Compare commits

...

1330 Commits

Author SHA1 Message Date
Matthias Clasen
cbda61d3fb 4.1.2 2021-03-14 21:48:48 -04:00
Matthias Clasen
afe195a862 Update release script
With gi-docgen based docs, we can try to go back to
including the docs in the main release tarball.
2021-03-14 21:48:46 -04:00
Matthias Clasen
e6adee2403 Merge branch 'menubar-accel' into 'master'
window: Add a way to disable F10 shortcut

Closes #3727

See merge request GNOME/gtk!3296
2021-03-15 01:27:45 +00:00
Matthias Clasen
cfc91b62b0 window: Add a way to disable F10 shortcut
This is needed for terminal emulators.

Fixes: #3727
2021-03-14 19:47:06 -04:00
Matthias Clasen
24ec2cc6a6 Merge branch 'ngl-less-shaders' into 'master'
Assorted ngl improvements

See merge request GNOME/gtk!3295
2021-03-14 21:04:37 +00:00
Matthias Clasen
28de2eecc9 ngl: Special-case css backgrounds
Recognize a common pattern: A rounded clip with
a color node, followed by a border node, with the
same outline. This is what CSS backgrounds frequently
produce, and we can render it more efficiently with
a combined shader.
2021-03-14 16:49:31 -04:00
Matthias Clasen
ed3f0012b1 ngl: Don't bother with uniform border nodes
Now that colors aren't uniforms anymore, we don't
win much by using the inset_shadow shader. The fragment
shaders of inset_shadow and border are identical. And
the regular border setup does nine-slicing.
2021-03-14 16:49:31 -04:00
Matthias Clasen
51074ca5df ngl: Small shader improvements
Add a variant of gskSetOutputColor that saves a
few multiplications, and use it where possible.
2021-03-14 16:49:31 -04:00
Matthias Clasen
8aac574d63 ngl: Improve the coloring shader
Since we are now passing a float anyway, we can avoid
the branch in the fragment shader.
2021-03-14 16:49:31 -04:00
Matthias Clasen
c1f98d6837 ngl: Improve the gradient shaders
Use a define for MAX_COLOR_STOPS, and give the loop
a fixed limit.
2021-03-14 16:49:31 -04:00
Matthias Clasen
3f60c39de4 ngl: Rewrite gsk_ngl_render_job_visit_text_node
Make this more compact, and thus easier to read.
2021-03-14 16:49:31 -04:00
Matthias Clasen
4aa570ba88 ngl: Drop gsk_ngl_render_job_set_color
Colors are not state that we carry across draw ops,
so setting the color on the render job doesn't make
much sense. Instead, pass the color to the various
draw calls. Add a few new ones for that purpose.

Also, shorten the names of some by going from
'load_vertices_from_offscreen' to 'draw_offscreen'.
2021-03-14 16:49:31 -04:00
Matthias Clasen
233969e9e4 ngl: Refactor gsk_ngl_render_job_visit_border_node
With color sorting out of the picture, this can
be much simpler.
2021-03-14 16:49:31 -04:00
Matthias Clasen
19e3a6af5d ngl: Consistently use gsk_scaled_premultiply
Its not going to make much of a difference, but we
can just as well be consistent.
2021-03-14 16:49:31 -04:00
Matthias Clasen
29501f5398 ngl: Fix up uniform enums
This got messed up when color was changed from
a uniform to an attribute in 06d5c8e72d.
2021-03-14 16:49:31 -04:00
Jiri Grönroos
3408240ba6 Update Finnish translation
(cherry picked from commit f5a34b53af)
2021-03-14 17:03:07 +00:00
Guillaume Bernard
e6725aa16f Update French translation
(cherry picked from commit 21039681d6)
2021-03-14 13:38:24 +00:00
Piotr Drąg
f34c0f4a99 Update Polish translation 2021-03-14 13:30:26 +01:00
Marek Černocký
52c7fd166b Updated Czech translation 2021-03-14 09:28:17 +01:00
Matthias Clasen
346b29ad8f Merge branch 'gles-coloring' into 'master'
ngl: Fix the coloring shader on GLES 2.0

See merge request GNOME/gtk!3294
2021-03-13 22:27:04 +00:00
Emmanuel Gil Peyrot
064947356a ngl: Fix the coloring shader on GLES 2.0
Integer varyings didn’t exist in GLSL ES 1.00, neither did the flat
attribute.
2021-03-13 22:00:54 +00:00
Kjartan Maraas
d2258fb316 Update Norwegian Bokmål translation
(cherry picked from commit 70ee21db71)
2021-03-13 16:05:15 +00:00
Matthias Clasen
dda66d580f Merge branch 'ebassi/for-master' into 'master'
docs: Fix the dependencies links

See merge request GNOME/gtk!3284
2021-03-13 12:36:56 +00:00
Matthias Clasen
1d773df9f2 Merge branch 'ngl-textview-cursor' into 'master'
Ngl textview cursor

See merge request GNOME/gtk!3292
2021-03-13 12:33:15 +00:00
Matthias Clasen
9be2f130f0 textview: Fix blinking block cursors
When we have a block cursor, we need to discard the
cached node of the line containing the cursor, in order
to get a blinking cursor.
2021-03-12 21:50:07 -05:00
Matthias Clasen
e345f9a4db textview: Fix blinking block cursors
When we have a block cursor, we need to discard the
cached node of the line containing the cursor, in order
to get a blinking cursor.
2021-03-12 19:44:31 -05:00
Matthias Clasen
3a928c8980 textlayout: Render cursors at the end
Don't place the insertion cursor render nodes in the
middle of the text nodes for all the text. This helps
the renderer batching the text draw calls together.
2021-03-12 19:28:36 -05:00
Matthias Clasen
42dfc21b2d ngl: Fix up some debug printouts 2021-03-12 18:26:15 -05:00
Matthias Clasen
daed57c30e Merge branch 'wip/chergert/fewer-uniforms' into 'master'
ngl: apply fewer uniforms

See merge request GNOME/gtk!3289
2021-03-12 22:55:00 +00:00
Matthias Clasen
de0860c1bf Merge branch 'pgriffis/readme-fixes' into 'master'
readme: Fix broken doc links

See merge request GNOME/gtk!3291
2021-03-12 22:51:16 +00:00
Patrick Griffis
4fbc63f50a readme: Fix broken doc links 2021-03-12 22:02:55 +00:00
Matthias Clasen
3e1524fade Merge branch 'ngl-vertex-attributes' into 'master'
Ngl vertex attributes

See merge request GNOME/gtk!3290
2021-03-12 21:26:52 +00:00
Matthias Clasen
ebe30d851b ngl: Identify shaders
Add a comment with a name to each shader. That makes
identifying the shaders in apitrace much easier.
2021-03-12 15:35:40 -05:00
Christian Hergert
f97ce21e59 ngl: reintroduce comparison checks
This reduces how many changes we make when recording uniform state, which
increases the chances that the data offset will be the same when applying
uniforms.
2021-03-12 11:47:15 -08:00
Christian Hergert
0b7d8e19c3 ngl: add front cache to reduce uniform changes
Since we make full snapshots when recording uniform state of batches, we
need to perform some deduplication to avoid so many repeated uniform calls.

This uses a closed hashtable to determine if we are likely changing the
value to something new.

This does not currently compare values, it instead only compares that we
are going to point at a new offset into the uniform buffer. We could go
further if we compare upon updating values (we did that early on in the
prototype) so that offsets are less likely to be changed.
2021-03-12 11:22:59 -08:00
Matthias Clasen
0ee6868b7f gtk-demo: Add a test for scrolling with Emoji
Make a text with lots of Emoji and text. This
is exercising the GL renderers switching between
different shaders for color and plain glyphs.
2021-03-12 13:19:37 -05:00
Matthias Clasen
6a30c6b01c ngl: Make the coloring shader more versatile
When the color passed is transparent black, use
the color from the texture as source, instead of
as mask. This lets use use the coloring program
both for regular and color glyphs, avoiding
program changes in text with Emoji.
2021-03-12 13:19:37 -05:00
Matthias Clasen
06d5c8e72d ngl: Set color as vertex attribute
Instead of using uniforms for color used in multiple
programs, pass it as vertex attributes. This will let
us batch more draw calls, since we don't have to change
uniforms so often. In particular, for syntax-highlighted
text.
2021-03-12 13:18:47 -05:00
Matthias Clasen
3252f1e301 gsk: Give ngl its own shader sources
We may want to change the interface between the
shaders and the renderer for ngl, and therefore,
sharing the shaders between gl and ngl will not
be practical, going forward.
2021-03-12 13:18:47 -05:00
Matthias Clasen
7f292d34bd Merge branch 'fix-3704' into 'master'
gdksurface-win32.c: Fix window menu positioning (issue #3704)

Closes #3704

See merge request GNOME/gtk!3286
2021-03-12 14:06:33 +00:00
Emmanuele Bassi
7c29847fbf build: Install the API references
We are building them, but not installing them.
2021-03-12 11:32:09 +00:00
Emmanuele Bassi
66f0547ebf docs: Fix the dependencies links
Use the GitLab pages location until we can link to a proper space on
developer.gnome.org.
2021-03-12 11:18:37 +00:00
Chun-wei Fan
e941e2be7d gdksurface-win32.c: Fix window menu positioning
We ought to get the coordinates of where the window menu should be
displayed using gdk_win32_surface_get_root_coords(), instead of rounding
the position that we obtained with gdk_event_get_position().

Also rename items a bit in the same function, and call
gdk_event_get_event_type() for consistency with the other backends.

Fixes issue #3704.
2021-03-12 18:45:43 +08:00
Changwoo Ryu
28e33bc26c Update Korean translation
(cherry picked from commit 7774d5d85e)
2021-03-12 08:51:03 +00:00
Emmanuele Bassi
372513a5e2 Merge branch 'bilelmoussaoui/shortcuts-annotation' into 'master'
g-i: fix gtk_shortcut_label_new annotation

See merge request GNOME/gtk!3285
2021-03-11 18:40:32 +00:00
Bilal Elmoussaoui
5c505aefc4 g-i: fix gtk_shortcut_label_new annotation 2021-03-11 18:21:56 +00:00
Emmanuele Bassi
9b3ca7f6b1 Merge branch 'ebassi/gidocgen' into 'master'
Move API reference to gi-docgen

See merge request GNOME/gtk!3222
2021-03-11 17:11:57 +00:00
Emmanuele Bassi
c5ddf5b381 docs: Add URL maps for cross links 2021-03-11 16:46:02 +00:00
Emmanuele Bassi
61712bfb3b docs: Enable search 2021-03-11 16:37:38 +00:00
Emmanuele Bassi
c3eb3f2943 docs: Update the "running GTK apps" section
Style the content a bit better, and use the appropriate links.
2021-03-11 16:37:38 +00:00
Matthias Clasen
d13e592dbf Small updates to the coding and documentation style
Mention summary sentences, and a few other things.
2021-03-11 16:37:38 +00:00
Emmanuele Bassi
686f65f267 build: Add missing variable definition 2021-03-11 16:37:38 +00:00
Emmanuele Bassi
bb2ee71cd8 build: Add a GIR dependency to PangoCairo
This is not strictly needed from an introspection perspective, but:

 - GTK strictly depends on PangoCairo internally
 - we want to integrate the GDK docs with PangoCairo's

So even though we don't have an explicit dependency on PangoCairo types
in our ABI, we do assume that people will be able to use the PangoCairo
API with GTK.
2021-03-11 16:37:38 +00:00
Emmanuele Bassi
816383e9ef Handle static inline GtkOrdering function
The introspection scanner does not handle `static inline` functions:
they are not in the shared library, so cannot be dlsym() out of it; and
the `static` keyword tells g-ir-scanner to skip the function declaration
entirely.

We can trick the scanner into thinking the gtk_ordering_from_cmpfunc()
symbol is a real, public one, by declaring and defining a regular
function under the `__GI_SCANNER__` guard; the symbol does not appear
when actually building GTK, or any code using GTK, so we don't risk
collisions.
2021-03-11 16:37:38 +00:00
Emmanuele Bassi
90cf6bb686 docs: Show class hierarchy in the API references 2021-03-11 16:37:38 +00:00
Matthias Clasen
e930433800 label: Fix some external links
I had put in a bunch of [class@Pango.Attribute],
but it needs to be [struct@Pango.Attribute].

Know your dependencies` type hierarchy!
2021-03-11 16:37:38 +00:00
Matthias Clasen
a6b2994f8b text: Fix some copy-paste mishap
A bunch of occurrances of "the self" looked like
absurdist short fiction:

"...the self scrolled off the screen to the left"
2021-03-11 16:37:38 +00:00
Matthias Clasen
8d7103116a widget: Fix up some links
Fix up some links to vfuncs and to sections, as well as class methods.
2021-03-11 16:37:38 +00:00
Matthias Clasen
9d95c5a26d shortcuttrigger: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
9fbe61e01f shortcutlabel: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
7c442c1736 shortcutcontroller: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
48a3b4e7cd shortcutaction: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
90ecf58a9c shortcut: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
0a966e59e6 sizegroup: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
acb78afc2d testutils: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
d0ed62e747 snapshot: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
44e977ef35 tooltip: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
f93f975e42 settings: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
9fa8b446cc recentmanager: Convert docs 2021-03-11 16:37:38 +00:00
Matthias Clasen
e065b28d1a mountoperation: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
6108759d63 menutrackeritem: Remove SECTION
This is private
2021-03-11 16:37:37 +00:00
Matthias Clasen
4e315b81cc menutracker: Remove SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
802c976d07 treesortable: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
a5018ed029 treeselection: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
1a09c361f5 treemodelsort: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
58f64c85ca treemodelfilter: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
9a6886e5e2 treemodel: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
deef6425b3 treednd: Add summaries 2021-03-11 16:37:37 +00:00
Matthias Clasen
9e3df3fac1 treestore: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
03e21fc957 liststore: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
3ed729e1d7 treeviewcolumn: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
1cde6a2e08 treeview: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
f937fe4a87 windowgroup: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
190292a7da listbox: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
86d2a44850 iconview: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
ef429c587b constraintsolver: Remove SECTION
This is private
2021-03-11 16:37:37 +00:00
Matthias Clasen
f9cb67b32c cellview: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
f6932b885d cellrenderertoggle: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
b1ba7f4380 cellrenderertext: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
2eae3e8e78 cellrendererspinner: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
077fe55d81 cellrendererspin: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
e92e14c845 cellrendererprogress: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
8b7f39ead8 cellrendererpixbuf: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
48a94ccbfc celleditable: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
a9b163cd7f cellrenderercombo: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
3236b1d1c9 cellrendereraccel: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
d85fa8854e cellrenderer: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
522ae8d02f celllayout: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
7173223df5 cellareacontext: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
186d2c2964 cellareabox: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
ccb40688ec cellarea: Add a summary 2021-03-11 16:37:37 +00:00
Matthias Clasen
8d888203f0 actionobserver: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
a63223b25b actionobservable: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
3cccb00f51 actionmuxer: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
cc0df3c315 accessiblevalue: Drop SECTION
This is private.
2021-03-11 16:37:37 +00:00
Matthias Clasen
7b08e9b5d3 cssdataurl: Drop SECTION
This is private
2021-03-11 16:37:37 +00:00
Matthias Clasen
b019cabd0c bloomfilter: Drop the SECTION
This is private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
260a4db854 accelgroup: Convert docs
Drop an unused SECTION, and convert links.
2021-03-11 16:37:37 +00:00
Matthias Clasen
8497f285c4 scrollbar: Tweak docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
6925843221 placesview: Remove SECTION
Its private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
a6a7799dc5 placessidebar: Remove SECTION
Its private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
3205cc79a7 modelbutton: Remove SECTION
Its private, no need.
2021-03-11 16:37:37 +00:00
Matthias Clasen
71fce93088 filechooserwidget: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
537d6e5e65 treelistmodel: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
d0b1e2f7de treeexpander: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
eb675e3e7e shortcuttrigger: Tweak docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
3f201aeb21 selectionmodel: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
da6b6d44c1 multiselection: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
b873b83691 listlistmodel: Remove SECTION
Private, no point.
2021-03-11 16:37:37 +00:00
Matthias Clasen
19f649ec1d noselection: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
a786af0c19 selectionfiltermodel: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
42e9cf88cf immulticontext: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
33d7aff67e imcontextsimple: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
4e4050813a gestureswipe: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
2d55e3343a papersize: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
8d8fd63b93 gesturestylus: Convert docs 2021-03-11 16:37:37 +00:00
Matthias Clasen
e2cab4d406 imcontext: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
3eeaef0834 widgetpaintable: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
4921497904 singleselection: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
71ce79bfb8 slicelistmodel: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
c76bd17ddd gesturesingle: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ecd8d7596b maplistmodel: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
97fd0fe889 scrollable: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
96fe1218f2 overlaylayout: Add docs for GtkOverlayLayoutChild 2021-03-11 16:37:36 +00:00
Matthias Clasen
14c45be89c gesturerotate: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d5d0cf61b9 padcontroller: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
7606329617 gesturezoom: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
7a1da45fff mediafile: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
4905f5e722 mediastream: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ca3363466f gesturepan: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
207c4cd9e1 propertylookuplistmodel: Remove SECTION
This is private, no need.
2021-03-11 16:37:36 +00:00
Matthias Clasen
6221d1b407 version: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f6ff03bf09 viewport: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ae315c1106 stringlist: Add docs to GtkStringObject 2021-03-11 16:37:36 +00:00
Matthias Clasen
8164cbbc5f listbase: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
2d76ce829c gesturelongpress: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
e604c3b77c gesturedrag: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d4f2121bc2 infobar: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f328e5ecc1 gestureclick: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
19df22f784 icontheme: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
3556b605c9 gesture: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
c26ac6b695 flowbox: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
9f08c50791 flattenlistmodel: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
95b2107728 filefilter: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
2915c72a26 eventcontrollerscroll: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
207a45b7e0 eventcontrollermotion: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
32b3386d23 eventcontrollerlegacy: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
094d5d5260 eventcontrollerkey: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
8b26894759 eventcontrollerfocus: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f4ad0f32f8 expander: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
ca74f46b3e spinner: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d7e0af62e3 eventcontroller: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
21f2a824ad entrycompletion: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
6bd46779fc editable: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
b3f6e95d62 droptargetasync: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
39dac1ff22 droptarget: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
30236be2fd dragsource: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
a9d4b6a61c dragicon: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
c1e10473fb builder: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
e8bba52190 border: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
1a504feab9 accessible: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
406e4a6928 csssection: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
f89e1bce90 csslocation: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d1b472c1c8 windowcontrols: Tweak docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
cabe2f5f20 treelistrowsorter: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
970ae74cd5 texttag: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
50139ad184 textview: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
d74666de58 texttagtable: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
e0df1b3fd9 textmark: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
bf978ba5a6 textiter: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
05b13dca55 textchild: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
720f6e7a17 textbuffer: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
71649fce29 text: Convert docs 2021-03-11 16:37:36 +00:00
Matthias Clasen
42aa2edf19 styleprovider: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
b66c74767f stylecontext: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
39394da850 stringsorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
da9a320a40 sortlistmodel: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5bdcd66117 sorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
930912fd0d revealer: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5ebd0edf72 numericsorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
dda6458142 multisorter: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5568025f1d listview: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5189d3b485 listitem: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
901f60bc54 gridview: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
9f90100019 fixedlayout: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
8db6d6750c fixed: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
36f6a76272 filterlistmodel: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
8696b78e59 expression: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
493d773c18 enums: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
9247460c2f entrybuffer: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
ebadece27b dropcontrollermotion: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
f4b498031a dragsource: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
eb77ff9696 dragicon: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
c11ec03642 directorylist: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
7744be938f customsorter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
646a6726a8 customlayout: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
460955d578 cssprovider: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
2e1114c9fa customfilter: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
a814c3b3c4 constraintlayout: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
5e41ea1d2f constraintguide: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
350a775963 Constraint: Tweak docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
c0da6b935d columnviewcolumn: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
a9162d2218 columnview: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
102884faf1 docs: Remove anchors from list overview
Our markdown doesn't support this.
2021-03-11 16:37:35 +00:00
Matthias Clasen
497a399372 windowcontrols: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
292643890b window: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
c46480fe7e textview: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
29f2e5f84e switch: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
9ab40d2899 stringlist: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
cc03ca9df1 spinbutton: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
bcb0b36238 searchentry: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
7e7c81c5d2 searchbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
d7ce5c55c8 scrollbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
59c0bee4b8 scalebutton: Convert docs 2021-03-11 16:37:35 +00:00
Matthias Clasen
33f611a596 scale: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
495c3d9c44 progressbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
b4ad1fa44f popovermenubar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
b093900e48 popover: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
27b338a90b passwordentry: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
ca51d6dfd9 paned: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
47c1b50eba cursor: Use a table for cursor names
This gets all the names into view at the same time.
2021-03-11 16:37:35 +00:00
Matthias Clasen
5d68a23b55 menubutton: Put images in a table 2021-03-11 16:37:35 +00:00
Matthias Clasen
9f6e4e60d0 label: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
7a60c66940 headerbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
31245353d5 frame: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
c91e141a6c fontbutton: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
87c0363cd5 expander: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
71bad39f5a entry: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
40574f9ca3 emojichooser: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
752477b1ae editablelabel: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
ad9849bf26 dropdown: Small doc tweak 2021-03-11 16:37:35 +00:00
Matthias Clasen
9bfe163cf1 comboboxtext: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
22f072faea combobox: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
57c7d77cdf colorbutton: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
7ac7bb9543 checkbutton: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
c82b5b8d8a centerbox: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
15aa7de547 calendar: Use markdown for css tree 2021-03-11 16:37:34 +00:00
Matthias Clasen
ee62d19115 button: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
cdcabb7fb7 atcontext: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
494bdad887 contentprovider: Convert some more markup 2021-03-11 16:37:34 +00:00
Matthias Clasen
ef09696ee5 stringfilter: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
8da60587e1 stackswitcher: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
3a7e9a28d3 stacksidebar: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
3535b582a1 stack: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
07573ef2a6 overlaylayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
92838f9972 printdialog: Add an example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
ca5f66b368 multifilter: Docs tweaks. 2021-03-11 16:37:34 +00:00
Matthias Clasen
af6af482c4 pagesetupdialog: Add an example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
c65239155f notebook: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
12f0d963d9 levelbar: Docs tweaks 2021-03-11 16:37:34 +00:00
Matthias Clasen
6ab8ca4669 headerbar: Add example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
d65a98f828 gridlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
79417d8d40 centerlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
8bdb2ea667 overlay: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
8e887fbbf4 listitemfactory: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
dc42dcf962 signallistitemfactory: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
68cd66b210 builderlistitemfactory: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
39a9bea066 builderscope: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
0776f645fd builder: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
b408dc0706 boxlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
626ee40970 boolfilter: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
f86c8f2077 bookmarklist: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
1a501e3d53 binlayout: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
c611fcc709 assistant: Small doc tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
de1101df19 aspectframe: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
aca07954af applicationwindow: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
06a51c045c application: Tweak docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
7f7231038d adjustment: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
fd6faabe16 actionable: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
26ca77d01b aboutdialog: Small docs tweak 2021-03-11 16:37:34 +00:00
Matthias Clasen
b983133675 Include low-level printing in the gir
We add the sources, but not the headers. Oops.
2021-03-11 16:37:34 +00:00
Matthias Clasen
02fc352bfb windowhandle: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
180de1041b shortcutmanager: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
ded9903a83 root: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
921e8e02f4 printoperationpreview: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
9d536b9aef printunixdialog: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
d11b263ac2 printsettings: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
a710e64bad printeroperation: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
b257a58417 printjob: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
eca14b763c printer: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
5225a0f253 printcontext: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
60b3effce3 pagesetupdialog: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
b3e7e31bb0 pagesetup: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
3ab954882d layoutmanager: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
7dd436ab17 filter: Add sections for AnyFilter and EveryFilter 2021-03-11 16:37:34 +00:00
Matthias Clasen
085b0b7c08 adjustment: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
76fa6dcef6 shortcutmanager: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
dde3de34c9 popovermenubar: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
e88f0d4b77 popovermenu: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
172ab2f20a native: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
0ca97cd218 emojichooser: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
645c951fb6 mediacontrols: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
4bed24a816 windowcontrols: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
9104420c87 shortcutswindow: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
0d238f4c99 range: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
9b9c9ae8d4 popover: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
1f06cfd5d8 headerbar: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
ddcb76ac2d appchooserwidget: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
e21156b30b appchooserdialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
166edeed91 appchooser: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
465aca029e Add some more widgets to the gallery
We already have images for menus, menubars and emoji chooser.
Use them.
2021-03-11 16:37:33 +00:00
Matthias Clasen
86604d8e01 nativedialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
bb393f6496 fontchooserwidget: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
7a099604c9 fontchooserdialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
92009413f2 fontchooser: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
7763fc55bb filechoosernative: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
042af94048 filechooserdialog: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
d91fb26409 filechooser: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
3124a784fe searchbar: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
936a2c2c59 colorchooserdialog: Fixup 2021-03-11 16:37:33 +00:00
Matthias Clasen
53d3b46d4a actionbar: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
fc55478890 paned: Convert docs
Convert links, add example image, clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
d41c3e3c2d colorchooser: Convert docs
Convert link syntax.
2021-03-11 16:37:33 +00:00
Matthias Clasen
886ba1680d colorchooserwidget: Convert docs
Convert links, and clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
11c5523142 colorchooserdialog: Convert docs
Convert link syntax, add example image, clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
c0be9c5b97 colorbutton: Small doc tweaks 2021-03-11 16:37:33 +00:00
Matthias Clasen
ad2dad6612 assistant: Convert docs
Convert link syntax, an example image, clean things up.
2021-03-11 16:37:33 +00:00
Matthias Clasen
5950bcd754 frame: Convert docs
Convert link syntax, add an example image, add property
annotations.
2021-03-11 16:37:33 +00:00
Matthias Clasen
067b43fb5b aboutdialog: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
b39160243f aboutdialog: Improve example image
Use our logo, and update the copyright years.
2021-03-11 16:37:33 +00:00
Matthias Clasen
b460ffd120 dialog: Convert docs
Convert links, add an example image, generally clean up docs.
2021-03-11 16:37:33 +00:00
Matthias Clasen
a61c677a0d docs: Add dialogs to the gallery 2021-03-11 16:37:33 +00:00
Matthias Clasen
7afc1291a8 window: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
cc2d9f0cb5 scrollable: Convert docs
Convert link format, add property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
73b66428a7 viewport: Convert docs
Convert link format, add property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
3a62b28344 scrolledwindow: Convert docs
Convert link format, add property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
f3b16d0e9d messagedialog: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
e999773566 grid: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
6aaa98f669 expander: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
f800178e7f centerbox: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
07a2b60f45 box: Convert docs
Convert link format, add an example image, add
property annotations. General cleanup.
2021-03-11 16:37:33 +00:00
Matthias Clasen
f5fe5c1fa6 appchooserbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
e353cf38ec colorbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
947ebee7d4 dropdown: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
d4eb11142a fontbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
e4054d62fe switch: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
37855e2b53 spinbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
08371b25dc menubutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
26100ad5d1 lockbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
69427e98d5 editablelabel: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
d3e8607f58 combobox: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
cf6f57b41c passwordentry: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
d5a024c7f8 linkbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
67fdc0491a checkbutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
5d69584a53 togglebutton: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
ef5b781e0c entry: Minor docs fixes 2021-03-11 16:37:33 +00:00
Matthias Clasen
72505acb9e searchentry: Minor docs tweaks 2021-03-11 16:37:33 +00:00
Matthias Clasen
d7b55cfd0c editable: Convert docs 2021-03-11 16:37:33 +00:00
Matthias Clasen
7803a09f31 entry: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Emmanuele Bassi
4f36509e5f Mark padding fields as private
And mention that they should be removed in the next version of GTK.
Padding fields in interfaces are unnecessary, as they don't contribute
to the ABI.
2021-03-11 16:37:33 +00:00
Emmanuele Bassi
198c0be5e7 flowbow: Mark private fields as private 2021-03-11 16:37:33 +00:00
Matthias Clasen
c0bd352c88 scale: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
3a62913a97 entry: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:33 +00:00
Matthias Clasen
abb951daf1 button: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Matthias Clasen
4131cb4c7b bitset: Convert docs 2021-03-11 16:37:32 +00:00
Matthias Clasen
7450427757 gsktransform: Convert docs 2021-03-11 16:37:32 +00:00
Matthias Clasen
b836707979 gskroundedrect: Convert docs 2021-03-11 16:37:32 +00:00
Matthias Clasen
70f805cdfe rendernode: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Matthias Clasen
458bc5500c gskrenderer: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Matthias Clasen
22b375534e glshader: Add property annotations
Connect properties, getters, and setters with annotations
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
e60afc6011 docs: Remove stray backtick 2021-03-11 16:37:32 +00:00
Matthias Clasen
30073de932 widget: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
b674bba155 video: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
50df5e0ec2 textview: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
693f3d6b41 separator: Add property annotations
Connect properties, getters, and setters with annotations.t
2021-03-11 16:37:32 +00:00
Matthias Clasen
e78302c4e5 scrollbar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
0559e9e763 scale: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
8eacbc3a20 picture: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
3fd3187d8f orientable: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
723d979be2 infobar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
0c56522de1 image: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
8db308be4d glarea: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
30d32a1f9d drawingarea: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
08509acc04 claendar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
6ff78c99fa accessible: Annotate properties 2021-03-11 16:37:32 +00:00
Matthias Clasen
34443546a8 visual index: Reorder some widgets
This improves the alignment a bit.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d5e9e10d0a toplevel: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d262f740b2 texture: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d886ab9229 surface: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
6be66205cc seat: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
abb6fe326f popup: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d6c763f2ae monitor: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
34533b544a glcontext: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d92647a92b drop: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
553a959102 drawcontext: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
9a33a1852a drag: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
ce83a0e5bb displaymanager: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
d724ea294d display: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
038006d582 devicetool: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
4a4301be38 device: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
50fe533246 cursor: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
11022fc485 contentprovider: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
c51585bab1 clipboard: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
701ebd55c7 applaunchcontext: Add property annotations
Connect properties and getters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
4c50c312c1 statusbar: Remove SECTION 2021-03-11 16:37:32 +00:00
Matthias Clasen
55f1ed171a infobar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
97c4e46e39 progressbar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
3ed2e94f29 levelbar: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
e98ea46d87 spinner: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Matthias Clasen
a8a15d48ad label: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
6bc69a12cc docs: Update the documentation style guide 2021-03-11 16:37:32 +00:00
Emmanuele Bassi
c6b23f8f89 constraint: Port to the new docs format
- Drop the "SECTION".
 - Add attributes annotations for properties and getter methods.
 - Remove excessive linking and redundant types
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
be93dd98f7 Hide GtkSettingsValue
This is a private type that has no public API, and no business being in
a public header.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
a8f36b8381 Hide GtkTextBTree's typedef
It's a private type, and has no business in a public header.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
1fb5824e1e treemodel: Update the description format
Also add a description for GtkTreePath.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
35e438a62e treeview: Update the description format 2021-03-11 16:37:32 +00:00
Emmanuele Bassi
cf707cbfaa expression: Update docs format
And add documentation stanzas for GtkExpression sub-types.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
1eb9d699b5 Box GtkExpressionWatch
Otherwise bindings won't know how to deal with memory management.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
da94b461e0 csssection: Update docs syntax 2021-03-11 16:37:32 +00:00
Emmanuele Bassi
ec32ff04b8 application: Convert docs
Drop mentions of command line arguments parsed by gtk_init(), and of the
GDK lock.
2021-03-11 16:37:32 +00:00
Emmanuele Bassi
8d12dce174 docs: Fix property annotation 2021-03-11 16:37:32 +00:00
Matthias Clasen
63dc97fb29 spinbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
6c315b1b8a searchentry: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
231a19abb9 passwordentry: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
99a3dbef00 editablelabel: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
9934f9c43b constrainttarget: Convert docs 2021-03-11 16:37:31 +00:00
Matthias Clasen
c4e43c1cd5 buildable: Convert docs
Change link syntax.
2021-03-11 16:37:31 +00:00
Matthias Clasen
3549914d0f accessible: Convert docs
Change link syntax.
2021-03-11 16:37:31 +00:00
Matthias Clasen
e034046724 widget: Convert docs
Some work toward converting the docs to markdown.

More work needed, in particular around vfuncs and
class functions.
2021-03-11 16:37:31 +00:00
Matthias Clasen
c975216f47 entry: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
18e5192a58 switch: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
dc8ee5a992 volumebutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
e75c3d0380 fontbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
47cb0771f5 colorbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
6884a1a5c6 dropdown: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
d028f7ed9a appchooserbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
fc6f16cb61 lockbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
1692b41b30 comboboxtext: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
8e6b6ae26e combobox: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
9a16b1b971 docs: Remove duplicate documentation stanzas 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
895aa1d3ab docs: Fix typos 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
da6861188b docs: Fix value annotation
Drop the `:`.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
1dd240974b docs: Fix copy-paste error in GdkDevice 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
b6b30c9bcf docs: Fix the MenuButton direction property links 2021-03-11 16:37:31 +00:00
Matthias Clasen
47b9a554ac menubutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
3d8c810ab7 checkbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
dfb68fb13d docs: Split images for check and radio buttons
Its the same widget, but two images fit better in the gallery,
and will be easier to use as example images in the docs.
2021-03-11 16:37:31 +00:00
Matthias Clasen
f854136676 linkbutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
18f525f7b4 docs: Improve the togglebutton image
Make it actually show toggles.
2021-03-11 16:37:31 +00:00
Matthias Clasen
4ee4c88e43 wayland: Fix a link
gi-docgen currently can't handle links without namespace
in the Wayland docs.
2021-03-11 16:37:31 +00:00
Matthias Clasen
ec78bf3309 togglebutton: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Matthias Clasen
4bf7bfb41a button: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
538f935d44 docs: Fix the annotation for GtkTextView:justification 2021-03-11 16:37:31 +00:00
Emmanuele Bassi
952fc31dbc docs: Fix up the 3-to-4 migration guide 2021-03-11 16:37:31 +00:00
Matthias Clasen
93326164e2 docs: Add backend links to the gdk docs
These are placeholders for when we know how to
link across namespaces.
2021-03-11 16:37:31 +00:00
Matthias Clasen
b78895e449 docs: Add separate toml files for gdk backends
Reusing the same one duplicates the standalone
docs, which doesn't quite seem right.
2021-03-11 16:37:31 +00:00
Matthias Clasen
205a13eaa0 docs: Brush up the Wayland backend docs
Add some content here.
2021-03-11 16:37:31 +00:00
Matthias Clasen
a9dd352986 gdk: Some more tweaks of the docs 2021-03-11 16:37:31 +00:00
Matthias Clasen
e82d090bf5 docs: Add some links to the pango chapter 2021-03-11 16:37:31 +00:00
Matthias Clasen
9132f1831c docs: Rework the gdk docs
Convert links, make things more concise.
2021-03-11 16:37:31 +00:00
Matthias Clasen
3d04c0f4be docs: Move GdkEvent docs inline
This is not really worth a chapter of its own.
2021-03-11 16:37:31 +00:00
Matthias Clasen
ca3120919f docs: Improve gsk docs
Convert link formats, add summaries, and make
a few missing things show up in the docs.
2021-03-11 16:37:31 +00:00
Matthias Clasen
e5bed812f5 docs: Tweak X11 section
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
d88a4629f9 docs: Tweaks Windows section
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
24c04b5bb9 docs: Tweak Wayland section
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
4c3ea25745 docs: Tweak a11y section
Convert link syntax.
2021-03-11 16:37:31 +00:00
Matthias Clasen
231814a595 docs: Tweak running chapter
Remove unsupported heading anchors, fix definition
list use.
2021-03-11 16:37:31 +00:00
Matthias Clasen
820f37be0b docs: Tweak input overview
Remove unsupported heading anchors.
2021-03-11 16:37:31 +00:00
Matthias Clasen
02ec00dc5a docs: Tweak drawing model overview
Fix link syntax, remove gtk-doc markup.
2021-03-11 16:37:30 +00:00
Matthias Clasen
4d2e4309f0 docs: Tweak css properties section
Fix the use of definition lists.
2021-03-11 16:37:30 +00:00
Matthias Clasen
d2ba09ec98 docs: Tweak the actions overview
Fix use of definition lists, and remove some gtk-doc
markup.
2021-03-11 16:37:30 +00:00
Matthias Clasen
41ddce152a building: Minor tweaks
Remove unsupported anchors from headings.
2021-03-11 16:37:30 +00:00
Matthias Clasen
df9c469acd video: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
8cf04b3345 glarea: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
1072b56970 drawingarea: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
f94fc28eb5 textview: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
3b42440805 picture: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
dcf53bced2 scale: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
76e9a7bbb4 image: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
12ccc68c99 separator: Convert docs
Change link syntax and add an example image.
2021-03-11 16:37:30 +00:00
Matthias Clasen
834295dde0 calendar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
b7f4f5d234 scrollbar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
61d85f32a2 infobar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6d489a9e81 docs: Generate the DevHelp file for our namespaces 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
85774d2bcd docs: Update the "Getting Started" page
Drop the Pandoc stuff, add the gi-docgen links, and remove a stray
docbook element.
2021-03-11 16:37:30 +00:00
Matthias Clasen
03c5b680ec statusbar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
8de0a2c7c6 infobar: Convert docs
Change link syntax, add an example image, generally clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
d58655b4ae progressbar: Convert docs
Change link syntax, add an example image, generally clean
things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
f2b482ef65 levelbar: Convert docs
Change link syntax, add an example image, generally
clean things up.
2021-03-11 16:37:30 +00:00
Matthias Clasen
a2e8bd24ca spinner: Convert docs
Change link syntax and add an example image.
2021-03-11 16:37:30 +00:00
Matthias Clasen
584e978840 aboutdialog: tweak the docs
Add a short summary.
2021-03-11 16:37:30 +00:00
Matthias Clasen
f00f900224 label: Convert docs
Change link syntax, add singl-line summaries,
add missing property docs.
2021-03-11 16:37:30 +00:00
Matthias Clasen
b9a02b0c24 docs: Bring the widget gallery back
We have all the images, lets put them to use.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
af8d8113eb docs: Remove the last few remaining '+' from GTK 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
e8b6e6cad0 docs: Clean up the first paragraph for various symbols
The documentation engine will use the first paragraph as the summary for
a type or constant.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
701f1b837b docs: Show summary in the namespace index 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6781de96a5 docs: Start porting GtkImage to the new style 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
4fef62c38d docs: Port GtkAboutDialog to the new syntax
We should also clean up the annotations, while we're at it.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
3ef95b4065 build: Quiet down gi-docgen
We are only interested in the warnings and errors.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
d621a37a60 docs: Fix up the style of the X11 content file 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6f93e63d21 docs: Move detached sections into their own content file 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
04fb95ce9f docs: Split GdkDrag and GdkDrop sections
This way we have a section for each class.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
548280da9f docs: Rename GdkTexture section
The name needs to match the class.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
b9f0cf1c8b docs: Move gdkcairo section to an external file 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
abb33bd65f docs: Move the gtkmain section to its own document
The introspection data does not handle unattached sections like gtk-doc
does, so we need to move what was gtkmain into its own Markdown
document.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
542b959933 docs: Use new link syntax 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
b2a99642a9 docs: Begin porting GtkWidget to the new format 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
6f7e933713 doc: Port GtkConstraint to the new format 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
3c0f047597 docs: De-indent GtkRecentInfo.get_applications() return value
Otherwise the four spaces will be treated as a pre-formatted block by
Markdown.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
a6da2db4ea docs: Start porting GtkConstraintLayout to the new doc format
Drop the old gtk-doc'isms, and use the gi-docgen links instead.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
f85b847410 docs: Add metadata preamble to GTK's content files 2021-03-11 16:37:30 +00:00
Emmanuele Bassi
a6ee0dd8aa docs: Drop gtk-doc files
We don't use gtk-doc to generate our API reference, so we don't need its
files lying around any more.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
0ba2a3a191 Generate GTK API reference(s) with gi-docgen
Stop using gtk-doc, and switch to gi-docgen.

The gi-docgen tool generates API references through the introspection
data, which has various benefits:

 - it does not parse C code
 - it does not generate and run C code to introspect types at build time
 - it does not present a different API from the one we're exporting

Additionally, gi-docgen:

 - does not generate DocBook XML in order to generate HTML
 - does not go through xsltproc
 - parses proper Markdown

Which makes it markedly faster than gtk-doc has ever been.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
761c327ac5 Add gi-docgen as a subproject
While we're developing gi-docgen it's better to have it as part of our
build.
2021-03-11 16:37:30 +00:00
Emmanuele Bassi
3760051169 ci: Update the fedora-docs Docker image
Use the latest base image.
2021-03-11 16:37:29 +00:00
Emmanuele Bassi
787830d360 ci: Update the CI image for docs building
We don't use Pandoc any more, but we need a bunch of Python modules for
gi-docgen.
2021-03-11 16:37:29 +00:00
Emmanuele Bassi
4018417ceb ci: Update the reference job 2021-03-11 16:37:29 +00:00
Emmanuele Bassi
386256a424 Rename base version argument in run-docker.sh
The `--base-version` argument trips up everyone. Might as well rename it
to `--version`.
2021-03-11 16:37:29 +00:00
Matthias Clasen
f3701ff961 Merge branch 'fix-menubutton-tooltips' into 'master'
Limit tooltip queries to the same native

Closes #3719

See merge request GNOME/gtk!3283
2021-03-11 14:25:53 +00:00
Matthias Clasen
27295bc555 Limit tooltip queries to the same native
Without this, the menubuttons tooltip pops up
when hovering the popover, which is suprising
and unintended.

Fixes: #3719
2021-03-11 08:56:56 -05:00
Matthias Clasen
e62f9e33a1 Merge branch 'gdk-win32-use-window-from-point-for-master' into 'master'
GdkWin32: Fix mouse events in presence of transparent windows on the desktop

Closes #370, #417, and gimp#1082

See merge request GNOME/gtk!2800
2021-03-11 01:09:39 +00:00
Matthias Clasen
fe45f283af Merge branch 'matthiasc/for-master' into 'master'
inspector: Fix surface transform regression

See merge request GNOME/gtk!3280
2021-03-09 23:59:05 +00:00
Matthias Clasen
5556907194 inspector: Fix surface transform regression
Ever since we added surface-to-widget transforms,
the autofading of the fps overlay did not work anymore,
since it was given the transient transform node, most
of the time.

Fix this by passing both the root of the node tree and
the node for the toplevel widget to prepare_render, and
hande the widget node to the overlays. Update the
affected overlays that need to have their positioning
adjusted.
2021-03-09 18:27:04 -05:00
Мирослав Николић
9d51821e84 Update Serbian translation
(cherry picked from commit f33a2febc7)
2021-03-09 21:23:22 +00:00
Benjamin Otte
c696385130 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!3279
2021-03-09 19:11:09 +00:00
Benjamin Otte
0a9d075b47 wayland: Fix memleaks when rendering with Cairo
We were leaking buffers. This wasn't caught by valgrind and friends
because it was shared memory (with the compositor), but top(1) would
instantly see memory consumption of the app and the shell go through the
roof.
2021-03-09 19:52:59 +01:00
Benjamin Otte
b63c4d6722 wayland: Don't call _gdk_surface_update_size() all the time
We were calling _gdk_surface_update_size() every frame, even if the
window size didn't change. This would cause us to discard all cached
buffers and redraw the whole screen.

This was BAD.
2021-03-09 19:50:56 +01:00
Matthias Clasen
221825394f Merge branch 'ngl-rect-borders' into 'master'
Speed up border rendering

See merge request GNOME/gtk!3278
2021-03-09 17:56:57 +00:00
Matthias Clasen
124f60593b nodeparser: Print debug message before child
This puts the message up top, where it can be seen,
and not at the other end of an endless tree of children.

Update tests to match.
2021-03-09 12:15:25 -05:00
Matthias Clasen
09af40faeb ngl: Render simple borders simply
Use 4 color commands for uniform, rectilinear
borders. Most of our borders are rounded with
Adwaita, but there are still some of these.
2021-03-09 12:15:25 -05:00
Matthias Clasen
bf59ddd01d gsk: Add gsk_border_node_get_uniform_color
Maintain this bit of information separately,
it will be useful in the next commit.
2021-03-09 12:15:25 -05:00
Benjamin Otte
fea67dea6a vulkan: Improve rounded rect clipping
Handle the case where the inner rounded rect is fully contained
within the outer rounded rect.
2021-03-09 17:43:28 +01:00
Benjamin Otte
9f18c138d1 vulkan: Fix invalid read
Look at the right rect to compute circularness
2021-03-09 17:43:28 +01:00
Matthias Clasen
bfa68223e1 Merge branch 'meson-override-dep' into 'master'
meson: override gtk4 dependency

See merge request GNOME/gtk!3277
2021-03-09 03:00:18 +00:00
Xavier Claessens
405dc7f557 meson: override gtk4 dependency
This allows applications that depends on gtk4 to build it as subproject
without hardcoding 'gtk_dep' variable name in their build definition.
2021-03-08 21:06:33 -05:00
Matthias Clasen
cba8c40aa0 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3276
2021-03-09 00:12:11 +00:00
Matthias Clasen
98b13933d9 Merge branch 'bilelmoussaoui/size-request-annotations' into 'master'
g-i: update distribute_natural_allocation annotation

See merge request GNOME/gtk!3271
2021-03-08 23:07:18 +00:00
Matthias Clasen
062383bfd3 node-format: Small docs fixes 2021-03-08 17:49:21 -05:00
Matthias Clasen
91e94556ad spinbutton: Interpret localized digits
Interpret input where the characters have numeric values.

See #3387
2021-03-08 17:49:21 -05:00
Matthias Clasen
07ca46e92c Merge branch 'ngl-clip-classification' into 'master'
Ngl clip classification

See merge request GNOME/gtk!3274
2021-03-08 20:20:50 +00:00
Matthias Clasen
57e354c297 glsl: Make rounded rect clipping cheaper
Add early acceptance checks for non-corner cases.
2021-03-08 14:41:48 -05:00
Matthias Clasen
fb0814602e Merge branch 'matthiasc/for-master' into 'master'
Revert "ngl: Remove a few redundant checks"

See merge request GNOME/gtk!3273
2021-03-08 13:38:12 +00:00
Matthias Clasen
5f664dbbbb Revert "ngl: Remove a few redundant checks"
This reverts commit 4375f8e382.

These were not redundant after all, as pointed out by Timm.
2021-03-08 08:10:35 -05:00
Matthias Clasen
5d30569575 Add some more rounded rect tests 2021-03-07 21:28:19 -05:00
Matthias Clasen
46d1fc1c24 gsk: Use clip defines in shaders
Use the NO_CLIP and RECT_CLIP defines to make
simpler shaders for these cases.

Note: This does not work yet.
2021-03-07 20:30:45 -05:00
Matthias Clasen
2c05b758c7 ngl: Add infrastructure for clip-variants of shaders
Make ngl compile each shader three times.
Once with #define NO_CLIP 1
once with #define RECT_CLIP 1
and once as before.
2021-03-07 20:30:45 -05:00
Matthias Clasen
5788338a14 ngl: Classify clips
Maintain the 'fully contained' information in the clip
stack. This will let us pick simpler shaders in the future.
2021-03-07 20:30:45 -05:00
Matthias Clasen
d786e1d614 Merge branch 'ebassi/iface-macros' into 'master'
Remove invalid class macros

See merge request GNOME/gtk!3270
2021-03-07 20:22:14 +00:00
Matthias Clasen
c60a316e22 Move gtk_rounded_rect_scale_affine to the right place
This function should live with the rest of the
GskRoundedRect code in gskroundedrect.c.
2021-03-07 15:17:32 -05:00
Matthias Clasen
b73c9e992f imcontext: Fix a docs mishap 2021-03-07 15:16:59 -05:00
Bilal Elmoussaoui
4980f620f9 g-i: update distribute_natural_allocation annotation 2021-03-07 20:59:01 +01:00
Matthias Clasen
87b800c11d Merge branch 'bilelmoussaoui/gi-annotations' into 'master'
g-i: add missing since annotations for 4.2

See merge request GNOME/gtk!3268
2021-03-07 19:46:59 +00:00
Bilal Elmoussaoui
6e903e13a5 g-i: add missing since annotations for 4.2 2021-03-07 19:50:32 +01:00
Matthias Clasen
83c466dcd1 Merge branch 'scalable-svg' into 'master'
icons: Rename two icons which had the wrong extension

See merge request GNOME/gtk!3269
2021-03-07 18:43:50 +00:00
Emmanuele Bassi
676ea489cc docs: Remove invalid macros 2021-03-07 18:34:53 +00:00
Emmanuele Bassi
70fbfd8ede treesortable: Remove class check macro 2021-03-07 18:26:31 +00:00
Emmanuele Bassi
6234ccc974 orientable: Remove class macros 2021-03-07 18:25:55 +00:00
Emmanuele Bassi
0cfe3d45f5 celleditable: Remove class cast check macro 2021-03-07 18:25:07 +00:00
Emmanuele Bassi
41371ccae6 buildable: Remove "class" macro 2021-03-07 18:23:23 +00:00
Emmanuel Gil Peyrot
5807fee893 icons: Rename two icons which had the wrong extension
Fixes two warnings when opening the inspector on my PinePhone, these two
files were attempted to be loaded as PNG (as per the extension) instead
of SVG.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2021-03-07 18:59:04 +01:00
Christian Hergert
b2c1d6bc9b Merge branch 'ngl-misc-fixes' into 'master'
Ngl misc fixes

See merge request GNOME/gtk!3267
2021-03-07 15:59:59 +00:00
Rūdolfs Mazurs
5fd22e5981 Update Latvian translation
(cherry picked from commit 1d62020a19)
2021-03-07 15:26:30 +00:00
Matthias Clasen
d0dce4cfa1 ngl: Treat radial gradients like others
Handle colorstop overflow for radial gradients
the same way we do for linear and conic gradients.
2021-03-07 10:18:47 -05:00
Matthias Clasen
4375f8e382 ngl: Remove a few redundant checks
We bail early on invisible nodes. No need to
repeat that check in individual visit functions.
2021-03-07 10:18:47 -05:00
Matthias Clasen
42b515a1e5 Merge branch 'matthiasc/for-master' into 'master'
Revert "flatpak: No need to build sassc anymore"

See merge request GNOME/gtk!3266
2021-03-07 14:59:57 +00:00
Matthias Clasen
6ab779cd06 roundedrect: Remove unclear language from the docs
The various intersection function for rounded rects are
precise. No need to add wordy disclaimers about the handling
of the corners.
2021-03-07 09:04:43 -05:00
Matthias Clasen
a261e9fca2 Revert "flatpak: No need to build sassc anymore"
This reverts commit 9a540841fd.
2021-03-06 16:03:41 -05:00
Matthias Clasen
50ccab487f Merge branch 'matthiasc/for-master' into 'master'
vulkan: Add visible fallback rendering

See merge request GNOME/gtk!3264
2021-03-06 19:29:50 +00:00
Guillaume Bernard
ddd5e5717d Update French translation
(cherry picked from commit 5b18df9b5e)
2021-03-06 18:49:41 +00:00
Мирослав Николић
390a278606 Update Serbian translation
(cherry picked from commit b9a451423f)
2021-03-06 18:43:51 +00:00
Changwoo Ryu
00423c54b5 Update Korean translation
(cherry picked from commit 60a714a25f)
2021-03-06 18:11:58 +00:00
Jordi Mas
f8f90d85ad Update Catalan translation 2021-03-06 09:44:50 +01:00
Benjamin Otte
91932ada63 vulkan: Handle simple transforms in the clipping code
Requires pushing the GskTransform into the clipping code so that we
can actually look at its category.
2021-03-05 19:36:36 -05:00
Matthias Clasen
dbb264dfc9 vulkan: Add visible fallback rendering
Hook up the "Show fallback rendering" switch for Vulkan.

This brings home the sobering truth that the Vulkan renderer
is doing *all* fallback, since we switched from offset nodes
to transform nodes.
2021-03-05 18:42:04 -05:00
Matthias Clasen
3aa89efcf4 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3263
2021-03-05 20:30:54 +00:00
Matthias Clasen
82f40a92c1 searchentry: Typo fix 2021-03-05 15:07:02 -05:00
Matthias Clasen
ae1a950a93 flatpak: Fix the gtk4-demo build
This was overlooked in 8e7e821033.
2021-03-05 15:06:20 -05:00
Matthias Clasen
2228181b35 Merge branch 'wip/exalm/window-shadow-dark-4' into 'master'
Adwaita: Use transparent black for window border in dark too

See merge request GNOME/gtk!3261
2021-03-05 19:41:39 +00:00
Matthias Clasen
7357120c81 Merge branch 'wip/jimmac/fix-flatpak-build' into 'master'
Flatpak: Update build manifests

See merge request GNOME/gtk!3259
2021-03-05 19:11:36 +00:00
Alexander Mikhaylenko
0942e863f2 Adwaita: Use transparent black for window border in dark too
Avoid smear when the background behind the window is dark. Adjust opacity
to make it appear roughly the same as before on white background.
2021-03-05 22:59:25 +05:00
Matthias Clasen
08f3618a47 Merge branch 'wip/jimmac/sidebar-focus' into 'master'
Adwaita: Regular focus ring for sidebar rows

Closes #3708

See merge request GNOME/gtk!3258
2021-03-05 17:17:04 +00:00
Jakub Steiner
8e7e821033 Flatpak: Update build manifests
- point to the upstream repo for wayland
- disable disabling of sassc
- switch wayland from autotools to meson
2021-03-05 18:00:17 +01:00
Jakub Steiner
11d6f2ddd0 Adwaita: Regular focus ring for sidebar rows
- style sidebar rows as regular items like buttons wrt focus
- define transition as part of the focus-ring(),
  only animate outline related properties rather than `all`

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3708
2021-03-05 17:45:58 +01:00
Kukuh Syafaat
490384c69f Update Indonesian translation
(cherry picked from commit e54dc87a15)
2021-03-05 11:53:01 +00:00
Matthias Clasen
468242b13b Merge branch 'iconbrowser-fix' into 'master'
iconbrowser: fix search<>category interaction

Closes #3717

See merge request GNOME/gtk!3257
2021-03-05 01:11:11 +00:00
Matthias Clasen
d3d49ce7f1 iconbrowser: fix search<>category interaction
Make search act like a separate, filtered view of
all icons. This is how it worked in gtk3, and how
it should be.

Fixes: #3717
2021-03-04 19:30:02 -05:00
Matthias Clasen
c303ec1553 Merge branch 'preedit-selection-fix' into 'master'
Preedit selection fix

Closes #1123

See merge request GNOME/gtk!3255
2021-03-04 22:48:25 +00:00
Matthias Clasen
d28df0b87e textview: Delete selection when preedit starts
This prevents confusing misrendering when the preedit text
pushes the selection text out of the rendered selection.

Fixes: #1123
2021-03-04 15:18:30 -05:00
Matthias Clasen
d1fbfb9c4e textview: Send anchor with surrounding
We have the api to do it now.
2021-03-04 15:18:30 -05:00
Matthias Clasen
ccae0e1732 text: Optimize away 0-change insertions and deletions
We can short-circuit insert and delete calls that are
not causing any change.
2021-03-04 15:18:30 -05:00
Matthias Clasen
447203ce52 text: Delete selection when preedit starts
This prevents confusing misrendering when the preedit text
pushes the selection text out of the rendered selection.

Fixes: #1123
2021-03-04 15:18:30 -05:00
Matthias Clasen
feccdad9d2 text: Send anchor with surrounding
We have the api to do it now.
2021-03-04 15:18:30 -05:00
Matthias Clasen
35fceca157 imwayland: Pass anchor with surrounding
This was missing in the initial implementation since
GtkIMContext did not have it in its api, but it was
added now, so we can send the information.
2021-03-04 15:18:30 -05:00
Matthias Clasen
97db959305 immulticontext: Implement [gs]et_surrounding_with_selection
This is the recommended api, going forward.
2021-03-04 15:18:30 -05:00
Matthias Clasen
4b9aeaf9e3 imcontext: Add [gs]et_surrounding_with_selection
The Wayland text protocol expects to get both ends
of the selection with its surrounding call, so make
that available via GtkIMContext. We add this as new
api and vfuncs, and fall back, so that existing
implementations keep working.
2021-03-04 15:18:30 -05:00
Matthias Clasen
053d7cfe9f Merge branch 'wip/chergert/remove-zero-suffix-array' into 'master'
ngl: remove unnecessary suffix array

See merge request GNOME/gtk!3254
2021-03-03 21:53:27 +00:00
Jordi Mas
2959f219e4 Update Catalan translation 2021-03-03 22:31:04 +01:00
Christian Hergert
b368d3abde ngl: remove unnecessary suffix array
We didn't end up using this in the final version, so we can just delete
it and avoid MSVC issues.
2021-03-03 13:03:24 -08:00
Matthias Clasen
b533bba3f3 Merge branch 'bilelmoussaoui/annotations-fix' into 'master'
update annotation of gtk_single_selection_get_selected_item

See merge request GNOME/gtk!3253
2021-03-03 15:11:00 +00:00
Bilal Elmoussaoui
aae67b8fbd gtk: update annotation of gtk_single_selection_get_selected_item 2021-03-03 14:19:45 +01:00
Matthias Clasen
d79354dbf5 Merge branch 'wip/exalm/headerbar-css' into 'master'
Header bar CSS tweaks

See merge request GNOME/gtk!3252
2021-03-03 13:11:22 +00:00
Alexander Mikhaylenko
aa693159dc adwaita: Remove the nested headerbars hack
We clip the window now, it's not necessary anymore.
2021-03-03 17:35:15 +05:00
Alexander Mikhaylenko
5fef637e84 adwaita: Remove headerbar sheen on backdrop
It's gone from active windows since c9807f5afe,
but was still there in backdrop.
2021-03-03 17:34:22 +05:00
Matthias Clasen
208a53fa39 Merge branch 'label-mnemonic-fix' into 'master'
label: Fix markup parsing interactions

See merge request GNOME/gtk!3250
2021-03-03 12:00:37 +00:00
Matthias Clasen
875a92b95f label: Fix markup parsing interactions
We were not handling mnemonics vs markup right
in all cases. Rewrite the _-stripping code to
do it during the link parsing, instead of as
a separate function. This avoids the issue of
stripping _ from attribute names in markup.

Add tests.

Fixes: 3706
2021-03-02 23:25:01 -05:00
Matthias Clasen
c23848c03e Merge branch 'fix-glyph-serialization' into 'master'
rendernode: Fix glyph serialization

Closes #3710

See merge request GNOME/gtk!3248
2021-03-02 20:31:09 +00:00
Matthias Clasen
96ac85038b rendernode: Fix glyph serialization
We serializing to a string of ASCII, we need to
escape some chars, such as '\' and '"'.

Fixes: #3710
2021-03-02 11:32:29 -05:00
Baurzhan Muftakhidinov
69f051798e Update Kazakh translation
(cherry picked from commit 62e9dff536)
2021-03-02 03:35:10 +00:00
Matthias Clasen
1c6da51000 Merge branch 'wip/chergert/fix-ngl-gles' into 'master'
ngl: fix typo from NGL rename

See merge request GNOME/gtk!3246
2021-03-02 00:37:00 +00:00
Christian Hergert
d6694a4408 ngl: fix typo from NGL rename 2021-03-01 10:28:26 -08:00
Matthias Clasen
0ccca910df Merge branch 'submodules' into 'master'
Allow GTK4 to be added as a subproject

See merge request GNOME/gtk!3242
2021-03-01 16:01:25 +00:00
Matthias Clasen
fd2909abb2 Merge branch 'broadway-guint32' into 'master'
broadway: Restore guint32 type for memory size

Closes #3702

See merge request GNOME/gtk!3244
2021-02-27 23:16:28 +00:00
Rafał Dzięgiel
d586410416 broadway: Restore guint32 type for memory size
guint32 is used as part of the protocol in broadway backend.
Memory size declared with it was mistakenly replaced with size_t type
which does not guarantee being 32bit on all platforms, leading to a crash.
2021-02-27 23:43:12 +01:00
Jiri Grönroos
4721e760e7 Update Finnish translation
(cherry picked from commit 3cb5a831e3)
2021-02-26 12:10:10 +00:00
BogDan Vatra
72700d1644 Allow GTK4 to be added as a subproject 2021-02-26 09:27:02 +02:00
Emin Tufan Çetin
c274c35583 Update Turkish translation 2021-02-25 14:28:49 +00:00
Emin Tufan Çetin
d2c3f8f496 Update Turkish translation 2021-02-25 14:02:50 +00:00
Matthias Clasen
bffb666914 Merge branch 'matthiasc/for-master' into 'master'
imcontext: Fixes to the state machine

See merge request GNOME/gtk!3238
2021-02-25 12:25:02 +00:00
Matthias Clasen
ab615104f5 Merge branch 'wip/carlosg/touchpad-gesture-devices' into 'master'
gdk/wayland: Assign logical pointer to touchpad gesture events

See merge request GNOME/gtk!3240
2021-02-25 12:23:26 +00:00
Jiri Grönroos
9c2674ee1e Update Finnish translation
(cherry picked from commit 0fd0b00ec9)
2021-02-25 10:46:56 +00:00
Carlos Garnacho
68ced9b553 gdk/wayland: Assign logical pointer to touchpad gesture events
These events don't make sense on physical devices (for starters, they
are relative to the logical pointer position). Use this device for
those events, also happens to be what the upper parts expect of them.
2021-02-25 01:08:07 +01:00
Matthias Clasen
177f6b377d Merge branch 'bilelmoussaoui/gdk-draw-context' into 'master'
gdk: drop the latest mention of DrawingContext

See merge request GNOME/gtk!3232
2021-02-24 22:28:47 +00:00
Matthias Clasen
55f871c193 imcontext: Fixes to the state machine
It turns out that we we were sometimes emitting
preedit-end multiple times, and sometimes not at
all. Same for preedit-start. To fix this up, introduce
a in_compose_sequence flag, maintain it, and use it
in the right places.

After these changes, both

C-S-u 1 2 3 Enter
Compose a e

generate the right signals:

preedit-start, preedit-changed,..., preedit-end, commit
2021-02-24 13:31:31 -05:00
Carlos Garnacho
ce2835265b Merge branch 'wip/carlosg/mark-settings-valid-again' into 'master'
gdk/wayland: Make more matched settings from the portal as valid

See merge request GNOME/gtk!3236
2021-02-24 16:12:13 +00:00
Carlos Garnacho
75ae0e04e1 gdk/wayland: Make more matched settings from the portal as valid
Commit 97b5fad131 was a forward port from a gtk3 patch, but the hunk
was applied on the wrong bits of code.

Ensure the initialization paths also do mark settings read from the
portal as valid, so the checks for optional/newer settings actually have
the expected result. It is also desirable to mark settings as valid
after configuration changes (as that patch did effectively do), but not
enough to fix all situations.
2021-02-24 16:41:13 +01:00
Matthias Clasen
1f284fcd70 4.1.1 2021-02-23 20:59:16 -05:00
Matthias Clasen
718a95c1d2 Merge branch 'matthiasc/for-master' into 'master'
composetable: Remove some redundant code

See merge request GNOME/gtk!3234
2021-02-24 01:57:47 +00:00
Matthias Clasen
cd2854a5c6 Merge branch 'wip/chergert/glproto' into 'master'
gsk: add OpenGL based GskNglRenderer

See merge request GNOME/gtk!3225
2021-02-24 01:14:14 +00:00
Fran Dieguez
86151622db Updated Galician translations 2021-02-24 01:51:12 +01:00
Matthias Clasen
915e3f0e28 composetable: Remove some redundant code
Pointed out by Peter Bloomfield.
2021-02-23 19:14:26 -05:00
Matthias Clasen
a4e7b03185 inspector: Fix a typo
When selecting the "ngl" renderer, the inspector was
saying Renderer: Unknown, due to a typo. Fix that.
2021-02-23 18:37:32 -05:00
Matthias Clasen
e9ed874231 gsk: Replace a last instance of "next"
The output of GSK_RENDERER=help was still talking about
the "next" renderer, while actually looking for "ngl".
2021-02-23 18:36:41 -05:00
Christian Hergert
2a38cecd33 gsk: add OpenGL based GskNglRenderer
The primary goal here was to cleanup the current GL renderer to make
maintenance easier going forward. Furthermore, it tracks state to allow
us to implement more advanced renderer features going forward.

Reordering

This renderer will reorder batches by render target to reduce the number
of times render targets are changed.

In the future, we could also reorder by program within the render target
if we can determine that vertices do not overlap.

Uniform Snapshots

To allow for reordering of batches all uniforms need to be tracked for
the programs. This allows us to create the full uniform state when the
batch has been moved into a new position.

Some care was taken as it can be performance sensitive.

Attachment Snapshots

Similar to uniform snapshots, we need to know all of the texture
attachments so that we can rebind them when necessary.

Render Jobs

To help isolate the process of creating GL commands from the renderer
abstraction a render job abstraction was added. This could be extended
in the future if we decided to do tiling.

Command Queue

Render jobs create batches using the command queue. The command queue
will snapshot uniform and attachment state so that it can reorder
batches right before executing them.

Currently, the only reordering done is to ensure that we only visit
each render target once. We could extend this by tracking vertices,
attachments, and others.

This code currently uses an inline array helper to reduce overhead
from GArray which was showing up on profiles. It could be changed to
use GdkArray without too much work, but had roughly double the
instructions. Cycle counts have not yet been determined.

GLSL Programs

This was simplified to use XMACROS so that we can just extend one file
(gskglprograms.defs) instead of multiple places. The programs are added
as fields in the driver for easy access.

Driver

The driver manages textures, render targets, access to atlases,
programs, and more. There is one driver per display, by using the
shared GL context.

Some work could be done here to batch uploads so that we make fewer
calls to upload when sending icon theme data to the GPU. We'd need
to keep a copy of the atlas data for such purposes.
2021-02-23 14:41:52 -08:00
Ask Hjorth Larsen
9698d4aa2a Updated Danish translation of gtk-properties 2021-02-23 01:23:03 +01:00
Ask Hjorth Larsen
dd2851a0ff Updated Danish translation 2021-02-23 01:23:03 +01:00
Bilal Elmoussaoui
adf9377b61 gdk: drop the latest mention of DrawingContext 2021-02-22 22:15:14 +00:00
Matthias Clasen
700f39bfca Merge branch 'compose-warning' into 'master'
imcontext: Take out the warnings

See merge request GNOME/gtk!3230
2021-02-22 20:31:19 +00:00
Matthias Clasen
baec7079e0 imcontext: Take out the warnings
Don't warn about Compose file constructs we don't
support. We haven't supported these for a long time,
and nobody has every complained. No need to wake
up sleeping dogs.
2021-02-22 15:08:58 -05:00
Timm Bäder
f83644edee Merge branch 'SilverRainZ-master-patch-42810' into 'master'
gtk-demo: Fix typo GtkKabel -> GtkLabel

See merge request GNOME/gtk!3229
2021-02-22 08:20:34 +00:00
Emin Tufan Çetin
30d4417064 Update Turkish translation 2021-02-21 17:56:30 +00:00
Emin Tufan Çetin
b428fafade Update Turkish translation 2021-02-21 17:51:14 +00:00
Emin Tufan Çetin
63d1dc307a Update Turkish translation 2021-02-21 16:27:09 +00:00
Shengyu Zhang
55bfadadc4 gtk-demo: Fix typo GtkKabel -> GtkLabel 2021-02-21 16:20:22 +00:00
Piotr Drąg
179fae32a5 Update POTFILES.in 2021-02-21 12:50:44 +01:00
Matthias Clasen
e220b24b70 Merge branch 'wip/chergert/macos-gl-opaque-context' into 'master'
macos: make OpenGL context opaque when possible

See merge request GNOME/gtk!3226
2021-02-20 02:37:52 +00:00
Matthias Clasen
9061256122 Merge branch 'wip/chergert/fix-macos-resizing' into 'master'
macos: fix resizing of resizable windows on macOS

See merge request GNOME/gtk!3227
2021-02-20 02:32:15 +00:00
Christian Hergert
ea0d487f0b macos: fix resizing of resizable windows on macOS 2021-02-19 15:43:49 -08:00
Christian Hergert
b2fd09625c macos: make OpenGL context opaque when possible
If our opaque region is the entire surface, then we can make the OpenGL
context opaque like we do for decorated windows. This improves performance
as the compositor does not need to blend the surface with the contents
behind the window.
2021-02-19 13:23:26 -08:00
Matthias Clasen
5797c72e9c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3224
2021-02-19 14:41:36 +00:00
Zander Brown
d02cfceb3d Update British English translation
(cherry picked from commit 1f18d2638f)
2021-02-19 14:26:26 +00:00
Zander Brown
451af280a2 Update British English translation
(cherry picked from commit 6f26331864)
2021-02-19 14:24:32 +00:00
Matthias Clasen
516776b630 gtk-demo: Make --version match about
Print the same version information in --version
that we show in the about dialog.
2021-02-18 22:52:15 -05:00
Matthias Clasen
4d0a1a97cc widget-factory: Make --version match about
Print the same version information in --version
that we show in the about dialog.
2021-02-18 22:51:35 -05:00
Matthias Clasen
3ee5354e0f imwayland: Be careful about cursor positions
We don't want to hand out cursor positions based on
the original preedit text and then tweak the text to
be different.
2021-02-18 15:33:01 -05:00
Matthias Clasen
07295ac169 Merge branch 'unintrusive-compose-preedit' into 'master'
Unintrusive compose preedit

See merge request GNOME/gtk!3220
2021-02-18 17:36:08 +00:00
Matthias Clasen
447e6db847 Merge branch 'wip/carlosg/font-setting-lookups' into 'master'
gdk/wayland: Look for font settings recursively

Closes #3680

See merge request GNOME/gtk!3218
2021-02-18 17:18:37 +00:00
Matthias Clasen
d84a028455 imwayland: Tweak preedit text
Tweak the preedit text we get from IBus (via the compositor) to
match what GtkIMContextSimple produces for Compose sequences now.

This provides a unified experience.
2021-02-18 11:44:09 -05:00
Matthias Clasen
4327a866f4 imcontext: Make Compose preedit less intrusive
Tweak the preedit display for Compose sequences to
be not so distracting. We only show the Compose key
when it occurs in the middle of the sequence or is
the only key so far, and use · instead of ⎄ for it.

Also, make sure to display dead keys more adequately.
2021-02-18 11:44:09 -05:00
Carlos Garnacho
1fbdfe340e gdk/wayland: Look for font settings recursively
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
2021-02-18 16:50:45 +01:00
Matthias Clasen
4a47bdf596 Merge branch 'wip/exalm/root' into 'master'
widget: Don't assume GtkWindow root in gtk_widget_propagate_state()

See merge request GNOME/gtk!3217
2021-02-18 14:38:50 +00:00
Alexander Mikhaylenko
8e2f90e342 widget: Don't assume GtkWindow root in gtk_widget_propagate_state()
Avoid crashes with GtkDragIcon children.
2021-02-18 13:41:41 +05:00
Matthias Clasen
32c7ca50ea Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3679 and #3678

See merge request GNOME/gtk!3216
2021-02-18 05:52:44 +00:00
Matthias Clasen
19b9967a72 text: Fix sticky preedit attrs
In some cases, we were inadvertedly merging the
preedit attributes into priv->attrs, instead of
keeping them separate. This was causing the underlines
to grow beyond the preedit and never go away. One
place where this was showing up is the fontchooser
preview.

Fixes: #3679
2021-02-17 23:25:31 -05:00
Matthias Clasen
da71a37945 imwayland: Return limited preedit attributes
It should not matter, but it is the right thing to
do to limit the preedit attributes to the length
of the preedit text.
2021-02-17 22:57:41 -05:00
Matthias Clasen
05fe2441a7 imcontext: Enable font fallback for preedit
Not doing so only invites hexboxes.

Fixes: #3678
2021-02-17 22:11:57 -05:00
Matthias Clasen
35488959b4 paned: Add a paned handle class
Instead of bending GtkGizmo to the breaking point,
split off a GtkPanedHandle class that just does
what is needed here. Its simpler, and lets us keep
GtkGizmo simpler too. Everybody wins.
2021-02-17 21:45:33 -05:00
Matthias Clasen
af1981eda2 popovercontent: Few small fixes
Forgot to include config.h. Oops, and we make things
a bit shorter still.
2021-02-17 21:44:53 -05:00
Matthias Clasen
38da88908d Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3676 and #3675

See merge request GNOME/gtk!3215
2021-02-17 20:49:41 +00:00
Matthias Clasen
41abda9f03 Make gtk_im_modules_init properly private
Putting non-exported symbols in public headers can
only lead to confusion and day drinking. Don't do it.

Fixes: #3676
2021-02-17 15:25:42 -05:00
Matthias Clasen
5a8e2a8c2d gsk: Add a missing GDK_AVAILABLE_IN_ALL
gsk_text_node_has_color_glyphs was not properlty exported,
by accident.

Fixes: #3675
2021-02-17 15:20:24 -05:00
Matthias Clasen
7390e2490c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3214
2021-02-17 12:55:39 +00:00
Matthias Clasen
04daa236ad Revert "gizmo: Add a css_changed function"
This reverts commit 39f72b3834.
2021-02-16 23:51:14 -05:00
Matthias Clasen
31ceb4ddfb Revert "gizmo: Chain up in css_changed"
This reverts commit bb0a1b0cfe.
2021-02-16 23:51:14 -05:00
Matthias Clasen
c2f811dd29 popover: Add a popover content class
Instead of bending GtkGizmo to the breaking point,
split off a GtkPopoverContent class that just does
what is needed here. Its simpler, and lets us keep
GtkGizmo simpler too.
2021-02-16 23:51:14 -05:00
Matthias Clasen
189e0c05fd Merge branch 'wip/smcv/reftest-dedup' into 'master'
Reduce duplication in reftests

See merge request GNOME/gtk!3203
2021-02-17 03:55:45 +00:00
Matthias Clasen
8ee4ea4282 Merge branch 'wip/jimmac/tiled-resize-area-gtk4' into 'master'
Adwaita: control surface for resize tiled windows

Closes #3670

See merge request GNOME/gtk!3211
2021-02-17 03:54:27 +00:00
Jakub Steiner
edcd4c6207 Adwaita: control surface for resize tiled windows
- window resizing control area is implemented as where the shadows are drawn
- create a 'fake' shadow for the tiled case to allow easier resizing of
  the tiled window ratio even if it's offset to the side of the border

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3670
2021-02-16 14:10:14 +01:00
Matthias Clasen
f5bd591d89 Merge branch 'wip/jimmac/scrollbars-fine-tune-fix' into 'master'
Adwaita: avoid fine-tune scrollbars jumping

Closes #3672

See merge request GNOME/gtk!3208
2021-02-16 12:26:02 +00:00
Jakub Steiner
67b5a34bad Adwaita: Avoid fine-tune scrollbars jumping
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3672
2021-02-16 11:59:45 +01:00
Matthias Clasen
27071b5cfb Merge branch 'matthiasc/for-master' into 'master'
wayland: Complete our buffer format listing

See merge request GNOME/gtk!3207
2021-02-16 04:33:08 +00:00
Matthias Clasen
19b9c42562 Merge branch 'fix-scrollbar-sizing' into 'master'
gizmo: Chain up in css_changed

See merge request GNOME/gtk!3206
2021-02-15 21:43:47 +00:00
Matthias Clasen
bf6a40f39b wayland: Complete our buffer format listing
The debug spew for printing out supported buffer
formats was missing a bunch, among them the fp16
formats that are interesting for HDR support.
Add them.

Note that we still only support ARGB8888. But
at least we can print out what don't support.
2021-02-15 16:42:17 -05:00
Matthias Clasen
bb0a1b0cfe gizmo: Chain up in css_changed
css_changed is a vfunc that *must* chain up.
Failure to do so broke the resizing of overlay scrollbars,
amongst other things.

This bug was introduced in 39f72b3834.
2021-02-15 14:26:52 -05:00
Matthias Clasen
2ac5c3282f Merge branch 'lenient-compose-parsing' into 'master'
imcontext: Be more lenient in parsing Compose

See merge request GNOME/gtk!3201
2021-02-15 18:08:45 +00:00
Matthias Clasen
6b3c356eb7 Merge branch 'wip/jimmac/larger-smaller-scrollbar-gtk4' into 'master'
Adwaita: Scrollbar transitions and size

Closes #1886

See merge request GNOME/gtk!3204
2021-02-15 18:06:00 +00:00
Jakub Steiner
5c5cd34c2f Adwaita: Scrollbar transitions and size
- tone down the size of the controller again
- transition between the indicator and control fluidly

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1886
2021-02-15 12:25:09 +01:00
Simon McVittie
1c6cf7a3b6 reftests: Share reftest-compare.[ch] between GSK and GTK tests
The only non-whitespace difference is that the copy in GSK does not
set the symbol's visibility.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-02-15 09:22:41 +00:00
Simon McVittie
6b29eeeb1c reftest-compare: Fix spelling of "diff"
This is the only non-whitespace difference between the copies in
testsuite/reftests/ and testsuite/gsk/.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-02-15 09:22:41 +00:00
Matthias Clasen
2f43b8dc49 imcontext: Improve compose table parsing
Avoid leaking value in error cases, and actually
emit a warning for a missing quote. Pointed out
by Peter Bloomfield.
2021-02-15 01:46:00 -05:00
Jordi Mas
7b4cfd38bc Update Catalan translation 2021-02-14 21:52:55 +01:00
Matthias Clasen
d2e074e36b imcontext: Be more lenient in parsing Compose
X11 allows keysyms to be specified in addition to strings.
We only support the strings. In the past, we ignored everything
after the string. Go back to doing that, but issue a warning
that we've ignored the keysym.
2021-02-14 12:56:00 -05:00
Matthias Clasen
2623932886 Merge branch 'fix-compose-comments' into 'master'
Fix compose comments

Closes #3664

See merge request GNOME/gtk!3199
2021-02-14 17:25:58 +00:00
Matthias Clasen
b0a82b1dfe Merge branch 'popup-shadow-width' into 'master'
Support shadows on popovers

See merge request GNOME/gtk!3089
2021-02-14 17:22:50 +00:00
Matthias Clasen
f15aa2f3e5 imcontext: Fix a regression in Compose file parsing
We accidentally dropped the handing of # comments.
Bring it back. Test included.

Fixes: #3664
2021-02-14 11:56:24 -05:00
Matthias Clasen
5d6792137d testsuite: Add a missing file 2021-02-14 11:56:24 -05:00
Matthias Clasen
52a2891933 window: Add some more details to css docs
Mention more of the supported style classes.
2021-02-14 11:22:44 -05:00
Matthias Clasen
7ebc3a9489 Update popover css docs
Mention that shadows are now possible.
2021-02-14 11:14:23 -05:00
Matthias Clasen
04fb1421dc Merge branch 'antoniof-master-patch-32022' into 'master'
docs: Mark heading in migration guide

See merge request GNOME/gtk!3198
2021-02-14 15:59:29 +00:00
Matthias Clasen
a4f17eaa8b macos: Apply popup shadow width 2021-02-14 10:52:33 -05:00
Matthias Clasen
e0c48e74bd win32: Apply popup shadow width 2021-02-14 10:52:33 -05:00
António Fernandes
a810f600bf docs: Mark heading in migration guide
This heading was missing from the index because it was not marked as one
2021-02-14 15:20:54 +00:00
Matthias Clasen
ad9c813ed1 x11: Apply popup shadow with 2021-02-14 10:12:10 -05:00
Matthias Clasen
aa1d08687d popover: Handle shadow changes
When the box-shadow css property of the contents
widget changes, queue a resize on the popover.
2021-02-14 10:12:10 -05:00
Matthias Clasen
39f72b3834 gizmo: Add a css_changed function
In a break from the current gizmo api, add a separate
setter, since the calls with long argument lists full
of NULL are getting out of hand.
2021-02-14 10:12:10 -05:00
Matthias Clasen
7332b4f1d9 Add a test for popover positioning
This is useful for testing the interaction of arrows, shadows
or offsets with popover positioning.
2021-02-14 10:11:17 -05:00
Matthias Clasen
b948799778 popover: Support shadows
Use gdk_popup_layout_set_shadow_width to take shadows into
account when positioning popovers, and set the input region
to exclude the shadow, since we aren't doing interactive
resizing and the like.

When the popover has a beak, we make the surface size be
content size + shadow + tail, and then position the content
according to the final position inside this slightly too large
surface. The surface being too large doesn't matter, since we
set up an input region.
2021-02-14 10:11:17 -05:00
Matthias Clasen
aec738745a wayland: Set shadow width on popup surfaces
Take the shadow width from the popup layout into account.
2021-02-14 10:11:17 -05:00
Matthias Clasen
ea19f7c360 popuplayout: Add shadow width
Add shadow width to the GdkPopupLayout struct. This
information is needed by the compositor to make correct
positioning decisions about popups.
2021-02-13 21:01:46 -05:00
Matthias Clasen
0222d389ee Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3197
2021-02-14 01:59:35 +00:00
Matthias Clasen
b3a055a9b7 popover: Queue a resize when position changes
At least with an arrow, changing the position
requires a resize
2021-02-13 20:27:01 -05:00
Matthias Clasen
bd877ccf06 popover: Cosmetics 2021-02-13 20:26:54 -05:00
Balázs Meskó
a8d87f80f3 Update Hungarian translation 2021-02-14 00:07:07 +00:00
Matthias Clasen
6601d79b2d Merge branch 'revert-82ab039a' into 'master'
Revert "Merge branch 'disable-macos-ci' into 'master'"

See merge request GNOME/gtk!3192
2021-02-12 21:29:08 +00:00
Matthias Clasen
5ff843f97d Stop passing introspection=false to graphene
This should no longer be possible (and the introspection
option is no longer a boolean.
2021-02-12 16:04:15 -05:00
Matthias Clasen
b1c1e02c28 ci: Add debug spew on macos 2021-02-12 15:24:27 -05:00
Bartłomiej Piotrowski
0ce0402edf Revert "Merge branch 'disable-macos-ci' into 'master'"
This reverts merge request !3183
2021-02-12 19:40:57 +00:00
Matthias Clasen
5d13bb7aa2 Merge branch 'win32.surface.resize' into 'master'
Some fixes for resizing of GDK/Win32 surfaces

See merge request GNOME/gtk!3144
2021-02-12 14:07:07 +00:00
Matthias Clasen
c5e69e83b5 Merge branch 'flatpak-tweaks' into 'master'
Flatpak tweaks

See merge request GNOME/gtk!3187
2021-02-12 14:03:54 +00:00
Matthias Clasen
bcfca52e9e Merge branch 'ci-fedora-33' into 'master'
ci: Update the Fedora image to F33

See merge request GNOME/gtk!3188
2021-02-12 13:46:14 +00:00
Matthias Clasen
919e06a831 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!3189
2021-02-12 12:45:51 +00:00
Timm Bäder
0d5957b97a nativedialog: Remove unused run state 2021-02-12 08:39:40 +01:00
Timm Bäder
6e4bba3d75 build: Check for mallinfo2 instead of mallinfo
Similar to e89fcbfad6
but the tests we use mallinfo() in really aren't important to not worth
the effort to differentiate between mallinfo and mallinfo2. Only check
for mallinfo2().
2021-02-12 08:39:40 +01:00
Matthias Clasen
3e426e4c5b flatpak: Try harder to disable sassc 2021-02-12 00:26:10 -05:00
Matthias Clasen
8d4f4af8ef Add devel styling to nightly flatpaks
Pass -Dprofile=devel to the gtk build for our nightly
flatpaks, so they pick up devel styling.
2021-02-12 00:10:30 -05:00
Matthias Clasen
3aa3c21d69 demos: Add devel styling
Add a -Dprofile=devel meson option, and add some visual
hints to the demos that you are running a nightly build.
2021-02-12 00:08:55 -05:00
Matthias Clasen
9a540841fd flatpak: No need to build sassc anymore
We should be able to do a gtk build without rebuilding
css nowadays.
2021-02-11 23:00:19 -05:00
Matthias Clasen
0a3fa40923 ci: Update the Fedora image to F33 2021-02-11 22:02:39 -05:00
Matthias Clasen
9f10f9a595 Merge branch 'fix-network-places' into 'master'
placesview: Avoid use-after-free

See merge request GNOME/gtk!3186
2021-02-11 19:41:10 +00:00
Matthias Clasen
560e27a3f4 Merge branch 'wip/jimmac/tiled-shadow-fix-fix-gtk4' into 'master'
Adwaita: bring borders for tiled

Closes #3661

See merge request GNOME/gtk!3184
2021-02-11 17:04:47 +00:00
Matthias Clasen
4df7cc948c Merge branch 'ebassi/memdup2' into 'master'
Use g_memdup2()

See merge request GNOME/gtk!3157
2021-02-11 17:02:00 +00:00
Emmanuele Bassi
b74a9445af tests: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:23 +00:00
Emmanuele Bassi
a63a2b26cf Ensure we don't overflow when using g_memdup2()
When we turn integers into size_t we should check we're not going to
make a mess.
2021-02-11 14:22:23 +00:00
Emmanuele Bassi
43fd9d16c5 win32: Move from g_memdup() to g_memdup2()
Use `size_t` and `gsize` consistently for the length argument in every
function taking a bytes array and a length.
2021-02-11 14:22:23 +00:00
Emmanuele Bassi
78e3908a00 gtk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
a9c616284a gsk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
386d8326ca gdk: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
cf3f742ad8 x11: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
3a3e029270 wayland: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
435d12680d macos: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Emmanuele Bassi
504b5bbd1b broadway: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Jakub Steiner
f953dfef11 Adwaita: bring borders for tiled
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3661
2021-02-11 15:16:57 +01:00
Matthias Clasen
95d48ac2e8 placesview: Avoid use-after-free
The places view has questionable code for handling
'destroy', which seems to trigger use-after-free in
some cases. Clean this up a bit by acknowledging the
cancellation fully, rather than relying on the
destroyed flag.
2021-02-11 09:14:34 -05:00
Emmanuele Bassi
965e74f902 Add compatibility shim for g_memdup2()
We don't necessarily want to depend on a newer version of GLib, given
that we're not really using g_memdup() in the wrong way.
2021-02-11 12:57:38 +00:00
Matthias Clasen
0cc43e10a5 Merge branch 'wip/chergert/inline-transform-category' into 'master'
gsk: move transform structure to private.h

See merge request GNOME/gtk!3182
2021-02-11 01:14:21 +00:00
Matthias Clasen
82ab039abe Merge branch 'disable-macos-ci' into 'master'
ci: Temporarily disable macOS CI job as runner is offline

See merge request GNOME/gtk!3183
2021-02-11 01:14:01 +00:00
Matthias Clasen
e823fa6665 Merge branch 'fix-filter-value' into 'master'
css: Avoid an invalid read

See merge request GNOME/gtk!3181
2021-02-11 00:51:40 +00:00
Matthias Clasen
8cd4b338db ci: Temporarily disable macOS CI job as runner is offline
See https://gitlab.gnome.org/Infrastructure/GitLab/-/issues/495
2021-02-10 19:50:17 -05:00
Matthias Clasen
9af30aca35 Merge branch 'wip/chergert/fix-unused' into 'master'
snapshot: fix warning when asserts are disabled

See merge request GNOME/gtk!3180
2021-02-11 00:47:08 +00:00
Christian Hergert
6fab195643 gsk: move transform structure to private.h
This allows using the category without having to call a function from the
hot paths of the renderer.
2021-02-10 16:14:59 -08:00
Christian Hergert
c90ffc7363 snapshot: fix warning when asserts are disabled 2021-02-10 16:13:38 -08:00
Matthias Clasen
3eb4ec89f3 css: Avoid an invalid read
This was broken in ea7185bdb1.

Pointed out by Christian Hergert.
2021-02-10 19:13:36 -05:00
Matthias Clasen
6c85a4b2f5 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3177
2021-02-10 13:55:50 +00:00
Matthias Clasen
befc2c3ed6 iconbrowser: Use the right icon
We have an app icon, lets use it.
2021-02-10 08:04:11 -05:00
Matthias Clasen
62788d5b0d print-editor: Use the non-devel icon
We are no longer a nightly print editor.
2021-02-10 07:52:29 -05:00
Matthias Clasen
3c91a2b0a8 node-editor: Use the non-devel icon
We're now a respectable, stable node editor.
2021-02-10 07:44:59 -05:00
Matthias Clasen
d3096f079f Merge branch 'fix-clipped-texture' into 'master'
gl: Fixed clipped offscreen rendering

Closes #3651

See merge request GNOME/gtk!3175
2021-02-10 05:15:14 +00:00
Matthias Clasen
dff2aa20ff gl: Fixed clipped offscreen rendering
When we are rendering a texture node to an offscreen,
and we have a clip, we must force the offscreen rendering.
Otherwise, the code will notice: Hey, it already is a texture
node, so no need to render it to a texture again. But when
clipping is involved, that is exactly what we want to do.

Testcase included.

Fixes: #3651
2021-02-09 22:43:15 -05:00
Matthias Clasen
dae42c8f55 Merge branch 'wip/chergert/fix-maximized-shadows' into 'master'
adwaita: disable shadows when window is maximized or fullscreen

See merge request GNOME/gtk!3173
2021-02-09 23:16:49 +00:00
Jakub Steiner
da64856f37 Adwaita: don't cast shadows for halt-tiled windows
- while the case of a single half tiled window casting shadow is valid,
  the main use case for half tiled windows is when they have a neighbor.
  The :backdrop should be enough of a focus indicator and we avoid shadow
  casting on neighbors that are on the same Z level.
2021-02-09 18:57:31 +01:00
Christian Hergert
461fe36707 adwaita: disable shadows when window is maximized or fullscreen
These shadows cause a significant draw performance drop for maximized
windows. Disabling them increases the chances we can have faster scroll
performance of text.

There is some risk here for systems where they have a dock and you expect
the shadow to draw beneath that dock for transparency reasons.
2021-02-09 09:27:22 -08:00
Matthias Clasen
4ce071721f Merge branch 'win32-drop-formats-leak' into 'master'
win32: Fix some leaks

See merge request GNOME/gtk!3167
2021-02-09 12:27:35 +00:00
Matthias Clasen
3cdfb779c7 Merge branch 'wip/chergert/fix-bgr8-uploads' into 'master'
gl: handle B8G8R8 texture data when uploading

See merge request GNOME/gtk!3171
2021-02-09 12:11:49 +00:00
Christian Hergert
3a43663630 gl: handle B8G8R8 texture data when uploading
We do not need to translate this on the CPU when we can instead push it
to the GPU in the same format and allow it to swizzle.

This fixes a huge number of memory allocations found while uploading the
GTK animation in widget-factory.
2021-02-08 15:32:12 -08:00
Matthias Clasen
360a66e945 Merge branch 'wip/chergert/macos-perf-fixes' into 'master'
macos: various OpenGL performance fixes

See merge request GNOME/gtk!3170
2021-02-08 20:30:27 +00:00
Christian Hergert
13e162c404 macos: improve use of swap rectangles with OpenGL 2021-02-08 11:30:11 -08:00
Christian Hergert
65296228d7 macos: only flush when not attached
This makes it so we only flush the context for the NSView, not the context
that is the center of our center of the GL context spokes.
2021-02-08 11:30:05 -08:00
Christian Hergert
443d199868 macos: mark region as unlikely 2021-02-08 11:29:56 -08:00
Christian Hergert
86c5f2df6e gsk: make gsk_render_node_get_node_type() use const
There isn't any state to modify in the type so we can use const here.
Doing so allows some of the renderer code to use const across a
number of functions so that repeated calls are elided if inlined.
2021-02-08 11:29:43 -08:00
Christian Hergert
09b447a9e1 gsk: make render node getters pure
These do not do modify anything so they can be marked as pure to
potentially ellide calls. Since they do dereference, I do not believe
we can make them const although that is unclear since we could technically
just return a pointer + offset. Therefore it *might* be possible to also
make these G_GNUC_CONST.
2021-02-08 11:29:39 -08:00
Christian Hergert
161ddcfa92 gsk: make render node getters const
This also removes the return if fail macros from these as a good portion
of them didn't have them anyway. I think it's fair to say that access to
these incorrectly is a programmer error.

It significantly reduces the amount of code generated into generally a
movss,ret.
2021-02-08 11:29:36 -08:00
Christian Hergert
226dc49602 profiler: allow using gdk profiler functions without braces
Just compiling these out means you have to write code slightly differently
so that you don't end up with "if ();" afterwards.

This adds a "do {} while (0)" so that we're still semantically a statement
but will also compile out.
2021-02-08 11:29:32 -08:00
Matthias Clasen
207569c4ed Merge branch 'wip/exalm/headerbar' into 'master'
headerbar: Don't use gtk_widget_unparent() with GtkBox

See merge request GNOME/gtk!3169
2021-02-08 15:38:48 +00:00
Alexander Mikhaylenko
cf61d96188 headerbar: Null-check boxes when removing window controls
Prevent a crash when show-title-buttons value changes to FALSE during
destruction.
2021-02-08 18:46:35 +05:00
Alexander Mikhaylenko
319755662f headerbar: Don't use gtk_widget_unparent() with GtkBox
gtk_widget_unparent() is for widget implementations, it's not supposed to
be used from outside.
2021-02-08 18:46:27 +05:00
Matthias Clasen
055cd9aaad Merge branch 'printing-temporary-queues-gtk4' into 'master'
printing: Create temporary queues for Avahi printers

See merge request GNOME/gtk!3160
2021-02-07 16:13:46 +00:00
Matthias Clasen
15697d5c0c Merge branch 'focus' into 'master'
listbox: Fix handling of non-focusable rows

Closes #3633

See merge request GNOME/gtk!3152
2021-02-07 15:57:11 +00:00
Matthias Clasen
0cd2d01f3f Merge branch 'fix-x11-drop' into 'master'
x11: More dnd fixes

Closes #3654

See merge request GNOME/gtk!3166
2021-02-07 14:52:24 +00:00
Matthias Clasen
67877e403f win32: Fix some leaks
My reading of the code is that gdk_drop_new() is not
consuming the content formats it is given, so the caller
must not pass a new reference.

Needs testing on Windows.
2021-02-07 09:41:34 -05:00
Matthias Clasen
0bce63e3ab x11: More dnd fixes
Whenever we communicate targets, we need to the union, otherwise
we don't tell the other side about our serialization. This makes
drops of images from gtk4-icon-browser to gimp and libreoffice
succeed in transferring data.

Fixes: #3654
2021-02-07 09:03:22 -05:00
Matthias Clasen
6396bf6d89 Merge branch 'fix-x11-drop' into 'master'
Fix x11 drop

Closes #3652

See merge request GNOME/gtk!3165
2021-02-07 06:52:45 +00:00
Matthias Clasen
5b45f267d6 x11: Pass mimetypes when creating output stream
When creating the output stream for a drop, we must
pass the mimetypes we support, otherwise the picking
of the right handler does not work.

Fixes: #3652
2021-02-07 01:32:39 -05:00
Matthias Clasen
f26f15fced x11: Fix a memory leak
We ref the content formats here, so we better unref it
when done.
2021-02-07 01:31:40 -05:00
Matthias Clasen
a37044f36c x11: Some code cleanups
Fix some glaring misindentation.
2021-02-07 01:30:50 -05:00
Matthias Clasen
e8c8be8e37 Merge branch 'matthiasc/for-master' into 'master'
Implement drop-shadow css filter

See merge request GNOME/gtk!3163
2021-02-06 22:35:23 +00:00
Matthias Clasen
bfc80c32ea Add tests for the css filter property
Test that we can parse filters and that we
don't accept invalid filters.
2021-02-06 16:16:44 -05:00
Matthias Clasen
5f48764ac8 cssfiltervalue: Reject invalid filters
The Filter Effects Spec doesn't allow negative values
for most of the filter parameters.
2021-02-06 16:16:44 -05:00
Matthias Clasen
cc6fcbfc09 cssfiltervalue: Fix blur filter interpretation
According to https://www.w3.org/TR/filter-effects-1/,
the length passed to blur() is the standard deviation,
and according to https://www.w3.org/TR/css-backgrounds-3/#shadow-blur
the blur radius is twice the standard deviation.
2021-02-06 16:16:44 -05:00
Matthias Clasen
ea7185bdb1 cssfiltervalue: Implement drop-shadows
We have all the pieces, so this is surprisingly easy.
2021-02-06 16:16:43 -05:00
Matthias Clasen
429dfcf483 cssshadowvalue: Add a 'filter mode'
Shadow values created by gtk_css_shadow_value_new_filter or
gtk_css_shadow_value_parse_filter interpret their radius value
as standard deviation. Add a flag for this mode, and use it
where necessary.
2021-02-06 16:10:34 -05:00
Matthias Clasen
be3f352b59 cssshadowvalue: Add a parsing function
Add a variant of the parse function that parses
just a single (non-box) shadow, as required for
the drop-shadow filter.
2021-02-06 16:10:32 -05:00
Matthias Clasen
5b8896f1db cssshadowvalue: Add gtk_css_shadow_value_pop_snapshot
This is the counterpart ot gtk_css_shadow_value_push_snapshot.

To make this easy, move the determination whether we need a
shadow out of the push function and save it.
2021-02-06 16:09:21 -05:00
Matthias Clasen
4e27de7df9 cssshadowvalue: Drop the underscore
Rename _gtk_css_shadow_value_parse to drop the underscore.
It was the only underscore-prefixed function in this file.
2021-02-06 16:08:19 -05:00
Marek Černocký
2712f536c2 Updated Czech translation 2021-02-06 09:44:09 +01:00
Matthias Clasen
a1f7073ff5 Add tests for the css filter property
Test that we can parse filters.
2021-02-05 21:37:47 -05:00
Matthias Clasen
9770872d12 css: Implement the drop-shadow filter
We have all the pieces, so this is surprisingly easy.
2021-02-05 21:37:14 -05:00
Matthias Clasen
de24b4f91b cssshadowvalue: Add a parsing function
Add a variant of the parse function that parses
just a single (non-box) shadow, as required for
the drop-shadow filter.
2021-02-05 21:36:22 -05:00
Matthias Clasen
650fd9c291 Merge branch 'module-ext' into 'master'
meson: use correct module file extension on macOS

Closes #3645

See merge request GNOME/gtk!3162
2021-02-06 01:15:09 +00:00
David Lechner
b509809f34 meson: use correct module file extension on macOS
GModule requires the .so file extension on macOS for historic reasons.
However Meson defaults to .dylib for modules, so we need to override
it to get the correct extension.

Fixes #3645.
2021-02-05 16:54:28 -06:00
Marek Kasik
a93ab37ea9 printing: Show all Avahi advertised printers
This commit unsubscribes CUPS backend from a DBus
signal in idle when listening for new items on Avahi.

Since GDBus emits gathered signals in idle while
checking whether the signal has been unsubscribed
it could happen that a signal was not processed
because it was removed from hash table of
subscribed signals.
This caused the situation where printers advertised
on Avahi were not listed in CUPS backend sometimes.

We need those signals since this happens when switching
from a general subscription which listens to signals
for all Avahi services to a specific one which listens
to just _ipp._tcp and _ipps._tcp (chicken and egg problem).
2021-02-05 18:35:56 +01:00
Marek Kasik
5d7364960a printing: Create temporary queues for Avahi printers
This change extends set of Avahi advertised printers which
works with Gtk's CUPS print backend.

It creates a temporary queue (local printer) for each
Avahi printer in CUPS instead of accessing them directly
(via CUPS library).

This makes some printers work which did not work before and
also gives users more options to change in the print dialog.

This also changes naming of printers to be in accordance with CUPS.
It uses '_' instead of '-' and has hostname appended for CUPS remote
printers.
2021-02-05 18:35:56 +01:00
Matthias Clasen
60ff231fac Merge branch 'matthiasc/for-master' into 'master'
iconbrowser: Make image dnd work again

Closes #3648

See merge request GNOME/gtk!3159
2021-02-05 12:48:10 +00:00
Emmanuele Bassi
958005317b Merge branch 'master' into 'master'
Improve the docs of GtkWidget and GtkGrid

See merge request GNOME/gtk!2946
2021-02-05 12:14:26 +00:00
Matthias Clasen
15c36aaa1e iconbrowser: Make image dnd work again
We need to drag a texture, not a paintable.

Fixes: #3648
2021-02-04 20:47:19 -05:00
Matthias Clasen
482b73c376 Merge branch 'matthiasc/for-master' into 'master'
docs: Rewrite the long description for GtkDialog

Closes #3646

See merge request GNOME/gtk!3156
2021-02-05 00:10:47 +00:00
Matthias Clasen
4a8bf6e13d Merge branch 'doc-typo' into 'master'
gtkshow: Fix doc typo

See merge request GNOME/gtk!3158
2021-02-05 00:07:18 +00:00
Maximiliano Sandoval R
3e2e6633b0 gtkshow: Fix doc typo 2021-02-04 21:02:22 +01:00
Matthias Clasen
4724f9907c docs: Rewrite the long description for GtkDialog
As was pointed out in #3646, some of the content here
was a bit outdated.

Fixes: #3646
2021-02-04 13:05:28 -05:00
Matthias Clasen
26e84a7b8c Merge branch 'matthiasc/for-master' into 'master'
More work on css transition tests

See merge request GNOME/gtk!3154
2021-02-04 13:28:59 +00:00
Matthias Clasen
d5838f14f9 Drop the installed test for now
It fails in ci, and I have no idea why.
2021-02-04 07:26:10 -05:00
Matthias Clasen
5c532104e4 Merge branch 'pvs-fixes' into 'master'
Pvs fixes

See merge request GNOME/gtk!3155
2021-02-04 12:20:24 +00:00
Matthias Clasen
2f42e1fb89 treemodelfilter: Drop unreachable code
We never get here. The compiler says so.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:40:14 -05:00
Matthias Clasen
b5200bd076 css: Drop a bit of unreachable code
We never get here. The compiler says so.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:39:34 -05:00
Matthias Clasen
aa5bd38137 a11y: Avoid out-of-bounds access
Don't use the index before we've checked its good.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:34:05 -05:00
Matthias Clasen
0eba833595 gdk: Remove a redundant check
We already know desktop_notification_id is not NULL.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:29:51 -05:00
Matthias Clasen
1e0ea21297 messagedialog: Don't initialize twice
We don't need to set these fields more than once.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:25:36 -05:00
Matthias Clasen
e91e75173d composetable: Remove a redundant check
We already know seq_index is not NULL here.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:22:52 -05:00
Matthias Clasen
927fdb9a83 x11: A case of argument order confusion
translate_keysym was expecting its arguments the
other way around.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:20:26 -05:00
Matthias Clasen
041f410838 textbtree: Avoid line vs char count confusion
The post_insert_fixup helper function was confused about
its argument order.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:17:55 -05:00
Matthias Clasen
c71c8919fe listbase: Don't specify the same thing twice
We only need to set EXPLICIT_NOTIFY once.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:13:53 -05:00
Matthias Clasen
3f28399f7d css: Fix border value parsing
This function was not resetting computed as it meant
to because the last loop was never executed.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:12:51 -05:00
Matthias Clasen
3c15fa96bc vulkan: Fix image uploading by regions
This code did not make sense; it was incrementing
the wrong variable.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:12:44 -05:00
Matthias Clasen
0a0a059397 docs: Mention css drop-shadow filter
We don't support this filter, currently.
2021-02-03 22:10:13 -05:00
Matthias Clasen
18e83fe16d Add more css transition tests 2021-02-03 22:10:13 -05:00
Matthias Clasen
90d7ed5dd1 Rename test to transition
Thats what it is about, so name it clearly.

Add missing installed tests too.
2021-02-03 22:10:13 -05:00
Matthias Clasen
3c6e7569ff Add more css transition tests
Test font size transitions.
2021-02-03 22:10:13 -05:00
Matthias Clasen
4e2ec2d68d testsuite: Pass GDK_DEBUG=default-settings to css tests
Otherwise, settings might creep in and change css defaults.
2021-02-03 22:10:13 -05:00
Matthias Clasen
1af72eac21 cssvalue: Cosmetic change
Don't return FALSE from pointer-returning functions.
2021-02-03 22:10:13 -05:00
Matthias Clasen
640273a0e2 Improve the css value tests
The test code had some bugs. Fix those, and
print out useful information when tests fail.
2021-02-03 22:10:13 -05:00
Matthias Clasen
a14a0c6315 css: Fix shadow value equal
This function was not doing the right thing.

Once we are doing the right thing and not compare
shadows as unequal, some reftests that inhibit
snapshots for a few frames now hang forever, since
we are no more redrawing unnecessarily. Fix that
with an explicit queue_draw.
2021-02-03 22:10:13 -05:00
Matthias Clasen
38481680e1 Merge branch 'wip/jimmac/colored-list-image-buttons' into 'master'
Adwaita: allow suggested and destructive action buttons in lists

Closes #3643

See merge request GNOME/gtk!3153
2021-02-04 01:38:47 +00:00
Matthias Clasen
12a540c284 Merge branch 'ebassi/for-master' into 'master'
Graphene is a dependency of Gsk, not Gdk

See merge request GNOME/gtk!3149
2021-02-04 01:38:09 +00:00
Jakub Steiner
289bf078bf Adwaita: allow suggested and destructive action buttons in lists
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3643
2021-02-03 23:15:30 +01:00
Elias Projahn
a7ae94c06e listbox: Fix handling of non-focusable rows
This commit modifies the gtk_list_box_row_grab_focus() implementation to
correctly return FALSE in case the row couldn't be focused. This behavior will
also be honored by gtk_list_box_row_focus() to properly handle focus in that
case. To achieve that, the method has been restructured slightly.

Closes #3633
2021-02-03 21:22:55 +01:00
Matthias Clasen
58ab9ddc40 Merge branch 'x11-dnd-fix' into 'master'
x11: Handle X-specific targets in drops

Closes #3642

See merge request GNOME/gtk!3151
2021-02-03 20:11:33 +00:00
Matthias Clasen
c78036fc51 x11: Handle X-specific targets in drops
This code is very similar to the handling for these
targets in the clipboard case.

Fixes: #3642
2021-02-03 14:17:04 -05:00
Matthias Clasen
120f2768e6 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3150
2021-02-03 15:17:34 +00:00
Emmanuele Bassi
592b33cb48 Graphene is a dependency of Gsk, not Gdk
So let's put it in the right place when building the introspection data.
2021-02-03 14:05:27 +00:00
Matthias Clasen
7a9bc1f1d8 Link the data url tests statically
Thats the cleaner way to test internal apis.
2021-02-03 09:02:06 -05:00
Matthias Clasen
9cc6f3ee29 Add tests for css value transitions
Just a few cases for now, enough to test a recently
fixed regression with shadow transitions.
2021-02-03 08:56:57 -05:00
Chun-wei Fan
9efaa0b51d Merge branch 'uac.meson.master' into 'master'
gtk4-update-icon-cache: Avoid UAC on 32-bit Windows

Closes #3632

See merge request GNOME/gtk!3141
2021-02-03 02:16:58 +00:00
Chun-wei Fan
f0967fa5e4 gtk4-update-icon-cache: Avoid UAC on 32-bit Windows
As the program executable name has 'update' in its filename,
gtk4-update-icon-cache.exe is considered to be an installer program on 32-bit
Windows [1], which will cause the program to fail to run unless it is running
with elevated privileges (i.e. UAC).

Avoid this situation by embedding a manifest file into the final executable
that tells Windows that this is not a program that requires elevation.

Fixes issue #3632.

[1]: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc709628(v=ws.10)?redirectedfrom=MSDN,
     under section "Installer Detection  Technology"
2021-02-03 02:16:58 +00:00
Matthias Clasen
f8529983f9 Merge branch 'matthiasc/for-master' into 'master'
css: Allow transitioning different-size shadows

See merge request GNOME/gtk!3145
2021-02-03 00:43:44 +00:00
Matthias Clasen
919c08d4fd css: Allow transitioning different-size shadows
The code handles it just fine. The length check was
an erronous addition.
2021-02-02 15:27:42 -05:00
Matthias Clasen
e9b06b6346 Merge branch 'im-context-work' into 'master'
Some im context work

Closes #1004, #186, and #3521

See merge request GNOME/gtk!3143
2021-02-02 17:29:14 +00:00
Matthias Clasen
949c783187 composetable: Parse hex escapes too
This was a small omission from the Compose file
syntax that doesn't cost us much to support.

Add a test for this syntax too.

Fixes: #1004
2021-02-02 12:05:19 -05:00
Matthias Clasen
814a4a781a Add tests for string values
Add a test that checks we parse values with
multiple characters correctly.
2021-02-02 11:55:00 -05:00
Matthias Clasen
676f875bf6 composetable: Support string values in the cache
Change the cache format to include the character
data that we need to hold string values in the table.
2021-02-02 11:55:00 -05:00
Matthias Clasen
140c5c5333 composetable: Don't use GSlice for big blobs
This just doesn't make sense. This will use malloc
anyway, so just call malloc directly.
2021-02-02 11:55:00 -05:00
Matthias Clasen
cebf2b2009 composetable: Keep multi-char values
Keep string values in the table, and return them
from the check function. This commit temporarily
disables the table caching, since the cache format
does not handle string values yet.

Fixes: #186
2021-02-02 11:54:53 -05:00
Matthias Clasen
86b437a1b6 Merge branch 'wip/silence-bounds-warnings' into 'master'
gdk/toplevelsize: Remove warnings about exceeding bounds

Closes #3035

See merge request GNOME/gtk!3142
2021-02-02 16:38:20 +00:00
Matthias Clasen
773ae0cd0f composetable: Parse multi-char values
Rewrite the value parsing function to accept strings
that hold more than a single Unicode character.
2021-02-02 09:03:53 -05:00
Matthias Clasen
564793d5b5 composetable: Another step towards multi-char values
Change the parser data structures to hold a string, rather
than a gunichar. We still only put a single Unicode character
into it, currently.
2021-02-02 09:02:46 -05:00
Matthias Clasen
9142aa0f51 composetable: Prepare for multi character values
Make it possible for gtk_compose_table_check to return
a string instead of just a single Unicode character.
Currently, we only ever return strings holding a single
character, still.
2021-02-02 09:02:00 -05:00
Chun-wei Fan
39e136e9b7 Gdk/Win32: Fix resizing surfaces
This attempts to fix the counter-intuitive resizing of surfaces in GTK4 where
the surface grows or shrinks at the right and/or bottom edge when the window
resized from the top and/or left edge(s).

This is not yet perfect as the window stutters upon resizing from the top
and/or left edges, but at least makes resizing more intuitive.
2021-02-02 17:36:32 +08:00
Chun-wei Fan
652b892fc1 gdkwin32surface.[c|h]: Clean up code a bit
Remove the 'resized' member from the GdkWin32Surface structure, as we already
have a structure with a member that keeps track of whether a surface is being
resized, so we can just use that and avoid some confusion in the process
2021-02-02 17:36:32 +08:00
Matthias Clasen
af9a578d68 imcontext: Prepare for multi-char values
Reshuffle things so we can easily handle values
that are strings instead of just single Unicode
characters.
2021-02-01 23:43:59 -05:00
Matthias Clasen
ecb072fdd0 composetable: Check algorithmic matching
Just some spot checks, enough to verify the
fix in the previous commit.
2021-02-01 21:59:21 -05:00
Matthias Clasen
ef053ebb4a composetable: Fix algorithmic matching
The code wasn't paying attention to (lack of) nul-termination
in one place, causing it to not match when it should.
2021-02-01 21:51:51 -05:00
Matthias Clasen
8d18d93742 composetable: Add tests for compact table matching
Not very exhaustive, just some spot checks.
2021-02-01 21:10:44 -05:00
Matthias Clasen
10fcdd88e3 imcontext: Code cleanup
Get rid of auxiliary check_table function.
2021-02-01 20:41:45 -05:00
Matthias Clasen
5d9509c51b imcontext: Move code around
Move all the checking code to gtkcomposetable.c, and
add api that we can use in tests.
2021-02-01 20:27:38 -05:00
Matthias Clasen
c9cac5fbc3 composetable: Add tests for matching
This tests the api we use to match key sequences
against compose tables.
2021-02-01 19:55:56 -05:00
Matthias Clasen
aa9054a5f1 imcontext: Use gtk_compose_table_check
Use the just-introduced api.
2021-02-01 19:41:07 -05:00
Matthias Clasen
9ebf3fac73 composetable: Add api to check tables
This copies the check_table code from gtkimcontextsimple.c,
in order to have an api for tests.
2021-02-01 19:40:22 -05:00
Matthias Clasen
569294070b Add tests for GtkComposeTable
Add some tests for the code that parses Compose files.

This tests the fix in the previous commit.
2021-02-01 19:02:31 -05:00
Matthias Clasen
be35c46ce9 composetable: Drop table debug code
This is better off in the tests that we are going to add.
2021-02-01 19:02:21 -05:00
Matthias Clasen
dbbcb13721 composetable: Parser fixes
We were not handling octal escapes right.
2021-02-01 16:05:05 -05:00
Matthias Clasen
edeaf9c040 imcontext: Drop GTK_MAX_COMPOSE_LEN
Drop GTK_MAX_COMPOSE_LEN from docs. It is no longer
used by GTK at all.  We leave the define in place
for now, to avoid breaking 3rd party code that might
use it.
2021-02-01 12:31:23 -05:00
Matthias Clasen
61f709811c composetable: Warn when ignoring things
We should at least give a hint that we've seen the line,
otherwise people will wonder why nothing happened.
2021-02-01 12:27:41 -05:00
Matthias Clasen
f7c4375509 composetable: parse long sequences
Allow compose sequences of up to 20 code points.

Fixes: #3521
2021-02-01 12:27:35 -05:00
Matthias Clasen
52fb900ced composetable: Fix an off-by-one
Fix an off-by-one in the code parsing octal escapes
in compose files.
2021-02-01 12:10:05 -05:00
Matthias Clasen
031944ad30 imcontext: Stop using GTK_MAX_COMPOSE_LEN
Allocate the compose_buffer, and resize it when needed
to match the tables we use.
2021-02-01 12:10:05 -05:00
Matthias Clasen
bf8b974f68 imcontext: Code cleanup
Use g_clear_pointer instead of opencoding it in
multiple places.
2021-02-01 12:10:05 -05:00
Jonas Ådahl
6ad2a049e7 gdk/toplevelsize: Remove warnings about exceeding bounds
Sometimes the size will exceed the minimum bounds. For example crazy
applications like the widget factory that contains the world, or when a
user interactively resizes a window to be larger than the monitor the
window is on is.

The former is questionable, but the latter is not, and from here we
can't really see the difference, so just stop complaining.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3035
2021-02-01 11:31:11 +01:00
Matthias Clasen
3d85d53e5d Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #2319

See merge request GNOME/gtk!3140
2021-02-01 06:20:40 +00:00
Matthias Clasen
094a346539 imcontext: Allow sequences of length GTK_MAX_COMPOSE_LEN
There was an off-by-one error, making us reject sequences
of this length. But the rest of the code handles them
just fine.

Fixes: #2319
2021-02-01 00:55:25 -05:00
Matthias Clasen
162814f969 imcontext: Improve an error message
This error message was misleading, as pointed out
by Ralf Jung.
2021-02-01 00:44:41 -05:00
Matthias Clasen
e39b5c99f1 imcontext: Add a precondition check 2021-02-01 00:43:44 -05:00
Matthias Clasen
8883243aaa imcontext: Show preedit for compose sequences
Show the sequences as they are entered, using ⎄ for
the compose key, to match what IBus does nowadays.
Also handle backspace to allow corrections.
2021-02-01 00:37:43 -05:00
Matthias Clasen
89511eecf1 imcontext: Update our check for dead keys
A bunch of keysyms for dead keys have been added since this
code was last touched. Update the check to cover the full
range from dead_grave to dead_greek.
2021-01-31 23:56:24 -05:00
Matthias Clasen
2c304ca80d Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3139
2021-02-01 01:48:47 +00:00
Matthias Clasen
bf4102e664 Merge branch 'wip/exalm/consumes-motion' into 'master'
Drag fixes and cleanups

Closes #3513

See merge request GNOME/gtk!3001
2021-02-01 01:34:45 +00:00
Matthias Clasen
b86153cee3 Remove a forgotten file
The example series only has 9 steps now. Remove remnants
of step 10.
2021-01-31 20:26:02 -05:00
Matthias Clasen
7985d277b3 nativedialog: Add more docs
Emphasize that native dialogs aren't widgets, and are not
kept alive by GTK.
2021-01-31 20:25:44 -05:00
Matthias Clasen
752da5c2a5 Merge branch 'tool-static' into 'master'
tools: Don't static and dynamic link on libgtk4

See merge request GNOME/gtk!3138
2021-02-01 00:44:08 +00:00
Matthias Clasen
de4b8d547b Merge branch 'wip/exalm/activate' into 'master'
listitemwidget: Activate on release instead of press

Closes #3345

See merge request GNOME/gtk!3008
2021-02-01 00:32:05 +00:00
Xavier Claessens
1048ad1a01 tools: Don't static and dynamic link on libgtk4 2021-01-31 11:09:20 -05:00
Ungedummt
4d11158d97 GtkGrid: Add xml example for GtkBuildable to docs
Added an example and a short discription for the properties
2021-01-31 10:19:14 +01:00
Ungedummt
293b81cad2 Fix small typo in the docs of GtkWidget
In a XML example was MyGrid as a class defined; replaced with GtkGrid
2021-01-31 10:19:08 +01:00
Matthias Clasen
65c38111f9 4.1.0 2021-01-30 19:57:24 -05:00
Matthias Clasen
ec8db379a6 tests: Disable the textview-margins reftest
It is too flaky to be useful.
2021-01-30 19:57:24 -05:00
Matthias Clasen
1484b4ae9f node editor: Add a dark mode toggle
This is useful to see light rendering clearly.
2021-01-30 19:57:24 -05:00
Rafael Fontenelle
4cecbf1654 Update Brazilian Portuguese translation
(cherry picked from commit 056c3e11a1)
2021-01-30 19:16:02 +00:00
Timm Bäder
234ba90e2b Merge branch 'mcclurgm-master-patch-63249' into 'master'
Document nullability of gtk_list_box_get_selected_row

See merge request GNOME/gtk!3137
2021-01-30 17:58:33 +00:00
Rafael Fontenelle
bdd2244f75 Update Brazilian Portuguese translation
(cherry picked from commit f224c8fab9)
2021-01-30 16:00:45 +00:00
Michael McClurg
cd7ec8ac92 Document nullability of gtk_list_box_get_selected_row 2021-01-30 15:23:41 +00:00
Piotr Drąg
cc5edbbbb2 Update POTFILES.in 2021-01-30 14:21:32 +01:00
Matthias Clasen
94d9e34dd3 Merge branch 'fix-unfocus-on-unmap' into 'master'
Fix unsetting focus

Closes #3623

See merge request GNOME/gtk!3136
2021-01-30 03:25:19 +00:00
Matthias Clasen
3dbf5038fa Fix unsetting focus
Make _gtk_window_unset_focus_and_default queue the changes
for after the next draw. This achieves two things: first,
it avoids invalidating css at the wrong time (e.g. when
setting child-visible during size-allocation), and second,
it defers the focus change until after the widget is
hidden, so that moving the focus has the desired effect
of picking a different, visible widget.

Fixes: #3623
2021-01-29 21:41:16 -05:00
Matthias Clasen
456a2f3bcf Merge branch 'msvc.nounistd' into 'master'
testsuite/testutils.c: Fix build on Visual Studio

See merge request GNOME/gtk!3131
2021-01-29 20:16:13 +00:00
Matthias Clasen
8e1fa52d14 Merge branch 'gst-vaapi-fix' into 'master'
gtkgstsink: Sync texture before handing it to GDK

See merge request GNOME/gtk!3114
2021-01-29 19:06:03 +00:00
Matthias Clasen
cbf2feb633 Merge branch 'ci-gstreamer-deps' into 'master'
Ci gstreamer deps

See merge request GNOME/gtk!3133
2021-01-29 19:05:47 +00:00
Matthias Clasen
afe8ee501c Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

See merge request GNOME/gtk!3134
2021-01-29 18:47:31 +00:00
Jan Alexander Steffens (heftig)
4644dab081 gtkgstsink: Sync texture before handing it to GDK
We need to synchronize when moving the texture between contexts, or we
get glitches with VA-API decoding.
2021-01-29 18:58:17 +01:00
Matthias Clasen
b37a69d76c ci: Add mesa-libGLES-devel
Try again, since libglvnd-devel is not the right choice.
2021-01-29 12:55:46 -05:00
Emmanuele Bassi
51bc6ce2e4 build: Disable subproject Cairo tests
There's really no point in running them.
2021-01-29 16:31:10 +00:00
Emmanuele Bassi
988ebc2248 docs: Annotate XML fragments as such
This way we can get syntax highlighting.
2021-01-29 16:31:10 +00:00
Emmanuele Bassi
9f31e95420 docs: Escape bare tags
Otherwise tools processing the description of GtkWidget will be *very*
confused.
2021-01-29 16:31:10 +00:00
Emmanuele Bassi
3a076e26f7 docs: Use the appropriate syntax for code block language 2021-01-29 16:31:09 +00:00
Emmanuele Bassi
e3e85fc6f3 docs: Remove stray code block end marker 2021-01-29 16:31:09 +00:00
Jonas Ådahl
ad3a35b4c5 Merge branch 'gtk-surface-release-4' into 'master'
wayland: Signal gtk-shell surface destruction to the server

See merge request GNOME/gtk!3129
2021-01-29 16:21:05 +00:00
Matthias Clasen
454caa3eec ci: Use v26 of the Fedora image
This includes libglvnd-devel and should fix using the
gstreamer gl support.
2021-01-29 11:14:54 -05:00
Matthias Clasen
0ffe67ffed ci: Add libglvnd-devel to images
gstreamers gl support included headers from this
package without depending on it. Work around this
packaging error by explicitly adding the needed
dependencies.
2021-01-29 11:07:11 -05:00
Matthias Clasen
8eb46bbfb2 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3615

See merge request GNOME/gtk!3132
2021-01-29 15:15:43 +00:00
Chun-wei Fan
d8e8b3c235 testsuite/testutils.c: Fix build on Visual Studio
Visual Studio does not come with unistd.h, but Windows do have write() and
close() in io.h, so include io.h instead of unistd.h on Windows.

For MinGW, unistd.h in turn includes io.h.
2021-01-29 17:59:10 +08:00
Timm Bäder
79f273348d gl renderer: Fix viewport computation when rendering offscreen
Fixes #3615
2021-01-29 10:37:48 +01:00
Timm Bäder
fc99081658 showrendernode: Monitor input file 2021-01-29 09:45:25 +01:00
Timm Bäder
aba14e6a43 node editor: Show some default node data
Show case the icon and the render node format this way.
2021-01-29 09:45:25 +01:00
Timm Bäder
8ebcef97ff shader builder: Improve error output 2021-01-29 09:45:25 +01:00
Timm Bäder
00956a3770 node editor: Make help textview monospace
Otherwise the nice markdown tables don't line up.
2021-01-29 08:07:39 +01:00
Alexander Mikhaylenko
11f3b7730c windowhandle: Use drag threshold instead of double click threshold
Now that we have gtk_drag_check_threshold_double(), be consistent with
other draggable widgets and make sure we don't take over a drag before a
child does.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3513
2021-01-29 12:01:34 +05:00
Alexander Mikhaylenko
f63e6394ac dragsource: Use double coordinates for checking drag threshold
If multiple nested widgets have drag sources on them, both using bubble
phase, we need to reliably pick the inner one. Both of them will try to
start dragging, and we need to make sure there are no situations where the
outer widget starts drag earlier and cancels the inner one.

Currently, this can easily happen via integer rounding: start and current
coordinates passed into gtk_drag_check_threshold() are initially doubles
(other than in GtkNotebook and GtkIconView), and are casted to ints. Then
those rounded values are used to calculate deltas to compare to the drag
threshold, losing quite a lot of precision along the way, and often
resulting in the outer widget getting larger deltas.

To avoid it, just don't round it. Introduce a variant of the function that
operates on doubles: gtk_drag_check_threshold_double() and use it instead
of the original everywhere.
2021-01-29 12:01:34 +05:00
Alexander Mikhaylenko
bbca4c38df entry: Fix drag threshold check
It was passing offsets as current oordinates.
2021-01-29 12:00:10 +05:00
Alexander Mikhaylenko
28f5d26719 windowhandle: Don't drag on capture phase
This was needed to work around widgets claiming event sequences on press,
by ignoring them and starting the drag anyway unless they have certain
event controllers on them.

The most visible offender was GtkButton, but since the last commit it
doesn't claim the sequence anymore and we can remove the hack.
2021-01-29 12:00:10 +05:00
Alexander Mikhaylenko
bf2620f041 checkbutton: Claim sequence on release instead of press
Make it possible to drag windows from check buttons in future.
2021-01-29 12:00:10 +05:00
Alexander Mikhaylenko
870b82b541 button: Stop claiming event sequence on press
Currently GtkButton claims the sequence both on press and on release. Stop
claiming it on press and only do it on release, allowing drags to start
from it.

This will allow to remove a hack from GtkWindowHandle.
2021-01-29 12:00:10 +05:00
Matthias Clasen
1635d9fb78 Merge branch 'pango-glyph-positions' into 'master'
Tell pango not to round glyph positions

See merge request GNOME/gtk!2058
2021-01-29 01:41:56 +00:00
Matthias Clasen
20fb155e8c gsk: Fix render node serialization
When looking for ascii glyphs, we must match
the pango shape flags that GTK is using.
2021-01-28 18:19:42 -05:00
Matthias Clasen
da59c77ae2 widget: Use subpixel positioning
Before turning off pangos rounding of glyph positions,
we must check if the cairo we are using is new enough
to have working subpixel positioning (the relevant
cairo commit is 52a7c79fd4ff96bb5fac175f0199819b0f8c18fc).
2021-01-28 18:17:22 -05:00
Matthias Clasen
0d0bdaa02e gsk: Fix a thinko
With subpixel positioning, we need to offset the
cached glyphs by their phase.
2021-01-28 18:16:16 -05:00
Sebastian Keller
04cf5044da wayland: Signal gtk-shell surface destruction to the server
This adds a "release" destructor for the gtk_surface1 interface which
signals to the server that a surface has been destroyed on the client
side, which the current "destroy" does not do.

Ideally the protocol would have specified a destroy request marked as
destructor to handle this automatically, however this is no longer
possible due to the destroy method being implicitly generated in the
absence of an explicit request in the protocol. Adding a destroy request
marked as destructor now would generate a new destroy method that
unconditionally would send the request to the server, which would break
clients running on servers not supporting that request.
2021-01-28 22:31:03 +01:00
Anders Jonsson
b005cd0bbd Update Swedish translation
(cherry picked from commit 5a5bb9099e)
2021-01-28 20:39:25 +00:00
Matthias Clasen
f5379d2047 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3127
2021-01-28 19:12:18 +00:00
Matthias Clasen
98c247ec29 label: Drop some unused includes 2021-01-28 12:27:07 -05:00
Matthias Clasen
38e2f9138d Remove vestigial glade support
These files have not been kept up to date, and
glade doesn't work with GTK4 currently.
2021-01-28 12:27:07 -05:00
Matthias Clasen
3cc7d9b8c0 Move the gesture icons in the right place
Put these images into gtk/icons, where they belong.
2021-01-28 12:27:07 -05:00
Matthias Clasen
1ac9400712 Drop unused logo resource
The inspector no longer sets a window icon.
2021-01-28 12:27:07 -05:00
Matthias Clasen
10d5705b70 Reduce use of GtkStyleContext
Remove some unnecessary uses of GtkStyleContext where
we can directly go to the GtkCssStyle, and and drop
unnnecessary includes.
2021-01-28 12:27:07 -05:00
Matthias Clasen
2d0d579735 Unify border-spacing handling
Avoid using GtkStyleContext unnecessarily, just go
to the css node directly.
2021-01-28 12:27:07 -05:00
Matthias Clasen
ac0f524722 build: Redo the tools build
Move the tools directory to be toplevel, and instead of
recompiling sources twice, link them with the our new
static libgtk.a.
2021-01-28 12:27:07 -05:00
Matthias Clasen
2cd0e5f60b Merge branch 'wip/fl/gl-renderer-fixes' into 'master'
gskglshaderbuilder: bind correct uv location

See merge request GNOME/gtk!3128
2021-01-28 17:15:43 +00:00
Fabio Lagalla
d83502d054 gskglshaderbuilder: bind correct uv location 2021-01-28 17:08:46 +01:00
Matthias Clasen
9e539a7f59 Merge branch 'matthiasc/for-master' into 'master'
builder-tool: Translate GtkImage:pixbuf

See merge request GNOME/gtk!3126
2021-01-28 02:04:48 +00:00
Matthias Clasen
c60247f51f Merge branch 'wip/fl/gl-gradients' into 'master'
OpenGL gradient rendering improvements and additions

See merge request GNOME/gtk!3105
2021-01-28 01:43:57 +00:00
Matthias Clasen
06321511ad builder-tool: Translate GtkImage:pixbuf
The pixbuf property doesn't exist anymore. It is
commonly set to a path in ui files, so translate it
to the file property.
2021-01-27 17:01:51 -05:00
Matthias Clasen
2e7923cad0 Merge branch 'matthiasc/for-master' into 'master'
docs: Add gtk_widget_grab_default to migration guide

See merge request GNOME/gtk!3125
2021-01-27 21:53:02 +00:00
Matthias Clasen
3c66c27caa docs: Add gtk_widget_grab_default to migration guide
Point out the replacement for this api.
2021-01-27 13:50:05 -05:00
Timm Bäder
7f4bd6917e Merge branch 'sophie-h-master-patch-47269' into 'master'
widget: get_name() is not nullable

See merge request GNOME/gtk!3124
2021-01-27 18:34:10 +00:00
Sophie Herold
b89376da55 widget: get_name() is not nullable
Partial revert of !2905
2021-01-27 17:49:17 +00:00
Fabio Lagalla
a1dd6521e8 gskglrenderer: Remove switch fallthrough comments 2021-01-27 12:52:11 +01:00
Fabio Lagalla
0088f840fe gskrendernode: Cache angle in conic gradients 2021-01-27 12:44:10 +01:00
Fabio Lagalla
1b698c896e gskglrenderer: Use gboolean instead of bool 2021-01-27 12:44:10 +01:00
Fabio Lagalla
04000f28e7 gskglrenderer: First class support of repeating-radial-gradient 2021-01-27 12:44:10 +01:00
Fabio Lagalla
976a05f6eb gskglrenderer: First class support of repeating-linear-gradient 2021-01-27 12:44:10 +01:00
Fabio Lagalla
b15902bf44 gskglrenderer: Optimize conic-gradient shader 2021-01-27 12:44:10 +01:00
Fabio Lagalla
5ac7529771 gskglrenderer: Optimize radial-gradient shader 2021-01-27 12:44:10 +01:00
Fabio Lagalla
bbf68c0d9d gskglrenderer: Optimize linear-gradient shader 2021-01-27 12:44:10 +01:00
Matthias Clasen
eeb3dd3511 Merge branch 'fix-can-focus' into 'master'
widget: Fix can-focus

Closes #3610

See merge request GNOME/gtk!3123
2021-01-27 05:34:21 +00:00
Matthias Clasen
7b0ce11e46 Merge branch 'search-entry-capture' into 'master'
Search entry capture

Closes #3098

See merge request GNOME/gtk!3115
2021-01-27 05:14:30 +00:00
Matthias Clasen
8ef1d6a49c widget: Fix can-focus
Setting can-focus to FALSE on a widget is supposed
to prevent focus from entering the entire subtree.
So when we grab focus directly to a widget, we need
to check the can-focus flag not just of the widget
itself, but all its ancestors.

Fixes: #3610
2021-01-26 23:45:06 -05:00
Matthias Clasen
7db60f958d searchentry: Capture events in the bubble phase
This is an unfortunate naming clash, but it avoids
an event handling clash between the capture widget
and its children.

Fixes: #3098
2021-01-26 22:17:57 -05:00
Matthias Clasen
30043e072e Merge branch 'css-crossfade-color' into 'master'
Css crossfade color

See merge request GNOME/gtk!3122
2021-01-27 03:11:17 +00:00
Matthias Clasen
5ee7606779 css: Support colors in cross fades
The CSS Image Spec (Level 4) allows colors in
cross-fade expressions to specify solid-color images.

Support this.
2021-01-26 21:14:09 -05:00
Matthias Clasen
25409c5a5a css: Add a constructor for GtkCssImageFallback
Add a way to create a solid color image.
2021-01-26 21:10:11 -05:00
Matthias Clasen
51122dd287 docs: Cosmetics
Tweak the css docs slightly.
2021-01-26 20:33:16 -05:00
Matthias Clasen
ec9159f983 Merge branch 'gst-vaapi-fix-pre' into 'master'
Minor fixes to gtkgstsink

See merge request GNOME/gtk!3120
2021-01-27 01:11:54 +00:00
Matthias Clasen
f3d77d1c21 Merge branch 'css-text-decoration' into 'master'
css: Fix text-decoration-line support

Closes #3621

See merge request GNOME/gtk!3121
2021-01-27 00:42:40 +00:00
Matthias Clasen
1258fcaaf4 css: Fix text-decoration-line support
This property needs to be treated as flags, not as
enum, since it should be possible to specify more
than one value, e.g.

text-decoration-line: underline overline;

Tests included.

Fixes: #3621
2021-01-26 17:53:14 -05:00
Jan Alexander Steffens (heftig)
00fd60aaa8 gtkgstsink: Use video_frame_free also for the GL path
The video frame needs to stay mapped while the texture is in use.

Avoid using g_memdup because the structure is not supposed to be moved.
2021-01-26 20:30:47 +01:00
Jan Alexander Steffens (heftig)
c7a7d0582a gtkgstsink: Report allocation size even if no pool requested
We can do that so we should.
2021-01-26 20:30:47 +01:00
Matthias Clasen
b6e7acfb90 Merge branch 'matthiasc/for-master' into 'master'
docs: Update border-size docs

See merge request GNOME/gtk!3119
2021-01-26 16:25:24 +00:00
Matthias Clasen
40eae298d5 docs: Update border-size docs
GtkCenterLayout respected border-size as well.
2021-01-26 10:40:22 -05:00
Marek Černocký
09a9131a10 Updated Czech translation 2021-01-26 16:21:18 +01:00
Marek Černocký
c93c9f5c2a Updated Czech translation 2021-01-26 16:12:36 +01:00
Matthias Clasen
7f08adc23e Merge branch 'ebassi/for-master' into 'master'
Fixes for gdk_surface_translate_coordinates()

See merge request GNOME/gtk!3118
2021-01-26 13:57:50 +00:00
Emmanuele Bassi
f41012080f Validate arguments
We're just assuming everything is not NULL or with a valid type.
2021-01-26 12:56:32 +00:00
Emmanuele Bassi
786e9d351c Make the inout argument logic clearer
It's easy to misread a `+=`.
2021-01-26 12:54:53 +00:00
Emmanuele Bassi
3d2cf97fbf Fix annotations
The arguments are really (inout), not (out).
2021-01-26 12:54:00 +00:00
Matthias Clasen
1fe6fb6739 Merge branch 'circular-menubutton' into 'master'
Allow circular menubuttons

Closes #3423 and #3523

See merge request GNOME/gtk!3117
2021-01-26 12:47:38 +00:00
Emmanuele Bassi
6710eb5eb3 Merge branch 'ricotz/for-master' into 'master'
gdk: Add missing g-i annotations for gdk_surface_translate_coordinates

See merge request GNOME/gtk!3112
2021-01-26 12:28:55 +00:00
Matthias Clasen
80b1d55683 Merge branch 'css-overline' into 'master'
css: Support overline

See merge request GNOME/gtk!3116
2021-01-26 05:44:14 +00:00
Matthias Clasen
1cebc4316b Allow circular menubuttons
Fixes #3523
2021-01-26 00:20:23 -05:00
Matthias Clasen
20895d6f3f Merge branch 'adaptive-emojichooser' into 'master'
Adaptive emojichooser

Closes #3307

See merge request GNOME/gtk!2989
2021-01-26 05:07:46 +00:00
Matthias Clasen
65a4118d50 css: Support overline
We can support text-decoration-line: overline,
since pango supports it now.
2021-01-26 00:04:04 -05:00
Matthias Clasen
4857829aaa popover: Try to not exceed monitor bounds
When the natural size of the popover exceeds
the monitor width, clamp it to fit on screen.

This gives the Emoji chooser a chance to
work on phone screens.

Fixes: #3307
2021-01-25 23:33:04 -05:00
Matthias Clasen
2ea4574caf emojichooser: Allow the section buttons to wrap
Use a flowbox instead of a horizontal box for
the section buttons at the bottom, so they can
wrap and allow for narrow layout.

We also need to stop giving the scrolledwindow
a content height, so it can shrink to make room
for more rows of section buttons.
2021-01-25 23:32:15 -05:00
Matthias Clasen
102b74f9eb emojichooser: Make keynav work with != 7 columns
The number of 7 columns was hardcoded in a few places
related to keynav across sections. The flowbox does
not have an api for it, but we can find out anyway
how many columns there are.
2021-01-25 23:32:08 -05:00
Matthias Clasen
8a0d4dfa94 searchbar: Capture events in the bubble phase
This is an unfortunate naming clash, but it avoids
an event handling clash between the capture widget
and its children.

Fixes: #3098
2021-01-25 22:16:29 -05:00
Matthias Clasen
b4e645862a searchbar: Fix documentation mishap
The css section was inserted between the example
and the sentence referring to it.
2021-01-25 22:15:56 -05:00
Matthias Clasen
ea48506a32 Merge branch 'simplify-get-module-path' into 'master'
modules: Simplify _gtk_get_module_path

See merge request GNOME/gtk!3113
2021-01-26 02:53:38 +00:00
Jan Alexander Steffens (heftig)
23f0a29260 modules: Simplify _gtk_get_module_path
Remove the bizarre loops.
2021-01-25 22:47:16 +01:00
Rico Tzschichholz
9249717cf4 gdk: Add missing g-i annotations for gdk_surface_translate_coordinates 2021-01-25 20:18:33 +01:00
Matthias Clasen
4196dfc374 Merge branch 'wip/jimmac/larger-scrollbars-gtk4' into 'master'
Adwaita: make scrollbars larger

Closes #1886

See merge request GNOME/gtk!3109
2021-01-25 13:35:47 +00:00
Jakub Steiner
23af707b41 Adwaita: make scrollbars larger
When using scrollbars as active controls, rather than their primary role as indicators,
increase their size as click targets.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1886
2021-01-25 14:15:22 +01:00
Matthias Clasen
421088c3a0 Merge branch 'transform-origin' into 'master'
Transform origin

See merge request GNOME/gtk!3108
2021-01-25 12:58:36 +00:00
Matthias Clasen
749f1a7c00 Add a reftest for transform-origin 2021-01-24 23:47:10 -05:00
Matthias Clasen
344f9fcf05 css: Implement transform-origin
Implement most of transform-origin. We only
handle the xy components currently, which lets
us reuse the position value implementation that
is used for background-position.
2021-01-24 22:49:08 -05:00
Matthias Clasen
4c971cd4da docs: Fix reference for css transform
Refer to the canonical location for the css
transform spec.
2021-01-24 22:48:00 -05:00
A S Alam
43d553dcfb Update Punjabi translation
(cherry picked from commit 64519d73bb)
2021-01-24 22:52:47 +00:00
A S Alam
66264f9a3d Update Punjabi translation
(cherry picked from commit 518331812e)
2021-01-24 22:42:39 +00:00
Efstathios Iosifidis
269f369541 Update Greek translation
(cherry picked from commit 281c17c400)
2021-01-24 10:17:36 +00:00
Matthias Clasen
1973019962 Merge branch 'static-lib-for-tests' into 'master'
Static lib for tests

See merge request GNOME/gtk!3107
2021-01-23 16:15:23 +00:00
Matthias Clasen
fe515c4c1c testsuite: Link some tests statically
Link tests for private apis statically.
2021-01-23 10:34:57 -05:00
Matthias Clasen
14f0a0addb Create a static library
Rearrange our build to create a libgtk.a for the the contents of gtk/,
and build libgtk-4.so from our per-subdirectory static libraries.
This will let us link tests statically for testing internal apis.
2021-01-23 10:31:23 -05:00
Matthias Clasen
64a2d0221c Merge branch 'lsan-leaks-2' into 'master'
Lsan leaks 2

See merge request GNOME/gtk!3106
2021-01-22 20:08:54 +00:00
Matthias Clasen
0ef91c3ba8 Avoid a buffer overrun
We were putting the '\0' behind the end. Oops.
2021-01-22 13:56:04 -05:00
Matthias Clasen
2adcb7be71 Tweak lsan suppressions
We don't use atk-bridge anymore, and we don't want
to see gio leaks.
2021-01-22 13:32:41 -05:00
Matthias Clasen
a332f2402a ci: Don't print lsan suppressions
Printing these out breaks TAP output, and we really
aren't interested in them.
2021-01-22 13:01:09 -05:00
Matthias Clasen
131a61c51b testsuite: Fix a leak
asan pointed out that the array tests leak.
2021-01-22 11:50:04 -05:00
Matthias Clasen
39d5dd89c5 Avoid a heap-use-after-free
_gtk_gesture_cancel_sequence frees the struct pointed to by data,
so don't write to it afterwards. Found by asan.
2021-01-22 11:39:04 -05:00
Danial Behzadi
341efe9a40 Update Persian translation 2021-01-22 14:57:52 +00:00
Matthias Clasen
5ed6f89b4a Merge branch 'lsan-leaks' into 'master'
Lsan leaks

See merge request GNOME/gtk!3104
2021-01-22 12:30:22 +00:00
Matthias Clasen
4d609149d2 Merge branch 'tests-without-diff' into 'master'
testsuite: Stop requiring diff

See merge request GNOME/gtk!3103
2021-01-22 05:16:08 +00:00
Matthias Clasen
0d790505aa Force malloc of g_slices in asan build
Otherwise leaks could be missed.
2021-01-22 00:13:13 -05:00
Matthias Clasen
a486536925 Remove libc from leak suppression list
Every program starts in __libc_start_main, so this would suppress
everything. This doesn't happen in practice because asan by default
is unable to unwind the stack. Setting
ASAN_OPTIONS=fast_unwind_on_malloc=0,malloc_context_size=15 can unwind
the stack, and if malloc_context_size is large enough it will indeed
suppress everything.
2021-01-22 00:12:46 -05:00
Matthias Clasen
e808fb424a testsuite: Stop requiring diff
Unify the many copies of diff_with_file in one source
file, and patch it to detect diff at runtime and fall
back to a simple strcmp if we don't have it. Make all
tests use this new testutils.c, and stop requiring
diff for building the tests.

This should let us allow to build on Windows with the
default value for -Dbuild-tests.
2021-01-21 23:57:24 -05:00
Matthias Clasen
6c54abeca7 wayland: Explicitly announce ssd for kwin
Without this, kwin correctly assumes that we are
using client-side decorations. This is a port
of 32ae97f1 from GTK 3.24.

Fixes: #3609
2021-01-21 22:45:47 -05:00
Daniel Șerbănescu
d24b8a094c Update Romanian translation 2021-01-21 19:27:47 +00:00
Emmanuele Bassi
c46391420f Merge branch 'ebassi/lazier-a11y' into 'master'
Lazier accessibility

See merge request GNOME/gtk!3102
2021-01-21 18:57:34 +00:00
Yuri Chornoivan
68df7527f7 Update Ukrainian translation 2021-01-21 18:23:25 +00:00
Matthias Clasen
5a3c3d8210 Merge branch 'inspector-controllers' into 'master'
Inspector controllers

See merge request GNOME/gtk!3101
2021-01-21 18:15:57 +00:00
Emmanuele Bassi
95ceb49770 a11y: Make GtkATContext realization lazier
We only realize the ATContext on the top level, which will create an
GtkAtSpiRoot object and the corresponding GtkAtSpiCache object. Whenever
an AT connects to the accessibility bus, and asks for the various
objects, all the ATContext will be realized on demand.
2021-01-21 16:40:57 +00:00
Emmanuele Bassi
0bde58ffd7 a11y: Avoid signal emission during cache population
If we're responding to a request to get all the cached items, there's no
need to emit signals when adding an ATContext to the cache.
2021-01-21 16:40:57 +00:00
Matthias Clasen
ccd9827b63 inspector: Redo the actions page
Don't create widgets in bind, instead just set
the new action on the action-editor, and let it
recreate the parts that need to be recreated.
2021-01-21 10:25:13 -05:00
Matthias Clasen
db189cfb9f inspector: Reshuffle action editor
Prepare the action editor for being able to change its
actions after creation.
2021-01-21 10:24:31 -05:00
Matthias Clasen
7527f181d5 inspector: Simplify action editor
We are not using the size group anymore, so drop it.
2021-01-21 10:20:21 -05:00
Matthias Clasen
c05b418512 inspector: Split out variant editor 2021-01-21 10:19:18 -05:00
Matthias Clasen
e97d996fe4 inspector: Redo the shortcuts page
Use a column view here.
2021-01-21 10:19:18 -05:00
Matthias Clasen
0537b167ca inspector: Redo the controllers page
Use a column view, and only show the widgets own
controllers.
2021-01-21 10:19:18 -05:00
Matthias Clasen
40446201ff Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

Closes #3607

See merge request GNOME/gtk!3100
2021-01-21 04:22:13 +00:00
Matthias Clasen
fff6b35821 inspector: Redo the controllers page
Use a column view, and only show the widgets own
controllers.
2021-01-20 18:51:01 -05:00
Emmanuele Bassi
75f2d7583f Abort if the shared memory pool cannot be created
If we cannot allocate memory, we cannot create any windowing system
surface. There's no coming back from that.

Fixes: #3607
2021-01-20 19:10:54 +00:00
Matthias Clasen
1fd8d3b487 Merge branch 'matthiasc/for-master' into 'master'
docs: Update getting started section

Closes #3601

See merge request GNOME/gtk!3099
2021-01-20 15:54:37 +00:00
Emmanuele Bassi
a1216599ff Add rename-to annotation for GtkListStore.insert_valuesv()
The vector-based variant should shadow the variadic arguments function
in bindings.
2021-01-20 14:10:17 +00:00
Emmanuele Bassi
8fff0e0fdf docs: Reformat GtkListStore.insert_values() 2021-01-20 14:10:17 +00:00
Emmanuele Bassi
439727a84a Add more directions to the issue templates
Let's hope people read them.
2021-01-20 14:10:17 +00:00
Matthias Clasen
3a18a6dddf docs: Update getting started section
We were still talking about draw signals here,
which don't exist anymore.

Fixes: #3601
2021-01-20 08:01:54 -05:00
Matthias Clasen
d7050c63ae Merge branch 'treeview-sort-arrows' into 'master'
Redo arrow icons in various widgets

Closes #3577

See merge request GNOME/gtk!3097
2021-01-19 21:24:04 +00:00
Balázs Meskó
b7c88ec87d Update Hungarian translation 2021-01-19 20:47:20 +00:00
Matthias Clasen
5985b62f60 columnview: Redo indicator arrows
Use the same approach as GtkTreeViewColumn for sort
indicators. Luckily, the same css works for both.
2021-01-19 14:24:19 -05:00
Matthias Clasen
e7c29b989c menbutton: Redo indicator arrows
Instead of hardcoding icon names in the widget, use
arrow.none, arrow.up, arrow.down, arrow.left, arrow.right
styles and set the icon to use with -gtk-icon-source. This
lets themes change the icons that are used here, without
forcing all uses of pan-up/down/start/end-symbolic to be
treated the same.

Document this in the menubutton CSS docs.
2021-01-19 14:02:23 -05:00
Matthias Clasen
2100e427d9 treeviewcolumn: Redo sort arrows
Instead of hardcoding icon names in the widget, use
sort-indicator.ascending and sort-indicator.descending styles
and set the icon to use with -gtk-icon-source. This lets themes
change the icon that is used here, without forcing all uses of
pan-up/down-symbolic to be treated the same.

Document this in the treeview CSS docs.

Fixes: #3577
2021-01-19 14:02:16 -05:00
Matthias Clasen
2550d6dc63 Merge branch 'wip/kalev/dist-HighContrast-dark' into 'master'
dist: Fix css theme disting after HighContrast-dark changes

See merge request GNOME/gtk!3095
2021-01-19 12:08:21 +00:00
Matthias Clasen
ca72fae884 Merge branch 'issue-2436-gtk4' into 'master'
macOS: fix #2436 raise transient window on focus

Closes #2436

See merge request GNOME/gtk!3094
2021-01-19 11:56:54 +00:00
Matthias Clasen
4fc1af14a7 Merge branch 'wip/kalev/NEWS.pre-4.0' into 'master'
Split NEWS for pre-4.0 changes

See merge request GNOME/gtk!3096
2021-01-19 11:43:58 +00:00
Kalev Lember
1a30ec6da6 dist: Fix css theme disting after HighContrast-dark changes
Commit f60d245e32 renamed it from
HighContrast-inverse.css to HighContrast-dark.css.
2021-01-19 10:50:30 +01:00
Kalev Lember
e77d519482 Split NEWS for pre-4.0 changes
Similar to commit 87e9f0895b that did the
same for older releases, this commit splits out pre-4.0 changes to
separate NEWS.pre-4.0 file.
2021-01-19 10:40:09 +01:00
Thomas Holder
59806eee38 macOS: fix #2436 raise transient window on focus
Ported from gtk-3-24 e278f38905

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2436
2021-01-19 09:31:00 +01:00
Alexander Mikhaylenko
5968b10b0b listitemwidget: Activate on release instead of press
Single click activation should only be done on release and not on press,
otherwise it breaks touch scrolling. Double-click activation still can be
done on press.

This matches the GtkListBox behavior as well.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3345
2021-01-19 12:36:32 +05:00
Matthias Clasen
e6f0103940 Merge branch 'version-bump' into 'master'
Version bump

See merge request GNOME/gtk!3093
2021-01-19 04:48:26 +00:00
Matthias Clasen
cbaad3dbd9 Add version macros for 4.2
These will be needed for adding new API.
2021-01-18 23:10:18 -05:00
Matthias Clasen
ee43a6a603 Bump version to 4.1
master is now open for 4.2 API additions.

Includes an update for the one test we have that
has the version number in its expected output.
2021-01-18 23:09:44 -05:00
Matthias Clasen
1ac1147ecb Merge branch 'check_button_activate' into 'master'
Add activate signal to GtkCheckButton

Closes #3525 and #3550

See merge request GNOME/gtk!3012
2021-01-19 04:06:01 +00:00
Matthias Clasen
1edbc1f1f9 Merge branch 'wip/jtojnar/fix-pc-vulcan' into 'master'
build: Use Meson’s module for building .pc files

Closes #3517

See merge request GNOME/gtk!3005
2021-01-19 04:04:34 +00:00
Matthias Clasen
146b4c93ba 4.0.2 2021-01-18 22:23:57 -05:00
Matthias Clasen
94f90f457a Merge branch 'fix-cell-renderer-toggle' into 'master'
cellrenderertoggle: Fix css node handling

Closes #3599

See merge request GNOME/gtk!3092
2021-01-19 02:09:10 +00:00
Matthias Clasen
6b7d56ac49 cellrenderertoggle: Fix css node handling
Commit cbbbf44dd4 tried to replace
gtk_style_context_save_named with an explicit
css node to save to, but it failed, and the failure
was showing up as crashes in the inspector.

Fix by Benjamin Otte.

Fixes: #3599
2021-01-18 20:52:59 -05:00
Emmanuele Bassi
1635d7be8c Merge branch 'cherry-pick-gtk_file_chooser_set_current_name-fix-type' into 'master'
gtk_file_chooser_set_current_name: fix type of name argument

See merge request GNOME/gtk!3091
2021-01-18 23:19:00 +00:00
Thomas Holder
992cd088cf gtk_file_chooser_set_current_name: fix type of name argument
The description says UTF-8 string, but the annotation said filename.

Cherry-picked from gtk-3-24 1573ff6803
2021-01-18 22:14:03 +01:00
Matthias Clasen
f6010b2a59 Merge branch 'doap-update' into 'master'
Update the gtk.doap file

See merge request GNOME/gtk!3088
2021-01-18 14:40:02 +00:00
Matthias Clasen
9222a5fd6d Update the gtk.doap file
Add relevant people as maintainers.
2021-01-18 09:14:50 -05:00
Florentina Mușat
6f7fb6ba5a Update Romanian translation 2021-01-18 13:06:18 +00:00
Chun-wei Fan
a57a144f8e Merge branch 'win32-remove-layered-windows' into 'master'
GDK/Win32: Remove layered windows usage

See merge request GNOME/gtk!2782
2021-01-18 10:42:37 +00:00
Chun-wei Fan
7b47e3225b GDK/Win32: Remove layered windows usage
In GTK4, we are now defaulting to the OpenGL renderer with the Cairo renderer
only used as a fallback, so there is no point keeping the code paths that use
layered windows as layered windows do not work well with OpenGL nor Vulkan.
2021-01-18 12:48:16 +08:00
Matthias Clasen
6aa893e091 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3437

See merge request GNOME/gtk!3087
2021-01-17 17:51:15 +00:00
Matthias Clasen
5aa03bcb0d aboutdialog: Fix initial focus
When GtkAboutDialog was changed to derive from
GtkWindow, it lost the initial focus handling that
GtkDialog has. Reinstate some of it.

Fixes: #3437
2021-01-17 11:53:53 -05:00
Matthias Clasen
d7060025e0 inspector: Avoid a critical
Avoid a critical when closing the inspector with the
recorder page open.
2021-01-17 10:55:53 -05:00
Matthias Clasen
00883016af Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #3593

See merge request GNOME/gtk!3086
2021-01-17 14:20:13 +00:00
Fabio Tomat
f0d8b614d0 Update Friulian translation 2021-01-17 13:11:25 +00:00
Piotr Drąg
ddbd574643 Update Polish translation 2021-01-17 12:38:17 +01:00
Timm Bäder
5ea3777599 widget: Fix gtk_widget_class_add_binding() argument name 2021-01-17 08:12:14 +01:00
Timm Bäder
a3949763f2 Add nullable annotations to GtkShortcutFunc
Fixes #3593
2021-01-17 08:11:42 +01:00
Matthias Clasen
1b961a9ae2 Merge branch 'surface-scale' into 'master'
Surface scale

Closes #3578

See merge request GNOME/gtk!3085
2021-01-17 05:23:22 +00:00
Timm Bäder
d9f6b268d3 gl renderer: Use rect_contains_rect() copy
And this way the contains_rect() inside
rounded_inner_rect_contains_rect() goes from 3.3% to 0.79% in the
fishbowl when rendering the levelbars.
2021-01-17 04:39:26 +01:00
Timm Bäder
934b91f65f label: Remove unneeded NULL guards
The pointers passed to GtkWidgetClass::measure cannot be NULL
2021-01-17 04:39:26 +01:00
Timm Bäder
c3050231d1 label: Refactor get_layout_location
Make this function shorter, the parameters non-nullable and the simple
cases more explicit.
2021-01-17 04:39:26 +01:00
Timm Bäder
4d7a01562e gl renderer: Don't reset offset when drawing offscreen 2021-01-17 04:39:26 +01:00
Timm Bäder
650eed7f72 gl renderer: Properly y-flip non-offscreen children of rounded clips 2021-01-17 04:39:26 +01:00
Timm Bäder
ec8614e8e4 label: Fix a potential memory leak
This only happens in error cases so not very interesting. Anyway, try to
make scan-build happy.
2021-01-17 04:39:26 +01:00
Timm Bäder
cb41b96a9e builderparser: Save finalizers in a GPtrArray
We get up to 370 of these when starting the widget-factory.
2021-01-17 04:39:26 +01:00
Timm Bäder
872b46a527 widget: Shorten get_halign() a bit 2021-01-17 04:39:26 +01:00
Timm Bäder
b1c8613dbe accessible: Fix memory leak if context is unset
Unref the acessible values
2021-01-17 04:39:26 +01:00
Timm Bäder
de6cd4f0d2 builder: Use a GPtrArray when parsing signals 2021-01-17 04:39:26 +01:00
Timm Bäder
aec2fb939f builderparser: Keep properties in a GPtrArray 2021-01-17 04:39:26 +01:00
Timm Bäder
69293db804 builderparser: Only allocate subparser stack when needed
Out of the 3.3k possibly_finish_subparser calls when opening the
widget-factory, only 300 need one.
2021-01-17 04:39:26 +01:00
Matthias Clasen
61a7ebf980 Merge branch 'matthiasc/for-master' into 'master'
docs: Add details

See merge request GNOME/gtk!3084
2021-01-16 20:36:44 +00:00
Matthias Clasen
f14762b026 x11: Notify on surface scale changes
Emit property notification when the surface scale
changes.
2021-01-16 15:22:46 -05:00
Matthias Clasen
187d261400 wayland: Notify on surface changes
When the width, height or scale of a surface changes,
emit property change notification.
2021-01-16 15:22:46 -05:00
Matthias Clasen
e905f7ff7c native: Listen for scale changes
Connect to change notification for the surface
scale-factor property, and update the widgets
when it changes.

Fixes: #3578
2021-01-16 15:22:46 -05:00
Matthias Clasen
aefc630d29 surface: Add a scale-factor property
This will allow us to notify when the scale changes.
2021-01-16 15:22:46 -05:00
Matthias Clasen
a5e929ce36 docs: Add details
Explain the difference between GtkPicture and GtkImage,
and when you might want to use which.
2021-01-16 14:45:20 -05:00
Yuri Chornoivan
1641d365f5 Update Ukrainian translation 2021-01-16 18:44:30 +00:00
Matthias Clasen
07d9cd8efe Merge branch 'matthiasc/for-master' into 'master'
inspector: Add a legend for the layout overlay

See merge request GNOME/gtk!3083
2021-01-16 18:37:58 +00:00
Matthias Clasen
29868b2a05 docs: Remove a reference to configure events
Those don't exist anymore.
2021-01-16 12:52:06 -05:00
Matthias Clasen
691b6b88ea inspector: Add a legend for the layout overlay
Colors are more useful if you know what they represent.
2021-01-16 12:38:24 -05:00
Matthias Clasen
2ee1a00177 Merge branch 'matthiasc/for-master' into 'master'
overlaylayout: Set the child type in the class

See merge request GNOME/gtk!3082
2021-01-16 03:55:22 +00:00
Matthias Clasen
144cf2d040 overlaylayout: Set the child type in the class
We don't need to override create_layout_child here,
and setting the child type has the advantage that
the layout properties are showing up in the inspector.
2021-01-15 22:35:11 -05:00
Matthias Clasen
e1a308d151 Merge branch 'rtl-margins' into 'master'
Flip margin-start and -end in RTL

Closes #3583

See merge request GNOME/gtk!3081
2021-01-16 00:19:41 +00:00
Matthias Clasen
bbfaacb598 Add a reftest for box flipping
Test that a horizontal box changes the order of its
children in RTL, and that widget margins flip start
and end.

This tests the fix in d89ff71819.
2021-01-15 18:43:31 -05:00
Matthias Clasen
d89ff71819 Flip margin-start and -end in RTL
We lost this at some point, but the widget margins
are still meant to be relative to the text direction.

Fixes: #3583
2021-01-15 14:58:21 -05:00
Matthias Clasen
141c725489 Merge branch 'macos-ci-cairo' into 'master'
Revert "Fix the cairo build on OS X"

See merge request GNOME/gtk!3080
2021-01-15 15:56:37 +00:00
Matthias Clasen
bbc3aa4ff9 Revert "Fix the cairo build on OS X"
This reverts commit 710ef00dfe.

The cairo change has been merged.
2021-01-15 09:07:02 -05:00
Marek Černocký
f7856f29fd Updated Czech translation 2021-01-15 14:10:17 +01:00
Matthias Clasen
7b69c58deb Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3078
2021-01-15 05:48:00 +00:00
Matthias Clasen
f60d245e32 Make HighContrastInverse a dark variant
Make HighContrastInverse available as the dark variant of HighContrast,
in addition to being a standalone theme. This regularizes our theme
variants, and doesn't hurt.
2021-01-14 22:55:52 -05:00
Matthias Clasen
f04e5bd590 Make Adwaita-dark available as a theme
This makes Adwaita-dark available as a standalone
theme.
2021-01-14 22:42:50 -05:00
Matthias Clasen
90c428b4a7 Merge branch 'wip/carlosg/mark-valid-portal-settings' into 'master'
gdk/wayland: Mark matched settings from the portal as valid

See merge request GNOME/gtk!3076
2021-01-14 18:33:45 +00:00
Carlos Garnacho
97b5fad131 gdk/wayland: Mark matched settings from the portal as valid
Commit e6209de962 added some checks on TranslationEntry.valid in
order to figure out whether using the new font settings or the
old g-s-d ones. However that's only set in the non-sandboxed case.

This makes sandboxed applications fallback to the old (and also
non-existing with modern g-s-d) settings, possibly resulting in
ugly defaults being picked.

Fix this by also marking TranslationEntry elements as valid when
using the settings portal, precisely those entries that we are able
to read and match with our own table.
2021-01-14 15:57:29 +01:00
Matthias Clasen
285a91715d Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3075
2021-01-14 13:38:18 +00:00
Matthias Clasen
880468f5a3 docs: Fix a heading gotcha
One of the many migration guide sections was too
prominent.
2021-01-14 08:13:34 -05:00
Matthias Clasen
6ddbb2a402 doc: Clarify some migration hints
Don't mention GdkSurface::layout as replacement for
GtkWindow::configure-event. Instead, explain how to
save window state.
2021-01-14 07:52:36 -05:00
Daniel Mustieles
7eab565225 Updated Spanish translation 2021-01-14 10:35:43 +01:00
Daniel Mustieles
b34101d45d Updated Spanish translation 2021-01-14 10:35:35 +01:00
Christian Hergert
6c21a7be0b Merge branch 'nacho/macos-stylus' into 'master'
Support stylus devices on macos

See merge request GNOME/gtk!3058
2021-01-13 16:13:14 +00:00
Anders Jonsson
a6f2bcb220 Update Swedish translation 2021-01-12 21:55:52 +00:00
Anders Jonsson
ef0db01d5c Update Swedish translation 2021-01-12 21:51:53 +00:00
Emmanuele Bassi
ef33ec639c Merge branch 'ebassi/aspect-frame-doc' into 'master'
Ebassi/aspect frame doc

See merge request GNOME/gtk!3073
2021-01-12 16:50:31 +00:00
Matthias Clasen
27ca4434e2 Remove a misleading comment 2021-01-12 10:50:41 -05:00
Matthias Clasen
9861c7d25c Merge branch 'dist-css' into 'master'
dist: Add a dist script to generate css

See merge request GNOME/gtk!3074
2021-01-12 14:04:51 +00:00
Matthias Clasen
13ef82fc4d dist: Add a dist script to generate css
When I added the sassc option, I failed to ensure that
the theme css is included in the tarballs. This is required
to make tarball builds with -Dsassc=disabled work.
2021-01-12 08:42:18 -05:00
Emmanuele Bassi
b33ca43e14 Merge branch 'ebassi/atspi-path-sanitize' into 'master'
a11y: Fix leak

See merge request GNOME/gtk!3072
2021-01-12 12:37:31 +00:00
Emmanuele Bassi
39e07a8d56 Document limits of gtk_aspect_frame_get_ratio()
The GtkAspectFrame:ratio getter will return the value set, not the
actual ratio computed in case GtkAspectFrame:obey-child is TRUE.
2021-01-12 12:28:18 +00:00
Emmanuele Bassi
5286743cbe Document GtkAspectFrame properties 2021-01-12 12:28:00 +00:00
Emmanuele Bassi
58bb998ef0 docs: GtkAspectFrame is not a GtkFrame any more 2021-01-12 12:23:14 +00:00
Emmanuele Bassi
a56b2900dd a11y: Fix leak
Introduced by me in commit 03b60a2d5e.
2021-01-12 12:01:29 +00:00
Emmanuele Bassi
ff34124394 Merge branch 'ebassi/atspi-path-sanitize' into 'master'
a11y: Sanitize the AT-SPI object path further

See merge request GNOME/gtk!3071
2021-01-12 11:36:52 +00:00
Emmanuele Bassi
03b60a2d5e a11y: Sanitize the AT-SPI object path further
When falling back to g_get_prgname(), we need to take into account that
the program name may be the full argv[0] path, which will end up messing
the DBus object path.
2021-01-12 11:15:28 +00:00
Benjamin Otte
d939d04885 Merge branch 'about-dialog-icon-size' into 'master'
About dialog icon size

See merge request GNOME/gtk!3070
2021-01-11 23:13:21 +00:00
Matthias Clasen
73fb28a058 iconhelper: Recreate the texture when needed
When the icon size changes, we want to reload themed
icons.

This was showing up as the GtkImage in about dialogs
getting a big size with the same small icon upon
changing -gtk-icon-size in the inspector.
2021-01-11 17:50:05 -05:00
Matthias Clasen
65eaf8e8c4 Adwaita: Make about dialog icons big
Use 128 as the icon size for the image widget
in about dialogs.
2021-01-11 17:50:05 -05:00
Matthias Clasen
beeedb5141 aboutdialog: Set icon-size for the logo
Make it explicit that we want large icons here.
2021-01-11 17:50:05 -05:00
Matthias Clasen
1d40750a60 aboutdialog: Set a style class
Add the .aboutdialog style class to toplevel
widget of about dialogs, similar to what we
do for e.g. GtkAssistant.
2021-01-11 17:46:55 -05:00
Matthias Clasen
96baf9769a about dialog: Remove manual icon sizing
We have icon theme code to do that for us.
2021-01-11 17:46:55 -05:00
Matthias Clasen
5044031b53 Merge branch 'wip/kalev/gcc-11' into 'master'
Avoid diagnostics for gcc-11 false positive out of bounds accesses

See merge request GNOME/gtk!3064
2021-01-11 22:04:52 +00:00
Emmanuele Bassi
9f7119ee58 Merge branch 'wip/fl/glrenderer-fixes' into 'master'
gl renderer: print fragment shader info

See merge request GNOME/gtk!3069
2021-01-11 16:44:00 +00:00
Kalev Lember
c514c41d0e Avoid diagnostics for gcc-11 false positive out of bounds accesses
This is a patch by Jeff Law <law@redhat.com> done in downstream Fedora
to fix the build with gcc 11.
2021-01-11 17:19:36 +01:00
Jakub Steiner
45848c5298 Merge branch 'wip/jimmac/adjust-for-contemporary-trends' into 'master'
Wip/jimmac/adjust for contemporary trends

Closes #3568 and #3560

See merge request GNOME/gtk!3060
2021-01-11 16:09:08 +00:00
Fabio Lagalla
8c61038b9f gl renderer: print fragment shader info
It was logged twice the vertex shader info, instead
2021-01-11 17:06:03 +01:00
Jakub Steiner
b5cb2f7e41 Adwaita: update image assets
- reflect button styling
- ignore backdrop for non buttons
2021-01-11 16:24:22 +01:00
Matthias Clasen
8af0d4b51f Merge branch 'otte/for-master2' into 'master'
Remove guarantees we do not intend to hold

See merge request GNOME/gtk!3066
2021-01-11 15:07:40 +00:00
Jakub Steiner
378ad75d48 Adwaita: scales border
- remove -alt specialcasing for a straight forward border like
  everything else and avoid broken :dark and HC
2021-01-11 16:00:32 +01:00
Matthias Clasen
01d19e2aa4 Merge branch 'fix-tablet-4' into 'master'
Wayland: ignore touch/tablet events on destroyed surfaces [GTK4]

See merge request GNOME/gtk!3065
2021-01-11 14:44:27 +00:00
Jakub Steiner
64e16ecaf1 Merge branch 'wip/jimmac/undercorated-active' into 'master'
Adwaita: less dramatic :active for undecorated buttons

Closes #3575

See merge request GNOME/gtk!3068
2021-01-11 14:37:58 +00:00
Jakub Steiner
6a047e53a8 Adwaita: less dramatic :active for undecorated buttons
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3575
2021-01-11 15:00:38 +01:00
Jakub Steiner
31a7bc70c9 Adwaita: fix button border logic
- tint borders dark on non default / blue / red buttons
- just use plain $borders_color otherwise
- fixes HC/HCi
- ditch -alt buttons
2021-01-11 14:08:57 +01:00
Jakub Steiner
874cae1dab Adwaita: flatter, lighter buttons
- lighten up for contrast, less of an oldschool gradient

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3568
2021-01-11 13:50:32 +01:00
Jakub Steiner
7a3dd41dba Adwaita: round progress and levelbars 2021-01-11 13:50:32 +01:00
Jakub Steiner
149962670a Adwaita: :checked:active and checked:hover states
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3560
2021-01-11 13:50:32 +01:00
Jakub Steiner
849e3c8b4b Adwaita: flat scales, progressbars and level bars 2021-01-11 13:50:32 +01:00
Jakub Steiner
c9807f5afe Adwaita: remove edge highlights
- flat is the name of the game
  - kids scream make it flat
  - simplify mixins
2021-01-11 13:50:32 +01:00
Carlos Garnacho
9a9899597c Merge branch 'avoid-pointer-reset-gtk4' into 'master'
wayland: avoid set_cursor() when unchanged or invisible

Closes #3350

See merge request GNOME/gtk!3062
2021-01-11 12:07:01 +00:00
Matthias Clasen
fecb7af66e Merge branch 'surface.compute.win32' into 'master'
Fix surface and geometry computation for Windows (Win32)

Closes #3480

See merge request GNOME/gtk!3067
2021-01-11 11:56:42 +00:00
Ignacio Casal Quinteiro
f5efb15cba Support stylus devices on macos 2021-01-11 11:41:00 +01:00
Chun-wei Fan
d7d4fed0f3 gdk/win32: Fix window display and resizing
Have an implementation of ->request_layout() and ->compute_size() for the Win32
surface backend so that we can properly display and move and resize the
windows, as we request from the Win32 APIs.

Hxndling Aerosnap properly is mostly done except for snap_up(), which needs to
to be looked at later.
2021-01-11 17:55:25 +08:00
Chun-wei Fan
c2c2635763 gdk/win32: Rename 'margins' to 'shadow'
This improves consistency for the code.
2021-01-11 17:53:56 +08:00
Chun-wei Fan
fb33e83c96 gdkwin32-surface.c: Fix return type
gdk_win32_toplevel_present() should now be returning nothing, not a gboolean.
2021-01-11 17:53:47 +08:00
Chun-wei Fan
291ad17a22 gdksurface-win32.c: Decouple mapped state from surface creation
In line with what is done with the Wayland backend, enable the mapped state
independently as needed from the toplevel surface presentation, and also enable
the mapped state if necessary when presenting the popup surface.
2021-01-11 17:53:38 +08:00
Benjamin Otte
0f052d46b2 Remove guarantees we do not intend to hold
The fact that we are using gdk-pixbuf for loading files currrently does not mean we will use it going forward.
Also, "anything gdk-pixbuf can load" does not mean anything, because what gdk-pixbuf can load is a compile-time option.

As new_from_resource() will assert() if it cannot load a resource, we must be very sure that people do not use anything but PNG and JPEG for resources and the docs were not clear on that.
2021-01-10 21:37:03 +00:00
Asier Sarasua Garmendia
506423cf23 Update Basque translation 2021-01-10 18:00:26 +00:00
Asier Sarasua Garmendia
946a496a2e Update Basque translation 2021-01-10 17:59:56 +00:00
Piotr Drąg
d20526570b Update Polish translation 2021-01-10 18:27:55 +01:00
wisp3rwind
8312b9d9ca Wayland: ignore touch/tablet events on destroyed surfaces
When destroying a wl_surface (e.g. when a window or menu is closed), the
surface may continue to exist in the compositor slightly longer than on
the client side. In that case, the surface can still receive input
events, which need to be ignored gracefully.
In particular, this prevents segfaulting on wl_surface_get_user_data()
in that situation.

Reported in
https://gitlab.gnome.org/GNOME/gtk/-/issues/3296

The same issue for pointers/keyboards was reported in
https://bugzilla.gnome.org/show_bug.cgi?id=693338

and fixed with in
bfd7137ffb
3625f17857
a8fc099a72
2021-01-10 12:31:37 +01:00
wisp3rwind
992f092968 wayland: avoid set_cursor() when unchanged or invisible
In pointer_surface_update_scale(), only rescale the cursor surface when
the scale has actually changed and the cursor is on at least one output.

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3350

Right now, this issue is not completely understood, so it might also
involve some questionable handling of cursor surface by sway/wlroots.

However, irrespective of that issue, this patch avoids unnecessary calls to the
compositor, and there should be no drawback: Whenever the pointer enters
a new output, pointer_surface_update_scale() will be called again, such
that correct scaling of the cursor is still ensured.

There is a slight difference: When the cursor leaves the last output,
previously the image was reset to scale factor 1. Now, it keeps whatever
was last. That might be more sensible than the previous behaviour,
assuming that it's likely that when the cursor enter an output again, it
has the same scaling. Alternatively, if one cares about resource usage
at this level, it might make more sense to destroy the surface than
rescaling to 1.
2021-01-09 11:42:59 +01:00
Matthias Clasen
60835227a1 4.0.1 2021-01-09 01:30:13 -05:00
Matthias Clasen
2b6b35d91f build: Add a sassc feature
Add an option to disable css rebuilds. This allows
to build GTK from release tarballs (Which are including
the css) without a sassc dependency.
2021-01-09 01:30:13 -05:00
Matthias Clasen
897164c66c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3565

See merge request GNOME/gtk!3061
2021-01-09 03:56:59 +00:00
Matthias Clasen
441d944c08 droptarget: Some docs cleanups
Fixes #3565, among other things.
2021-01-08 22:24:42 -05:00
Chun-wei Fan
2b8ad6c4b5 gtkffmediafile.c: Use g_snprintf()
Visual Studio 2013 is just shy of being sufficiently C99-compliant to
build GTK master, as it did not support snprintf() in its CRT
implementation.

Use g_snprintf() to cover for this.
2021-01-08 22:24:42 -05:00
Chun-wei Fan
99b2da4c47 gtk/gtksecurememoryprivate.h: Include glib.h
Some compilers somehow do not have `inline` defined, so include glib.h
to ensure that keyword is defined.`
2021-01-08 22:24:42 -05:00
Matthias Clasen
8243b5493b a11y: Avoid __ prefixes for variable names
Seems that msvc does not like that.
2021-01-08 22:24:42 -05:00
Matthias Clasen
d5ef906cff Merge branch 'nacho/seatdefault' into 'master'
Clean ups in seat default

See merge request GNOME/gtk!3057
2021-01-09 01:04:22 +00:00
Ignacio Casal Quinteiro
a720d8bc79 seatdefault: use g_clear_pointer to unref the tools 2021-01-08 13:11:56 +01:00
Ignacio Casal Quinteiro
57691eacc5 seatdefault: rename dispose method 2021-01-08 13:10:56 +01:00
Matthias Clasen
526e24f5b1 Merge branch 'wip/nacho/associated-device' into 'master'
gdkdevice: use g_set_object to set the associated device

See merge request GNOME/gtk!3049
2021-01-07 21:08:46 +00:00
Matthias Clasen
2a79152762 Merge branch 'mcatanzaro/company-unparent-warning' into 'master'
Add critical if widget has a parent during dispose

See merge request GNOME/gtk!3053
2021-01-07 18:37:28 +00:00
Matthias Clasen
f03acaf7ab Merge branch 'mcatanzaro/unparent' into 'master'
Remove incorrect unparenting guidance from migration guide

See merge request GNOME/gtk!3050
2021-01-07 18:35:37 +00:00
Matthias Clasen
4e7ce9edcf Merge branch 'mcatanzaro/gtkbuilder-docs' into 'master'
Improve GtkBuilder documentation

See merge request GNOME/gtk!3055
2021-01-07 18:00:19 +00:00
Matthias Clasen
ff72619333 Merge branch 'mcatanzaro/event-controller-porting-guide' into 'master'
Expand event controller API changes section of GTK 4 porting guide

See merge request GNOME/gtk!3054
2021-01-07 17:55:38 +00:00
Michael Catanzaro
59692599ea Remove incorrect unparenting guidance from migration guide
This rule is almost always wrong, and we're having some trouble agreeing
on replacement text. Let's remove the whole paragraph for now, to avoid
confusion.
2021-01-07 11:39:53 -06:00
Benjamin Otte
4761641098 Add critical if widget has a parent during dispose
This is a refcounting bug. Be very verbose about it instead of trying to
call a function that releases a reference to the widget without
references.
2021-01-07 11:39:32 -06:00
Michael Catanzaro
afaa275dc8 gtkbuilder: fix recommendations that no longer make sense in GTK 4
In GTK 3, it was pretty much always better to use
gtk_builder_new_from_whatever() rather than
gtk_builder_add_from_whatever(). But in GTK 4, this is no longer
generally true. Let's add some context on when you want to use one or
the other.
2021-01-07 11:34:42 -06:00
Michael Catanzaro
c736deb83b Add section on GtkBuilder API changes to GTK 4 migration guide
Thanks to Benjamin for helping with the language.
2021-01-07 11:34:42 -06:00
Emmanuele Bassi
e930a20522 Merge branch 'ebassi/ci-only' into 'master'
ci: Specify `only` for other jobs

See merge request GNOME/gtk!3052
2021-01-07 17:17:44 +00:00
Michael Catanzaro
137f32f9ef Expand event controller API changes section of GTK 4 porting guide
There is more to say about changes to GtkEventController.
2021-01-07 10:53:09 -06:00
Emmanuele Bassi
195b98f19a ci: Only run macOS job on upstream branches
Don't run CI on macOS for forks.
2021-01-07 16:14:04 +00:00
Emmanuele Bassi
87e0a28482 ci: Specify only for other jobs
Otherwise MRs will only run macOS jobs.
2021-01-07 16:13:59 +00:00
Ignacio Casal Quinteiro
3ca3d7efef gdkdevice: use g_set_object to set the associated device 2021-01-07 16:13:39 +01:00
Matthias Clasen
d8d8322912 Merge branch 'wip/jimmac/flat-buttons' into 'master'
Adwaita: fine tune flat button styling

Closes #3481

See merge request GNOME/gtk!3046
2021-01-07 13:42:42 +00:00
Matthias Clasen
1ea1a70fd2 Merge branch 'wip/jimmac/hc-switch-border' into 'master'
HC: switch border color

Closes #3460

See merge request GNOME/gtk!3048
2021-01-07 13:41:40 +00:00
Matthias Clasen
1d5bc2838b Merge branch 'wip/nacho/tool-api' into 'master'
seat: improve api to take into account the tool type

See merge request GNOME/gtk!3047
2021-01-07 13:25:11 +00:00
Ignacio Casal Quinteiro
45ec3fc389 seat: improve api to take into account the tool type
Otherwise if we have several tools with the same serial
and hardware id we might match the wrong tool.
2021-01-07 12:50:48 +01:00
Jakub Steiner
3a5eee7dbe HC: switch border color
- lighten inverted HC borders while darkening the regular/light variant

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3460
2021-01-07 12:44:53 +01:00
Jakub Steiner
0cda6f42b8 Adwaita: fine tune flat button styling
- enough contrast for hover and active, while noticably different in
  normal nad headerbar context (and both light and dark variants).

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3481
2021-01-07 12:12:55 +01:00
Matthias Clasen
0d99ef7cee Merge branch 'X11-surface' into 'master'
x11: fix crash on idle compute size without layout

See merge request GNOME/gtk!3031
2021-01-06 22:13:02 +00:00
Matthias Clasen
7583810c90 Merge branch 'wip/exalm/headerbar' into 'master'
headerbar: Prepend start window controls instead of appending

See merge request GNOME/gtk!3044
2021-01-06 22:10:25 +00:00
Jordi Mas
1341bc0b19 Update Catalan translation 2021-01-06 22:42:44 +01:00
Alexander Mikhaylenko
fd073deea9 headerbar: Prepend start window controls instead of appending
Make sure they are always in the correct position.
2021-01-06 22:04:55 +05:00
Matthias Clasen
5652ab0a61 Merge branch 'macos-ci' into 'master'
Macos ci

See merge request GNOME/gtk!3032
2021-01-06 14:52:11 +00:00
Matthias Clasen
2ff23b08be Merge branch 'wip/jimmac/headerbar-specialcasing' into 'master'
Adwaita: specialcase switches and scales for headerbars

Closes #3504

See merge request GNOME/gtk!3043
2021-01-06 14:40:36 +00:00
Matthias Clasen
0336af06f1 ci: Limit macos runs
We are building the full stack here, which is pretty expensive,
so only do it for merge requests and master.
2021-01-06 09:36:54 -05:00
Matthias Clasen
2af9f1ad62 Merge branch 'wip/jimmac/hc-dim-label' into 'master'
HC: special case .dim-label

Closes #3507

See merge request GNOME/gtk!3042
2021-01-06 13:04:24 +00:00
Jakub Steiner
e657da6658 Adwaita: specialcase switches and scales for headerbars
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3504
2021-01-06 13:02:21 +01:00
Jakub Steiner
fd00aa98ea HC: special case .dim-label
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3507
2021-01-06 12:46:35 +01:00
Timm Bäder
de8a8d7bde Merge branch 'dlech-master-patch-65287' into 'master'
doc: fix annotation for GtkCssLocation

See merge request GNOME/gtk!3041
2021-01-06 08:55:57 +00:00
David Lechner
eb6fbf907f doc: fix annotation for GtkCssLocation
GtkCssLocation is a type so it should be prefixed with # rather than @.
2021-01-06 04:32:09 +00:00
Christian Hergert
4035f86b6d macos: use deprecated NSOnState for older systems 2021-01-05 16:37:30 -08:00
Christian Hergert
855b44f2ed macos: keep array of pasteboard types
To support Sierra, we need to have access to pasteboard types as a
NSString. Constants are provided in later versions of macOS, but we
can emulate that with an array which is initialized on first access.
2021-01-05 16:21:05 -08:00
Christian Hergert
f2e0097cac gtk: fix brace initialization for bloom filter
This was breaking CI for macOS and it is a simple enough change to ensure
that just works for the internal buckets.
2021-01-05 16:21:05 -08:00
Christian Hergert
7c9bc7a204 macos: supply NSPasteboardType when necessary
On older macOS systems, we might need to provide our own typedef
for the NSPasteboardType. It is just a NSString pointer anyway.
2021-01-05 13:54:07 -08:00
Christian Hergert
f4f104c9f9 macos: fix typedef on older macOS
On older systems, we don't have a typedef for gravity. They are a NSString
pointer and we can provide that manually just fine.
2021-01-05 13:53:22 -08:00
Christian Hergert
28a6f0df05 macos: handle point conversion on older macOS
On older systems, the availability of some methods seem to be incorrect
based on Apple documentation. This works around the issue by using
the rect conversion on older systems.
2021-01-05 13:52:11 -08:00
Matthias Clasen
0eab4deab0 Merge branch 'media-caps' into 'master'
media: Be more specific in our caps

See merge request GNOME/gtk!3037
2021-01-05 21:34:27 +00:00
Matthias Clasen
6e8e467cc9 Merge branch 'simplify-toolbar' into 'master'
3to4: Remove GtkToolbar::toolbar_style

See merge request GNOME/gtk!3040
2021-01-05 19:35:46 +00:00
Matthias Clasen
ca9801f5fb 3to4: Remove GtkToolbar::toolbar_style
The property was removed (with the rest of the widget),
so keeping it around in the ui file makes no sense.

Testcase included.
2021-01-05 13:58:58 -05:00
Matthias Clasen
6b6fc1e5d8 Merge branch 'ebassi/migrating-clipboard' into 'master'
Ebassi/migrating clipboard

See merge request GNOME/gtk!3039
2021-01-05 18:41:27 +00:00
Emmanuele Bassi
e3641d0568 Merge branch 'dlech-master-patch-06007' into 'master'
docs: fix parameter reference in gtk_bitset_contains()

See merge request GNOME/gtk!3035
2021-01-05 18:10:59 +00:00
David Lechner
a5b88a53c2 docs: fix parameter reference in gtk_bitset_contains()
This fixes an error in the doc comments where the first parameter was
referred to as @bitset instead of @self.
2021-01-05 11:39:43 -06:00
Emmanuele Bassi
e4d0114e0d docs: Add migration section for GtkClipboard
A simple copy/paste text example, plus directing people towards the
appropriate GType to replace the old convenience API.
2021-01-05 16:51:14 +00:00
Matthias Clasen
f974c5343e Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3038
2021-01-05 16:49:53 +00:00
Daniel Șerbănescu
bc39da0619 Updated the Romanian Translation 2021-01-05 17:38:02 +01:00
Emmanuele Bassi
1995b7f34b docs: Preformat some symbols 2021-01-05 16:19:21 +00:00
Matthias Clasen
36eb7c40d0 gtk-demo: Small a11y fix
Label the entry in the assistant demo.
2021-01-05 11:16:10 -05:00
Matthias Clasen
56af472cfc a11y: Only spew help once
Make GTK_A11Y=help only spew once, and avoid a warning
when we do.
2021-01-05 11:15:33 -05:00
Matthias Clasen
d1fcfa58b9 popup: Mention the popover arrow in the docs
Suggested by Jonas.
2021-01-05 10:59:59 -05:00
Matthias Clasen
cf23324749 Merge branch 'no-gl-context' into 'master'
Disable GL support in gstreamer media backend on Windows

See merge request GNOME/gtk!3034
2021-01-05 15:22:09 +00:00
Matthias Clasen
b79c26b39e Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!3029
2021-01-05 15:20:25 +00:00
Matthias Clasen
532b8c71a8 media: Be more specific in our caps
We can only handle 2D textures, so tell gstreamer
about that.
2021-01-05 09:28:04 -05:00
Matthias Clasen
7c5b8911d8 Merge branch 'matthiasc/for-master' into 'master'
some docs tweaks

See merge request GNOME/gtk!3036
2021-01-05 14:26:38 +00:00
Matthias Clasen
e141d61593 docs: Cosmetics 2021-01-05 08:37:23 -05:00
Matthias Clasen
9595d440cf docs: Flesh out Popup layout docs
We have nice illustrations for this, lets use them.
2021-01-05 08:37:23 -05:00
Yuri Chornoivan
1063924bd0 Update Ukrainian translation 2021-01-05 08:08:44 +00:00
Timm Bäder
42fedfc870 csstokenizer: Keep a GString for name parsing around
We only every parse one of those at a time, so keep a GString around for
it. This way we don't have to create a new GString every time we parse
an identifier. Doesn't spare us the strdup though.
2021-01-05 08:53:13 +01:00
Timm Bäder
24836c0351 csstokenizer: Add separate init functions for token types
Using a variadic function is just awkward there. Use different init
functions and use them as appropriate; we already know which one to call
everywhere.
2021-01-05 08:53:13 +01:00
Timm Bäder
21b6c8b5d8 builder: Remove unused typedef 2021-01-05 08:53:13 +01:00
Timm Bäder
41fb6f6a8e builder: Remove unused function prototype 2021-01-05 08:53:13 +01:00
Timm Bäder
071ea6b559 builderparser: Use GPtrArray for stack 2021-01-05 08:53:11 +01:00
Chun-wei Fan
397a71ca8b gstreamer media backend: Disable OpenGL on Windows
...for at least WGL, since we are not allowed to use wglMakeCurrent(),
which is eventually called by gdk_gl_context_make_current() to share WGL
contexts across different threads, which will cause a crash.

This means, we cannot enable WGL in the gstreamer media backend on
Windows.
2021-01-05 14:34:06 +08:00
Matthias Clasen
40c10f83e2 Merge branch 'matthiasc/gl-media-stream' into 'master'
Use GL in the gstreamer media backend

See merge request GNOME/gtk!3027
2021-01-05 00:54:37 +00:00
Matthias Clasen
fb31581bb4 gtk-demo: Use GtkVideo in the fishbowl
The demo is called 'Video', so we should actually
use a GtkVideo widget. Doing things this way has
the advantage that we get GL support, which wasn't
working with GtkPicture.
2021-01-04 18:26:29 -05:00
Matthias Clasen
536a67ec96 media: Only force GL if we're using a GL renderer
When we are not using a GL renderer, getting GL textures
is no advantage to us, so don't make gstreamer send its
frames as GL memory in this case.
2021-01-04 15:01:19 -05:00
Matthias Clasen
53fe751371 media: Convince gstreamer to deliver GL memory
Use a glsinkbin to make gstreamer deliver GL memory.
2021-01-04 15:00:36 -05:00
Benjamin Otte
7901ab857b media: Add support for OpenGL to GtkGstMediaFile 2021-01-04 15:00:36 -05:00
Matthias Clasen
8f585f7a53 video: Realize the media stream before setting a file
This makes it so that we obtain a GL context before
creating the GstSink, so we at least advertise our
ability to handle GL buffer.

Gstreamer still won't send us any.
2021-01-04 15:00:36 -05:00
Matthias Clasen
874b19b27e Merge branch 'wip/jimmac/popover-separators' into 'master'
Adwaita: increase cotrast of popover separators

Closes #3535

See merge request GNOME/gtk!3033
2021-01-04 18:14:00 +00:00
Jakub Steiner
fe7b11b4e9 Adwaita: increase contrast of popover separators
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3535
2021-01-04 17:55:44 +01:00
Yetizone
601dfeeff9 checkbutton: Add activate signal to work with gtk_widget_activate()
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3525
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3550
2021-01-04 17:25:53 +02:00
Matthias Clasen
cf623ce774 Merge branch 'window-geometry-info' into 'master'
gtk/window: remove GtkWindowGeometryInfo from public header file

See merge request GNOME/gtk!3028
2021-01-04 13:55:08 +00:00
Aurimas Černius
36b49950e8 Updated Lithuanian translation 2021-01-04 14:10:23 +02:00
Matthias Clasen
77feb51b9c Pass coretext=enabled to harfbuzz
When we use harfbuzz as a subproject on OS X,
we (or rather, pango) need coretext support.
2021-01-03 21:34:04 -05:00
Matthias Clasen
710ef00dfe Fix the cairo build on OS X
Change the subproject to point to a branch that includes
an OS X build fix. Once
https://gitlab.freedesktop.org/cairo/cairo/-/issues/441
is fixed, we should switch back to master.
2021-01-03 21:34:04 -05:00
Matthias Clasen
0c8124828f ci: Disable pixman tests on MacOS
The pixman tests fail to build, and I don't have
the stamina to fix all sub-sub-projects, so just
disable the tests.
2021-01-03 21:34:04 -05:00
Matthias Clasen
0605c3c167 ci: Fix the harfbuzz build on MacOS
We need to force c++11 at the toplevel here, since
meson can't deal with per-project compiler choice.
2021-01-03 21:34:04 -05:00
Matthias Clasen
93d795e7c0 printing: Remove cairo header checks
cc.has_header doesn't work with subprojects, and all this
check does is to make the build fail, so we can just...
let the build fail instead.
2021-01-03 21:34:04 -05:00
Matthias Clasen
d55f938f7c printing: cairo-pdf is needed
The print backends need cairos pdf support, which is
contingent on zlib, so enable that when using cairo
as a subproject, as we do in ci for MacOS.
2021-01-03 21:34:04 -05:00
Matthias Clasen
45bb4dc80c ci: Add a macos build
Most of this is cribbed from glib.

We don't use COMMON_MESON_FLAGS here, since disabling
-Werror one subproject at a time is too painful for
all the promoted sub-sub-projects. This needs a better
solution in meson.

Since this is a full rebuild of the entire stack, limit
this to master and merge requests.
2021-01-03 21:34:04 -05:00
Rafostar
53af35d256 x11: fix crash on idle compute size without layout
On x11 toplevel layout is not created before toplevel
is presented, but GTK tries to update it on idle
which leads to a crash due to accessing property
of undefined object. Treat soon to be created layout
as a layout with default values upon creation (resizable).
2021-01-03 18:02:31 +01:00
Philipp Kiemle
51a6b29e01 Update German translation 2021-01-03 13:41:25 +00:00
Philipp Kiemle
e3835476ba Update German translation 2021-01-03 13:40:13 +00:00
Timm Bäder
256b094b13 messagedialog: Modernize source file
Move vfunc implementations above class_init, remove unneeded prototypes,
properly indent everything and remove trailing whitespace
2021-01-03 11:01:29 +01:00
Timm Bäder
699adb0b10 widget: Refactor gtk_widget_class_set_template()
Don't call gbytes_get_data/get_size so often and exit early if the given
bytes is already precompiled.
2021-01-03 11:01:29 +01:00
Timm Bäder
c91b5eaa41 widget: Inline setup_template_child() into only caller
This is a pretty short and self-contained function.
2021-01-03 11:01:29 +01:00
Timm Bäder
7e1f20bf4c icontheme: Make a parameter const 2021-01-03 11:01:29 +01:00
Timm Bäder
f9fe640905 settings: Overallocate property_values
Instead of walking the pspecs twice and checking for the owner_type,
just allocate n_pspecs entries. They are the same value right now
anyway, but even if they aren't it doesn't hurt to have a few extra ones
allocated.
2021-01-03 11:01:29 +01:00
Timm Bäder
34ea99006f settings: Load keyfiles ourselves
This does not change anything in the case where the .init file does not
exist. We still hit the disk once. Otherwise, we now only hit it once
instead of twice and avoid a potential race-condition.
2021-01-03 11:01:29 +01:00
Timm Bäder
06cce81a97 widget: Use gtk_widget_get_native() in get_surface_allocation() 2021-01-03 11:01:29 +01:00
Timm Bäder
4a1a7940d5 gtksettings: Remove unused defines 2021-01-03 11:01:29 +01:00
Timm Bäder
1108d00014 render: Inline function into only caller 2021-01-03 11:01:29 +01:00
Timm Bäder
034672e84e frame: Remove unnecessary function
Just call the vfunc directly in the only place we used to call the old
wrapper
2021-01-03 11:01:29 +01:00
Timm Bäder
00c885c93c gesture: Replace tabs 2021-01-03 11:01:29 +01:00
Timm Bäder
114f0bd8d6 box: Replace tabs with spaces 2021-01-03 11:01:29 +01:00
Timm Bäder
24c67efdfd scrolledwindow: Use g_clear_handle_id 2021-01-03 11:01:29 +01:00
Timm Bäder
6a3748146d viewport: Small cleanup
No need to check for visibility before calling gtk_widget_measure().
2021-01-03 11:01:29 +01:00
Timm Bäder
92ec754737 widget: Move quark_builder_set_id declaration to other GQuarks 2021-01-03 11:01:29 +01:00
Timm Bäder
d11fbbc478 widget: Re-arrange some more functions 2021-01-03 11:01:29 +01:00
Timm Bäder
f11f0da11c wiget: Fix whitespace issues
Switch from tabs to spaces everywhere consistently and remove all
trailing whitespace.
2021-01-03 11:01:29 +01:00
Timm Bäder
ebdf2989f8 widget: Move a few vfunc implementations above class_init
And save us the prototypes at the top of the file this way.
2021-01-03 11:01:29 +01:00
Timm Bäder
bc35c5d494 nevertrigger: Remove unused instance members 2021-01-03 11:01:29 +01:00
Timm Bäder
70a3e5e8ce shortcutmanager: Use g_list_store_find()
We require glib 2.66 these days, so we can unconditionally use
g_list_store_find().
2021-01-03 11:01:29 +01:00
Timm Bäder
74ff61a937 gesturelongpress: Remove a useless cast
We already get a GtkGestureLongPress here.
2021-01-03 11:01:29 +01:00
Timm Bäder
280d7e57bd gesturelongpress: Keep the pspec around
So we can use it to notify(), like we do everywhere else.
2021-01-03 11:01:29 +01:00
Timm Bäder
03f5a368ec label: Remove unused private functions 2021-01-03 11:01:29 +01:00
Timm Bäder
0b15aba82a label: Remove mnemonics_visible_apply_recursively from private header
This is only used in gtklabel.c
2021-01-03 11:01:28 +01:00
Timm Bäder
d8fa9de93a label: Modernize source file
Try to sort toplevel functions to minimize unnecessary function
prototypes at the beginning of the file, get rid of all tabs and
trailing whitespace.
2021-01-03 11:01:28 +01:00
Timm Bäder
afabbc4957 gtk4-demo: Remove unused size group 2021-01-03 11:01:28 +01:00
Timm Bäder
d978ba31d6 glcontext-wayland: Whitespace 2021-01-03 11:01:28 +01:00
Timm Bäder
71efa96ef2 gesturestylus: Only add histroy element if translation succeeded
Instead of always doing it and then undoing it if the translation does
not succeed.
2021-01-03 11:01:28 +01:00
Timm Bäder
e336fe2bf8 gesturestylus: Retrieve event and controller widget only once
Make it clear that these are not gonna chance while iterating the loop.
2021-01-03 11:01:28 +01:00
Timm Bäder
d7f15c15e9 glcontext-wayland: Avoid heap-alloacting small arrays...
every frame.
2021-01-03 11:01:28 +01:00
Timm Bäder
fff570538c glcontext-wayland: Only allocate configs we use
We only use the first one, so don't allocate space for more than that.
2021-01-03 11:01:28 +01:00
Matthias Clasen
38166a67c7 NEWS: Updates 2021-01-02 20:17:19 -05:00
Matthias Clasen
01b94db73d Merge branch 'matthiasc/for-master' into 'master'
video: Tweak the docs

See merge request GNOME/gtk!3026
2021-01-02 19:04:26 +00:00
Matthias Clasen
c804645382 video: Tweak the docs
Point out the limitations and use cases of GtkVideo
and mention that GtkPicture can display video just fine.
2021-01-02 12:21:03 -05:00
Matthias Clasen
384081ce0a Merge branch 'matthiasc/for-master' into 'master'
video: Pause on unset too

See merge request GNOME/gtk!3025
2021-01-02 15:49:46 +00:00
Florentina Mușat
afccb86f7e Update Romanian translation 2021-01-02 11:21:43 +00:00
Matthias Clasen
0ba5631100 video: Pause on unset too
When new media stream is set on the GtkVideo
widget and we're autoplaying, pause the old one.

Otherwise, the music keeps playing unexpectedly.
2021-01-02 01:33:48 -05:00
Matthias Clasen
c72589f0ee Merge branch 'wip/chergert/fix-macos-compute-size' into 'master'
macos: fix compute_size and request_layout

Closes #3532

See merge request GNOME/gtk!3023
2021-01-01 23:33:01 +00:00
Matthias Clasen
f2e5775380 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3506 and #3530

See merge request GNOME/gtk!3024
2021-01-01 22:48:11 +00:00
Benjamin Otte
a7164208d3 Merge branch 'video-stop' into 'master'
video: Stop playing when appropriate

See merge request GNOME/gtk!3022
2021-01-01 21:54:22 +00:00
Matthias Clasen
20f3d1608d video: Be consistent about play/pause
Always check that the stream is prepared, and the
widget is mapped, before calling gtk_media_stream_play().
2021-01-01 16:25:54 -05:00
Christian Hergert
9320148d71 macos: implement compute_size and request_layout
These functions were not implemented when the sizing changes
landed before GTK 4 was released. This fixes an issue with non-
resizeable windows not reacting to layout changes.

Fixes #3532
2021-01-01 13:17:47 -08:00
Christian Hergert
ad617a0e06 macos: avoid setHasShadow unless shadow changes 2021-01-01 13:17:47 -08:00
Christian Hergert
62af8365f6 macos: fix toplevel present function prototype
No need to return anything here.
2021-01-01 13:17:47 -08:00
Matthias Clasen
29afe5a688 video: Stop playing when appropriate
When the widget gets unrealized or hidden, pause
the mediastream. Otherwise, audio might keep playing
unexpectedly.
2021-01-01 15:17:59 -05:00
Matthias Clasen
2d3885a44a center layout: Fix handling of expanding center child
We were not taking spacing into account when adjusting
the size of an expanding center child, causing it to slip
under the end child at times.

Fixes: #3506
2021-01-01 11:02:57 -05:00
Matthias Clasen
75a297632e Merge branch 'wip/chergert/fix-macos-window-check' into 'master'
macos: ensure GdkMacosWindow in surface discovery

Closes #3533

See merge request GNOME/gtk!3021
2021-01-01 15:39:08 +00:00
Matthias Clasen
572649740e docs: Flesh out the gtk4-builder-tool man page
Add some details about the --3to4 conversion, and
set expectations.
2021-01-01 10:14:01 -05:00
Yuri Chornoivan
b5938faa06 Update Ukrainian translation 2021-01-01 14:50:35 +00:00
Matthias Clasen
a4baac7193 docs: Complete a sentence
Fixes: #3530
2021-01-01 09:40:40 -05:00
Matthias Clasen
bdde41e290 Merge branch 'encode-symbolic-debug' into 'master'
gtk4-encode-symbolic: Add debug output

See merge request GNOME/gtk!3017
2021-01-01 14:23:08 +00:00
Christian Hergert
d888402bf9 macos: ensure GdkMacosWindow in surface discovery
We want to ignore windows that are not related to those controlled
by the GDK backend.

Fixes #3533
2020-12-31 10:55:50 -08:00
Christian Hergert
378bd9fab2 Merge branch 'macos-mojave' into 'master'
macos: do not crash in mojave

See merge request GNOME/gtk!3020
2020-12-31 18:13:46 +00:00
Ignacio Casal Quinteiro
4ad5e77907 macos: do not crash in mojave
The localizedName property is not available in Mojave
so just ifdef in that case the code out.
2020-12-31 11:35:04 +01:00
David Lechner
4fb70c5e4d gtk/window: remove GtkWindowGeometryInfo from public header file
GtkWindowGeometryInfo is only used by static methods in gtkwindow.c
so it doesn't need to be in the public header file.
2020-12-30 01:32:27 -06:00
Matthias Clasen
d5963ad109 Merge branch 'revert-224c2674' into 'master'
Revert "Merge branch 'gtk_egl_wayland' into 'master'"

See merge request GNOME/gtk!3018
2020-12-30 03:34:51 +00:00
Matthias Clasen
b5fe434fea Revert "Merge branch 'gtk_egl_wayland' into 'master'"
This reverts merge request !3011
2020-12-30 03:32:18 +00:00
Matthias Clasen
224c2674ab Merge branch 'gtk_egl_wayland' into 'master'
Expose gdk_wayland_surface_get_wl_egl_window()

See merge request GNOME/gtk!3011
2020-12-30 03:32:05 +00:00
Matthias Clasen
878b34fae3 gtk4-encode-symbolic: Add debug output
Add a --debug option that makes this tool produce
some debug output that can be helpful in tracking
down why symbolic svgs are broken.
2020-12-29 21:30:52 -05:00
Matthias Clasen
5fe433418d Merge branch 'mcatanzaro/#3509' into 'master'
message dialog: use title style only if there is secondary text

Closes #3509

See merge request GNOME/gtk!3015
2020-12-29 17:47:01 +00:00
Matthias Clasen
02ba9bc1da Merge branch 'fix-menu-alignment' into 'master'
Fix menu item alignment with submenus

See merge request GNOME/gtk!3016
2020-12-29 17:41:49 +00:00
Michael Catanzaro
2336120010 message dialog: use title style only if there is secondary text
If there is no secondary text, then the primary text is just a message,
not a title, and should not use title style.

This partially reverts 1e3ec7c1f9. The
message dialog nown looks like it used to in GTK 3. However, it's still
styled only using a style class rather than using pango markup, as in
GTK 3.

Fixes #3509
2020-12-29 11:15:14 -06:00
Matthias Clasen
0d54d73a51 Fix menu item alignment with submenus
We were not aligning model button labels with nesting
submenus with indicators in their containing menu.

This was visible in the application demo of gtk4-demo.
2020-12-29 12:10:35 -05:00
Timm Bäder
6c09832b9b Merge branch 'xndcn/fix-shader' into 'master'
gl: Fix implicit leaking of shader object

See merge request GNOME/gtk!3013
2020-12-29 16:58:55 +00:00
Matthias Clasen
1758f88492 Merge branch 'ebassi/issue-3522' into 'master'
Fix the Vulkan header check for VK_RESULT_RANGE_SIZE

Closes #3522

See merge request GNOME/gtk!3009
2020-12-29 16:36:09 +00:00
xndcn
34ffdc6e3f gl: Fix implicit leaking of shader object
According to OpenGL spec, a shader object will only be flagged
for deletion unless it has been detached; when a program object
is deleted, those shader objects attached to it will be detached
but not deleted unless they have already been flagged for deletion.

So we shall detach a shader object before it is deleted, and delete
it before the program object is deleted best.
2020-12-29 23:50:45 +08:00
Timm Bäder
108933b655 Merge branch 'wip/chergert/volatile-fixes' into 'master'
types: fix various use of volatile in type registration

See merge request GNOME/gtk!2865
2020-12-29 07:49:12 +00:00
Vivek Kasireddy
3344bcaf92 gdk/wayland/surface: Expose gdk_wayland_surface_get_wl_egl_window()
Some GTK based applications such as Qemu UI create and manage
EGLSurfaces associated with the relevant GdkSurfaces. In order to create
an EGLSurface, there needs to be a way to pass the native window
object to eglCreateWindowSurface(). While running in an X environment,
the native window object can be obtained by calling
gdk_x11_surface_get_xid(). Likewise, the native window object can be
obtained by calling gdk_wayland_surface_get_wl_egl_window() while
running in a Wayland environment. Therefore, this API needs to be
exposed to apps.

Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2020-12-28 18:20:04 -08:00
Emmanuele Bassi
f22ec063a1 Fix the Vulkan header check for VK_RESULT_RANGE_SIZE
The VK_RESULT_RANGE_SIZE enumeration value was removed in 1.2.140, not
1.2.142.

Fixes: #3522
2020-12-28 18:41:18 +00:00
Jan Tojnar
2c9f2325e2 build: Use Meson’s module for building .pc files
Using the module will prevent trivial bugs caused by incorrect string concatenation.

This is just a literal translation. In the future we might rely on Meson auto-detecting fields from library declaration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3517
2020-12-27 06:27:59 +01:00
Christian Hergert
0d2ea14ac1 types: fix various use of volatile in type registration
The use of volatile was incorrect in GLib and has been that way for
a long time. Recently however that has changed, and this makes GTK
follow suit to avoid using volatile in the type registration.

See also: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

Combined with the above merge request for GLib, this fixes a large
number of compilation warnings when using Clang.
2020-11-18 20:21:33 -08:00
Luca Bacci
aec87a3514 GdkWin32: Fix mouse events in presence of transparent windows on the desktop
In gdkdevice-win32.c we are interested in knowing which window
receives mouse input at a specific location.

Only WindowFromPoint is the right API for the task, other API's
(such as (Real)ChildWindowFromPoint(Ex)) have shortcomings because
they are really designed for other purposes. For example, only
WindowFromPoint is able to look through transparent layered windows.

So even if we want to find a direct child we have to use
WindowFromPoint and then walk up the hierarchy.

Fixes: #370, #417
See: !2800
2020-11-11 12:46:52 +01:00
1213 changed files with 147119 additions and 125026 deletions

View File

@@ -24,9 +24,9 @@ variables:
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
MESON_TEST_TIMEOUT_MULTIPLIER: 3
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v25"
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v28"
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v25"
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v26"
.only-default:
only:
@@ -43,6 +43,7 @@ style-check-diff:
- .gitlab-ci/run-style-check-diff.sh
.build-fedora-default:
extends: .only-default
image: $FEDORA_IMAGE
artifacts:
when: always
@@ -121,6 +122,7 @@ installed-tests:
.mingw-defaults:
extends: .only-default
stage: build
tags:
- win32-ps
@@ -144,6 +146,32 @@ msys2-mingw64:
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
macos:
extends: .only-default
only:
- branches@GNOME/gtk
stage: build
tags:
- macos
needs: []
before_script:
- bash .gitlab-ci/show-execution-environment.sh
- pip3 install --user meson==0.56
- pip3 install --user ninja
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
- export MESON_FORCE_BACKTRACE=1
script:
- meson -Dx11-backend=false
-Dintrospection=disabled
-Dcpp_std=c++11
-Dpixman:tests=disabled
_build
- ninja -C _build
artifacts:
when: always
paths:
- "${CI_PROJECT_DIR}/_build/meson-logs"
.flatpak-defaults:
image: $FLATPAK_IMAGE
stage: flatpak
@@ -262,11 +290,13 @@ reference:
EXTRA_MESON_FLAGS: "--buildtype=release"
script:
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true _build
- ninja -C _build gdk4-doc gsk4-doc gtk4-doc
- meson compile -C _build
- mkdir -p _reference/
- mv _build/docs/reference/gdk/html/ _reference/gdk/
- mv _build/docs/reference/gsk/html/ _reference/gsk/
- mv _build/docs/reference/gtk/html/ _reference/gtk/
- mv _build/docs/reference/gdk/gdk4/ _reference/gdk4/
- mv _build/docs/reference/gdk/gdk4-x11/ _reference/gdk4-x11/
- mv _build/docs/reference/gdk/gdk4-wayland/ _reference/gdk4-wayland/
- mv _build/docs/reference/gsk/gsk4/ _reference/gsk4/
- mv _build/docs/reference/gtk/gtk4/ _reference/gtk4/
artifacts:
paths:
- _reference

View File

@@ -17,8 +17,8 @@ branch, as well as their available versions.
### Checklist for Updating a CI image
- [ ] Update the `${image}.Dockerfile` file with the dependencies
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh build --base ${image} --version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --version ${number}`
once the Docker image is built; you may need to log in by using
`docker login` or `podman login`
- [ ] Update the `image` keys in the `.gitlab-ci.yml` file with the new
@@ -30,8 +30,8 @@ branch, as well as their available versions.
- [ ] Write a new `${image}.Dockerfile` with the instructions to set up
a build environment
- [ ] Add the `pip3 install meson` incantation
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
- [ ] Run `./run-docker.sh build --base ${image} --version ${number}`
- [ ] Run `./run-docker.sh push --base ${image} --version ${number}`
- [ ] Add the new job to `.gitlab-ci.yml` referencing the image
- [ ] Open a merge request with your changes and let it run

View File

@@ -1,4 +1,4 @@
FROM fedora:31
FROM fedora:33
RUN dnf -y install \
adwaita-icon-theme \
@@ -65,7 +65,8 @@ RUN dnf -y install \
libxslt \
mesa-dri-drivers \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
mesa-libGLES-devel \
meson \
ninja-build \
pango-devel \
pcre-devel \
@@ -86,6 +87,3 @@ RUN dnf -y install \
which \
xorg-x11-server-Xvfb \
&& dnf clean all
RUN pip3 install meson==0.55.3

View File

@@ -1,6 +1,11 @@
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v25
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v28
RUN dnf -y install pandoc
RUN dnf -y install \
python3-jinja2 \
python3-markdown \
python3-pygments \
python3-toml \
python3-typogrify
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v25
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v28
# Enable sudo for wheel users
RUN sed -i -e 's/# %wheel/%wheel/' -e '0,/%wheel/{s/%wheel/# %wheel/}' /etc/sudoers

View File

@@ -32,7 +32,7 @@ while (($# > 0)); do
list) list=1;;
help) print_help=1;;
--base|-b) read_arg base "$@" || shift;;
--base-version) read_arg base_version "$@" || shift;;
--version|-v) read_arg base_version "$@" || shift;;
--no-login) no_login=1;;
*) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;;
esac

View File

@@ -8,7 +8,8 @@ builddir=$1
backend=$2
# Ignore memory leaks lower in dependencies
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0
export G_SLICE=always-malloc
case "${backend}" in
x11)

View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -eux -o pipefail
xcodebuild -version || :
xcodebuild -showsdks || :
system_profiler SPSoftwareDataType || :

View File

@@ -1,4 +1,13 @@
<!--
Please, read the CONTRIBUTING.md guide on how to file a new issue.
https://gitlab.gnome.org/GNOME/gtk/-/blob/master/CONTRIBUTING.md
-->
## Steps to reproduce
<!--
Please, explain the sequence of actions necessary to reproduce the
bug
-->
1. ...
2. ...
@@ -32,5 +41,8 @@
## Additional information
<!--
- Screenshots or screen recordings are useful for visual errors
- Attaching a screenshot or a video without explaining the current
behavior and the actions necessary to reproduce the bug will lead
to the bug being closed
- Please report any warning or message printed on the terminal
-->

View File

@@ -1,4 +1,14 @@
<!--
Please, read the CONTRIBUTING.md guide on how to file a new issue.
https://gitlab.gnome.org/GNOME/gtk/-/blob/master/CONTRIBUTING.md
-->
## Steps to reproduce
<!--
Please, explain the sequence of actions necessary to reproduce the
crash
-->
1. ...
2. ...

9310
NEWS

File diff suppressed because it is too large Load Diff

9178
NEWS.pre-4.0 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -32,9 +32,9 @@ Discussion forum
- https://discourse.gnome.org/c/platform/core/
Nightly documentation can be found at
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk/
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk4/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk4/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk4/
Building and installing
-----------------------

View File

@@ -35,15 +35,15 @@
"modules" : [
{
"name" : "wayland",
"buildsystem" : "autotools",
"buildsystem" : "meson",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
"-Ddocumentation=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
}
]
},
@@ -100,7 +100,8 @@
"config-opts" : [
"--libdir=/app/lib",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
"sources" : [
{

View File

@@ -35,15 +35,15 @@
"modules" : [
{
"name" : "wayland",
"buildsystem" : "autotools",
"buildsystem" : "meson",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
"-Ddocumentation=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
}
]
},
@@ -100,7 +100,8 @@
"config-opts" : [
"--libdir=/app/lib",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
"sources" : [
{

View File

@@ -35,15 +35,15 @@
"modules" : [
{
"name" : "wayland",
"buildsystem" : "autotools",
"buildsystem" : "meson",
"builddir" : true,
"config-opts" : [
"--disable-documentation"
"-Ddocumentation=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/wayland-project/wayland.git"
"url" : "https://gitlab.freedesktop.org/wayland/wayland.git"
}
]
},
@@ -100,7 +100,8 @@
"config-opts" : [
"--libdir=/app/lib",
"-Denable_vulkan=no",
"-Dbuildtype=debugoptimized"
"-Dbuildtype=debugoptimized",
"-Dprofile=devel"
],
"sources" : [
{

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import os
from pathlib import PurePath
import subprocess
stylesheets = [ 'gtk/theme/Adwaita/Adwaita.css',
'gtk/theme/Adwaita/Adwaita-dark.css',
'gtk/theme/HighContrast/HighContrast.css',
'gtk/theme/HighContrast/HighContrast-dark.css' ]
sourceroot = os.environ.get('MESON_SOURCE_ROOT')
distroot = os.environ.get('MESON_DIST_ROOT')
for stylesheet in stylesheets:
stylesheet_path = PurePath(stylesheet)
src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
dst = PurePath(distroot, stylesheet_path)
subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst])

View File

@@ -98,6 +98,9 @@ create_page1 (GtkWidget *assistant)
gtk_box_append (GTK_BOX (box), label);
entry = gtk_entry_new ();
gtk_accessible_update_relation (GTK_ACCESSIBLE (entry),
GTK_ACCESSIBLE_RELATION_LABELLED_BY, label, NULL,
-1);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
gtk_box_append (GTK_BOX (box), entry);

View File

@@ -119,13 +119,12 @@ create_label (void)
static GtkWidget *
create_video (void)
{
GtkMediaStream *stream = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
GtkWidget *w = gtk_picture_new_for_paintable (GDK_PAINTABLE (stream));
GtkWidget *w = gtk_video_new ();
gtk_widget_set_size_request (w, 64, 64);
gtk_media_stream_set_loop (stream, TRUE);
gtk_media_stream_play (stream);
g_object_unref (stream);
gtk_video_set_loop (GTK_VIDEO (w), TRUE);
gtk_video_set_autoplay (GTK_VIDEO (w), TRUE);
gtk_video_set_resource (GTK_VIDEO (w), "/images/gtk-logo.webm");
return w;
}

View File

@@ -787,6 +787,8 @@ gtk_gears_realize (GtkWidget *widget)
glLinkProgram(program);
glGetProgramInfoLog(program, sizeof msg, NULL, msg);
g_debug ("program info: %s\n", msg);
glDetachShader (program, v);
glDetachShader (program, f);
glDeleteShader (v);
glDeleteShader (f);

View File

@@ -13,7 +13,7 @@ static GtkWidget *window = NULL;
static GtkWidget *scrolledwindow;
static int selected;
#define N_WIDGET_TYPES 7
#define N_WIDGET_TYPES 8
static int hincrement = 5;
@@ -110,6 +110,41 @@ populate_text (gboolean highlight)
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), textview);
}
static void
populate_emoji_text (void)
{
GtkWidget *textview;
GtkTextBuffer *buffer;
GString *s;
s = g_string_sized_new (1000 * 30 * 4);
for (int i = 0; i < 1000; i++)
{
if (i % 2)
g_string_append (s, "x");
for (int j = 0; j < 30; j++)
g_string_append (s, "💓x");
g_string_append (s, "\n");
}
buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_set_text (buffer, s->str, s->len);
g_string_free (s, TRUE);
textview = gtk_text_view_new ();
gtk_text_view_set_buffer (GTK_TEXT_VIEW (textview), buffer);
hincrement = 0;
vincrement = 5;
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), textview);
}
static void
populate_image (void)
{
@@ -224,21 +259,26 @@ set_widget_type (int type)
break;
case 3:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling text with Emoji");
populate_emoji_text ();
break;
case 4:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a big image");
populate_image ();
break;
case 4:
case 5:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a list");
populate_list ();
break;
case 5:
case 6:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a columned list");
populate_list2 ();
break;
case 6:
case 7:
gtk_window_set_title (GTK_WINDOW (window), "Scrolling a grid");
populate_grid ();
break;

View File

@@ -39,7 +39,7 @@ create_application_list (void)
}
/* This is the function we use for setting up new listitems to display.
* We add just an #GtkImage and a #GtkKabel here to display the application's
* We add just an #GtkImage and a #GtkLabel here to display the application's
* icon and name, as this is just a simple demo.
*/
static void

View File

@@ -25,6 +25,8 @@
#include "demos.h"
#include "fontify.h"
#include "demo_conf.h"
static GtkWidget *info_view;
static GtkWidget *source_view;
@@ -196,16 +198,20 @@ activate_about (GSimpleAction *action,
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can appear here: <http://www.gtk.org>");
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK Demo",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Demo (Development)"
: "GTK Demo",
"version", version,
"copyright", "©1997—2020 The GTK Team",
"copyright", "©1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK widgets",
@@ -901,6 +907,9 @@ activate (GApplication *app)
window = (GtkWidget *)gtk_builder_get_object (builder, "window");
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (window));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (window, "devel");
action = g_simple_action_new ("run", NULL);
g_signal_connect (action, "activate", G_CALLBACK (activate_run), window);
g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (action));
@@ -1043,10 +1052,10 @@ out:
static void
print_version (void)
{
g_print ("gtk4-demo %d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
g_print ("gtk4-demo %s%s%s\n",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
}
static int

View File

@@ -167,6 +167,8 @@ foreach flag: common_cflags
endif
endforeach
gtkdemo_deps += [ demo_conf_h ]
executable('gtk4-demo',
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
c_args: gtkdemo_args + demo_cflags,

View File

@@ -4,6 +4,8 @@
#include "iconbrowserapp.h"
#include "iconbrowserwin.h"
#include "demo_conf.h"
struct _IconBrowserApp
{
GtkApplication parent;
@@ -75,21 +77,25 @@ about_activated (GSimpleAction *action,
gtk_get_minor_version (),
gtk_get_micro_version ());
g_string_append_printf (s, "\nIcon theme\n\t%s", icon_theme);
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
"program-name", "GTK Icon Browser",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Icon Browser (Development)"
: "GTK Icon Browser",
"version", version,
"copyright", "©1997—2020 The GTK Team",
"copyright", "©1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to browse themed icons",
"authors", authors,
"logo-icon-name", "org.gtk.Demo4",
"logo-icon-name", "org.gtk.IconBrowser4",
"title", "About GTK Icon Browser",
"system-information", s->str,
NULL);
@@ -129,6 +135,10 @@ icon_browser_app_activate (GApplication *app)
IconBrowserWindow *win;
win = icon_browser_window_new (ICON_BROWSER_APP (app));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (win), "devel");
gtk_window_present (GTK_WINDOW (win));
}

View File

@@ -14,8 +14,10 @@ struct _IconBrowserWindow
GtkWidget *searchbar;
GListModel *icon_filter_model;
GListStore *icon_store;
GListModel *context_model;
GListStore *context_store;
GtkFilter *name_filter;
GtkFilter *search_mode_filter;
GtkWidget *details;
GtkWidget *image1;
GtkWidget *image2;
@@ -279,11 +281,31 @@ drag_prepare_texture (GtkDragSource *source,
GtkWidget *widget)
{
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (widget));
GtkSnapshot *snapshot;
double width, height;
GskRenderNode *node;
GskRenderer *renderer;
GdkTexture *texture;
GdkContentProvider *ret;
if (!GDK_IS_PAINTABLE (paintable))
return NULL;
return gdk_content_provider_new_typed (GDK_TYPE_PAINTABLE, paintable);
snapshot = gtk_snapshot_new ();
width = gdk_paintable_get_intrinsic_width (paintable);
height = gdk_paintable_get_intrinsic_height (paintable);
gdk_paintable_snapshot (paintable, snapshot, width, height);
node = gtk_snapshot_free_to_node (snapshot);
renderer = gtk_native_get_renderer (gtk_widget_get_native (widget));
texture = gsk_renderer_render_texture (renderer, node, &GRAPHENE_RECT_INIT (0, 0, width, height));
ret = gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, texture);
g_object_unref (texture);
gsk_render_node_unref (node);
return ret;
}
static GdkContentProvider *
@@ -334,6 +356,28 @@ setup_scalable_image_dnd (GtkWidget *image)
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
}
static void
search_mode_toggled (GtkSearchBar *searchbar,
GParamSpec *pspec,
IconBrowserWindow *win)
{
if (gtk_search_bar_get_search_mode (searchbar))
gtk_single_selection_set_selected (GTK_SINGLE_SELECTION (win->context_model), GTK_INVALID_LIST_POSITION);
else if (gtk_single_selection_get_selected (GTK_SINGLE_SELECTION (win->context_model)) == GTK_INVALID_LIST_POSITION)
gtk_single_selection_set_selected (GTK_SINGLE_SELECTION (win->context_model), 0);
gtk_filter_changed (win->search_mode_filter, GTK_FILTER_CHANGE_DIFFERENT);
}
static void
selected_name_changed (GtkSingleSelection *selection,
GParamSpec *pspec,
IconBrowserWindow *win)
{
if (gtk_single_selection_get_selected (selection) != GTK_INVALID_LIST_POSITION)
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (win->searchbar), FALSE);
}
static void
icon_browser_window_init (IconBrowserWindow *win)
{
@@ -360,6 +404,9 @@ icon_browser_window_init (IconBrowserWindow *win)
win->name_filter = GTK_FILTER (gtk_custom_filter_new (filter_by_icon_name, NULL, NULL));
gtk_multi_filter_append (GTK_MULTI_FILTER (filter), g_object_ref (win->name_filter));
g_signal_connect (win->searchbar, "notify::search-mode-enabled", G_CALLBACK (search_mode_toggled), win);
g_signal_connect (win->context_model, "notify::selected", G_CALLBACK (selected_name_changed), win);
}
static void
@@ -389,6 +436,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, searchbar);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, icon_store);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, icon_filter_model);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, context_model);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, context_store);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, details);
@@ -402,6 +450,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image8);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, label8);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, search_mode_filter);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), copy_to_clipboard);

View File

@@ -14,7 +14,7 @@ iconbrowser_resources = gnome.compile_resources('iconbrowser_resources',
executable('gtk4-icon-browser',
sources: [iconbrowser_sources, iconbrowser_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,

View File

@@ -151,19 +151,32 @@
</object>
</child>
<child>
<object class="GtkStringFilter">
<property name="ignore-case">0</property>
<property name="match-mode">exact</property>
<property name="expression">
<lookup name="context" type="IbIcon"/>
</property>
<binding name="search">
<lookup name="id" type="IbContext">
<lookup name="selected-item" type="GtkSingleSelection">
context_model
</lookup>
</lookup>
</binding>
<object class="GtkAnyFilter">
<child>
<object class="GtkBoolFilter" id="search_mode_filter">
<property name="expression">
<lookup name="search-mode-enabled">
searchbar
</lookup>
</property>
</object>
</child>
<child>
<object class="GtkStringFilter">
<property name="ignore-case">0</property>
<property name="match-mode">exact</property>
<property name="expression">
<lookup name="context" type="IbIcon"/>
</property>
<binding name="search">
<lookup name="id" type="IbContext">
<lookup name="selected-item" type="GtkSingleSelection">
context_model
</lookup>
</lookup>
</binding>
</object>
</child>
</object>
</child>
</object>

View File

@@ -1,3 +1,19 @@
demo_conf = configuration_data()
demo_conf.set_quoted('PROFILE', get_option('profile'))
demo_conf.set_quoted('VCS_TAG', '@VCS_TAG@')
demo_conf_h = declare_dependency(
sources: vcs_tag(
command: [ 'git', 'rev-parse', '--short', 'HEAD' ],
fallback: get_option('profile') != 'default' ? 'devel' : '',
input: configure_file(
output: 'demo_conf.h.in',
configuration: demo_conf
),
output: 'demo_conf.h'
)
)
subdir('constraint-editor')
subdir('gtk-demo')
subdir('icon-browser')

View File

@@ -13,6 +13,7 @@
<property name="right-margin">20</property>
<property name="top-margin">20</property>
<property name="bottom-margin">20</property>
<property name="monospace">1</property>
<property name="buffer">
<object class="GtkTextBuffer" id="buffer"/>
</property>

View File

@@ -12,7 +12,7 @@ node_editor_resources = gnome.compile_resources('node_editor_resources',
executable('gtk4-node-editor',
sources: [node_editor_sources, node_editor_resources],
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())

View File

@@ -23,6 +23,8 @@
#include "node-editor-window.h"
#include "demo_conf.h"
static const char *css =
"textview.editor {"
" color: rgb(192, 197, 206);"
@@ -94,22 +96,26 @@ activate_about (GSimpleAction *action,
g_string_append_printf (s, "\nRenderer\n\t%s", renderer);
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", gtk_application_get_active_window (app),
"program-name", "GTK Node Editor",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Node Editor (Development)"
: "GTK Node Editor",
"version", version,
"copyright", "©2019—2020 The GTK Team",
"copyright", "©2019—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to test GTK rendering",
"authors", (const char *[]){ "Benjamin Otte", "Timm Bäder", NULL},
"logo-icon-name", "org.gtk.gtk4.NodeEditor.Devel",
"logo-icon-name", "org.gtk.gtk4.NodeEditor",
"title", "About GTK Node Editor",
"system-information", s->str,
NULL);
@@ -207,6 +213,10 @@ node_editor_application_activate (GApplication *app)
NodeEditorWindow *win;
win = node_editor_window_new (NODE_EDITOR_APPLICATION (app));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (win), "devel");
gtk_window_present (GTK_WINDOW (win));
}

View File

@@ -25,6 +25,7 @@
#include "gsk/gskrendernodeparserprivate.h"
#include "gsk/gl/gskglrenderer.h"
#include "gsk/ngl/gsknglrenderer.h"
#ifdef GDK_WINDOWING_BROADWAY
#include "gsk/broadway/gskbroadwayrenderer.h"
#endif
@@ -700,6 +701,16 @@ out:
g_free (source_dir);
}
static void
dark_mode_cb (GtkToggleButton *button,
GParamSpec *pspec,
NodeEditorWindow *self)
{
g_object_set (gtk_widget_get_settings (GTK_WIDGET (self)),
"gtk-application-prefer-dark-theme", gtk_toggle_button_get_active (button),
NULL);
}
static void
node_editor_window_finalize (GObject *object)
{
@@ -752,6 +763,9 @@ node_editor_window_realize (GtkWidget *widget)
node_editor_window_add_renderer (self,
gsk_gl_renderer_new (),
"OpenGL");
node_editor_window_add_renderer (self,
gsk_ngl_renderer_new (),
"NGL");
#ifdef GDK_RENDERING_VULKAN
node_editor_window_add_renderer (self,
gsk_vulkan_renderer_new (),
@@ -814,6 +828,7 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
gtk_widget_class_bind_template_callback (widget_class, export_image_cb);
gtk_widget_class_bind_template_callback (widget_class, testcase_save_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, testcase_name_entry_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, dark_mode_cb);
}
static GtkWidget *
@@ -910,6 +925,26 @@ node_editor_window_init (NodeEditorWindow *self)
self->text_buffer = gtk_text_buffer_new (self->tag_table);
g_signal_connect (self->text_buffer, "changed", G_CALLBACK (text_changed), self);
gtk_text_view_set_buffer (GTK_TEXT_VIEW (self->text_view), self->text_buffer);
/* Default */
gtk_text_buffer_set_text (self->text_buffer,
"shadow {\n"
" child: texture {\n"
" bounds: 0 0 128 128;\n"
" texture: url(\"resource:///org/gtk/gtk4/node-editor/icons/apps/org.gtk.gtk4.NodeEditor.svg\");\n"
" }\n"
" shadows: rgba(0,0,0,0.5) 0 1 12;\n"
"}\n"
"\n"
"transform {\n"
" child: text {\n"
" color: rgb(46,52,54);\n"
" font: \"Cantarell Bold 11\";\n"
" glyphs: \"GTK Node Editor\";\n"
" offset: 8 14.418;\n"
" }\n"
" transform: translate(0, 140);\n"
"}", -1);
}
NodeEditorWindow *

View File

@@ -139,6 +139,15 @@
<property name="icon-name">open-menu-symbolic</property>
</object>
</child>
<child type="end">
<object class="GtkToggleButton" id="dark_bg_button">
<property name="valign">center</property>
<property name="has-frame">0</property>
<property name="icon-name">display-brightness-symbolic</property>
<property name="tooltip-text" translatable="yes">Use a dark background</property>
<signal name="notify::active" handler="dark_mode_cb" swapped="0"/>
</object>
</child>
</object>
</child>
<child>

View File

@@ -4,6 +4,6 @@
<file preprocess="xml-stripblanks">node-editor-window.ui</file>
<file preprocess="xml-stripblanks">help-window.ui</file>
<file>node-format.md</file>
<file alias='icons/apps/org.gtk.gtk4.NodeEditor.Devel.svg'>data/scalable/apps/org.gtk.gtk4.NodeEditor.Devel.svg</file>
<file alias='icons/apps/org.gtk.gtk4.NodeEditor.svg'>data/scalable/apps/org.gtk.gtk4.NodeEditor.svg</file>
</gresource>
</gresources>

View File

@@ -42,9 +42,9 @@ Creates a node like `gsk_blur_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| color | `<color>{1,4}` | black | non-default |
| colors | `<color>{1,4}` | black | non-default |
| outline | `<rounded-rect>` | 50 | always |
| width | `<number>{1,4}` | 1 | non-default |
| widths | `<number>{1,4}` | 1 | non-default |
Creates a node like `gsk_border_node_new()` with the given properties.
@@ -121,7 +121,7 @@ Creates a node like `gsk_conic_gradient_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| end | `<node>` | color { } | always |
| mode | `<number>` | 0.5 | non-default |
| progress | `<number>` | 0.5 | non-default |
| start | `<node>` | color { } | always |
Creates a node like `gsk_cross_fade_node_new()` with the given properties.
@@ -246,7 +246,7 @@ Creates a node like `gsk_rounded_clip_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| child | `<node>` | color { } | always |
| shadow | `<shadow>` | black 1 1 | always |
| shadows | `<shadow>` | black 1 1 | always |
Creates a node like `gsk_shadow_node_new()` with the given properties.

View File

@@ -1,7 +1,7 @@
executable('gtk4-print-editor',
sources: ['print-editor.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,

View File

@@ -2,7 +2,7 @@
Name=Print Editor
Comment=A simple editor demonstrating GTK printing
Exec=gtk4-print-editor %f
Icon=org.gtk.PrintEditor4.Devel
Icon=org.gtk.PrintEditor4
Terminal=false
Type=Application
StartupNotify=true

View File

@@ -4,6 +4,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "demo_conf.h"
static GtkWidget *main_window;
static GFile *filename = NULL;
static GtkPageSetup *page_setup = NULL;
@@ -641,22 +643,26 @@ activate_about (GSimpleAction *action,
g_strfreev (backends);
g_free (setting);
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", main_window,
"program-name", "GTK Print Editor",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Print Editor (Development)"
: "GTK Print Editor",
"version", version,
"copyright", "© 2006-2020 Red Hat, Inc",
"copyright", "© 2006-2021 Red Hat, Inc",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK printing",
"authors", authors,
"logo-icon-name", "org.gtk.PrintEditor4.Devel",
"logo-icon-name", "org.gtk.PrintEditor4",
"title", "About GTK Print Editor",
"system-information", sysinfo->str,
NULL);
@@ -807,6 +813,10 @@ activate (GApplication *app)
GtkWidget *contents;
main_window = gtk_application_window_new (GTK_APPLICATION (app));
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (main_window), "devel");
gtk_window_set_icon_name (GTK_WINDOW (main_window), "text-editor");
gtk_window_set_default_size (GTK_WINDOW (main_window), 400, 600);
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (main_window), TRUE);

View File

@@ -8,7 +8,7 @@ widgetfactory_resources = gnome.compile_resources('widgetfactory_resources',
executable('gtk4-widget-factory',
sources: ['widget-factory.c', widgetfactory_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
dependencies: [ libgtk_dep, demo_conf_h ],
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,

View File

@@ -25,6 +25,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "demo_conf.h"
static void
change_dark_state (GSimpleAction *action,
GVariant *state,
@@ -300,8 +302,10 @@ activate_about (GSimpleAction *action,
gtk_get_micro_version ());
g_string_append_printf (s, "\nA link can appear here: <http://www.gtk.org>");
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
version = g_strdup_printf ("%s%s%s\nRunning against GTK %d.%d.%d",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
@@ -309,9 +313,11 @@ activate_about (GSimpleAction *action,
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", gtk_application_get_active_window (app),
"modal", TRUE,
"program-name", "GTK Widget Factory",
"program-name", g_strcmp0 (PROFILE, "devel") == 0
? "GTK Widget Factory (Development)"
: "GTK Widget Factory",
"version", version,
"copyright", "©1997—2020 The GTK Team",
"copyright", "©1997—2021 The GTK Team",
"license-type", GTK_LICENSE_LGPL_2_1,
"website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK themes and widgets",
@@ -2065,6 +2071,10 @@ activate (GApplication *app)
}
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
if (g_strcmp0 (PROFILE, "devel") == 0)
gtk_widget_add_css_class (GTK_WIDGET (window), "devel");
gtk_application_add_window (GTK_APPLICATION (app), window);
g_action_map_add_action_entries (G_ACTION_MAP (window),
win_entries, G_N_ELEMENTS (win_entries),
@@ -2319,10 +2329,10 @@ activate (GApplication *app)
static void
print_version (void)
{
g_print ("gtk4-widget-factory %d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
gtk_get_micro_version ());
g_print ("gtk4-widget-factory %s%s%s\n",
PACKAGE_VERSION,
g_strcmp0 (PROFILE, "devel") == 0 ? "-" : "",
g_strcmp0 (PROFILE, "devel") == 0 ? VCS_TAG : "");
}
static int

View File

@@ -3298,7 +3298,6 @@ bad things might happen.</property>
</object>
</child>
</object>
<object class="GtkSizeGroup" id="basement-indicators"/>
<menu id="new_style_menu_model">
<section>
<attribute name="display-hint">circular-buttons</attribute>

View File

@@ -696,27 +696,29 @@ Public macros should not be used unless they evaluate to a constant.
### Symbol visibility
Any symbol that is not explicitly annotated using a `GDK_AVAILABLE_IN_*`
macro is considered internal, and not exported in the shared library.
or `GDK_DEPRECATED_IN_*` macro is considered internal, and not exported
in the shared library.
Never export variables as public API, since this is cumbersome on some
platforms. It is always preferable to add getters and setters instead.
Non-exported functions that are needed in more than one source file
should be declared in a private header file.
should be declared in a private header file with a name that ends in
`private.h`.
Non-exported functions that are only needed in one source file
should be declared static.
### Documentation
All public APIs must have gtk-doc comments. For functions, these should
All public APIs must have doc comments. For functions, these should
be placed in the source file, directly above the function.
```c
/* valid */
/**
* gtk_get_flow:
* @widget: a #GtkWidget
* @widget: a `GtkWidget`
*
* Gets the flow of a widget.
*
@@ -736,29 +738,34 @@ be placed in the source file, directly above the function.
Doc comments for macros, function types, class structs, etc should be
placed next to the definitions, typically in headers.
Section introductions should be placed in the source file they describe,
after the license header:
The main content of the doc comments uses markdown, which can include
inline formatting, sections, tables, images, links. For links to
symbols/classes/etc, we use a markdown extension syntax like this:
[class@Gtk.Widget], [method@Gtk.ListView.get_factory],...
Every doc comment should start with a single-sentence paragraph that
can serve as a summary of sorts (it will often be placed next to a
link pointing to the full documentation for the symbol/class/etc).
The summary should not include links.
Long-form documentation for classes should be included in the doc
comment for the struct, typically at the top of the source file,
after the license header and includes:
```c
/* valid */
/**
* SECTION:gtksizerequest
* @Short_Description: Height-for-width geometry management
* @Title: GtkSizeRequest
* GtkSizeRequest:
*
* The GtkSizeRequest interface is GTK's height-for-width geometry
* geometry management system.
*
* # Geometry management
*
* The GtkSizeRequest interface is GTK's height-for-width (and
* width-for-height) geometry management system.
* ...
*/
```
To properly document a new function, macro, function type or struct,
it needs to be listed in the `sections.txt` file.
To properly document a new class, it needs to be given its own section
in the sections.txt, needs to be included in the `docs.xml` file, and the
`get_type` function needs to listed in the `.types` file.
For more information on the documentation style and contribution guidelines,
please [follow the corresponding contribution guide](./reference/README.md).

View File

@@ -6,40 +6,41 @@ The GTK documentation is divided in two major components:
source code
- static pages that provide an overview of specific sections of the API
In both cases, the contents are parsed, converted into DocBook format, and
cross-linked in order to match types, functions, signals, and properties.
From the DocBook output, we generate HTML, which can be used to read the
documentation both offline and online.
In both cases, the contents are parsed as markdown and cross-linked in order
to match types, functions, signals, and properties. Ultimatively, we generate
HTML, which can be used to read the documentation both offline and online.
In both cases, contributing to the GTK documentation requires modifying
files tracked in the source control repository, and follows the same steps
as any other code contribution as outlined in the GTK [contribution
guide][contributing]. Please, refer to that document for any further
question on the mechanics of contributing to GTK.
Contributing to the GTK documentation requires modifying files tracked in the
source control repository, and follows the same steps as any other code
contribution as outlined in the GTK [contribution guide][contributing].
Please, refer to that document for any further question on the mechanics
of contributing to GTK.
GTK uses [gtk-doc][gtkdoc] to generate its documentation. Please, visit the
gtk-doc website to read the project's documentation.
GTK uses [gi-docgen][gidocgen] to generate its documentation. Please, visit
the gi-docgen website to read the project's documentation.
[contributing]: ../../CONTRIBUTING.md
[gtkdoc]: https://wiki.gnome.org/DocumentationProject/GtkDoc
[gi-docgen]: https://gitlab.gnome.org/ebassi/gi-docgen
## Contributing to the API reference
Whenever you need to add or modify the documentation of a type or a
function, you will need to edit a `gtk-doc` comment stanza, typically right
function, you will need to edit a comment stanza, typically right
above the type or function declaration. For instance:
```c
/**
* gtk_foo_set_bar:
* @self: a #GtkFoo
* @bar: a #GtkBar
* @self: a foo widget
* @bar: (nullable): the bar to set
*
* Sets the given #GtkBar instance on a #GtkFoo widget.
* Sets the given `GtkBar` instance on a foo widget.
*
* Returns: `TRUE` if the bar was set
*/
void
gboolean
gtk_foo_set_bar (GtkFoo *self,
GtkBar *bar)
GtkBar *bar)
{
...
```
@@ -51,31 +52,14 @@ Or, for types:
* GtkFoo:
*
* A foo widget instance.
*
* The contents of this structure are private and should never
* be accessed directly.
*/
struct _GtkFoo
{
/*< private >*/
GtkWidget parent_instance;
};
```
Each public function and type in the GTK API reference must be listed in the
`sections.txt` file for the specific namespace to which it belongs: GDK,
GSK, or GTK. For instance, if you add a function named `gtk_foo_set_bar()`,
you will need to:
1. open `docs/reference/gtk/gtk4-sections.txt`
1. find the section that lists the symbols of the `GtkFoo` type
1. add `gtk_foo_set_bar` to the list
New classes require:
1. a new section in the `sections.txt` file
1. the `get_type` function added to the `.types` file
1. an `xinclude` element in the `docs.xml` file
The GTK documentation also contains a number of 'freestanding' chapters
for which the source is in .md files in docs/reference/gtk.
@@ -90,49 +74,61 @@ unrelated reasons.
### Syntax
The input syntax for GTK documentation is markdown, in a flavor that is
similar to what you see on gitlab or github. The markdown support for
fragments that are extracted from sources is more limited than for
The input syntax for GTK documentation is Markdown, in a flavor that is
similar to what you see on GitLab or GitHub. The markdown support for
fragments that are extracted from sources is identical to the one for
freestanding chapters. As an exception, man pages for tools are currently
maintained in docbook, since the conversion from markdown to docbook is
losing too much of the expected formatting.
In addition to typical markdown formatting such as \*emphasis\* or \_italics\_,
gtk-doc supports a few abbreviations for cross-references and formatting:
the GTK documentation supports additional link formats, like:
`#ClassName`
`[class@Namespace.ClassName]`
: Creates a link to the docs for a class
`function()`
: Creates a link to the docs for a function
`[method@Namespace.Method.name]`
: Creates a link to the docs for a method in a class
`%constant`
: Generates suitable markup for enum values or constants
`[func@Namespace.function]`
: Creates a link to the docs for a global function
### Sections
For more information on the available link formats, see the gi-docgen
documentation.
- The "section" of each type must contain a name, to be referenced in the
`sections.txt` file; a title; and a short description. For instance:
Every doc comment should start with a single-sentence paragraph that
can serve as a summary of sorts (it will often be placed next to a
link pointing to the full documentation for the symbol/class/etc).
The summary should not include links.
```c
/**
* SECTION:gtkshortcut
* @Title: GtkShortcut
* @Short_desc: A key shortcut
*
* ...
```
### Introspection annotations
For classes, the title should be the name of the class. While it's
possible to add section titles directly to the `sections.txt` file, this
is considered deprecated, and should not be done for newly written code.
- For classes, the long description should contain an overview of the type;
what it does; typical use cases; and idiomatic examples of its use.
- For widget classes, the long description of a section should also contain:
- special XML elements and attributes parsed by the class, in case of a
custom GtkBuildable implementation
- the CSS element name to be used by selectors
- the CSS selector hierarchy for children, in case of a composite widget
The purpose of the annotations for function arguments, properties, signals,
etc., is to describe the API in a machine readable way. The annotations
are consumed by language bindings and by the documentation tools.
For more information about the annotations used by GTK, you should refer to
the [GObject Introspection documentation][gi-annotations].
[gi-annotations]: https://gi.readthedocs.io/en/latest/annotations/giannotations.html
### Type description
Each type should be annotated with a description of what the type does.
For classes, the description should contain an overview of the type;
what it does; typical use cases; and idiomatic examples of its use.
For widget classes, the description should also contain:
- special XML elements and attributes parsed by the class, in case of a
custom GtkBuildable implementation
- the CSS element name to be used by selectors
- the CSS selector hierarchy for children, in case of a composite widget
- the accessible role of the class
Each section in a type description can have a heading; it's preferred to use
second and third level headings only.
### Functions
@@ -155,17 +151,26 @@ Checks whether the widget is set to be visible or not.
- Methods are special functions whose first argument is always the instance
of a certain class. The instance argument for newly written code should be
called `self`.
- If a method is a setter or a getter for an object property, link the
property in the methods's description.
- If a method is a setter or a getter for an object property, you should
add an `(attributes org.gtk.Method.set_property=property-name)` or a
an `(attributes org.gtk.Method.get_property=property-name)` annotation
to the method's identifier
- If a method changes one or more properties as side effect, link those
properties in the method's description
- If a method is a signal emitter, link the signal in the method's
description.
- If a method is a signal emitter, you should use the
`(attributes org.gtk.Method.signal=signal-name)` annotation in
the method's identifier
### Arguments and return values
- Arguments should be descriptive, but short
- There is no need to mention the type of the argument
- Always annotate nullability, direction, and ownership transfer
### Signals
- While GObject can introspect argument and return types for signals,
you should *always* document them with an explicit gtk-doc stanza.
you should *always* document them with an explicit documentation stanza.
- The syntax for signal stanzas is similar to functions:
```c
@@ -181,12 +186,15 @@ Checks whether the widget is set to be visible or not.
- While GObject properties contain text that can be extracted
programmatically in order to build their documentation, you should
*always* document them with an explicit gtk-doc stanza. The text
*always* document them with an explicit documentation stanza. The text
associated to the property is short and meant to be used when
programmatically building user interfaces, and not for documentation
purposes.
- Always note if setting a property has side effects, like causing another
property to change state.
- If the property has public accessors you should annotate it with
the `(attributes org.gtk.Property.set=setter_function)` and
`(attributes org.gtk.Property.get=getter_function)` attributes
- The syntax for property documentation is:
```c
@@ -198,8 +206,9 @@ Checks whether the widget is set to be visible or not.
### Actions
- Actions are new in GTK 4, and gtk-doc had to learn a new syntax
to document them:
- Actions are new in GTK 4, and describe an action associated to
a widget class
- The syntax for action documentation is:
```
/**c

View File

@@ -0,0 +1,18 @@
----
Title: Cairo interaction
----
## Functions to support using cairo
[Cairo](http://cairographics.org) is a graphics library that supports vector
graphics and image compositing that can be used with GTK.
GDK does not wrap the Cairo API; instead it allows to create Cairo
drawing contexts which can be used to draw on [class@Gdk.Surface]s.
Additional functions allow use [struct@Gdk.Rectangle]s with Cairo
and to use [struct@Gdk.RGBA], `GdkPixbuf`, and [class@Gdk.Surface]
instances as sources for drawing operations.
For more information on Cairo, please see the
[Cairo API reference](https://www.cairographics.org/manual/).

View File

@@ -1,85 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GDK 4 Reference Manual</title>
<releaseinfo>
This document is for the GDK 4 library, version &version;.
The latest versions can be found online at
<ulink role="online-location" url="https://developer.gnome.org/gdk4/">https://developer.gnome.org/gdk4/</ulink>.
If you are looking for the older GDK 3 series of libraries,
see <ulink role="online-location" url="https://developer.gnome.org/gdk3/">https://developer.gnome.org/gdk3/</ulink>.
</releaseinfo>
</bookinfo>
<chapter>
<title>API Reference</title>
<xi:include href="xml/general.xml" />
<xi:include href="xml/gdkdisplaymanager.xml" />
<xi:include href="xml/gdkdisplay.xml" />
<xi:include href="xml/gdkseat.xml" />
<xi:include href="xml/gdkdevice.xml" />
<section>
<xi:include href="xml/gdkdevicepad.xml" />
</section>
<xi:include href="xml/gdkmonitor.xml" />
<xi:include href="xml/regions.xml" />
<xi:include href="xml/textures.xml" />
<xi:include href="xml/gdkpaintable.xml" />
<xi:include href="xml/rgba_colors.xml" />
<xi:include href="xml/cursors.xml" />
<xi:include href="xml/gdksurface.xml" />
<xi:include href="xml/gdktoplevel.xml" />
<section>
<xi:include href="xml/gdktoplevellayout.xml" />
<xi:include href="xml/gdktoplevelsize.xml" />
</section>
<xi:include href="xml/gdkpopup.xml" />
<section>
<xi:include href="xml/gdkpopuplayout.xml" />
</section>
<xi:include href="xml/gdkframeclock.xml" />
<section>
<xi:include href="xml/gdkframetimings.xml" />
</section>
<xi:include href="xml/gdkdrawcontext.xml" />
<section>
<xi:include href="xml/gdkglcontext.xml" />
<xi:include href="xml/gdkvulkancontext.xml" />
<xi:include href="xml/gdkcairocontext.xml" />
</section>
<xi:include href="xml/events.xml" />
<xi:include href="xml/keys.xml" />
<xi:include href="xml/gdkclipboard.xml" />
<xi:include href="xml/dnd.xml" />
<xi:include href="xml/gdkcontentformats.xml" />
<xi:include href="xml/gdkcontentprovider.xml" />
<xi:include href="xml/gdkcontentserializer.xml" />
<xi:include href="xml/gdkcontentdeserializer.xml" />
<xi:include href="xml/pixbufs.xml" />
<xi:include href="xml/pango_interaction.xml" />
<xi:include href="xml/cairo_interaction.xml" />
</chapter>
<chapter>
<title>GDK Platform Support</title>
<xi:include href="xml/gdkapplaunchcontext.xml" />
<xi:include href="xml/x_interaction.xml" />
<xi:include href="xml/wayland_interaction.xml" />
</chapter>
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-deprecated" role="deprecated">
<title>Index of deprecated symbols</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>

View File

@@ -1,25 +0,0 @@
<MACRO>
<NAME>GDK_WINDOWING_X11</NAME>
#define GDK_WINDOWING_X11
</MACRO>
<MACRO>
<NAME>GDK_WINDOWING_WIN32</NAME>
#define GDK_WINDOWING_WIN32
</MACRO>
<MACRO>
<NAME>GDK_WINDOWING_MACOS</NAME>
#define GDK_WINDOWING_MACOS
</MACRO>
<MACRO>
<NAME>GDK_WINDOWING_WAYLAND</NAME>
#define GDK_WINDOWING_WAYLAND
</MACRO>
<MACRO>
<NAME>GDK_DISABLE_DEPRECATION_WARNINGS</NAME>
#define GDK_DISABLE_DEPRECATION_WARNINGS
</MACRO>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
[library]
version = "@version@"
browse_url = "https://gitlab.gnome.org/GNOME/gtk/"
repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = [ "GObject-2.0" ]
devhelp = true
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://developer.gnome.org/gobject/stable"
[theme]
name = "basic"
show_index_summary = true
[source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"

View File

@@ -0,0 +1,23 @@
[library]
version = "@version@"
browse_url = "https://gitlab.gnome.org/GNOME/gtk/"
repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = [ "GObject-2.0" ]
devhelp = true
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://developer.gnome.org/gobject/stable"
[theme]
name = "basic"
show_index_summary = true
[source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"

View File

@@ -0,0 +1,97 @@
[library]
version = "@version@"
browse_url = "https://gitlab.gnome.org/GNOME/gtk/"
repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = [ "GObject-2.0", "cairo-1.0", "Pango-1.0", "GdkWayland-4.0", "GdkX11-4.0" ]
devhelp = true
search_index = true
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://developer.gnome.org/gobject/stable"
[dependencies."cairo-1.0"]
name = "Cairo"
description = "A 2D graphics library with support for multiple output devices"
docs_url = "https://www.cairographics.org/manual/"
[dependencies."Pango-1.0"]
name = "Pango"
description = "Text shaping and rendering"
docs_url = "https://developer.gnome.org/pango/stable"
[dependencies."GdkWayland-4.0"]
name = "GdkWayland"
description = "GDK Wayland Backend"
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/"
[dependencies."GdkX11-4.0"]
name = "GdkX11"
description = "GDK X11 Backend"
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/"
[theme]
name = "basic"
show_index_summary = true
show_class_hierarchy = true
[source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra]
content_files = [
"keys.md",
"cairo.md",
"pango.md",
"wayland.md",
"x11.md",
"macos.md",
]
content_images = [
"images/gtk-logo.svg",
"images/rotated-text.png",
"images/default_cursor.png",
"images/help_cursor.png",
"images/pointer_cursor.png",
"images/context_menu_cursor.png",
"images/progress_cursor.png",
"images/wait_cursor.png",
"images/cell_cursor.png",
"images/crosshair_cursor.png",
"images/text_cursor.png",
"images/vertical_text_cursor.png",
"images/alias_cursor.png",
"images/copy_cursor.png",
"images/no_drop_cursor.png",
"images/move_cursor.png",
"images/not_allowed_cursor.png",
"images/grab_cursor.png",
"images/grabbing_cursor.png",
"images/all_scroll_cursor.png",
"images/col_resize_cursor.png",
"images/row_resize_cursor.png",
"images/n_resize_cursor.png",
"images/e_resize_cursor.png",
"images/s_resize_cursor.png",
"images/w_resize_cursor.png",
"images/ne_resize_cursor.png",
"images/nw_resize_cursor.png",
"images/sw_resize_cursor.png",
"images/se_resize_cursor.png",
"images/ew_resize_cursor.png",
"images/ns_resize_cursor.png",
"images/nesw_resize_cursor.png",
"images/nwse_resize_cursor.png",
"images/zoom_in_cursor.png",
"images/zoom_out_cursor.png",
"images/popup-anchors.png",
"images/popup-flip.png",
"images/popup-slide.png",
]
urlmap_file = "urlmap.js"

View File

@@ -1,32 +0,0 @@
gdk_app_launch_context_get_type
gdk_clipboard_get_type
gdk_content_deserializer_get_type
gdk_content_formats_get_type
gdk_content_provider_get_type
gdk_content_serializer_get_type
gdk_cursor_get_type
gdk_device_get_type
gdk_device_pad_get_type
gdk_device_tool_get_type
gdk_display_get_type
gdk_display_manager_get_type
gdk_drag_get_type
gdk_drag_surface_get_type
gdk_drop_get_type
gdk_event_get_type
gdk_frame_clock_get_type
gdk_gl_context_get_type
gdk_gl_texture_get_type
gdk_memory_texture_get_type
gdk_monitor_get_type
gdk_paintable_get_type
gdk_popup_get_type
gdk_popup_layout_get_type
gdk_rgba_get_type
gdk_seat_get_type
gdk_snapshot_get_type
gdk_surface_get_type
gdk_texture_get_type
gdk_toplevel_get_type
gdk_toplevel_layout_get_type
gdk_vulkan_context_get_type

View File

@@ -0,0 +1,16 @@
Title: Library initialization and versioning
The GDK and GTK headers annotate deprecated APIs in a way that produces
compiler warnings if these deprecated APIs are used. The warnings
can be turned off by defining the macro `GDK_DISABLE_DEPRECATION_WARNINGS`
before including the `gdk.h` header.
GDK and GTK also provide support for building applications against defined
subsets of deprecated or new APIs. You can define the macro
`GDK_VERSION_MIN_REQUIRED` to specify up to what version you want to receive
warnings about deprecated APIs; and the macro `GDK_VERSION_MAX_ALLOWED` to
specify the newest version whose API you want to use. If you attempt to use
a function deprecated before the version of GTK specified in
`GDK_VERSION_MIN_REQUIRED`, or a function introduced after the version of
GTK specified in `GDK_VERSION_MAX_ALLOWED`, the compiler will warn you when
building your code.

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg6843"
sodipodi:version="0.32"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
version="1.0"
sodipodi:docname="gtk-logo.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/ebassi/Pictures/gtk-logo-256.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs6845">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-50 : 600 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="700 : 600 : 1"
inkscape:persp3d-origin="300 : 400 : 1"
id="perspective13" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="69.874353"
inkscape:cy="64.313526"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:document-units="px"
inkscape:grid-bbox="true"
width="128px"
height="128px"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid7947" />
</sodipodi:namedview>
<metadata
id="metadata6848">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:date />
<dc:creator>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:rights>
<dc:publisher>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:publisher>
<dc:identifier />
<dc:source />
<dc:relation />
<dc:language />
<dc:subject>
<rdf:Bag />
</dc:subject>
<dc:coverage />
<dc:description />
<dc:contributor>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:contributor>
<cc:license
rdf:resource="" />
</cc:Work>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccccc"
id="path6976"
d="M 20.88413,30.82696 L 53.816977,55.527708 L 107.33282,39.060543 L 70.587303,17.177763 L 20.88413,30.82696 z"
style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6978"
d="M 22.94243,82.287118 L 20.88413,30.82696 L 53.816977,55.527708 L 53.816977,111.10486 L 22.94243,82.287118 z"
style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6980"
d="M 53.816977,111.10486 L 103.21619,90.5207 L 107.33282,39.060543 L 53.816977,55.527708 L 53.816977,111.10486 z"
style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
sodipodi:nodetypes="ccc"
id="path6982"
d="M 23.216626,81.319479 L 70.48573,67.361442 L 103.38422,90.444516"
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path6984"
d="M 70.434539,17.875593 L 70.434539,66.984877"
style="opacity:1;fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

113
docs/reference/gdk/keys.md Normal file
View File

@@ -0,0 +1,113 @@
Title: Key Values
## Functions for manipulating keyboard codes
Key values are the codes which are sent whenever a key is pressed or released.
They are included in the data contained in a key press or release #GdkEvent.
The complete list of key values can be found in the `gdk/gdkkeysyms.h` header
file.
Key values are regularly updated from the upstream X.org X11 implementation,
so new values are added regularly. They will be prefixed with GDK_KEY_ rather
than XF86XK_ or XK_ (for older symbols).
Key values can be converted into a string representation using
gdk_keyval_name(). The reverse function, converting a string to a key value,
is provided by gdk_keyval_from_name().
The case of key values can be determined using gdk_keyval_is_upper() and
gdk_keyval_is_lower(). Key values can be converted to upper or lower case
using gdk_keyval_to_upper() and gdk_keyval_to_lower().
When it makes sense, key values can be converted to and from
Unicode characters with gdk_keyval_to_unicode() and gdk_unicode_to_keyval().
## Key groups
At the lowest level, physical keys on the keyboard are represented by
numeric keycodes, and GDK knows how to translate these keycodes into
key values according to the configured keyboard layout and the current
state of the keyboard. In the GDK api, the mapping from keycodes to key
values is available via [`method@Gdk.Display.map_keycode`], and the reverse
mapping is available via [`method@Gdk.Display.map_keyval`]. The results of
these functions are returned in [struct@Gdk.KeymapKey] structures.
You can think of a [struct@Gdk.KeymapKey] as a representation of a symbol
printed on a physical keyboard key. That is, it contains three pieces of
information:
1. first, it contains the hardware keycode; this is an identifying number
for a physical key
1. second, it contains the “level” of the key. The level indicates which
symbol on the key will be used, in a vertical direction. So on a standard
US keyboard, the key with the number “1“ on it also has the exclamation
point (”!”) character on it. The level indicates whether to use the “1”
or the “!” symbol. The letter keys are considered to have a lowercase
letter at level 0, and an uppercase letter at level 1, though normally
only the uppercase letter is printed on the key
1. third, the #GdkKeymapKey contains a group; groups are not used on
standard US keyboards, but are used in many other countries. On a
keyboard with groups, there can be 3 or 4 symbols printed on a single
key. The group indicates movement in a horizontal direction. Usually
groups are used for two different languages. In group 0, a key might
have two English characters, and in group 1 it might have two Hebrew
characters. The Hebrew characters will be printed on the key next to
the English characters.
When GDK creates a key event in order to deliver a key press or release,
it first converts the current keyboard state into an effective group and
level. This is done via a set of rules that varies widely according to
type of keyboard and user configuration. The input to this translation
consists of the hardware keycode pressed, the active modifiers, and the
active group. It then applies the appropriate rules, and returns the
group/level to be used to index the keymap, along with the modifiers
which did not affect the group and level. i.e. it returns “unconsumed
modifiers.” The keyboard group may differ from the effective group used
for lookups because some keys don't have multiple groups - e.g. the
<kbd>Enter</kbd> key is always in group 0 regardless of keyboard state.
The results of the translation, including the keyval, are all included
in the key event and can be obtained via [class@Gdk.KeyEvent] getters.
### Consumed modifiers
The `consumed_modifiers` in a key event are modifiers that should be masked
out from @state when comparing this key press to a hot key. For instance,
on a US keyboard, the `plus` symbol is shifted, so when comparing a key
press to a `<Control>plus` accelerator `<Shift>` should be masked out.
```c
// We want to ignore irrelevant modifiers like ScrollLock
#define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK)
state = gdk_event_get_modifier_state (event);
gdk_keymap_translate_keyboard_state (keymap,
gdk_key_event_get_keycode (event),
state,
gdk_key_event_get_group (event),
&keyval, NULL, NULL, &consumed);
if (keyval == GDK_PLUS &&
(state & ~consumed & ALL_ACCELS_MASK) == GDK_CONTROL_MASK)
// Control was pressed
```
An older interpretation of `consumed_modifiers` was that it contained
all modifiers that might affect the translation of the key;
this allowed accelerators to be stored with irrelevant consumed
modifiers, by doing:
```c
// XXX Dont do this XXX
if (keyval == accel_keyval &&
(state & ~consumed & ALL_ACCELS_MASK) == (accel_mods & ~consumed))
// Accelerator was pressed
```
However, this did not work if multi-modifier combinations were
used in the keymap, since, for instance, `<Control>` would be
masked out even if only `<Control><Alt>` was used in
the keymap. To support this usage as well as well as possible, all single
modifier combinations that could affect the key for any combination
of modifiers will be returned in `consumed_modifiers`; multi-modifier
combinations are returned only when actually found in `state`. When
you store accelerators, you should always store them with consumed
modifiers removed. Store `<Control>plus`, not `<Control><Shift>plus`.

View File

@@ -0,0 +1,58 @@
Title: macOS Interaction
## macOS backend-specific functions
The functions in this section are specific to the GDK macOS backend.
To use them, you need to include the `<gdk/macos/gdkmacos.h>` header and
use the macOS-specific pkg-config `gtk4-macos` file to build your
application.
## Checking for the macOS backend
GDK can be built with support for multiple backends, which means you will
need to perform both compile time *and* run time checks if you wish to call
backend-specific API; for instance, the code sample below will guard the
calls to different backends, and error out on unsupported windowing systems:
```c
#ifdef GDK_WINDOWING_MACOS
#include <gdk/macos/gdkmacos.h>
#endif
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/wayland/gdkwayland.h>
#endif
#ifdef GDK_WINDOWING_X11
#include <gdk/x11/gdkx.h>
#endif
#ifdef GDK_WINDOWING_MACOS
if (GDK_IS_MACOS_DISPLAY (display))
{
// make macOS-specific calls here
}
else
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (GTK_IS_WAYLAND_DISPLAY (display))
{
// make Wayland-specific calls here
}
else
#endif
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
// make X11-specific calls here
}
else
#endif
g_error ("Unsupported GDK backend");
```
The compile time check is performed by using the `GDK_WINDOWING_*`
pre-processor symbols; there is one defined for each windowing system
backend built into GDK. For Wayland, the symbol is `GDK_WINDOWING_MACOS`.
The run time check is performed by looking at the type of the
[class@Gdk.Display] object. For Wayland, the display objects will be of type
`GdkMacosDisplay`.

View File

@@ -1,187 +1,74 @@
private_headers = [
'gdk-autocleanup.h',
'gdk-private.h',
'gdkapplaunchcontextprivate.h',
'gdkcairocontextprivate.h',
'gdkcairoprivate.h',
'gdkclipboardprivate.h',
'gdkcontentformatsprivate.h',
'gdkcontentproviderprivate.h',
'gdkcursorprivate.h',
'gdkdebug.h',
'gdkdevicepadprivate.h',
'gdkdeviceprivate.h',
'gdkdevicetoolprivate.h',
'gdkdisplaymanagerprivate.h',
'gdkdisplayprivate.h',
'gdkdndprivate.h',
'gdkdragprivate.h',
'gdkdragsurfaceprivate.h',
'gdkdrawcontextprivate.h',
'gdkdropprivate.h',
'gdkeventsprivate.h',
'gdkframeclockidleprivate.h',
'gdkframeclockprivate.h',
'gdkglcontextprivate.h',
'gdkgltextureprivate.h',
'gdkinternals.h',
'gdkintl.h',
'gdkkeysprivate.h',
'gdkkeysyms.h',
'gdkmarshalers.h',
'gdkmemorytextureprivate.h',
'gdkmonitorprivate.h',
'gdkpipeiostreamprivate.h',
'gdkpopupprivate.h',
'gdkprofilerprivate.h',
'gdkrgbaprivate.h',
'gdkscreenprivate.h',
'gdkseatdefaultprivate.h',
'gdkseatprivate.h',
'gdksnapshotprivate.h',
'gdksurfaceimpl.h',
'gdksurfaceprivate.h',
'gdktextureprivate.h',
'gdktoplevelprivate.h',
'gdktoplevelsizeprivate.h',
'gdkvulkancontextprivate.h',
'filetransferportalprivate.h',
'gdkconstructor.h',
'keyname-table.h',
# gdk/x11
'gdkasync.h',
'gdkcairocontext-x11.h',
'gdkclipboard-x11.h',
'gdkdevice-xi2-private.h',
'gdkdevicemanagerprivate-core.h',
'gdkdisplay-x11.h',
'gdkeventsource.h',
'gdkeventtranslator.h',
'gdkglcontext-x11.h',
'gdkkeys-x11.h',
'gdkmonitor-x11.h',
'gdkprivate-x11.h',
'gdkscreen-x11.h',
'gdkselectioninputstream-x11.h',
'gdkselectionoutputstream-x11.h',
'gdksurface-x11.h',
'gdktextlistconverter-x11.h',
'gdkvisual-x11.h',
'gdkvulkancontext-x11.h',
'gdkx-autocleanups.h',
'MwmUtil.h',
'xsettings-client.h',
# gdk/wayland
'gdkcairocontext-wayland.h',
'gdkclipboard-wayland.h',
'gdkdevice-wayland-private.h',
'gdkdisplay-wayland.h',
'gdkglcontext-wayland.h',
'gdkmonitor-wayland.h',
'gdkprimary-wayland.h',
'gdkprivate-wayland.h',
'gdkseat-wayland.h',
'gdksurface-wayland.h',
'gdkvulkancontext-wayland.h',
'wm-button-layout-translation.h',
'gtk-primary-selection-client-protocol.h',
'gtk-shell-client-protocol.h',
'idle-inhibit-unstable-v1-client-protocol.h',
'keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h',
'pointer-gestures-unstable-v1-client-protocol.h',
'primary-selection-unstable-v1-client-protocol.h',
'server-decoration-client-protocol.h',
'tablet-unstable-v2-client-protocol.h',
'xdg-foreign-unstable-v1-client-protocol.h',
'xdg-shell-unstable-v6-client-protocol.h',
'xdg-output-unstable-v1-client-protocol.h',
'xdg-shell-client-protocol.h',
'xdg-shell-unstable-v6-client-protocol.h',
'wayland-cursor.h',
'os-compatibility.h',
'xcursor.h',
'broadway',
'wayland/cursor',
'macos',
'win32',
expand_content_md_files = [
]
images = [
'images/rotated-text.png',
'images/default_cursor.png',
'images/help_cursor.png',
'images/pointer_cursor.png',
'images/context_menu_cursor.png',
'images/progress_cursor.png',
'images/wait_cursor.png',
'images/cell_cursor.png',
'images/crosshair_cursor.png',
'images/text_cursor.png',
'images/vertical_text_cursor.png',
'images/alias_cursor.png',
'images/copy_cursor.png',
'images/no_drop_cursor.png',
'images/move_cursor.png',
'images/not_allowed_cursor.png',
'images/grab_cursor.png',
'images/grabbing_cursor.png',
'images/all_scroll_cursor.png',
'images/col_resize_cursor.png',
'images/row_resize_cursor.png',
'images/n_resize_cursor.png',
'images/e_resize_cursor.png',
'images/s_resize_cursor.png',
'images/w_resize_cursor.png',
'images/ne_resize_cursor.png',
'images/nw_resize_cursor.png',
'images/sw_resize_cursor.png',
'images/se_resize_cursor.png',
'images/ew_resize_cursor.png',
'images/ns_resize_cursor.png',
'images/nesw_resize_cursor.png',
'images/nwse_resize_cursor.png',
'images/zoom_in_cursor.png',
'images/zoom_out_cursor.png',
]
src_dir = [ gdkinc ]
if x11_enabled
src_dir += [ gdkx11_inc ]
endif
if wayland_enabled
src_dir += [ gdkwayland_inc ]
endif
gdk4_toml = configure_file(input: 'gdk4.toml.in', output: 'gdk4.toml', configuration: toml_conf)
gdk4x11_toml = configure_file(input: 'gdk4-x11.toml.in', output: 'gdk4-x11.toml', configuration: toml_conf)
gdk4wayland_toml = configure_file(input: 'gdk4-wayland.toml.in', output: 'gdk4-wayland.toml', configuration: toml_conf)
if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
gnome.gtkdoc('gdk4',
mode: 'none',
main_xml: 'gdk4-docs.xml',
src_dir: src_dir,
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
custom_target('gdk4-doc',
input: [ gdk4_toml, gdk_gir[0] ],
output: 'gdk4',
command: [
gidocgen,
'generate',
'--quiet',
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
mkdb_args: [
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
],
html_assets: images,
depend_files: [ expand_content_md_files ],
build_by_default: true,
install: true,
install_dir: docs_dir,
)
if x11_enabled
custom_target('gdk4-x11-doc',
input: [ gdk4x11_toml, gdk_x11_gir[0] ],
output: 'gdk4-x11',
command: [
gidocgen,
'generate',
'--quiet',
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
depends: [ gdk_gir[0] ],
depend_files: [ ],
build_by_default: true,
install: true,
install_dir: docs_dir,
)
endif
if wayland_enabled
custom_target('gdk4-wayland-doc',
input: [ gdk4wayland_toml, gdk_wayland_gir[0] ],
output: 'gdk4-wayland',
command: [
gidocgen,
'generate',
'--quiet',
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
depends: [ gdk_gir[0] ],
depend_files: [ ],
build_by_default: true,
install: true,
install_dir: docs_dir,
)
endif
endif

View File

@@ -0,0 +1,94 @@
Title: Pango Interaction
Pango is the text layout system used by GDK and GTK. The functions
and types in this section are used to obtain clip regions for
`PangoLayout`s, and to get `PangoContext`s that can be used with
GDK.
## Using Pango in GDK
Creating a `PangoLayout` object is the first step in rendering text,
and requires getting a handle to a `PangoContext`. For GTK programs,
youll usually want to use [method@Gtk.Widget.get_pango_context], or
[method@Gtk.Widget.create_pango_layout]. Once you have a `PangoLayout`,
you can set the text and attributes of it with Pango functions like
[method@Pango.Layout.set_text] and get its size with
[method@Pango.Layout.get_size].
*Note*: Pango uses a fixed point system internally, so converting
between Pango units and pixels using `PANGO_SCALE` or the `PANGO_PIXELS()`
macro.
Rendering a Pango layout is done most simply with [func@PangoCairo.show_layout];
you can also draw pieces of the layout with [func@PangoCairo.show_layout_line].
### Draw transformed text with Pango and cairo
```c
#define RADIUS 100
#define N_WORDS 10
#define FONT "Sans Bold 18"
PangoContext *context;
PangoLayout *layout;
PangoFontDescription *desc;
double radius;
int width, height;
int i;
// Set up a transformation matrix so that the user space coordinates for
// where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
// We first center, then change the scale
width = gdk_surface_get_width (surface);
height = gdk_surface_get_height (surface);
radius = MIN (width, height) / 2.;
cairo_translate (cr,
radius + (width - 2 * radius) / 2,
radius + (height - 2 * radius) / 2);
cairo_scale (cr, radius / RADIUS, radius / RADIUS);
// Create a PangoLayout, set the font and text
context = gdk_pango_context_get_for_display (display);
layout = pango_layout_new (context);
pango_layout_set_text (layout, "Text", -1);
desc = pango_font_description_from_string (FONT);
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
// Draw the layout N_WORDS times in a circle
for (i = 0; i < N_WORDS; i++)
{
double red, green, blue;
double angle = 2 * G_PI * i / n_words;
cairo_save (cr);
// Gradient from red at angle == 60 to blue at angle == 300
red = (1 + cos (angle - 60)) / 2;
green = 0;
blue = 1 - red;
cairo_set_source_rgb (cr, red, green, blue);
cairo_rotate (cr, angle);
// Inform Pango to re-layout the text with the new transformation matrix
pango_cairo_update_layout (cr, layout);
pango_layout_get_size (layout, &width, &height);
cairo_move_to (cr, - width / 2 / PANGO_SCALE, - DEFAULT_TEXT_RADIUS);
pango_cairo_show_layout (cr, layout);
cairo_restore (cr);
}
g_object_unref (layout);
g_object_unref (context);
```
The example code above will yield the following result:
![](rotated-text.png)

View File

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View File

@@ -0,0 +1,13 @@
// SPDX-FileCopyrightText: 2021 GNOME Foundation
// SPDX-License-Identifier: LGPL-2.1-or-later
// A map between namespaces and base URLs for their online documentation
baseURLs = [
[ 'Gdk', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4/' ],
[ 'GdkWayland', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/' ],
[ 'GdkX11', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/' ],
[ 'Gsk', 'https://gnome.pages.gitlab.gnome.org/gtk/gsk4/' ],
[ 'Gtk', 'https://gnome.pages.gitlab.gnome.org/gtk/gtk4/' ],
[ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
[ 'PangoCairo', 'https://gnome.pages.gitlab.gnome.org/pango/pangocairo/' ],
]

View File

@@ -1 +0,0 @@
@GTK_VERSION@

View File

@@ -0,0 +1,48 @@
Title: Wayland Interaction
## Wayland backend-specific functions
The functions in this section are specific to the GDK Wayland backend.
To use them, you need to include the `<gdk/wayland/gdkwayland.h>` header and
use the Wayland-specific pkg-config `gtk4-wayland` file to build your
application.
## Checking for the Wayland backend
GDK can be built with support for multiple backends, which means you will
need to perform both compile time *and* run time checks if you wish to call
backend-specific API; for instance, the code sample below will guard the
calls to different backends, and error out on unsupported windowing systems:
```c
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/wayland/gdkwayland.h>
#endif
#ifdef GDK_WINDOWING_X11
#include <gdk/x11/gdkx.h>
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (GTK_IS_WAYLAND_DISPLAY (display))
{
// make Wayland-specific calls here
}
else
#endif
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
// make X11-specific calls here
}
else
#endif
g_error ("Unsupported GDK backend");
```
The compile time check is performed by using the `GDK_WINDOWING_*`
pre-processor symbols; there is one defined for each windowing system
backend built into GDK. For Wayland, the symbol is `GDK_WINDOWING_WAYLAND`.
The run time check is performed by looking at the type of the
[class@Gdk.Display] object. For Wayland, the display objects will be of type
`GdkWaylandDisplay`.

47
docs/reference/gdk/x11.md Normal file
View File

@@ -0,0 +1,47 @@
Title: X Window System Interaction
## X backend-specific functions
The functions in this section are specific to the GDK X11 backend.
To use them, you need to include the `<gdk/x11/gdkx.h>` header and use
the X11-specific pkg-config file `gtk4-x11` to build your application.
## Checking for the X11 backend
GDK can be built with support for multiple backends, which means you will
need to perform both compile time *and* run time checks if you wish to call
backend-specific API; for instance, the code sample below will guard the
calls to different backends, and error out on unsupported windowing systems:
```c
#ifdef GDK_WINDOWING_X11
#include <gdk/x11/gdkx.h>
#endif
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/wayland/gdkwayland.h>
#endif
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
// make X11-specific calls here
}
else
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (GTK_IS_WAYLAND_DISPLAY (display))
{
// make Wayland-specific calls here
}
else
#endif
g_error ("Unsupported GDK backend");
```
The compile time check is performed by using the `GDK_WINDOWING_*`
pre-processor symbols; there is one defined for each windowing system
backend built into GDK. For X11, the symbol is `GDK_WINDOWING_X11`.
The run time check is performed by looking at the type of the
[class@Gdk.Display] object. For X11, the display objects will be of type
`GdkX11Display`.

View File

@@ -1,33 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GSK 4 Reference Manual</title>
<releaseinfo>
This document is for the GSK 4 library, version &version;
The latest versions can be found online at
<ulink role="online-location" url="https://developer.gnome.org/gsk4/">https://developer.gnome.org/gsk4/</ulink>.
</releaseinfo>
</bookinfo>
<reference id="reference">
<title>API Reference</title>
<xi:include href="xml/GskRenderer.xml" />
<xi:include href="xml/GskRenderNode.xml" />
<xi:include href="xml/GskRoundedRect.xml" />
<xi:include href="xml/GskTransform.xml" />
<xi:include href="xml/GskGLShader.xml" />
</reference>
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>

View File

@@ -1,399 +0,0 @@
<SECTION>
<FILE>GskRenderer</FILE>
GskRenderer
gsk_renderer_get_surface
gsk_renderer_realize
gsk_renderer_unrealize
gsk_renderer_is_realized
gsk_renderer_render
gsk_renderer_render_texture
<SUBSECTION>
gsk_renderer_new_for_surface
gsk_gl_renderer_new
gsk_cairo_renderer_new
gsk_vulkan_renderer_new
gsk_broadway_renderer_new
<SUBSECTION Standard>
GSK_IS_RENDERER
GSK_RENDERER
GSK_TYPE_RENDERER
GskRendererClass
gsk_renderer_get_type
GSK_TYPE_SCALING_FILTER
GSK_BROADWAY_RENDERER
GSK_BROADWAY_RENDERER_CLASS
GSK_BROADWAY_RENDERER_GET_CLASS
GSK_IS_BROADWAY_RENDERER
GSK_IS_BROADWAY_RENDERER_CLASS
GSK_TYPE_BROADWAY_RENDERER
GskBroadwayRenderer
GskBroadwayRendererClass
GSK_CAIRO_RENDERER
GSK_CAIRO_RENDERER_CLASS
GSK_CAIRO_RENDERER_GET_CLASS
GSK_IS_CAIRO_RENDERER
GSK_IS_CAIRO_RENDERER_CLASS
GSK_TYPE_CAIRO_RENDERER
GskCairoRenderer
GskCairoRendererClass
GSK_GL_RENDERER
GSK_GL_RENDERER_CLASS
GSK_GL_RENDERER_GET_CLASS
GSK_IS_GL_RENDERER
GSK_IS_GL_RENDERER_CLASS
GSK_TYPE_GL_RENDERER
GskGLRenderer
GskGLRendererClass
gsk_gl_renderer_get_type
GSK_VULKAN_RENDERER
GSK_VULKAN_RENDERER_CLASS
GSK_VULKAN_RENDERER_GET_CLASS
GSK_IS_VULKAN_RENDERER
GSK_IS_VULKAN_RENDERER_CLASS
GSK_TYPE_VULKAN_RENDERER
GskVulkanRenderer
GskVulkanRendererClass
gsk_vulkan_renderer_get_type
</SECTION>
<SECTION>
<FILE>GskRenderNode</FILE>
GskRenderNode
GskBlendNode
GskBlurNode
GskBorderNode
GskCairoNode
GskClipNode
GskColorMatrixNode
GskColorNode
GskConicGradientNode
GskContainerNode
GskCrossFadeNode
GskDebugNode
GskInsetShadowNode
GskLinearGradientNode
GskRadialGradientNode
GskOpacityNode
GskOutsetShadowNode
GskRepeatingLinearGradientNode
GskRepeatingRadialGradientNode
GskRepeatNode
GskRoundedClipNode
GskShadowNode
GskTextNode
GskTextureNode
GskTransformNode
GskGLShaderNode
gsk_render_node_ref
gsk_render_node_unref
GskRenderNodeType
gsk_render_node_get_node_type
gsk_render_node_draw
GskSerializationError
GskParseErrorFunc
GskParseLocation
gsk_render_node_serialize
gsk_render_node_deserialize
gsk_render_node_write_to_file
GskScalingFilter
gsk_render_node_get_bounds
<SUBSECTION>
gsk_color_node_new
gsk_color_node_get_color
gsk_texture_node_new
gsk_texture_node_get_texture
<SUBSECTION>
GskColorStop
gsk_linear_gradient_node_new
gsk_repeating_linear_gradient_node_new
gsk_linear_gradient_node_get_start
gsk_linear_gradient_node_get_end
gsk_linear_gradient_node_get_n_color_stops
gsk_linear_gradient_node_get_color_stops
<SUBSECTION>
gsk_radial_gradient_node_new
gsk_repeating_radial_gradient_node_new
gsk_radial_gradient_node_get_n_color_stops
gsk_radial_gradient_node_get_color_stops
gsk_radial_gradient_node_get_start
gsk_radial_gradient_node_get_end
gsk_radial_gradient_node_get_hradius
gsk_radial_gradient_node_get_vradius
gsk_radial_gradient_node_get_center
<SUBSECTION>
gsk_conic_gradient_node_new
gsk_conic_gradient_node_get_n_color_stops
gsk_conic_gradient_node_get_color_stops
gsk_conic_gradient_node_get_center
gsk_conic_gradient_node_get_rotation
<SUBSECTION>
gsk_border_node_new
gsk_border_node_get_outline
gsk_border_node_get_widths
gsk_border_node_get_colors
<SUBSECTION>
gsk_inset_shadow_node_new
gsk_inset_shadow_node_get_outline
gsk_inset_shadow_node_get_color
gsk_inset_shadow_node_get_dx
gsk_inset_shadow_node_get_dy
gsk_inset_shadow_node_get_spread
gsk_inset_shadow_node_get_blur_radius
<SUBSECTION>
gsk_outset_shadow_node_new
gsk_outset_shadow_node_get_outline
gsk_outset_shadow_node_get_color
gsk_outset_shadow_node_get_dx
gsk_outset_shadow_node_get_dy
gsk_outset_shadow_node_get_spread
gsk_outset_shadow_node_get_blur_radius
<SUBSECTION>
gsk_cairo_node_new
gsk_cairo_node_get_draw_context
gsk_cairo_node_get_surface
<SUBSECTION>
gsk_container_node_new
gsk_container_node_get_n_children
gsk_container_node_get_child
<SUBSECTION>
gsk_transform_node_new
gsk_transform_node_get_child
gsk_transform_node_get_transform
<SUBSECTION>
gsk_opacity_node_new
gsk_opacity_node_get_child
gsk_opacity_node_get_opacity
<SUBSECTION>
gsk_color_matrix_node_new
gsk_color_matrix_node_get_child
gsk_color_matrix_node_get_color_matrix
gsk_color_matrix_node_get_color_offset
<SUBSECTION>
gsk_repeat_node_new
gsk_repeat_node_get_child
gsk_repeat_node_get_child_bounds
<SUBSECTION>
gsk_clip_node_new
gsk_clip_node_get_child
gsk_clip_node_get_clip
<SUBSECTION>
gsk_rounded_clip_node_new
gsk_rounded_clip_node_get_child
gsk_rounded_clip_node_get_clip
<SUBSECTION>
GskShadow
gsk_shadow_node_new
gsk_shadow_node_get_shadow
gsk_shadow_node_get_n_shadows
gsk_shadow_node_get_child
<SUBSECTION>
GskBlendMode
gsk_blend_node_new
gsk_blend_node_get_bottom_child
gsk_blend_node_get_top_child
gsk_blend_node_get_blend_mode
<SUBSECTION>
gsk_cross_fade_node_new
gsk_cross_fade_node_get_start_child
gsk_cross_fade_node_get_end_child
gsk_cross_fade_node_get_progress
<SUBSECTION>
gsk_text_node_new
gsk_text_node_get_font
gsk_text_node_get_glyphs
gsk_text_node_get_color
gsk_text_node_has_color_glyphs
gsk_text_node_get_num_glyphs
gsk_text_node_get_offset
<SUBSECTION>
gsk_blur_node_new
gsk_blur_node_get_child
gsk_blur_node_get_radius
<SUBSECTION>
gsk_debug_node_new
gsk_debug_node_get_child
gsk_debug_node_get_message
<SUBSECTION>
gsk_gl_shader_node_new
gsk_gl_shader_node_get_n_children
gsk_gl_shader_node_get_child
gsk_gl_shader_node_get_args
gsk_gl_shader_node_get_shader
<SUBSECTION Standard>
GSK_IS_RENDER_NODE
GSK_RENDER_NODE
GSK_TYPE_RENDER_NODE
GSK_TYPE_BLEND_NODE
GSK_TYPE_BLUR_NODE
GSK_TYPE_BORDER_NODE
GSK_TYPE_CAIRO_NODE
GSK_TYPE_CLIP_NODE
GSK_TYPE_COLOR_MATRIX_NODE
GSK_TYPE_COLOR_NODE
GSK_TYPE_CONTAINER_NODE
GSK_TYPE_CONIC_GRADIENT_NODE
GSK_TYPE_CROSS_FADE_NODE
GSK_TYPE_DEBUG_NODE
GSK_TYPE_GL_SHADER_NODE
GSK_TYPE_INSET_SHADOW_NODE
GSK_TYPE_LINEAR_GRADIENT_NODE
GSK_TYPE_OPACITY_NODE
GSK_TYPE_OUTSET_SHADOW_NODE
GSK_TYPE_RADIAL_GRADIENT_NODE
GSK_TYPE_REPEATING_LINEAR_GRADIENT_NODE
GSK_TYPE_REPEATING_RADIAL_GRADIENT_NODE
GSK_TYPE_REPEAT_NODE
GSK_TYPE_ROUNDED_CLIP_NODE
GSK_TYPE_SHADOW_NODE
GSK_TYPE_TEXT_NODE
GSK_TYPE_TEXTURE_NODE
GSK_TYPE_TRANSFORM_NODE
GSK_TYPE_GLSHADER_NODE
GSK_TYPE_RENDER_NODE_TYPE
GskRenderNodeClass
gsk_blend_node_get_type
gsk_blur_node_get_type
gsk_border_node_get_type
gsk_broadway_renderer_get_type
gsk_cairo_node_get_type
gsk_cairo_renderer_get_type
gsk_clip_node_get_type
gsk_color_matrix_node_get_type
gsk_color_node_get_type
gsk_conic_gradient_node_get_type
gsk_container_node_get_type
gsk_cross_fade_node_get_type
gsk_debug_node_get_type
gsk_gl_shader_node_get_type
gsk_inset_shadow_node_get_type
gsk_linear_gradient_node_get_type
gsk_opacity_node_get_type
gsk_outset_shadow_node_get_type
gsk_radial_gradient_node_get_type
gsk_render_node_get_type
gsk_repeating_linear_gradient_node_get_type
gsk_repeating_radial_gradient_node_get_type
gsk_repeat_node_get_type
gsk_rounded_clip_node_get_type
gsk_shadow_node_get_type
gsk_text_node_get_type
gsk_texture_node_get_type
gsk_transform_node_get_type
GSK_TYPE_BLEND_MODE
<SUBSECTION Standard>
gsk_serialization_error_quark
GSK_SERIALIZATION_ERROR
GSK_TYPE_SERIALIZATION_ERROR
</SECTION>
<SECTION>
<FILE>GskRoundedRect</FILE>
GskCorner
GskRoundedRect
GSK_ROUNDED_RECT_INIT
gsk_rounded_rect_init
gsk_rounded_rect_init_copy
gsk_rounded_rect_init_from_rect
gsk_rounded_rect_normalize
gsk_rounded_rect_offset
gsk_rounded_rect_shrink
gsk_rounded_rect_is_rectilinear
gsk_rounded_rect_contains_point
gsk_rounded_rect_contains_rect
gsk_rounded_rect_intersects_rect
<SUBSECTION Standard>
GSK_TYPE_CORNER
</SECTION>
<SECTION>
<FILE>GskTransform</FILE>
GskTransform
gsk_transform_ref
gsk_transform_unref
<SUBSECTION>
GskTransformCategory
gsk_transform_get_category
<SUBSECTION>
gsk_transform_print
gsk_transform_to_string
gsk_transform_parse
<SUBSECTION>
gsk_transform_to_matrix
gsk_transform_to_2d
gsk_transform_to_affine
gsk_transform_to_translate
<SUBSECTION>
gsk_transform_transform
gsk_transform_invert
gsk_transform_matrix
gsk_transform_translate
gsk_transform_translate_3d
gsk_transform_rotate
gsk_transform_rotate_3d
gsk_transform_scale
gsk_transform_scale_3d
gsk_transform_perspective
<SUBSECTION>
gsk_transform_equal
<SUBSECTION>
gsk_transform_transform_bounds
gsk_transform_transform_point
<SUBSECTION Private>
GSK_TYPE_TRANSFORM
GSK_TYPE_TRANSFORM_CATEGORY
gsk_transform_get_type
gsk_transform_new
</SECTION>
<SECTION>
<FILE>GskGLShader</FILE>
GskGLShader
gsk_gl_shader_new_from_bytes
gsk_gl_shader_new_from_resource
gsk_gl_shader_compile
gsk_gl_shader_get_source
gsk_gl_shader_get_resource
gsk_gl_shader_get_n_textures
gsk_gl_shader_get_n_uniforms
gsk_gl_shader_get_uniform_name
gsk_gl_shader_find_uniform_by_name
GskGLUniformType
gsk_gl_shader_get_uniform_type
gsk_gl_shader_get_uniform_offset
gsk_gl_shader_get_args_size
<SUBSECTION Uniform Data>
gsk_gl_shader_get_arg_float
gsk_gl_shader_get_arg_int
gsk_gl_shader_get_arg_uint
gsk_gl_shader_get_arg_bool
gsk_gl_shader_get_arg_vec2
gsk_gl_shader_get_arg_vec3
gsk_gl_shader_get_arg_vec4
gsk_gl_shader_format_args_va
gsk_gl_shader_format_args
<SUBSECTION Shader Args Builder>
GskShaderArgsBuilder
gsk_shader_args_builder_new
gsk_shader_args_builder_to_args
gsk_shader_args_builder_free_to_args
gsk_shader_args_builder_unref
gsk_shader_args_builder_ref
gsk_shader_args_builder_set_float
gsk_shader_args_builder_set_int
gsk_shader_args_builder_set_uint
gsk_shader_args_builder_set_bool
gsk_shader_args_builder_set_vec2
gsk_shader_args_builder_set_vec3
gsk_shader_args_builder_set_vec4
<SUBSECTION Private>
GSK_TYPE_GL_SHADER
GSK_TYPE_GL_UNIFORM_TYPE
GSK_TYPE_SHADER_ARGS_BUILDER
gsk_shader_args_builder_get_type
</SECTION>

View File

@@ -0,0 +1,46 @@
[library]
version = "@version@"
browse_url = "https://gitlab.gnome.org/GNOME/gtk/"
repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0" ]
devhelp = true
search_index = true
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://developer.gnome.org/gobject/stable"
[dependencies."Graphene-1.0"]
name = "Graphene"
description = "A thin layer of mathematical types for 3D libraries"
docs_url = "https://ebassi.github.io/graphene/docs"
[dependencies."Pango-1.0"]
name = "Pango"
description = "Text shaping and rendering"
docs_url = "https://developer.gnome.org/pango/stable"
[dependencies."Gdk-4.0"]
name = "GDK"
description = "The GTK windowing system abstraction"
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4/"
[theme]
name = "basic"
show_index_summary = true
show_class_hierarchy = true
[source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra]
content_images = [
"gtk-logo.svg",
]
urlmap_file = "urlmap.js"

View File

@@ -1,3 +0,0 @@
gsk_render_node_get_type
gsk_renderer_get_type
gsk_gl_shader_get_type

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg6843"
sodipodi:version="0.32"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
version="1.0"
sodipodi:docname="gtk-logo.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/ebassi/Pictures/gtk-logo-256.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs6845">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-50 : 600 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="700 : 600 : 1"
inkscape:persp3d-origin="300 : 400 : 1"
id="perspective13" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="69.874353"
inkscape:cy="64.313526"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:document-units="px"
inkscape:grid-bbox="true"
width="128px"
height="128px"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid7947" />
</sodipodi:namedview>
<metadata
id="metadata6848">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:date />
<dc:creator>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:rights>
<dc:publisher>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:publisher>
<dc:identifier />
<dc:source />
<dc:relation />
<dc:language />
<dc:subject>
<rdf:Bag />
</dc:subject>
<dc:coverage />
<dc:description />
<dc:contributor>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:contributor>
<cc:license
rdf:resource="" />
</cc:Work>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccccc"
id="path6976"
d="M 20.88413,30.82696 L 53.816977,55.527708 L 107.33282,39.060543 L 70.587303,17.177763 L 20.88413,30.82696 z"
style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6978"
d="M 22.94243,82.287118 L 20.88413,30.82696 L 53.816977,55.527708 L 53.816977,111.10486 L 22.94243,82.287118 z"
style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6980"
d="M 53.816977,111.10486 L 103.21619,90.5207 L 107.33282,39.060543 L 53.816977,55.527708 L 53.816977,111.10486 z"
style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
sodipodi:nodetypes="ccc"
id="path6982"
d="M 23.216626,81.319479 L 70.48573,67.361442 L 103.38422,90.444516"
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path6984"
d="M 70.434539,17.875593 L 70.434539,66.984877"
style="opacity:1;fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -1,91 +1,24 @@
private_headers = [
'gsk-autocleanup.h',
'gskcairoblurprivate.h',
'gskcairorendererprivate.h',
'gskdebugprivate.h',
'gskdiffprivate.h',
'gskglshaderprivate.h',
'gskprivate.h',
'gskprofilerprivate.h',
'gskrendererprivate.h',
'gskrendernodeprivate.h',
'gskrendernodeparserprivate.h',
'gskroundedrectprivate.h',
'gsktransformprivate.h',
# gsk/gl
'glutilsprivate.h',
'gskgldriverprivate.h',
'gskglglyphcacheprivate.h',
'gskgliconcacheprivate.h',
'gskglimageprivate.h',
'gskglnodesampleprivate.h',
'gskglprofilerprivate.h',
'gskglrendererprivate.h',
'gskglrenderopsprivate.h',
'gskglshaderbuilderprivate.h',
'gskglshadowcacheprivate.h',
'gskgltextureatlasprivate.h',
'opbuffer.h',
'stb_rect_pack.h',
# gsk/vulkan
'gskvulkanblendmodepipelineprivate.h',
'gskvulkanblurpipelineprivate.h',
'gskvulkanborderpipelineprivate.h',
'gskvulkanboxshadowpipelineprivate.h',
'gskvulkanbufferprivate.h',
'gskvulkanclipprivate.h',
'gskvulkancolorpipelineprivate.h',
'gskvulkancolortextpipelineprivate.h',
'gskvulkancommandpoolprivate.h',
'gskvulkancrossfadepipelineprivate.h',
'gskvulkaneffectpipelineprivate.h',
'gskvulkanglyphcacheprivate.h',
'gskvulkanimageprivate.h',
'gskvulkanlineargradientpipelineprivate.h',
'gskvulkanmemoryprivate.h',
'gskvulkanpipelineprivate.h',
'gskvulkanpushconstantsprivate.h',
'gskvulkanrendererprivate.h',
'gskvulkanrenderpassprivate.h',
'gskvulkanrenderprivate.h',
'gskvulkanshaderprivate.h',
'gskvulkantextpipelineprivate.h',
'gskvulkantexturepipelineprivate.h',
]
images = [
]
gsk4_toml = configure_file(input: 'gsk4.toml.in', output: 'gsk4.toml', configuration: toml_conf)
if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
gnome.gtkdoc('gsk4',
mode: 'none',
main_xml: 'gsk4-docs.xml',
src_dir: [
gskinc,
custom_target('gsk4-doc',
input: [ gsk4_toml, gsk_gir[0] ],
output: 'gsk4',
command: [
gidocgen,
'generate',
'--quiet',
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=../gdk',
],
html_assets: images,
depends: [ gdk_gir[0] ],
depend_files: [ expand_content_md_files ],
build_by_default: true,
install: true,
install_dir: docs_dir,
)
endif

View File

@@ -0,0 +1,13 @@
// SPDX-FileCopyrightText: 2021 GNOME Foundation
// SPDX-License-Identifier: LGPL-2.1-or-later
// A map between namespaces and base URLs for their online documentation
baseURLs = [
[ 'Gdk', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4/' ],
[ 'GdkWayland', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/' ],
[ 'GdkX11', 'https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/' ],
[ 'Gsk', 'https://gnome.pages.gitlab.gnome.org/gtk/gsk4/' ],
[ 'Gtk', 'https://gnome.pages.gitlab.gnome.org/gtk/gtk4/' ],
[ 'Pango', 'https://gnome.pages/gitlab.gnome.org/pango/pango/' ],
[ 'PangoCairo', 'https://gnome.pages.gitlab.gnome.org/pango/pangocairo/' ],
]

View File

@@ -1 +0,0 @@
@GTK_VERSION@

View File

@@ -1,13 +1,14 @@
# Overview of actions in GTK {#actions-overview}
Title: Overview of actions in GTK
Slug: actions
This chapter describes in detail how GTK uses actions to connect
activatable UI elements to callbacks. GTK inherits the underlying
architecture of GAction and GMe:u for describing abstract actions
architecture of `GAction` and `GMenu` for describing abstract actions
and menus from the GIO library.
## Basics about actions
A GAction is essentially a way to tell the toolkit about a piece of
A `GAction` is essentially a way to tell the toolkit about a piece of
functionality in your program, and to give it a name.
Actions are purely functional. They do not contain any presentational
@@ -76,7 +77,7 @@ state type, and activating them with a particular parameter value is
equivalent to changing their state to that value.
This approach to handling radio buttons is different than many other
action systems such as GtkAction. With GAction, there is only one action
action systems such as `GtkAction`. With `GAction`, there is only one action
for "text-justify" and "left", "center" and "right" are possible states on
that action. There are not three separate "justify-left", "justify-center"
and "justify-right" actions.
@@ -96,7 +97,7 @@ Even though toggle actions have a state, they do not have a parameter.
Therefore, a target value is not needed when referring to them — they
will always be toggled on activation.
Most APIs that allow using a GAction (such as GMenuModel and GtkActionable)
Most APIs that allow using a `GAction` (such as `GMenuModel` and `GtkActionable`)
allow use of detailed action names. This is a convenient way of specifying
an action name and an action target with a single string.
@@ -140,7 +141,7 @@ separate state for each instance of the action as well as being able to
control the enabled state of the action on a per-window basis.
Actions are added to their relevant scope (application, window or widget)
either using the GActionMap interface, or by using
either using the `GActionMap` interface, or by using
gtk_widget_insert_action_group(). Actions that will be the same for all
instances of a widget class can be added globally using
gtk_widget_class_install_action().
@@ -149,7 +150,7 @@ gtk_widget_class_install_action().
Actions rarely occurs in isolation. It is common to have groups
of related actions, which are represented by instances of the
GActionGroup interface.
`GActionGroup` interface.
Action maps are a variant of action groups that allow to change
the name of the action as it is looked up. In GTK, the convention
@@ -160,46 +161,46 @@ or "win." for those with window scope.
When referring to actions on a GActionMap only the name of the
action itself is used (ie: "quit", not "app.quit"). The
"app.quit" form is only used when referring to actions from
places like a GMenu or GtkActionable widget where the scope
places like a `GMenu` or `GtkActionable` widget where the scope
of the action is not already known.
GtkApplication and GtkApplicationWindow implement the GActionMap
`GtkApplication` and `GtkApplicationWindow` implement the `GActionMap`
interface, so you can just add actions directly to them. For
other widgets, use gtk_widget_insert_action_group() to add
actions to it.
If you want to insert several actions at the same time, it is
typically faster and easier to use GActionEntry.
typically faster and easier to use `GActionEntry`.
## Connecting actions to widgets
Any widget that implements the GtkActionable interface can
Any widget that implements the `GtkActionable` interface can
be connected to an action just by setting the ::action-name
property. If the action has a parameter, you will also need
to set the ::action-target property.
Widgets that implement GtkActionable include GtkSwitch, GtkButton,
and their respective subclasses.
to set the ::action-target property. Widgets that implement
`GtkActionable` include `GtkSwitch`, `GtkButton`, and their
respective subclasses.
Another way of obtaining widgets that are connected to actions
is to create a menu using a GMenu menu model. GMenu provides an
is to create a menu using a `GMenu` menu model. `GMenu` provides an
abstract way to describe typical menus: nested groups of items
where each item can have a label, and icon, and an action.
A typical use of GMenu inside GTK is to set up an application
A typical use of `GMenu` inside GTK is to set up an application
menubar with gtk_application_set_menubar(). Another, maybe more
common use is to create a popover for a menubutton, using
gtk_menu_button_set_menu_model().
Unlike traditional menus, those created from menu models don't
have keyboard accelerators associated with menu items. Instead,
GtkApplication offers the gtk_application_set_accels_for_action()
`GtkApplication` offers the gtk_application_set_accels_for_action()
API to associate keyboard shortcuts with actions.
## Activation
When a widget with a connected action is activated, GTK finds
the action to activate by walking up the widget hierarchy,
looking for a matching action, ending up at the GtkApplication.
looking for a matching action, ending up at the `GtkApplication`.
## Built-in Actions
@@ -209,13 +210,16 @@ you should avoid naming conflicts with them when creating your
own actions.
default.activate
: Activates the default widget in a context (typically a GtkWindow,
GtkDialog or GtkPopover)
: Activates the default widget in a context (typically a `GtkWindow`,
`GtkDialog` or `GtkPopover`)
clipboard.cut, clipboard.copy, clipboard.paste
: Clipboard operations on entries, text view and labels, typically
used in the context menu
: Clipboard operations on entries, text view and labels, typically
used in the context menu
selection.delete, selection.select-all
: Selection operations on entries, text view and labels
: Selection operations on entries, text view and labels
color.select, color.customize:
: Operate on colors in a #GtkColorChooserWidget. These actions are
unusual in that they have the non-trivial parameter type (dddd):
: Operate on colors in a `GtkColorChooserWidget`. These actions are
unusual in that they have the non-trivial parameter type (dddd):

View File

@@ -1,4 +1,7 @@
# Using GTK with Broadway {#gtk-broadway}
Title: The Broadway windowing system
Slug: broadway
## Using GTK with Broadway
The GDK Broadway backend provides support for displaying GTK
applications in a web browser, using HTML5 and web sockets. To run
@@ -26,9 +29,9 @@ Start your applications like this:
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo
```
## Broadway-specific environment variables {#broadway-envar}
## Broadway-specific environment variables
### BROADWAY_DISPLAY
### BROADWAY\_DISPLAY
Specifies the Broadway display number. The default display is 0.
The display number determines the port to use when connecting

View File

@@ -1,4 +1,5 @@
# Compiling the GTK Libraries {#gtk-building}
Title: Compiling the GTK Libraries
Slug: gtk-building
## Building GTK
@@ -75,7 +76,7 @@ PATH="/opt/gtk/bin:$PATH"
export LD_LIBRARY_PATH PATH
```
## Build types {#build-types}
## Build types
Meson has different build types, exposed by the `buildtype`
configuration option. GTK enables and disables functionality
@@ -111,7 +112,7 @@ linker flags. Note that with the plain build type, you are also
responsible for controlling the debugging features of GTK with
`-DG_ENABLE_DEBUG` and `-DG_DISABLE_CAST_CHECKS`.
## Dependencies {#dependencies}
## Dependencies
Before you can compile the GTK widget toolkit, you need to have
various other tools and libraries installed on your
@@ -179,7 +180,7 @@ Other libraries are maintained separately.
`XDG_DATA_DIRS` set accordingly at configure time. Otherwise,
gdk-pixbuf falls back to its built-in mime type detection.
## Building and testing GTK {#building}
## Building and testing GTK
First make sure that you have the necessary external
dependencies installed: `pkg-config`, Meson, Ninja,
@@ -207,7 +208,7 @@ log that can help you understand the issue you're encountering. If
all else fails, you can ask for help on the
[GTK forums](#gtk-resources).
## Extra Configuration Options {#extra-configuration-options}
## Extra Configuration Options
In addition to the normal options provided by Meson, GTK defines various
arguments that modify what should be built. All of these options are passed

View File

@@ -1,4 +1,5 @@
# Compiling GTK Applications on UNIX {#gtk-compiling}
Title: Compiling GTK Applications on UNIX
Slug: gtk-compiling
To compile a GTK application, you need to tell the compiler where to
find the GTK header files and libraries. This is done with the

View File

@@ -1,4 +1,5 @@
# CSS in GTK {#css}
Title: CSS in GTK
Slug: css
This chapter describes how GTK uses CSS for styling and layout.
It is not meant to be an explanation of CSS from first principles,

View File

@@ -1,4 +1,5 @@
# GTK CSS Properties
Title: GTK CSS Properties
Slug: css-properties
GTK supports CSS properties and shorthands as far as they can be applied
in the context of widgets, and adds its own properties only when needed.
@@ -14,13 +15,16 @@ spec.
The following units are supported for basic datatypes:
Length
: px, pt, em, ex, rem, pc, in, cm, mm, calc()
: px, pt, em, ex, rem, pc, in, cm, mm, calc()
Percentage
: %, calc()
: %, calc()
Angle
: deg | grad | turn, calc()
: deg, grad, turn, calc()
Time
: s | ms, calc()
: s, ms, calc()
Length values with the em or ex units are resolved using the font
size value, unless they occur in setting the font-size itself, in
@@ -32,7 +36,7 @@ not quite the same as the CSS definition of rem.
The calc() notation adds considerable expressive power. There are limits
on what types can be combined in such an expression (e.g. it does not make
sense to add a number and a time). For the full details, see the
[CSS3 VAlues and Units](https://www.w3.org/TR/css3-values/#calc-notation)
[CSS3 Values and Units](https://www.w3.org/TR/css3-values/#calc-notation)
spec.
A common pattern among shorthand properties (called 'four sides') is one
@@ -41,13 +45,16 @@ side of an area. In this case, the specified values are interpreted as
follows:
4 values:
: top right bottom left
: top right bottom left
3 values:
: top horizontal bottom
: top horizontal bottom
2 values:
: vertical horizontal
: vertical horizontal
1 value:
: all
: all
## Colors
@@ -151,7 +158,7 @@ done with
|caret-color|[CSS Basic User Interface Level 3](https://www.w3.org/TR/css3-ui/#caret-color) | CSS allows an auto value |
|-gtk-secondary-caret-color|[Color](https://www.w3.org/TR/css-color-3/#valuea-def-color) | used for the secondary caret in bidirectional text |
|letter-spacing| [CSS Text Level 3](https://www.w3.org/TR/css3-text/#letter-spacing) | |
|text-decoration-line| [CSS Text Decoration Level 3](https://www.w3.org/TR/css-text-decor-3/#text-decoration-line-property) | CSS allows overline |
|text-decoration-line| [CSS Text Decoration Level 3](https://www.w3.org/TR/css-text-decor-3/#text-decoration-line-property) | |
|text-decoration-color| [CSS Text Decoration Level 3](https://www.w3.org/TR/css-text-decor-3/#text-decoration-color-property) | |
|text-decoration-style| [CSS Text Decoration Level 3](https://www.w3.org/TR/css-text-decor-3/#text-decoration-style-property) | CSS allows dashed and dotted |
|text-shadow| [CSS Text Decoration Level 3](https://www.w3.org/TR/css-text-decor-3/#text-shadow-property) | |
@@ -159,11 +166,12 @@ done with
|-gtk-icon-source| [Image](https://www.w3.org/TR/css-backgrounds-3/#typedef-image), `builtin` or `none` | used for builtin icons in buttons and expanders |
|-gtk-icon-size| [Length](https://www.w3.org/TR/css3-values/#length-value) | size used for builtin icons in buttons and expanders |
|-gtk-icon-style| `requested`, `regular` or `symbolic` | preferred style for application-loaded icons |
|-gtk-icon-transform| [Transform list](https://drafts.csswg.org/css-transforms-1/#typedef-transform-list) or `none` | applied to builtin and application-loaded icons |
|-gtk-icon-transform| [Transform list](https://www.w3.org/TR/css-transforms-1/#typedef-transform-list) or `none` | applied to builtin and application-loaded icons |
|-gtk-icon-palette| Color palette, as explained above | used to recolor symbolic icons |
|-gtk-icon-shadow| [Shadow](https://www.w3.org/TR/css-backgrounds-3/#typedef-shadow) or `none` | applied to builtin and application-loaded icons |
|-gtk-icon-filter| [Filter value list](https://www.w3.org/TR/filter-effects-1/#typedef-filter-value-list) or `none` | applied to builtin and application-loaded icons |
|transform| [CSS Transforms Level 2](https://drafts.csswg.org/css-transforms-2/) | |
|transform| [CSS Transforms Level 1](https://www.w3.org/TR/css-transforms-1/#transform-property) | |
|transform-origin| [CSS Transforms Level 1](https://www.w3.org/TR/css-transforms-1/#transform-origin-property) | CSS allows specifying a z component|
|min-width| [CSS Box Model Level 3](https://www.w3.org/TR/css3-box/#min-width) | CSS allows percentages |
|min-height| [CSS Box Model Level 3](https://www.w3.org/TR/css3-box/#min-height) | CSS allows percentages |
|margin-top| [CSS Box Model Level 3](https://www.w3.org/TR/css3-box/#margin-top) | CSS allows percentages or auto |
@@ -217,7 +225,7 @@ done with
|background-size| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-size) | |
|background-position| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-position) | |
|background-repeat| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-repeat) | |
|background-image| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-image) | not supported: urls without quotes, colors in crossfades |
|background-image| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-image) | not supported: urls without quotes |
|box-shadow| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#box-shadow) | |
|background-blend-mode| [CSS Compositing and Blending Level 1](https://www.w3.org/TR/compositing-1/#propdef-background-blend-mode) | only affects multiple backgrounds |
|background| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background) | |
@@ -235,4 +243,4 @@ done with
|animation-delay| [CSS Animations Level 1](https://www.w3.org/TR/css3-animations/#animation-delay) | |
|animation-fill-mode| [CSS Animations Level 1](https://www.w3.org/TR/css3-animations/#animation-fill-mode) | |
|animation| [CSS Animations Level 1](https://www.w3.org/TR/css3-animations/#animation) | |
|border-spacing| [CSS Table Level 3](https://www.w3.org/TR/css-tables-3/#border-spacing-property) | respected by GtkBox and GtkGrid |
|border-spacing| [CSS Table Level 3](https://www.w3.org/TR/css-tables-3/#border-spacing-property) | respected by GtkBoxLayout, GtkGridLayout, GtkCenterLayout |

View File

@@ -1,13 +1,14 @@
# Overview of the drawing model {#drawing-overview}
Title: Overview of the drawing model
Slug: drawing-overview
This chapter describes the GTK drawing model in detail. If you
This chapter describes the GTK drawing model in detail. If you
are interested in the procedure which GTK follows to draw its
widgets and windows, you should read this chapter; this will be
useful to know if you decide to implement your own widgets. This
useful to know if you decide to implement your own widgets. This
chapter will also clarify the reasons behind the ways certain
things are done in GTK.
## Windows and events {#drawing-windows}
## Windows and events
Applications that use a windowing system generally create
rectangular regions in the screen called _surfaces_ (GTK is
@@ -27,14 +28,14 @@ windowing system surface. Child widgets such as buttons or
entries don't have their own surface; they use the surface
of their toplevel.
Generally, the drawing cycle begins when GTK receives
a frame event from the underlying windowing system: if the
user drags a window over another one, the windowing system will
tell the underlying surface that it needs to repaint itself. The
drawing cycle can also be initiated when a widget itself decides
that it needs to update its display. For example, when the user
types a character in an entry widget, the entry asks GTK to queue
a redraw operation for itself.
Generally, the drawing cycle begins when GTK receives a frame event
from the underlying windowing system: if the user drags a window
over another one, the windowing system will tell the underlying
surface that it needs to repaint itself. The drawing cycle can
also be initiated when a widget itself decides that it needs to
update its display. For example, when the user types a character
in an entry widget, the entry asks GTK to queue a redraw operation
for itself.
The windowing system generates frame events for surfaces. The GDK
interface to the windowing system translates such events into
@@ -46,7 +47,7 @@ need to be repainted in response to such events, and how widgets
work internally in terms of the resources they use from the
windowing system.
## The frame clock {#frameclock}
## The frame clock
All GTK applications are mainloop-driven, which means that most
of the time the app is idle inside a loop that just waits for
@@ -112,7 +113,7 @@ happen at higher levels:
There are also a lot of implicit triggers of these from the
CSS layer (which does animations, resizes and repaints as needed).
## The scene graph {#scene-graph}
## The scene graph
The first step in “drawing” a window is that GTK creates
_render nodes_ for all the widgets in the window. The render
@@ -133,15 +134,15 @@ rendering commands for the drawing API it targets, and arranges
for the resulting drawing to be associated with the right surface.
GSK has renderers for OpenGL, Vulkan and cairo.
## Hierarchical drawing {#hierarchical-drawing}
## Hierarchical drawing
During the Paint phase GTK receives a single #GdkSurface::render
signal on the toplevel surface. The signal handler will create a
snapshot object (which is a helper for creating a scene graph) and
call the #GtkWidget::snapshot() vfunc, which will propagate down
the widget hierarchy. This lets each widget snapshot its content
at the right place and time, correctly handling things like partial
transparencies and overlapping widgets.
During the Paint phase GTK receives a single ::render signal on the
toplevel surface. The signal handler will create a snapshot object
(which is a helper for creating a scene graph) and call the
GtkWidget snapshot() vfunc, which will propagate down the widget
hierarchy. This lets each widget snapshot its content at the right
place and time, correctly handling things like partial transparencies
and overlapping widgets.
During the snapshotting of each widget, GTK automatically handles
the CSS rendering according to the CSS box model. It snapshots first

View File

@@ -1,4 +1,5 @@
# Getting Started with GTK {#gtk-getting-started}
Title: Getting Started with GTK
Slug: gtk-getting-started
GTK is a [widget toolkit](http://en.wikipedia.org/wiki/Widget_toolkit).
Each user interface created by GTK consists of widgets. This is implemented
@@ -29,7 +30,7 @@ window.
Create a new file with the following content named `example-0.c`.
``` {.c source=examples/window-default.c }
```c
#include <gtk/gtk.h>
static void
@@ -63,7 +64,7 @@ main (int argc,
You can compile the program above with GCC using:
```
gcc `pkg-config --cflags gtk4` -o example-0 example-0.c `pkg-config --libs gtk4`
gcc $( pkg-config --cflags gtk4 ) -o example-0 example-0.c $( pkg-config --libs gtk4 )
```
For more information on how to compile a GTK application, please
@@ -77,49 +78,51 @@ Even if GTK installs multiple header files, only the top-level `gtk/gtk.h`
header can be directly included by third-party code. The compiler will abort
with an error if any other header is directly included.
In a GTK application, the purpose of the main() function is to create a
GtkApplication object and run it. In this example a GtkApplication pointer
named `app` is declared and then initialized using gtk_application_new().
In a GTK application, the purpose of the `main()` function is to create a
[class@Gtk.Application] object and run it. In this example a
[class@Gtk.Application] pointer named `app` is declared and then initialized
using `gtk_application_new()`.
When creating a GtkApplication, you need to pick an application identifier
(a name) and pass it to gtk_application_new() as parameter. For this example
`org.gtk.example` is used. For choosing an identifier for your application, see
[this guide](https://wiki.gnome.org/HowDoI/ChooseApplicationID). Lastly,
gtk_application_new() takes GApplicationFlags as input for your application,
if your application would have special needs.
When creating a [class@Gtk.Application], you need to pick an application
identifier (a name) and pass it to [ctor@Gtk.Application.new] as parameter. For
this example `org.gtk.example` is used. For choosing an identifier for your
application, see [this guide](https://wiki.gnome.org/HowDoI/ChooseApplicationID).
Lastly, [ctor@Gtk.Application.new] takes `GApplicationFlags` as input
for your application, if your application would have special needs.
Next the [activate signal](https://wiki.gnome.org/HowDoI/GtkApplication) is
connected to the activate() function above the main() function. The `activate`
signal will be emitted when your application is launched with g_application_run()
on the line below. The g_application_run() call also takes as arguments the
connected to the activate() function above the `main()` function. The `activate`
signal will be emitted when your application is launched with `g_application_run()`
on the line below. The `g_application_run()` call also takes as arguments the
command line arguments (the `argc` count and the `argv` string array).
Your application can override the command line handling, e.g. to open
files passed on the commandline.
Within g_application_run() the activate signal is sent and we then proceed
Within `g_application_run()` the activate signal is sent and we then proceed
into the activate() function of the application. This is where we construct
our GTK window, so that a window is shown when the application is launched.
The call to gtk_application_window_new() will create a new GtkWindow and
store it inside the `window` pointer. The window will have a frame, a title
bar, and window controls depending on the platform.
The call to [ctor@Gtk.ApplicationWindow.new] will create a new
[class@Gtk.ApplicationWindow] and store it inside the `window` pointer. The
window will have a frame, a title bar, and window controls depending on the
platform.
A window title is set using gtk_window_set_title(). This function takes a
GtkWindow* pointer and a string as input. As our `window` pointer is a
GtkWidget pointer, we need to cast it to GtkWindow*. But instead of casting
`window` via `(GtkWindow*)`, `window` can be cast using the macro
`GTK_WINDOW()`. `GTK_WINDOW()` will check if the pointer is an instance of
the GtkWindow class, before casting, and emit a warning if the check fails.
More information about this convention can be found
[here](https://developer.gnome.org/gobject/stable/gtype-conventions.html).
A window title is set using [`method@Gtk.Window.set_title`]. This function
takes a `GtkWindow` pointer and a string as input. As our `window` pointer
is a `GtkWidget` pointer, we need to cast it to `GtkWindow`; instead of
casting `window` via a typical C cast like `(GtkWindow*)`, `window` can be
cast using the macro `GTK_WINDOW()`. `GTK_WINDOW()` will check if the
pointer is an instance of the `GtkWindow` class, before casting, and emit a
warning if the check fails. More information about this convention can be
found [here](https://developer.gnome.org/gobject/stable/gtype-conventions.html).
Finally the window size is set using gtk_window_set_default_size()
and the window is then shown by GTK via gtk_widget_show().
Finally the window size is set using [`method@Gtk.Window.set_default_size`]
and the window is then shown by GTK via [method@Gtk.Widget.show].
When you close the window, by for example pressing the X, the g_application_run()
call returns with a number which is saved inside an integer variable named
`status`. Afterwards, the GtkApplication object is freed from memory with
g_object_unref(). Finally the status integer is returned and the application
exits.
When you close the window, by (for example) pressing the X button, the
`g_application_run()` call returns with a number which is saved inside an
integer variable named `status`. Afterwards, the `GtkApplication` object is
freed from memory with `g_object_unref()`. Finally the status integer is
returned and the application exits.
While the program is running, GTK is receiving _events_. These are typically
input events caused by the user interacting with your program, but also things
@@ -138,11 +141,11 @@ this example is called *Hello, World*.
![Hello, world](hello-world.png)
### Hello World in C {#gtk-getting-started-hello-world}
### Hello World in C
Create a new file with the following content named `example-1.c`.
``` {.c source=examples/hello-world.c }
```c
#include <gtk/gtk.h>
static void
@@ -195,43 +198,44 @@ main (int argc,
You can compile the program above with GCC using:
```
gcc `pkg-config --cflags gtk4` -o example-1 example-1.c `pkg-config --libs gtk4`
gcc $( pkg-config --cflags gtk4 ) -o example-1 example-1.c $( pkg-config --libs gtk4 )
```
As seen above, example-1.c builds further upon example-0.c by adding a
button to our window, with the label "Hello World". Two new GtkWidget
As seen above, `example-1.c` builds further upon `example-0.c` by adding a
button to our window, with the label "Hello World". Two new `GtkWidget`
pointers are declared to accomplish this, `button` and `box`. The box
variable is created to store a GtkBox, which is GTK's way of controlling
the size and layout of buttons.
variable is created to store a [class@Gtk.Box], which is GTK's way of
controlling the size and layout of buttons.
The GtkBox is created with gtk_box_new() which takes a GtkOrientation
enum as parameter. The buttons which this box will contain can either be laid
out horizontally or vertically. This does not matter in this particular case,
as we are dealing with only one button. After initializing box with the newly
created GtkBox, the code adds the box widget to the window widget using
gtk_window_set_child().
The `GtkBox` widget is created with [ctor@Gtk.Box.new], which takes a
[enum@Gtk.Orientation] enumeration value as parameter. The buttons which
this box will contain can either be laid out horizontally or vertically.
This does not matter in this particular case, as we are dealing with only
one button. After initializing box with the newly created `GtkBox`, the code
adds the box widget to the window widget using [`method@Gtk.Window.set_child`].
Next the `button` variable is initialized in similar manner.
gtk_button_new_with_label() is called which returns a GtkButton to be
stored in `button`. Afterwards `button` is added to our `box`.
[`ctor@Gtk.Button.new_with_label`] is called which returns a
[class@Gtk.Button] to be stored in `button`. Afterwards `button` is added to
our `box`.
Using g_signal_connect(), the button is connected to a function in our app called
print_hello(), so that when the button is clicked, GTK will call this function.
As the print_hello() function does not use any data as input, NULL is passed
to it. print_hello() calls g_print() with the string "Hello World" which will
Using `g_signal_connect()`, the button is connected to a function in our app called
`print_hello()`, so that when the button is clicked, GTK will call this function.
As the `print_hello()` function does not use any data as input, `NULL` is passed
to it. `print_hello()` calls `g_print()` with the string "Hello World" which will
print Hello World in a terminal if the GTK application was started from one.
After connecting print_hello(), another signal is connected to the "clicked"
state of the button using g_signal_connect_swapped(). This functions is similar
to a g_signal_connect() with the difference lying in how the callback function
is treated. g_signal_connect_swapped() allows you to specify what the callback
After connecting `print_hello()`, another signal is connected to the "clicked"
state of the button using `g_signal_connect_swapped()`. This functions is similar
to a `g_signal_connect()`, with the difference lying in how the callback function
is treated; `g_signal_connect_swapped()` allows you to specify what the callback
function should take as parameter by letting you pass it as data. In this case
the function being called back is gtk_window_destroy() and the `window` pointer
the function being called back is [method@Gtk.Window.destroy] and the `window` pointer
is passed to it. This has the effect that when the button is clicked, the whole
GTK window is destroyed. In contrast if a normal g_signal_connect() were used
to connect the "clicked" signal with gtk_window_destroy(), then the function
GTK window is destroyed. In contrast if a normal `g_signal_connect()` were used
to connect the "clicked" signal with [method@Gtk.Window.destroy], then the function
would be called on `button` (which would not go well, since the function expects
a GtkWindow as argument).
a `GtkWindow` as argument).
More information about creating buttons can be found
[here](https://wiki.gnome.org/HowDoI/Buttons).
@@ -255,11 +259,11 @@ arrange several buttons:
![Grid packing](grid-packing.png)
### Packing buttons {#gtk-getting-started-grid-packing}
### Packing buttons
Create a new file with the following content named `example-2.c`.
``` {.c source=examples/grid-packing.c }
```c
#include <gtk/gtk.h>
static void
@@ -334,7 +338,7 @@ main (int argc,
You can compile the program above with GCC using:
```
gcc `pkg-config --cflags gtk4` -o example-2 example-2.c `pkg-config --libs gtk4`
gcc $( pkg-config --cflags gtk4 ) -o example-2 example-2.c $( pkg-config --libs gtk4 )
```
## Custom Drawing
@@ -342,29 +346,28 @@ gcc `pkg-config --cflags gtk4` -o example-2 example-2.c `pkg-config --libs gtk4`
Many widgets, like buttons, do all their drawing themselves. You just tell
them the label you want to see, and they figure out what font to use, draw
the button outline and focus rectangle, etc. Sometimes, it is necessary to
do some custom drawing. In that case, a GtkDrawingArea might be the right
widget to use. It offers a canvas on which you can draw by connecting to
the ::draw signal.
do some custom drawing. In that case, a [class@Gtk.DrawingArea] might be the right
widget to use. It offers a canvas on which you can draw by setting its
draw function.
The contents of a widget often need to be partially or fully redrawn,
e.g. when another window is moved and uncovers part of the widget, or
when the window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
handler.
The contents of a widget often need to be partially or fully redrawn, e.g.
when another window is moved and uncovers part of the widget, or when the
window containing it is resized. It is also possible to explicitly cause a
widget to be redrawn, by calling [`method@Gtk.Widget.queue_draw`]. GTK takes
care of most of the details by providing a ready-to-use cairo context to the
draw function.
The following example shows a ::draw signal handler. It is a bit more
complicated than the previous examples, since it also demonstrates
input event handling by means of event controllers.
The following example shows how to use a draw function with GtkDrawingArea.
It is a bit more complicated than the previous examples, since it also
demonstrates input event handling with event controllers.
![Drawing](drawing.png)
### Drawing in response to input {#gtk-getting-started-drawing}
### Drawing in response to input
Create a new file with the following content named `example-4.c`.
``` {.c source=examples/drawing.c }
```c
#include <gtk/gtk.h>
/* Surface to store current scribbles */
@@ -557,7 +560,7 @@ main (int argc,
You can compile the program above with GCC using:
```
gcc `pkg-config --cflags gtk4` -o example-4 example-4.c `pkg-config --libs gtk4`
gcc $( pkg-config --cflags gtk4 ) -o example-4 example-4.c $( pkg-config --libs gtk4 )
```
## Building user interfaces
@@ -568,13 +571,13 @@ cumbersome, and making changes becomes next to impossible.
Thankfully, GTK supports the separation of user interface
layout from your business logic, by using UI descriptions in an
XML format that can be parsed by the GtkBuilder class.</para>
XML format that can be parsed by the [class@Gtk.Builder] class.
### Packing buttons with GtkBuilder
Create a new file with the following content named `example-3.c`.
``` {.c source=examples/builder.c }
```c
#include <gtk/gtk.h>
#include <glib/gstdio.h>
@@ -638,7 +641,7 @@ main (int argc,
Create a new file with the following content named `builder.ui`.
``` {.xml source=examples/builder.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object id="window" class="GtkWindow">
@@ -682,24 +685,24 @@ Create a new file with the following content named `builder.ui`.
You can compile the program above with GCC using:
```
gcc `pkg-config --cflags gtk4` -o example-3 example-3.c `pkg-config --libs gtk4`
gcc $( pkg-config --cflags gtk4 ) -o example-3 example-3.c $( pkg-config --libs gtk4 )
```
Note that GtkBuilder can also be used to construct objects that are
Note that `GtkBuilder` can also be used to construct objects that are
not widgets, such as tree models, adjustments, etc. That is the reason
the method we use here is called gtk_builder_get_object() and returns
a GObject* instead of a GtkWidget*.
the method we use here is called [`method@Gtk.Builder.get_object`] and returns
a `GObject` instead of a `GtkWidget`.
Normally, you would pass a full path to gtk_builder_add_from_file() to
Normally, you would pass a full path to [`method@Gtk.Builder.add_from_file`] to
make the execution of your program independent of the current directory.
A common location to install UI descriptions and similar data is
`/usr/share/appname`.
It is also possible to embed the UI description in the source code as a
string and use gtk_builder_add_from_string() to load it. But keeping the
string and use [`method@Gtk.Builder.add_from_string`] to load it. But keeping the
UI description in a separate file has several advantages: It is then possible
to make minor adjustments to the UI without recompiling your program, and,
more importantly, graphical UI editors such as [glade](http://glade.gnome.org)
more importantly, graphical UI editors such as [Glade](http://glade.gnome.org)
can load the file and allow you to create and modify your UI by point-and-click.
## Building applications
@@ -708,41 +711,45 @@ An application consists of a number of files:
The binary
: This gets installed in `/usr/bin`.
A desktop file
: The desktop file provides important information about the application to
the desktop shell, such as its name, icon, D-Bus name, commandline to launch
it, etc. It is installed in `/usr/share/applications`.
An icon
: The icon gets installed in `/usr/share/icons/hicolor/48x48/apps`, where it
will be found regardless of the current theme.
will be found regardless of the current theme.
A settings schema
: If the application uses GSettings, it will install its schema in
`/usr/share/glib-2.0/schemas`, so that tools like dconf-editor can find it.
`/usr/share/glib-2.0/schemas`, so that tools like dconf-editor can find it.
Other resources
: Other files, such as GtkBuilder ui files, are best loaded from
resources stored in the application binary itself. This eliminates the
need for most of the files that would traditionally be installed in
an application-specific location in `/usr/share`.
GTK includes application support that is built on top of GApplication. In this
GTK includes application support that is built on top of `GApplication`. In this
tutorial we'll build a simple application by starting from scratch, adding more
and more pieces over time. Along the way, we'll learn about GtkApplication,
templates, resources, application menus, settings, GtkHeaderBar, GtkStack,
GtkSearchBar, GtkListBox, and more.
and more pieces over time. Along the way, we'll learn about [class@Gtk.Application],
templates, resources, application menus, settings, [class@Gtk.HeaderBar], [class@Gtk.Stack],
[class@Gtk.SearchBar], [class@Gtk.ListBox], and more.
The full, buildable sources for these examples can be found in the `examples/`
directory of the GTK source distribution, or
[online](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples) in the GTK git
repository. You can build each example separately by using make with the
`Makefile.example` file. For more information, see the `README` included in the
examples directory.
The full, buildable sources for these examples can be found in the
`examples` directory of the GTK source distribution, or
[online](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples) in the GTK
source code repository. You can build each example separately by using make
with the `Makefile.example` file. For more information, see the `README`
included in the examples directory.
### A trivial application
When using GtkApplication, the main() function can be very simple. We just call
g_application_run() and give it an instance of our application class.
When using `GtkApplication`, the `main()` function can be very simple. We just call
`g_application_run()` and give it an instance of our application class.
``` {.c source=examples/application1/main.c }
```c
#include <gtk/gtk.h>
#include "exampleapp.h"
@@ -759,15 +766,15 @@ GtkApplication. Our example does not yet have any interesting functionality.
All it does is open a window when it is activated without arguments, and open
the files it is given, if it is started with arguments.
To handle these two cases, we override the activate() vfunc, which gets called
when the application is launched without commandline arguments, and the open()
vfunc, which gets called when the application is launched with commandline
arguments.
To handle these two cases, we override the activate() vfunc, which gets
called when the application is launched without commandline arguments, and
the `open()` virtual function, which gets called when the application is
launched with commandline arguments.
To learn more about GApplication entry points, consult the GIO
[documentation](https://developer.gnome.org/gio/2.36/GApplication.html#GApplication.description).
To learn more about `GApplication` entry points, consult the GIO
[documentation](https://developer.gnome.org/gio/stable/GApplication.html#GApplication.description).
``` {.c source=examples/application1/exampleapp.c }
```c
#include <gtk/gtk.h>
#include "exampleapp.h"
@@ -834,10 +841,10 @@ example_app_new (void)
```
Another important class that is part of the application support in GTK is
GtkApplicationWindow. It is typically subclassed as well. Our subclass does
`GtkApplicationWindow`. It is typically subclassed as well. Our subclass does
not do anything yet, so we will just get an empty window.
``` {.c source=examples/application1/examplewin.c }
```c
#include <gtk/gtk.h>
#include "exampleapp.h"
@@ -878,7 +885,7 @@ create an icon and a desktop file.
![An icon](exampleapp.png)
``` { source=examples/application1/org.gtk.exampleapp.desktop }
```
[Desktop Entry]
Type=Application
Name=Example
@@ -906,7 +913,7 @@ GtkBuilder ui file with our application window class.
Our simple ui file gives the window a title, and puts a GtkStack
widget as the main content.
``` { .xml source=examples/application2/window.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ExampleAppWindow" parent="GtkApplicationWindow">
@@ -926,14 +933,14 @@ widget as the main content.
```
To make use of this file in our application, we revisit our
GtkApplicationWindow subclass, and call
gtk_widget_class_set_template_from_resource() from the class init
`GtkApplicationWindow` subclass, and call
`gtk_widget_class_set_template_from_resource()` from the class init
function to set the ui file as template for this class. We also
add a call to gtk_widget_init_template() in the instance init
add a call to `gtk_widget_init_template()` in the instance init
function to instantiate the template for each instance of our
class.
```
```c
...
static void
@@ -951,6 +958,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application2/exampleappwin.c))
You may have noticed that we used the `_from_resource()` variant of the function
@@ -959,7 +967,7 @@ that sets a template. Now we need to use
to include the ui file in the binary. This is commonly done by listing all resources
in a `.gresource.xml` file, such as this:
``` { .xml source=examples/application2/exampleapp.gresource.xml }
```c
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gtk/exampleapp">
@@ -976,8 +984,8 @@ into the application together with the other source files. To do so, we use the
glib-compile-resources exampleapp.gresource.xml --target=resources.c --generate-source
```
The gnome module of the meson build system provides the
[gnome.compile_resources()](https://mesonbuild.com/Gnome-module.html#gnomecompile_resources)
The gnome module of the [Meson build system](https://mesonbuild.com)
provides the [`gnome.compile_resources()`](https://mesonbuild.com/Gnome-module.html#gnomecompile_resources)
method for this task.
Our application now looks like this:
@@ -990,14 +998,14 @@ In this step, we make our application show the content of all the files
that it is given on the commandline.
To this end, we add a member to the struct of our application window subclass
and keep a reference to the GtkStack there. The first member of the struct
and keep a reference to the `GtkStack` there. The first member of the struct
should be the parent type from which the class is derived. Here,
ExampleAppWindow is derived from GtkApplicationWindow. The
gtk_widget_class_bind_template_child() function arranges things so that after
`ExampleAppWindow` is derived from `GtkApplicationWindow`. The
`gtk_widget_class_bind_template_child()` function arranges things so that after
instantiating the template, the `stack` member of the struct will point to the
widget of the same name from the template.
```
```c
...
struct _ExampleAppWindow
@@ -1021,13 +1029,14 @@ example_app_window_class_init (ExampleAppWindowClass *class)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application3/exampleappwin.c))
Now we revisit the example_app_window_open() function that is called for each
Now we revisit the `example_app_window_open()` function that is called for each
commandline argument, and construct a GtkTextView that we then add as a page
to the stack:
```
```c
...
void
@@ -1064,14 +1073,16 @@ example_app_window_open (ExampleAppWindow *win,
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application3/exampleappwin.c))
Lastly, we add a GtkStackSwitcher to the titlebar area in the ui file, and we
Lastly, we add a [class@Gtk.StackSwitcher] to the titlebar area in the UI file, and we
tell it to display information about our stack.
The stack switcher gets all its information it needs to display tabs from
the stack that it belongs to. Here, we are passing the label to show for
each file as the last argument to the gtk_stack_add_titled() function.
each file as the last argument to the [`method@Gtk.Stack.add_titled`]
function.
Our application is beginning to take shape:
@@ -1085,7 +1096,7 @@ infrequently used actions that affect the whole application.
Just like the window template, we specify our menu in a ui file, and add it
as a resource to our binary.
``` {.xml source=examples/application4/gears-menu.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="menu">
@@ -1113,7 +1124,7 @@ of actions to our application.
Adding the actions is best done in the startup() vfunc, which is guaranteed
to be called once for each primary application instance:
```
```c
...
static void
@@ -1163,11 +1174,12 @@ example_app_class_init (ExampleAppClass *class)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application4/exampleapp.c))
Our preferences menu item does not do anything yet, but the Quit menu item
is fully functional. Note that it can also be activated by the usual Ctrl-Q
shortcut. The shortcut was added with gtk_application_set_accels_for_action().
shortcut. The shortcut was added with `gtk_application_set_accels_for_action()`.
The application menu looks like this:
@@ -1179,10 +1191,10 @@ A typical application will have a some preferences that should be remembered
from one run to the next. Even for our simple example application, we may
want to change the font that is used for the content.
We are going to use GSettings to store our preferences. GSettings requires
We are going to use `GSettings` to store our preferences. `GSettings` requires
a schema that describes our settings:
``` {.xml source=examples/application5/org.gtk.exampleapp.gschema.xml }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/org/gtk/exampleapp/" id="org.gtk.exampleapp">
@@ -1208,16 +1220,16 @@ a schema that describes our settings:
Before we can make use of this schema in our application, we need to compile
it into the binary form that GSettings expects. GIO provides
[macros](https://developer.gnome.org/gio/2.36/ch31s06.html) to do this in
autotools-based projects, and the gnome module of the meson build system
provides the [gnome.compile_schemas()](https://mesonbuild.com/Gnome-module.html#gnomecompile_schemas)
autotools-based projects, and the gnome module of the Meson build system
provides the [`gnome.compile_schemas()`](https://mesonbuild.com/Gnome-module.html#gnomecompile_schemas)
method for this task.
Next, we need to connect our settings to the widgets that they are supposed
to control. One convenient way to do this is to use GSettings bind
to control. One convenient way to do this is to use `GSettings` bind
functionality to bind settings keys to object properties, as we do here
for the transition setting.
```
```c
...
static void
@@ -1233,6 +1245,7 @@ example_app_window_init (ExampleAppWindow *win)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application5/exampleappwin.c))
The code to connect the font setting is a little more involved, since there
@@ -1240,15 +1253,15 @@ is no simple object property that it corresponds to, so we are not going to
go into that here.
At this point, the application will already react if you change one of the
settings, e.g. using the gsettings commandline tool. Of course, we expect
settings, e.g. using the `gsettings` command line tool. Of course, we expect
the application to provide a preference dialog for these. So lets do that
now. Our preference dialog will be a subclass of GtkDialog, and we'll use
the same techniques that we've already seen: templates, private structs,
settings bindings.
now. Our preference dialog will be a subclass of [class@Gtk.Dialog], and
we'll use the same techniques that we've already seen: templates, private
structs, settings bindings.
Lets start with the template.
``` {.xml source=examples/application6/prefs.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ExampleAppPrefs" parent="GtkDialog">
@@ -1320,7 +1333,7 @@ Lets start with the template.
Next comes the dialog subclass.
``` {.c source=examples/application6/exampleappprefs.c }
```c
#include <gtk/gtk.h>
#include "exampleapp.h"
@@ -1385,7 +1398,7 @@ example_app_prefs_new (ExampleAppWindow *win)
Now we revisit the `preferences_activated()` function in our application
class, and make it open a new preference dialog.
```
```c
...
static void
@@ -1403,6 +1416,7 @@ preferences_activated (GSimpleAction *action,
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application6/exampleapp.c))
After all this work, our application can now show a preference dialog
@@ -1413,14 +1427,14 @@ like this:
### Adding a search bar
We continue to flesh out the functionality of our application. For now, we
add search. GTK supports this with GtkSearchEntry and GtkSearchBar. The
search bar is a widget that can slide in from the top to present a search
entry.
add search. GTK supports this with [class@Gtk.SearchEntry] and
[class@Gtk.SearchBar]. The search bar is a widget that can slide in from the
top to present a search entry.
We add a toggle button to the header bar, which can be used to slide out
the search bar below the header bar.
``` {.xml source=examples/application7/window.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ExampleAppWindow" parent="GtkApplicationWindow">
@@ -1475,7 +1489,7 @@ going to completely go over here. The central piece of the search
implementation is a signal handler that listens for text changes in
the search entry.
```
```c
...
static void
@@ -1522,6 +1536,7 @@ example_app_window_init (ExampleAppWindow *win)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application7/exampleappwin.c))
With the search bar, our application now looks like this:
@@ -1531,9 +1546,9 @@ With the search bar, our application now looks like this:
### Adding a side bar
As another piece of functionality, we are adding a sidebar, which demonstrates
GtkMenuButton, GtkRevealer and GtkListBox.
[class@Gtk.MenuButton], [class@Gtk.Revealer] and [class@Gtk.ListBox].
``` {.xml source=examples/application8/window.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ExampleAppWindow" parent="GtkApplicationWindow">
@@ -1606,7 +1621,7 @@ The code to populate the sidebar with buttons for the words found in each
file is a little too involved to go into here. But we'll look at the code
to add a checkbutton for the new feature to the menu.
``` {.xml source=examples/application8/gears-menu.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="menu">
@@ -1631,9 +1646,9 @@ to add a checkbutton for the new feature to the menu.
```
To connect the menuitem to the show-words setting, we use
a GAction corresponding to the given GSettings key.
a `GAction` corresponding to the given `GSettings` key.
```
```c
...
static void
@@ -1654,6 +1669,7 @@ example_app_window_init (ExampleAppWindow *win)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application8/exampleappwin.c))
What our application looks like now:
@@ -1665,7 +1681,7 @@ What our application looks like now:
Widgets and other objects have many useful properties.
Here we show some ways to use them in new and flexible ways, by wrapping
them in actions with GPropertyAction or by binding them with GBinding.
them in actions with `GPropertyAction` or by binding them with `GBinding`.
To set this up, we add two labels to the header bar in our window template,
named `lines_label` and `lines`, and bind them to struct members in the
@@ -1674,7 +1690,7 @@ private struct, as we've seen a couple of times by now.
We add a new "Lines" menu item to the gears menu, which triggers the
show-lines action:
``` {.xml source=examples/application9/gears-menu.ui }
```xml
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="menu">
@@ -1711,7 +1727,7 @@ Since we want both labels to appear and disappear together, we bind
the visible property of the `lines_label` widget to the same property
of the `lines` widget.
```
```c
...
static void
@@ -1730,6 +1746,7 @@ example_app_window_init (ExampleAppWindow *win)
...
```
([full source](https://gitlab.gnome.org/GNOME/gtk/blob/master/examples/application9/exampleappwin.c))
We also need a function that counts the lines of the currently active tab,

View File

@@ -1,199 +0,0 @@
#!/usr/bin/python3
#
# Call pandoc to convert markdown to docbook, then expand gtk-doc
# abbreviations (|[ ]|, function(), #object, %constant, etc)
import sys
import re
import tempfile
import os.path
import subprocess
# The following code is taken from gtk-doc
def ExpandAbbreviations(symbol, text):
# Hack!
# Strip xlink namespace from hrefs since pandoc insists on
# inserting them, and namespace setup doesn't transfer across
# xi:include.
# Yay for XML!
text = re.sub('xlink:href', 'href', text)
# Convert '@param()'
text = re.sub(r'(\A|[^\\])\@(\w+((\.|->)\w+)*)\s*\(\)', r'\1<parameter>\2()</parameter>', text)
# Convert 'function()' or 'macro()'.
# if there is abc_*_def() we don't want to make a link to _def()
# FIXME: also handle abc(def(....)) : but that would need to be done recursively :/
def f1(m):
return m.group(1) + MakeXRef(m.group(2), tagify(m.group(2) + "()", "function"))
text = re.sub(r'([^\*.\w])(\w+)\s*\(\)', f1, text)
# handle #Object.func()
text = re.sub(r'(\A|[^\\])#([\w\-:\.]+[\w]+)\s*\(\)', f1, text)
# Convert '@param', but not '\@param'.
text = re.sub(r'(\A|[^\\])\@(\w+((\.|->)\w+)*)', r'\1<parameter>\2</parameter>', text)
text = re.sub(r'/\\\@', r'\@', text)
# Convert '%constant', but not '\%constant'.
# Also allow negative numbers, e.g. %-1.
def f2(m):
return m.group(1) + MakeXRef(m.group(2), tagify(m.group(2), "literal"))
text = re.sub(r'(\A|[^\\])\%(-?\w+)', f2, text)
text = re.sub(r'\\\%', r'\%', text)
# Convert '#symbol', but not '\#symbol'.
# Only convert #foo after a space to avoid interfering with
# fragment identifiers in urls
def f3(m):
return m.group(1) + MakeHashXRef(m.group(2), "type")
text = re.sub(r'(\A|[ ])#([\w\-:\.]+[\w]+)', f3, text)
text = re.sub(r'\\#', '#', text)
return text
# Standard C preprocessor directives, which we ignore for '#' abbreviations.
PreProcessorDirectives = {
'assert', 'define', 'elif', 'else', 'endif', 'error', 'if', 'ifdef', 'ifndef',
'include', 'line', 'pragma', 'unassert', 'undef', 'warning'
}
def MakeHashXRef(symbol, tag):
text = symbol
# Check for things like '#include', '#define', and skip them.
if symbol in PreProcessorDirectives:
return "#%s" % symbol
# Get rid of special suffixes ('-struct','-enum').
text = re.sub(r'-struct$', '', text)
text = re.sub(r'-enum$', '', text)
# If the symbol is in the form "Object::signal", then change the symbol to
# "Object-signal" and use "signal" as the text.
if '::' in symbol:
o, s = symbol.split('::', 1)
symbol = '%s-%s' % (o, s)
text = u'“' + s + u'”'
# If the symbol is in the form "Object:property", then change the symbol to
# "Object--property" and use "property" as the text.
if ':' in symbol:
o, p = symbol.split(':', 1)
symbol = '%s--%s' % (o, p)
text = u'“' + p + u'”'
if tag != '':
text = tagify(text, tag)
return MakeXRef(symbol, text)
def MakeXRef(symbol, text=None):
"""This returns a cross-reference link to the given symbol.
Though it doesn't try to do this for a few standard C types that it knows
won't be in the documentation.
Args:
symbol (str): the symbol to try to create a XRef to.
text (str): text to put inside the XRef, defaults to symbol
Returns:
str: a docbook link
"""
symbol = symbol.strip()
if not text:
text = symbol
# Get rid of special suffixes ('-struct','-enum').
text = re.sub(r'-struct$', '', text)
text = re.sub(r'-enum$', '', text)
if ' ' in symbol:
return text
symbol_id = CreateValidSGMLID(symbol)
return "<link linkend=\"%s\">%s</link>" % (symbol_id, text)
def CreateValidSGMLID(xml_id):
"""Creates a valid SGML 'id' from the given string.
According to http://www.w3.org/TR/html4/types.html#type-id "ID and NAME
tokens must begin with a letter ([A-Za-z]) and may be followed by any number
of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"),
and periods (".")."
When creating SGML IDS, we append ":CAPS" to all all-caps identifiers to
prevent name clashes (SGML ids are case-insensitive). (It basically never is
the case that mixed-case identifiers would collide.)
Args:
id (str): The text to be converted into a valid SGML id.
Returns:
str: The converted id.
"""
# Special case, '_' would end up as '' so we use 'gettext-macro' instead.
if xml_id == '_':
return "gettext-macro"
xml_id = re.sub(r'[,;]', '', xml_id)
xml_id = re.sub(r'[_ ]', '-', xml_id)
xml_id = re.sub(r'^-+', '', xml_id)
xml_id = xml_id.replace('::', '-')
xml_id = xml_id.replace(':', '--')
# Append ":CAPS" to all all-caps identifiers
# FIXME: there are some inconsistencies here, we have index files containing e.g. TRUE--CAPS
if xml_id.isupper() and not xml_id.endswith('-CAPS'):
xml_id += ':CAPS'
return xml_id
def tagify(text, elem):
# Adds a tag around some text.
# e.g tagify("Text", "literal") => "<literal>Text</literal>".
return '<' + elem + '>' + text + '</' + elem + '>'
# End of gtk-doc excerpts
MarkdownExtensions = {
'-auto_identifiers', # we use explicit identifiers where needed
'+header_attributes', # for explicit identifiers
'+blank_before_header', # helps with gtk-doc #Object abbreviations
'+compact_definition_lists', # to replace <variablelist>
'+pipe_tables',
'+backtick_code_blocks', # to replace |[ ]|
'+fenced_code_attributes', # to add language annotations
'-raw_html', # to escape literal tags like <child> in input
'+startnum', # to have interrupted lists in the q&a part
}
def ConvertToDocbook(infile, outfile):
basename = os.path.basename(infile)
if basename.startswith('section'):
division='section'
else:
division='chapter'
input_format = "markdown" + "".join(MarkdownExtensions)
output_format = "docbook4"
subprocess.check_call(["pandoc", infile, "-o", outfile,
"--from=" + input_format,
"--to=" + output_format,
"--top-level-division=" + division])
def ExpandGtkDocAbbreviations(infile, outfile):
contents = open(infile, 'r', encoding='utf-8').read()
with open(outfile, 'w', encoding='utf-8') as out:
out.write(ExpandAbbreviations("file", contents))
if __name__ == '__main__':
tmp = tempfile.mktemp()
ConvertToDocbook(sys.argv[1], tmp)
ExpandGtkDocAbbreviations(tmp, sys.argv[2])
os.remove(tmp)

View File

@@ -41,35 +41,41 @@
<command>gtk4-builder-tool</command> can perform various operations
on GtkBuilder .ui files.
</para>
<para>
The <option>validate</option> command validates the .ui file and reports
errors to stderr.
</para>
<para>
The <option>enumerate</option> command lists all the named objects that
are created in the .ui file.
</para>
<para>
The <option>preview</option> command displays the .ui file. This command
accepts options to specify the ID of the toplevel object and a .css file
to use.
</para>
<para>
The <option>simplify</option> command simplifies the .ui file by removing
properties that are set to their default values and writes the resulting XML
to stdout, or back to the input file.
</para>
<para>
When the <option>--3to4</option> is specified, <option>simplify</option>
interprets the input as a GTK 3 ui file and attempts to convert it to GTK 4
equivalents. It performs various conversions, such as renaming properties,
translating child properties to layout properties, rewriting the setup for
GtkNotebook, GtkStack, GtkAssistant or changing toolbars into boxes.
</para>
<para>
You should always test the modified .ui files produced by gtk4-builder-tool
before using them in production.
</para>
</refsect1>
<refsect1><title>Commands</title>
<para>The following commands are understood:</para>
<variablelist>
<varlistentry>
<term><option>validate</option></term>
<listitem><para>Validates the .ui file and report errors to stderr.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>simplify</option></term>
<listitem><para>Simplifies the .ui file by removing properties that
are set to their default values and write the resulting XML to stdout,
or back to the input file.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>enumerate</option></term>
<listitem><para>Lists all the named objects that are created in the .ui file.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>preview</option></term>
<listitem><para>Preview the .ui file. This command accepts options
to specify the ID of an object and a .css file to use.</para></listitem>
</varlistentry>
</variablelist>
<para>
Note in particular that the conversion
done with <option>--3to4</option> is meant as a starting point for a port
from GTK 3 to GTK 4. It is expected that you will have to do manual fixups
after the initial conversion.
</para>
</refsect1>
<refsect1><title>Simplify Options</title>

View File

@@ -1,496 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<book xmlns="http://docbook.org/ns/docbook" id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GTK 4 Reference Manual</title>
<releaseinfo>
This document is for the GTK 4 library, version &version;.
The latest versions can be found online at
<ulink role="online-location" url="https://developer.gnome.org/gtk4/">https://developer.gnome.org/gtk4/</ulink>.
If you are looking for the older GTK 3 series of libraries,
see <ulink role="online-location" url="https://developer.gnome.org/gtk3/">https://developer.gnome.org/gtk3/</ulink>.
</releaseinfo>
</bookinfo>
<part id="gtk">
<title>Introduction</title>
<xi:include href="overview.xml"/>
<xi:include href="getting_started.xml"/>
<xi:include href="resources.xml" />
<xi:include href="question_index.xml" />
</part>
<part id="concepts">
<title>GTK Concepts</title>
<xi:include href="drawing-model.xml" />
<xi:include href="input-handling.xml" />
<xi:include href="actions.xml" />
</part>
<part id="gtkobjects">
<title>GTK Widgets and Objects</title>
<chapter>
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml" />
</chapter>
<chapter>
<title>Widget Gallery</title>
<xi:include href="visual_index.xml" />
</chapter>
<chapter id="Lists">
<title>GListModel support</title>
<xi:include href="xml/gtkbitset.xml" />
<xi:include href="xml/gtkexpression.xml" />
<xi:include href="xml/gtkfilterlistmodel.xml" />
<section>
<xi:include href="xml/gtkfilter.xml" />
<xi:include href="xml/gtkcustomfilter.xml" />
<xi:include href="xml/gtkmultifilter.xml" />
<xi:include href="xml/gtkboolfilter.xml" />
<xi:include href="xml/gtkstringfilter.xml" />
<xi:include href="xml/gtkfilefilter.xml" />
</section>
<xi:include href="xml/gtkflattenlistmodel.xml" />
<xi:include href="xml/gtkmaplistmodel.xml" />
<xi:include href="xml/gtkslicelistmodel.xml" />
<xi:include href="xml/gtksortlistmodel.xml" />
<section>
<xi:include href="xml/gtksorter.xml" />
<xi:include href="xml/gtkcustomsorter.xml" />
<xi:include href="xml/gtkmultisorter.xml" />
<xi:include href="xml/gtkstringsorter.xml" />
<xi:include href="xml/gtknumericsorter.xml" />
</section>
<xi:include href="xml/gtkselectionmodel.xml" />
<section>
<xi:include href="xml/gtknoselection.xml" />
<xi:include href="xml/gtksingleselection.xml" />
<xi:include href="xml/gtkmultiselection.xml" />
</section>
<xi:include href="xml/gtkselectionfiltermodel.xml" />
<xi:include href="xml/gtkbookmarklist.xml" />
<xi:include href="xml/gtkdirectorylist.xml" />
<xi:include href="xml/gtkstringlist.xml" />
</chapter>
<chapter id="ListContainers">
<title>List-based Widgets</title>
<xi:include href="section-list-widget.xml"/>
<xi:include href="xml/gtklistitem.xml" />
<xi:include href="xml/gtklistitemfactory.xml" />
<section>
<xi:include href="xml/gtksignallistitemfactory.xml" />
<xi:include href="xml/gtkbuilderlistitemfactory.xml" />
</section>
<xi:include href="xml/gtklistview.xml" />
<xi:include href="xml/gtkgridview.xml" />
<xi:include href="xml/gtkcolumnview.xml" />
<section>
<xi:include href="xml/gtkcolumnviewcolumn.xml" />
</section>
<xi:include href="xml/gtkdropdown.xml" />
</chapter>
<chapter id="Trees">
<title>Tree support</title>
<xi:include href="xml/gtktreelistmodel.xml" />
<section>
<xi:include href="xml/gtktreelistrow.xml" />
</section>
<xi:include href="xml/gtktreelistrowsorter.xml" />
<xi:include href="xml/gtktreeexpander.xml" />
</chapter>
<chapter id="Application">
<title>Application support</title>
<xi:include href="xml/gtkapplication.xml" />
<xi:include href="xml/gtkapplicationwindow.xml" />
<xi:include href="xml/gtkactionable.xml" />
</chapter>
<chapter id="Builder">
<title>Interface builder</title>
<xi:include href="xml/gtkbuilder.xml" />
<xi:include href="xml/gtkbuildable.xml" />
<xi:include href="xml/gtkbuilderscope.xml" />
</chapter>
<chapter id="WindowWidgets">
<title>Windows</title>
<xi:include href="xml/gtkroot.xml" />
<xi:include href="xml/gtknative.xml" />
<xi:include href="xml/gtkwindow.xml" />
<xi:include href="xml/gtkdialog.xml" />
<xi:include href="xml/gtkmessagedialog.xml" />
<xi:include href="xml/gtkaboutdialog.xml" />
<xi:include href="xml/gtkassistant.xml" />
<xi:include href="xml/gtkwindowgroup.xml" />
<xi:include href="xml/gtknativedialog.xml" />
</chapter>
<chapter id="LayoutContainers">
<title>Layout Containers</title>
<xi:include href="xml/gtkbox.xml" />
<xi:include href="xml/gtkcenterbox.xml" />
<xi:include href="xml/gtkgrid.xml" />
<xi:include href="xml/gtkrevealer.xml" />
<xi:include href="xml/gtklistbox.xml" />
<xi:include href="xml/gtkflowbox.xml" />
<xi:include href="xml/gtkstack.xml" />
<xi:include href="xml/gtkstackswitcher.xml" />
<xi:include href="xml/gtkstacksidebar.xml" />
<xi:include href="xml/gtkactionbar.xml" />
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />
<xi:include href="xml/gtkpaned.xml" />
<xi:include href="xml/gtknotebook.xml" />
<xi:include href="xml/gtkexpander.xml" />
<xi:include href="xml/gtkorientable.xml" />
<xi:include href="xml/gtkaspectframe.xml" />
<xi:include href="xml/gtkfixed.xml" />
</chapter>
<chapter id="LayoutManagers">
<title>Layout Managers</title>
<xi:include href="xml/gtklayoutmanager.xml" />
<xi:include href="xml/gtklayoutchild.xml" />
<xi:include href="xml/gtkbinlayout.xml" />
<xi:include href="xml/gtkboxlayout.xml" />
<xi:include href="xml/gtkcenterlayout.xml" />
<xi:include href="xml/gtkfixedlayout.xml" />
<xi:include href="xml/gtkgridlayout.xml" />
<xi:include href="xml/gtkoverlaylayout.xml" />
<xi:include href="xml/gtkcustomlayout.xml" />
<xi:include href="xml/gtkconstraintlayout.xml" />
<xi:include href="xml/gtkconstraint.xml" />
<xi:include href="xml/gtkconstraintguide.xml" />
</chapter>
<chapter id="DisplayWidgets">
<title>Display Widgets</title>
<xi:include href="xml/gtklabel.xml" />
<xi:include href="xml/gtkimage.xml" />
<xi:include href="xml/gtkpicture.xml" />
<xi:include href="xml/gtkspinner.xml" />
<xi:include href="xml/gtkinfobar.xml" />
<xi:include href="xml/gtkprogressbar.xml" />
<xi:include href="xml/gtklevelbar.xml" />
<xi:include href="xml/gtkstatusbar.xml" />
<xi:include href="xml/gtkcalendar.xml" />
</chapter>
<chapter id="MediaSupport">
<title>Media Support</title>
<xi:include href="xml/gtkvideo.xml" />
<xi:include href="xml/gtkmediacontrols.xml" />
<xi:include href="xml/gtkmediastream.xml" />
<xi:include href="xml/gtkmediafile.xml" />
</chapter>
<chapter id="ButtonWidgets">
<title>Buttons and Toggles</title>
<xi:include href="xml/gtkbutton.xml" />
<xi:include href="xml/gtkcheckbutton.xml" />
<xi:include href="xml/gtktogglebutton.xml" />
<xi:include href="xml/gtklinkbutton.xml" />
<xi:include href="xml/gtkmenubutton.xml" />
<xi:include href="xml/gtkswitch.xml" />
<xi:include href="xml/gtkscalebutton.xml" />
<xi:include href="xml/gtkvolumebutton.xml" />
<xi:include href="xml/gtklockbutton.xml" />
</chapter>
<chapter id="NumericEntry">
<title>Numeric and Text Data Entry</title>
<xi:include href="xml/gtkeditable.xml" />
<xi:include href="xml/gtkentrybuffer.xml" />
<xi:include href="xml/gtktext.xml" />
<xi:include href="xml/gtkentry.xml" />
<xi:include href="xml/gtkentrycompletion.xml" />
<xi:include href="xml/gtkpasswordentry.xml" />
<xi:include href="xml/gtkscale.xml" />
<xi:include href="xml/gtkspinbutton.xml" />
<xi:include href="xml/gtksearchentry.xml" />
<xi:include href="xml/gtksearchbar.xml" />
<xi:include href="xml/gtkeditablelabel.xml" />
</chapter>
<chapter id="TextWidgetObjects">
<title>Multiline Text Editor</title>
<xi:include href="section-text-widget.xml" />
<xi:include href="xml/gtktextiter.xml" />
<xi:include href="xml/gtktextmark.xml" />
<xi:include href="xml/gtktextbuffer.xml" />
<xi:include href="xml/gtktexttag.xml" />
<xi:include href="xml/gtktexttagtable.xml" />
<xi:include href="xml/gtktextview.xml" />
</chapter>
<chapter id="TreeWidgetObjects">
<title>Tree, List and Icon Grid Widgets</title>
<xi:include href="section-tree-widget.xml" />
<xi:include href="xml/gtktreemodel.xml" />
<xi:include href="xml/gtktreeselection.xml" />
<xi:include href="xml/gtktreeviewcolumn.xml" />
<xi:include href="xml/gtktreeview.xml" />
<xi:include href="xml/gtktreednd.xml" />
<xi:include href="xml/gtkcellview.xml" />
<xi:include href="xml/gtkiconview.xml" />
<xi:include href="xml/gtktreesortable.xml" />
<xi:include href="xml/gtktreemodelsort.xml" />
<xi:include href="xml/gtktreemodelfilter.xml" />
<xi:include href="xml/gtkcelllayout.xml" />
<xi:include href="xml/gtkcellarea.xml" />
<xi:include href="xml/gtkcellareabox.xml" />
<xi:include href="xml/gtkcellareacontext.xml" />
<xi:include href="xml/gtkcellrenderer.xml" />
<xi:include href="xml/gtkcelleditable.xml" />
<xi:include href="xml/gtkcellrendereraccel.xml" />
<xi:include href="xml/gtkcellrenderercombo.xml" />
<xi:include href="xml/gtkcellrendererpixbuf.xml" />
<xi:include href="xml/gtkcellrendererprogress.xml" />
<xi:include href="xml/gtkcellrendererspin.xml" />
<xi:include href="xml/gtkcellrenderertext.xml" />
<xi:include href="xml/gtkcellrenderertoggle.xml" />
<xi:include href="xml/gtkcellrendererspinner.xml" />
<xi:include href="xml/gtkliststore.xml" />
<xi:include href="xml/gtktreestore.xml" />
</chapter>
<chapter id="MenusAndCombos">
<title>Menus, Combo Box</title>
<xi:include href="xml/gtkcombobox.xml" />
<xi:include href="xml/gtkcomboboxtext.xml" />
<xi:include href="xml/gtkpopover.xml" />
<xi:include href="xml/gtkpopovermenu.xml" />
<xi:include href="xml/gtkpopovermenubar.xml" />
<xi:include href="xml/gtkdropdown.xml" />
</chapter>
<chapter id="SelectorWidgets">
<title>Selector Widgets and Dialogs</title>
<xi:include href="xml/gtkcolorchooser.xml" />
<xi:include href="xml/gtkcolorbutton.xml" />
<xi:include href="xml/gtkcolorchooserwidget.xml" />
<xi:include href="xml/gtkcolorchooserdialog.xml" />
<xi:include href="xml/gtkfilechooser.xml" />
<xi:include href="xml/gtkfilechoosernative.xml" />
<xi:include href="xml/gtkfilechooserdialog.xml" />
<xi:include href="xml/gtkfilechooserwidget.xml" />
<xi:include href="xml/gtkfontchooser.xml" />
<xi:include href="xml/gtkfontbutton.xml" />
<xi:include href="xml/gtkfontchooserwidget.xml" />
<xi:include href="xml/gtkfontchooserdialog.xml" />
<xi:include href="xml/gtkemojichooser.xml" />
</chapter>
<chapter id="DrawingWidgets">
<title>Widgets for custom drawing</title>
<xi:include href="xml/gtkdrawingarea.xml" />
<xi:include href="xml/gtkglarea.xml" />
</chapter>
<chapter id="Ornaments">
<title>Ornaments</title>
<xi:include href="xml/gtkframe.xml" />
<xi:include href="xml/gtkseparator.xml" />
</chapter>
<chapter id="ScrollingWidgets">
<title>Scrolling</title>
<xi:include href="xml/gtkscrollbar.xml" />
<xi:include href="xml/gtkscrolledwindow.xml" />
<xi:include href="xml/gtkscrollable.xml" />
<xi:include href="xml/gtkviewport.xml" />
</chapter>
<chapter id="Printing">
<title>Printing</title>
<xi:include href="xml/gtkprintoperation.xml" />
<xi:include href="xml/gtkprintcontext.xml" />
<xi:include href="xml/gtkprintsettings.xml" />
<xi:include href="xml/gtkpagesetup.xml" />
<xi:include href="xml/gtkpapersize.xml" />
<xi:include href="xml/gtkprinter.xml" />
<xi:include href="xml/gtkprintjob.xml" />
<xi:include href="xml/gtkprintunixdialog.xml" />
<xi:include href="xml/gtkpagesetupunixdialog.xml" />
</chapter>
<chapter id="ShortcutsOverview">
<title>Shortcuts Overview</title>
<xi:include href="xml/gtkshortcutswindow.xml" />
<xi:include href="xml/gtkshortcutssection.xml" />
<xi:include href="xml/gtkshortcutsgroup.xml" />
<xi:include href="xml/gtkshortcutsshortcut.xml" />
<xi:include href="xml/gtkshortcutlabel.xml" />
</chapter>
<chapter id="Accessibility">
<title>Accessibility</title>
<xi:include href="section-accessibility.xml"/>
<xi:include href="xml/gtkaccessible.xml" />
<xi:include href="xml/gtkatcontext.xml" />
</chapter>
<chapter id="MiscObjects">
<title>Miscellaneous</title>
<xi:include href="xml/gtkadjustment.xml" />
<xi:include href="xml/gtkimcontextsimple.xml" />
<xi:include href="xml/gtkimmulticontext.xml" />
<xi:include href="xml/gtksizegroup.xml" />
<xi:include href="xml/gtksnapshot.xml" />
<xi:include href="xml/gtktooltip.xml" />
<xi:include href="xml/gtkwidgetpaintable.xml" />
<xi:include href="xml/gtkwindowcontrols.xml" />
<xi:include href="xml/gtkwindowhandle.xml" />
</chapter>
<chapter id="AbstractObjects">
<title>Abstract Base Classes</title>
<xi:include href="xml/gtkwidget.xml" />
<xi:include href="xml/gtkrange.xml" />
<xi:include href="xml/gtkimcontext.xml" />
<xi:include href="xml/gtknativedialog.xml" />
<xi:include href="xml/gtkaccessible.xml" />
</chapter>
<chapter id="RecentDocuments">
<title>Recently Used Documents</title>
<xi:include href="xml/gtkrecentmanager.xml" />
</chapter>
<chapter id="ApplicationChoosing">
<title>Choosing from installed applications</title>
<xi:include href="xml/gtkappchooser.xml" />
<xi:include href="xml/gtkappchooserbutton.xml" />
<xi:include href="xml/gtkappchooserdialog.xml" />
<xi:include href="xml/gtkappchooserwidget.xml" />
</chapter>
<chapter id="Gestures">
<title>Gestures and event handling</title>
<xi:include href="xml/gtkeventcontroller.xml" />
<xi:include href="xml/gtkeventcontrollerkey.xml" />
<xi:include href="xml/gtkeventcontrollerfocus.xml" />
<xi:include href="xml/gtkeventcontrollerlegacy.xml" />
<xi:include href="xml/gtkeventcontrollerscroll.xml" />
<xi:include href="xml/gtkeventcontrollermotion.xml" />
<xi:include href="xml/gtkgesture.xml" />
<xi:include href="xml/gtkgesturesingle.xml" />
<xi:include href="xml/gtkgesturedrag.xml" />
<xi:include href="xml/gtkgesturelongpress.xml" />
<xi:include href="xml/gtkgestureclick.xml" />
<xi:include href="xml/gtkgesturepan.xml" />
<xi:include href="xml/gtkgestureswipe.xml" />
<xi:include href="xml/gtkgesturerotate.xml" />
<xi:include href="xml/gtkgesturezoom.xml" />
<xi:include href="xml/gtkgesturestylus.xml" />
<xi:include href="xml/gtkpadcontroller.xml" />
<xi:include href="xml/gtkshortcutcontroller.xml" />
</chapter>
<chapter>
<title>Keyboard shortcuts</title>
<xi:include href="xml/gtkaccelgroup.xml" />
<xi:include href="xml/gtkshortcut.xml" />
<xi:include href="xml/gtkshortcuttrigger.xml" />
<xi:include href="xml/gtkshortcutaction.xml" />
<xi:include href="xml/gtkshortcutmanager.xml" />
</chapter>
<chapter>
<title>Data exchange, clipboards and Drag-and-Drop</title>
<xi:include href="xml/gtkdragsource.xml"/>
<xi:include href="xml/gtkdragicon.xml"/>
<xi:include href="xml/gtkdroptarget.xml"/>
<xi:include href="xml/gtkdroptargetasync.xml"/>
<xi:include href="xml/gtkdropcontrollermotion.xml"/>
</chapter>
</part>
<part id="gtkbase">
<title>GTK Core Reference</title>
<xi:include href="xml/gtkmain.xml" />
<xi:include href="xml/gtkfeatures.xml" />
<xi:include href="xml/gtksettings.xml" />
<xi:include href="xml/gtkenums.xml" />
<xi:include href="xml/gtktesting.xml" />
<xi:include href="xml/filesystem.xml" />
</part>
<part id="theming">
<title>Theming in GTK</title>
<xi:include href="css-overview.xml" />
<xi:include href="css-properties.xml" />
<xi:include href="xml/gtkstylecontext.xml" />
<xi:include href="xml/gtkcssprovider.xml" />
<xi:include href="xml/gtkstyleprovider.xml" />
<xi:include href="xml/gtkicontheme.xml" />
</part>
<part id="migrating">
<title>Migrating from Previous Versions of GTK</title>
<partintro>
<para>
This part describes what you need to change in programs use
older versions of GTK so that they can use the new features.
It also mentions how to convert applications using widgets
found in the libgnomeui library to use their counterparts
in GTK.
</para>
</partintro>
<xi:include href="migrating-2to4.xml" />
<xi:include href="migrating-3to4.xml" />
</part>
<part>
<title>GTK Tools</title>
<xi:include href="gtk4-demo.xml" />
<xi:include href="gtk4-demo-application.xml" />
<xi:include href="gtk4-widget-factory.xml" />
<xi:include href="gtk4-icon-browser.xml" />
<xi:include href="gtk4-update-icon-cache.xml" />
<xi:include href="gtk4-encode-symbolic-svg.xml" />
<xi:include href="gtk4-builder-tool.xml" />
<xi:include href="gtk4-launch.xml" />
<xi:include href="gtk4-query-settings.xml" />
<xi:include href="gtk4-broadwayd.xml" />
</part>
<part id="platform-support">
<title>GTK Platform Support</title>
<xi:include href="building.xml" />
<xi:include href="compiling.xml" />
<xi:include href="running.xml" />
<xi:include href="x11.xml" />
<xi:include href="windows.xml" />
<xi:include href="osx.xml" />
<xi:include href="broadway.xml" />
<xi:include href="wayland.xml" />
</part>
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-deprecated" role="deprecated">
<title>Index of deprecated symbols</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>

View File

@@ -61,6 +61,13 @@
<listitem><para>Write png files to <replaceable>DIRECTORY</replaceable>
instead of the current working directory.</para></listitem>
</varlistentry>
<varlistentry>
<term>--debug</term>
<listitem><para>Generate png files of the various channels during
the conversion. If these files are not monochrome green, they
are often helpful in pinpointing the problematic parts of
the source svg.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,235 @@
[library]
version = "@version@"
browse_url = "https://gitlab.gnome.org/GNOME/gtk/"
repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
website_url = "https://www.gtk.org"
authors = "GTK Development Team"
logo_url = "gtk-logo.svg"
license = "GPL-2.1-or-later"
description = "The GTK toolkit"
dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0", "Gsk-4.0" ]
devhelp = true
search_index = true
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://developer.gnome.org/gobject/stable"
[dependencies."Graphene-1.0"]
name = "Graphene"
description = "A thin layer of mathematical types for 3D libraries"
docs_url = "https://ebassi.github.io/graphene/docs"
[dependencies."Pango-1.0"]
name = "Pango"
description = "Text shaping and rendering"
docs_url = "https://developer.gnome.org/pango/stable"
[dependencies."Gdk-4.0"]
name = "GDK"
description = "The GTK windowing system abstraction"
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4/"
[dependencies."Gsk-4.0"]
name = "GSK"
description = "The GTK rendering abstraction"
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gsk4/"
[theme]
name = "basic"
show_index_summary = true
show_class_hierarchy = true
[source-location]
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
[extra]
# The same order will be used when generating the index
content_files = [
"overview.md",
"getting_started.md",
"building.md",
"compiling.md",
"running.md",
"question_index.md",
"resources.md",
"initialization.md",
"actions.md",
"input-handling.md",
"drawing-model.md",
"css-overview.md",
"css-properties.md",
"section-accessibility.md",
"section-list-widget.md",
"section-text-widget.md",
"section-tree-widget.md",
"migrating-2to4.md",
"migrating-3to4.md",
"broadway.md",
"osx.md",
"wayland.md",
"windows.md",
"x11.md",
"visual_index.md",
]
content_images = [
"images/aboutdialog.png",
"images/action-bar.png",
"images/appchooserbutton.png",
"images/appchooserdialog.png",
"images/arrows.png",
"images/assistant.png",
"images/background.png",
"images/bloatpad-gnome.png",
"images/bloatpad-osx.png",
"images/bloatpad-xfce.png",
"images/border1.png",
"images/border2.png",
"images/border3.png",
"images/box.png",
"images/box-expand.png",
"images/box-packing.png",
"images/builder-shortcuts.png",
"images/button.png",
"images/calendar.png",
"images/capture-bubble.png",
"images/centerbox.png",
"images/check-button.png",
"images/checks.png",
"images/clocks-shortcuts.png",
"images/color-button.png",
"images/colorchooser.png",
"images/combo-box-entry.png",
"images/combo-box.png",
"images/combo-box-text.png",
"images/dialog.png",
"images/down-center.png",
"images/down-end.png",
"images/down-start.png",
"images/drop-down.png",
"images/drawing.png",
"images/drawingarea.png",
"images/ease-in-out.png",
"images/ease-in.png",
"images/ease-out.png",
"images/ease.png",
"images/editable-label.png",
"images/emojichooser.png",
"images/entry.png",
"images/exampleapp.png",
"images/expanders.png",
"images/expander.png",
"images/extensions.png",
"images/figure-hierarchical-drawing.png",
"images/figure-windowed-label.png",
"images/file-button.png",
"images/filechooser.png",
"images/flow-box.png",
"images/focus.png",
"images/font-button.png",
"images/fontchooser.png",
"images/frame-gap.png",
"images/frame.png",
"images/frames.png",
"images/gedit-shortcuts.png",
"images/getting-started-app10.png",
"images/getting-started-app1.png",
"images/getting-started-app2.png",
"images/getting-started-app3.png",
"images/getting-started-app4.png",
"images/getting-started-app6.png",
"images/getting-started-app7.png",
"images/getting-started-app8.png",
"images/getting-started-app9.png",
"images/glarea.png",
"images/gradient1.png",
"images/gradient2.png",
"images/gradient3.png",
"images/gradient4.png",
"images/grid.png",
"images/grid-packing.png",
"images/gtk-logo.png",
"images/gtk-logo.svg",
"images/handles.png",
"images/headerbar.png",
"images/hello-world.png",
"images/icon-view.png",
"images/image.png",
"images/info-bar.png",
"images/inspector.png",
"images/label.png",
"images/layout-btlr.png",
"images/layout-btrl.png",
"images/layout-lrbt.png",
"images/layout-lrtb.png",
"images/layout-rlbt.png",
"images/layout-rltb.png",
"images/layout-tblr.png",
"images/layout-tbrl.png",
"images/left-center.png",
"images/left-end.png",
"images/left-start.png",
"images/levelbar.png",
"images/linear.png",
"images/link-button.png",
"images/list-and-tree.png",
"images/list-box.png",
"images/lockbutton-locked.png",
"images/lock-button.png",
"images/lockbutton.png",
"images/lockbutton-sorry.png",
"images/lockbutton-unlocked.png",
"images/media-controls.png",
"images/menu.png",
"images/menubar.png",
"images/menu-button.png",
"images/messagedialog.png",
"images/multiline-text.png",
"images/notebook.png",
"images/options.png",
"images/overlay.png",
"images/pagesetupdialog.png",
"images/panes.png",
"images/password-entry.png",
"images/picture.png",
"images/popover.png",
"images/printdialog.png",
"images/progressbar.png",
"images/radio-button.png",
"images/right-center.png",
"images/right-end.png",
"images/right-start.png",
"images/scales.png",
"images/scrollbar.png",
"images/scrolledwindow.png",
"images/search-bar.png",
"images/search-entry.png",
"images/separator.png",
"images/shortcuts-window.png",
"images/sidebar.png",
"images/slices.png",
"images/sliders.png",
"images/spinbutton.png",
"images/spinner.png",
"images/stack.png",
"images/stackswitcher.png",
"images/statusbar.png",
"images/switch.png",
"images/toggle-button.png",
"images/toolbar.png",
"images/tree-view-coordinates.png",
"images/up-center.png",
"images/up-end.png",
"images/up-start.png",
"images/video.png",
"images/volumebutton.png",
"images/widget-hvalign.png",
"images/windowcontrols.png",
"images/window-default.png",
"images/window.png",
"images/rich-list.png",
"images/data-table.png",
"images/navigation-sidebar.png",
]
urlmap_file = "urlmap.js"

View File

@@ -1,261 +0,0 @@
#include <gtk/gtk.h>
#include <gtk/gtkunixprint.h>
gtk_about_dialog_get_type
gtk_accessible_get_type
gtk_actionable_get_type
gtk_action_bar_get_type
gtk_adjustment_get_type
gtk_any_filter_get_type
gtk_app_chooser_get_type
gtk_app_chooser_button_get_type
gtk_app_chooser_dialog_get_type
gtk_app_chooser_widget_get_type
gtk_application_get_type
gtk_application_window_get_type
gtk_aspect_frame_get_type
gtk_assistant_get_type
gtk_assistant_page_get_type
gtk_at_context_get_type
gtk_bin_layout_get_type
gtk_bitset_get_type
gtk_bookmark_list_get_type
gtk_bool_filter_get_type
gtk_box_get_type
gtk_box_layout_get_type
gtk_buildable_get_type
gtk_builder_cscope_get_type
gtk_builder_get_type
gtk_builder_list_item_factory_get_type
gtk_builder_scope_get_type
gtk_button_get_type
gtk_calendar_get_type
gtk_cclosure_expression_get_type
gtk_cell_area_get_type
gtk_cell_area_box_get_type
gtk_cell_area_context_get_type
gtk_cell_editable_get_type
gtk_cell_layout_get_type
gtk_cell_renderer_accel_get_type
gtk_cell_renderer_combo_get_type
gtk_cell_renderer_get_type
gtk_cell_renderer_pixbuf_get_type
gtk_cell_renderer_progress_get_type
gtk_cell_renderer_spin_get_type
gtk_cell_renderer_spinner_get_type
gtk_cell_renderer_text_get_type
gtk_cell_renderer_toggle_get_type
gtk_cell_view_get_type
gtk_center_box_get_type
gtk_center_layout_get_type
gtk_check_button_get_type
gtk_closure_expression_get_type
gtk_color_button_get_type
gtk_color_chooser_get_type
gtk_color_chooser_dialog_get_type
gtk_color_chooser_widget_get_type
gtk_column_view_get_type
gtk_column_view_column_get_type
gtk_combo_box_get_type
gtk_combo_box_text_get_type
gtk_constant_expression_get_type
gtk_constraint_get_type
gtk_constraint_guide_get_type
gtk_constraint_layout_get_type
gtk_constraint_target_get_type
gtk_css_provider_get_type
gtk_custom_filter_get_type
gtk_custom_sorter_get_type
gtk_custom_layout_get_type
gtk_dialog_get_type
gtk_directory_list_get_type
gtk_drag_icon_get_type
gtk_drag_source_get_type
gtk_drawing_area_get_type
gtk_drop_controller_motion_get_type
gtk_drop_down_get_type
gtk_drop_target_async_get_type
gtk_drop_target_get_type
gtk_editable_get_type
gtk_editable_label_get_type
gtk_emoji_chooser_get_type
gtk_entry_buffer_get_type
gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_controller_get_type
gtk_event_controller_key_get_type
gtk_event_controller_focus_get_type
gtk_event_controller_legacy_get_type
gtk_event_controller_motion_get_type
gtk_event_controller_scroll_get_type
gtk_every_filter_get_type
gtk_expander_get_type
gtk_expression_get_type
gtk_file_chooser_dialog_get_type
gtk_file_chooser_get_type
gtk_file_chooser_native_get_type
gtk_file_chooser_widget_get_type
gtk_file_filter_get_type
gtk_filter_get_type
gtk_filter_list_model_get_type
gtk_fixed_get_type
gtk_fixed_layout_get_type
gtk_flatten_list_model_get_type
gtk_flow_box_get_type
gtk_flow_box_child_get_type
gtk_font_button_get_type
gtk_font_chooser_get_type
gtk_font_chooser_dialog_get_type
gtk_font_chooser_widget_get_type
gtk_frame_get_type
gtk_gesture_get_type
gtk_gesture_click_get_type
gtk_gesture_drag_get_type
gtk_gesture_long_press_get_type
gtk_gesture_pan_get_type
gtk_gesture_rotate_get_type
gtk_gesture_single_get_type
gtk_gesture_stylus_get_type
gtk_gesture_swipe_get_type
gtk_gesture_zoom_get_type
gtk_gl_area_get_type
gtk_grid_get_type
gtk_grid_layout_child_get_type
gtk_grid_layout_get_type
gtk_grid_view_get_type
gtk_header_bar_get_type
gtk_icon_theme_get_type
gtk_icon_view_get_type
gtk_image_get_type
gtk_im_context_get_type
gtk_im_context_simple_get_type
gtk_im_multicontext_get_type
gtk_info_bar_get_type
gtk_label_get_type
gtk_layout_child_get_type
gtk_layout_manager_get_type
gtk_link_button_get_type
gtk_list_item_get_type
gtk_list_item_factory_get_type
gtk_list_store_get_type
gtk_list_box_get_type
gtk_list_box_row_get_type
gtk_list_view_get_type
gtk_lock_button_get_type
gtk_map_list_model_get_type
gtk_media_controls_get_type
gtk_media_file_get_type
gtk_media_stream_get_type
gtk_menu_button_get_type
gtk_message_dialog_get_type
gtk_mount_operation_get_type
gtk_multi_filter_get_type
gtk_multi_selection_get_type
gtk_multi_sorter_get_type
gtk_native_get_type
gtk_native_dialog_get_type
gtk_no_selection_get_type
gtk_notebook_get_type
gtk_notebook_page_get_type
gtk_numeric_sorter_get_type
gtk_object_expression_get_type
gtk_orientable_get_type
gtk_overlay_get_type
gtk_overlay_layout_get_type
gtk_overlay_layout_child_get_type
gtk_pad_controller_get_type
gtk_page_setup_get_type
@DISABLE_ON_W32@gtk_page_setup_unix_dialog_get_type
gtk_paned_get_type
gtk_paper_size_get_type
gtk_password_entry_get_type
gtk_picture_get_type
gtk_popover_get_type
gtk_popover_menu_get_type
gtk_popover_menu_bar_get_type
@DISABLE_ON_W32@gtk_printer_get_type
gtk_print_context_get_type
@DISABLE_ON_W32@gtk_print_job_get_type
gtk_print_operation_get_type
gtk_print_operation_preview_get_type
gtk_print_settings_get_type
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
gtk_progress_bar_get_type
gtk_property_expression_get_type
gtk_range_get_type
gtk_recent_manager_get_type
gtk_revealer_get_type
gtk_root_get_type
gtk_scale_button_get_type
gtk_scale_get_type
gtk_scrollable_get_type
gtk_scrollbar_get_type
gtk_scrolled_window_get_type
gtk_search_bar_get_type
gtk_search_entry_get_type
gtk_selection_filter_model_get_type
gtk_selection_model_get_type
gtk_separator_get_type
gtk_settings_get_type
gtk_shortcut_get_type
gtk_shortcut_controller_get_type
gtk_shortcut_label_get_type
gtk_shortcut_manager_get_type
gtk_shortcuts_window_get_type
gtk_shortcuts_section_get_type
gtk_shortcuts_group_get_type
gtk_shortcuts_shortcut_get_type
gtk_signal_list_item_factory_get_type
gtk_single_selection_get_type
gtk_size_group_get_type
gtk_slice_list_model_get_type
gtk_snapshot_get_type
gtk_sort_list_model_get_type
gtk_sorter_get_type
gtk_spin_button_get_type
gtk_spinner_get_type
gtk_stack_get_type
gtk_stack_page_get_type
gtk_stack_sidebar_get_type
gtk_stack_switcher_get_type
gtk_statusbar_get_type
gtk_string_filter_get_type
gtk_string_list_get_type
gtk_string_object_get_type
gtk_string_sorter_get_type
gtk_switch_get_type
gtk_level_bar_get_type
gtk_style_context_get_type
gtk_style_provider_get_type
gtk_text_buffer_get_type
gtk_text_child_anchor_get_type
gtk_text_get_type
gtk_text_iter_get_type
gtk_text_mark_get_type
gtk_text_tag_get_type
gtk_text_tag_table_get_type
gtk_text_view_get_type
gtk_toggle_button_get_type
gtk_tree_drag_dest_get_type
gtk_tree_drag_source_get_type
gtk_tree_expander_get_type
gtk_tree_list_model_get_type
gtk_tree_list_row_get_type
gtk_tree_list_row_sorter_get_type
gtk_tree_model_filter_get_type
gtk_tree_model_get_type
gtk_tree_model_sort_get_type
gtk_tree_selection_get_type
gtk_tree_sortable_get_type
gtk_tree_store_get_type
gtk_tree_view_column_get_type
gtk_tree_view_get_type
gtk_video_get_type
gtk_viewport_get_type
gtk_volume_button_get_type
gtk_widget_get_type
gtk_widget_paintable_get_type
gtk_window_get_type
gtk_window_controls_get_type
gtk_window_group_get_type
gtk_window_handle_get_type

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg6843"
sodipodi:version="0.32"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
version="1.0"
sodipodi:docname="gtk-logo.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/ebassi/Pictures/gtk-logo-256.png"
inkscape:export-xdpi="192"
inkscape:export-ydpi="192">
<defs
id="defs6845">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-50 : 600 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="700 : 600 : 1"
inkscape:persp3d-origin="300 : 400 : 1"
id="perspective13" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284271"
inkscape:cx="69.874353"
inkscape:cy="64.313526"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:document-units="px"
inkscape:grid-bbox="true"
width="128px"
height="128px"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid7947" />
</sodipodi:namedview>
<metadata
id="metadata6848">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:date />
<dc:creator>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:rights>
<dc:publisher>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:publisher>
<dc:identifier />
<dc:source />
<dc:relation />
<dc:language />
<dc:subject>
<rdf:Bag />
</dc:subject>
<dc:coverage />
<dc:description />
<dc:contributor>
<cc:Agent>
<dc:title />
</cc:Agent>
</dc:contributor>
<cc:license
rdf:resource="" />
</cc:Work>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccccc"
id="path6976"
d="M 20.88413,30.82696 L 53.816977,55.527708 L 107.33282,39.060543 L 70.587303,17.177763 L 20.88413,30.82696 z"
style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6978"
d="M 22.94243,82.287118 L 20.88413,30.82696 L 53.816977,55.527708 L 53.816977,111.10486 L 22.94243,82.287118 z"
style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
id="path6980"
d="M 53.816977,111.10486 L 103.21619,90.5207 L 107.33282,39.060543 L 53.816977,55.527708 L 53.816977,111.10486 z"
style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
<path
sodipodi:nodetypes="ccc"
id="path6982"
d="M 23.216626,81.319479 L 70.48573,67.361442 L 103.38422,90.444516"
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path6984"
d="M 70.434539,17.875593 L 70.434539,66.984877"
style="opacity:1;fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,70 @@
----
Title: Initialization
----
# Library initialization and main loop
Before using GTK, you need to initialize it using [func@Gtk.init]; this
connects to the windowing system, sets up the locale and performs other
initialization tasks. [func@Gtk.init] exits the application if errors occur;
to avoid this, you can use [`func@Gtk.init_check`], which allows you to recover
from a failed GTK initialization; for instance, you might start up your
application in text mode instead.
Like most GUI toolkits, GTK uses an event-driven programming model. When the
application is doing nothing, GTK sits in the “main loop” and waits for input.
If the user performs some action - say, a mouse click - then the main loop
“wakes up” and delivers an event to GTK. GTK forwards the event to one or
more widgets.
When widgets receive an event, they frequently emit one or more “signals”.
Signals notify your program that "something interesting happened" by invoking
functions youve connected to the signal with `g_signal_connect()`. Functions
connected to a signal are often called “callbacks”.
When your callbacks are invoked, you would typically take some action - for
example, when an Open button is clicked you might display a [class@Gtk.FileChooserDialog].
After a callback finishes, GTK will return to the main loop and await more
user input.
### The `main()` function for a simple GTK application
```c
int
main (int argc, char **argv)
{
GtkWidget *window;
// Initialize i18n support with bindtextdomain(), etc.
// ...
// Initialize the widget set
gtk_init ();
// Create the main window
window = gtk_window_new ();
// Set up our GUI elements
// ...
// Show the application window
gtk_widget_show (window);
// Enter the main event loop, and wait for user interaction
while (!done)
g_main_context_iteration (NULL, TRUE);
// The user lost interest
return 0;
}
```
It's important to note that if you use [class@Gtk.Application], the
application class will take care of initializing GTK for you, as well
as spinning the main loop.
### See also
- the GLib manual, especially `GMainLoop`
- signal-related functions, such as `g_signal_connect()` in GObject

View File

@@ -1,4 +1,5 @@
# Overview of GTK input and event handling {#input-overview}
Title: Overview of GTK input and event handling
Slug: input-overview
This chapter describes in detail how GTK handles input. If you are interested
in what happens to translate a key press or mouse motion of the users into a
@@ -10,7 +11,7 @@ be useful if you decide to implement your own widgets.
The most basic input devices that every computer user has interacted with are
keyboards and mice; beyond these, GTK supports touchpads, touchscreens and
more exotic input devices such as graphics tablets. Inside GTK, every such
input device is represented by a #GdkDevice object.
input device is represented by a `GdkDevice` object.
To simplify dealing with the variability between these input devices, GTK
has a concept of logical and physical devices. The concrete physical devices that
@@ -29,9 +30,9 @@ These are typically directed at a specific surface - for pointer events,
the surface under the pointer (grabs complicate this), for keyboard events,
the surface with the keyboard focus.
GDK translates these raw windowing system events into #GdkEvents.
GDK translates these raw windowing system events into `GdkEvents`.
Typical input events are button clicks, pointer motion, key presses
or touch events. These are all represented as #GdkEvents, but you can
or touch events. These are all represented as `GdkEvents`, but you can
differentiate between different events by looking at their type, using
gdk_event_get_event_type().
@@ -40,12 +41,12 @@ are connected in to each other in an “event sequence” that
univocally identifies events that are related to the same
interaction.
When GTK creates a GdkSurface, it connects to the #GdkSurface::event
When GTK creates a `GdkSurface`, it connects to the ::event
signal on it, which receives all of these input events. Surfaces have
have signals and properties, e.g. to deal with window management
related events.
## Event propagation {#event-propagation}
## Event propagation
The function which initially receives input events on the GTK
side is responsible for a number of tasks.
@@ -56,7 +57,7 @@ side is responsible for a number of tasks.
3. Send the event to widgets.
An event is propagated down and up the widget hierarchy in three phases
(see #GtkPropagationPhase) towards a target widget.
towards a target widget.
![Event propagation phases](capture-bubble.png)
@@ -69,8 +70,8 @@ For pointer events, the target widget is determined by picking
the widget at the events coordinates (see gtk_widget_pick()).
In the first phase (the “capture” phase) the event is delivered to
each widget from the top-most (the top-level #GtkWindow or grab widget)
down to the target #GtkWidget.
each widget from the top-most (the top-level `GtkWindow` or grab widget)
down to the target widget.
[Event controllers](event-controllers-and-gestures) that are attached
with %GTK_PHASE_CAPTURE get a chance to react to the event.
@@ -94,12 +95,11 @@ below to learn more about gestures and sequences.
## Keyboard input
Every #GtkWindow maintains a single focus location (in
the #GtkWindow:focus-widget property). The focus widget is the
target widget for key events sent to the window. Only widgets which
have #GtkWidget:can-focus set to %TRUE can become the focus. Typically
these are input controls such as entries or text fields, but e.g.
buttons can take the focus too.
Every `GtkWindow` maintains a single focus location (in the :focus-widget
property). The focus widget is the target widget for key events sent to
the window. Only widgets which have :focusable set to %TRUE can become
the focus. Typically these are input controls such as entries or text
fields, but e.g. buttons can take the focus too.
Input widgets can be given the focus by clicking on them, but focus
can also be moved around with certain key events (this is known as
@@ -125,7 +125,7 @@ GTK has traditionally supported different kinds of shortcuts:
- Mnemonics are usually triggered using Alt as a modifier for a letter.
They are used in places where a label is associated with a control,
and are indicated by underlining the letter in the label. As a special
case, inside menus (i.e. inside #GtkPopoverMenu), mnemonics can be
case, inside menus (i.e. inside `GtkPopoverMenu`), mnemonics can be
triggered without the modifier.
- Key bindings are specific to individual widgets, such as Ctrl-C or
Ctrl-V in an entry copy to or paste from the clipboard. They are only
@@ -134,15 +134,15 @@ GTK has traditionally supported different kinds of shortcuts:
GTK handles accelerators and mnemonics in a global scope, during the
capture phase, and key bindings locally, during the target phase.
Under the hood, all shortcuts are represented as instances of #GtkShortcut,
and they are managed by #GtkShortcutController.
Under the hood, all shortcuts are represented as instances of `GtkShortcut`,
and they are managed by `GtkShortcutController`.
## Event controllers and gestures {#event-controllers-and-gestures}
## Event controllers and gestures
Event controllers are standalone objects that can perform
specific actions upon received #GdkEvents. These are tied
to a #GtkWidget, and can be told of the event propagation
phase at which they will manage the events.
specific actions upon received `GdkEvents`. These are tied
to a widget, and can be told of the event propagation phase
at which they will manage the events.
Gestures are a set of specific controllers that are prepared
to handle pointer and/or touch events, each gesture
@@ -167,10 +167,10 @@ gestures. Some examples of grouping may be:
- If “press” and “long press” are wanted simultaneously,
those would need grouping.
Shortcuts are handled by #GtkShortcutController, which is
Shortcuts are handled by `GtkShortcutController`, which is
a complex event handler that can either activate shortcuts
itself, or propagate them to another controller, depending
on its #GtkShortcutController:scope.
on its scope.
## Gesture states

View File

@@ -1,482 +1,13 @@
fs = import('fs')
private_headers = [
'gtkaccelgroupprivate.h',
'gtkaccelmapprivate.h',
'gtkaccessibleattributesetprivate.h',
'gtkaccessibleattributevalueprivate.h',
'gtkaccessibleprivate.h',
'gtkaccessiblevalueprivate.h',
'gtkactionhelperprivate.h',
'gtkactionmuxerprivate.h',
'gtkactionobservableprivate.h',
'gtkactionobserverprivate.h',
'gtkadjustmentprivate.h',
'gtkallocatedbitmaskprivate.h',
'gtkappchooserprivate.h',
'gtkapplicationaccelsprivate.h',
'gtkapplicationprivate.h',
'gtkatcontextprivate.h',
'gtkbindingsprivate.h',
'gtkbitmaskprivateimpl.h',
'gtkbitmaskprivate.h',
'gtkbuildableprivate.h',
'gtkbuilderprivate.h',
'gtkbuilderscopeprivate.h',
'gtkbuiltiniconprivate.h',
'gtkbuttonprivate.h',
'gtkcellareaboxcontextprivate.h',
'gtkcheckbuttonprivate.h',
'gtkcolorchooserprivate.h',
'gtkcoloreditorprivate.h',
'gtkcolorpickerkwinprivate.h',
'gtkcolorpickerportalprivate.h',
'gtkcolorpickerprivate.h',
'gtkcolorpickershellprivate.h',
'gtkcolorplaneprivate.h',
'gtkcolorscaleprivate.h',
'gtkcolorswatchprivate.h',
'gtkcolumnlistitemfactoryprivate.h',
'gtkcolumnviewcellprivate.h',
'gtkcolumnviewcolumnprivate.h',
'gtkcolumnviewlayoutprivate.h',
'gtkcolumnviewprivate.h',
'gtkcolumnviewsorterprivate.h',
'gtkcolumnviewtitleprivate.h',
'gtkcomboboxprivate.h',
'gtkcomposetable.h',
'gtkconstraintexpressionprivate.h',
'gtkconstraintguideprivate.h',
'gtkconstraintlayoutprivate.h',
'gtkconstraintprivate.h',
'gtkconstraintsolverprivate.h',
'gtkconstrainttypesprivate.h',
'gtkconstraintvflparserprivate.h',
'gtkcountingbloomfilterprivate.h',
'gtkcssanimatedstyleprivate.h',
'gtkcssanimationprivate.h',
'gtkcssarrayvalueprivate.h',
'gtkcssbgsizevalueprivate.h',
'gtkcssbordervalueprivate.h',
'gtkcssboxesimplprivate.h',
'gtkcssboxesprivate.h',
'gtkcsscalcvalueprivate.h',
'gtkcsscolorvalueprivate.h',
'gtkcsscornervalueprivate.h',
'gtkcssdataurlprivate.h',
'gtkcssdimensionvalueprivate.h',
'gtkcssdynamicprivate.h',
'gtkcsseasevalueprivate.h',
'gtkcssenumvalueprivate.h',
'gtkcssfiltervalueprivate.h',
'gtkcssfontfeaturesvalueprivate.h',
'gtkcssfontvariationsvalueprivate.h',
'gtkcssiconthemevalueprivate.h',
'gtkcssimageconicprivate.h',
'gtkcssimagecrossfadeprivate.h',
'gtkcssimagefallbackprivate.h',
'gtkcssimageiconthemeprivate.h',
'gtkcssimageinvalidprivate.h',
'gtkcssimagelinearprivate.h',
'gtkcssimagepaintableprivate.h',
'gtkcssimageprivate.h',
'gtkcssimageradialprivate.h',
'gtkcssimagerecolorprivate.h',
'gtkcssimagescaledprivate.h',
'gtkcssimageurlprivate.h',
'gtkcssimagevalueprivate.h',
'gtkcssimagewin32private.h',
'gtkcssinheritvalueprivate.h',
'gtkcssinitialvalueprivate.h',
'gtkcsskeyframesprivate.h',
'gtkcsslocationprivate.h',
'gtkcsslookupprivate.h',
'gtkcssmatcherprivate.h',
'gtkcssnodedeclarationprivate.h',
'gtkcssnodeprivate.h',
'gtkcssnodestylecacheprivate.h',
'gtkcssnumbervalueprivate.h',
'gtkcsspalettevalueprivate.h',
'gtkcssparserprivate.h',
'gtkcsspathnodeprivate.h',
'gtkcsspositionvalueprivate.h',
'gtkcssproviderprivate.h',
'gtkcssrepeatvalueprivate.h',
'gtkcssrgbavalueprivate.h',
'gtkcsssectionprivate.h',
'gtkcssselectorprivate.h',
'gtkcssserializerprivate.h',
'gtkcssshadowsvalueprivate.h',
'gtkcssshadowvalueprivate.h',
'gtkcssshorthandpropertyprivate.h',
'gtkcssstaticstyleprivate.h',
'gtkcssstringvalueprivate.h',
'gtkcssstylechangeprivate.h',
'gtkcssstyleprivate.h',
'gtkcssstylepropertyprivate.h',
'gtkcsstokenizerprivate.h',
'gtkcsstransformvalueprivate.h',
'gtkcsstransientnodeprivate.h',
'gtkcsstransitionprivate.h',
'gtkcsstypesprivate.h',
'gtkcssunsetvalueprivate.h',
'gtkcssvalueprivate.h',
'gtkcsswidgetnodeprivate.h',
'gtkcsswin32sizevalueprivate.h',
'gtkdialogprivate.h',
'gtkdragdestprivate.h',
'gtkdropprivate.h',
'gtkemojicompletion.h',
'gtkentryprivate.h',
'gtkeventcontrollerlegacyprivate.h',
'gtkeventcontrollerprivate.h',
'gtkfilechoosererrorstackprivate.h',
'gtkfilechoosernativeprivate.h',
'gtkfilechooserprivate.h',
'gtkfilechooserwidgetprivate.h',
'gtkfilefilterprivate.h',
'gtkflowboxprivate.h',
'gtkfontchooserprivate.h',
'gtkfontchooserwidgetprivate.h',
'gtkgesturedragprivate.h',
'gtkgesturelongpressprivate.h',
'gtkgesturemultipressprivate.h',
'gtkgesturepanprivate.h',
'gtkgestureprivate.h',
'gtkgesturerotateprivate.h',
'gtkgesturesingleprivate.h',
'gtkgesturestylusprivate.h',
'gtkgestureswipeprivate.h',
'gtkgesturezoomprivate.h',
'gtkgizmoprivate.h',
'gtkheaderbarprivate.h',
'gtkhslaprivate.h',
'gtkiconcacheprivate.h',
'gtkiconcachevalidatorprivate.h',
'gtkiconhelperprivate.h',
'gtkiconprivate.h',
'gtkiconthemeprivate.h',
'gtkiconviewprivate.h',
'gtkimagedefinitionprivate.h',
'gtkimageprivate.h',
'gtkimcontextbroadway.h',
'gtkimcontextime.h',
'gtkimcontextquartz.h',
'gtkimcontextsimpleprivate.h',
'gtkimcontextsimpleseqs.h',
'gtkimcontextwayland.h',
'gtkimmoduleprivate.h',
'gtkimmodule.h',
'gtkintl.h',
'gtkistringprivate.h',
'gtkkineticscrollingprivate.h',
'gtklabelprivate.h',
'gtklayoutmanagerprivate.h',
'gtklistbaseprivate.h',
'gtklistitemprivate.h',
'gtklistitemfactoryprivate.h',
'gtklistitemmanagerprivate.h',
'gtklistitemwidgetprivate.h',
'gtklistlistmodelprivate.h',
'gtklockbuttonprivate.h',
'gtkmagnifierprivate.h',
'gtkmediafileprivate.h',
'gtkmenubuttonprivate.h',
'gtkmenusectionboxprivate.h',
'gtkmenutrackeritemprivate.h',
'gtkmenutrackerprivate.h',
'gtkmodelbuttonprivate.h',
'gtkmodulesprivate.h',
'gtkmountoperationprivate.h',
'gtknativedialogprivate.h',
'gtknativeprivate.h',
'gtknomediafileprivate.h',
'gtkpango.h',
'gtkpasswordentrybufferprivate.h',
'gtkpasswordentryprivate.h',
'gtkpathbar.h',
'gdkpixbufutilsprivate.h',
'gtkplacessidebarprivate.h',
'gtkplacesviewprivate.h',
'gtkplacesviewrowprivate.h',
'gtkpointerfocusprivate.h',
'gtkpopcountprivate.h',
'gtkpopovermenubarprivate.h',
'gtkpopovermenuprivate.h',
'gtkpopoverprivate.h',
'gtkprintbackendprivate.h',
'gtkprinterprivate.h',
'gtkprintoperation-portal.h',
'gtkprintoperation-private.h',
'gtkprintutils.h',
'gtkprivate.h',
'gtkprogresstrackerprivate.h',
'gtkpropertylookuplistmodelprivate.h',
'gtkquery.h',
'gtkrangeprivate.h',
'gtkrbtreeprivate.h',
'gtkrenderbackgroundprivate.h',
'gtkrenderborderprivate.h',
'gtkrendericonprivate.h',
'gtkrendernodepaintableprivate.h',
'gtkrootprivate.h',
'gtkroundedboxprivate.h',
'gtkscalerprivate.h',
'gtksearchengine.h',
'gtksearchenginemodel.h',
'gtksearchenginequartz.h',
'gtksearchenginetracker3.h',
'gtksearchentryprivate.h',
'gtksecurememoryprivate.h',
'gtksettingsprivate.h',
'gtkshortcutactionprivate.h',
'gtkshortcutcontrollerprivate.h',
'gtkshortcutmanagerprivate.h',
'gtkshortcutsshortcutprivate.h',
'gtkshortcutswindowprivate.h',
'gtksidebarrowprivate.h',
'gtksizegroup-private.h',
'gtksizerequestcacheprivate.h',
'gtksnapshotprivate.h',
'gtksorterprivate.h',
'gtksortkeysprivate.h',
'gtkspinbuttonprivate.h',
'gtkstyleanimationprivate.h',
'gtkstylecascadeprivate.h',
'gtkstylecontextprivate.h',
'gtkstylepropertyprivate.h',
'gtkstyleproviderprivate.h',
'gtktestatcontextprivate.h',
'gtktextattributes.h',
'gtktextbufferprivate.h',
'gtktextchildprivate.h',
'gtktextdisplayprivate.h',
'gtktexthandleprivate.h',
'gtktexthistoryprivate.h',
'gtktextiterprivate.h',
'gtktextlayoutprivate.h',
'gtktextlinedisplaycacheprivate.h',
'gtktextmarkprivate.h',
'gtktextprivate.h',
'gtktextsegment.h',
'gtktexttagprivate.h',
'gtktextutil.h',
'gtktextviewchildprivate.h',
'gtktextviewprivate.h',
'gtktogglebuttonprivate.h',
'gtktoolbarprivate.h',
'gtktooltipprivate.h',
'gtktooltipwindowprivate.h',
'gtktreedatalist.h',
'gtktreepopoverprivate.h',
'gtktreeprivate.h',
'gtktreerbtreeprivate.h',
'gtkutilsprivate.h',
'gtkwidgetpaintableprivate.h',
'gtkwidgetpathprivate.h',
'gtkwidgetprivate.h',
'gtkwin32drawprivate.h',
'gtkwin32themeprivate.h',
'gtkwindowprivate.h',
'gsettings-mapping.h',
'gskpango.h',
'gtkdbusgenerated.h',
'imm-extra.h',
'language-names.h',
'open-type-layout.h',
'script-names.h',
'text-input-unstable-v3-client-protocol.h',
'a11y',
'inspector',
'roaring',
'timsort',
'tools',
]
images = [
'images/aboutdialog.png',
'images/action-bar.png',
'images/appchooserbutton.png',
'images/appchooserdialog.png',
'images/arrows.png',
'images/assistant.png',
'images/background.png',
'images/bloatpad-gnome.png',
'images/bloatpad-osx.png',
'images/bloatpad-xfce.png',
'images/border1.png',
'images/border2.png',
'images/border3.png',
'images/box.png',
'images/box-expand.png',
'images/box-packing.png',
'images/builder-shortcuts.png',
'images/button.png',
'images/calendar.png',
'images/capture-bubble.png',
'images/centerbox.png',
'images/check-button.png',
'images/checks.png',
'images/clocks-shortcuts.png',
'images/color-button.png',
'images/colorchooser.png',
'images/combo-box-entry.png',
'images/combo-box.png',
'images/combo-box-text.png',
'images/down-center.png',
'images/down-end.png',
'images/down-start.png',
'images/drop-down.png',
'images/drawing.png',
'images/drawingarea.png',
'images/ease-in-out.png',
'images/ease-in.png',
'images/ease-out.png',
'images/ease.png',
'images/editable-label.png',
'images/emojichooser.png',
'images/entry.png',
'images/exampleapp.png',
'images/expanders.png',
'images/expander.png',
'images/extensions.png',
'images/figure-hierarchical-drawing.png',
'images/figure-windowed-label.png',
'images/file-button.png',
'images/filechooser.png',
'images/flow-box.png',
'images/focus.png',
'images/font-button.png',
'images/fontchooser.png',
'images/frame-gap.png',
'images/frame.png',
'images/frames.png',
'images/gedit-shortcuts.png',
'images/getting-started-app10.png',
'images/getting-started-app1.png',
'images/getting-started-app2.png',
'images/getting-started-app3.png',
'images/getting-started-app4.png',
'images/getting-started-app6.png',
'images/getting-started-app7.png',
'images/getting-started-app8.png',
'images/getting-started-app9.png',
'images/glarea.png',
'images/gradient1.png',
'images/gradient2.png',
'images/gradient3.png',
'images/gradient4.png',
'images/grid.png',
'images/grid-packing.png',
'images/handles.png',
'images/headerbar.png',
'images/hello-world.png',
'images/icon-view.png',
'images/image.png',
'images/info-bar.png',
'images/inspector.png',
'images/label.png',
'images/layout-btlr.png',
'images/layout-btrl.png',
'images/layout-lrbt.png',
'images/layout-lrtb.png',
'images/layout-rlbt.png',
'images/layout-rltb.png',
'images/layout-tblr.png',
'images/layout-tbrl.png',
'images/left-center.png',
'images/left-end.png',
'images/left-start.png',
'images/levelbar.png',
'images/linear.png',
'images/link-button.png',
'images/list-and-tree.png',
'images/list-box.png',
'images/lockbutton-locked.png',
'images/lock-button.png',
'images/lockbutton.png',
'images/lockbutton-sorry.png',
'images/lockbutton-unlocked.png',
'images/media-controls.png',
'images/menu.png',
'images/menubar.png',
'images/menu-button.png',
'images/messagedialog.png',
'images/multiline-text.png',
'images/notebook.png',
'images/options.png',
'images/overlay.png',
'images/pagesetupdialog.png',
'images/panes.png',
'images/password-entry.png',
'images/picture.png',
'images/popover.png',
'images/popup-anchors.png',
'images/popup-at.svg',
'images/popup-flip.png',
'images/popup-slide.png',
'images/printdialog.png',
'images/progressbar.png',
'images/right-center.png',
'images/right-end.png',
'images/right-start.png',
'images/scales.png',
'images/scrollbar.png',
'images/scrolledwindow.png',
'images/search-bar.png',
'images/search-entry.png',
'images/separator.png',
'images/shortcuts-window.png',
'images/sidebar.png',
'images/slices.png',
'images/sliders.png',
'images/spinbutton.png',
'images/spinner.png',
'images/stack.png',
'images/stackswitcher.png',
'images/statusbar.png',
'images/switch.png',
'images/toggle-button.png',
'images/toolbar.png',
'images/tree-view-coordinates.png',
'images/up-center.png',
'images/up-end.png',
'images/up-start.png',
'images/video.png',
'images/volumebutton.png',
'images/widget-hvalign.png',
'images/windowcontrols.png',
'images/window-default.png',
'images/window.png',
'images/rich-list.png',
'images/data-table.png',
'images/navigation-sidebar.png'
]
content_files = [
'gtk4-broadwayd.xml',
'gtk4-builder-tool.xml',
'gtk4-demo-application.xml',
'gtk4-demo.xml',
'gtk4-encode-symbolic-svg.xml',
'gtk4-icon-browser.xml',
'gtk4-launch.xml',
'gtk4-query-settings.xml',
'gtk4-update-icon-cache.xml',
'gtk4-widget-factory.xml',
'overview.xml',
'visual_index.xml',
]
# XXX: gi-docgen needs a deps file
expand_content_md_files = [
'overview.md',
'broadway.md',
'osx.md',
'wayland.md',
'windows.md',
'x11.md',
'getting_started.md',
'initialization.md',
'resources.md',
'building.md',
'compiling.md',
@@ -493,69 +24,31 @@ expand_content_md_files = [
'section-tree-widget.md',
'section-list-widget.md',
'question_index.md',
'visual_index.md'
]
types_conf = configuration_data()
if os_win32
types_conf.set('DISABLE_ON_W32', '%')
else
types_conf.set('DISABLE_ON_W32', '')
endif
if os_darwin
types_conf.set('DISABLE_ON_QUARTZ', '%')
else
types_conf.set('DISABLE_ON_QUARTZ', '')
endif
gtk4_toml = configure_file(input: 'gtk4.toml.in', output: 'gtk4.toml', configuration: toml_conf)
if get_option('gtk_doc')
configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
# gtk-markdown-to-docbook uses pandoc
pandoc = find_program('pandoc', required: true)
expand_md = find_program('gtk-markdown-to-docbook')
expand_md_targets = []
foreach t : expand_content_md_files
expand_md_targets += custom_target(t,
input: [ t ],
output: [ fs.replace_suffix(t, '.xml') ],
command: [ expand_md, '@INPUT@', '@OUTPUT@'],
)
endforeach
gnome.gtkdoc('gtk4',
mode: 'none',
main_xml: 'gtk4-docs.xml',
src_dir: [
gtkinc,
custom_target('gtk4-doc',
input: [ gtk4_toml, gtk_gir[0] ],
output: 'gtk4',
command: [
gidocgen,
'generate',
'--quiet',
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
dependencies: libgtk_dep,
gobject_typesfile: configure_file(
input: 'gtk4.types.in',
output: 'gtk4.types',
configuration: types_conf,
),
scan_args: [
'--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(private_headers),
],
mkdb_args: [
'--default-includes=gtk/gtk.h',
'--ignore-files=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
'--extra-dir=@0@'.format(cairo_docpath),
'--extra-dir=@0@'.format(gdkpixbuf_docpath),
'--extra-dir=../gdk',
'--extra-dir=../gsk',
],
content_files: content_files + expand_md_targets,
html_assets: images,
depends: [ gdk_gir[0], gsk_gir[0] ],
depend_files: [ expand_content_md_files ],
build_by_default: true,
install: true,
install_dir: docs_dir,
)
endif

View File

@@ -1,4 +1,5 @@
# Migrating from GTK 2.x to GTK 4 {#gtk-migrating-2-to-4}
Title: Migrating from GTK 2.x to GTK 4
Slug: gtk-migrating-2-to-4
If your application is still using GTK 2, you should first convert it to GTK 3,
by following the [migration guide](https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html)

Some files were not shown because too many files have changed in this diff Show More