Compare commits

...

249 Commits

Author SHA1 Message Date
Matthias Clasen 805f3bb123 vulkan: Give up on VkResult
This enumeration is not managed in a sane way.
Just report the numbers.
2020-12-28 19:04:35 -05:00
Benjamin Otte 0fcf01ddd5 Merge branch 'gtkmediafile-pixel-aspect-ratio' into 'master'
gtkmediafile: Consider pixel-aspect-ratio for rendering video with the correct aspect ratio

Closes #3516

See merge request GNOME/gtk!3007
2020-12-28 14:54:30 +00:00
Asier Sarasua Garmendia 1119a74ff0 Update Basque translation 2020-12-27 17:56:02 +00:00
Sebastian Dröge 18ea60e235 gtkmediafile: Consider pixel-aspect-ratio for rendering video with the correct aspect ratio
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3516
2020-12-27 19:33:55 +02:00
Matthias Clasen d752828977 Merge branch 'wip/jtojnar/trivial-fix-pc-vulcan' into 'master'
build: Fix vulkan reference in pc file

Closes #3517

See merge request GNOME/gtk!3006
2020-12-27 17:06:52 +00:00
Fran Dieguez 1034271d9a Update Galician translation 2020-12-27 16:56:56 +00:00
Fran Dieguez f013d3b5d6 Update Galician translation 2020-12-27 16:51:38 +00:00
Benjamin Otte 5f41d26abc Merge branch 'gtkgstsink-unmap-only-when-done' into 'master'
gtkmediafile: Only unmap the GstVideoFrame in the GBytes destroy notify

See merge request GNOME/gtk!3003
2020-12-27 06:17:36 +00:00
Jan Tojnar 7d5826ccf7 build: Fix vulkan reference in pc file
A mistake in string concatenation caused the vulcan dependency to be omitted.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3517
2020-12-27 06:42:29 +01:00
Matthias Clasen daded2bc86 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!3004
2020-12-27 05:21:26 +00:00
Matthias Clasen bc7619abaf Merge branch 'gtkclip' into 'master'
gtk: remove GtkClipboard leftovers

See merge request GNOME/gtk!2991
2020-12-27 04:32:26 +00:00
Matthias Clasen 459d6e1349 Merge branch 'wip/carlosg/for-master' into 'master'
gtk/gesturestylus: Convert motion history from surface coordinates

Closes #3491

See merge request GNOME/gtk!2999
2020-12-27 04:30:38 +00:00
Sebastian Dröge 6e108d310a gtkmediafile: Only unmap the GstVideoFrame in the GBytes destroy notify
The memory pointed to by GstVideoFrame::plane_data becomes invalid after
unmapping causing the GBytes to point at some random memory if the
unmapping is not deferred until its destroy notify.

When the GStreamer buffer is backed by normal system memory this is not
a problem but if it is backed by e.g. an OpenGL texture, dmabuf or some
other hardware-specific memory this will otherwise cause interesting
problems.
2020-12-26 14:26:23 +02:00
Benjamin Otte 9c84fa127a Merge branch 'unused-static-inline' into 'master'
Remove unused static inline function

See merge request GNOME/gtk!3002
2020-12-25 18:05:11 +00:00
Emmanuel Gil Peyrot 84c6708366 Remove unused static inline function
This was causing a warning on AArch64 since __LITTLE_ENDIAN__ and
__BIG_ENDIAN__ weren’t set, but the functions were actually completely
unused.
2020-12-25 16:16:43 +01:00
Benjamin Otte f7e3016949 Merge branch 'gles-gears' into 'master'
Fix gtk4-demo’s gears demo on OpenGL ES

See merge request GNOME/gtk!3000
2020-12-25 01:36:34 +00:00
Emmanuel Gil Peyrot dd1110ca5c Fix some of gtk4-demo’s transitions example on OpenGL ES
Same issue as the previous commit, int+float is error, and pow() only
works on floats.
2020-12-25 01:36:21 +01:00
Emmanuel Gil Peyrot 28c4adac24 Fix gtk4-demo’s gears demo on OpenGL ES
Here is a command to reproduce this testcase:
GDK_DEBUG=gl-gles gtk4-demo --run gears

Without this patch, Mesa throws this compile error:
0:130(13): error: no matching function for call to `mod(error, float)'; candidates are:

This is caused by `u_rotation - 90` being of type error since
`u_rotation` is a float and it’s illegal to subtract it with an integer.
2020-12-25 01:21:08 +01:00
Carlos Garnacho cf20cfd31e gtk/gesturestylus: Convert motion history from surface coordinates
Motion history coordinates are based on GdkSurface coordinates. Transform
the coordinates from the GtkNative they are received on, accounting for the
possible transforms (e.g. due to window borders and shadows).

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3491
2020-12-24 19:59:51 +01:00
Matthias Clasen 7e579bb59a Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!2997
2020-12-24 07:13:22 +00:00
Benjamin Otte 96e1b85c2c gdkarray: Add a "stolen" boolean to splice()
If set to TRUE, does not call the free func for the removed items.

This can be used to move items between arrays without having to do the
refcounting dance.
2020-12-24 06:38:45 +01:00
Benjamin Otte 71e616d17e listview: Use the correct scroll policy
Use the horizontal policy for horizontal decisions, not the vertical
one.

This broke in 0011ce949c.
2020-12-24 06:38:45 +01:00
Benjamin Otte f85d939e5e docs: Put render nodes in their own sections 2020-12-24 06:38:45 +01:00
Benjamin Otte 8d014d6cb0 roundedbox: Remove unused API 2020-12-24 06:38:45 +01:00
Benjamin Otte f7f8990f7a picture: Fix copy/paste error in docs 2020-12-24 06:38:45 +01:00
Benjamin Otte d6f288427a video: When autoplaying, start playing once the video is prepared
This fixe video sources with longer loading times not automatically
playing.
2020-12-24 06:38:45 +01:00
Benjamin Otte 2a8f371643 gtk-demo: Don't put the search bar in the scroll area
1. That's a bad idea UI wise as you can't see the search after you
   scrolled.

2. That's a bad idea code-wise because Listviews need to be put into
   a ScrolledWindow or they won't scroll.
2020-12-24 06:38:45 +01:00
Benjamin Otte dee863dbb2 rendernode: Bail if matrix is invalid
Invalid matrices are okay in GSK (and GL), but not in Cairo.

Testcase included.
2020-12-24 06:38:45 +01:00
A S Alam 7d6877ec80 Update Punjabi translation 2020-12-23 19:48:28 +00:00
Danial Behzadi f426d23690 Update Persian translation 2020-12-23 15:53:07 +00:00
Matthias Clasen 6bd0dc3e78 colorbutton: Correct the css docs
Mention the wrapper colorbutton node.
2020-12-23 09:03:07 -05:00
Matthias Clasen 4f0c920a8e fontbutton: Correct the css docs
Mention the wrapper fontbutton node.
2020-12-23 08:59:58 -05:00
Matthias Clasen b0b793dd94 menubutton: Correct the css docs
We are using menubutton instead of button.popup now.
2020-12-23 08:56:18 -05:00
Matthias Clasen efbb649eee modelbutton: Center titles
The centering of titles was broken in b5b81dea7f.
Make it mostly work again by adding an empty end indicator.

Related: #3405
2020-12-23 00:51:51 -05:00
Matthias Clasen e128a77eed Merge branch 'matthiasc/for-master' into 'master'
window: Release application in destroy

See merge request GNOME/gtk!2994
2020-12-23 03:01:55 +00:00
Matthias Clasen 5cd2ee927a window: Release application in destroy
We used to do this; it was lost in some life-cycle
reshuffling.
2020-12-22 20:34:13 -05:00
Marc-André Lureau 90dfb5e138 gtk: remove GtkClipboard leftovers
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-12-22 16:39:54 +04:00
Matthias Clasen e854b90293 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!2990
2020-12-22 04:53:31 +00:00
Matthias Clasen 6d042d9e61 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2988
2020-12-22 02:29:03 +00:00
Matthias Clasen 4310f24a4e Fix warnings with Vulkan < 162
Tiring to watch the Vulkan people stumble through
ABI and API compat, but what can you do.
2020-12-21 20:00:16 -05:00
Matthias Clasen aebf8e3c29 Merge branch 'mcatanzaro/fix-gtk-builder-tool' into 'master'
Fix buffer overruns in 'gtk-builder-tool simplify'

See merge request GNOME/gtk!2987
2020-12-21 22:49:42 +00:00
Matthias Clasen fcd449f0d4 modelbutton: Remove an unused field
We're not using the centered field anymore.
2020-12-21 17:45:01 -05:00
Michael Catanzaro ab1b117d91 Fix buffer overruns in 'gtk-builder-tool simplify'
Oops, here we allocate only one byte for each pointer we want to store.
We need to multiply by the size of a pointer.
2020-12-21 15:39:34 -06:00
Emmanuele Bassi 1253296387 Merge branch 'fix-printbackends' into 'master'
Fix the value for the print-backends setting

Closes #3486

See merge request GNOME/gtk!2986
2020-12-21 20:04:26 +00:00
Matthias Clasen 466484176f Merge branch 'ebassi/docs-for-master' into 'master'
Ebassi/docs for master

See merge request GNOME/gtk!2983
2020-12-21 19:22:38 +00:00
Matthias Clasen 20289ad8e1 Fix the value for the print-backends setting
This was broken in the meson conversion, causing
us to default to "" instead of the built print
backends.

Fixes: #3486
2020-12-21 14:10:03 -05:00
Matthias Clasen 0abb8c6862 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2984
2020-12-21 19:00:10 +00:00
Matthias Clasen 147386189f inspector: Show glyphs as in node files
Reuse the glyph serialization code from gsk to
show glyphs in the same way here.
2020-12-21 13:11:46 -05:00
Matthias Clasen 9cec9e4ce2 gsk: Export the glyph serialization privately
We want to use the same serialization in the inspector,
so export this function.
2020-12-21 13:11:08 -05:00
Matthias Clasen 26119af7a6 gsk: Improve glyph serialization
The special case for ASCII glyphs is unfortunately not
working very well, because of an oversight in pango:
When I added subpixel positioning, I made pango_shape()
default to not rounding, and make PangoLayout call
pango_shape_with_flags() and pass the rounding information
down. The upshot is that we need to use the _with_flags
variant here and tell it to round position, so it matches
what the text node contains.
2020-12-21 13:08:34 -05:00
Timm Bäder 478d1f71e3 Merge branch 'fix-node-glyphs' into 'master'
gsk: Fix serialization of glyphs

Closes #3496

See merge request GNOME/gtk!2982
2020-12-21 17:16:38 +00:00
Emmanuele Bassi b1d952b8a2 docs: Add examples for GtkDropTarget
Like we did for GtkDragSource.
2020-12-21 17:11:42 +00:00
Emmanuele Bassi b9bcdbbfdc docs: Add examples of GtkDragSource use
The description is a bit terse; we should help out application
developers some more.
2020-12-21 17:03:59 +00:00
Emmanuele Bassi 6c31ed53f4 docs: Fix typo and whitespace 2020-12-21 17:03:42 +00:00
Matthias Clasen aa95ae774f gsk: Fix serialization of glyphs
We were forgetting to put a space between two numbers
in some cases, confusing the parser.

Test included.

Fixes: #3496
2020-12-21 10:49:56 -05:00
Emmanuele Bassi 65adfd9243 Merge branch 'box_docs' into 'master'
box: improve documentation

Closes #3499

See merge request GNOME/gtk!2981
2020-12-21 15:40:07 +00:00
Yetizone c4a8c0893b box: improve documentation
Rephrase a function parameter description and remove "." from all function parameters descriptions

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3499
2020-12-21 17:26:23 +02:00
Timm Bäder e90f5e8a20 gskpango: Don't copy fg color
No need to do that here, we copy it in to the individual render nodes
anyway.
2020-12-21 15:23:25 +01:00
Timm Bäder 526c76181e gl renderer: Check for pointer equality in rounded_rect_equal 2020-12-21 15:22:08 +01:00
Timm Bäder cf352374ae gskpango: Correct a comment
Not all other draw calls will use cairo.
2020-12-21 13:23:28 +01:00
Timm Bäder 98b99201b0 gskpango: Remove bounds rect
We only need this to render shapes and trapezoids, i.e. only when
falling back to cairo. Remove code to measure the layout and convert the
ink_rect to a graphene_rect_t from gtk_snapshot_append_layout() and do
it when drawing shapes and trapezoids instead.
2020-12-21 12:56:38 +01:00
Timm Bäder bce4d669ee gskpango: Fix a potential cairo_t leak
The previous early return did not cairo_destroy() it.
2020-12-21 12:49:06 +01:00
Timm Bäder e7a326e230 label: Refactor get_layout_location()
Rename a few local variables to be clearer about whether they belong to
the widget or to the layout.

Remove a workaround for an old bug that is no longer valid. We don't
underallocate the layout anymore. Aways center vertically, with respect
to the yalign.
2020-12-21 12:44:01 +01:00
Timm Bäder 9eaeaa8452 label: Refactor snapshot()
Use two early-out style if statements to reduce indentation in this
entire function.
2020-12-21 12:32:32 +01:00
Timm Bäder 2031c5bf90 textlayout: Remove dead offset_y code 2020-12-21 10:26:03 +01:00
Timm Bäder 9fefa7b44c rendernode: Different uniformity in border nodes
Means they are different and a diff is impossible.
2020-12-21 10:26:03 +01:00
Timm Bäder a2a70c3b65 rendernode: Sort diff() requirements by complexity 2020-12-21 10:26:03 +01:00
Timm Bäder 0b4ed8d791 renderborder: Avoid 0 width outline color nodes 2020-12-21 10:26:03 +01:00
Timm Bäder c34f98931e layoutoverlay: Avoid adding transparent color nodes
We have a region for the border here, but the color is defined as
transparent black because we don't want to render anything for it.

This way, the generated .node file for the listbox demo in gtk4-demo
with enabled layout borders is 3.5MB instead of 3.8MB.
2020-12-21 10:26:03 +01:00
Timm Bäder 2feac2772f layoutoverlay: Avoid adding 0 sized color nodes
This way, the output node file of the listbox demo in gtk4-demo with
enabled layout borders is only 3.8MB instead of 12MB.
2020-12-21 10:26:03 +01:00
Timm Bäder fdda4e4e99 GskTransform: Add nullable annotations to _equals()
Both can be NULL here.
2020-12-21 10:26:03 +01:00
Timm Bäder e1cf0cff26 gl renderer: Proper state tracking for color matrix ops 2020-12-21 10:26:03 +01:00
Timm Bäder 634fa772c9 gl renderer: Add missing debug output for repeat ops 2020-12-21 10:26:03 +01:00
Timm Bäder 4b3bbe0ecd gl renderer: Create shader-global uniform ops on draw()
This way we can render the first frame of tests/testoutsetshadowdrawing
in 153 ops instead of 183.

And the first frame of gtk4-demo in 260 instead of 300.
2020-12-21 10:26:03 +01:00
Timm Bäder cde43541d0 gl renderer: Unify new clip/viewport rects in blur_texture() 2020-12-21 10:26:03 +01:00
Timm Bäder 186287ecfb GskTransform: Fix identity transform class name 2020-12-21 10:26:02 +01:00
Timm Bäder bd5d1615ac GskTransform: Avoid a ref+unref pair
If gsk_transform_is_identity() returned FALSE for the next transform,
the previous code did a ref + unref pair, even though it was unneeded.
2020-12-21 10:26:02 +01:00
Timm Bäder 21299cc7e4 icontheme: Make some constant values const 2020-12-21 10:26:02 +01:00
Timm Bäder e747ea7dfd pixbufutils: Only convert icon size to string once 2020-12-21 10:26:02 +01:00
Timm Bäder 810cd7881e icontheme: Make icon_paintable_ensure_texture() return an unowned value
It's private, has only one caller and that one doesn't need the extra
ref.
2020-12-21 10:26:02 +01:00
Timm Bäder a8213d7f45 gl renderer: Avoid setting modelview to identical values
The previous comment here was incorrect. We can save the op itself, we
just can't save us the entry in the modelview stack.
2020-12-21 10:26:02 +01:00
Timm Bäder e6f6d1e478 main: Add & use gdk_event_dup_axes()
The way this code is written trips up scan-build. Add
gdk_event_dup_axes() and use it in gtkmain.c.
2020-12-21 10:26:02 +01:00
Rafael Fontenelle 933d241bba Update Brazilian Portuguese translation 2020-12-21 07:02:13 +00:00
Matthias Clasen 7249c3a09b Merge branch 'ebassi/issue-3495' into 'master'
Use full path when calling gtk4-update-icon-cache

Closes #3495

See merge request GNOME/gtk!2979
2020-12-20 22:40:48 +00:00
Emmanuele Bassi d13f8ac3a9 Call the newly installed gtk4-update-icon-cache
Otherwise we rely on whatever it's inside the PATH.
2020-12-20 16:33:41 +00:00
Emmanuele Bassi fa35e3b874 Pass the bindir to the post-install script 2020-12-20 16:33:25 +00:00
Rafael Fontenelle 853883c6e5 Update Brazilian Portuguese translation 2020-12-20 14:06:52 +00:00
sicklylife b467279c7d Update Japanese translation 2020-12-20 08:03:00 +00:00
sicklylife c6a5ac1d16 Update Japanese translation 2020-12-20 07:58:09 +00:00
A S Alam e41288de4f Update Punjabi translation 2020-12-20 06:14:42 +00:00
Jordi Mas i Hernandez b886988a54 Update Catalan translation 2020-12-19 18:29:08 +00:00
Matthias Clasen bb8a459fe2 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2978
2020-12-19 17:20:39 +00:00
Matthias Clasen d5143a1bf0 Revert "gl renderer: Render too big textures to the clipped area"
This reverts commit 7f6608cbed.
2020-12-19 11:43:56 -05:00
Matthias Clasen 12611fa142 Revert "gl renderer: Take a out graphene_rect in blur_node()"
This reverts commit 7eece7e769.
2020-12-19 11:43:43 -05:00
Matthias Clasen 3e319b409b Merge branch 'ebassi/issue-3492' into 'master'
3to4: Remove GtkCheckButton:draw-indicator

Closes #3492

See merge request GNOME/gtk!2976
2020-12-19 16:41:14 +00:00
Emmanuele Bassi f2b16836c2 3to4: Add test for GtkCheckButton:draw-indicator removal 2020-12-19 15:52:22 +00:00
Emmanuele Bassi 14bf45a0d5 3to4: Remove GtkCheckButton:draw-indicator
The property was removed from the widget, so we need to remove it from
UI files too.

Fixes: #3492
2020-12-18 23:14:24 +00:00
Timm Bäder 0c6a6b3370 Merge branch 'doc_backticks' into 'master'
docs: backtick fixes

See merge request GNOME/gtk!2975
2020-12-18 15:57:30 +00:00
wisp3rwind 9521f609d8 docs: backtick fixes
- in the gettext() examples, at least the _() triggers italics
- add missing closing backtick
2020-12-18 16:31:41 +01:00
Matthias Clasen 7533369695 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!2973
2020-12-18 05:06:35 +00:00
Matthias Clasen f31765d5dd Merge branch 'ebassi/mnemonic-label-remove' into 'master'
a11y: Fix removing mnemonic widgets

See merge request GNOME/gtk!2970
2020-12-18 00:00:48 +00:00
Matthias Clasen d33062795c Merge branch 'ebassi/docs-for-master' into 'master'
Ebassi/docs for master

See merge request GNOME/gtk!2971
2020-12-17 23:59:41 +00:00
Emmanuele Bassi 2da8d9b0ac Do not build gdk-pixbuf's man page
When using it as a sub-project. We don't really need them.
2020-12-17 20:50:16 +00:00
Matthias Clasen 3f56e8191f Merge branch 'shortcuts' into 'master'
docs: Add separation between kinds of shortcuts in Keyboard input

See merge request GNOME/gtk!2964
2020-12-17 19:43:38 +00:00
Chris Mayo bf4c3dc2c5 docs: Fix list of kinds of shortcuts in Keyboard input
Formatting in HTML was mangled.
2020-12-17 19:18:10 +00:00
Emmanuele Bassi a5365ec8cb docs: Add missing GTK types
If we don't specify the get_type() function, gtk-doc will not collect
properties and signals, and will use a different URL for the page.
2020-12-17 18:30:19 +00:00
Emmanuele Bassi ec94ec0286 Merge branch 'ebassi/password-entry-notify' into 'master'
Notify properties on deletion in PasswordEntryBuffer

Closes #3484

See merge request GNOME/gtk!2969
2020-12-17 15:51:04 +00:00
Emmanuele Bassi af0973c847 a11y: Fix removing mnemonic widgets
We must not use the variadic arguments version with GList, as it expects
a pointer to a GtkAccessible.
2020-12-17 15:49:00 +00:00
Emmanuele Bassi e71f6b0bc0 docs: Note the caveat on GtkEditable signals with delegates
We cannot bubble up ::insert-text and ::delete-text signals from the
delegate to the wrapper editable without causing an infinite recursion,
due to how the signals are designed; ideally, we would have decoupled
signal emission from virtual functions *before* releasing GTK4, but now
that we have, we can't break the contract.
2020-12-17 15:13:43 +00:00
Emmanuele Bassi 1738724e4a Notify properties on deletion in PasswordEntryBuffer
The GtkEntryBufferClass.deleted_text() behaviour changed between GTK3
and GTK4, which means any subclass of GtkEntryBuffer is now responsible
for emitting the "notify" signal for the "text" and "length" properties.

Without this, the GtkText delegate widget used by GtkPasswordEntry would
not be able to communicate changes in the contents of its buffer.

Fixes: #3484
2020-12-17 15:01:35 +00:00
Emmanuele Bassi e9e09be37e Merge branch 'issue-3483' into 'master'
Fix URLs for the download.gnome.org locations

Closes #3483

See merge request GNOME/gtk!2968
2020-12-17 13:47:01 +00:00
Matthias Clasen 8a923e02a1 Merge branch 'wip/jimmac/flat-button-tweaks' into 'master'
Adwaita: flat button adjustments

See merge request GNOME/gtk!2967
2020-12-17 12:52:22 +00:00
Emmanuele Bassi 4f12e2f711 Fix URLs for the download.gnome.org locations
Use a trailing slash, otherwise we end up on an out of date mirror.

Fixes: #3483
2020-12-17 12:46:12 +00:00
Jakub Steiner addcf57b4d Adwaita: flat button adjustments
- normally lighter (on bg_color)
- darker for headerbar
- undecorated checked buttons were never style properly (even gtk3)
  see page2 volume buttons

Finetunes https://gitlab.gnome.org/GNOME/gtk/-/issues/3427
2020-12-17 12:20:29 +01:00
Matthias Clasen db08bccb11 Merge branch 'cursor-aspect-ratio' into 'master'
Cursor aspect ratio fixes for gtk 4

Closes #3441

See merge request GNOME/gtk!2966
2020-12-16 23:40:26 +00:00
Sebastian Keller 02f0681344 settings: Change gtk-cursor-aspect-ratio from float to double
Float properties can not be read from keyfiles. This was causing changes
to this property in settings.ini to be ignored. Fix this by changing it
to a double.

Technically this change could be considered an API break, but there are
no users of this property as float yet and it is early enough to expect
there to never be any.

Also document this change in the 3 to 4 migration guide since in gtk 3
this setting will be kept a float.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 22:35:36 +01:00
Emmanuele Bassi 62dbadd536 Merge branch 'fix-macos-compilation' into 'master'
macos: fix typo that breaks compilation

See merge request GNOME/gtk!2962
2020-12-16 20:18:27 +00:00
Matthias Clasen 0588db8a69 Merge branch 'wip/carlosg/for-master' into 'master'
gdk/x11: Transform XI_Motion based scroll into discrete

Closes #3459

See merge request GNOME/gtk!2959
2020-12-16 19:56:16 +00:00
Emmanuele Bassi 58b1a13453 Merge branch 'ricotz/for-master' into 'master'
gdk: Use correct parameter name to fix g-ir-scanner warning

See merge request GNOME/gtk!2963
2020-12-16 19:46:51 +00:00
Rico Tzschichholz df70dbbae4 gdk: Use correct parameter name to fix g-ir-scanner warning
../gdk/gdktoplevellayout.c:217: Warning: Gdk: gdk_toplevel_layout_get_maximized:
  unknown parameter 'maximized' in documentation comment, should be 'maximize'
2020-12-16 20:19:05 +01:00
Tom Schoonjans 81c55b06d2 macos: fix typo that breaks compilation 2020-12-16 19:16:19 +00:00
Matthias Clasen 591c2f0595 4.0 2020-12-16 12:12:58 -05:00
Matthias Clasen 9c5a42be0d Update expected test results
We have one test that expected 3.99 to show up in an error message.
2020-12-16 12:12:58 -05:00
Matthias Clasen 45b7fa15e5 Merge branch 'ebassi/docs-for-master' into 'master'
Ebassi/docs for master

See merge request GNOME/gtk!2960
2020-12-16 16:41:44 +00:00
Emmanuele Bassi e3de92f1ea docs: Fix annotation for GtkSearchEntry::activate 2020-12-16 16:29:01 +00:00
Emmanuele Bassi 2ffa2be64e doc: Document missing GtkNotebook types 2020-12-16 16:29:01 +00:00
Emmanuele Bassi 387078b40c docs: Document GtkNativeDialogClass 2020-12-16 16:29:01 +00:00
Emmanuele Bassi 5203bf0b83 docs: Document GtkTreeViewColumn::clicked 2020-12-16 16:29:01 +00:00
Emmanuele Bassi fb93baeae4 docs: Add missing description for GtkWidget::move-focus 2020-12-16 16:29:01 +00:00
Emmanuele Bassi 9fa4c2f5b8 docs: Ignore gtkspinbuttonprivate.h 2020-12-16 16:29:01 +00:00
Emmanuele Bassi cc9528eaec docs: Add missing documentation to GtkStatusbar 2020-12-16 16:29:01 +00:00
Emmanuele Bassi 73dda96711 docs: Add missing stanzas for gtk_test_accessible API 2020-12-16 16:29:01 +00:00
Emmanuele Bassi d711acc954 docs: Ignore gtksorterprivate.h 2020-12-16 16:29:01 +00:00
Emmanuele Bassi ab59c47880 docs: Add missing documentation to GtkPopover 2020-12-16 16:29:01 +00:00
Emmanuele Bassi e4b7847904 docs: Fix documentation of GtkGestureStylus
Document all the signals, and fix the syntax for boolean values.
2020-12-16 16:29:01 +00:00
Emmanuele Bassi 308115ebae docs: Add gtk-doc stanza for GtkExpander::activate 2020-12-16 16:29:00 +00:00
Emmanuele Bassi 1cb72536ea docs: Fix syntax of GtkEntry::activate signal 2020-12-16 16:29:00 +00:00
Emmanuele Bassi f24429e84a docs: Remove private symbols 2020-12-16 16:29:00 +00:00
Emmanuele Bassi fc4402b456 docs: Ignore gtkpasswordentryprivate.h 2020-12-16 16:29:00 +00:00
Emmanuele Bassi 077aec5d32 docs: Add missing documentation for GtkTextCharPredicate 2020-12-16 16:29:00 +00:00
Emmanuele Bassi 548949214c docs: Add missing documentation GtkNative 2020-12-16 16:29:00 +00:00
Emmanuele Bassi 2aec47f56f docs: Add missing documentation for GtkCellRenderer 2020-12-16 16:29:00 +00:00
Emmanuele Bassi 344eb21bee docs: Complete symbol coverage for GSK
100% symbol docs coverage.
241 symbols documented.
0 symbols incomplete.
0 not documented.
2020-12-16 16:29:00 +00:00
Emmanuele Bassi 4fb55b3270 docs: Complete symbol coverage for GDK
100% symbol docs coverage.
833 symbols documented.
0 symbols incomplete.
0 not documented.

What's left are just type system macros and windowing system opaque
structures.
2020-12-16 16:28:58 +00:00
Matthias Clasen 75764c284d Merge branch 'wip/toplevel-layout-intent' into 'master'
Fix toplevel layout state communication

Closes #3466

See merge request GNOME/gtk!2958
2020-12-16 16:02:00 +00:00
Carlos Garnacho c95a32def8 gdk/x11: Transform XI_Motion based scroll into discrete
Depending on the input driver, we will get XI_Motion based scroll
events for regular mouse wheels. These are intended to be handled
as discrete scroll, so detect smooth scroll events that move by
exactly 1.0 in either direction.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3459
2020-12-16 14:26:44 +01:00
Jonas Ådahl 142f7862ed gdk/toplevellayout: Change API to be about intent, not full state
When being fullscreen, and wanting to unfullscreen but not caring about
whether to go unmaximized or maximized (as this information is lost), if
the GdkToplevelLayout represents the full intended state, we won't be
able to do the right thing.

To avoid this issue, make the GdkToplevelLayout API intend based, where
if one e.g. doesn't call gdk_toplevel_set_maximized() with anything, the
backend will not attempt to change the maximized state.

This means we can also remove the old 'initially_maximized' and
'initially_fullscreen' fields from the private GtkWindow struct, as we
only deal with intents now.
2020-12-16 14:16:08 +01:00
Jonas Ådahl b6412adc32 gtk/window: Check widget mappdness and not surface mappedness
When deciding whether to call gdk_toplevel_present(), check the
mappedness of GtkWidget instead of the mapped-ness of GdkSurface, as the
latter is mapped asynchronously, while the former is direct state of the
GtkWindow itself.

This fixes an issue where calling e.g. gtk_window_maximize() shortly
after showing it didn't take effect, as hadn't been mapped yet. While
maximizing after showing is racy, and will likely glitch from time to
time, the correct thing to do is still to maximize and handle whatever
state the compositor configured the window to be in.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3466
2020-12-16 11:56:41 +01:00
Timm Bäder 7eece7e769 gl renderer: Take a out graphene_rect in blur_node() 2020-12-16 09:13:12 +01:00
Timm Bäder 7f6608cbed gl renderer: Render too big textures to the clipped area 2020-12-16 08:26:46 +01:00
Timm Bäder f816a8fb82 gl renderer: Unify viewport setting in add_offscreen_ops()
We use the same rect here a few times.
2020-12-16 08:26:46 +01:00
Timm Bäder 3c2484142d vulkancontext: Remove usage of VK_ERROR_INCOMPATIBLE_VERSION_KHR
According to
https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/html/chap46.html
this has been removed. It also breaks the build on my system
2020-12-16 08:26:46 +01:00
Matthias Clasen 2192bb3dde Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2957
2020-12-15 20:33:01 +00:00
Matthias Clasen e1df9a043f Add a doc comment for GskConicGradientNode 2020-12-15 14:18:26 -05:00
Matthias Clasen 338d3ffa13 Add a doc comment for gdk_surface_request_layout 2020-12-15 14:14:49 -05:00
Emmanuele Bassi 6039a36183 Merge branch 'ebassi/for-master' into 'master'
Clean up the build system

See merge request GNOME/gtk!2955
2020-12-15 16:54:59 +00:00
Matthias Clasen c551f693c2 Merge branch 'matthiasc/for-master' into 'master'
Update the node format docs

See merge request GNOME/gtk!2956
2020-12-15 16:23:15 +00:00
Emmanuele Bassi 5d2278a5ca docs: Add public symbols to the GTK reference 2020-12-15 16:21:20 +00:00
Emmanuele Bassi ea5e186bb8 Hide GtkTextAttributes functions
The type is private, so making functions operating on it public is
pointless.
2020-12-15 16:20:21 +00:00
Emmanuele Bassi 69b181f263 Remove boxed type for GtkCrossingData
The GtkCrossingData type is completely private, so there's no point in
having a boxed type for it.
2020-12-15 15:55:15 +00:00
Emmanuele Bassi 3132b10bc0 docs: Add more private headers 2020-12-15 15:55:06 +00:00
Matthias Clasen 7335e166b7 Update the node format docs
Update this document to mention all the render nodes we
have, and the default values for their properties.
2020-12-15 10:30:18 -05:00
Emmanuele Bassi 91bba794a6 docs: Add missing symbols to the GTK reference 2020-12-15 14:30:32 +00:00
Emmanuele Bassi a6bd0c7eed Remove stray mentions of GdkConfigureEvent
The event was removed, but some traces of it linger.
2020-12-15 13:58:52 +00:00
Emmanuele Bassi ff351721b2 docs: Add missing symbols to the GDK reference 2020-12-15 13:47:40 +00:00
Emmanuele Bassi 538aa6c200 Move private GdkX11 symbols out of a public header
This avoids private symbols showing up in the introspection data, as
well as in the undocumented symbols list when generating the GDK API
reference.
2020-12-15 13:46:50 +00:00
Emmanuele Bassi f546e03d31 docs: Add missing symbols to the GSK reference 2020-12-15 13:35:19 +00:00
Emmanuele Bassi bdbea0d037 docs: Add more ignored header for GSK 2020-12-15 13:31:02 +00:00
Emmanuele Bassi 474b4ac1af build: Use Meson support for dylib versions
Do not hand-code it inside GTK's meson.build.
2020-12-15 12:47:05 +00:00
Emmanuele Bassi 99e0929d6c build: Use a consistent style for Meson files 2020-12-15 12:46:59 +00:00
Emmanuele Bassi e75e44bdcc build: Remove duplicate definition
The `GTK_COMPILATION` symbol is defined in gir_args.
2020-12-15 11:47:32 +00:00
Emmanuele Bassi 7975bbfcaa build: Remove linker flags from static libraries
We only need hardening linker flags on the libgtk shared library;
internal static libraries don't really need them.
2020-12-15 11:36:20 +00:00
Emmanuele Bassi 11bca98a29 build: Remove unused variable
We don't need a `gsk_source` variable after all.
2020-12-15 11:35:27 +00:00
Emmanuele Bassi 618186723a build: Remove unused backend_immodules variable
We don't have input method modules any more.
2020-12-15 11:20:19 +00:00
Emmanuele Bassi a5986f0dcd build: Use get_supported_link_arguments()
Instead of hand-coding it ourselves, let Meson deal with linker
arguments discovery.
2020-12-15 11:19:39 +00:00
Daniel Mustieles c162d7148f Updated Spanish translation 2020-12-15 10:28:49 +01:00
Matthias Clasen 7e1a210ae0 Merge branch 'ebassi/for-master' into 'master'
docs: Add note for the removal of GtkFileChooserButton

See merge request GNOME/gtk!2954
2020-12-14 20:37:34 +00:00
Jordi Mas bf5e3efd54 Update Catalan translation 2020-12-14 18:39:00 +01:00
Emmanuele Bassi 08d52bee14 docs: Add note for the removal of GtkFileChooserButton
Point developers in the direction of GtkButton and GtkFileChooserNative.
2020-12-14 16:55:15 +00:00
Emmanuele Bassi a6e9a9b644 Merge branch 'pixbuf-from-surface-leak' into 'master'
gdkpixbuf-drawable: Free the pixbuf on Cairo error

See merge request GNOME/gtk!2951
2020-12-14 15:12:56 +00:00
Adrien Plazas dc96542742 gdkpixbuf-drawable: Free the pixbuf on Cairo error
This avoids leaking the pixbuf.
2020-12-14 15:07:41 +01:00
Matthias Clasen e2afb59a0b Merge branch 'matthiasc/for-master' into 'master'
Avoid adding // to resource paths

Closes #3469

See merge request GNOME/gtk!2947
2020-12-14 13:14:32 +00:00
Jakub Steiner daa5d5aead Merge branch 'dropdown-searchbar' into 'master'
dropdown: Improve search bar styling

See merge request GNOME/gtk!2948
2020-12-14 09:39:38 +00:00
Jakub Steiner fd0a03cf78 Merge branch 'emoji-searchbar' into 'master'
Adwaita: Improve emoji picker styling

See merge request GNOME/gtk!2949
2020-12-14 09:38:45 +00:00
nana-4 34d99ea1d0 Adwaita: Improve emoji picker styling
- Add borders around the main scrollable content, like most other
  places.
- Set padding and spacing on .emoji-searchbar and .emoji-toolbar in a
  more proper way.
- Remove unused button.emoji-section label styles.
2020-12-14 05:26:39 +09:00
nana-4 90355c0b27 emojichooser: Add .emoji-searchbar style class
Similar to .emoji-toolbar, it would be nice to have this for styling.
2020-12-14 05:26:13 +09:00
nana-4 538cf9e294 dropdown: Improve search bar styling
As per the mockup. See:

https://gitlab.gnome.org/Teams/Design/os-mockups/-/blob/master/dropdown-lists/dropdown-lists.png
2020-12-14 05:08:59 +09:00
Piotr Drąg 8e3f2b879e Update Polish translation 2020-12-13 16:51:51 +01:00
Florentina Mușat 8fa6a25aa5 Update Romanian translation 2020-12-12 18:49:22 +00:00
Matthias Clasen 96a300b2de Merge branch 'wip/jimmac/button-shed' into 'master'
headerbar window controls & clean up flat button extend

Closes #3427

See merge request GNOME/gtk!2942
2020-12-12 02:51:05 +00:00
Matthias Clasen aeca9cb7ba Avoid adding // to resource paths
The GResource machinery is not forgiving about this
sort of thing.

Fixes: #3469
2020-12-11 21:47:54 -05:00
Matthias Clasen c2727e6e04 Merge branch 'wip/carlosg/for-master' into 'master'
Wip/carlosg/for master

Closes #3461, #593, #3083, #3009, #3463, and #3426

See merge request GNOME/gtk!2945
2020-12-12 02:35:01 +00:00
Carlos Garnacho 8be0918d7e gdk/surface: Trigger motion check for next frame after thaw
This is a more reliable calling point than ::resume-events, and a
good one to schedule things so they happen on a frame clock in no
special phase (Thus still fixing the original issue at 80d4a08e30)

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3461
2020-12-12 02:14:02 +01:00
Carlos Garnacho 612d3bca7d gtk/window: Bring back L-shaped resize corners
These ended up square in the various refactors. Make them again L-shaped
by extending these along the edge being checked. This means we have to
check for corner positions in all edges, though.
2020-12-12 01:42:42 +01:00
Carlos Garnacho e9fe270e94 gtk/scrolledwindow: Handle full scroll sequences only
In order to do this, leverage smooth scroll handling into the capture
phase scroll controller, controlled by ::scroll-begin in the propagation
phase controller.

There's 2 cases here:
- A child widget handles scroll. The scrolled window does not get
  ::scroll-begin, the child widget handles the full scroll sequence.
- No child handles scroll, the scrolled window gets ::scroll-begin,
  and transfers control of scrolling to the capture phase controller.
  As scrolling is performed, the pointer may fall into scrollable children,
  but the scrolled window will be capturing the scroll events, so these
  won't be seen by the child widgets.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/593
2020-12-12 01:42:42 +01:00
Carlos Garnacho 8402665c55 gtk/eventscrollerscroll: Handle smooth events in discrete controllers
We let smooth scroll events that don't trigger a ::scroll signal through.
This is unintended, these are handled, even if just accumulated.

This fixes cases like GtkSpinButton inside GtkScrolledWindow, where both
would handle events, until the GtkSpinButton eventually shifts away from
underneath the pointer.

Brought up at https://gitlab.gnome.org/GNOME/gtk/-/issues/593
2020-12-12 01:42:42 +01:00
Carlos Garnacho 79090f1755 gtk/entrycompletion: Ensure to show first row when shown, not allocated
This code was here in gtk3 to cater for the completion window being
positioned. That was only to meant once as long as the completion window
was shown.

This doesn't work as well for gtk4, ::size-allocate gets propagated from
the toplevel, so happens much more often for the completion window, this
ends up with the completion position being reset to the first row
frequently.

Do this simply once when popping up the completion, instead.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3083
2020-12-12 01:42:42 +01:00
Carlos Garnacho 3d84a38867 gtk/treeview: Position editable widgets correctly wrt left border
The coordinates are already widget-local here, not transformed by the
adjustment positions. Using the adjustment value here ends up pushing
the entry far from the left border.

The correct minimum value here is 0, which matches the treeview left
border.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3009
2020-12-12 01:42:42 +01:00
Carlos Garnacho 5155fac94f gtk/modelbutton: Handle unpaired releases
Let model buttons handle unpaired releases, these may happen indirectly
e.g. due to other child menus being opened at the time. Clicking would
dismiss the menu, but the menu item beneath the pointer would not get
activated.

We can handle that button release though via ::unpaired-release, so
there's no second click required.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3463
2020-12-12 01:42:42 +01:00
Carlos Garnacho 7a4d15dc67 gtk/range: Move button release handling to GtkGestureDrag
Tracking it through the GtkGestureClick becomes a bit cumbersome for
handling of simultaneously pressed buttons. We can track ::stopped,
but that also emits for a number of situations where we want drag to
continue.

However, the GtkGestureDrag is grouped with the click gesture, and
knows better when to finish the drag gesture (not just because of a
button release), so hook drag and zoom mode finalization there.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3426
2020-12-12 01:42:42 +01:00
Emmanuele Bassi e4d8d50a8b Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

See merge request GNOME/gtk!2944
2020-12-12 00:01:38 +00:00
Emmanuele Bassi 3c9a13e6cf Update CODEOWNERS
Add me as the reference for the accessibility bits of the code base.
2020-12-11 23:42:25 +00:00
Emmanuele Bassi 2c97d44281 docs: Fix the Widget as Buildable example
The layout properties use an old name.
2020-12-11 23:41:51 +00:00
Kjartan Maraas 2d3a398678 Update Norwegian Bokmål translation 2020-12-11 11:40:55 +00:00
Florentina Mușat d380ed2b3a Update Romanian translation 2020-12-10 15:34:51 +00:00
Matthias Clasen 644a45714a Merge branch 'matthiasc/for-master' into 'master'
docs: Update references to GtkWindow:fullscreened

See merge request GNOME/gtk!2943
2020-12-10 14:31:54 +00:00
Matthias Clasen 324683993e docs: Update references to GtkWindow:fullscreened
The property got renamed from fullscreen to fullscreened.
Update all references.
2020-12-10 09:10:21 -05:00
Jakub Steiner f6f6241627 Adwaita: special case flat headerbar buttons
- make sure the hovers and pushed states are legible on a tintend headerbar

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3427
2020-12-10 14:24:29 +01:00
Jakub Steiner 6a33bed353 Adwaita: flat button :hover and :active
- special case undecorated button hovers
2020-12-10 14:16:25 +01:00
Jakub Steiner f83ee0be23 Adwaita: headerbar_color > headerbar_bg_color
- semantic correction
2020-12-10 13:58:42 +01:00
Jakub Steiner 7442bdc383 Adwaita: duplicate selector
- awkward duplicate selector that should have no effect
  (resulting in the same css)
2020-12-10 13:51:10 +01:00
Luna Jernberg 82950528ed Update Swedish translation 2020-12-09 21:05:25 +00:00
Matthias Clasen 97eaef8308 Merge branch 'ebassi/popcount' into 'master'
Share the popcount() fallback for MSVC

See merge request GNOME/gtk!2940
2020-12-09 16:32:09 +00:00
Matthias Clasen 92189cf96a Merge branch 'matthiasc/for-master' into 'master'
Remove NoDisplay from demo desktop files

Closes #2932

See merge request GNOME/gtk!2939
2020-12-09 16:10:04 +00:00
Emmanuele Bassi b8a651df47 Share the popcount() fallback for MSVC
We use __builtin_popcount() in a couple of places, so it makes sense to
have it in one header.
2020-12-09 16:06:52 +00:00
Matthias Clasen c0ed89be9a widget-factory: Autoplay the video
The empty video on the frontpage is a bit of a letdown, since
the big arrow can't be clicked.
2020-12-09 10:52:55 -05:00
Matthias Clasen ade4bcb125 Remove NoDisplay from demo desktop files
When these are installed (in particular, as flatpaks),
we should not hide them.

Fixes: #2932
2020-12-09 10:09:06 -05:00
Matthias Clasen c5dd34344f Merge branch 'wip/carlosg/for-master' into 'master'
Wip/carlosg/for master

Closes #3426 and #3264

See merge request GNOME/gtk!2933
2020-12-09 15:04:01 +00:00
Matthias Clasen c90cc976a5 Merge branch 'wip/jimmac/row-transitions-and-spacing' into 'master'
Adwaita: row transitions and spacing

Closes #3434

See merge request GNOME/gtk!2937
2020-12-09 13:35:54 +00:00
Matthias Clasen bd9bcd5905 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #3431

See merge request GNOME/gtk!2938
2020-12-09 13:34:21 +00:00
Matthias Clasen 0ddcbb52e6 Merge branch 'ebassi/4-0-abi-bump' into 'master'
Ebassi/4 0 abi bump

Closes #3392

See merge request GNOME/gtk!2883
2020-12-09 13:20:20 +00:00
Emmanuele Bassi 2457f3d54c build: Bump up the SONAME for GTK4
We released all the 3.9x development snapshots using:

  libgtk-4.0.so.0.xxxx.y

which means that the 4.0.0 release of GTK will have a lower SONAME than
the snapshots. To avoid that, bump the SONAME to 1.xxxx.y.

Fixes: #3392
2020-12-09 12:19:50 +00:00
Emmanuele Bassi 1cc207af32 build: Tie interface age to the development cycle
We don't want to increase the interface age manually, because we're
going to end up forgetting about it.

Instead, we should tie it to the rest of the version:

 - in stable (even minor) cycles, we don't add new API; the interface
   age is the same as the micro version
 - in unstable (odd minor) cycles, every new release might have new API,
   or updates to newly added API; keep the interface age to 0

This removes one more manual thing to change during release, and keeps
us honest with our promise not to add symbols during stable cycles.
2020-12-09 12:19:50 +00:00
Emmanuele Bassi f4a0d57c07 Prepare version macros for 4.0
Remove the 3.9x version macros, and ensure that we handle 4.0 as the
backstop for the minimum required version.
2020-12-09 12:19:50 +00:00
Jakub Steiner a76ee61e97 Adwaita: row transitions and spacing
- no fading out of row hovers. Many feel like it's a slow
  refresh rather than intentional effect.
- give some margin to navigation lists

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3434
2020-12-09 12:16:15 +01:00
Yuri Chornoivan fac367495b Update Ukrainian translation 2020-12-09 07:08:51 +00:00
Matthias Clasen 76177b6065 Merge branch 'ebassi/prop-names' into 'master'
Ebassi/prop names

See merge request GNOME/gtk!2936
2020-12-09 05:51:00 +00:00
Matthias Clasen 433f305fa9 Merge branch 'sophie-h-master-patch-62064' into 'master'
gtk-demo: Remove potentially ableist metaphor

See merge request GNOME/gtk!2934
2020-12-09 00:53:10 +00:00
Matthias Clasen fce824e78f Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3451

See merge request GNOME/gtk!2935
2020-12-09 00:52:53 +00:00
Emmanuele Bassi c4b768a4ec Rename GtkWindow:fullscreen to :fullscreened
Having a property with the same name of a method makes some languages
which put properties and method names in the same flat namespace not
really happy about our choices. To avoid collisions, let's put the the
"fullscreen" property into the past, alongside the "maximized" property.
2020-12-09 00:11:49 +00:00
Emmanuele Bassi 6d1be832d9 Fix the documentation for GtkWindow state properties
Drop the "don't write code that crashes" folksy bit; don't start
sentences with conjunctions; remove copy-pasted references to
"iconified" states; point to the corresponding property notification in
a consistent manner.
2020-12-08 23:49:45 +00:00
Matthias Clasen a828d4318e Mark flaky tests as flaky
We can't mark these as xfail, since it sometimes succeed.
2020-12-08 18:10:02 -05:00
Sophie Herold a36ccd7f42 gtk-demo: Remove potentially ableist metaphor 2020-12-08 23:02:03 +00:00
Matthias Clasen b4a7fe8d8f Add bug reporting address to pot files
Fixes: #3451
2020-12-08 17:51:38 -05:00
Carlos Garnacho 43e4848872 gtk/main: Keep implicit grab until all buttons are released
Currently, the implicit grab is broken on the first button release,
in the case of pressing multiple buttons simultaneously. This means
that we emit crossing events early, and the next button releases
are sent to the pointer focus widget instead.

Consider the implicit grab effective until all buttons are released,
and only unset the pointer implicit grab (and emit crossing events)
after there are no further buttons pressed. We do this by checking
event modifiers, given button release events do contain the modifiers
in effect at the time the event was generated, we have to look for
exactly one active button modifier.

Fixes weird pointer states after pressing multiple buttons on a
widget.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3426
2020-12-08 23:27:03 +01:00
Carlos Garnacho 80d4a08e30 gdk/surface: Delay gdk_surface_request_motion() requests internally
Those requests are received while dealing with the ::layout frame
clock phase, this has the unintended side effect of making the
frame clock "rewind" to handle ::flush-events again during this
frame, which delays everything and practically halves the frame
rate.

We do intend to make the motion events dispatches on the next frame,
so do this in an idle at a slightly lower priority than layout/draw,
so the ::flush-events phase is actually requested for the next frame.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3264
2020-12-08 23:27:03 +01:00
Carlos Garnacho 47d0b5ad0c gkt/textview: Set an iter position for event-less menu activation
This went missing. Use the current insertion position as a reference.
Fixes invoking the menu via keyboard.
2020-12-08 23:27:03 +01:00
Matthias Clasen c59b433395 Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'
macos: fix macOS build breakage

See merge request GNOME/gtk!2931
2020-12-08 20:32:51 +00:00
Yuri Chornoivan 18d06a1cd5 Update Ukrainian translation 2020-12-08 20:25:26 +00:00
Florentina Mușat f13041360a Update Romanian translation 2020-12-08 19:52:12 +00:00
Christian Hergert 0236fe80c1 macos: fix macOS build breakage
Fixes breakages due to recent refactoring around sizing changes.
2020-12-08 11:29:31 -08:00
Matthias Clasen 2caf283323 Mark the window-show-contents-on-map.ui reftest as xfail
We know now what the test is trying to test, just lack
the right plumbing to do it properly. So, keep the test
around, marked as expected fail.
2020-12-08 12:04:47 -05:00
Matthias Clasen 6fb66e299a Revert "reftests: Remove window-show-contents-on-map.ui test"
This reverts commit 074b933ae4.
2020-12-08 11:45:52 -05:00
Timm Bäder 33ed42d985 gl renderer: Remove RESET_OPACITY flag
We always need to do that (and always passed the flag to
add_offscreen_ops() anyway).
2020-12-06 20:03:35 +01:00
Timm Bäder 1ee4f6138b gl renderer: Reset opacity when rendering blend node children
We render those on a texture, so we need to reset the opacity because
that will be applied when rendering the resulting texture.
2020-12-06 20:01:36 +01:00
Timm Bäder 7b61ef9e0f gl renderer: Initialize rounded rect early 2020-12-06 19:57:48 +01:00
Timm Bäder b46d077b3a gl renderer: Fix rendering clipped blurred inset shadow nodes 2020-12-06 19:18:10 +01:00
Timm Bäder e32331d002 gl renderer: Ignore crossfades between equal texture nodes 2020-12-06 19:18:10 +01:00
Timm Bäder 05928608ec gl renderer: Use scale_x and scale_y everywhere
Try to handle two different values for scale in horizontal and vertical
direction better.

Fixes #3431
2020-12-06 19:18:05 +01:00
193 changed files with 34628 additions and 23542 deletions
+36 -2
View File
@@ -1,5 +1,39 @@
Overview of Changes
===================
Overview of Changes in GTK 4.0
==============================
* Fix problems with synthetic motion events affecting frame rates
* Fix problems with implicit grabs affecting widget states
* Fix problems with zoom mode on scales getting stuck
* Fix submenu closing by outside clicks
* Rename GtkWindow:fullscreen to :fullscreened to help
language bindings
* Bump the soname. Stable GTK 4 releases use libgtk-4.0.so.1.xxxx.y
* Adwaita:
- Reduce hover transition effects in lists
- Special-case header buttons
* Demos:
- Remove NoDisplay from desktop files
- Autoplay the video in widget-factory
* Translation updates:
Catalan
Norwegian Bokmål
Polish
Spanish
Swedish
Romanian
Ukrainian
Overview of Changes in 3.99.5
=============================
* Accessibility:
- Map presentation role according to Core-AAM
+6 -6
View File
@@ -17,7 +17,7 @@ license fees or royalties.
The official download location
- https://download.gnome.org/sources/gtk+
- https://download.gnome.org/sources/gtk/
The official web site
@@ -49,11 +49,11 @@ In order to build GTK you will need:
You will also need various dependencies, based on the platform you are
building for:
- [GLib](https://download.gnome.org/sources/glib)
- [GdkPixbuf](https://download.gnome.org/sources/gdk-pixbuf)
- [GObject-Introspection](https://download.gnome.org/sources/gobject-introspection)
- [Cairo](https://www.cairographics.org)
- [Pango](https://download.gnome.org/sources/pango)
- [GLib](https://download.gnome.org/sources/glib/)
- [GdkPixbuf](https://download.gnome.org/sources/gdk-pixbuf/)
- [GObject-Introspection](https://download.gnome.org/sources/gobject-introspection/)
- [Cairo](https://www.cairographics.org/)
- [Pango](https://download.gnome.org/sources/pango/)
- [Epoxy](https://github.com/anholt/libepoxy)
- [Graphene](https://github.com/ebassi/graphene)
- [Xkb-common](https://github.com/xkbcommon/libxkbcommon)
+25 -23
View File
@@ -1,20 +1,21 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
import os
import sys
import subprocess
if 'DESTDIR' not in os.environ:
gtk_api_version = sys.argv[1]
gtk_abi_version = sys.argv[2]
gtk_libdir = sys.argv[3]
gtk_datadir = sys.argv[4]
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
print('Compiling GSettings schemas...')
gtk_bindir = sys.argv[5]
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
print('Compiling GSettings schemas...')
glib_compile_schemas = subprocess.check_output(['pkg-config',
'--variable=glib_compile_schemas',
'gio-2.0']).strip()
@@ -22,13 +23,14 @@ if 'DESTDIR' not in os.environ:
# pkg-config variables only available since GLib 2.62.0.
glib_compile_schemas = 'glib-compile-schemas'
subprocess.call([glib_compile_schemas,
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
subprocess.call(['gtk4-update-icon-cache', '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
update_icon_cache = os.path.join(gtk_bindir, 'gtk4-update-icon-cache')
subprocess.call([update_icon_cache, '-q', '-t' ,'-f',
os.path.join(gtk_datadir, 'icons', 'hicolor')])
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
gio_querymodules = subprocess.check_output(['pkg-config',
'--variable=gio_querymodules',
@@ -37,7 +39,7 @@ if 'DESTDIR' not in os.environ:
# pkg-config variables only available since GLib 2.62.0.
gio_querymodules = 'gio-querymodules'
subprocess.call([gio_querymodules, gtk_printmodule_dir])
print('Updating module cache for input methods...')
print('Updating module cache for input methods...')
os.makedirs(gtk_immodule_dir, exist_ok=True)
subprocess.call([gio_querymodules, gtk_immodule_dir])
+11 -9
View File
@@ -8,14 +8,16 @@ constraint_editor_sources = [
]
constraint_editor_resources = gnome.compile_resources('constraint_editor_resources',
'constraint-editor.gresource.xml',
source_dir: '.')
'constraint-editor.gresource.xml',
source_dir: '.',
)
executable('gtk4-constraint-editor',
constraint_editor_sources, constraint_editor_resources,
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: false)
sources: [ constraint_editor_sources, constraint_editor_resources, ],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: false,
)
+1 -1
View File
@@ -20,7 +20,7 @@ mainImage(out vec4 fragColor, in vec2 fragCoord, in vec2 resolution, in vec2 uv)
float b = 1.0/distance (pos, p2);
float sum = r + g + b;
float alpha = 1.0 - pow (1.0/(sum), 40)*pow (10.0, 40*0.7);
float alpha = 1.0 - pow (1.0/(sum), 40.0)*pow (10.0, 40.0*0.7);
fragColor = vec4 (r*0.5, g*0.5, b*0.5, 1.0) * alpha;
}
+1 -1
View File
@@ -177,7 +177,7 @@ float ccell2(vec2 p, float r) {
float df(vec2 p, float scale, inout vec2 nn) {
p /= scale;
nn = hextile(p);
nn = round(nn);
nn = floor(nn + 0.5);
float r = hash(nn);
float d;;
+1 -1
View File
@@ -179,7 +179,7 @@ float ccell2(vec2 p, float r) {
float df(vec2 p, float scale, inout vec2 nn) {
p /= scale;
nn = hextile(p);
nn = round(nn);
nn = floor(nn + 0.5);
float r = hash(nn);
float d;;
+20 -22
View File
@@ -53,31 +53,30 @@
<child>
<object class="GtkBox">
<child>
<object class="GtkScrolledWindow">
<style>
<class name="sidebar"/>
</style>
<property name="width-request">120</property>
<property name="hscrollbar-policy">never</property>
<property name="min-content-width">150</property>
<object class="GtkBox">
<property name="width-request">220</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="width-request">220</property>
<property name="orientation">vertical</property>
<object class="GtkSearchBar" id="searchbar">
<property name="key-capture-widget">window</property>
<child>
<object class="GtkSearchBar" id="searchbar">
<property name="key-capture-widget">window</property>
<child>
<object class="GtkSearchEntry" id="search-entry">
<accessibility>
<relation name="controls">listview</relation>
</accessibility>
</object>
</child>
<object class="GtkSearchEntry" id="search-entry">
<accessibility>
<relation name="controls">listview</relation>
</accessibility>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<style>
<class name="sidebar"/>
</style>
<property name="width-request">120</property>
<property name="hscrollbar-policy">never</property>
<property name="min-content-width">150</property>
<property name="vexpand">1</property>
<child>
<object class="GtkListView" id="listview">
<style>
@@ -94,7 +93,6 @@
</accessibility>
</object>
</child>
</object>
</child>
</object>
+52 -47
View File
@@ -100,31 +100,33 @@ demos = files([
gtkdemo_deps = [ libgtk_dep, ]
extra_demo_sources = files(['main.c',
'fontify.c',
'gtkfishbowl.c',
'fontplane.c',
'gtkgears.c',
'gtkshaderbin.c',
'gtkshadertoy.c',
'gtkshaderstack.c',
'gskshaderpaintable.c',
'puzzlepiece.c',
'bluroverlay.c',
'demoimage.c',
'demotaggedentry.c',
'demochild.c',
'demolayout.c',
'demowidget.c',
'demo2layout.c',
'singular_value_decomposition.c',
'four_point_transform.c',
'demo2widget.c',
'demo3widget.c',
'pixbufpaintable.c',
'script-names.c',
'unicode-names.c',
'suggestionentry.c'])
extra_demo_sources = files([
'main.c',
'fontify.c',
'gtkfishbowl.c',
'fontplane.c',
'gtkgears.c',
'gtkshaderbin.c',
'gtkshadertoy.c',
'gtkshaderstack.c',
'gskshaderpaintable.c',
'puzzlepiece.c',
'bluroverlay.c',
'demoimage.c',
'demotaggedentry.c',
'demochild.c',
'demolayout.c',
'demowidget.c',
'demo2layout.c',
'singular_value_decomposition.c',
'four_point_transform.c',
'demo2widget.c',
'demo3widget.c',
'pixbufpaintable.c',
'script-names.c',
'unicode-names.c',
'suggestionentry.c',
])
if harfbuzz_dep.found() and pangoft_dep.found()
demos += files(['font_features.c'])
@@ -147,14 +149,17 @@ endif
gtkdemo_args = [ '-DGDK_DISABLE_DEPRECATED', '-DGTK_DISABLE_DEPRECATED', ]
demos_h = custom_target('gtk4 demo header',
output: 'demos.h',
input: demos,
command: [ find_program('geninclude.py'), '@OUTPUT@', '@INPUT@' ])
output: 'demos.h',
input: demos,
command: [ find_program('geninclude.py'), '@OUTPUT@', '@INPUT@' ],
)
gtkdemo_resources = gnome.compile_resources('gtkdemo_resources',
'demo.gresource.xml',
source_dir: '.')
'demo.gresource.xml',
source_dir: '.',
)
# Use a subset of compiler flags
demo_cflags = []
foreach flag: common_cflags
if flag not in ['-Werror=missing-prototypes', '-Werror=missing-declarations', '-fvisibility=hidden']
@@ -163,30 +168,30 @@ foreach flag: common_cflags
endforeach
executable('gtk4-demo',
demos, demos_h, extra_demo_sources, gtkdemo_resources,
c_args: gtkdemo_args + demo_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
c_args: gtkdemo_args + demo_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
executable('gtk4-demo-application',
'application.c', gtkdemo_resources,
c_args: gtkdemo_args + common_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: ['application.c', gtkdemo_resources],
c_args: gtkdemo_args + common_cflags,
dependencies: gtkdemo_deps,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# icons
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# desktop file
-1
View File
@@ -7,4 +7,3 @@ Terminal=false
Type=Application
StartupNotify=true
Categories=Development;GTK;
NoDisplay=true
+1 -1
View File
@@ -31,7 +31,7 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord, in vec2 resolution, in vec
float propagation_length = time * wave_speed;
float t = (propagation_length - distance_from_center) / wave_length;
float offset_magnitude = 0;
float offset_magnitude = 0.0;
if (t > 0.0)
offset_magnitude = decay(wave_height * sin(t * 2.0 * PI), t);
+1 -1
View File
@@ -1,6 +1,6 @@
/* Benchmark/Themes
*
* This demo switches themes like a maniac, like some of you.
* This demo continuously switches themes, like some of you.
*
* Warning: This demo involves rapidly flashing changes and may
* be hazardous to photosensitive viewers.
+12 -12
View File
@@ -7,25 +7,25 @@ iconbrowser_sources = [
]
iconbrowser_resources = gnome.compile_resources('iconbrowser_resources',
'iconbrowser.gresource.xml',
source_dir: '.')
'iconbrowser.gresource.xml',
source_dir: '.',
)
executable('gtk4-icon-browser',
iconbrowser_sources, iconbrowser_resources,
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: [iconbrowser_sources, iconbrowser_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# icons
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# desktop file
@@ -7,4 +7,3 @@ Terminal=false
Type=Application
StartupNotify=true
Categories=Development;GTK;
NoDisplay=true
+14 -14
View File
@@ -6,25 +6,25 @@ node_editor_sources = [
]
node_editor_resources = gnome.compile_resources('node_editor_resources',
'node-editor.gresource.xml',
source_dir: '.')
'node-editor.gresource.xml',
source_dir: '.',
)
executable('gtk4-node-editor',
node_editor_sources, node_editor_resources,
dependencies: libgtk_dep,
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())
] + common_cflags,
gui_app: true,
link_args: extra_demo_ldflags,
install: false)
sources: [node_editor_sources, node_editor_resources],
dependencies: libgtk_dep,
include_directories: confinc,
c_args: [
'-DNODE_EDITOR_SOURCE_DIR="@0@/../../testsuite/gsk/compare/"'.format(meson.current_source_dir())
] + common_cflags,
gui_app: true,
link_args: extra_demo_ldflags,
install: false,
)
# icons, don't install them until we decide to install gtk4-node-editor
#icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
#foreach size: ['scalable', 'symbolic']
# install_subdir('data/' + size,
# install_dir: icontheme_dir
# )
# install_subdir('data/' + size, install_dir: icontheme_dir)
#endforeach
+105 -13
View File
@@ -23,7 +23,7 @@ The **container** node is a special node that allows specifying a list of child
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bottom | `<node>` | color { color: #AF0; } | always |
| bottom | `<node>` | color { } | always |
| mode | `<blend-mode>` | normal | non-default |
| top | `<node>` | color { } | always |
@@ -48,7 +48,22 @@ Creates a node like `gsk_blur_node_new()` with the given properties.
Creates a node like `gsk_border_node_new()` with the given properties.
For the color and width properties, the values follow the typical CSS order of top, right, bottom, left. If the last/left value isn't given, the 2nd/right value is used. If the 3rd/bottom value isn't given, the 1st/top value is used. And if the 2nd/right value also isn't given, the 1st/top value is used for every 4 values.
For the color and width properties, the values follow the typical CSS order
of top, right, bottom, left. If the last/left value isn't given, the 2nd/right
value is used. If the 3rd/bottom value isn't given, the 1st/top value is used.
And if the 2nd/right value also isn't given, the 1st/top value is used for
every 4 values.
### cairo
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | none | always |
| pixels | `<url>` | none | non-default |
| script | `<url>` | none | non-default |
The pixels are a base64-encoded data url of png data. The script is
a base64-encoded data url of a cairo script.
### clip
@@ -59,7 +74,9 @@ For the color and width properties, the values follow the typical CSS order of t
Creates a node like `gsk_clip_node_new()` with the given properties.
As an extension, this node allows specifying a rounded rectangle for the clip property. If that rectangle is indeed rounded, a node like `gsk_rounded_clip_node_new()` will be created instead.
As an extension, this node allows specifying a rounded rectangle for the
clip property. If that rectangle is indeed rounded, a node like
`gsk_rounded_clip_node_new()` will be created instead.
### color
@@ -70,7 +87,8 @@ As an extension, this node allows specifying a rounded rectangle for the clip pr
Creates a node like `gsk_color_node_new()` with the given properties.
The color is chosen as an error pink so it is visible while also reminding people to change it.
The color is chosen as an error pink so it is visible while also reminding
people to change it.
### color-matrix
@@ -82,7 +100,21 @@ The color is chosen as an error pink so it is visible while also reminding peopl
Creates a node like `gsk_color_matrix_node_new()` with the given properties.
The matrix property accepts a <transform> for compatibility purposes, but you should be aware that the allowed values are meant to be used on 3D transformations, so their naming might appear awkward. However, it is always possible to use the matrix3d() production to specify all 16 values individually.
The matrix property accepts a <transform> for compatibility purposes, but you
should be aware that the allowed values are meant to be used on 3D transformations,
so their naming might appear awkward. However, it is always possible to use the
matrix3d() production to specify all 16 values individually.
### conic-gradient
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | 50 | always |
| center | `<point>` | 25, 25 | always |
| rotation | `<number>` | 0 | always |
| stops | `<color-stop>` | 0 #AF0, 1 #F0C | always |
Creates a node like `gsk_conic_gradient_node_new()` with the given properties.
### cross-fade
@@ -90,7 +122,7 @@ The matrix property accepts a <transform> for compatibility purposes, but you sh
| -------- | ---------------- | ---------------------- | ----------- |
| end | `<node>` | color { } | always |
| mode | `<number>` | 0.5 | non-default |
| start | `<node>` | color { color: #AF0; } | always |
| start | `<node>` | color { } | always |
Creates a node like `gsk_cross_fade_node_new()` with the given properties.
@@ -121,8 +153,8 @@ Creates a node like `gsk_inset_shadow_node_new()` with the given properties.
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | 50 | always |
| end | `<point>` | 0 50 | always |
| start | `<point>` | 0 0 | always |
| end | `<point>` | 0 50 | always |
| stops | `<color-stop>` | 0 #AF0, 1 #F0C | always |
Creates a node like `gsk_linear_gradient_node_new()` with the given properties.
@@ -149,16 +181,57 @@ Creates a node like `gsk_transform_node_new()` with the given properties.
Creates a node like `gsk_outset_shadow_node_new()` with the given properties.
### repeat
### radial-gradient
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | *bounds of child node* | non-default |
| child | `<node>` | color { } | always |
| child-bounds| `<rect>` | *bounds of child node* | non-default |
| bounds | `<rect>` | 50 | always |
| center | `<point>` | 25 25 | always |
| hradius | `<number>` | 25 | always |
| vradius | `<number>` | 25 | always |
| start | `<number>` | 0 | always |
| end | `<number>` | 1 | always |
| stops | `<color-stop>` | 0 #AF0, 1 #F0C | always |
Creates a node like `gsk_radial_gradient_node_new()` with the given properties.
### repeat
| property | syntax | default | printed |
| ----------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | *bounds of child node* | non-default |
| child | `<node>` | color { } | always |
| child-bounds| `<rect>` | *bounds of child node* | non-default |
Creates a node like `gsk_repeat_node_new()` with the given properties.
### repeating-linear-gradient
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | 50 | always |
| start | `<point>` | 0 0 | always |
| end | `<point>` | 0 50 | always |
| stops | `<color-stop>` | 0 #AF0, 1 #F0C | always |
Creates a node like `gsk_repeating_linear_gradient_node_new()` with the given
properties.
### repeating radial-gradient
| property | syntax | default | printed |
| -------- | ---------------- | ---------------------- | ----------- |
| bounds | `<rect>` | 50 | always |
| center | `<point>` | 25 25 | always |
| hradius | `<number>` | 25 | always |
| vradius | `<number>` | 25 | always |
| start | `<number>` | 0 | always |
| end | `<number>` | 1 | always |
| stops | `<color-stop>` | 0 #AF0, 1 #F0C | always |
Creates a node like `gsk_repeating_radial_gradient_node_new()` with the given
properties.
### rounded-clip
| property | syntax | default | printed |
@@ -188,7 +261,8 @@ Creates a node like `gsk_shadow_node_new()` with the given properties.
Creates a node like `gsk_text_node_new()` with the given properties.
If the given font does not exist or the given glyphs are invalid for the given font, an error node will be returned.
If the given font does not exist or the given glyphs are invalid for the given
font, an error node will be returned.
### texture
@@ -199,7 +273,9 @@ If the given font does not exist or the given glyphs are invalid for the given f
Creates a node like `gsk_texture_node_new()` with the given properties.
The default texture is a 10x10 checkerboard with the top left and bottom right 5x5 being in the color #FF00CC and the other part being transparent. A possible representation for this texture is `url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABmJLR0QA/wD/AP+gvaeTAAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQXY0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=")
The default texture is a 10x10 checkerboard with the top left and bottom right
5x5 being in the color #FF00CC and the other part being transparent. A possible
representation for this texture is `url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABmJLR0QA/wD/AP+gvaeTAAAAKUlEQVQYlWP8z3DmPwMaYGQwYUQXY0IXwAUGUCGGoxkYGBiweXAoeAYAz44F3e3U1xUAAAAASUVORK5CYII=")
`.
### transform
@@ -211,3 +287,19 @@ The default texture is a 10x10 checkerboard with the top left and bottom right 5
Creates a node like `gsk_transform_node_new()` with the given properties.
### glshader
| property | syntax | default | printed |
| ---------- | ------------------ | ---------------------- | ----------- |
| bounds | `<rect>` | 50 | always |
| sourcecode | `<string>` | "" | always |
| args | `<uniform values>` | none | non-default |
| child1 | `<node>` | none | non-default |
| child2 | `<node>` | none | non-default |
| child3 | `<node>` | none | non-default |
| child4 | `<node>` | none | non-default |
Creates a GLShader node. The `sourcecode` must be a GLSL fragment shader.
The `args` must match the uniforms of simple types declared in that shader,
in order and comma-separated. The `child` properties must match the sampler
uniforms in the shader.
+9 -10
View File
@@ -1,11 +1,12 @@
executable('gtk4-print-editor',
['print-editor.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: ['print-editor.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# desktop file
install_data('org.gtk.PrintEditor4.desktop', install_dir: gtk_applicationsdir)
@@ -17,7 +18,5 @@ install_data('org.gtk.PrintEditor4.appdata.xml', install_dir: gtk_appdatadir)
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
@@ -7,4 +7,3 @@ Terminal=false
Type=Application
StartupNotify=true
Categories=Development;GTK;
NoDisplay=true
+12 -12
View File
@@ -1,17 +1,19 @@
# demos/widget-factory
widgetfactory_resources = gnome.compile_resources('widgetfactory_resources',
'widget-factory.gresource.xml',
source_dir: '.')
'widget-factory.gresource.xml',
source_dir: '.',
)
executable('gtk4-widget-factory',
'widget-factory.c', widgetfactory_resources,
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true)
sources: ['widget-factory.c', widgetfactory_resources],
c_args: common_cflags,
dependencies: libgtk_dep,
include_directories: confinc,
gui_app: true,
link_args: extra_demo_ldflags,
install: true,
)
# desktop file
install_data('org.gtk.WidgetFactory4.desktop', install_dir: gtk_applicationsdir)
@@ -20,9 +22,7 @@ install_data('org.gtk.WidgetFactory4.desktop', install_dir: gtk_applicationsdir)
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
foreach size: ['scalable', 'symbolic']
install_subdir('data/' + size,
install_dir: icontheme_dir
)
install_subdir('data/' + size, install_dir: icontheme_dir)
endforeach
# appdata
@@ -7,4 +7,3 @@ Terminal=false
Type=Application
StartupNotify=true
Categories=Development;GTK;
NoDisplay=true
+1 -1
View File
@@ -1072,7 +1072,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="margin-end">6</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="autoplay">0</property>
<property name="autoplay">1</property>
<property name="loop">1</property>
<property name="file">resource:///org/gtk/WidgetFactory4/gtk-logo.webm</property>
</object>
+5
View File
@@ -70,3 +70,8 @@ gtk/inspector @otte @matthiasc
# Layout managers
gtk/gtklayout* @ebassi
gtk/gtkconstraint* @ebassi
# Accessibility
gtk/gtkaccessible*.[ch] @ebassi
gtk/gtkatcontext*.[ch] @ebassi
gtk/a11y @ebassi
+44 -4
View File
@@ -1,4 +1,3 @@
<INCLUDE>gdk/gdk.h</INCLUDE>
<SECTION>
@@ -29,8 +28,9 @@ GDK_TYPE_GRAB_STATUS
GDK_TYPE_STATUS
GdkStatus
GDKVAR
GDK_VERSION_3_92
GDK_VERSION_3_94
GDK_EXTERN_VAR
_GDK_EXTERN
GDK_DECLARE_INTERNAL_TYPE
gdk_axis_use_get_type
gdk_byte_order_get_type
gdk_crossing_mode_get_type
@@ -196,6 +196,7 @@ gdk_surface_create_cairo_context
<SUBSECTION>
gdk_surface_queue_render
gdk_surface_get_frame_clock
gdk_surface_request_layout
<SUBSECTION>
gdk_surface_set_cursor
@@ -374,6 +375,7 @@ gdk_device_tool_get_hardware_id
gdk_device_tool_get_axes
<SUBSECTION Standard>
GDK_TYPE_AXIS_FLAGS
GDK_TYPE_AXIS_USE
GDK_TYPE_EXTENSION_MODE
GDK_TYPE_INPUT_MODE
@@ -446,6 +448,7 @@ gdk_seat_capabilities_get_type
<FILE>events</FILE>
GdkEvent
GdkEventType
GdkKeymapKey
GdkKeyMatch
GdkTouchpadGesturePhase
GdkScrollDirection
@@ -481,10 +484,14 @@ gdk_event_get_axis
gdk_event_get_history
gdk_event_get_pointer_emulated
gdk_event_triggers_context_menu
GdkButtonEvent
gdk_button_event_get_button
GdkScrollEvent
gdk_scroll_event_get_direction
gdk_scroll_event_get_deltas
gdk_scroll_event_is_stop
GdkMotionEvent
GdkKeyEvent
gdk_key_event_get_keyval
gdk_key_event_get_keycode
gdk_key_event_get_consumed_modifiers
@@ -493,23 +500,31 @@ gdk_key_event_get_level
gdk_key_event_is_modifier
gdk_key_event_matches
gdk_key_event_get_match
GdkFocusEvent
gdk_focus_event_get_in
gdk_touch_event_get_emulating_pointer
GdkCrossingEvent
gdk_crossing_event_get_mode
gdk_crossing_event_get_detail
gdk_crossing_event_get_focus
GdkGrabBrokenEvent
gdk_grab_broken_event_get_grab_surface
gdk_grab_broken_event_get_implicit
GdkDeleteEvent
GdkDNDEvent
gdk_dnd_event_get_drop
gdk_configure_event_get_size
GdkTouchEvent
GdkTouchpadEvent
gdk_touchpad_event_get_gesture_phase
gdk_touchpad_event_get_n_fingers
gdk_touchpad_event_get_deltas
gdk_touchpad_event_get_pinch_angle_delta
gdk_touchpad_event_get_pinch_scale
GdkPadEvent
gdk_pad_event_get_axis_value
gdk_pad_event_get_button
gdk_pad_event_get_group_mode
GdkProximityEvent
<SUBSECTION>
gdk_events_get_angle
@@ -517,6 +532,7 @@ gdk_events_get_center
gdk_events_get_distance
<SUBSECTION Standard>
GDK_EVENT
GDK_TYPE_EVENT
GDK_TYPE_EVENT_MASK
GDK_TYPE_EVENT_TYPE
@@ -524,6 +540,20 @@ GDK_TYPE_CROSSING_MODE
GDK_TYPE_SCROLL_DIRECTION
GDK_TYPE_NOTIFY_TYPE
GDK_IS_EVENT
GDK_IS_EVENT_TYPE
GDK_TYPE_BUTTON_EVENT
GDK_TYPE_CROSSING_EVENT
GDK_TYPE_DELETE_EVENT
GDK_TYPE_DND_EVENT
GDK_TYPE_FOCUS_EVENT
GDK_TYPE_GRAB_BROKEN_EVENT
GDK_TYPE_KEY_EVENT
GDK_TYPE_MOTION_EVENT
GDK_TYPE_PAD_EVENT
GDK_TYPE_PROXIMITY_EVENT
GDK_TYPE_SCROLL_EVENT
GDK_TYPE_TOUCH_EVENT
GDK_TYPE_TOUCHPAD_EVENT
gdk_event_get_type
gdk_event_sequence_get_type
@@ -645,6 +675,7 @@ GdkToplevelSize
gdk_toplevel_size_get_bounds
gdk_toplevel_size_set_size
gdk_toplevel_size_set_min_size
gdk_toplevel_size_set_shadow_width
<SUBSECTION Standard>
GDK_TYPE_TOPLEVEL_SIZE
gdk_toplevel_size_get_type
@@ -1172,6 +1203,10 @@ GdkCairoContext
gdk_cairo_context_cairo_create
<SUBSECTION Standard>
GDK_CAIRO_CONTEXT
GDK_IS_CAIRO_CONTEXT
GDK_TYPE_CAIRO_CONTEXT
GDK_CAIRO_ERROR
gdk_cairo_context_get_type
</SECTION>
@@ -1191,6 +1226,11 @@ gdk_vulkan_context_get_queue
gdk_vulkan_context_get_queue_family_index
<SUBSECTION Standard>
GDK_VULKAN_CONTEXT
GDK_IS_VULKAN_CONTEXT
GDK_TYPE_VULKAN_CONTEXT
GDK_RENDERING_VULKAN
GDK_VULKAN_ERROR
gdk_vulkan_context_get_type
gdk_vulkan_error_quark
gdk_vulkan_strerror
+25 -21
View File
@@ -45,10 +45,13 @@ private_headers = [
'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',
@@ -159,25 +162,26 @@ 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),
],
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,
install: true)
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),
],
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,
install: true,
)
endif
+79 -4
View File
@@ -20,6 +20,40 @@ 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>
@@ -32,6 +66,7 @@ GskCairoNode
GskClipNode
GskColorMatrixNode
GskColorNode
GskConicGradientNode
GskContainerNode
GskCrossFadeNode
GskDebugNode
@@ -56,25 +91,29 @@ 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 Nodes>
<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
gsk_repeating_linear_gradient_node_new
<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
@@ -82,16 +121,18 @@ gsk_radial_gradient_node_get_end
gsk_radial_gradient_node_get_hradius
gsk_radial_gradient_node_get_vradius
gsk_radial_gradient_node_get_center
gsk_repeating_radial_gradient_node_new
<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
@@ -99,6 +140,7 @@ 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
@@ -106,45 +148,57 @@ 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
@@ -152,12 +206,15 @@ 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
@@ -175,13 +232,17 @@ 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
@@ -189,6 +250,7 @@ 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
@@ -199,22 +261,25 @@ 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_gl_shader_node_get_type
GSK_TYPE_BLEND_MODE
<SUBSECTION Standard>
gsk_serialization_error_quark
@@ -237,6 +302,8 @@ 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>
@@ -286,10 +353,12 @@ 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
@@ -321,4 +390,10 @@ 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>
+54 -27
View File
@@ -1,27 +1,48 @@
private_headers = [
'gsk-autocleanup.h',
'gskcairoblurprivate.h',
'gskcairorendererprivate.h',
'gskdebugprivate.h',
'gskgldriverprivate.h',
'gskglprofilerprivate.h',
'gskglrendererprivate.h',
'gskdiffprivate.h',
'gskglshaderprivate.h',
'gskprivate.h',
'gskprofilerprivate.h',
'gskrendererprivate.h',
'gskrendernodeprivate.h',
'gskrendernodeparserprivate.h',
'gskroundedrectprivate.h',
'gskshaderbuilderprivate.h',
'gsktextureprivate.h',
'gsktransformprivate.h',
'gskvulkanblendpipelineprivate.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',
@@ -31,6 +52,8 @@ private_headers = [
'gskvulkanrenderpassprivate.h',
'gskvulkanrenderprivate.h',
'gskvulkanshaderprivate.h',
'gskvulkantextpipelineprivate.h',
'gskvulkantexturepipelineprivate.h',
]
images = [
@@ -40,25 +63,29 @@ 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,
],
dependencies: libgtk_dep,
gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
scan_args: [
'--ignore-decorators=_GDK_EXTERN',
'--ignore-headers=' + ' '.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,
install: true)
mode: 'none',
main_xml: 'gsk4-docs.xml',
src_dir: [
gskinc,
],
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,
install: true,
)
endif
+73 -2
View File
@@ -618,6 +618,14 @@ GtkBuildable
GtkBuildableIface
GtkBuildableParser
gtk_buildable_get_buildable_id
<SUBSECTION Parser>
gtk_buildable_parse_context_get_element
gtk_buildable_parse_context_get_element_stack
gtk_buildable_parse_context_get_position
gtk_buildable_parse_context_pop
gtk_buildable_parse_context_push
<SUBSECTION Standard>
GTK_BUILDABLE
GTK_IS_BUILDABLE
@@ -835,6 +843,8 @@ gtk_combo_box_get_active_id
gtk_combo_box_set_active_id
gtk_combo_box_get_model
gtk_combo_box_set_model
gtk_combo_box_popup
gtk_combo_box_popup_for_device
gtk_combo_box_popdown
gtk_combo_box_get_row_separator_func
gtk_combo_box_set_row_separator_func
@@ -1001,7 +1011,6 @@ gtk_editable_label_get_type
<FILE>gtktext</FILE>
<TITLE>GtkText</TITLE>
GtkText
GtkTextClass
gtk_text_new
gtk_text_new_with_buffer
gtk_text_set_buffer
@@ -2757,7 +2766,6 @@ gtk_sort_list_model_get_type
GtkSpinButton
GtkSpinButtonUpdatePolicy
GtkSpinType
gtk_spin_button_configure
gtk_spin_button_new
gtk_spin_button_new_with_range
gtk_spin_button_set_adjustment
@@ -2781,6 +2789,7 @@ gtk_spin_button_set_snap_to_ticks
gtk_spin_button_get_snap_to_ticks
gtk_spin_button_set_climb_rate
gtk_spin_button_get_climb_rate
gtk_spin_button_configure
gtk_spin_button_spin
gtk_spin_button_update
GTK_INPUT_ERROR
@@ -2829,6 +2838,7 @@ gtk_statusbar_push
gtk_statusbar_pop
gtk_statusbar_remove
gtk_statusbar_remove_all
gtk_statusbar_get_message
<SUBSECTION Standard>
GTK_STATUSBAR
GTK_IS_STATUSBAR
@@ -2963,6 +2973,8 @@ GTK_TEXT_BUFFER_GET_CLASS
gtk_text_buffer_get_type
<SUBSECTION Private>
GtkTextBufferPrivate
gtk_text_byte_begins_utf8_char
gtk_text_unknown_char_utf8_gtk_tests_only
</SECTION>
<SECTION>
@@ -4002,6 +4014,10 @@ gtk_cell_renderer_get_padding
gtk_cell_renderer_set_padding
gtk_cell_renderer_get_state
gtk_cell_renderer_is_activatable
gtk_cell_renderer_get_is_expanded
gtk_cell_renderer_get_is_expander
gtk_cell_renderer_set_is_expanded
gtk_cell_renderer_set_is_expander
<SUBSECTION Width-for-height>
gtk_cell_renderer_get_preferred_height
@@ -4286,6 +4302,7 @@ gtk_snapshot_push_shadow
gtk_snapshot_push_debug
gtk_snapshot_push_gl_shader
gtk_snapshot_pop
gtk_snapshot_gl_shader_pop_texture
gtk_snapshot_save
gtk_snapshot_restore
gtk_snapshot_transform
@@ -4308,6 +4325,9 @@ gtk_snapshot_append_conic_gradient
gtk_snapshot_append_border
gtk_snapshot_append_inset_shadow
gtk_snapshot_append_outset_shadow
gtk_snapshot_append_radial_gradient
gtk_snapshot_append_repeating_radial_gradient
gtk_snapshot_render_insertion_cursor
gtk_snapshot_render_background
gtk_snapshot_render_frame
gtk_snapshot_render_focus
@@ -4442,6 +4462,7 @@ gtk_widget_get_focusable
gtk_widget_set_focusable
gtk_widget_get_focus_on_click
gtk_widget_set_focus_on_click
gtk_widget_get_focus_child
gtk_widget_set_focus_child
gtk_widget_get_can_target
gtk_widget_set_can_target
@@ -5105,6 +5126,34 @@ GTK_PRINTER_GET_CLASS
<SUBSECTION Private>
GtkPrinterPrivate
gtk_printer_get_type
GtkPrinterOption
gtk_printer_option_allocate_choices
gtk_printer_option_choices_from_array
gtk_printer_option_clear_has_conflict
gtk_printer_option_get_activates_default
gtk_printer_option_get_type
gtk_printer_option_has_choice
gtk_printer_option_new
gtk_printer_option_set
gtk_printer_option_set_activates_default
gtk_printer_option_set_add
gtk_printer_option_set_boolean
gtk_printer_option_set_clear_conflicts
gtk_printer_option_set_foreach
gtk_printer_option_set_foreach_in_group
gtk_printer_option_set_get_groups
gtk_printer_option_set_get_type
gtk_printer_option_set_has_conflict
gtk_printer_option_set_lookup
gtk_printer_option_set_new
gtk_printer_option_set_remove
GtkPrinterOptionWidget
gtk_printer_option_widget_get_external_label
gtk_printer_option_widget_get_type
gtk_printer_option_widget_get_value
gtk_printer_option_widget_has_external_label
gtk_printer_option_widget_new
gtk_printer_option_widget_set_source
</SECTION>
@@ -5297,6 +5346,7 @@ GtkCustomPaperUnixDialogClass
<SUBSECTION Private>
gtk_paper_size_get_type
gtk_custom_paper_unix_dialog_get_type
gtk_print_load_custom_papers
GtkCustomPaperUnixDialogPrivate
</SECTION>
@@ -5452,6 +5502,20 @@ gtk_test_init
gtk_test_list_all_types
gtk_test_register_all_types
gtk_test_widget_wait_for_draw
<SUBSECTION Accessibility>
gtk_test_accessible_assert_property
gtk_test_accessible_assert_relation
gtk_test_accessible_assert_role
gtk_test_accessible_assert_state
gtk_test_accessible_check_property
gtk_test_accessible_check_relation
gtk_test_accessible_check_state
gtk_test_accessible_has_property
gtk_test_accessible_has_relation
gtk_test_accessible_has_role
gtk_test_accessible_has_state
<SECTION Private>
gtk_test_accessible_assertion_message_role
</SECTION>
<SECTION>
@@ -6131,6 +6195,8 @@ gtk_popover_get_offset
gtk_popover_set_default_widget
gtk_popover_set_cascade_popdown
gtk_popover_get_cascade_popdown
gtk_popover_get_mnemonics_visible
gtk_popover_set_mnemonics_visible
<SUBSECTION Standard>
GTK_TYPE_POPOVER
GTK_IS_POPOVER
@@ -6974,6 +7040,8 @@ gtk_native_get_for_surface
gtk_native_get_surface
gtk_native_get_renderer
gtk_native_get_surface_transform
gtk_native_realize
gtk_native_unrealize
<SUBSECTION Private>
gtk_native_get_type
@@ -7514,6 +7582,9 @@ gtk_accessible_reset_property
gtk_accessible_update_relation
gtk_accessible_update_relation_value
gtk_accessible_reset_relation
gtk_accessible_property_init_value
gtk_accessible_relation_init_value
gtk_accessible_state_init_value
<SUBSECTION Standard>
GTK_TYPE_ACCESSIBLE
+8 -3
View File
@@ -19,8 +19,8 @@ gtk_assistant_page_get_type
gtk_at_context_get_type
gtk_bin_layout_get_type
gtk_bitset_get_type
gtk_expression_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
@@ -46,6 +46,7 @@ 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
@@ -65,14 +66,16 @@ 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_target_get_type
gtk_drop_target_async_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
@@ -87,6 +90,7 @@ 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
@@ -250,6 +254,7 @@ 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
+12 -15
View File
@@ -119,21 +119,18 @@ around or to activate a widget that does not currently have the focus.
GTK has traditionally supported different kinds of shortcuts:
Accelerators
: Accelerators are any other shortcuts that can be activated regardless
of where the focus is, and typically trigger global actions, such as
Ctrl-Q to quit an application.
Mnmemonics
: 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
triggered without the modifier.
Key bindings
: 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
triggered when the widget has focus.
- Accelerators are any other shortcuts that can be activated regardless
of where the focus is, and typically trigger global actions, such as
Ctrl-Q to quit an application.
- 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
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
triggered when the widget has focus.
GTK handles accelerators and mnemonics in a global scope, during the
capture phase, and key bindings locally, during the target phase.
+107 -46
View File
@@ -20,13 +20,19 @@ private_headers = [
'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',
@@ -38,6 +44,7 @@ private_headers = [
'gtkcolumnviewsorterprivate.h',
'gtkcolumnviewtitleprivate.h',
'gtkcomboboxprivate.h',
'gtkcomposetable.h',
'gtkconstraintexpressionprivate.h',
'gtkconstraintguideprivate.h',
'gtkconstraintlayoutprivate.h',
@@ -45,6 +52,7 @@ private_headers = [
'gtkconstraintsolverprivate.h',
'gtkconstrainttypesprivate.h',
'gtkconstraintvflparserprivate.h',
'gtkcountingbloomfilterprivate.h',
'gtkcssanimatedstyleprivate.h',
'gtkcssanimationprivate.h',
'gtkcssarrayvalueprivate.h',
@@ -55,6 +63,7 @@ private_headers = [
'gtkcsscalcvalueprivate.h',
'gtkcsscolorvalueprivate.h',
'gtkcsscornervalueprivate.h',
'gtkcssdataurlprivate.h',
'gtkcssdimensionvalueprivate.h',
'gtkcssdynamicprivate.h',
'gtkcsseasevalueprivate.h',
@@ -63,6 +72,7 @@ private_headers = [
'gtkcssfontfeaturesvalueprivate.h',
'gtkcssfontvariationsvalueprivate.h',
'gtkcssiconthemevalueprivate.h',
'gtkcssimageconicprivate.h',
'gtkcssimagecrossfadeprivate.h',
'gtkcssimagefallbackprivate.h',
'gtkcssimageiconthemeprivate.h',
@@ -79,6 +89,7 @@ private_headers = [
'gtkcssinheritvalueprivate.h',
'gtkcssinitialvalueprivate.h',
'gtkcsskeyframesprivate.h',
'gtkcsslocationprivate.h',
'gtkcsslookupprivate.h',
'gtkcssmatcherprivate.h',
'gtkcssnodedeclarationprivate.h',
@@ -94,6 +105,7 @@ private_headers = [
'gtkcssrgbavalueprivate.h',
'gtkcsssectionprivate.h',
'gtkcssselectorprivate.h',
'gtkcssserializerprivate.h',
'gtkcssshadowsvalueprivate.h',
'gtkcssshadowvalueprivate.h',
'gtkcssshorthandpropertyprivate.h',
@@ -102,6 +114,7 @@ private_headers = [
'gtkcssstylechangeprivate.h',
'gtkcssstyleprivate.h',
'gtkcssstylepropertyprivate.h',
'gtkcsstokenizerprivate.h',
'gtkcsstransformvalueprivate.h',
'gtkcsstransientnodeprivate.h',
'gtkcsstransitionprivate.h',
@@ -111,6 +124,9 @@ private_headers = [
'gtkcsswidgetnodeprivate.h',
'gtkcsswin32sizevalueprivate.h',
'gtkdialogprivate.h',
'gtkdragdestprivate.h',
'gtkdropprivate.h',
'gtkemojicompletion.h',
'gtkentryprivate.h',
'gtkeventcontrollerlegacyprivate.h',
'gtkeventcontrollerprivate.h',
@@ -119,6 +135,7 @@ private_headers = [
'gtkfilechooserprivate.h',
'gtkfilechooserwidgetprivate.h',
'gtkfilefilterprivate.h',
'gtkflowboxprivate.h',
'gtkfontchooserprivate.h',
'gtkfontchooserwidgetprivate.h',
'gtkgesturedragprivate.h',
@@ -142,16 +159,25 @@ private_headers = [
'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',
@@ -159,21 +185,33 @@ private_headers = [
'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',
@@ -181,6 +219,7 @@ private_headers = [
'gtkrenderborderprivate.h',
'gtkrendericonprivate.h',
'gtkrendernodepaintableprivate.h',
'gtkrootprivate.h',
'gtkroundedboxprivate.h',
'gtkscalerprivate.h',
'gtksearchengine.h',
@@ -188,19 +227,27 @@ private_headers = [
'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',
@@ -210,12 +257,17 @@ private_headers = [
'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',
@@ -227,14 +279,20 @@ private_headers = [
'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 = [
@@ -459,44 +517,46 @@ if get_option('gtk_doc')
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@'])
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,
],
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,
install: true)
mode: 'none',
main_xml: 'gtk4-docs.xml',
src_dir: [
gtkinc,
],
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,
install: true,
)
endif
xsltproc = find_program('xsltproc', required: false)
@@ -531,16 +591,17 @@ if get_option('man-pages') and xsltproc.found()
man_name = man.get(0)
man_section = man.get(1, '1')
custom_target('@0@.@1@'.format(man_name, man_section),
input: '@0@.xml'.format(man_name),
output: '@0@.@1@'.format(man_name, man_section),
command: [
xsltproc,
xlstproc_flags,
'-o', '@OUTPUT@',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)))
input: '@0@.xml'.format(man_name),
output: '@0@.@1@'.format(man_name, man_section),
command: [
xsltproc,
xlstproc_flags,
'-o', '@OUTPUT@',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)),
)
endforeach
endif
+14 -1
View File
@@ -1062,7 +1062,7 @@ to start a drag manually, call gdk_drag_begin().
The ::drag-data-get signal has been replaced by the #GtkDragSource::prepare
signal, which returns a #GdkContentProvider for the drag operation.
The destination-side Drag-and-Drop apis in GTK 4 have also been changed
The destination-side Drag-and-Drop API in GTK 4 have also been changed
to use an event controller, #GtkDropTarget. Instead of calling
gtk_drag_dest_set() and connecting to #GtkWidget signals, you create
a #GtkDropTarget object, attach it to the widget with
@@ -1149,6 +1149,19 @@ pointer coordinates as inout arguments any more, but as normal in ones.
See: gtk_tree_view_get_tooltip_context(), gtk_icon_view_get_tooltip_context()
### Stop using GtkFileChooserButton
The `GtkFileChooserButton` widget was removed, due to its shortcomings in
the user interaction. You can replace it with a simple #GtkButton that
shows a #GtkFileChooserNative dialog when clicked; once the file selection
has completed, you can update the label of the #GtkButton with the selected
file.
### Adapt to changed GtkSettings properties
In GTK 3 the #GtkSettings:gtk-cursor-aspect-ratio property of #GtkSettings was
a float. In GTK 4 this has been changed to a double.
## Changes to consider after the switch
GTK 4 has a number of new features that you may want to take
+4 -4
View File
@@ -97,11 +97,11 @@ the question you have, this list is a good place to start.
#define N_(x) x
#define C_(ctx,x) pgettext (ctx, x)
You use N_() (N stands for no-op) to mark a string for translation in
You use `N_()` (N stands for no-op) to mark a string for translation in
a location where a function call to gettext() is not allowed, such as
in an array initializer. You eventually have to call gettext() on the
string to actually fetch the translation. _() both marks the string for
translation and actually translates it. The C_() macro (C stands for
string to actually fetch the translation. `_()` both marks the string for
translation and actually translates it. The `C_()` macro (C stands for
context) adds an additional context to the string that is marked for
translation, which can help to disambiguate short strings that might
need different translations in different parts of your program.
@@ -190,7 +190,7 @@ the question you have, this list is a good place to start.
encode string literals in UTF-8 by using octal or hexadecimal escapes
like `\212` or `\xa8` to encode each byte. This is portable, but
modifying the escaped strings is not very convenient. Be careful when
mixing hexadecimal escapes with ordinary text; `"\xa8abcd" is a string
mixing hexadecimal escapes with ordinary text; `"\xa8abcd"` is a string
of length 1 !
- Runtime conversion
+8 -4
View File
@@ -1542,6 +1542,7 @@ gdk_broadway_toplevel_present (GdkToplevel *toplevel,
int width, height;
GdkGeometry geometry;
GdkSurfaceHints mask;
gboolean maximize;
gdk_broadway_surface_unminimize (surface);
@@ -1583,10 +1584,13 @@ gdk_broadway_toplevel_present (GdkToplevel *toplevel,
gdk_surface_constrain_size (&geometry, mask, width, height, &width, &height);
gdk_broadway_surface_toplevel_resize (surface, width, height);
if (gdk_toplevel_layout_get_maximized (layout))
gdk_broadway_surface_maximize (surface);
else
gdk_broadway_surface_unmaximize (surface);
if (gdk_toplevel_layout_get_maximized (layout, &maximize))
{
if (maximize)
gdk_broadway_surface_maximize (surface);
else
gdk_broadway_surface_unmaximize (surface);
}
if (size.shadow.is_valid)
{
+14 -6
View File
@@ -59,17 +59,25 @@ libgdk_broadway = static_library('gdk-broadway',
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_args: common_ldflags,
dependencies: [gdk_deps, gdk_broadway_deps])
dependencies: [gdk_deps, gdk_broadway_deps],
)
# gtk4-broadwayd
broadwayd_syslib = os_win32 ? find_library('ws2_32') : shmlib
executable('gtk4-broadwayd',
clienthtml_h, broadwayjs_h, gdkconfig, gdkenum_h,
'broadwayd.c', 'broadway-server.c', 'broadway-output.c',
sources: [
clienthtml_h,
broadwayjs_h,
gdkconfig,
gdkenum_h,
'broadwayd.c',
'broadway-server.c',
'broadway-output.c',
],
include_directories: [confinc, gdkinc, include_directories('.')],
c_args: ['-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ],
dependencies : [broadwayd_syslib, gdk_deps],
install : true)
dependencies: [ broadwayd_syslib, gdk_deps ],
install: true,
)
+7 -4
View File
@@ -182,6 +182,7 @@ G_GNUC_UNUSED static inline void
gdk_array(splice) (GdkArray *self,
gsize pos,
gsize removed,
gboolean stolen,
_T_ *additions,
gsize added)
{
@@ -192,8 +193,9 @@ gdk_array(splice) (GdkArray *self,
g_assert (pos + removed <= size);
remaining = size - pos - removed;
gdk_array(free_elements) (gdk_array(index) (self, pos),
gdk_array(index) (self, pos + removed));
if (!stolen)
gdk_array(free_elements) (gdk_array(index) (self, pos),
gdk_array(index) (self, pos + removed));
gdk_array(reserve) (self, size - removed + added);
@@ -225,9 +227,9 @@ gdk_array(set_size) (GdkArray *self,
{
gsize old_size = gdk_array(get_size) (self);
if (new_size > old_size)
gdk_array(splice) (self, old_size, 0, NULL, new_size - old_size);
gdk_array(splice) (self, old_size, 0, FALSE, NULL, new_size - old_size);
else
gdk_array(splice) (self, new_size, old_size - new_size, NULL, 0);
gdk_array(splice) (self, new_size, old_size - new_size, FALSE, NULL, 0);
}
G_GNUC_UNUSED static void
@@ -241,6 +243,7 @@ gdk_array(append) (GdkArray *self,
gdk_array(splice) (self,
gdk_array(get_size) (self),
0,
FALSE,
#ifdef GDK_ARRAY_BY_VALUE
value,
#else
+94
View File
@@ -1138,6 +1138,22 @@ gdk_event_get_axes (GdkEvent *event,
return GDK_EVENT_GET_CLASS (event)->get_axes (event, axes, n_axes);
}
double *
gdk_event_dup_axes (GdkEvent *event)
{
double *axes;
guint n_axes;
if (gdk_event_get_axes (event, &axes, &n_axes))
{
double *axes_copy = g_memdup (axes, n_axes * sizeof (double));
return axes_copy;
}
return NULL;
}
/**
* gdk_event_get_event_type:
* @event: a #GdkEvent
@@ -1314,6 +1330,12 @@ gdk_event_get_position (GdkEvent *event,
/* {{{ GdkButtonEvent */
/**
* GdkButtonEvent:
*
* An event related to a button on a pointer device/
*/
static void
gdk_button_event_finalize (GdkEvent *event)
{
@@ -1438,6 +1460,12 @@ gdk_button_event_get_button (GdkEvent *event)
/* {{{ GdkKeyEvent */
/**
* GdkKeyEvent:
*
* An event related to a key-based device.
*/
static GdkModifierType
gdk_key_event_get_state (GdkEvent *event)
{
@@ -1819,6 +1847,12 @@ gdk_key_event_get_match (GdkEvent *event,
/* {{{ GdkTouchEvent */
/**
* GdkTouchEvent:
*
* An event related to a touch-based device.
*/
static void
gdk_touch_event_finalize (GdkEvent *event)
{
@@ -1950,6 +1984,12 @@ gdk_touch_event_get_emulating_pointer (GdkEvent *event)
/* {{{ GdkCrossingEvent */
/**
* GdkCrossingEvent:
*
* An event caused by a pointing device moving between surfaces.
*/
static void
gdk_crossing_event_finalize (GdkEvent *event)
{
@@ -2088,6 +2128,12 @@ gdk_crossing_event_get_detail (GdkEvent *event)
/* {{{ GdkDeleteEvent */
/**
* GdkDeleteEvent:
*
* An event related to closing a top-level surface.
*/
static const GdkEventTypeInfo gdk_delete_event_info = {
sizeof (GdkDeleteEvent),
NULL,
@@ -2113,6 +2159,12 @@ gdk_delete_event_new (GdkSurface *surface)
/* {{{ GdkFocusEvent */
/**
* GdkFocusEvent:
*
* An event related to a focus change.
*/
static const GdkEventTypeInfo gdk_focus_event_info = {
sizeof (GdkFocusEvent),
NULL,
@@ -2164,6 +2216,12 @@ gdk_focus_event_get_in (GdkEvent *event)
/* {{{ GdkScrollEvent */
/**
* GdkScrollEvent:
*
* An event related to a scrolling motion.
*/
static void
gdk_scroll_event_finalize (GdkEvent *event)
{
@@ -2321,6 +2379,12 @@ gdk_scroll_event_is_stop (GdkEvent *event)
/* {{{ GdkTouchpadEvent */
/**
* GdkTouchpadEvent:
*
* An event related to a touchpad device.
*/
static GdkModifierType
gdk_touchpad_event_get_state (GdkEvent *event)
{
@@ -2517,6 +2581,12 @@ gdk_touchpad_event_get_pinch_scale (GdkEvent *event)
/* {{{ GdkPadEvent */
/**
* GdkPadEvent:
*
* An event related to a pad-based device.
*/
static const GdkEventTypeInfo gdk_pad_event_info = {
sizeof (GdkPadEvent),
NULL,
@@ -2685,6 +2755,12 @@ gdk_pad_event_get_group_mode (GdkEvent *event,
/* {{{ GdkMotionEvent */
/**
* GdkMotionEvent:
*
* An event related to a pointer or touch device motion.
*/
static void
gdk_motion_event_finalize (GdkEvent *event)
{
@@ -2839,6 +2915,12 @@ gdk_event_get_history (GdkEvent *event,
/* {{{ GdkProximityEvent */
/**
* GdkProximityEvent:
*
* An event related to the proximity of a tool to a device.
*/
static void
gdk_proximity_event_finalize (GdkEvent *event)
{
@@ -2896,6 +2978,12 @@ gdk_proximity_event_new (GdkEventType type,
/* {{{ GdkDNDEvent */
/**
* GdkDNDEvent:
*
* An event related to drag and drop operations.
*/
static void
gdk_dnd_event_finalize (GdkEvent *event)
{
@@ -2996,6 +3084,12 @@ gdk_dnd_event_get_drop (GdkEvent *event)
/* {{{ GdkGrabBrokenEvent */
/**
* GdkGrabBrokenEvent:
*
* An event related to a broken windowing system grab.
*/
static const GdkEventTypeInfo gdk_grab_broken_event_info = {
sizeof (GdkGrabBrokenEvent),
NULL,
+2 -4
View File
@@ -476,10 +476,6 @@ GdkEvent * gdk_focus_event_new (GdkSurface *surface,
GdkDevice *device,
gboolean focus_in);
GdkEvent * gdk_configure_event_new (GdkSurface *surface,
int width,
int height);
GdkEvent * gdk_delete_event_new (GdkSurface *surface);
GdkEvent * gdk_scroll_event_new (GdkSurface *surface,
@@ -607,6 +603,8 @@ void _gdk_event_queue_handle_motion_compression (GdkDisplay *display);
void gdk_event_queue_handle_scroll_compression (GdkDisplay *display);
void _gdk_event_queue_flush (GdkDisplay *display);
double * gdk_event_dup_axes (GdkEvent *event);
G_END_DECLS
+1
View File
@@ -202,6 +202,7 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
if (cairo_surface_status (surface) || dest == NULL)
{
cairo_surface_destroy (surface);
g_clear_object (&dest);
return NULL;
}
+30 -6
View File
@@ -681,6 +681,8 @@ gdk_surface_finalize (GObject *object)
{
GdkSurface *surface = GDK_SURFACE (object);
g_clear_handle_id (&surface->request_motion_id, g_source_remove);
g_signal_handlers_disconnect_by_func (surface->display,
seat_removed_cb, surface);
@@ -1354,6 +1356,13 @@ gdk_surface_layout_on_clock (GdkFrameClock *clock,
g_signal_emit (surface, signals[LAYOUT], 0, surface->width, surface->height);
}
/**
* gdk_surface_request_layout:
* @surface: a #GdkSurface
*
* Request a %GDK_FRAME_CLOCK_PHASE_LAYOUT from the surface's
* frame clock. See gdk_frame_clock_request_phase().
*/
void
gdk_surface_request_layout (GdkSurface *surface)
{
@@ -1553,6 +1562,20 @@ gdk_surface_freeze_updates (GdkSurface *surface)
_gdk_frame_clock_uninhibit_freeze (surface->frame_clock);
}
static gboolean
request_motion_cb (void *data)
{
GdkSurface *surface = GDK_SURFACE (data);
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
if (clock)
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
surface->request_motion_id = 0;
return G_SOURCE_REMOVE;
}
/*
* gdk_surface_thaw_updates:
* @surface: a #GdkSurface
@@ -1576,6 +1599,13 @@ gdk_surface_thaw_updates (GdkSurface *surface)
if (surface->pending_phases)
gdk_frame_clock_request_phase (frame_clock, surface->pending_phases);
if (surface->request_motion && surface->request_motion_id == 0)
{
surface->request_motion_id =
g_idle_add_full (GDK_PRIORITY_REDRAW + 20,
request_motion_cb, surface, NULL);
}
}
}
@@ -2912,13 +2942,7 @@ gdk_surface_handle_event (GdkEvent *event)
void
gdk_surface_request_motion (GdkSurface *surface)
{
GdkFrameClock *frame_clock;
surface->request_motion = TRUE;
frame_clock = gdk_surface_get_frame_clock (surface);
if (frame_clock)
gdk_frame_clock_request_phase (frame_clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
}
/**
+2
View File
@@ -80,6 +80,8 @@ struct _GdkSurface
guint shortcuts_inhibited : 1;
guint request_motion : 1;
guint request_motion_id;
struct {
GdkGravity surface_anchor;
GdkGravity rect_anchor;
+39 -10
View File
@@ -40,7 +40,10 @@ struct _GdkToplevelLayout
grefcount ref_count;
guint resizable : 1;
guint maximized_valid : 1;
guint maximized : 1;
guint fullscreen_valid : 1;
guint fullscreen : 1;
GdkMonitor *fullscreen_monitor;
};
@@ -70,7 +73,9 @@ gdk_toplevel_layout_new (void)
layout = g_new0 (GdkToplevelLayout, 1);
g_ref_count_init (&layout->ref_count);
layout->resizable = TRUE;
layout->maximized_valid = FALSE;
layout->maximized = FALSE;
layout->fullscreen_valid = FALSE;
layout->fullscreen = FALSE;
layout->fullscreen_monitor = NULL;
@@ -125,7 +130,9 @@ gdk_toplevel_layout_copy (GdkToplevelLayout *layout)
g_ref_count_init (&new_layout->ref_count);
new_layout->resizable = layout->resizable;
new_layout->maximized_valid = layout->maximized_valid;
new_layout->maximized = layout->maximized;
new_layout->fullscreen_valid = layout->fullscreen_valid;
new_layout->fullscreen = layout->fullscreen;
if (layout->fullscreen_monitor)
new_layout->fullscreen_monitor = g_object_ref (layout->fullscreen_monitor);
@@ -151,7 +158,9 @@ gdk_toplevel_layout_equal (GdkToplevelLayout *layout,
g_return_val_if_fail (other, FALSE);
return layout->resizable == other->resizable &&
layout->maximized_valid == other->maximized_valid &&
layout->maximized == other->maximized &&
layout->fullscreen_valid == other->fullscreen_valid &&
layout->fullscreen == other->fullscreen &&
layout->fullscreen_monitor == other->fullscreen_monitor;
}
@@ -198,22 +207,32 @@ void
gdk_toplevel_layout_set_maximized (GdkToplevelLayout *layout,
gboolean maximized)
{
layout->maximized_valid = TRUE;
layout->maximized = maximized;
}
/**
* gdk_toplevel_layout_get_maximized:
* @layout: a #GdkToplevelLayout
* @maximized: (out): set to %TRUE if the toplevel should be maximized
*
* Returns whether the layout should present the
* surface as maximized.
* If the layout specifies whether to the toplevel should go maximized,
* the value pointed to by @maximized is set to %TRUE if it should go
* fullscreen, or %FALSE, if it should go unmaximized.
*
* Returns: %TRUE if the layout is maximized
* Returns: whether the @layout specifies the maximized state for the toplevel
*/
gboolean
gdk_toplevel_layout_get_maximized (GdkToplevelLayout *layout)
gdk_toplevel_layout_get_maximized (GdkToplevelLayout *layout,
gboolean *maximized)
{
return layout->maximized;
if (layout->maximized_valid)
{
*maximized = layout->maximized;
return TRUE;
}
return FALSE;
}
/**
@@ -230,6 +249,7 @@ gdk_toplevel_layout_set_fullscreen (GdkToplevelLayout *layout,
gboolean fullscreen,
GdkMonitor *monitor)
{
layout->fullscreen_valid = TRUE;
layout->fullscreen = fullscreen;
if (monitor)
layout->fullscreen_monitor = g_object_ref (monitor);
@@ -238,16 +258,25 @@ gdk_toplevel_layout_set_fullscreen (GdkToplevelLayout *layout,
/**
* gdk_toplevel_layout_get_fullscreen:
* @layout: a #GdkToplevelLayout
* @fullscreen: (out): location to store whether the toplevel should be fullscreen
*
* Returns whether the layout should cause the surface
* to be fullscreen when presented.
* If the layout specifies whether to the toplevel should go fullscreen,
* the value pointed to by @fullscreen is set to %TRUE if it should go
* fullscreen, or %FALSE, if it should go unfullscreen.
*
* Returns: %TRUE if @layout is fullscreen
* Returns: whether the @layout specifies the fullscreen state for the toplevel
*/
gboolean
gdk_toplevel_layout_get_fullscreen (GdkToplevelLayout *layout)
gdk_toplevel_layout_get_fullscreen (GdkToplevelLayout *layout,
gboolean *fullscreen)
{
return layout->fullscreen;
if (layout->fullscreen_valid)
{
*fullscreen = layout->fullscreen;
return TRUE;
}
return FALSE;
}
/**
+4 -2
View File
@@ -66,10 +66,12 @@ void gdk_toplevel_layout_set_fullscreen (GdkToplevelLayout *l
GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL
gboolean gdk_toplevel_layout_get_maximized (GdkToplevelLayout *layout);
gboolean gdk_toplevel_layout_get_maximized (GdkToplevelLayout *layout,
gboolean *maximized);
GDK_AVAILABLE_IN_ALL
gboolean gdk_toplevel_layout_get_fullscreen (GdkToplevelLayout *layout);
gboolean gdk_toplevel_layout_get_fullscreen (GdkToplevelLayout *layout,
gboolean *fullscreen);
GDK_AVAILABLE_IN_ALL
GdkMonitor * gdk_toplevel_layout_get_fullscreen_monitor (GdkToplevelLayout *layout);
+55 -27
View File
@@ -24,8 +24,25 @@
#include <glib.h>
/**
* GDK_MAJOR_VERSION:
*
* The major version component of the library's version, e.g. "1" for "1.2.3".
*/
#define GDK_MAJOR_VERSION (@GTK_MAJOR_VERSION@)
/**
* GDK_MINOR_VERSION:
*
* The minor version component of the library's version, e.g. "2" for "1.2.3".
*/
#define GDK_MINOR_VERSION (@GTK_MINOR_VERSION@)
/**
* GDK_MICRO_VERSION:
*
* The micro version component of the library's version, e.g. "3" for "1.2.3".
*/
#define GDK_MICRO_VERSION (@GTK_MICRO_VERSION@)
#ifndef _GDK_EXTERN
@@ -35,9 +52,10 @@
/**
* GDK_DISABLE_DEPRECATION_WARNINGS:
*
* A macro that should be defined before including the gdk.h header.
* If it is defined, no compiler warnings will be produced for uses
* of deprecated GDK and GTK APIs.
* A macro that should be defined before including the `gdk.h` header.
*
* If this symbol is defined, no compiler warnings will be produced for
* uses of deprecated GDK and GTK APIs.
*/
#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
@@ -52,9 +70,6 @@
/* XXX: Every new stable minor release bump should add a macro here */
#define GDK_VERSION_3_92 (G_ENCODE_VERSION (3, 92))
#define GDK_VERSION_3_94 (G_ENCODE_VERSION (3, 94))
/**
* GDK_VERSION_4_0:
*
@@ -65,26 +80,34 @@
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
* this means the next stable target, with a hard backstop to the
* beginning of the stable series
*/
#if (GDK_MINOR_VERSION % 2)
#define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
#elif G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION) > GDK_VERSION_4_0
# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
#else
#define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
# define GDK_VERSION_CUR_STABLE GDK_VERSION_4_0
#endif
/* evaluates to the previous stable version */
#if (GDK_MINOR_VERSION % 2)
#define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
/* evaluates to the previous stable version, with a hard backstop
* to the beginning of the stable series
*/
#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
#elif GDK_MAJOR_VERSION >= 4 && GDK_MINOR_VERSION > 2
# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
#else
#define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
# define GDK_VERSION_PREV_STABLE GDK_VERSION_4_0
#endif
/**
* GDK_VERSION_MIN_REQUIRED:
*
* A macro that should be defined by the user prior to including
* the gdk.h header.
* the `gdk.h` header.
*
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
*
@@ -102,7 +125,8 @@
* GDK_VERSION_MAX_ALLOWED:
*
* A macro that should be defined by the user prior to including
* the gdk.h header.
* the `gdk.h` header.
*
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
*
@@ -122,29 +146,33 @@
/* sanity checks */
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
#error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
# error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
#endif
#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_3_92
#error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_92"
#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_4_0
# error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_4_0"
#endif
#define GDK_AVAILABLE_IN_ALL _GDK_EXTERN
/* XXX: Every new stable minor release should add a set of macros here */
/* This is not really necessary for 4.0, since there can't be an
* earlier version, and there are no deprecated symbols. We just
* include it for completeness, and because it's easier to copy
* this stanza every time a new development cycle starts.
*/
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_0
# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
#else
# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_92
# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_0
# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
+6 -140
View File
@@ -95,141 +95,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GdkVulkanContext, gdk_vulkan_context, GDK_TYPE
const char *
gdk_vulkan_strerror (VkResult result)
{
/* If your compiler brought you here with a warning about missing
* enumeration values, you're running a newer Vulkan version than
* the GTK developers (or you are a GTK developer) and have
* encountered a newly added Vulkan error message.
* You want to add it to this enum now.
*
* Because the Vulkan people don't make adding this too easy, here's
* the process to manage it:
* 1. go to
* https://github.com/KhronosGroup/Vulkan-Headers/blob/master/include/vulkan/vulkan_core.h
* 2. Find the line where this enum value was added.
* 3. Click the commit that added this line.
* 4. The commit you're looking at now should also change
* VK_HEADER_VERSION, find that number.
* 5. Use that number in the #ifdef when adding the enum value to
* this enum.
* 6. For the error message, look at the specification (the one
* that includes all extensions) at
* https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkResult
* 7. If this value has not been added to the specification yet,
* search for the error message in the text of specification.
* Often it will have a description that can be used as an error
* message.
* 8. If that didn't lead to one (or you are lazy), just use the
* literal string of the enum value as the error message. A
* GTK developer will add the correct one once it's added to the
* specification.
*/
switch (result)
{
case VK_SUCCESS:
return "Command successfully completed.";
case VK_NOT_READY:
return "A fence or query has not yet completed.";
case VK_TIMEOUT:
return "A wait operation has not completed in the specified time.";
case VK_EVENT_SET:
return "An event is signaled.";
case VK_EVENT_RESET:
return "An event is unsignaled.";
case VK_INCOMPLETE:
return "A return array was too small for the result.";
case VK_SUBOPTIMAL_KHR:
return "A swapchain no longer matches the surface properties exactly, but can still be used to present to the surface successfully.";
case VK_ERROR_OUT_OF_HOST_MEMORY:
return "A host memory allocation has failed.";
case VK_ERROR_OUT_OF_DEVICE_MEMORY:
return "A device memory allocation has failed.";
case VK_ERROR_INITIALIZATION_FAILED:
return "Initialization of an object could not be completed for implementation-specific reasons.";
case VK_ERROR_DEVICE_LOST:
return "The logical or physical device has been lost.";
case VK_ERROR_MEMORY_MAP_FAILED:
return "Mapping of a memory object has failed.";
case VK_ERROR_LAYER_NOT_PRESENT:
return "A requested layer is not present or could not be loaded.";
case VK_ERROR_EXTENSION_NOT_PRESENT:
return "A requested extension is not supported.";
case VK_ERROR_FEATURE_NOT_PRESENT:
return "A requested feature is not supported.";
case VK_ERROR_INCOMPATIBLE_DRIVER:
return "The requested version of Vulkan is not supported by the driver or is otherwise incompatible for implementation-specific reasons.";
case VK_ERROR_TOO_MANY_OBJECTS:
return "Too many objects of the type have already been created.";
case VK_ERROR_FORMAT_NOT_SUPPORTED:
return "A requested format is not supported on this device.";
#if VK_HEADER_VERSION >= 24
case VK_ERROR_FRAGMENTED_POOL:
return "A requested pool allocation has failed due to fragmentation of the pools memory.";
#endif
case VK_ERROR_SURFACE_LOST_KHR:
return "A surface is no longer available.";
case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR:
return "The requested window is already in use by Vulkan or another API in a manner which prevents it from being used again.";
case VK_ERROR_OUT_OF_DATE_KHR:
return "A surface has changed in such a way that it is no longer compatible with the swapchain.";
case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
return "The display used by a swapchain does not use the same presentable image layout, or is incompatible in a way that prevents sharing an image.";
case VK_ERROR_VALIDATION_FAILED_EXT:
return "The application caused the validation layer to fail.";
case VK_ERROR_INVALID_SHADER_NV:
return "One or more shaders failed to compile or link.";
#if VK_HEADER_VERSION >= 39
case VK_ERROR_OUT_OF_POOL_MEMORY_KHR:
return "A pool memory allocation has failed.";
#endif
#if VK_HEADER_VERSION >= 54
case VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR:
return "An external handle is not a valid handle of the specified type.";
#endif
#if VK_HEADER_VERSION >= 64
case VK_ERROR_NOT_PERMITTED_EXT:
return "The caller does not have sufficient privileges.";
#endif
#if VK_HEADER_VERSION >= 72
case VK_ERROR_FRAGMENTATION_EXT:
return "A descriptor pool creation has failed due to fragmentation";
#endif
#if VK_HEADER_VERSION >= 89
case VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT:
return "Invalid DRM format modifier plane layout";
#endif
#if VK_HEADER_VERSION >= 97
case VK_ERROR_INVALID_DEVICE_ADDRESS_EXT:
return "Invalid device address";
#endif
#if VK_HEADER_VERSION >= 105
case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT:
return "An operation on a swapchain created with VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT failed as it did not have exclusive full-screen access.";
#endif
#if VK_HEADER_VERSION >= 131
case VK_ERROR_UNKNOWN:
return "An unknown error has occurred; either the application has provided invalid input, or an implementation failure has occurred.";
#endif
#if VK_HEADER_VERSION >= 135
case VK_ERROR_INCOMPATIBLE_VERSION_KHR:
return "Acceleration structure serialized with version as the version information is not compatible with device.";
case VK_THREAD_IDLE_KHR:
return "A deferred operation is not complete but there is currently no work for this thread to do at the time of this call.";
case VK_THREAD_DONE_KHR:
return "A deferred operation is not complete but there is no work remaining to assign to additional threads.";
case VK_OPERATION_DEFERRED_KHR:
return "A deferred operation was requested and at least some of the work was deferred.";
case VK_OPERATION_NOT_DEFERRED_KHR:
return "A deferred operation was requested and no operations were deferred.";
case VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT:
return "A requested pipeline creation would have required compilation, but the application requested compilation to not be performed.";
#endif
#if VK_HEADER_VERSION < 140
case VK_RESULT_RANGE_SIZE:
#endif
case VK_RESULT_MAX_ENUM:
default:
return "Unknown Vulkan error.";
}
return "Unknown Vulkan error.";
}
static void
@@ -304,7 +170,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
if (res != VK_SUCCESS)
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
"Could not query surface capabilities: %s", gdk_vulkan_strerror (res));
"Could not query surface capabilities: %d", res);
return FALSE;
}
@@ -401,7 +267,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
else
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
"Could not create swapchain for this surface: %s", gdk_vulkan_strerror (res));
"Could not create swapchain for this surface: %d", res);
priv->swapchain = VK_NULL_HANDLE;
return FALSE;
}
@@ -577,7 +443,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
if (res != VK_SUCCESS)
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
"Could not create surface for this surface: %s", gdk_vulkan_strerror (res));
"Could not create surface for this surface: %d", res);
return FALSE;
}
@@ -588,7 +454,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
if (res != VK_SUCCESS)
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
"Could not check if queue family supports this surface: %s", gdk_vulkan_strerror (res));
"Could not check if queue family supports this surface: %d", res);
}
else if (!supported)
{
@@ -1116,7 +982,7 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
if (res != VK_SUCCESS)
{
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
"Could not create a Vulkan instance: %s", gdk_vulkan_strerror (res));
"Could not create a Vulkan instance: %d", res);
return FALSE;
}
-2
View File
@@ -230,9 +230,7 @@
NSRect content_rect;
GdkSurface *surface;
GdkDisplay *display;
GdkEvent *event;
gboolean maximized;
GList *node;
surface = GDK_SURFACE (gdk_surface);
display = gdk_surface_get_display (surface);
+5 -5
View File
@@ -85,6 +85,11 @@ void _gdk_macos_surface_get_shadow (GdkMacosSurface
int *right,
int *bottom,
int *left);
void _gdk_macos_surface_set_shadow (GdkMacosSurface *self,
int top,
int right,
int bottom,
int left);
NSView *_gdk_macos_surface_get_view (GdkMacosSurface *self);
gboolean _gdk_macos_surface_get_modal_hint (GdkMacosSurface *self);
void _gdk_macos_surface_set_modal_hint (GdkMacosSurface *self,
@@ -125,11 +130,6 @@ void _gdk_macos_surface_set_opacity (GdkMacosSurface
void _gdk_macos_surface_get_root_coords (GdkMacosSurface *self,
int *x,
int *y);
void _gdk_macos_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom);
G_END_DECLS
+5 -5
View File
@@ -140,11 +140,11 @@ gdk_macos_surface_get_scale_factor (GdkSurface *surface)
}
void
gdk_macos_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom)
_gdk_macos_surface_set_shadow (GdkMacosSurface *surface,
int top,
int right,
int bottom,
int left)
{
GdkMacosSurface *self = (GdkMacosSurface *)surface;
+21 -13
View File
@@ -96,6 +96,8 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel,
GdkGeometry geometry;
GdkSurfaceHints mask;
NSWindowStyleMask style_mask;
gboolean maximize;
gboolean fullscreen;
g_assert (GDK_IS_MACOS_TOPLEVEL_SURFACE (self));
g_assert (GDK_IS_MACOS_WINDOW (nswindow));
@@ -157,11 +159,11 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel,
if (size.shadow.is_valid)
{
_gdk_macos_surface_set_shadow_width (surface,
size.shadow.left,
size.shadow.right,
size.shadow.top,
size.shadow.bottom);
_gdk_macos_surface_set_shadow (GDK_MACOS_SURFACE (surface),
size.shadow.top,
size.shadow.right,
size.shadow.bottom,
size.shadow.left);
}
_gdk_macos_surface_set_geometry_hints (GDK_MACOS_SURFACE (self), &geometry, mask);
@@ -169,16 +171,22 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel,
_gdk_macos_surface_resize (GDK_MACOS_SURFACE (self), width, height);
/* Maximized state */
if (gdk_toplevel_layout_get_maximized (layout))
_gdk_macos_toplevel_surface_maximize (self);
else
_gdk_macos_toplevel_surface_unmaximize (self);
if (gdk_toplevel_layout_get_maximized (layout, &maximize))
{
if (maximize)
_gdk_macos_toplevel_surface_maximize (self);
else
_gdk_macos_toplevel_surface_unmaximize (self);
}
/* Fullscreen state */
if (gdk_toplevel_layout_get_fullscreen (layout))
_gdk_macos_toplevel_surface_fullscreen (self);
else
_gdk_macos_toplevel_surface_unfullscreen (self);
if (gdk_toplevel_layout_get_fullscreen (layout, &fullscreen))
{
if (fullscreen)
_gdk_macos_toplevel_surface_fullscreen (self);
else
_gdk_macos_toplevel_surface_unfullscreen (self);
}
if (GDK_SURFACE (self)->transient_for != NULL)
{
+6 -6
View File
@@ -55,9 +55,9 @@ gdk_macos_deps = [
libgdk_c_args += ['-xobjective-c']
libgdk_macos = static_library('gdk-macos',
gdk_macos_sources, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: libgdk_c_args + common_cflags,
link_args: common_ldflags,
link_with: [],
dependencies: gdk_deps + gdk_macos_deps)
gdk_macos_sources, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: [ libgdk_c_args, common_cflags, ],
link_with: [],
dependencies: [ gdk_deps, gdk_macos_deps, ],
)
+31 -22
View File
@@ -112,32 +112,39 @@ gdk_private_h_sources = files([
'gdktoplevelsizeprivate.h',
])
gdk_gresource_xml = configure_file(output : 'gdk.gresource.xml',
input : 'gen-gdk-gresources-xml.py',
command : [find_program('gen-gdk-gresources-xml.py'),
meson.current_source_dir(), '@OUTPUT@'])
gdk_gresource_xml = configure_file(output: 'gdk.gresource.xml',
input: 'gen-gdk-gresources-xml.py',
command: [
find_program('gen-gdk-gresources-xml.py'),
meson.current_source_dir(),
'@OUTPUT@',
],
)
gdkresources = gnome.compile_resources('gdkresources',
gdk_gresource_xml,
source_dir: '.',
c_name: '_gdk',
extra_args: '--manual-register')
extra_args: '--manual-register',
)
gdk_headers = gdk_public_headers
gdk_enums = gnome.mkenums('gdkenumtypes',
sources: gdk_public_headers,
c_template : 'gdkenumtypes.c.template',
h_template : 'gdkenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gdk'),
install_header : true)
c_template: 'gdkenumtypes.c.template',
h_template: 'gdkenumtypes.h.template',
install_dir: gtk_includedir / 'gtk-4.0/gdk',
install_header: true,
)
gdkenum_h = gdk_enums[1]
gdk_marshalers = gnome.genmarshal('gdkmarshalers',
sources : 'gdkmarshalers.list',
prefix : '_gdk_marshal',
valist_marshallers : true)
sources: 'gdkmarshalers.list',
prefix: '_gdk_marshal',
valist_marshallers: true,
)
gdkmarshal_h = gdk_marshalers[1]
@@ -150,11 +157,11 @@ gdkconfig_cdata.set('GDK_WINDOWING_MACOS', macos_enabled)
gdkconfig_cdata.set('GDK_RENDERING_VULKAN', have_vulkan)
gdkconfig = configure_file(
input : 'gdkconfig.h.meson',
output : 'gdkconfig.h',
configuration : gdkconfig_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gdk'))
input: 'gdkconfig.h.meson',
output: 'gdkconfig.h',
configuration: gdkconfig_cdata,
install_dir: gtk_includedir / 'gtk-4.0/gdk',
)
gdkversion_cdata = configuration_data()
gdkversion_cdata.set('GTK_MAJOR_VERSION', gtk_major_version)
@@ -162,10 +169,11 @@ gdkversion_cdata.set('GTK_MINOR_VERSION', gtk_minor_version)
gdkversion_cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
gdkversionmacros = configure_file(
input : 'gdkversionmacros.h.in',
output : 'gdkversionmacros.h',
input: 'gdkversionmacros.h.in',
output: 'gdkversionmacros.h',
configuration: gdkversion_cdata,
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gdk'))
install_dir: gtk_includedir / 'gtk-4.0/gdk',
)
gdkinc = include_directories('.')
gdkx11_inc = include_directories('x11')
@@ -251,7 +259,7 @@ libgdk = static_library('gdk',
include_directories: [confinc, gdkx11_inc, wlinc],
c_args: libgdk_c_args + common_cflags,
link_whole: gdk_backends,
link_args: common_ldflags)
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
@@ -259,4 +267,5 @@ libgdk = static_library('gdk',
libgdk_dep = declare_dependency(
sources: ['gdk.h', gdkconfig, gdkenum_h],
include_directories: [confinc, gdkx11_inc, wlinc],
dependencies: gdk_deps + [libgtk_css_dep])
dependencies: gdk_deps + [libgtk_css_dep],
)
+5 -5
View File
@@ -5,8 +5,8 @@ wayland_cursor_sources = files([
])
libwayland_cursor = static_library('wayland+cursor',
sources: wayland_cursor_sources,
include_directories: [ confinc, ],
dependencies: [ glib_dep, wlclientdep, ],
c_args: common_cflags,
link_args: common_ldflags)
sources: wayland_cursor_sources,
include_directories: [ confinc, ],
dependencies: [ glib_dep, wlclientdep, ],
c_args: common_cflags,
)
+6 -46
View File
@@ -4865,48 +4865,6 @@ gdk_wayland_toplevel_class_init (GdkWaylandToplevelClass *class)
gdk_toplevel_install_properties (object_class, 1);
}
static gboolean
did_maximize_layout_change (GdkToplevel *toplevel,
GdkToplevelLayout *layout)
{
GdkSurface *surface = GDK_SURFACE (toplevel);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!impl->toplevel.layout)
return TRUE;
if (gdk_toplevel_layout_get_maximized (impl->toplevel.layout) !=
gdk_toplevel_layout_get_maximized (layout) ||
!!(surface->state & GDK_TOPLEVEL_STATE_MAXIMIZED) !=
gdk_toplevel_layout_get_maximized (layout))
return TRUE;
return FALSE;
}
static gboolean
did_fullscreen_layout_change (GdkToplevel *toplevel,
GdkToplevelLayout *layout)
{
GdkSurface *surface = GDK_SURFACE (toplevel);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!impl->toplevel.layout)
return TRUE;
if (gdk_toplevel_layout_get_fullscreen (impl->toplevel.layout) !=
gdk_toplevel_layout_get_fullscreen (layout) ||
!!(surface->state & GDK_TOPLEVEL_STATE_FULLSCREEN) !=
gdk_toplevel_layout_get_fullscreen (layout))
return TRUE;
if (gdk_toplevel_layout_get_fullscreen_monitor (impl->toplevel.layout) !=
gdk_toplevel_layout_get_fullscreen_monitor (layout))
return TRUE;
return FALSE;
}
static void
gdk_wayland_toplevel_present (GdkToplevel *toplevel,
GdkToplevelLayout *layout)
@@ -4914,19 +4872,21 @@ gdk_wayland_toplevel_present (GdkToplevel *toplevel,
GdkSurface *surface = GDK_SURFACE (toplevel);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
gboolean pending_configure = FALSE;
gboolean maximize;
gboolean fullscreen;
if (did_maximize_layout_change (toplevel, layout))
if (gdk_toplevel_layout_get_maximized (layout, &maximize))
{
if (gdk_toplevel_layout_get_maximized (layout))
if (maximize)
gdk_wayland_surface_maximize (surface);
else
gdk_wayland_surface_unmaximize (surface);
pending_configure = TRUE;
}
if (did_fullscreen_layout_change (toplevel, layout))
if (gdk_toplevel_layout_get_fullscreen (layout, &fullscreen))
{
if (gdk_toplevel_layout_get_fullscreen (layout))
if (fullscreen)
{
GdkMonitor *monitor;
+30 -23
View File
@@ -77,31 +77,38 @@ foreach p: proto_sources
endif
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
])
input: input,
output: '@0@-client-protocol.h'.format(output_base),
command: [
wayland_scanner,
'client-header',
'@INPUT@', '@OUTPUT@',
],
)
gdk_wayland_sources += custom_target('@0@ source'.format(output_base),
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
])
input: input,
output: '@0@-protocol.c'.format(output_base),
command: [
wayland_scanner,
'private-code',
'@INPUT@', '@OUTPUT@',
],
)
endforeach
libgdk_wayland = static_library('gdk-wayland',
gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_args: common_ldflags,
link_with: [libwayland_cursor, ],
dependencies: [ gdk_deps, gdk_wayland_deps])
sources: [
gdk_wayland_sources,
gdk_wayland_gen_headers,
gdkconfig,
gdkenum_h,
],
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_with: [ libwayland_cursor, ],
dependencies: [ gdk_deps, gdk_wayland_deps ],
)
+16 -8
View File
@@ -4942,6 +4942,8 @@ gdk_win32_toplevel_present (GdkToplevel *toplevel,
int width, height;
GdkGeometry geometry;
GdkSurfaceHints mask;
gboolean maximize;
gboolean fullscreen;
monitor = gdk_display_get_monitor_at_surface (display, surface);
if (monitor)
@@ -4981,15 +4983,21 @@ gdk_win32_toplevel_present (GdkToplevel *toplevel,
gdk_surface_constrain_size (&geometry, mask, width, height, &width, &height);
gdk_win32_surface_resize (surface, width, height);
if (gdk_toplevel_layout_get_maximized (layout))
gdk_win32_surface_maximize (surface);
else
gdk_win32_surface_unmaximize (surface);
if (gdk_toplevel_layout_get_maximized (layout, &maximize))
{
if (maximize)
gdk_win32_surface_maximize (surface);
else
gdk_win32_surface_unmaximize (surface);
}
if (gdk_toplevel_layout_get_fullscreen (layout))
gdk_win32_surface_fullscreen (surface);
else
gdk_win32_surface_unfullscreen (surface);
if (gdk_toplevel_layout_get_fullscreen (layout, &fullscreen))
{
if (fullscreen)
gdk_win32_surface_fullscreen (surface);
else
gdk_win32_surface_unfullscreen (surface);
}
show_surface (surface);
+9 -4
View File
@@ -50,11 +50,16 @@ if win32_has_egl
endif
gdk_win32_deps = [ # FIXME
pangowin32_dep
pangowin32_dep
]
libgdk_win32 = static_library('gdk-win32',
gdk_win32_sources, gdkconfig, gdkenum_h,
include_directories: [confinc, gdkinc],
c_args: ['-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', '-DINSIDE_GDK_WIN32'] + GDK_WIN32_EGL_CFLAGS,
dependencies: [gdk_deps, gdk_win32_deps])
include_directories: [ confinc, gdkinc ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
'-DINSIDE_GDK_WIN32',
] + GDK_WIN32_EGL_CFLAGS,
dependencies: [ gdk_deps, gdk_win32_deps ],
)
+31
View File
@@ -1,9 +1,40 @@
/* gdkdevice-xi2-private.h: Private header for GdkX11DeviceXI2
*
* Copyright 2020 Red Hat
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DEVICE_XI2_PRIVATE_H__
#define __GDK_DEVICE_XI2_PRIVATE_H__
#include "gdkx11device-xi2.h"
G_BEGIN_DECLS
void gdk_x11_device_xi2_query_state (GdkDevice *device,
GdkSurface *surface,
double *win_x,
double *win_y,
GdkModifierType *mask);
GdkX11DeviceType gdk_x11_device_xi2_get_device_type (GdkX11DeviceXI2 *device);
void gdk_x11_device_xi2_set_device_type (GdkX11DeviceXI2 *device,
GdkX11DeviceType type);
G_END_DECLS
#endif
+39 -9
View File
@@ -18,8 +18,8 @@
#include "config.h"
#include "gdkx11devicemanager-xi2.h"
#include "gdkx11device-xi2.h"
#include "gdkdevice-xi2-private.h"
#include "gdkdeviceprivate.h"
#include "gdkdevicetoolprivate.h"
#include "gdkdisplayprivate.h"
@@ -1716,19 +1716,49 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
&xev->valuators, &delta_x, &delta_y))
{
GdkModifierType state;
GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("smooth scroll: \n\tdevice: %u\n\tsource device: %u\n\twindow %ld\n\tdeltas: %f %f",
xev->deviceid, xev->sourceid,
xev->event, delta_x, delta_y));
event = gdk_scroll_event_new (surface,
device,
NULL,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
delta_x,
delta_y,
delta_x == 0.0 && delta_y == 0.0);
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
if (gdk_device_get_source (source_device) != GDK_SOURCE_TOUCHPAD &&
((delta_x == 0.0 && ABS (delta_y) == 1.0) ||
(ABS (delta_x) == 1.0 && delta_y == 0.0)))
{
GdkScrollDirection direction;
if (delta_x > 0)
direction = GDK_SCROLL_RIGHT;
else if (delta_x < 0)
direction = GDK_SCROLL_LEFT;
else if (delta_y > 0)
direction = GDK_SCROLL_DOWN;
else
direction = GDK_SCROLL_UP;
event = gdk_scroll_event_new_discrete (surface,
device,
NULL,
xev->time,
state,
direction,
FALSE);
}
else
{
event = gdk_scroll_event_new (surface,
device,
NULL,
xev->time,
state,
delta_x,
delta_y,
delta_x == 0.0 && delta_y == 0.0);
}
break;
}
+24 -14
View File
@@ -5078,6 +5078,8 @@ gdk_x11_toplevel_present (GdkToplevel *toplevel,
GdkX11Surface *impl = GDK_X11_SURFACE (surface);
int width, height;
gboolean was_mapped;
gboolean maximize;
gboolean fullscreen;
if (surface->destroyed)
return;
@@ -5092,23 +5094,31 @@ gdk_x11_toplevel_present (GdkToplevel *toplevel,
if (compute_toplevel_size (surface, DONT_UPDATE_GEOMETRY, &width, &height))
gdk_x11_surface_toplevel_resize (surface, width, height);
if (gdk_toplevel_layout_get_maximized (layout))
gdk_x11_surface_maximize (surface);
else
gdk_x11_surface_unmaximize (surface);
if (gdk_toplevel_layout_get_fullscreen (layout))
if (gdk_toplevel_layout_get_maximized (layout, &maximize))
{
GdkMonitor *fullscreen_monitor =
gdk_toplevel_layout_get_fullscreen_monitor (layout);
if (fullscreen_monitor)
gdk_x11_surface_fullscreen_on_monitor (surface, fullscreen_monitor);
if (maximize)
gdk_x11_surface_maximize (surface);
else
gdk_x11_surface_fullscreen (surface);
gdk_x11_surface_unmaximize (surface);
}
if (gdk_toplevel_layout_get_fullscreen (layout, &fullscreen))
{
if (fullscreen)
{
GdkMonitor *fullscreen_monitor =
gdk_toplevel_layout_get_fullscreen_monitor (layout);
if (fullscreen_monitor)
gdk_x11_surface_fullscreen_on_monitor (surface, fullscreen_monitor);
else
gdk_x11_surface_fullscreen (surface);
}
else
{
gdk_x11_surface_unfullscreen (surface);
}
}
else
gdk_x11_surface_unfullscreen (surface);
impl->next_layout.surface_geometry_dirty = TRUE;
gdk_surface_request_layout (surface);
-4
View File
@@ -41,10 +41,6 @@ typedef enum {
GDK_AVAILABLE_IN_ALL
GType gdk_x11_device_xi2_get_type (void) G_GNUC_CONST;
GdkX11DeviceType gdk_x11_device_xi2_get_device_type (GdkX11DeviceXI2 *device);
void gdk_x11_device_xi2_set_device_type (GdkX11DeviceXI2 *device,
GdkX11DeviceType type);
G_END_DECLS
#endif /* __GDK_X11_DEVICE_XI2_H__ */
+14 -9
View File
@@ -72,12 +72,17 @@ gdk_x11_deps = [
xinerama_dep,
]
libgdk_x11 = static_library('gdk-x11', gdkmarshal_h,
gdk_x11_sources, gdkconfig, gdkenum_h,
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
link_args: common_ldflags,
dependencies: [ gdk_deps, gdk_x11_deps, ])
libgdk_x11 = static_library('gdk-x11',
sources: [
gdkmarshal_h,
gdkenum_h,
gdkconfig,
gdk_x11_sources,
],
include_directories: [ confinc, gdkinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gdk"',
] + common_cflags,
dependencies: [ gdk_deps, gdk_x11_deps, ],
)
+4 -2
View File
@@ -586,7 +586,8 @@ texture_key_hash (gconstpointer v)
const GskTextureKey *k = (GskTextureKey *)v;
return GPOINTER_TO_UINT (k->pointer)
+ (guint)(k->scale*100)
+ (guint)(k->scale_x * 100)
+ (guint)(k->scale_y * 100)
+ (guint)k->filter * 2 +
+ (guint)k->pointer_is_child;
}
@@ -598,7 +599,8 @@ texture_key_equal (gconstpointer v1, gconstpointer v2)
const GskTextureKey *k2 = (GskTextureKey *)v2;
return k1->pointer == k2->pointer &&
k1->scale == k2->scale &&
k1->scale_x == k2->scale_x &&
k1->scale_y == k2->scale_y &&
k1->filter == k2->filter &&
k1->pointer_is_child == k2->pointer_is_child &&
(!k1->pointer_is_child || graphene_rect_equal (&k1->parent_rect, &k2->parent_rect));
+2 -1
View File
@@ -23,7 +23,8 @@ typedef struct {
typedef struct {
gpointer pointer;
float scale;
float scale_x;
float scale_y;
int filter;
int pointer_is_child;
graphene_rect_t parent_rect; /* Only set if pointer_is_child */
+109 -75
View File
@@ -76,7 +76,6 @@ typedef enum
{
FORCE_OFFSCREEN = 1 << 0,
RESET_CLIP = 1 << 1,
RESET_OPACITY = 1 << 2,
DUMP_FRAMEBUFFER = 1 << 3,
NO_CACHE_PLZ = 1 << 5,
LINEAR_FILTER = 1 << 6,
@@ -244,6 +243,21 @@ _graphene_rect_contains_rect (const graphene_rect_t *r1,
return false;
}
static inline bool G_GNUC_PURE
equal_texture_nodes (GskRenderNode *node1,
GskRenderNode *node2)
{
if (gsk_render_node_get_node_type (node1) != GSK_TEXTURE_NODE ||
gsk_render_node_get_node_type (node2) != GSK_TEXTURE_NODE)
return false;
if (gsk_texture_node_get_texture (node1) !=
gsk_texture_node_get_texture (node2))
return false;
return graphene_rect_equal (&node1->bounds, &node2->bounds);
}
static inline void
sort_border_sides (const GdkRGBA *colors,
int *indices)
@@ -632,10 +646,11 @@ render_fallback_node (GskGLRenderer *self,
GskRenderNode *node,
RenderOpBuilder *builder)
{
const float scale_x = builder->scale_x;
const float scale_y = builder->scale_y;
const int surface_width = ceilf (node->bounds.size.width * scale_x);
const int surface_height = ceilf (node->bounds.size.height * scale_y);
GdkTexture *texture;
const float scale = ops_get_scale (builder);
const int surface_width = ceilf (node->bounds.size.width * scale);
const int surface_height = ceilf (node->bounds.size.height * scale);
cairo_surface_t *surface;
cairo_surface_t *rendered_surface;
cairo_t *cr;
@@ -649,7 +664,8 @@ render_fallback_node (GskGLRenderer *self,
key.pointer = node;
key.pointer_is_child = FALSE;
key.scale = scale;
key.scale_x = scale_x;
key.scale_y = scale_y;
key.filter = GL_NEAREST;
cached_id = gsk_gl_driver_get_texture_for_key (self->gl_driver, &key);
@@ -671,7 +687,7 @@ render_fallback_node (GskGLRenderer *self,
surface_width,
surface_height);
cairo_surface_set_device_scale (rendered_surface, scale, scale);
cairo_surface_set_device_scale (rendered_surface, scale_x, scale_y);
cr = cairo_create (rendered_surface);
cairo_save (cr);
@@ -684,15 +700,15 @@ render_fallback_node (GskGLRenderer *self,
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
surface_width,
surface_height);
cairo_surface_set_device_scale (surface, scale, scale);
cairo_surface_set_device_scale (surface, scale_x, scale_y);
cr = cairo_create (surface);
/* We draw upside down here, so it matches what GL does. */
cairo_save (cr);
cairo_scale (cr, 1, -1);
cairo_translate (cr, 0, - surface_height / scale);
cairo_translate (cr, 0, - surface_height / scale_y);
cairo_set_source_surface (cr, rendered_surface, 0, 0);
cairo_rectangle (cr, 0, 0, surface_width / scale, surface_height / scale);
cairo_rectangle (cr, 0, 0, surface_width / scale_x, surface_height / scale_y);
cairo_fill (cr);
cairo_restore (cr);
@@ -754,7 +770,7 @@ render_text_node (GskGLRenderer *self,
{
const PangoFont *font = gsk_text_node_get_font (node);
const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
const float text_scale = ops_get_scale (builder);
const float text_scale = MAX (builder->scale_x, builder->scale_y); /* TODO: Fix for uneven scales? */
const graphene_point_t *offset = gsk_text_node_get_offset (node);
const guint num_glyphs = gsk_text_node_get_num_glyphs (node);
const float x = offset->x + builder->dx;
@@ -1224,7 +1240,7 @@ render_gl_shader_node (GskGLRenderer *self,
&node->bounds,
child,
&regions[i], &is_offscreen[i],
FORCE_OFFSCREEN | RESET_CLIP | RESET_OPACITY))
FORCE_OFFSCREEN | RESET_CLIP))
return;
}
@@ -1343,7 +1359,7 @@ render_transform_node (GskGLRenderer *self,
&child->bounds,
child,
&region, &is_offscreen,
RESET_CLIP | RESET_OPACITY | filter_flag))
RESET_CLIP | filter_flag))
{
/* For non-trivial transforms, we draw everything on a texture and then
* draw the texture transformed. */
@@ -1390,7 +1406,7 @@ render_opacity_node (GskGLRenderer *self,
if (!add_offscreen_ops (self, builder, &child->bounds,
child,
&region, &is_offscreen,
FORCE_OFFSCREEN | RESET_OPACITY | RESET_CLIP))
FORCE_OFFSCREEN | RESET_CLIP))
return;
prev_opacity = ops_set_opacity (builder,
@@ -1628,22 +1644,18 @@ render_clipped_child (GskGLRenderer *self,
/* well fuck */
const float scale_x = builder->scale_x;
const float scale_y = builder->scale_y;
const GskRoundedRect scaled_clip = GSK_ROUNDED_RECT_INIT (clip->origin.x * scale_x,
clip->origin.y * scale_y,
clip->size.width * scale_x,
clip->size.height * scale_y);
gboolean is_offscreen;
TextureRegion region;
GskRoundedRect scaled_clip;
memset (&scaled_clip, 0, sizeof (GskRoundedRect));
scaled_clip.bounds.origin.x = clip->origin.x * scale_x;
scaled_clip.bounds.origin.y = clip->origin.y * scale_y;
scaled_clip.bounds.size.width = clip->size.width * scale_x;
scaled_clip.bounds.size.height = clip->size.height * scale_y;
ops_push_clip (builder, &scaled_clip);
if (!add_offscreen_ops (self, builder, &child->bounds,
child,
&region, &is_offscreen,
RESET_OPACITY | FORCE_OFFSCREEN))
FORCE_OFFSCREEN))
g_assert_not_reached ();
ops_pop_clip (builder);
@@ -1759,7 +1771,7 @@ render_rounded_clip_node (GskGLRenderer *self,
if (!add_offscreen_ops (self, builder, &node->bounds,
child,
&region, &is_offscreen,
FORCE_OFFSCREEN | RESET_OPACITY))
0))
g_assert_not_reached ();
ops_pop_clip (builder);
@@ -1787,7 +1799,7 @@ render_color_matrix_node (GskGLRenderer *self,
&node->bounds,
child,
&region, &is_offscreen,
RESET_CLIP | RESET_OPACITY))
RESET_CLIP))
g_assert_not_reached ();
ops_set_program (builder, &self->programs->color_matrix_program);
@@ -1812,6 +1824,7 @@ blur_texture (GskGLRenderer *self,
float blur_radius_x,
float blur_radius_y)
{
const GskRoundedRect new_clip = GSK_ROUNDED_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height);
int pass1_texture_id, pass1_render_target;
int pass2_texture_id, pass2_render_target;
int prev_render_target;
@@ -1838,17 +1851,16 @@ blur_texture (GskGLRenderer *self,
GL_NEAREST, GL_NEAREST,
&pass2_texture_id, &pass2_render_target);
init_projection_matrix (&item_proj,
&GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height));
init_projection_matrix (&item_proj, &new_clip.bounds);
ops_set_program (builder, &self->programs->blur_program);
prev_projection = ops_set_projection (builder, &item_proj);
ops_set_modelview (builder, NULL);
prev_viewport = ops_set_viewport (builder, &GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height));
ops_push_clip (builder, &GSK_ROUNDED_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height));
prev_viewport = ops_set_viewport (builder, &new_clip.bounds);
ops_push_clip (builder, &new_clip);
prev_render_target = ops_set_render_target (builder, pass1_render_target);
ops_begin (builder, OP_CLEAR);
ops_set_program (builder, &self->programs->blur_program);
op = ops_begin (builder, OP_CHANGE_BLUR);
op->size.width = texture_to_blur_width;
@@ -1859,7 +1871,7 @@ blur_texture (GskGLRenderer *self,
ops_set_texture (builder, region->texture_id);
load_vertex_data_with_region (ops_draw (builder, NULL),
&GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height),
&new_clip.bounds,
builder, region,
FALSE);
#if 0
@@ -1881,7 +1893,7 @@ blur_texture (GskGLRenderer *self,
ops_set_render_target (builder, pass2_render_target);
ops_begin (builder, OP_CLEAR);
load_vertex_data_with_region (ops_draw (builder, NULL), /* render pass 2 */
&GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height),
&new_clip.bounds,
builder, region,
FALSE);
@@ -1936,7 +1948,7 @@ blur_node (GskGLRenderer *self,
texture_width, texture_height),
node,
&region, &is_offscreen,
RESET_CLIP | RESET_OPACITY | FORCE_OFFSCREEN | extra_flags))
RESET_CLIP | FORCE_OFFSCREEN | extra_flags))
g_assert_not_reached ();
blurred_texture_id = blur_texture (self, builder,
@@ -1978,7 +1990,8 @@ render_blur_node (GskGLRenderer *self,
key.pointer = node;
key.pointer_is_child = FALSE;
key.scale = ops_get_scale (builder);
key.scale_x = builder->scale_x;
key.scale_y = builder->scale_y;
key.filter = GL_NEAREST;
blurred_region.texture_id = gsk_gl_driver_get_texture_for_key (self->gl_driver, &key);
blur_node (self, child, builder, blur_radius, 0, &blurred_region,
@@ -2041,7 +2054,8 @@ render_inset_shadow_node (GskGLRenderer *self,
key.pointer = node;
key.pointer_is_child = FALSE;
key.scale = MAX (scale_x, scale_y); /* TODO: Use scale_x/scale_y here? */
key.scale_x = scale_x;
key.scale_y = scale_y;
key.filter = GL_NEAREST;
blurred_texture_id = gsk_gl_driver_get_texture_for_key (self->gl_driver, &key);
if (blurred_texture_id == 0)
@@ -2135,7 +2149,14 @@ render_inset_shadow_node (GskGLRenderer *self,
if (needs_clip)
{
const GskRoundedRect node_clip = transform_rect (self, builder, node_outline);
GskRoundedRect node_clip;
ops_transform_bounds_modelview (builder, &node_outline->bounds, &node_clip.bounds);
for (int i = 0; i < 4; i ++)
{
node_clip.corner[i].width = node_outline->corner[i].width * scale_x;
node_clip.corner[i].height = node_outline->corner[i].height * scale_y;
}
ops_push_clip (builder, &node_clip);
}
@@ -2228,14 +2249,13 @@ render_outset_shadow_node (GskGLRenderer *self,
GskRenderNode *node,
RenderOpBuilder *builder)
{
const float scale = ops_get_scale (builder);
const float scale_x = builder->scale_x;
const float scale_y = builder->scale_y;
const GskRoundedRect *outline = gsk_outset_shadow_node_get_outline (node);
const GdkRGBA *color = gsk_outset_shadow_node_get_color (node);
const float blur_radius = gsk_outset_shadow_node_get_blur_radius (node);
const float blur_extra = blur_radius * 2.0f; /* 2.0 = shader radius_multiplier */
const int extra_blur_pixels = (int) ceilf(blur_extra / 2.0 * scale);
const int extra_blur_pixels = (int) ceilf(blur_extra / 2.0 * MAX (scale_x, scale_y)); /* TODO: No need to MAX() her actually */
const float spread = gsk_outset_shadow_node_get_spread (node);
const float dx = gsk_outset_shadow_node_get_dx (node);
const float dy = gsk_outset_shadow_node_get_dy (node);
@@ -2607,7 +2627,7 @@ render_shadow_node (GskGLRenderer *self,
if (!add_offscreen_ops (self, builder,
&shadow_child->bounds,
shadow_child, &region, &is_offscreen,
RESET_CLIP | RESET_OPACITY | NO_CACHE_PLZ))
RESET_CLIP | NO_CACHE_PLZ))
g_assert_not_reached ();
bounds = shadow_child->bounds;
@@ -2653,6 +2673,12 @@ render_cross_fade_node (GskGLRenderer *self,
return;
}
if (equal_texture_nodes (start_node, end_node))
{
gsk_gl_renderer_add_render_ops (self, end_node, builder);
return;
}
/* TODO: We create 2 textures here as big as the cross-fade node, but both the
* start and the end node might be a lot smaller than that. */
@@ -2660,7 +2686,7 @@ render_cross_fade_node (GskGLRenderer *self,
&node->bounds,
start_node,
&start_region, &is_offscreen1,
FORCE_OFFSCREEN | RESET_CLIP | RESET_OPACITY))
FORCE_OFFSCREEN | RESET_CLIP))
{
gsk_gl_renderer_add_render_ops (self, end_node, builder);
return;
@@ -2670,7 +2696,7 @@ render_cross_fade_node (GskGLRenderer *self,
&node->bounds,
end_node,
&end_region, &is_offscreen2,
FORCE_OFFSCREEN | RESET_CLIP | RESET_OPACITY))
FORCE_OFFSCREEN | RESET_CLIP))
{
const float prev_opacity = ops_set_opacity (builder, builder->current_opacity * progress);
gsk_gl_renderer_add_render_ops (self, start_node, builder);
@@ -2773,7 +2799,7 @@ render_repeat_node (GskGLRenderer *self,
&child->bounds,
child,
&region, &is_offscreen,
RESET_CLIP | RESET_OPACITY))
RESET_CLIP))
g_assert_not_reached ();
ops_set_program (builder, &self->programs->repeat_program);
@@ -2914,10 +2940,15 @@ static inline void
apply_color_matrix_op (const Program *program,
const OpColorMatrix *op)
{
float mat[16];
OP_PRINT (" -> Color Matrix");
graphene_matrix_to_float (op->matrix, mat);
glUniformMatrix4fv (program->color_matrix.color_matrix_location, 1, GL_FALSE, mat);
OP_PRINT (" -> Color matrix. Send matrix: %d. Send offset: %d.",
op->matrix.send, op->offset.send);
if (op->matrix.send)
{
float mat[16];
graphene_matrix_to_float (op->matrix.value, mat);
glUniformMatrix4fv (program->color_matrix.color_matrix_location, 1, GL_FALSE, mat);
}
if (op->offset.send)
{
@@ -3173,6 +3204,7 @@ static inline void
apply_repeat_op (const Program *program,
const OpRepeat *op)
{
OP_PRINT (" -> Repeat");
glUniform4fv (program->repeat.child_bounds_location, 1, op->child_bounds);
glUniform4fv (program->repeat.texture_rect_location, 1, op->texture_rect);
}
@@ -3798,9 +3830,11 @@ add_offscreen_ops (GskGLRenderer *self,
gboolean *is_offscreen,
guint flags)
{
float scale, width, height, size, scaled_size;
float width, height;
const float dx = builder->dx;
const float dy = builder->dy;
float scale_x;
float scale_y;
int render_target;
int prev_render_target;
graphene_matrix_t prev_projection;
@@ -3808,10 +3842,10 @@ add_offscreen_ops (GskGLRenderer *self,
graphene_matrix_t item_proj;
float prev_opacity = 1.0;
int texture_id = 0;
int max_texture_size;
int filter;
GskTextureKey key;
int cached_id;
graphene_rect_t viewport;
if (node_is_invisible (child_node))
{
@@ -3841,7 +3875,8 @@ add_offscreen_ops (GskGLRenderer *self,
key.pointer = child_node;
key.pointer_is_child = TRUE; /* Don't conflict with the child using the cache too */
key.parent_rect = *bounds;
key.scale = ops_get_scale (builder);
key.scale_x = builder->scale_x;
key.scale_y = builder->scale_y;
key.filter = filter;
cached_id = gsk_gl_driver_get_texture_for_key (self->gl_driver, &key);
@@ -3853,23 +3888,32 @@ add_offscreen_ops (GskGLRenderer *self,
return TRUE;
}
scale = ops_get_scale (builder);
width = bounds->size.width;
height = bounds->size.height;
scale_x = builder->scale_x;
scale_y = builder->scale_y;
/* Tweak the scale factor so that the required texture doesn't
* exceed the max texture limit. This will render with a lower
* resolution, but this is better than clipping.
*/
{
const int max_texture_size = gsk_gl_driver_get_max_texture_size (self->gl_driver);
size = MAX (width, height);
scaled_size = ceilf (size * scale);
max_texture_size = gsk_gl_driver_get_max_texture_size (self->gl_driver);
if (scaled_size > max_texture_size)
scale *= (float) max_texture_size / scaled_size;
width = ceilf (width * scale_x);
if (width > max_texture_size)
{
scale_x *= (float)max_texture_size / width;
width = max_texture_size;
}
width = ceilf (width * scale);
height = ceilf (height * scale);
height = ceilf (height * scale_y);
if (height > max_texture_size)
{
scale_y *= (float)max_texture_size / height;
height = max_texture_size;
}
}
gsk_gl_driver_create_render_target (self->gl_driver,
width, height,
@@ -3887,33 +3931,24 @@ add_offscreen_ops (GskGLRenderer *self,
render_target);
}
init_projection_matrix (&item_proj,
&GRAPHENE_RECT_INIT (
bounds->origin.x * scale,
bounds->origin.y * scale,
width, height
));
viewport = GRAPHENE_RECT_INIT (bounds->origin.x * scale_x,
bounds->origin.y * scale_y,
width, height);
init_projection_matrix (&item_proj, &viewport);
prev_render_target = ops_set_render_target (builder, render_target);
/* Clear since we use this rendertarget for the first time */
ops_begin (builder, OP_CLEAR);
prev_projection = ops_set_projection (builder, &item_proj);
ops_set_modelview (builder, gsk_transform_scale (NULL, scale, scale));
prev_viewport = ops_set_viewport (builder,
&GRAPHENE_RECT_INIT (bounds->origin.x * scale,
bounds->origin.y * scale,
width, height));
ops_set_modelview (builder, gsk_transform_scale (NULL, scale_x, scale_y));
prev_viewport = ops_set_viewport (builder, &viewport);
if (flags & RESET_CLIP)
ops_push_clip (builder,
&GSK_ROUNDED_RECT_INIT (bounds->origin.x * scale,
bounds->origin.y * scale,
width, height));
ops_push_clip (builder, &GSK_ROUNDED_RECT_INIT_FROM_RECT (viewport));
builder->dx = 0;
builder->dy = 0;
if (flags & RESET_OPACITY)
prev_opacity = ops_set_opacity (builder, 1.0);
prev_opacity = ops_set_opacity (builder, 1.0);
gsk_gl_renderer_add_render_ops (self, child_node, builder);
@@ -3930,8 +3965,7 @@ add_offscreen_ops (GskGLRenderer *self,
}
#endif
if (flags & RESET_OPACITY)
ops_set_opacity (builder, prev_opacity);
ops_set_opacity (builder, prev_opacity);
builder->dx = dx;
builder->dy = dy;
+75 -167
View File
@@ -14,27 +14,28 @@ rect_equal (const graphene_rect_t *a,
return memcmp (a, b, sizeof (graphene_rect_t)) == 0;
}
static inline gboolean G_GNUC_PURE
static inline bool G_GNUC_PURE
rounded_rect_equal (const GskRoundedRect *r1,
const GskRoundedRect *r2)
{
int i;
if (r1 == r2)
return true;
if (!r1)
return FALSE;
return false;
if (r1->bounds.origin.x != r2->bounds.origin.x ||
r1->bounds.origin.y != r2->bounds.origin.y ||
r1->bounds.size.width != r2->bounds.size.width ||
r1->bounds.size.height != r2->bounds.size.height)
return FALSE;
return false;
for (i = 0; i < 4; i ++)
for (int i = 0; i < 4; i ++)
if (r1->corner[i].width != r2->corner[i].width ||
r1->corner[i].height != r2->corner[i].height)
return FALSE;
return false;
return TRUE;
return true;
}
static inline gboolean G_GNUC_PURE
@@ -120,16 +121,6 @@ ops_pop_debug_group (RenderOpBuilder *builder)
ops_begin (builder, OP_POP_DEBUG_GROUP);
}
float
ops_get_scale (const RenderOpBuilder *builder)
{
g_assert (builder->mv_stack != NULL);
g_assert (builder->mv_stack->len >= 1);
/* TODO: Use two separate values */
return MAX (builder->scale_x, builder->scale_y);
}
static void
extract_matrix_metadata (GskTransform *transform,
OpsMatrixMetadata *md)
@@ -218,10 +209,9 @@ ops_free (RenderOpBuilder *builder)
void
ops_set_program (RenderOpBuilder *builder,
Program *program)
Program *program)
{
OpProgram *op;
ProgramState *program_state = NULL;
if (builder->current_program == program)
return;
@@ -230,86 +220,6 @@ ops_set_program (RenderOpBuilder *builder,
op->program = program;
builder->current_program = program;
program_state = &program->state;
if (memcmp (&builder->current_projection, &program_state->projection, sizeof (graphene_matrix_t)) != 0)
{
OpMatrix *opm;
opm = ops_begin (builder, OP_CHANGE_PROJECTION);
opm->matrix = builder->current_projection;
program_state->projection = builder->current_projection;
}
if (program_state->modelview == NULL ||
!gsk_transform_equal (builder->current_modelview, program_state->modelview))
{
OpMatrix *opm;
opm = ops_begin (builder, OP_CHANGE_MODELVIEW);
gsk_transform_to_matrix (builder->current_modelview, &opm->matrix);
gsk_transform_unref (program_state->modelview);
program_state->modelview = gsk_transform_ref (builder->current_modelview);
}
if (!rect_equal (&builder->current_viewport, &program_state->viewport))
{
OpViewport *opv;
opv = ops_begin (builder, OP_CHANGE_VIEWPORT);
opv->viewport = builder->current_viewport;
program_state->viewport = builder->current_viewport;
}
if (!rounded_rect_equal (builder->current_clip, &program_state->clip))
{
OpClip *opc;
opc = ops_begin (builder, OP_CHANGE_CLIP);
opc->clip = *builder->current_clip;
opc->send_corners = !rounded_rect_corners_equal (builder->current_clip, &program_state->clip);
program_state->clip = *builder->current_clip;
}
if (program_state->opacity != builder->current_opacity)
{
OpOpacity *opo;
opo = ops_begin (builder, OP_CHANGE_OPACITY);
opo->opacity = builder->current_opacity;
program_state->opacity = builder->current_opacity;
}
}
static void
ops_set_clip (RenderOpBuilder *builder,
const GskRoundedRect *clip)
{
ProgramState *current_program_state = get_current_program_state (builder);
OpClip *op;
if (current_program_state &&
rounded_rect_equal (&current_program_state->clip, clip))
return;
if (!(op = op_buffer_peek_tail_checked (&builder->render_ops, OP_CHANGE_CLIP)))
{
op = op_buffer_add (&builder->render_ops, OP_CHANGE_CLIP);
op->send_corners = !current_program_state ||
!rounded_rect_corners_equal (&current_program_state->clip, clip);
}
else
{
/* If the op before sent the corners, this one needs, too */
op->send_corners |= !current_program_state ||
!rounded_rect_corners_equal (&current_program_state->clip, clip);
}
op->clip = *clip;
if (current_program_state)
current_program_state->clip = *clip;
}
void
@@ -328,7 +238,6 @@ ops_push_clip (RenderOpBuilder *self,
g_array_append_val (self->clip_stack, entry);
self->current_clip = &g_array_index (self->clip_stack, ClipStackEntry, self->clip_stack->len - 1).rect;
self->clip_is_rectilinear = entry.is_rectilinear;
ops_set_clip (self, clip);
}
void
@@ -346,7 +255,6 @@ ops_pop_clip (RenderOpBuilder *self)
{
self->current_clip = &head->rect;
self->clip_is_rectilinear = head->is_rectilinear;
ops_set_clip (self, &head->rect);
}
else
{
@@ -362,32 +270,6 @@ ops_has_clip (RenderOpBuilder *self)
self->clip_stack->len > 1;
}
static void
ops_set_modelview_internal (RenderOpBuilder *builder,
GskTransform *transform)
{
ProgramState *current_program_state = get_current_program_state (builder);
OpMatrix *op;
#if 0
XXX This is not possible if we want pop() to work.
if (builder->current_program &&
gsk_transform_equal (builder->current_program_state->modelview, transform))
return;
#endif
if (!(op = op_buffer_peek_tail_checked (&builder->render_ops, OP_CHANGE_MODELVIEW)))
op = op_buffer_add (&builder->render_ops, OP_CHANGE_MODELVIEW);
gsk_transform_to_matrix (transform, &op->matrix);
if (builder->current_program != NULL)
{
gsk_transform_unref (current_program_state->modelview);
current_program_state->modelview = gsk_transform_ref (transform);
}
}
/**
* ops_set_modelview:
* @builder
@@ -420,7 +302,6 @@ ops_set_modelview (RenderOpBuilder *builder,
builder->current_modelview = entry->transform;
builder->scale_x = entry->metadata.scale_x;
builder->scale_y = entry->metadata.scale_y;
ops_set_modelview_internal (builder, entry->transform);
}
/* This sets the given modelview to the one we get when multiplying
@@ -466,7 +347,6 @@ ops_push_modelview (RenderOpBuilder *builder,
builder->scale_x = entry->metadata.scale_x;
builder->scale_y = entry->metadata.scale_y;
builder->current_modelview = entry->transform;
ops_set_modelview_internal (builder, entry->transform);
}
void
@@ -490,7 +370,6 @@ ops_pop_modelview (RenderOpBuilder *builder)
builder->scale_x = head->metadata.scale_x;
builder->scale_y = head->metadata.scale_y;
builder->current_modelview = head->transform;
ops_set_modelview_internal (builder, head->transform);
}
else
{
@@ -502,17 +381,7 @@ graphene_matrix_t
ops_set_projection (RenderOpBuilder *builder,
const graphene_matrix_t *projection)
{
ProgramState *current_program_state = get_current_program_state (builder);
graphene_matrix_t prev_mv;
OpMatrix *op;
if (!(op = op_buffer_peek_tail_checked (&builder->render_ops, OP_CHANGE_PROJECTION)))
op = op_buffer_add (&builder->render_ops, OP_CHANGE_PROJECTION);
op->matrix = *projection;
if (builder->current_program != NULL)
current_program_state->projection = *projection;
prev_mv = builder->current_projection;
builder->current_projection = *projection;
@@ -528,9 +397,8 @@ ops_set_viewport (RenderOpBuilder *builder,
OpViewport *op;
graphene_rect_t prev_viewport;
if (current_program_state != NULL &&
rect_equal (&current_program_state->viewport, viewport))
return current_program_state->viewport;
if (rect_equal (&builder->current_viewport, viewport))
return *viewport;
op = ops_begin (builder, OP_CHANGE_VIEWPORT);
op->viewport = *viewport;
@@ -596,24 +464,14 @@ float
ops_set_opacity (RenderOpBuilder *builder,
float opacity)
{
ProgramState *current_program_state = get_current_program_state (builder);
OpOpacity *op;
float prev_opacity;
if (builder->current_opacity == opacity)
return opacity;
if (!(op = op_buffer_peek_tail_checked (&builder->render_ops, OP_CHANGE_OPACITY)))
op = op_buffer_add (&builder->render_ops, OP_CHANGE_OPACITY);
op->opacity = opacity;
prev_opacity = builder->current_opacity;
builder->current_opacity = opacity;
if (builder->current_program != NULL)
current_program_state->opacity = opacity;
return prev_opacity;
}
@@ -676,30 +534,30 @@ ops_set_color_matrix (RenderOpBuilder *builder,
const graphene_vec4_t *offset)
{
ProgramState *current_program_state = get_current_program_state (builder);
const bool offset_equal = graphene_vec4_equal (offset, &current_program_state->color_matrix.offset);
const bool matrix_equal = graphene_matrix_equal_fast (matrix,
&current_program_state->color_matrix.matrix);
OpColorMatrix *op;
bool offset_equal;
offset_equal = memcmp (offset,
&current_program_state->color_matrix.offset,
sizeof (graphene_vec4_t)) == 0;
if (memcmp (matrix,
&current_program_state->color_matrix.matrix,
sizeof (graphene_matrix_t)) == 0 &&
offset_equal)
if (offset_equal && matrix_equal)
return;
current_program_state->color_matrix.matrix = *matrix;
op = ops_begin (builder, OP_CHANGE_COLOR_MATRIX);
op->matrix = matrix;
if (!matrix_equal)
{
current_program_state->color_matrix.matrix = *matrix;
op->matrix.value = matrix;
op->matrix.send = TRUE;
}
else
op->matrix.send = FALSE;
if (!offset_equal)
{
current_program_state->color_matrix.offset = *offset;
op->offset.value = offset;
op->offset.send = TRUE;
current_program_state->color_matrix.offset = *offset;
}
else
op->offset.send = FALSE;
@@ -765,8 +623,58 @@ GskQuadVertex *
ops_draw (RenderOpBuilder *builder,
const GskQuadVertex vertex_data[GL_N_VERTICES])
{
ProgramState *program_state = get_current_program_state (builder);
OpDraw *op;
if (memcmp (&builder->current_projection, &program_state->projection, sizeof (graphene_matrix_t)) != 0)
{
OpMatrix *opm;
opm = ops_begin (builder, OP_CHANGE_PROJECTION);
opm->matrix = builder->current_projection;
program_state->projection = builder->current_projection;
}
if (program_state->modelview == NULL ||
!gsk_transform_equal (builder->current_modelview, program_state->modelview))
{
OpMatrix *opm;
opm = ops_begin (builder, OP_CHANGE_MODELVIEW);
gsk_transform_to_matrix (builder->current_modelview, &opm->matrix);
gsk_transform_unref (program_state->modelview);
program_state->modelview = gsk_transform_ref (builder->current_modelview);
}
if (!rect_equal (&builder->current_viewport, &program_state->viewport))
{
OpViewport *opv;
opv = ops_begin (builder, OP_CHANGE_VIEWPORT);
opv->viewport = builder->current_viewport;
program_state->viewport = builder->current_viewport;
}
if (!rounded_rect_equal (builder->current_clip, &program_state->clip))
{
OpClip *opc;
opc = ops_begin (builder, OP_CHANGE_CLIP);
opc->clip = *builder->current_clip;
opc->send_corners = !rounded_rect_corners_equal (builder->current_clip, &program_state->clip);
program_state->clip = *builder->current_clip;
}
if (program_state->opacity != builder->current_opacity)
{
OpOpacity *opo;
opo = ops_begin (builder, OP_CHANGE_OPACITY);
opo->opacity = builder->current_opacity;
program_state->opacity = builder->current_opacity;
}
/* TODO: Did the additions above break the following optimization? */
if ((op = op_buffer_peek_tail_checked (&builder->render_ops, OP_DRAW)))
{
op->vao_size += GL_N_VERTICES;
-2
View File
@@ -255,8 +255,6 @@ void ops_push_modelview (RenderOpBuilder *builder,
void ops_set_modelview (RenderOpBuilder *builder,
GskTransform *transform);
void ops_pop_modelview (RenderOpBuilder *builder);
float ops_get_scale (const RenderOpBuilder *builder);
void ops_set_program (RenderOpBuilder *builder,
Program *program);
+2 -1
View File
@@ -53,6 +53,7 @@ typedef struct { GskRoundedRect value; guint send: 1; guint send_corners: 1; } R
typedef struct { const GdkRGBA *value; guint send: 1; } RGBAUniformValue;
typedef struct { const graphene_vec4_t *value; guint send: 1; } Vec4UniformValue;
typedef struct { const GskColorStop *value; guint send: 1; } ColorStopUniformValue;
typedef struct { const graphene_matrix_t *value; guint send: 1; } MatrixUniformValue;
/* OpNode are allocated within OpBuffer.pos, but we keep
* a secondary index into the locations of that buffer
@@ -167,7 +168,7 @@ typedef struct
typedef struct
{
const graphene_matrix_t *matrix;
MatrixUniformValue matrix;
Vec4UniformValue offset;
} OpColorMatrix;
+28 -5
View File
@@ -770,6 +770,12 @@ gsk_radial_gradient_node_get_end (GskRenderNode *node)
/*** GSK_CONIC_GRADIENT_NODE ***/
/**
* GskConicGradientNode:
*
* A render node for a conic gradient.
*/
struct _GskConicGradientNode
{
GskRenderNode render_node;
@@ -1257,15 +1263,22 @@ gsk_border_node_diff (GskRenderNode *node1,
gdk_rgba_equal (&self1->border_color[0], &self2->border_color[0]))
return;
if (gsk_rounded_rect_equal (&self1->outline, &self2->outline) &&
/* Different uniformity -> diff impossible */
if (self1->uniform ^ self2->uniform)
{
gsk_render_node_diff_impossible (node1, node2, region);
return;
}
if (self1->border_width[0] == self2->border_width[0] &&
self1->border_width[1] == self2->border_width[1] &&
self1->border_width[2] == self2->border_width[2] &&
self1->border_width[3] == self2->border_width[3] &&
gdk_rgba_equal (&self1->border_color[0], &self2->border_color[0]) &&
gdk_rgba_equal (&self1->border_color[1], &self2->border_color[1]) &&
gdk_rgba_equal (&self1->border_color[2], &self2->border_color[2]) &&
gdk_rgba_equal (&self1->border_color[3], &self2->border_color[3]) &&
self1->border_width[0] == self2->border_width[0] &&
self1->border_width[1] == self2->border_width[1] &&
self1->border_width[2] == self2->border_width[2] &&
self1->border_width[3] == self2->border_width[3])
gsk_rounded_rect_equal (&self1->outline, &self2->outline))
return;
gsk_render_node_diff_impossible (node1, node2, region);
@@ -2749,6 +2762,16 @@ gsk_transform_node_draw (GskRenderNode *node,
ctm.xx, ctm.yx,
ctm.xy, ctm.yy,
ctm.x0, ctm.y0));
if (xx * yy == xy * yx)
{
/* broken matrix here. This can happen during transitions
* (like when flipping an axis at the point where scale == 0)
* and just means that nothing should be drawn.
* But Cairo thows lots of ugly errors instead of silently
* going on. So We silently go on.
*/
return;
}
cairo_transform (cr, &ctm);
gsk_render_node_draw (self->child, cr);
+89 -61
View File
@@ -688,10 +688,16 @@ create_ascii_glyphs (PangoFont *font)
glyph_string = pango_glyph_string_new ();
for (i = MIN_ASCII_GLYPH; i < MAX_ASCII_GLYPH; i++)
{
pango_shape ((char[2]) { i, 0 },
1,
&not_a_hack,
glyph_string);
const char text[2] = { i, 0 };
pango_shape_with_flags (text,
1,
text,
1,
&not_a_hack,
glyph_string,
PANGO_SHAPE_ROUND_POSITIONS);
if (glyph_string->num_glyphs != 1)
{
pango_glyph_string_free (glyph_string);
@@ -2304,6 +2310,84 @@ base64_encode_with_linebreaks (const guchar *data,
return out;
}
void
gsk_text_node_serialize_glyphs (GskRenderNode *node,
GString *p)
{
const guint n_glyphs = gsk_text_node_get_num_glyphs (node);
const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
PangoFont *font = gsk_text_node_get_font (node);
GString *str;
guint i, j;
PangoGlyphString *ascii;
ascii = create_ascii_glyphs (font);
str = g_string_new ("");
for (i = 0; i < n_glyphs; i++)
{
if (ascii)
{
for (j = 0; j < ascii->num_glyphs; j++)
{
if (glyphs[i].glyph == ascii->glyphs[j].glyph &&
glyphs[i].geometry.width == ascii->glyphs[j].geometry.width &&
glyphs[i].geometry.x_offset == 0 &&
glyphs[i].geometry.y_offset == 0 &&
glyphs[i].attr.is_cluster_start)
{
g_string_append_c (str, j + MIN_ASCII_GLYPH);
break;
}
else if (glyphs[i].glyph == ascii->glyphs[j].glyph)
{
if (glyphs[i].geometry.width != ascii->glyphs[j].geometry.width)
g_print ("not ascii because of width (%d != %d)\n",
glyphs[i].geometry.width,
ascii->glyphs[j].geometry.width);
if (glyphs[i].geometry.x_offset != 0 ||
glyphs[i].geometry.y_offset != 0)
g_print ("not ascii because of offset\n");
if (!glyphs[i].attr.is_cluster_start)
g_print ("not ascii because of cluster\n");
}
}
if (j != ascii->num_glyphs)
continue;
}
if (str->len)
{
g_string_append_printf (p, "\"%s\", ", str->str);
g_string_set_size (str, 0);
}
g_string_append_printf (p, "%u %g",
glyphs[i].glyph,
(double) glyphs[i].geometry.width / PANGO_SCALE);
if (!glyphs[i].attr.is_cluster_start ||
glyphs[i].geometry.x_offset != 0 ||
glyphs[i].geometry.y_offset != 0)
{
g_string_append_printf (p, " %g %g",
(double) glyphs[i].geometry.x_offset / PANGO_SCALE,
(double) glyphs[i].geometry.y_offset / PANGO_SCALE);
if (!glyphs[i].attr.is_cluster_start)
g_string_append (p, " same-cluster");
}
if (i + 1 < n_glyphs)
g_string_append (p, ", ");
}
if (str->len)
g_string_append_printf (p, "\"%s\"", str->str);
g_string_free (str, TRUE);
if (ascii)
pango_glyph_string_free (ascii);
}
static void
render_node_print (Printer *p,
GskRenderNode *node)
@@ -2631,16 +2715,11 @@ render_node_print (Printer *p,
case GSK_TEXT_NODE:
{
const guint n_glyphs = gsk_text_node_get_num_glyphs (node);
const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
const graphene_point_t *offset = gsk_text_node_get_offset (node);
const GdkRGBA *color = gsk_text_node_get_color (node);
PangoFont *font = gsk_text_node_get_font (node);
PangoFontDescription *desc;
char *font_name;
GString *str;
guint i, j;
PangoGlyphString *ascii = create_ascii_glyphs (font);
start_node (p, "text");
@@ -2650,61 +2729,14 @@ render_node_print (Printer *p,
_indent (p);
desc = pango_font_describe (font);
font_name = pango_font_description_to_string (desc);
if (ascii == NULL)
g_print ("\"%s\" has no ascii table\n", font_name);
g_string_append_printf (p->str, "font: \"%s\";\n", font_name);
g_free (font_name);
pango_font_description_free (desc);
_indent (p);
str = g_string_new (NULL);
g_string_append (p->str, "glyphs: ");
for (i = 0; i < n_glyphs; i++)
{
if (ascii)
{
for (j = 0; j < ascii->num_glyphs; j++)
{
if (glyphs[i].glyph == ascii->glyphs[j].glyph &&
glyphs[i].geometry.width == ascii->glyphs[j].geometry.width &&
glyphs[i].geometry.x_offset == 0 &&
glyphs[i].geometry.y_offset == 0 &&
glyphs[i].attr.is_cluster_start)
{
g_string_append_c (str, j + MIN_ASCII_GLYPH);
break;
}
}
if (j != ascii->num_glyphs)
continue;
}
if (str->len)
{
g_string_append_printf (p->str, "\"%s\", ", str->str);
g_string_set_size (str, 0);
}
g_string_append_printf (p->str, "%u %g",
glyphs[i].glyph,
(double) glyphs[i].geometry.width / PANGO_SCALE);
if (!glyphs[i].attr.is_cluster_start ||
glyphs[i].geometry.x_offset != 0 ||
glyphs[i].geometry.y_offset != 0)
{
g_string_append_printf (p->str, "%g %g",
(double) glyphs[i].geometry.x_offset / PANGO_SCALE,
(double) glyphs[i].geometry.y_offset / PANGO_SCALE);
if (!glyphs[i].attr.is_cluster_start)
g_string_append (p->str, " same-cluster");
}
if (i + 1 < n_glyphs)
g_string_append (p->str, ", ");
}
if (str->len)
g_string_append_printf (p->str, "\"%s\"", str->str);
gsk_text_node_serialize_glyphs (node, p->str);
g_string_append_c (p->str, ';');
g_string_append_c (p->str, '\n');
@@ -2713,10 +2745,6 @@ render_node_print (Printer *p,
append_point_param (p, "offset", offset);
end_node (p);
g_string_free (str, TRUE);
if (ascii)
pango_glyph_string_free (ascii);
}
break;
+3
View File
@@ -96,6 +96,9 @@ void gsk_render_node_diff_impossible (GskRenderNode
bool gsk_border_node_get_uniform (GskRenderNode *self);
void gsk_text_node_serialize_glyphs (GskRenderNode *self,
GString *str);
G_END_DECLS
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
+10
View File
@@ -7,6 +7,16 @@
G_BEGIN_DECLS
#define GSK_ROUNDED_RECT_INIT_FROM_RECT(_r) \
(GskRoundedRect) { .bounds = _r, \
.corner = { \
GRAPHENE_SIZE_INIT(0, 0),\
GRAPHENE_SIZE_INIT(0, 0),\
GRAPHENE_SIZE_INIT(0, 0),\
GRAPHENE_SIZE_INIT(0, 0),\
}}
gboolean gsk_rounded_rect_is_circular (const GskRoundedRect *self);
void gsk_rounded_rect_path (const GskRoundedRect *self,
+7 -5
View File
@@ -127,8 +127,10 @@ gsk_transform_alloc (const GskTransformClass *transform_class,
self->transform_class = transform_class;
self->category = next ? MIN (category, next->category) : category;
self->next = gsk_transform_is_identity (next) ? NULL : gsk_transform_ref (next);
g_clear_pointer (&next, gsk_transform_unref);
if (gsk_transform_is_identity (next))
gsk_transform_unref (next);
else
self->next = next;
return self;
}
@@ -217,7 +219,7 @@ gsk_identity_transform_equal (GskTransform *first_transform,
static const GskTransformClass GSK_IDENTITY_TRANSFORM_CLASS =
{
sizeof (GskTransform),
"GskIdentityMatrix",
"GskIdentityTransform",
gsk_identity_transform_finalize,
gsk_identity_transform_to_matrix,
gsk_identity_transform_apply_2d,
@@ -1707,8 +1709,8 @@ gsk_transform_invert (GskTransform *self)
/**
* gsk_transform_equal:
* @first: the first transform
* @second: the second transform
* @first: (nullable): the first transform
* @second: (nullable): the second transform
*
* Checks two transforms for equality.
*
+39 -33
View File
@@ -130,33 +130,33 @@ if get_variable('broadway_enabled')
endif
gsk_resources_xml = configure_file(output: 'gsk.resources.xml',
input: 'gen-gsk-gresources-xml.py',
command: [
find_program('gen-gsk-gresources-xml.py'),
'@OUTPUT@',
gsk_private_gl_shaders,
gsk_private_vulkan_compiled_shaders,
gsk_private_vulkan_shaders
])
# FIXME: do we need this variable?
gsk_sources = gsk_public_sources + gsk_private_sources
input: 'gen-gsk-gresources-xml.py',
command: [
find_program('gen-gsk-gresources-xml.py'),
'@OUTPUT@',
gsk_private_gl_shaders,
gsk_private_vulkan_compiled_shaders,
gsk_private_vulkan_shaders
],
)
gsk_enums = gnome.mkenums('gskenumtypes',
sources: gsk_public_headers,
c_template: 'gskenumtypes.c.template',
h_template: 'gskenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gsk'),
install_header: true)
sources: gsk_public_headers,
c_template: 'gskenumtypes.c.template',
h_template: 'gskenumtypes.h.template',
install_dir: gtk_includedir / 'gtk-4.0/gsk',
install_header: true,
)
gskenum_h = gsk_enums[1]
gskresources = gnome.compile_resources('gskresources',
gsk_resources_xml,
dependencies: gsk_private_vulkan_compiled_shaders_deps,
source_dir: '.',
c_name: '_gsk',
extra_args: [ '--manual-register', ])
gsk_resources_xml,
dependencies: gsk_private_vulkan_compiled_shaders_deps,
source_dir: '.',
c_name: '_gsk',
extra_args: [ '--manual-register', ],
)
gsk_gen_headers = [ gskenum_h, ]
@@ -170,20 +170,26 @@ gsk_deps = [
]
libgsk = static_library('gsk',
sources: [ gsk_sources, gsk_enums, gskresources, ],
dependencies: gsk_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gsk"',
'-DG_LOG_STRUCTURED=1',
] + common_cflags,
link_with: libgdk,
link_args: common_ldflags)
sources: [
gsk_public_sources,
gsk_private_sources,
gsk_enums,
gskresources,
],
dependencies: gsk_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gsk"',
'-DG_LOG_STRUCTURED=1',
] + common_cflags,
link_with: libgdk,
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgsk_dep = declare_dependency(include_directories: [ confinc, ],
sources: [ gskenum_h, ],
dependencies: libgdk_dep)
sources: [ gskenum_h, ],
dependencies: libgdk_dep,
)
+3 -3
View File
@@ -15,8 +15,8 @@ void main() {
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
// The -90 is because conics point to the top by default
rotation = mod (u_rotation - 90, 360.0);
if (rotation < 0)
rotation = mod (u_rotation - 90.0, 360.0);
if (rotation < 0.0)
rotation += 360.0;
rotation = PI / 180.0 * rotation;
@@ -55,7 +55,7 @@ void main() {
angle -= rotation;
// fract() does the modulo here, so now we have progress
// into the current conic
float offset = fract (angle / 2 / PI + 2);
float offset = fract (angle / 2.0 / PI + 2.0);
vec4 color = color_stops[0];
for (int i = 1; i < u_num_color_stops; i ++) {
+21 -19
View File
@@ -28,31 +28,33 @@ gtk_css_deps = [
]
gtk_css_enums = gnome.mkenums('gtkcssenumtypes',
sources: gtk_css_public_headers,
c_template: 'gtkcssenumtypes.c.template',
h_template: 'gtkcssenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gtk/css'),
install_header: true)
sources: gtk_css_public_headers,
c_template: 'gtkcssenumtypes.c.template',
h_template: 'gtkcssenumtypes.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-4.0/gtk/css'),
install_header: true,
)
gtk_css_enum_h = gtk_css_enums[1]
libgtk_css = static_library('gtk_css',
sources: [
gtk_css_public_sources,
gtk_css_private_sources,
gtk_css_enums,
],
dependencies: gtk_css_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gtk"',
] + common_cflags,
link_args: common_ldflags)
sources: [
gtk_css_public_sources,
gtk_css_private_sources,
gtk_css_enums,
],
dependencies: gtk_css_deps,
include_directories: [ confinc, ],
c_args: [
'-DGTK_COMPILATION',
'-DG_LOG_DOMAIN="Gtk"',
] + common_cflags,
)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgtk_css_dep = declare_dependency(include_directories: [ confinc, ],
sources: [ gtk_css_enum_h ],
dependencies: gtk_css_deps)
sources: [ gtk_css_enum_h ],
dependencies: gtk_css_deps,
)
+22 -11
View File
@@ -66,11 +66,11 @@ get_color (GskPangoRenderer *crenderer,
rgba->red = color->red / 65535.;
rgba->green = color->green / 65535.;
rgba->blue = color->blue / 65535.;
rgba->alpha = a ? a / 65535. : crenderer->fg_color.alpha;
rgba->alpha = a ? a / 65535. : crenderer->fg_color->alpha;
}
else
{
*rgba = crenderer->fg_color;
*rgba = *crenderer->fg_color;
if (a)
rgba->alpha = a / 65535.;
}
@@ -138,11 +138,19 @@ gsk_pango_renderer_draw_trapezoid (PangoRenderer *renderer,
double x22)
{
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
PangoLayout *layout;
PangoRectangle ink_rect;
cairo_t *cr;
double x, y;
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
layout = pango_renderer_get_layout (renderer);
if (!layout)
return;
pango_layout_get_pixel_extents (layout, &ink_rect, NULL);
cr = gtk_snapshot_append_cairo (crenderer->snapshot,
&GRAPHENE_RECT_INIT (ink_rect.x, ink_rect.y,
ink_rect.width, ink_rect.height));
set_color (crenderer, part, cr);
x = y = 0;
@@ -234,7 +242,6 @@ gsk_pango_renderer_draw_shape (PangoRenderer *renderer,
int y)
{
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
cairo_t *cr;
PangoLayout *layout;
PangoCairoShapeRendererFunc shape_renderer;
gpointer shape_renderer_data;
@@ -263,17 +270,25 @@ gsk_pango_renderer_draw_shape (PangoRenderer *renderer,
if (!handled)
{
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
cairo_t *cr;
PangoRectangle ink_rect;
layout = pango_renderer_get_layout (renderer);
if (!layout)
return;
pango_layout_get_pixel_extents (layout, &ink_rect, NULL);
cr = gtk_snapshot_append_cairo (crenderer->snapshot,
&GRAPHENE_RECT_INIT (ink_rect.x, ink_rect.y,
ink_rect.width, ink_rect.height));
shape_renderer = pango_cairo_context_get_shape_renderer (pango_layout_get_context (layout),
&shape_renderer_data);
if (!shape_renderer)
return;
{
cairo_destroy (cr);
return;
}
set_color (crenderer, PANGO_RENDER_PART_FOREGROUND, cr);
@@ -480,7 +495,6 @@ gtk_snapshot_append_layout (GtkSnapshot *snapshot,
const GdkRGBA *color)
{
GskPangoRenderer *crenderer;
PangoRectangle ink_rect;
g_return_if_fail (snapshot != NULL);
g_return_if_fail (PANGO_IS_LAYOUT (layout));
@@ -488,10 +502,7 @@ gtk_snapshot_append_layout (GtkSnapshot *snapshot,
crenderer = gsk_pango_renderer_acquire ();
crenderer->snapshot = snapshot;
crenderer->fg_color = *color;
pango_layout_get_pixel_extents (layout, &ink_rect, NULL);
graphene_rect_init (&crenderer->bounds, ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height);
crenderer->fg_color = color;
pango_renderer_draw_layout (PANGO_RENDERER (crenderer), layout, 0, 0);
+2 -3
View File
@@ -49,7 +49,7 @@ typedef gboolean (*GskPangoShapeHandler) (PangoAttrShape *attr,
/*
* This is a PangoRenderer implementation that translates all the draw calls to
* gsk render nodes, using the GtkSnapshot helper class. Glyphs are translated
* to text nodes, all other draw calls fall back to cairo nodes.
* to text nodes, other draw calls may fall back to cairo nodes.
*/
struct _GskPangoRenderer
@@ -58,8 +58,7 @@ struct _GskPangoRenderer
GtkWidget *widget;
GtkSnapshot *snapshot;
GdkRGBA fg_color;
graphene_rect_t bounds;
const GdkRGBA *fg_color;
/* Error underline color for this widget */
GdkRGBA *error_color;
-1
View File
@@ -52,7 +52,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererText, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererToggle, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellView, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCheckButton, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkClipboard, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorButton, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorChooser, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorChooserDialog, g_object_unref)
+1 -1
View File
@@ -100,7 +100,7 @@ gtk_accels_remove (GtkAccels *accels,
position = gtk_accels_find (accels, action_and_target);
if (position < gtk_accels_get_size (accels))
gtk_accels_splice (accels, position, 1, NULL, 0);
gtk_accels_splice (accels, position, 1, FALSE, NULL, 0);
}
/*< private >
+7 -3
View File
@@ -191,19 +191,23 @@ gtk_application_load_resources (GtkApplication *application)
{
GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
const char *base_path;
const char *optional_slash = "/";
base_path = g_application_get_resource_base_path (G_APPLICATION (application));
if (base_path == NULL)
return;
if (base_path[strlen (base_path) - 1] == '/')
optional_slash = "";
/* Expand the icon search path */
{
GtkIconTheme *default_theme;
char *iconspath;
default_theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
iconspath = g_strconcat (base_path, "/icons/", NULL);
iconspath = g_strconcat (base_path, optional_slash, "icons/", NULL);
gtk_icon_theme_add_resource_path (default_theme, iconspath);
g_free (iconspath);
}
@@ -212,7 +216,7 @@ gtk_application_load_resources (GtkApplication *application)
{
char *menuspath;
menuspath = g_strconcat (base_path, "/gtk/menus.ui", NULL);
menuspath = g_strconcat (base_path, optional_slash, "gtk/menus.ui", NULL);
if (g_resources_get_info (menuspath, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
priv->menus_builder = gtk_builder_new_from_resource (menuspath);
g_free (menuspath);
@@ -231,7 +235,7 @@ gtk_application_load_resources (GtkApplication *application)
{
char *path;
path = g_strconcat (base_path, "/gtk/help-overlay.ui", NULL);
path = g_strconcat (base_path, optional_slash, "gtk/help-overlay.ui", NULL);
if (g_resources_get_info (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
{
const char * const accels[] = { "<Control>question", NULL };
+3 -3
View File
@@ -317,8 +317,8 @@ gtk_box_buildable_iface_init (GtkBuildableIface *iface)
/**
* gtk_box_new:
* @orientation: the boxs orientation.
* @spacing: the number of pixels to place by default between children.
* @orientation: the boxs orientation
* @spacing: the number of pixels to place by default between children
*
* Creates a new #GtkBox.
*
@@ -479,7 +479,7 @@ gtk_box_get_baseline_position (GtkBox *box)
* gtk_box_insert_child_after:
* @box: a #GtkBox
* @child: the #GtkWidget to insert
* @sibling: (nullable): the sibling to move @child after, or %NULL
* @sibling: (nullable): the sibling after which to insert @child
*
* Inserts @child in the position after @sibling in the list
* of @box children. If @sibling is %NULL, insert @child at
+30
View File
@@ -1691,6 +1691,13 @@ gtk_cell_renderer_get_state (GtkCellRenderer *cell,
return state;
}
/**
* gtk_cell_renderer_set_is_expander:
* @cell: a #GtkCellRenderer
* @is_expander: whether @cell is an expander
*
* Sets whether the given #GtkCellRenderer is an expander.
*/
void
gtk_cell_renderer_set_is_expander (GtkCellRenderer *cell,
gboolean is_expander)
@@ -1709,6 +1716,14 @@ gtk_cell_renderer_set_is_expander (GtkCellRenderer *cell,
}
}
/**
* gtk_cell_renderer_get_is_expander:
* @cell: a #GtkCellRenderer
*
* Checks whether the given #GtkCellRenderer is an expander.
*
* Returns: %TRUE if @cell is an expander, and %FALSE otherwise
*/
gboolean
gtk_cell_renderer_get_is_expander (GtkCellRenderer *cell)
{
@@ -1719,6 +1734,13 @@ gtk_cell_renderer_get_is_expander (GtkCellRenderer *cell)
return priv->is_expander;
}
/**
* gtk_cell_renderer_set_is_expanded:
* @cell: a #GtkCellRenderer
* @is_expanded: whether @cell should be expanded
*
* Sets whether the given #GtkCellRenderer is expanded.
*/
void
gtk_cell_renderer_set_is_expanded (GtkCellRenderer *cell,
gboolean is_expanded)
@@ -1737,6 +1759,14 @@ gtk_cell_renderer_set_is_expanded (GtkCellRenderer *cell,
}
}
/**
* gtk_cell_renderer_get_is_expanded:
* @cell: a #GtkCellRenderer
*
* Checks whether the given #GtkCellRenderer is expanded.
*
* Returns: %TRUE if the cell renderer is expanded
*/
gboolean
gtk_cell_renderer_get_is_expanded (GtkCellRenderer *cell)
{
+1 -1
View File
@@ -280,7 +280,7 @@ gboolean gtk_cell_renderer_get_is_expander (GtkCellRenderer *cell);
GDK_AVAILABLE_IN_ALL
void gtk_cell_renderer_set_is_expanded (GtkCellRenderer *cell,
gboolean is_expander);
gboolean is_expanded);
GDK_AVAILABLE_IN_ALL
gboolean gtk_cell_renderer_get_is_expanded (GtkCellRenderer *cell);
+9 -2
View File
@@ -58,8 +58,15 @@
*
* # CSS nodes
*
* GtkColorButton has a single CSS node with name button. To differentiate
* it from a plain #GtkButton, it gets the .color style class.
* |[<!-- language="plain" -->
* colorbutton
* button.color
* [content]
*]|
*
* GtkColorButton has a single CSS node with name colorbutton which
* contains a button node. To differentiate it from a plain #GtkButton,
* it gets the .color style class.
*/
typedef struct _GtkColorButtonClass GtkColorButtonClass;
+9 -44
View File
@@ -24,9 +24,7 @@
#include "gtkstyleproviderprivate.h"
#include "gtksettingsprivate.h"
#ifdef _MSC_VER
# include <intrin.h>
#endif
#include "gtkpopcountprivate.h"
/* repeated API */
@@ -1453,39 +1451,6 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_EAST_ASIAN = {
gtk_css_font_variant_east_asian_value_print
};
#ifdef _MSC_VER
/* __builtin_popcount is a GCC-only function
so we need to define it for ourselves somehow */
static inline guint
__msvc_compat_popcnt (guint32 value)
{
static gssize popcnt_checked = 0;
static gboolean have_popcnt = FALSE;
# if defined (_M_AMD64) || defined (_M_X64) || (_M_IX86)
if (g_once_init_enter (&popcnt_checked))
{
int cpuinfo[4] = {-1};
__cpuid (cpuinfo, 1);
have_popcnt = (cpuinfo[2] & 0x00800000) != 0;
g_once_init_leave (&popcnt_checked, 1);
}
# endif
if (have_popcnt)
return __popcnt (value);
else
/* http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel */
return (((value & 0xfff) * 0x1001001001001ULL & 0x84210842108421ULL) % 0x1f) +
((((value & 0xfff000) >> 12) * 0x1001001001001ULL & 0x84210842108421ULL) % 0x1f) +
(((value >> 24) * 0x1001001001001ULL & 0x84210842108421ULL) % 0x1f);
}
# define __builtin_popcount(v) __msvc_compat_popcnt(v)
#endif
static gboolean
east_asian_value_is_valid (GtkCssFontVariantEastAsian east_asian)
{
@@ -1493,16 +1458,16 @@ east_asian_value_is_valid (GtkCssFontVariantEastAsian east_asian)
(east_asian != GTK_CSS_FONT_VARIANT_EAST_ASIAN_NORMAL))
return FALSE;
if (__builtin_popcount (east_asian & (GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS78 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS83 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS90 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS04 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL)) > 1)
if (gtk_popcount (east_asian & (GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS78 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS83 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS90 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_JIS04 |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL)) > 1)
return FALSE;
if (__builtin_popcount (east_asian & (GTK_CSS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_PROPORTIONAL)) > 1)
if (gtk_popcount (east_asian & (GTK_CSS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH |
GTK_CSS_FONT_VARIANT_EAST_ASIAN_PROPORTIONAL)) > 1)
return FALSE;
return TRUE;
+1 -1
View File
@@ -167,7 +167,7 @@ gtk_css_selector_matches_insert_sorted (GtkCssSelectorMatches *matches,
break;
}
gtk_css_selector_matches_splice (matches, i, 0, (gpointer[1]) { data }, 1);
gtk_css_selector_matches_splice (matches, i, 0, FALSE, (gpointer[1]) { data }, 1);
}
static inline gboolean
+51 -3
View File
@@ -55,15 +55,63 @@
* source must be added to a widget as an event controller, using
* gtk_widget_add_controller().
*
* |[<!-- language="C" -->
* static void
* my_widget_init (MyWidget *self)
* {
* GtkDragSource *drag_source = gtk_drag_source_new ();
*
* g_signal_connect (drag_source, "prepare", G_CALLBACK (on_drag_prepare), self);
* g_signal_connect (drag_source, "drag-begin", G_CALLBACK (on_drag_begin), self);
*
* gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drag_source));
* }
* ]|
*
* Setting up the content provider and icon ahead of time only
* makes sense when the data does not change. More commonly, you
* will want to set them up just in time. To do so, #GtkDragSource
* has #GtkDragSource::prepare and #GtkDragSource::drag-begin signals.
*
* The ::prepare signal is emitted before a drag is started, and
* can be used to set the content provider and actions that the
* drag should be started with. The ::drag-begin signal is emitted
* after the #GdkDrag object has been created, and can be used
* to set up the drag icon.
* drag should be started with.
*
* |[<!-- language="C" -->
* static GdkContentProvider *
* on_drag_prepare (GtkDragSource *source,
* double x,
* double y,
* MyWidget *self)
* {
* // This widget supports two types of content: GFile objects
* // and GdkPixbuf objects; GTK will handle the serialization
* // of these types automatically
* GFile *file = my_widget_get_file (self);
* GdkPixbuf *pixbuf = my_widget_get_pixbuf (self);
*
* return gdk_content_provider_new_union ((GdkContentProvider *[2]) {
* gdk_content_provider_new_typed (G_TYPE_FILE, file),
* gdk_content_provider_new_typed (GDK_TYPE_PIXBUF, pixbuf),
* }, 2);
* }
* ]|
*
* The ::drag-begin signal is emitted after the #GdkDrag object has
* been created, and can be used to set up the drag icon.
*
* |[<!-- language="C" -->
* static void
* on_drag_begin (GtkDragSource *source,
* GtkDrag *drag,
* MyWidget *self)
* {
* // Set the widget as the drag icon
* GdkPaintable *paintable = gtk_widget_paintable_new (GTK_WIDGET (self));
* gtk_drag_source_set_icon (source, paintable, 0, 0);
* g_object_unref (paintable);
* }
* ]|
*
* During the DND operation, GtkDragSource emits signals that
* can be used to obtain updates about the status of the operation,
+3 -1
View File
@@ -96,6 +96,7 @@ struct _GtkDropDown
GtkWidget *button_stack;
GtkWidget *button_item;
GtkWidget *button_placeholder;
GtkWidget *search_box;
GtkWidget *search_entry;
gboolean enable_search;
@@ -521,6 +522,7 @@ gtk_drop_down_class_init (GtkDropDownClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkDropDown, button_item);
gtk_widget_class_bind_template_child (widget_class, GtkDropDown, popup);
gtk_widget_class_bind_template_child (widget_class, GtkDropDown, popup_list);
gtk_widget_class_bind_template_child (widget_class, GtkDropDown, search_box);
gtk_widget_class_bind_template_child (widget_class, GtkDropDown, search_entry);
gtk_widget_class_bind_template_callback (widget_class, row_activated);
@@ -936,7 +938,7 @@ gtk_drop_down_set_enable_search (GtkDropDown *self,
self->enable_search = enable_search;
gtk_editable_set_text (GTK_EDITABLE (self->search_entry), "");
gtk_widget_set_visible (self->search_entry, enable_search);
gtk_widget_set_visible (self->search_box, enable_search);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ENABLE_SEARCH]);
}
+40 -1
View File
@@ -47,7 +47,46 @@
* The most basic way to use a #GtkDropTarget to receive drops on a
* widget is to create it via gtk_drop_target_new() passing in the
* #GType of the data you want to receive and connect to the
* GtkDropTarget::drop signal to receive the data.
* GtkDropTarget::drop signal to receive the data:
*
* |[<!-- language="C" -->
* static gboolean
* on_drop (GtkDropTarget *target,
* const GValue *value,
* double x,
* double y,
* gpointer data)
* {
* MyWidget *self = data;
*
* // Call the appropriate setter depending on the type of data
* // that we received
* if (G_VALUE_HOLDS (value, G_TYPE_FILE))
* my_widget_set_file (self, g_value_get_object (value));
* else if (G_VALUE_HOLDS (value, GDK_TYPE_PIXBUF))
* my_widget_set_pixbuf (self, g_value_get_object (value));
* else
* return FALSE;
*
* return TRUE;
* }
*
* static void
* my_widget_init (MyWidget *self)
* {
* GtkDropTarget *target =
* gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_COPY);
*
* // This widget accepts two types of drop types: GFile objects
* // and GdkPixbuf objects
* gtk_drop_target_set_gtypes (target, (GTypes [2]) {
* G_TYPE_FILE,
* GDK_TYPE_PIXBUF,
* }, 2);
*
* gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (target));
* }
* ]|
*
* #GtkDropTarget supports more options, such as:
*
+10 -2
View File
@@ -133,8 +133,8 @@
* }
* ]|
*
* Finally, use gtk_editable_delegate_set_property() in your set_property
* function (and similar for get_property), to set the editable properties:
* Finally, use gtk_editable_delegate_set_property() in your `set_property`
* function (and similar for `get_property`), to set the editable properties:
*
* |[
* ...
@@ -144,6 +144,14 @@
* switch (prop_id)
* ...
* ]|
*
* It is important to note that if you create a GtkEditable that uses a delegate,
* the low level #GtkEditable::insert-text and #GtkEditable::delete-text signals
* will be propagated from the "wrapper" editable to the delegate, but they will
* not be propagated from the delegate to the "wrapper" editable, as they would
* cause an infinite recursion. If you wish to connect to the #GtkEditable::insert-text
* and #GtkEditable::delete-text signals, you will need to connect to them on
* the delegate obtained via gtk_editable_get_delegate().
*/
#include "config.h"
+4
View File
@@ -54,6 +54,8 @@
* # CSS nodes
* |[<!-- language="plain" -->
* popover
* box.emoji-searchbar
* entry.search
* box.emoji-toolbar
* button.image-button.emoji-section
* ...
@@ -63,6 +65,8 @@
* Every #GtkEmojiChooser consists of a main node called popover.
* The contents of the popover are largely implementation defined
* and supposed to inherit general styles.
* The top searchbar used to search emoji and gets the .emoji-searchbar
* style class itself.
* The bottom toolbar used to switch between different emoji categories
* consists of buttons with the .emoji-section style class and gets the
* .emoji-toolbar style class itself.
+1 -1
View File
@@ -975,7 +975,7 @@ gtk_entry_class_init (GtkEntryClass *class)
gtk_editable_install_properties (gobject_class, PROP_EDITING_CANCELED + 1);
/**
* GtkEntry:activate:
* GtkEntry::activate:
* @self: The widget on which the signal is emitted
*
* The ::activate signal is forwarded from the
+10 -9
View File
@@ -1099,7 +1099,6 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
GdkSurface *surface;
GtkRequisition entry_req;
GtkRequisition tree_req;
GtkTreePath *path;
int width;
surface = gtk_native_get_surface (gtk_widget_get_native (completion->entry));
@@ -1143,14 +1142,6 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
gtk_widget_set_size_request (completion->popup_window, width, -1);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (completion->scrolled_window), items * height);
if (matches > 0)
{
path = gtk_tree_path_new_from_indices (0, -1);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (completion->tree_view), path,
NULL, FALSE, 0.0, 0.0);
gtk_tree_path_free (path);
}
gtk_popover_present (GTK_POPOVER (completion->popup_window));
}
@@ -1175,6 +1166,16 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion)
_gtk_entry_completion_resize_popup (completion);
if (completion->filter_model)
{
GtkTreePath *path;
path = gtk_tree_path_new_from_indices (0, -1);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (completion->tree_view), path,
NULL, FALSE, 0.0, 0.0);
gtk_tree_path_free (path);
}
gtk_popover_popup (GTK_POPOVER (completion->popup_window));
}
+7 -32
View File
@@ -226,6 +226,11 @@ gtk_event_controller_class_init (GtkEventControllerClass *klass)
GTK_LIMIT_SAME_NATIVE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkEventController:name:
*
* The name for this controller, typically used for debugging purposes.
*/
properties[PROP_NAME] =
g_param_spec_string ("name",
P_("Name"),
@@ -364,7 +369,7 @@ gtk_event_controller_handle_event (GtkEventController *controller,
return retval;
}
/**
/*< private >
* gtk_event_controller_handle_crossing:
* @controller: a #GtkEventController
* @crossing: a #GtkCrossingData
@@ -373,7 +378,7 @@ gtk_event_controller_handle_event (GtkEventController *controller,
*
* Feeds a crossing event into @controller, so it can be interpreted
* and the controller actions triggered.
**/
*/
void
gtk_event_controller_handle_crossing (GtkEventController *controller,
const GtkCrossingData *crossing,
@@ -658,33 +663,3 @@ gtk_event_controller_get_current_event_state (GtkEventController *controller)
return 0;
}
static GtkCrossingData *
gtk_crossing_data_copy (GtkCrossingData *crossing)
{
GtkCrossingData *copy;
copy = g_new (GtkCrossingData, 1);
copy->type = crossing->type;
copy->direction = crossing->direction;
if (crossing->old_target)
copy->old_target = g_object_ref (crossing->old_target);
if (crossing->new_target)
copy->new_target = g_object_ref (crossing->new_target);
return copy;
}
static void
gtk_crossing_data_free (GtkCrossingData *crossing)
{
g_clear_object (&crossing->old_target);
g_clear_object (&crossing->new_target);
g_free (crossing);
}
G_DEFINE_BOXED_TYPE (GtkCrossingData, gtk_crossing_data,
gtk_crossing_data_copy, gtk_crossing_data_free)
-3
View File
@@ -40,9 +40,6 @@ G_BEGIN_DECLS
#define GTK_EVENT_CONTROLLER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER, GtkEventControllerClass))
GDK_AVAILABLE_IN_ALL
GType gtk_crossing_data_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GType gtk_event_controller_get_type (void) G_GNUC_CONST;
+4
View File
@@ -325,6 +325,9 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
if (dx != 0 || dy != 0)
g_signal_emit (controller, signals[SCROLL], 0, dx, dy, &handled);
else if (direction == GDK_SCROLL_SMOOTH &&
(scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_DISCRETE) != 0)
handled = scroll->active;
if (direction == GDK_SCROLL_SMOOTH &&
scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_KINETIC)
@@ -334,6 +337,7 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
{
g_signal_emit (controller, signals[SCROLL_END], 0);
scroll->active = FALSE;
handled = FALSE;
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_KINETIC)
{
+6
View File
@@ -369,6 +369,12 @@ gtk_expander_class_init (GtkExpanderClass *klass)
GTK_TYPE_WIDGET,
GTK_PARAM_READWRITE));
/**
* GtkExpander::activate:
* @expander: the #GtkExpander that emitted the signal
*
* Activates the #GtkExpander.
*/
activate_signal =
g_signal_new (I_("activate"),
G_TYPE_FROM_CLASS (gobject_class),
+8 -1
View File
@@ -59,7 +59,14 @@
*
* # CSS nodes
*
* GtkFontButton has a single CSS node with name fontbutton.
* |[<!-- language="plain" -->
* fontbutton
* button.font
* [content]
*]|
*
* GtkFontButton has a single CSS node with name fontbutton which
* contains a button node with the .font style class.
*/
typedef struct _GtkFontButtonClass GtkFontButtonClass;
+53 -12
View File
@@ -24,7 +24,8 @@
* @See_also: #GtkGesture, #GtkGestureSingle
*
* #GtkGestureStylus is a #GtkGesture implementation specific to stylus
* input. The provided signals just provide the basic information
* input. The provided signals just relay the basic information of the
* stylus events.
*/
#include "config.h"
@@ -34,6 +35,7 @@
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkmain.h"
#include "gtknative.h"
G_DEFINE_TYPE (GtkGestureStylus, gtk_gesture_stylus, GTK_TYPE_GESTURE_SINGLE)
@@ -94,6 +96,14 @@ gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
event_controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
event_controller_class->handle_event = gtk_gesture_stylus_handle_event;
/**
* GtkGestureStylus::proximity:
* @gesture: the #GtkGestureStylus that emitted the signal
* @x: the X coordinate of the stylus event
* @y: the Y coordinate of the stylus event
*
* A signal emitted when the stylus is in proximity of the device.
*/
signals[PROXIMITY] =
g_signal_new (I_("proximity"),
G_TYPE_FROM_CLASS (klass),
@@ -106,6 +116,14 @@ gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkGestureStylus::down:
* @gesture: the #GtkGestureStylus that emitted the signal
* @x: the X coordinate of the stylus event
* @y: the Y coordinate of the stylus event
*
* A signal emitted when the stylus touches the device.
*/
signals[DOWN] =
g_signal_new (I_("down"),
G_TYPE_FROM_CLASS (klass),
@@ -118,6 +136,14 @@ gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkGestureStylus::motion:
* @gesture: the #GtkGestureStylus that emitted the signal
* @x: the X coordinate of the stylus event
* @y: the Y coordinate of the stylus event
*
* A signal emitted when the stylus moves while touching the device.
*/
signals[MOTION] =
g_signal_new (I_("motion"),
G_TYPE_FROM_CLASS (klass),
@@ -130,6 +156,14 @@ gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkGestureStylus::up:
* @gesture: the #GtkGestureStylus that emitted the signal
* @x: the X coordinate of the stylus event
* @y: the Y coordinate of the stylus event
*
* A signal emitted when the stylus no longer touches the device.
*/
signals[UP] =
g_signal_new (I_("up"),
G_TYPE_FROM_CLASS (klass),
@@ -178,12 +212,13 @@ gesture_get_current_event (GtkGestureStylus *gesture)
* @axis: requested device axis
* @value: (out): return location for the axis value
*
* Returns the current value for the requested @axis. This function
* must be called from either the #GtkGestureStylus::down,
* #GtkGestureStylus::motion, #GtkGestureStylus::up or #GtkGestureStylus::proximity
* signals.
* Returns the current value for the requested @axis.
*
* Returns: #TRUE if there is a current value for the axis
* This function must be called from the handler of one of the
* #GtkGestureStylus::down, #GtkGestureStylus::motion,
* #GtkGestureStylus::up or #GtkGestureStylus::proximity signals.
*
* Returns: %TRUE if there is a current value for the axis
**/
gboolean
gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
@@ -214,7 +249,7 @@ gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
* #GtkGestureStylus::motion, #GtkGestureStylus::up or #GtkGestureStylus::proximity
* signals.
*
* Returns: #TRUE if there is a current value for the axes
* Returns: %TRUE if there is a current value for the axes
**/
gboolean
gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
@@ -272,9 +307,9 @@ gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
* gtk_gesture_stylus_get_axis() call express the latest (most up-to-date)
* state in motion history.
*
* @backlog is provided in chronological order.
* The @backlog is provided in chronological order.
*
* Returns: #TRUE if there is a backlog to unfold in the current state.
* Returns: %TRUE if there is a backlog to unfold in the current state.
**/
gboolean
gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
@@ -285,6 +320,8 @@ gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
GArray *backlog_array;
GdkTimeCoord *history = NULL;
guint n_coords = 0, i;
double surf_x, surf_y;
GtkNative *native;
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
g_return_val_if_fail (backlog != NULL && n_elems != NULL, FALSE);
@@ -297,6 +334,9 @@ gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
if (!history)
return FALSE;
native = gtk_widget_get_native (gtk_get_event_widget (event));
gtk_native_get_surface_transform (native, &surf_x, &surf_y);
backlog_array = g_array_new (FALSE, FALSE, sizeof (GdkTimeCoord));
for (i = 0; i < n_coords; i++)
{
@@ -305,10 +345,11 @@ gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
g_array_append_val (backlog_array, *time_coord);
time_coord = &g_array_index (backlog_array, GdkTimeCoord, backlog_array->len - 1);
if (gtk_widget_compute_point (gtk_get_event_widget (event),
if (gtk_widget_compute_point (GTK_WIDGET (native),
gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)),
&GRAPHENE_POINT_INIT (time_coord->axes[GDK_AXIS_X],
time_coord->axes[GDK_AXIS_Y]),
&GRAPHENE_POINT_INIT (time_coord->axes[GDK_AXIS_X] - surf_x,
time_coord->axes[GDK_AXIS_Y] - surf_y),
&p))
{
time_coord->axes[GDK_AXIS_X] = p.x;
+5 -8
View File
@@ -3850,7 +3850,7 @@ gtk_icon_paintable_ensure_texture (GtkIconPaintable *self)
icon_ensure_texture__locked (self, FALSE);
texture = g_object_ref (self->texture);
texture = self->texture;
g_mutex_unlock (&self->texture_lock);
@@ -3867,10 +3867,10 @@ init_color_matrix (graphene_matrix_t *color_matrix,
const GdkRGBA *warning_color,
const GdkRGBA *error_color)
{
GdkRGBA fg_default = { 0.7450980392156863, 0.7450980392156863, 0.7450980392156863, 1.0};
GdkRGBA success_default = { 0.3046921492332342,0.6015716792553597, 0.023437857633325704, 1.0};
GdkRGBA warning_default = {0.9570458533607996, 0.47266346227206835, 0.2421911955443656, 1.0 };
GdkRGBA error_default = { 0.796887159533074, 0 ,0, 1.0 };
const GdkRGBA fg_default = { 0.7450980392156863, 0.7450980392156863, 0.7450980392156863, 1.0};
const GdkRGBA success_default = { 0.3046921492332342,0.6015716792553597, 0.023437857633325704, 1.0};
const GdkRGBA warning_default = {0.9570458533607996, 0.47266346227206835, 0.2421911955443656, 1.0 };
const GdkRGBA error_default = { 0.796887159533074, 0 ,0, 1.0 };
const GdkRGBA *fg = foreground_color ? foreground_color : &fg_default;
const GdkRGBA *sc = success_color ? success_color : &success_default;
const GdkRGBA *wc = warning_color ? warning_color : &warning_default;
@@ -3971,11 +3971,8 @@ gtk_icon_paintable_snapshot_with_colors (GtkIconPaintable *icon,
if (symbolic)
gtk_snapshot_pop (snapshot);
g_object_unref (texture);
}
static GdkPaintableFlags
icon_paintable_get_flags (GdkPaintable *paintable)
{
+82 -108
View File
@@ -3199,12 +3199,11 @@ get_layout_location (GtkLabel *self,
int *yp)
{
GtkWidget *widget = GTK_WIDGET (self);
int req_width, x, y;
int req_height;
int layout_width, layout_height, x, y;
float xalign, yalign;
PangoRectangle logical;
int baseline, layout_baseline, baseline_offset;
int label_width, label_height;
int widget_width, widget_height;
xalign = self->xalign;
yalign = self->yalign;
@@ -3212,19 +3211,17 @@ get_layout_location (GtkLabel *self,
if (_gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
xalign = 1.0 - xalign;
pango_layout_get_extents (self->layout, NULL, &logical);
pango_layout_get_pixel_extents (self->layout, NULL, &logical);
pango_extents_to_pixels (&logical, NULL);
layout_width = logical.width;
layout_height = logical.height;
req_width = logical.width;
req_height = logical.height;
label_width = gtk_widget_get_width (widget);
label_height = gtk_widget_get_height (widget);
widget_width = gtk_widget_get_width (widget);
widget_height = gtk_widget_get_height (widget);
baseline = gtk_widget_get_allocated_baseline (widget);
x = floor ((xalign * (label_width - req_width)) - logical.x);
x = floor ((xalign * (widget_width - layout_width)) - logical.x);
baseline_offset = 0;
if (baseline != -1)
@@ -3234,23 +3231,7 @@ get_layout_location (GtkLabel *self,
yalign = 0.0; /* Can't support yalign while baseline aligning */
}
/* bgo#315462 - For single-line labels, *do* align the requisition with
* respect to the allocation, even if we are under-allocated. For multi-line
* labels, always show the top of the text when they are under-allocated. The
* rationale is this:
*
* - Single-line labels appear in GtkButtons, and it is very easy to get them
* to be smaller than their requisition. The button may clip the label, but
* the label will still be able to show most of itself and the focus
* rectangle. Also, it is fairly easy to read a single line of clipped text.
*
* - Multi-line labels should not be clipped to showing "something in the
* middle". You want to read the first line, at least, to get some context.
*/
if (pango_layout_get_line_count (self->layout) == 1)
y = floor ((label_height - req_height) * yalign) + baseline_offset;
else
y = floor (MAX ((label_height - req_height) * yalign, 0)) + baseline_offset;
y = floor ((widget_height - layout_height) * yalign) + baseline_offset;
if (xp)
*xp = x;
@@ -3440,42 +3421,84 @@ gtk_label_snapshot (GtkWidget *widget,
GtkLabelSelectionInfo *info;
GtkStyleContext *context;
int lx, ly;
int width, height, x;
int width, height;
info = self->select_info;
if (!self->text || (*self->text == '\0'))
return;
gtk_label_ensure_layout (self);
context = _gtk_widget_get_style_context (widget);
get_layout_location (self, &lx, &ly);
gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout);
info = self->select_info;
if (!info)
return;
width = gtk_widget_get_width (widget);
height = gtk_widget_get_height (widget);
x = 0;
if (self->text && (*self->text != '\0'))
if (info->selection_anchor != info->selection_end)
{
get_layout_location (self, &lx, &ly);
int range[2];
cairo_region_t *range_clip;
cairo_rectangle_int_t clip_rect;
int i;
gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout);
range[0] = MIN (info->selection_anchor, info->selection_end);
range[1] = MAX (info->selection_anchor, info->selection_end);
if (info && (info->selection_anchor != info->selection_end))
gtk_style_context_save_to_node (context, info->selection_node);
range_clip = gdk_pango_layout_get_clip_region (self->layout, lx, ly, range, 1);
for (i = 0; i < cairo_region_num_rectangles (range_clip); i++)
{
int range[2];
cairo_region_t *range_clip;
cairo_rectangle_int_t clip_rect;
int i;
cairo_region_get_rectangle (range_clip, i, &clip_rect);
range[0] = info->selection_anchor;
range[1] = info->selection_end;
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect));
gtk_snapshot_render_background (snapshot, context, 0, 0, width, height);
gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout);
gtk_snapshot_pop (snapshot);
}
if (range[0] > range[1])
{
int tmp = range[0];
range[0] = range[1];
range[1] = tmp;
}
cairo_region_destroy (range_clip);
gtk_style_context_save_to_node (context, info->selection_node);
gtk_style_context_restore (context);
}
else
{
GtkLabelLink *focus_link;
GtkLabelLink *active_link;
int range[2];
cairo_region_t *range_clip;
cairo_rectangle_int_t clip_rect;
int i;
GdkRectangle rect;
if (info->selectable &&
gtk_widget_has_focus (widget) &&
gtk_widget_is_drawable (widget))
{
PangoDirection cursor_direction;
cursor_direction = get_cursor_direction (self);
gtk_snapshot_render_insertion_cursor (snapshot, context,
lx, ly,
self->layout, self->select_info->selection_end,
cursor_direction);
}
focus_link = gtk_label_get_focus_link (self, NULL);
active_link = info->active_link;
if (active_link)
{
range[0] = active_link->start;
range[1] = active_link->end;
gtk_style_context_save_to_node (context, active_link->cssnode);
range_clip = gdk_pango_layout_get_clip_region (self->layout, lx, ly, range, 1);
for (i = 0; i < cairo_region_num_rectangles (range_clip); i++)
@@ -3483,7 +3506,7 @@ gtk_label_snapshot (GtkWidget *widget,
cairo_region_get_rectangle (range_clip, i, &clip_rect);
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect));
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
gtk_snapshot_render_background (snapshot, context, 0, 0, width, height);
gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout);
gtk_snapshot_pop (snapshot);
}
@@ -3492,71 +3515,22 @@ gtk_label_snapshot (GtkWidget *widget,
gtk_style_context_restore (context);
}
else if (info)
if (focus_link && gtk_widget_has_visible_focus (widget))
{
GtkLabelLink *focus_link;
GtkLabelLink *active_link;
int range[2];
cairo_region_t *range_clip;
cairo_rectangle_int_t clip_rect;
int i;
GdkRectangle rect;
range[0] = focus_link->start;
range[1] = focus_link->end;
if (info->selectable &&
gtk_widget_has_focus (widget) &&
gtk_widget_is_drawable (widget))
{
PangoDirection cursor_direction;
gtk_style_context_save_to_node (context, focus_link->cssnode);
cursor_direction = get_cursor_direction (self);
gtk_snapshot_render_insertion_cursor (snapshot, context,
lx, ly,
self->layout, self->select_info->selection_end,
cursor_direction);
}
range_clip = gdk_pango_layout_get_clip_region (self->layout, lx, ly, range, 1);
cairo_region_get_extents (range_clip, &rect);
focus_link = gtk_label_get_focus_link (self, NULL);
active_link = info->active_link;
gtk_snapshot_render_focus (snapshot, context, rect.x, rect.y, rect.width, rect.height);
if (active_link)
{
range[0] = active_link->start;
range[1] = active_link->end;
cairo_region_destroy (range_clip);
gtk_style_context_save_to_node (context, active_link->cssnode);
range_clip = gdk_pango_layout_get_clip_region (self->layout, lx, ly, range, 1);
for (i = 0; i < cairo_region_num_rectangles (range_clip); i++)
{
cairo_region_get_rectangle (range_clip, i, &clip_rect);
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect));
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout);
gtk_snapshot_pop (snapshot);
}
cairo_region_destroy (range_clip);
gtk_style_context_restore (context);
}
if (focus_link && gtk_widget_has_visible_focus (widget))
{
range[0] = focus_link->start;
range[1] = focus_link->end;
gtk_style_context_save_to_node (context, focus_link->cssnode);
range_clip = gdk_pango_layout_get_clip_region (self->layout, lx, ly, range, 1);
cairo_region_get_extents (range_clip, &rect);
gtk_snapshot_render_focus (snapshot, context, rect.x, rect.y, rect.width, rect.height);
cairo_region_destroy (range_clip);
gtk_style_context_restore (context);
}
gtk_style_context_restore (context);
}
}
}

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