gtk+ 4 status updatehistory 1998 — 1.0 really the gimp toolkit 1999 — 1.2 gobject 2002 — 2.0...
TRANSCRIPT
![Page 1: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/1.jpg)
GTK+ 4 Status UpdateMatthias Clasen
![Page 2: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/2.jpg)
History
1998 — 1.0
○ really the Gimp toolkit
1999 — 1.2
○ GObject
2002 — 2.0
○ Pango○ ATK○ cairo
2011 — 3.0
○ client-side windows○ client-side decorations○ CSS○ touch, gestures○ GL rendering○ broadway, wayland
![Page 3: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/3.jpg)
Present
3.22
○ the final, stable 3.x series
3.90 — since mid-2016
○ integrate GSK, fully GL/Vulkan based rendering○ build with meson○ modernize GDK APIs○ fully switch to event controllers○ composite widgets
4.0 — 2018 ?
![Page 4: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/4.jpg)
Drawing in GTK+ 3
Window
Button
Label: hello world
...
![Page 5: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/5.jpg)
Drawing in GTK+ 3
Window
Button
Label: hello world
...
Create a cairo surface
![Page 6: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/6.jpg)
Drawing in GTK+ 3
Call draw() on each widget...
Window
Button
Label: hello world
...
![Page 7: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/7.jpg)
Drawing in GTK+ 3
Call draw functions to render CSS background, border, shadow...
Window
Button
Label: hello world
...
![Page 8: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/8.jpg)
Drawing in GTK+ 3
Call Pango to render text...
Window
Button
Label: hello world
...
![Page 9: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/9.jpg)
Drawing in GTK+ 3
Window
Button
Label: hello world
...
Send the completed frame to the display server
![Page 10: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/10.jpg)
Drawing in GTK+ 4
Window
Button
Label: hello world
...
![Page 11: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/11.jpg)
Drawing in GTK+ 4
Call snapshot() on each widget to create render nodes...
Window
Button
Label: hello world
...
Container
Shadow Color
![Page 12: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/12.jpg)
Drawing in GTK+ 4
Create render nodes for CSS background, border, shadow...
Window
Button
Label: hello world
...
Container
Shadow Color
Clip Shadow Border
Container
![Page 13: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/13.jpg)
Drawing in GTK+ 4
Call snapshot functions to create render nodes for text
Window
Button
Label: hello world
...
Container
Shadow Color
Clip Shadow Border
Shadow Glyphs
Container
![Page 14: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/14.jpg)
Drawing in GTK+ 4
GSK translates render nodes into backend operations
Container
Shadow Color
Clip Shadow Border
Shadow Glyphs
Container
OpColor
OpLinearGradient
OpBorder
OpTexture
OpInsetShadow
OpText
⋮
![Page 15: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/15.jpg)
Drawing in GTK+ 4
Upload textures and use Pango to render glyphs
Container
Shadow Color
Clip Shadow Border
Shadow Glyphs
Container
OpColor
OpLinearGradient
OpBorder
OpTexture
OpInsetShadow
OpText
⋮
OpColor
OpLinearGradient
⋮
Texture
Glyph atlas
![Page 16: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/16.jpg)
Drawing in GTK+ 4
Send the render operations to the GPU
OpColor
OpLinearGradient
OpBorder
OpTexture
OpInsetShadow
OpText
⋮
OpColor
OpLinearGradient
⋮
![Page 17: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/17.jpg)
Render nodes in the Inspector
![Page 18: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/18.jpg)
Input in GTK+ 3
Window
Paned
Button
...
...
ButtonWindowX, Y
An event arrives
![Page 19: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/19.jpg)
Input in GTK+ 3
Window
Paned
Button
...
...
ButtonWindowX, Y
Route it by matching the window
Window
![Page 20: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/20.jpg)
Input in GTK+ 3
Window
Paned
Button
...
...
ButtonWindowX, Y
Emit event signals
::button-press-event
![Page 21: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/21.jpg)
Input in GTK+ 3
Window
Paned
Button
...
...
ButtonWindowX, Y
...and propagate up
::button-press-event
![Page 22: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/22.jpg)
Input in GTK+ 4
Window
Paned
Button
...
...
ButtonWindowX, Y
An event arrives
![Page 23: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/23.jpg)
Input in GTK+ 4
Window
Paned
Button
...
...
ButtonWindowX, Y
Route it by matching coordinates, top-down (capture)
![Page 24: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/24.jpg)
Input in GTK+ 4
Window
Paned
Button
...
...
ButtonWindowX, Y
...and back up (bubble)
![Page 25: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/25.jpg)
Input in GTK+ 4
Window
Paned
Button
...
...
ButtonWindowX, Y
Pass the event to event controllers at each step
controller1controller2...
![Page 26: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/26.jpg)
Composite Widgets in GTK+ 3
Custom drawing – not the CSS box modelCustom event handlingCode duplicationA spinbutton is an entry
![Page 27: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/27.jpg)
Composite Widgets in GTK+ 4
Any widget can have children
Widgets are close to CSS boxes
Composition instead of subclassing
A switch is composed of○ two labels○ a slider
A spinbutton has○ an entry○ two buttons
![Page 28: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/28.jpg)
What’s done
Vulkan renderer
GL renderer
New GDK apis
Event controllers
Composite widgets
![Page 29: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/29.jpg)
What’s left to do
Write cool examples
Complete API cleanups
Expose shaders for applications
Transformations for widgets
‘Complicated’ widgets: treeview, textview
![Page 30: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/30.jpg)
How you can help
Write cool examples
Port an application
Convert custom widgets to new APIs
Find what doesn’t work, or is too complicated
![Page 31: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/31.jpg)
Porting ?
Widgets are now visible by default
gtk_box_pack_start/end has less arguments
No more event->button
![Page 32: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/32.jpg)
Heroes of GTK+ 4
Benjamin Otte
Emmanuele Bassi
Timm Bäder
Carlos Garnacho
Jonas Ådahl
Daniel Boles
Alexander Larsson
Chun-wei Fan
Руслан Ижбулатов
![Page 33: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/33.jpg)
References
GTK+ 4 roadmap: https://wiki.gnome.org/Projects/GTK+/Roadmap/GTK4
GTK+ sources: https://git.gnome.org/browse/gtk+/
GTK+ blog: https://blog.gtk.org/
GTK+ docs, migration guide: https://developer.gnome.org/gtk4/
![Page 34: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/34.jpg)
Questions?
![Page 35: GTK+ 4 Status UpdateHistory 1998 — 1.0 really the Gimp toolkit 1999 — 1.2 GObject 2002 — 2.0 Pango ATK cairo 2011 — 3.0 client-side windows client-side decorationsPresent 3.22](https://reader033.vdocument.in/reader033/viewer/2022060916/60a95fc78acbe06f10530ad7/html5/thumbnails/35.jpg)
Thanks!