Compare commits
427 Commits
3.15.7
...
wip/cssnode3
| Author | SHA1 | Date | |
|---|---|---|---|
| 1af58dc4ee | |||
| cb1cf06744 | |||
| c5d00ae119 | |||
| 15582ef9c1 | |||
| 0e57785af7 | |||
| 52f58f1637 | |||
| cd87252130 | |||
| 85d86d61de | |||
| 0d01ceb415 | |||
| aa005486de | |||
| cdd26d0d01 | |||
| f408c59869 | |||
| 4326e38b90 | |||
| 0f488064a2 | |||
| e6c7e038c8 | |||
| 18bd973014 | |||
| dae2d9ec27 | |||
| c0c79eee03 | |||
| 3f13349f27 | |||
| d6bfc2b9c9 | |||
| fa1bb8972a | |||
| 8e82d0fba2 | |||
| 7b1ff7c215 | |||
| 3211e82b59 | |||
| 6c8c37abbb | |||
| d5160bb950 | |||
| a59fd4a9ad | |||
| 4d0e1e0b88 | |||
| d48ba486ee | |||
| 7dac38f841 | |||
| ec57c6c10b | |||
| d55c261079 | |||
| 8640bc47b1 | |||
| d0d9f5a302 | |||
| 10d39171d9 | |||
| 6988f9b818 | |||
| c7fba52a36 | |||
| 7395dddd47 | |||
| d785820c53 | |||
| 759d8dafd9 | |||
| d9727290cf | |||
| 68b8f792d6 | |||
| 776d99ac51 | |||
| 092ff983f7 | |||
| df51bc836b | |||
| 3d1e2a0558 | |||
| 399df06d19 | |||
| 6dd19306eb | |||
| f43543165b | |||
| 2954417335 | |||
| 172f345d01 | |||
| fbe796f293 | |||
| 2ec26cd9b5 | |||
| 4b2cdb37fb | |||
| dbe5058b86 | |||
| 5833858abf | |||
| ceaa594fa4 | |||
| cadf6a9d3c | |||
| 16b8972bee | |||
| c0f6e746a0 | |||
| 13fd368781 | |||
| 75b633ae08 | |||
| da25771e58 | |||
| e95985da26 | |||
| 6f9969f4fe | |||
| b827725ace | |||
| 6c00eba7fb | |||
| d3471508a0 | |||
| 9b73b39f9a | |||
| 2670ae4436 | |||
| 2694545468 | |||
| ee91fb71ca | |||
| b92fe2fa85 | |||
| 507016cafc | |||
| 310f9f40da | |||
| ee6d081ed9 | |||
| 89115be3cb | |||
| 2a5194b635 | |||
| 2143abe5ee | |||
| 76ca9a9181 | |||
| 2bf7bdd651 | |||
| 630f0f199e | |||
| 5df01f9244 | |||
| 5edc6d94d1 | |||
| ffb410f11e | |||
| 28043f0a92 | |||
| efda30c495 | |||
| 020f3f11c8 | |||
| cdd964a3af | |||
| 5f19f09ac3 | |||
| caf2fc9a10 | |||
| 219e52f7e1 | |||
| 71813671ef | |||
| c550cf122a | |||
| 649edbe2fc | |||
| c4b88e05fd | |||
| 637a4bda5c | |||
| 03ac5f310b | |||
| 6dc6af674c | |||
| 4cc2af2db1 | |||
| 8e1017db35 | |||
| 55e68bc2ea | |||
| a589f98821 | |||
| 721dce73e0 | |||
| 8c73799ca8 | |||
| 7bafb63ec3 | |||
| d79a44c1af | |||
| 6f99a3cdb0 | |||
| 0e3da2f7cf | |||
| b9f1f8aa38 | |||
| 21c3b13596 | |||
| 40d94fcd38 | |||
| e2f6d4db43 | |||
| 726d8abb7d | |||
| cf6d9edc12 | |||
| be596f3967 | |||
| 99c4f2dd39 | |||
| 0529e15d61 | |||
| dcfa55ac7e | |||
| 28063ee2e4 | |||
| 416c370da1 | |||
| d823c39caf | |||
| 00544e9090 | |||
| 3d3591e873 | |||
| 49b6be4e06 | |||
| 557f5d5c7c | |||
| bcddf68858 | |||
| 75105f94f0 | |||
| f671cd6296 | |||
| 9b5fa0860f | |||
| 390dd37656 | |||
| 88a5959b22 | |||
| 27164484cd | |||
| 6f478db2fa | |||
| d5d28a5062 | |||
| 4e930ada32 | |||
| c7672699e9 | |||
| 855c4dc0ce | |||
| 70e7b4c848 | |||
| b4b23580a6 | |||
| b4e61b759b | |||
| f5f6ad9981 | |||
| 2e272106ef | |||
| 2d013a739a | |||
| a24aee6bb2 | |||
| 225c10bc5a | |||
| 7372ddd2a1 | |||
| 465647e964 | |||
| 7b2cdabc2e | |||
| c7be8fd398 | |||
| 6675b9639c | |||
| 49cd3c8232 | |||
| 25b610ef5e | |||
| de239ca31b | |||
| 5dfbeb978f | |||
| e98b096ca8 | |||
| 399d2c1389 | |||
| 59a901e285 | |||
| 8d58b64c28 | |||
| 0df9b59dfc | |||
| 17a221dba9 | |||
| e6f9c49c22 | |||
| 11096885ae | |||
| 838c9a0d98 | |||
| c5905b13b9 | |||
| d2881d901b | |||
| 7ef7873b23 | |||
| 10ea4d81e6 | |||
| 2026efb981 | |||
| e41cadd835 | |||
| 0ddb5d729c | |||
| bb3ae47477 | |||
| a744a67f42 | |||
| c93d66c8a7 | |||
| a7ef117b4a | |||
| f0609a5142 | |||
| d89bd0040c | |||
| fec8a1ee7f | |||
| 98730f71f9 | |||
| b756fd42a0 | |||
| 4d889ccc42 | |||
| 5f8e054a9d | |||
| fe13fb841b | |||
| 1349b0f72d | |||
| b974ced51b | |||
| c9faea04c5 | |||
| 171d4305f4 | |||
| d96cbb3b59 | |||
| e944525596 | |||
| 49881eebbb | |||
| 8615a52ca3 | |||
| 7ad203732f | |||
| 93f8966bd9 | |||
| 181e58e402 | |||
| 63f59dde3a | |||
| b2d40afdf5 | |||
| f82341d1d3 | |||
| 80013436d0 | |||
| 52858f709c | |||
| d65ccf96ee | |||
| 3b45be94e8 | |||
| b4344861a0 | |||
| a52ff2f66e | |||
| 073a9c9cd5 | |||
| 622a930c5a | |||
| 2f8938cf23 | |||
| 1cc35cdc6d | |||
| 9e2cdce58e | |||
| 94ec6b4418 | |||
| c352093bde | |||
| ac4da770e1 | |||
| 5ced234144 | |||
| 9ec2804775 | |||
| f8eac08a0a | |||
| af36220bca | |||
| 8e3b499699 | |||
| 968780d8da | |||
| 4fc6880d83 | |||
| 51971d56bc | |||
| c7f5f10853 | |||
| 61c46d911f | |||
| 19222a6364 | |||
| 7479133753 | |||
| 0282714d86 | |||
| 586240d2f8 | |||
| e99e282b5a | |||
| 52f5a78c6d | |||
| 01d76b7701 | |||
| 59d12be94f | |||
| 9b18deee1f | |||
| 7385784ded | |||
| 6950116678 | |||
| 247e62390b | |||
| ec567e5fad | |||
| 6b23c44056 | |||
| f6d0b9e9a9 | |||
| 70775e1985 | |||
| 8ecc51ad8a | |||
| 4938aa9c6b | |||
| 1f3328c096 | |||
| 6e7ad732fc | |||
| cbf5b49cb8 | |||
| b3725a455d | |||
| 9c545ac2e8 | |||
| b87715973f | |||
| 064f4db012 | |||
| 45da8bf045 | |||
| 91bc414360 | |||
| e2190d7a01 | |||
| 7fbbf850c3 | |||
| 1fb172011c | |||
| 4691049f9e | |||
| 40c8d8bcf4 | |||
| 08b5de7836 | |||
| 6ac3ec0b53 | |||
| 2b7eaaf86e | |||
| 08494f86a0 | |||
| 768e6a4579 | |||
| ce9a5a3fec | |||
| 17bc7aaefd | |||
| 71bd1c7e2c | |||
| b92573e42e | |||
| 76c66ef2ed | |||
| 5751d4f66e | |||
| b2f3b67494 | |||
| a994f4edfb | |||
| 79321c0d8a | |||
| 48c93fb347 | |||
| 163f7e75bf | |||
| bb78a39103 | |||
| 05ef31362d | |||
| a4f69408ac | |||
| e31a936e3e | |||
| 32c0c6fee0 | |||
| 238cdd5e37 | |||
| 3569d373a2 | |||
| 0019eb7bf9 | |||
| 209c5c37f3 | |||
| 18de5e6547 | |||
| d2fe45ab57 | |||
| 65b55938ca | |||
| 4cae9bdd05 | |||
| 3ccfcf5b9f | |||
| da679f3866 | |||
| 1feaa6f301 | |||
| 22c83e5ea7 | |||
| eaebc2cb4b | |||
| d070e4c742 | |||
| c55fcd35fe | |||
| 13e22e2030 | |||
| 0796d7b6ff | |||
| 2e52e9964b | |||
| a4e0de1839 | |||
| 0910eaf6fe | |||
| 7c4bf742e8 | |||
| 66d25c4a06 | |||
| c2aff4ab6e | |||
| bc77408e3c | |||
| c91076f64c | |||
| 4f0ab5656b | |||
| 9ba4bed117 | |||
| fc838cefbf | |||
| d87041bfe3 | |||
| 8a0d02c548 | |||
| f126157bfa | |||
| 6ed479e71c | |||
| 5611cf2096 | |||
| 2a3f1a49de | |||
| a764e343c7 | |||
| af86bc58b9 | |||
| 94c5d691df | |||
| a0eb0e2346 | |||
| 3d205a2037 | |||
| 3b10269a12 | |||
| 6ccef21d49 | |||
| 53028ff3bb | |||
| ff85f6ce3f | |||
| 0507a4d39a | |||
| 7cee6c5cc6 | |||
| ab3084b714 | |||
| 00f4c070f4 | |||
| 668df30b60 | |||
| 3ce3593ebf | |||
| 45210d5835 | |||
| f96f69996a | |||
| 6855e1eec3 | |||
| c951740cf9 | |||
| 5840c931b3 | |||
| b08015371b | |||
| b3a5d86d5d | |||
| b618256a4c | |||
| 6a0290145d | |||
| f74067dda2 | |||
| 979a4c1b08 | |||
| 7fa9089196 | |||
| ff0aabe576 | |||
| f13157f4bb | |||
| aa81262f11 | |||
| 56c9eac16e | |||
| a70b478a5c | |||
| 40f2af665d | |||
| 0ab48fcc42 | |||
| 9e50fe0aeb | |||
| e86cad1006 | |||
| 1b578ef33a | |||
| 02774f9fd5 | |||
| d582e71ba8 | |||
| f986730c14 | |||
| 0c903156ef | |||
| b06908ad52 | |||
| 913e10fe3b | |||
| b0b38c106d | |||
| aba2de3443 | |||
| 761c781168 | |||
| b85fc8045c | |||
| eddaf01676 | |||
| acd72ffabe | |||
| e7a2fc2d01 | |||
| ec07987a90 | |||
| c73ab94d3f | |||
| 3222de2f91 | |||
| 2b6376248d | |||
| c060d93e3d | |||
| 8726c6d5d2 | |||
| 1402e22862 | |||
| 5a0ad907b4 | |||
| 25308477e7 | |||
| 44d3b71678 | |||
| 1ffcdfcc32 | |||
| ae63b21c61 | |||
| 967ba60303 | |||
| ee857cd261 | |||
| fb581a1084 | |||
| 77c982ed3f | |||
| 486b56e179 | |||
| f07677c105 | |||
| 851d784f6d | |||
| 178d9bd84c | |||
| 09daf9b916 | |||
| 415ab252f4 | |||
| fa48b42ef1 | |||
| 85ad434290 | |||
| cff1694c99 | |||
| 3a671994d4 | |||
| 4fc98ae345 | |||
| 00f9f1cc6b | |||
| cc780116a2 | |||
| 4a7da1e143 | |||
| b8005f4de9 | |||
| 8b4863f0c4 | |||
| 09bb109f01 | |||
| 668d5d8665 | |||
| b397dd04c4 | |||
| 5091ae5e04 | |||
| c85e32d56e | |||
| 50c848a992 | |||
| 7624418ddf | |||
| e1100813e6 | |||
| 11960fa916 | |||
| 359fc25aad | |||
| 3d88899072 | |||
| e160befdf8 | |||
| 8c32f403fb | |||
| a0a1ea10a8 | |||
| 7233281d05 | |||
| eb995ce453 | |||
| e43ec48e83 | |||
| 4162fccaa2 | |||
| bf22ac8337 | |||
| 5a907cc094 | |||
| c473afbdc9 | |||
| b3043e429b | |||
| f4510c93b7 | |||
| 0cf63ec892 | |||
| 0a4879b9ac | |||
| da559c08f9 | |||
| e1081bc471 | |||
| 86a41b108e | |||
| 1b171e812e | |||
| 295b8aab0c | |||
| 0c4a42e629 | |||
| a414faa997 | |||
| 36fcd7327c | |||
| 1500626d44 | |||
| 978c364847 | |||
| 26cc941a9e | |||
| 0550ba4208 |
+3
-2
@@ -1,7 +1,7 @@
|
||||
## Makefile.am for GTK+
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SRC_SUBDIRS = util gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
@@ -21,7 +21,8 @@ EXTRA_DIST += \
|
||||
gtk-zip.sh.in \
|
||||
sanitize-la.sh \
|
||||
po/README.translators \
|
||||
po/po2tbl.sed.in
|
||||
po/po2tbl.sed.in \
|
||||
make-pot
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
|
||||
|
||||
@@ -1,3 +1,198 @@
|
||||
Overview of Changes in GTK+ 3.15.12
|
||||
===================================
|
||||
|
||||
* GtkMenuButton:
|
||||
- Improve accessible names
|
||||
|
||||
* GtkCellRendererPixbuf:
|
||||
- Always follow state changes, the ::follow-state property
|
||||
is now ignored. This is necessary to make HighContrast
|
||||
and symbolic icons remain visible e.g. in selected rows.
|
||||
|
||||
* GtkEntry:
|
||||
- Rework the size allocation code to be less arcane. This
|
||||
changed the semantics of the get_frame_size() vfunc. GtkEntry
|
||||
subclasses that override this vfunc may need adjustment.
|
||||
|
||||
* Wayland:
|
||||
- Support hi-dpi cursors
|
||||
|
||||
* Bugs fixed:
|
||||
745829 crash when double-clicking close button while popover...
|
||||
746141 wayland: Support HiDPI pointer cursors
|
||||
746192 Insensitive backdrop ToolButtons are not drawn correctly
|
||||
746201 Sidebar icons are black on black in HighContrast theme
|
||||
746202 use insensitive color for unfocused selected items
|
||||
746205 gemfile: needs add source rubygems.org
|
||||
746282 pixman warnings after recent changes
|
||||
746301 Opening "Sound" panel generates pixman error
|
||||
|
||||
* Translation updates:
|
||||
Bosnian
|
||||
Bulgarian
|
||||
Catalan
|
||||
Danish
|
||||
Punjabi
|
||||
Slovenian
|
||||
Swedish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.11
|
||||
===================================
|
||||
|
||||
* Go back to requiring GTK_FRAME_EXTENTS support for CSD,
|
||||
to fix shadow problems in KDE.
|
||||
|
||||
* Bug fixes:
|
||||
535929 Fix warnings from xReply test in configure.in
|
||||
577862 FileFilter name not set
|
||||
669008 Kerberos authentication popup
|
||||
712760 Clang static analysis fixes
|
||||
739070 Undefined reference to get_xkb() when building with --disable-xkb
|
||||
744288 gdk_gl_context_set_required_version() handles version requests...
|
||||
744589 nautilus bookmarks changing places randomly
|
||||
745065 GtkPrintOperation dialog creation fails when GTK is locally loaded
|
||||
745463 Search suggestions are not shown in Clocks / Weather
|
||||
745479 Tracker search in file chooser causes a crash
|
||||
745562 gedit titlebar is no longer draggable
|
||||
745578 sincos is not portable
|
||||
745622 Selected text not highlighted in GtkInfoBar
|
||||
745721 wayland: Add support for gtk_window_set_modal
|
||||
745918 add padding to textview in CSS section of GtkInspector
|
||||
745969 CSD windows cannot be moved immediately after being resized
|
||||
746013 Invalid write of size 8
|
||||
Print dialog: Fix icons in HighContrast
|
||||
Fix selected menu items in HighContrast
|
||||
App chooser: Fix icons in HighContrast
|
||||
|
||||
* Translation updates:
|
||||
French
|
||||
Galician
|
||||
Kazakh
|
||||
Korean
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.10
|
||||
===================================
|
||||
|
||||
* GtkFileChooser:
|
||||
- Don't start search too eagerly
|
||||
- Use fts with tracker
|
||||
- Make tracker queries more similar to nautilus
|
||||
|
||||
GtkWindow:
|
||||
- Improve window dragging on header bars
|
||||
|
||||
* Printing:
|
||||
- Make avahi-browsed printers work
|
||||
- Set printer state correctly
|
||||
|
||||
* Wayland
|
||||
- Exit cleanly if the compositor goes away
|
||||
- Don't ignore early maximization/fullscreening
|
||||
- Make subsurface popovers work under Weston
|
||||
|
||||
* GL
|
||||
- Port GdkGears example to modern OpenGL
|
||||
|
||||
* Bugs fixed:
|
||||
741511 Critical message: NULL is passed to g_object_unref() in spi_...
|
||||
743323 avahi-discovered CUPS printers don't work
|
||||
743427 subsurface-using popovers don't work on Weston
|
||||
744879 Another core dump when clicking the Back button
|
||||
745225 eventcontroller: Don't crash if the widget is destroyed first
|
||||
745263 The Open button in the new file chooser is too low/thin
|
||||
745289 wayland: do not use g_error() on connection errors
|
||||
745303 Wayland: Initial setup window is not maximised
|
||||
745344 overlay scrollbar fail
|
||||
745400 fix a couple of issues in gdkglcontext-win32
|
||||
703610 Problems with UC-Logic WA60 tablet
|
||||
729366 Changes to folder name are not shown when creating new fol...
|
||||
745315 Overshoot deceleration causes WebKitGTK1 web view to jump ...
|
||||
|
||||
* Translation updates
|
||||
Afrikaans
|
||||
Czech
|
||||
French
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Kazakh
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Spanish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.9
|
||||
==================================
|
||||
|
||||
* GtkScrolledWindow
|
||||
- Avoid 'jumping' when zoom scrolling kicks in
|
||||
- Make zoom scrolling less easy to trigger
|
||||
- Make steppers use smooth autoscrolling
|
||||
|
||||
* Input methods can now be turned off entirely, which
|
||||
can be useful to free up the Ctrl-Shift-u shortcut
|
||||
|
||||
* Add some DND support to gtk3-icon-browser
|
||||
|
||||
* Bugs fixed:
|
||||
696505 Segfault on Windows x64: gtkstatusicon.c tries to put 64-bit...
|
||||
744942 quartz: Avoid segfaulting when calling gdk_window_ensure_native
|
||||
744991 Fix loading of GResource SVGs
|
||||
745052 Icon theme code assumes directories with mtime 0 don't exist
|
||||
745076 Various DPI and OpenGL related fixes in the Wayland backend
|
||||
Fix crash and miscalculation in css bitmask manipulation
|
||||
Fix a crash due to too large surfaces
|
||||
|
||||
* Translation updates
|
||||
Chinese (Taiwan)
|
||||
Hebrew
|
||||
Hungarian
|
||||
Galician
|
||||
Greek
|
||||
Slovak
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.8
|
||||
==================================
|
||||
|
||||
* CSS
|
||||
- Support animated font weight changes
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Ensure indicators appear in the correct place
|
||||
|
||||
* Wayland:
|
||||
- DND fixes
|
||||
|
||||
* GtkPopover:
|
||||
- has a map/unmap animation now
|
||||
|
||||
* Bugs fixed:
|
||||
743647 image-missing is missing from libgtk's resources
|
||||
744054 Clarify documentation for event propagation a...
|
||||
744683 Tooltips should have ATK_ROLE_TOOL_TIP (like ...
|
||||
|
||||
* Translation updates
|
||||
Galician
|
||||
Hebrew
|
||||
Hungarian
|
||||
Italian
|
||||
Norwegian bokmål
|
||||
Punjabi
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.7
|
||||
==================================
|
||||
|
||||
|
||||
@@ -99,6 +99,11 @@ Release notes for 3.16
|
||||
has non-scrolling parts similar to treeview headers, there is no need
|
||||
to implement this vfunc.
|
||||
|
||||
* The GtkSearchEntry widget has gained a number of new signal that
|
||||
are emitted when certain key sequences are seen. In particular, it
|
||||
now handles the Escape key and emits ::stop-search. Applications that
|
||||
expect to handle Escape themselves will need to be updated.
|
||||
|
||||
Release notes for 3.14
|
||||
======================
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -113,6 +114,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -135,6 +137,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -158,6 +161,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -169,6 +170,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -188,6 +190,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -209,6 +212,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -233,6 +237,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -255,6 +260,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -274,6 +280,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -295,6 +302,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
||||
@@ -11,26 +11,69 @@
|
||||
<GtkDoInstallBin>
|
||||
mkdir $(CopyDir)\bin
|
||||
mkdir $(CopyDir)\lib
|
||||
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\*.dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\*.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gailutil-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gtk3-demo.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.pdb" $(CopyDir)\bin
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
|
||||
:DO_BROADWAY_RELEASE
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_DEBUG
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
:DONE_BIN
|
||||
</GtkDoInstallBin>
|
||||
<GtkDoInstall>
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -108,6 +109,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -132,6 +134,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -151,6 +154,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -161,6 +161,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c"><Filter>Sources</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0"
|
||||
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
|
||||
ForcedIncludeFiles="msvc_recommended_pragmas.h"
|
||||
AdditionalOptions="/MP"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
|
||||
@@ -10,26 +10,63 @@
|
||||
Value="
|
||||
mkdir $(CopyDir)\bin

|
||||
mkdir $(CopyDir)\lib

|
||||
|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_BIN

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_RELEASE

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG

|
||||
:DO_BROADWAY_RELEASE

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_DEBUG

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
:DONE_BIN

|
||||
"
|
||||
/>
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
>
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\main.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\resources.c" />
|
||||
</Filter>
|
||||
|
||||
@@ -141,6 +141,9 @@
|
||||
#define HAVE_ROUND 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if sincos() is available */
|
||||
/* #undef HAVE_SINCOS */
|
||||
|
||||
/* Have the sockaddr_un.sun_len member */
|
||||
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
|
||||
|
||||
|
||||
+20
-19
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [15])
|
||||
m4_define([gtk_micro_version], [7])
|
||||
m4_define([gtk_micro_version], [12])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -147,7 +147,6 @@ AC_PROG_MKDIR_P
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
|
||||
GETTEXT_PACKAGE=gtk30
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
||||
@@ -666,6 +665,15 @@ fi
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
AC_MSG_CHECKING([whether xgettext supports ui files])
|
||||
if $ac_cv_path_XGETTEXT --output=- --language=Glade $srcdir/gtk/ui/gtkfilechooserwidget.ui > /dev/null 2>&1; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([GNU gettext 0.18.3 or newer is required])
|
||||
fi
|
||||
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_CONFIG_COMMANDS([po-properties],
|
||||
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
@@ -818,7 +826,7 @@ AC_TYPE_UID_T
|
||||
|
||||
# Check for round(), rint(), isnan(), isinf() and nearbyint()
|
||||
AC_CHECK_LIB(m,round,,)
|
||||
AC_CHECK_FUNCS(round rint nearbyint)
|
||||
AC_CHECK_FUNCS(round rint nearbyint sincos)
|
||||
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
# Checks for gdkspawn
|
||||
@@ -1023,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
AC_CHECK_FUNC(XextFindDisplay, :,
|
||||
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
|
||||
|
||||
# Check for xReply
|
||||
# Check if <X11/extensions/XIproto.h> is needed for xReply.
|
||||
|
||||
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
|
||||
AC_CHECK_TYPE([xReply], ,
|
||||
[AC_CHECK_TYPE([xReply],
|
||||
[AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
|
||||
[[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]])],
|
||||
[[#include <X11/Xlibint.h>]])
|
||||
|
||||
# Check for XKB support.
|
||||
|
||||
@@ -1906,7 +1908,6 @@ gtk/makefile.msc
|
||||
gtk/gtkversion.h
|
||||
gtk/gtk-win32.rc
|
||||
gtk/libgtk3.manifest
|
||||
util/Makefile
|
||||
libgail-util/Makefile
|
||||
modules/Makefile
|
||||
modules/input/Makefile
|
||||
|
||||
@@ -218,7 +218,6 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* column for symbolic icon */
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
|
||||
renderer,
|
||||
"icon-name",
|
||||
|
||||
@@ -543,7 +543,7 @@ add_data_tab (const gchar *demoname)
|
||||
* not an image. Let's try something else then.
|
||||
*/
|
||||
g_object_ref_sink (widget);
|
||||
gtk_widget_destroy (widget);
|
||||
g_object_unref (widget);
|
||||
|
||||
bytes = g_resources_lookup_data (resource_name, 0, NULL);
|
||||
g_assert (bytes);
|
||||
|
||||
@@ -20,6 +20,7 @@ gtk3_icon_browser_SOURCES = \
|
||||
main.c \
|
||||
iconbrowserapp.c iconbrowserapp.h \
|
||||
iconbrowserwin.c iconbrowserwin.h \
|
||||
iconstore.c iconstore.h \
|
||||
resources.c
|
||||
|
||||
BUILT_SOURCES = \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <string.h>
|
||||
#include "iconbrowserapp.h"
|
||||
#include "iconbrowserwin.h"
|
||||
#include "iconstore.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef struct
|
||||
@@ -42,13 +43,6 @@ struct _IconBrowserWindowClass
|
||||
GtkApplicationWindowClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
NAME_COLUMN,
|
||||
SYMBOLIC_NAME_COLUMN,
|
||||
DESCRIPTION_COLUMN,
|
||||
CONTEXT_COLUMN
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
@@ -64,16 +58,31 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
}
|
||||
|
||||
static void
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
static GdkPixbuf *
|
||||
get_icon (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
GtkIconInfo *info;
|
||||
GtkStyleContext *context;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
context = gtk_widget_get_style_context (image);
|
||||
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, size, 0);
|
||||
pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL);
|
||||
g_object_unref (info);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_changed (GtkIconView *icon_view, IconBrowserWindow *win)
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_drag_source_set_icon_pixbuf (gtk_widget_get_parent (image), pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -87,14 +96,14 @@ item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *wi
|
||||
gtk_tree_model_get_iter (GTK_TREE_MODEL (win->filter_model), &iter, path);
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = NAME_COLUMN;
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (win->filter_model), &iter,
|
||||
column, &name,
|
||||
DESCRIPTION_COLUMN, &description,
|
||||
ICON_STORE_DESCRIPTION_COLUMN, &description,
|
||||
-1);
|
||||
|
||||
|
||||
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
|
||||
{
|
||||
g_free (description);
|
||||
@@ -146,10 +155,10 @@ add_icon (IconBrowserWindow *win,
|
||||
symbolic_name = NULL;
|
||||
}
|
||||
gtk_list_store_insert_with_values (win->store, NULL, -1,
|
||||
NAME_COLUMN, regular_name,
|
||||
SYMBOLIC_NAME_COLUMN, symbolic_name,
|
||||
DESCRIPTION_COLUMN, description,
|
||||
CONTEXT_COLUMN, context,
|
||||
ICON_STORE_NAME_COLUMN, regular_name,
|
||||
ICON_STORE_SYMBOLIC_NAME_COLUMN, symbolic_name,
|
||||
ICON_STORE_DESCRIPTION_COLUMN, description,
|
||||
ICON_STORE_CONTEXT_COLUMN, context,
|
||||
-1);
|
||||
}
|
||||
|
||||
@@ -702,13 +711,13 @@ icon_visible_func (GtkTreeModel *model,
|
||||
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = NAME_COLUMN;
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
|
||||
gtk_tree_model_get (model, iter,
|
||||
column, &name,
|
||||
CONTEXT_COLUMN, &context,
|
||||
ICON_STORE_CONTEXT_COLUMN, &context,
|
||||
-1);
|
||||
if (!name)
|
||||
visible = FALSE;
|
||||
@@ -731,9 +740,11 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
|
||||
win->symbolic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
column = ICON_STORE_SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
column = NAME_COLUMN;
|
||||
column = ICON_STORE_NAME_COLUMN;
|
||||
|
||||
icon_store_set_text_column (ICON_STORE (win->store), column);
|
||||
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->cell, "icon-name", column, NULL);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (win->list), win->text_cell, "text", column, NULL);
|
||||
@@ -749,17 +760,72 @@ search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *w
|
||||
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
|
||||
}
|
||||
|
||||
static void
|
||||
get_image_data (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkSelectionData *selection,
|
||||
guint target_info,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *image;
|
||||
const gchar *name;
|
||||
gint size;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
image = gtk_bin_get_child (GTK_BIN (widget));
|
||||
|
||||
gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL);
|
||||
size = gtk_image_get_pixel_size (GTK_IMAGE (image));
|
||||
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_selection_data_set_pixbuf (selection, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_image_dnd (GtkWidget *image)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = gtk_widget_get_parent (image);
|
||||
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (parent);
|
||||
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_image_data), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_init (IconBrowserWindow *win)
|
||||
{
|
||||
GtkTargetList *list;
|
||||
GtkTargetEntry *targets;
|
||||
gint n_targets;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
|
||||
list = gtk_target_list_new (NULL, 0);
|
||||
gtk_target_list_add_text_targets (list, 0);
|
||||
targets = gtk_target_table_new_from_list (list, &n_targets);
|
||||
gtk_target_list_unref (list);
|
||||
|
||||
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (win->list),
|
||||
GDK_BUTTON1_MASK,
|
||||
targets, n_targets,
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
gtk_target_table_free (targets, n_targets);
|
||||
|
||||
setup_image_dnd (win->image1);
|
||||
setup_image_dnd (win->image2);
|
||||
setup_image_dnd (win->image3);
|
||||
setup_image_dnd (win->image4);
|
||||
setup_image_dnd (win->image5);
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
|
||||
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win));
|
||||
|
||||
|
||||
g_signal_connect (win->searchbar, "notify::search-mode-enabled",
|
||||
G_CALLBACK (search_mode_toggled), win);
|
||||
|
||||
@@ -771,6 +837,8 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
static void
|
||||
icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
{
|
||||
g_type_ensure (ICON_STORE_TYPE);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/iconbrowser/window.ui");
|
||||
|
||||
@@ -794,7 +862,6 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selection_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled);
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#include "iconstore.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
struct _IconStore
|
||||
{
|
||||
GtkListStore parent;
|
||||
|
||||
gint text_column;
|
||||
};
|
||||
|
||||
struct _IconStoreClass
|
||||
{
|
||||
GtkListStoreClass parent_class;
|
||||
};
|
||||
|
||||
static void icon_store_drag_source_init (GtkTreeDragSourceIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (IconStore, icon_store, GTK_TYPE_LIST_STORE,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
|
||||
icon_store_drag_source_init))
|
||||
|
||||
|
||||
static void
|
||||
icon_store_init (IconStore *store)
|
||||
{
|
||||
GType types[4] = { G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING };
|
||||
|
||||
gtk_list_store_set_column_types (GTK_LIST_STORE (store), 4, types);
|
||||
|
||||
store->text_column = ICON_STORE_NAME_COLUMN;
|
||||
}
|
||||
|
||||
static void
|
||||
icon_store_class_init (IconStoreClass *class)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
row_draggable (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_data_delete (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
|
||||
return gtk_list_store_remove (GTK_LIST_STORE (drag_source), &iter);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_data_get (GtkTreeDragSource *drag_source,
|
||||
GtkTreePath *path,
|
||||
GtkSelectionData *selection)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gchar *text;
|
||||
|
||||
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source), &iter, path))
|
||||
return FALSE;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (drag_source), &iter,
|
||||
ICON_STORE (drag_source)->text_column, &text,
|
||||
-1);
|
||||
|
||||
gtk_selection_data_set_text (selection, text, -1);
|
||||
|
||||
g_free (text);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
icon_store_drag_source_init (GtkTreeDragSourceIface *iface)
|
||||
{
|
||||
iface->row_draggable = row_draggable;
|
||||
iface->drag_data_delete = drag_data_delete;
|
||||
iface->drag_data_get = drag_data_get;
|
||||
}
|
||||
|
||||
void
|
||||
icon_store_set_text_column (IconStore *store, gint text_column)
|
||||
{
|
||||
store->text_column = text_column;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef __ICON_STORE_H
|
||||
#define __ICON_STORE_H
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
#define ICON_STORE_TYPE (icon_store_get_type ())
|
||||
#define ICON_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ICON_STORE_TYPE, IconStore))
|
||||
|
||||
|
||||
typedef struct _IconStore IconStore;
|
||||
typedef struct _IconStoreClass IconStoreClass;
|
||||
|
||||
enum {
|
||||
ICON_STORE_NAME_COLUMN,
|
||||
ICON_STORE_SYMBOLIC_NAME_COLUMN,
|
||||
ICON_STORE_DESCRIPTION_COLUMN,
|
||||
ICON_STORE_CONTEXT_COLUMN
|
||||
};
|
||||
|
||||
GType icon_store_get_type (void);
|
||||
|
||||
void icon_store_set_text_column (IconStore *store,
|
||||
gint column);
|
||||
|
||||
#endif /* __ICON_STORE_H */
|
||||
@@ -1,13 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.8 -->
|
||||
<object class="GtkListStore" id="store">
|
||||
<columns>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<object class="IconStore" id="store">
|
||||
</object>
|
||||
<object class="GtkTreeModelFilter" id="filter_model">
|
||||
<property name="child_model">store</property>
|
||||
@@ -108,7 +102,8 @@
|
||||
<object class="GtkIconView" id="list">
|
||||
<property name="visible">True</property>
|
||||
<property name="model">filter_model</property>
|
||||
<signal name="selection_changed" handler="selection_changed"/>
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="activate-on-single-click">True</property>
|
||||
<signal name="item_activated" handler="item_activated"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cell">
|
||||
@@ -156,12 +151,17 @@
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -169,12 +169,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -182,12 +187,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image3">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
@@ -195,12 +205,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">3</property>
|
||||
@@ -208,12 +223,17 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image5">
|
||||
<object class="GtkEventBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">4</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">4</property>
|
||||
|
||||
@@ -62,6 +62,7 @@ uninstall-update-icon-cache:
|
||||
|
||||
EXTRA_DIST += \
|
||||
widget-factory.ui \
|
||||
widget-factory.css \
|
||||
menus.ui \
|
||||
widget-factory.gresource.xml \
|
||||
data/source.svg \
|
||||
|
||||
@@ -1157,7 +1157,7 @@ activate (GApplication *app)
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
|
||||
gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
@@ -1336,6 +1336,7 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkApplication *app;
|
||||
GAction *action;
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "about", activate_about, NULL, NULL, NULL },
|
||||
{ "quit", activate_quit, NULL, NULL, NULL },
|
||||
@@ -1353,6 +1354,8 @@ main (int argc, char *argv[])
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
.circular-button {
|
||||
border-radius: 20px;
|
||||
outline-radius: 20px;
|
||||
}
|
||||
|
||||
.small-button {
|
||||
padding: 0;
|
||||
outline-width: 0;
|
||||
}
|
||||
@@ -3,6 +3,9 @@
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file preprocess="xml-stripblanks">widget-factory.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file>widget-factory.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory/gtk">
|
||||
<file preprocess="xml-stripblanks">menus.ui</file>
|
||||
</gresource>
|
||||
|
||||
@@ -1060,6 +1060,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<object class="GtkFileChooserButton" id="filechooserbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="local_only">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -1570,9 +1571,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="title" translatable="yes">Icon</property>
|
||||
<property name="reorderable">True</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
|
||||
<property name="follow_state">true</property>
|
||||
</object>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
|
||||
<attributes>
|
||||
<attribute name="icon_name">1</attribute>
|
||||
</attributes>
|
||||
@@ -2895,6 +2894,15 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Search for it</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="label" translatable="yes">Insert</property>
|
||||
<property name="icon-name">insert-image</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert something</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3073,9 +3081,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="selection_mode">multiple</property>
|
||||
<property name="model">iconsmodel</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell">
|
||||
<property name="follow-state">True</property>
|
||||
</object>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell"/>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
@@ -3621,6 +3627,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<property name="icon-size">1</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
@@ -3860,11 +3867,41 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3872,11 +3909,41 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -28,6 +28,7 @@ IGNORE_HFILES= \
|
||||
gdkprivate.h \
|
||||
gdk*private.h \
|
||||
keyname-table.h \
|
||||
wayland/xdg-shell-client-protocol.h \
|
||||
win32 \
|
||||
x11 \
|
||||
quartz
|
||||
|
||||
+157
-24
@@ -19,85 +19,217 @@ HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||
CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||
|
||||
# Header files to ignore when scanning
|
||||
IGNORE_HFILES= \
|
||||
IGNORE_HFILES = \
|
||||
inspector \
|
||||
a11y \
|
||||
gtkaccelgroupprivate.h \
|
||||
gtkaccelmapprivate.h \
|
||||
gtkadjustmentprivate.h \
|
||||
gtkallocatedbitmaskprivate.h \
|
||||
gtkappchooserprivate.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbindingsprivate.h \
|
||||
gtkbitmaskprivate.h \
|
||||
gtkboxprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkbuttonprivate.h \
|
||||
gtkcairoblurprivate.h \
|
||||
gtkcellareaboxcontextprivate.h \
|
||||
gtkclipboardprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkcomboboxprivate.h \
|
||||
gtkcontainerprivate.h \
|
||||
gtkcssanimatedstyleprivate.h \
|
||||
gtkcssanimationprivate.h \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscolorvalueprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
gtkcsseasevalueprivate.h \
|
||||
gtkcssenginevalueprivate.h \
|
||||
gtkcssenumvalueprivate.h \
|
||||
gtkcssiconthemevalueprivate.h \
|
||||
gtkcssimagebuiltinprivate.h \
|
||||
gtkcssimagecrossfadeprivate.h \
|
||||
gtkcssimagegradientprivate.h \
|
||||
gtkcssimageiconthemeprivate.h \
|
||||
gtkcssimagelinearprivate.h \
|
||||
gtkcssimageprivate.h \
|
||||
gtkcssimagescaledprivate.h \
|
||||
gtkcssimagesurfaceprivate.h \
|
||||
gtkcssimageurlprivate.h \
|
||||
gtkcssimagevalueprivate.h \
|
||||
gtkcssimagewin32private.h \
|
||||
gtkcssinheritvalueprivate.h \
|
||||
gtkcssinitialvalueprivate.h \
|
||||
gtkcsskeyframesprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnodedeclarationprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
gtkcssrgbavalueprivate.h \
|
||||
gtkcsssectionprivate.h \
|
||||
gtkcssselectorprivate.h \
|
||||
gtkcssshadowsvalueprivate.h \
|
||||
gtkcssshadowvalueprivate.h \
|
||||
gtkcssshorthandpropertyprivate.h\
|
||||
gtkcssstaticstyleprivate.h \
|
||||
gtkcssstringvalueprivate.h \
|
||||
gtkcssstylefuncsprivate.h \
|
||||
gtkcssstyleprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransformvalueprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcsstypesprivate.h \
|
||||
gtkcssunsetvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkdialogprivate.h \
|
||||
gtkentryprivate.h \
|
||||
gtkeventcontrollerprivate.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfontchooserprivate.h \
|
||||
gtkgesturedragprivate.h \
|
||||
gtkgesturelongpressprivate.h \
|
||||
gtkgesturemultipressprivate.h \
|
||||
gtkgesturepanprivate.h \
|
||||
gtkgestureprivate.h \
|
||||
gtkgesturerotateprivate.h \
|
||||
gtkgesturesingleprivate.h \
|
||||
gtkgestureswipeprivate.h \
|
||||
gtkgesturezoomprivate.h \
|
||||
gtkheaderbarprivate.h \
|
||||
gtkhslaprivate.h \
|
||||
gtkiconhelperprivate.h \
|
||||
gtkiconviewprivate.h \
|
||||
gtkimageprivate.h \
|
||||
gtkimmoduleprivate.h \
|
||||
gtklabelprivate.h \
|
||||
gtklockbuttonprivate.h \
|
||||
gtkmagnifierprivate.h \
|
||||
gtkmenubuttonprivate.h \
|
||||
gtkmenuitemprivate.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmenushellprivate.h \
|
||||
gtkmodulesprivate.h \
|
||||
gtkmountoperationprivate.h \
|
||||
gtkorientableprivate.h \
|
||||
gtkpixelcacheprivate.h \
|
||||
gtkpopoverprivate.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkrangeprivate.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtkrenderbackgroundprivate.h \
|
||||
gtkrenderborderprivate.h \
|
||||
gtkrendericonprivate.h \
|
||||
gtkrenderprivate.h \
|
||||
gtkroundedboxprivate.h \
|
||||
gtkscaleprivate.h \
|
||||
gtksearchentryprivate.h \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksizerequestcacheprivate.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktogglebuttonprivate.h \
|
||||
gtktoolbarprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktooltipprivate.h \
|
||||
gtktreeprivate.h \
|
||||
gtkwidgetprivate.h \
|
||||
gtkwin32themeprivate.h \
|
||||
gtkwindowprivate.h \
|
||||
fnmatch.h \
|
||||
gtkactionmuxer.h \
|
||||
gtkactionobserver.h \
|
||||
gtkactionobservable.h \
|
||||
gtk9slice.h \
|
||||
gtkanimationdescription.h \
|
||||
gtkbitmaskprivateimpl.h \
|
||||
gtkbookmarksmanager.h \
|
||||
gtkdbusgenerated.c \
|
||||
gtkdbusgenerated.h \
|
||||
gtkdebug.h \
|
||||
gtkactionhelper.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
gtkfilechooserdefault.h \
|
||||
gtkfilechooserembed.h \
|
||||
gtkfilechooserentry.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfilechoosersettings.h \
|
||||
gtkfilechooserutils.h \
|
||||
gtkfilesystem.h \
|
||||
gtkfilesystemmodel.h \
|
||||
gtkfilesystemunix.h \
|
||||
gtkfilesystemwin32.h \
|
||||
gtkfontchooserutils.h \
|
||||
gtkiconcache.h \
|
||||
gtkiconcachevalidator.h \
|
||||
gtkiconthemeparser.h \
|
||||
gtkintl.h \
|
||||
gtkkeyhash.h \
|
||||
gtkkineticscrolling.h \
|
||||
gtkmarshal.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmnemonichash.h \
|
||||
gtkmenutracker.h \
|
||||
gtkmenutrackeritem.h \
|
||||
gtkmenusectionbox.h \
|
||||
gtkmodelmenu.h \
|
||||
gtkmodelmenuitem.h \
|
||||
gtkmodifierstyle.h \
|
||||
gtkpathbar.h \
|
||||
gtkplugprivate.h \
|
||||
gtkprintbackend.h \
|
||||
gtkprinteroption.h \
|
||||
gtkprinteroptionset.h \
|
||||
gtkprinteroptionwidget.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprint-win32.h \
|
||||
gtkprintutils.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkprivatetypebuiltins.h \
|
||||
gtkquery.h \
|
||||
gtkrbtree.h \
|
||||
gtkrecentchooserdefault.h \
|
||||
gtkrecentchooserutils.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtksearchengine.h \
|
||||
gtksearchenginebeagle.h \
|
||||
gtksearchenginetracker.h \
|
||||
gtksearchenginesimple.h \
|
||||
gtksearchenginequartz.h \
|
||||
gtksequence.h \
|
||||
gtksocketprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserializ.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextdisplay.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextlayout.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktextsegment.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktexttypes.h \
|
||||
gtktextutil.h \
|
||||
gtktimeline.h \
|
||||
gtkthemes.h \
|
||||
gtktrashmonitor.h \
|
||||
gtktrayicon.h \
|
||||
gtktreedatalist.h \
|
||||
gtktreeprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktreemenu.h \
|
||||
gtktypebuiltins.h \
|
||||
gtkxembed.h \
|
||||
gtkwin32embed.h \
|
||||
@@ -172,6 +304,7 @@ expand_content_files = \
|
||||
drawing-model.xml \
|
||||
getting_started.xml \
|
||||
glossary.xml \
|
||||
input-handling.xml \
|
||||
migrating-2to3.xml \
|
||||
migrating-checklist.sgml \
|
||||
migrating-unique-GtkApplication.xml \
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
application. Inside the activate() function we want to construct
|
||||
our GTK window, so that a window is shown when the application
|
||||
is launched. The call to gtk_application_window_new() will
|
||||
createa a new #GtkWindow and store it inside the
|
||||
create a new #GtkWindow and store it inside the
|
||||
<varname>window</varname> pointer. The window will have a frame,
|
||||
a title bar, and window controls depending on the platform.</para>
|
||||
|
||||
@@ -165,6 +165,47 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<para>As seen above, example-1.c builds further upon example-0.c by adding a
|
||||
button to our window, with the label "Hello World". Two new GtkWidget pointers
|
||||
are declared to accomplish this, <varname>button</varname> and
|
||||
<varname>button_box</varname>. The button_box variable is created to store a
|
||||
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
|
||||
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
|
||||
#GtkOrientation enum as parameter. The buttons which this box will contain can
|
||||
either be stored horizontally or vertically but this does not matter in this
|
||||
particular case as we are dealing with only one button. After initializing
|
||||
button_box with horizontal orientation, the code adds the button_box widget to the
|
||||
window widget using gtk_container_add().</para>
|
||||
|
||||
<para>Next the <varname>button</varname> variable is initialized in similar manner.
|
||||
gtk_button_new_with_label() is called which returns a GtkButton to be stored inside
|
||||
<varname>button</varname>. Afterwards <varname>button</varname> is added to
|
||||
our <varname>button_box</varname>.
|
||||
Using g_signal_connect the button is connected to a function in our app called
|
||||
print_hello(), so that when the button is clicked, GTK will call this function.
|
||||
As the print_hello() function does not use any data as input, NULL is passed
|
||||
to it. print_hello() calls g_print() with the string "Hello World"
|
||||
which will print Hello World in a terminal if the GTK application was started
|
||||
from one.</para>
|
||||
|
||||
<para>After connecting print_hello(), another signal is connected to the "clicked" state
|
||||
of the button using g_signal_connect_swapped(). This functions is similar to
|
||||
a g_signal_connect() with the difference lying in how the callback function is
|
||||
treated. g_signal_connect_swapped() allow you to specify what the callback
|
||||
function should take as parameter by letting you pass it as data. In this case
|
||||
the function being called back is gtk_widget_destroy() and the <varname>window</varname>
|
||||
pointer is passed to it. This has the effect that when the button is clicked,
|
||||
the whole GTK window is destroyed. In contrast if a normal g_signal_connect() were used
|
||||
to connect the "clicked" signal with gtk_widget_destroy(), then the <varname>button</varname>
|
||||
itself would have been destroyed, not the window.
|
||||
More information about creating buttons can be found
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/Buttons">here</ulink>.
|
||||
</para>
|
||||
|
||||
<para>The rest of the code in example-1.c is identical to example-0.c. Next
|
||||
section will elaborate further on how to add several GtkWidgets to your GTK
|
||||
application.</para>
|
||||
|
||||
<section>
|
||||
<title>Packing</title>
|
||||
|
||||
@@ -202,51 +243,6 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="drawing.png" format="PNG"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<para>Create a new file with the following content named example-3.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Building user interfaces</title>
|
||||
|
||||
@@ -1041,4 +1037,50 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
here.</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Custom Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<informalfigure>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="drawing.png" format="PNG"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</informalfigure>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<para>Create a new file with the following content named example-3.c.</para>
|
||||
<programlisting><xi:include href="../../../../examples/drawing.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can compile the program above with GCC using:
|
||||
<literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o example-3 example-3.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<xi:include href="resources.sgml" />
|
||||
<xi:include href="xml/question_index.sgml" />
|
||||
<xi:include href="drawing-model.xml" />
|
||||
<xi:include href="input-handling.xml" />
|
||||
<xi:include href="xml/input-handling.xml" />
|
||||
</part>
|
||||
|
||||
|
||||
|
||||
@@ -329,6 +329,7 @@ GTK_ADJUSTMENT_CLASS
|
||||
GTK_IS_ADJUSTMENT_CLASS
|
||||
GTK_ADJUSTMENT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAdjustmentPrivate
|
||||
gtk_adjustment_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -557,7 +558,6 @@ gtk_list_box_row_new
|
||||
gtk_list_box_row_changed
|
||||
gtk_list_box_row_is_selected
|
||||
gtk_list_box_row_get_header
|
||||
gtk_list_box_row_get_type
|
||||
gtk_list_box_row_set_header
|
||||
gtk_list_box_row_get_index
|
||||
gtk_list_box_row_set_activatable
|
||||
@@ -566,6 +566,12 @@ gtk_list_box_row_set_selectable
|
||||
gtk_list_box_row_get_selectable
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_LIST_BOX
|
||||
GTK_LIST_BOX_CLASS
|
||||
GTK_LIST_BOX_GET_CLASS
|
||||
GTK_LIST_BOX_ROW
|
||||
GTK_LIST_BOX_ROW_CLASS
|
||||
GTK_LIST_BOX_ROW_GET_CLASS
|
||||
GTK_IS_LIST_BOX
|
||||
GTK_IS_LIST_BOX_CLASS
|
||||
GTK_IS_LIST_BOX_ROW
|
||||
@@ -1120,6 +1126,7 @@ gtk_editable_get_type
|
||||
<FILE>gtkentry</FILE>
|
||||
<TITLE>GtkEntry</TITLE>
|
||||
GtkEntry
|
||||
GtkEntryClass
|
||||
gtk_entry_new
|
||||
gtk_entry_new_with_buffer
|
||||
gtk_entry_get_buffer
|
||||
@@ -1208,6 +1215,8 @@ GTK_ENTRY_CLASS
|
||||
GTK_IS_ENTRY_CLASS
|
||||
GTK_ENTRY_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_TEXT_HANDLE_POSITION
|
||||
GTK_TYPE_TEXT_HANDLE_MODE
|
||||
GtkEntryPrivate
|
||||
gtk_entry_get_type
|
||||
</SECTION>
|
||||
@@ -1304,6 +1313,7 @@ GTK_EVENT_BOX_CLASS
|
||||
GTK_IS_EVENT_BOX_CLASS
|
||||
GTK_EVENT_BOX_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkEventBoxPrivate
|
||||
gtk_event_box_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -1635,6 +1645,7 @@ GTK_IS_FONT_CHOOSER_IFACE
|
||||
GTK_FONT_CHOOSER_GET_IFACE
|
||||
|
||||
<SUBSECTION Private>
|
||||
GTK_FONT_CHOOSER_DELEGATE_QUARK
|
||||
gtk_font_chooser_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2237,6 +2248,7 @@ GTK_MENU_CLASS
|
||||
GTK_IS_MENU_CLASS
|
||||
GTK_MENU_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuPrivate
|
||||
gtk_menu_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2289,7 +2301,7 @@ GTK_IS_MENU_BUTTON
|
||||
GTK_IS_MENU_BUTTON_CLASS
|
||||
GTK_MENU_BUTTON_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuButtonrPrivate
|
||||
GtkMenuButtonPrivate
|
||||
gtk_menu_button_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2326,6 +2338,7 @@ GTK_MENU_ITEM_CLASS
|
||||
GTK_IS_MENU_ITEM_CLASS
|
||||
GTK_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuItemPrivate
|
||||
gtk_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2392,6 +2405,7 @@ GTK_MENU_SHELL_CLASS
|
||||
GTK_IS_MENU_SHELL_CLASS
|
||||
GTK_MENU_SHELL_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuShellPrivate
|
||||
gtk_menu_shell_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2560,6 +2574,7 @@ GTK_IS_NUMERABLE_ICON_CLASS
|
||||
GTK_NUMERABLE_ICON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkNumerableIconPrivate
|
||||
gtk_numerable_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -3276,6 +3291,7 @@ GTK_SETTINGS_CLASS
|
||||
GTK_SETTINGS_GET_CLASS
|
||||
GTK_TYPE_SETTINGS
|
||||
<SUBSECTION Private>
|
||||
GtkSettingsPrivate
|
||||
gtk_settings_get_type
|
||||
GtkSettingsPropertyValue
|
||||
</SECTION>
|
||||
@@ -3321,6 +3337,7 @@ GTK_SOCKET_CLASS
|
||||
GTK_IS_SOCKET_CLASS
|
||||
GTK_SOCKET_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkSocketPrivate
|
||||
gtk_socket_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4375,6 +4392,7 @@ gtk_tree_model_row_inserted
|
||||
gtk_tree_model_row_has_child_toggled
|
||||
gtk_tree_model_row_deleted
|
||||
gtk_tree_model_rows_reordered
|
||||
gtk_tree_model_rows_reordered_with_length
|
||||
<SUBSECTION Standard>
|
||||
GTK_TREE_MODEL
|
||||
GTK_IS_TREE_MODEL
|
||||
@@ -4411,6 +4429,7 @@ GTK_TREE_MODEL_SORT_CLASS
|
||||
GTK_IS_TREE_MODEL_SORT_CLASS
|
||||
GTK_TREE_MODEL_SORT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeModelSortPrivate
|
||||
gtk_tree_model_sort_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4478,6 +4497,7 @@ GTK_TREE_SELECTION_CLASS
|
||||
GTK_TREE_SELECTION_GET_CLASS
|
||||
GTK_IS_TREE_SELECTION_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeSelectionPrivate
|
||||
gtk_tree_selection_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4568,6 +4588,7 @@ GTK_TREE_STORE_CLASS
|
||||
GTK_IS_TREE_STORE_CLASS
|
||||
GTK_TREE_STORE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeStorePrivate
|
||||
gtk_tree_store_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4638,6 +4659,7 @@ GTK_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_IS_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_TREE_VIEW_COLUMN_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeViewColumnPrivate
|
||||
gtk_tree_view_column_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4853,6 +4875,7 @@ gtk_cell_area_get_current_path_string
|
||||
gtk_cell_area_apply_attributes
|
||||
gtk_cell_area_attribute_connect
|
||||
gtk_cell_area_attribute_disconnect
|
||||
gtk_cell_area_attribute_get_column
|
||||
gtk_cell_area_class_install_cell_property
|
||||
gtk_cell_area_class_find_cell_property
|
||||
gtk_cell_area_class_list_cell_properties
|
||||
@@ -4990,6 +5013,7 @@ GTK_IS_CELL_RENDERER_CLASS
|
||||
GTK_CELL_RENDERER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkCellRendererPrivate
|
||||
GtkCellRendererClassPrivate
|
||||
gtk_cell_renderer_get_type
|
||||
gtk_cell_renderer_mode_get_type
|
||||
gtk_cell_renderer_state_get_type
|
||||
@@ -5628,6 +5652,7 @@ GTK_IS_WIDGET_CLASS
|
||||
GTK_WIDGET_GET_CLASS
|
||||
GTK_TYPE_REQUISITION
|
||||
<SUBSECTION Private>
|
||||
GtkWidgetClassPrivate
|
||||
GtkWidgetPrivate
|
||||
gtk_widget_get_type
|
||||
gtk_requisition_get_type
|
||||
@@ -5795,6 +5820,7 @@ GTK_WINDOW_GROUP
|
||||
GTK_WINDOW_GROUP_CLASS
|
||||
GTK_WINDOW_GROUP_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkWindowGroupPrivate
|
||||
gtk_window_group_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5863,6 +5889,11 @@ gtk_get_micro_version
|
||||
gtk_get_binary_age
|
||||
gtk_get_interface_age
|
||||
gtk_check_version
|
||||
gtk_major_version
|
||||
gtk_minor_version
|
||||
gtk_micro_version
|
||||
gtk_binary_age
|
||||
gtk_interface_age
|
||||
|
||||
<SUBSECTION>
|
||||
GTK_MAJOR_VERSION
|
||||
@@ -5970,6 +6001,7 @@ GTK_STYLE_PROPERTIES
|
||||
GTK_STYLE_PROPERTIES_CLASS
|
||||
GTK_STYLE_PROPERTIES_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkStylePropertiesPrivate
|
||||
gtk_style_properties_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5997,6 +6029,7 @@ GTK_STYLE_CLASS_BUTTON
|
||||
GTK_STYLE_CLASS_CALENDAR
|
||||
GTK_STYLE_CLASS_CELL
|
||||
GTK_STYLE_CLASS_COMBOBOX_ENTRY
|
||||
GTK_STYLE_CLASS_CONTEXT_MENU
|
||||
GTK_STYLE_CLASS_CHECK
|
||||
GTK_STYLE_CLASS_CSD
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
@@ -6037,12 +6070,14 @@ GTK_STYLE_CLASS_OVERSHOOT
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_POPOVER
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
GTK_STYLE_CLASS_PULSE
|
||||
GTK_STYLE_CLASS_QUESTION
|
||||
GTK_STYLE_CLASS_RADIO
|
||||
GTK_STYLE_CLASS_RAISED
|
||||
GTK_STYLE_CLASS_READ_ONLY
|
||||
GTK_STYLE_CLASS_RIGHT
|
||||
GTK_STYLE_CLASS_RUBBERBAND
|
||||
GTK_STYLE_CLASS_SCALE
|
||||
@@ -6062,6 +6097,7 @@ GTK_STYLE_CLASS_TITLE
|
||||
GTK_STYLE_CLASS_TITLEBAR
|
||||
GTK_STYLE_CLASS_TOOLBAR
|
||||
GTK_STYLE_CLASS_TOOLTIP
|
||||
GTK_STYLE_CLASS_TOUCH_SELECTION
|
||||
GTK_STYLE_CLASS_TOP
|
||||
GTK_STYLE_CLASS_TROUGH
|
||||
GTK_STYLE_CLASS_UNDERSHOOT
|
||||
@@ -6170,6 +6206,7 @@ GTK_IS_STYLE_CONTEXT_CLASS
|
||||
GTK_TYPE_BORDER
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkStyleContextPrivate
|
||||
gtk_style_context_get_type
|
||||
gtk_border_get_type
|
||||
</SECTION>
|
||||
@@ -6208,6 +6245,8 @@ GTK_CSS_PROVIDER_GET_CLASS
|
||||
GTK_IS_CSS_PROVIDER
|
||||
GTK_IS_CSS_PROVIDER_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_CSS_SECTION
|
||||
GtkCssProviderPrivate
|
||||
gtk_css_provider_get_type
|
||||
gtk_css_provider_error_quark
|
||||
gtk_css_section_get_type
|
||||
@@ -6721,6 +6760,8 @@ GTK_STOCK_ZOOM_100
|
||||
GTK_STOCK_ZOOM_FIT
|
||||
GTK_STOCK_ZOOM_IN
|
||||
GTK_STOCK_ZOOM_OUT
|
||||
<SUBSECTION Private>
|
||||
GtkStock
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -6782,6 +6823,7 @@ gtk_icon_info_get_attach_points
|
||||
gtk_icon_info_get_display_name
|
||||
gtk_icon_info_is_symbolic
|
||||
<SUBSECTION Standard>
|
||||
GtkIconInfoClass
|
||||
GTK_ICON_THEME
|
||||
GTK_IS_ICON_THEME
|
||||
GTK_TYPE_ICON_THEME
|
||||
@@ -6791,6 +6833,11 @@ GTK_IS_ICON_THEME_CLASS
|
||||
GTK_ICON_THEME_GET_CLASS
|
||||
gtk_icon_info_get_type
|
||||
GTK_TYPE_ICON_INFO
|
||||
GTK_ICON_INFO
|
||||
GTK_ICON_INFO_CLASS
|
||||
GTK_ICON_INFO_GET_CLASS
|
||||
GTK_IS_ICON_INFO
|
||||
GTK_IS_ICON_INFO_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkIconThemePrivate
|
||||
gtk_icon_theme_error_quark
|
||||
@@ -7155,6 +7202,7 @@ gtk_print_settings_get_type
|
||||
<TITLE>GtkPaperSize</TITLE>
|
||||
GtkPaperSize
|
||||
GtkUnit
|
||||
GTK_UNIT_PIXEL
|
||||
GTK_PAPER_NAME_A3
|
||||
GTK_PAPER_NAME_A4
|
||||
GTK_PAPER_NAME_A5
|
||||
@@ -7809,6 +7857,7 @@ GTK_IS_ACTION_BAR_CLASS
|
||||
GTK_ACTION_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkActionBarPrivate
|
||||
gtk_action_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7841,6 +7890,7 @@ GTK_IS_HEADER_BAR_CLASS
|
||||
GTK_HEADER_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkHeaderBarPrivate
|
||||
gtk_header_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7869,6 +7919,14 @@ GtkStackTransitionType
|
||||
gtk_stack_set_transition_type
|
||||
gtk_stack_get_transition_type
|
||||
gtk_stack_get_transition_running
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK
|
||||
GTK_IS_STACK
|
||||
GTK_IS_STACK_CLASS
|
||||
GTK_STACK
|
||||
GTK_STACK_CLASS
|
||||
GTK_STACK_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_get_type
|
||||
</SECTION>
|
||||
@@ -7880,6 +7938,14 @@ GtkStackSwitcher
|
||||
gtk_stack_switcher_new
|
||||
gtk_stack_switcher_set_stack
|
||||
gtk_stack_switcher_get_stack
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER
|
||||
GTK_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_switcher_get_type
|
||||
</SECTION>
|
||||
@@ -7898,6 +7964,15 @@ gtk_revealer_set_transition_duration
|
||||
GtkRevealerTransitionType
|
||||
gtk_revealer_get_transition_type
|
||||
gtk_revealer_set_transition_type
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_REVEALER
|
||||
GTK_IS_REVEALER
|
||||
GTK_IS_REVEALER_CLASS
|
||||
GTK_REVEALER
|
||||
GTK_REVEALER_CLASS
|
||||
GTK_REVEALER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_revealer_get_type
|
||||
</SECTION>
|
||||
@@ -7949,6 +8024,24 @@ gtk_flow_box_child_new
|
||||
gtk_flow_box_child_get_index
|
||||
gtk_flow_box_child_is_selected
|
||||
gtk_flow_box_child_changed
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkFlowBoxChildClass
|
||||
GTK_TYPE_FLOW_BOX
|
||||
GTK_TYPE_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX
|
||||
GTK_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_GET_CLASS
|
||||
GTK_IS_FLOW_BOX
|
||||
GTK_IS_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX_CHILD_CLASS
|
||||
GTK_FLOW_BOX_CHILD_GET_CLASS
|
||||
GTK_IS_FLOW_BOX_CHILD
|
||||
GTK_IS_FLOW_BOX_CHILD_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_flow_box_get_type
|
||||
gtk_flow_box_child_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -7966,7 +8059,20 @@ gtk_popover_set_position
|
||||
gtk_popover_get_position
|
||||
gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
gtk_popover_set_transitions_enabled
|
||||
gtk_popover_get_transitions_enabled
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER
|
||||
GTK_IS_POPOVER
|
||||
GTK_IS_POPOVER_CLASS
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER
|
||||
GTK_POPOVER_CLASS
|
||||
GTK_POPOVER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkPopoverPrivate
|
||||
gtk_popover_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7976,6 +8082,15 @@ gtk_popover_get_type
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_open_submenu
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU
|
||||
GTK_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_popover_menu_get_type
|
||||
</SECTION>
|
||||
@@ -7986,6 +8101,12 @@ gtk_popover_menu_get_type
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MODEL_BUTTON
|
||||
GTK_MODEL_BUTTON
|
||||
GTK_IS_MODEL_BUTTON
|
||||
<SUBSECTION Private>
|
||||
gtk_model_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -8005,6 +8126,7 @@ GTK_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_GET_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkEventControllerPriv
|
||||
@@ -8222,11 +8344,11 @@ gtk_stack_sidebar_set_stack
|
||||
gtk_stack_sidebar_get_stack
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SIDEBAR
|
||||
GTK_TYPE_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR_CLASS
|
||||
GTK_IS_SIDEBAR
|
||||
GTK_IS_SIDEBAR_CLASS
|
||||
GTK_IS_STACK_SIDEBAR
|
||||
GTK_IS_STACK_SIDEBAR_CLASS
|
||||
GTK_STACK_SIDEBAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
@@ -8242,10 +8364,9 @@ gtk_gl_area_new
|
||||
gtk_gl_area_get_context
|
||||
gtk_gl_area_make_current
|
||||
gtk_gl_area_queue_render
|
||||
gtk_gl_area_attach_buffers
|
||||
gtk_gl_area_set_error
|
||||
gtk_gl_area_get_error
|
||||
gtk_gl_area_set_profile
|
||||
gtk_gl_area_get_profile
|
||||
<SUBSECTION>
|
||||
gtk_gl_area_set_has_alpha
|
||||
gtk_gl_area_get_has_alpha
|
||||
@@ -8255,10 +8376,13 @@ gtk_gl_area_set_has_stencil_buffer
|
||||
gtk_gl_area_get_has_stencil_buffer
|
||||
gtk_gl_area_set_auto_render
|
||||
gtk_gl_area_get_auto_render
|
||||
gtk_gl_area_get_required_version
|
||||
gtk_gl_area_set_required_version
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GL_AREA
|
||||
GTK_GL_AREA
|
||||
GTK_GL_AREA_CLASS
|
||||
GTK_GL_AREA_GET_CLASS
|
||||
GTK_IS_GL_AREA
|
||||
GTK_IS_GL_AREA_CLASS
|
||||
<SUBSECTION Private>
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
]>
|
||||
<refentry id="chap-input-handling">
|
||||
<refmeta>
|
||||
<refentrytitle>The GTK+ Input Handling Model</refentrytitle>
|
||||
<refentrytitle>The GTK+ Input and Event Handling Model</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>The GTK+ Input Handling Model</refname>
|
||||
<refname>The GTK+ Input and Event Handling Model</refname>
|
||||
<refpurpose>
|
||||
GTK+ input handling in detail
|
||||
GTK+ input and event handling in detail
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1 id="input-overview">
|
||||
<title>Overview of GTK+ input handling</title>
|
||||
<title>Overview of GTK+ input and event handling</title>
|
||||
|
||||
<para>
|
||||
This chapter describes in detail how GTK+ handles input. If you are interested
|
||||
@@ -64,20 +64,20 @@
|
||||
GDK translates these raw windowing system events into #GdkEvents.
|
||||
Typical input events are:
|
||||
<simplelist>
|
||||
<member>GdkEventButton</member>
|
||||
<member>GdkEventMotion</member>
|
||||
<member>GdkEventCrossing</member>
|
||||
<member>GdkEventKey</member>
|
||||
<member>GdkEventFocus</member>
|
||||
<member>GdkEventTouch</member>
|
||||
<member>#GdkEventButton</member>
|
||||
<member>#GdkEventMotion</member>
|
||||
<member>#GdkEventCrossing</member>
|
||||
<member>#GdkEventKey</member>
|
||||
<member>#GdkEventFocus</member>
|
||||
<member>#GdkEventTouch</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
Additionally, GDK/GTK synthesizes other signals to let know whether
|
||||
grabs (system-wide or in-app) are taking input away:
|
||||
<simplelist>
|
||||
<member>GdkEventGrabBroken</member>
|
||||
<member>GtkWidget::grab-notify</member>
|
||||
<member>#GdkEventGrabBroken</member>
|
||||
<member>#GtkWidget::grab-notify</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -87,80 +87,167 @@
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<refsect2 id="event-propagation">
|
||||
<title>Event propagation</title>
|
||||
|
||||
<para>
|
||||
When GTK+ receives an event, it determines the target widget that
|
||||
it is directed to. Unless grabs are involved, this is done by finding
|
||||
the widget to which the window of the event belongs.
|
||||
For widgets which have a #GdkWindow set, events are received from the
|
||||
windowing system and passed to gtk_main_do_event(). See its documentation
|
||||
for details of what it does: compression of enter/leave events,
|
||||
identification of the widget receiving the event, pushing the event onto a
|
||||
stack for gtk_get_current_event(), and propagating the event to the
|
||||
widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The event is then propagated from the toplevel window down to the
|
||||
target widget. In this phase, which is known as the “capture” phase,
|
||||
gestures that are attached with GTK_PHASE_CAPTURE get a chance
|
||||
to react to the event.
|
||||
When a GDK backend produces an input event, it is tied to a #GdkDevice and
|
||||
a #GdkWindow, which in turn represents a windowing system surface in the
|
||||
backend. If a widget has grabbed the current input device, or all input
|
||||
devices, the event is propagated to that #GtkWidget. Otherwise, it is
|
||||
propagated to the the #GtkWidget which called gtk_widget_register_window()
|
||||
on the #GdkWindow receiving the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Grabs are implemented for each input device, and globally. A grab for a
|
||||
specific input device (gtk_device_grab_add()), is sent events in
|
||||
preference to a global grab (gtk_grab_add()). Input grabs only have effect
|
||||
within the #GtkWindowGroup containing the #GtkWidget which registered the
|
||||
event’s #GdkWindow. If this #GtkWidget is a child of the grab widget, the
|
||||
event is propagated to the child — this is the basis for propagating
|
||||
events within modal dialogs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An event is propagated to a widget using gtk_propagate_event().
|
||||
Propagation differs between event types: key events (%GDK_KEY_PRESS,
|
||||
%GDK_KEY_RELEASE) are delivered to the top-level #GtkWindow; other events
|
||||
are propagated down and up the widget hierarchy in three phases (see
|
||||
#GtkPropagationPhase).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For key events, the top-level window’s default #GtkWindow::key-press-event
|
||||
and #GtkWindow::key-release-event signal handlers handle mnemonics and
|
||||
accelerators first. Other key presses are then passed to
|
||||
gtk_window_propagate_key_event() which propagates the event upwards from
|
||||
the window’s current focus widget (gtk_window_get_focus()) to the
|
||||
top-level.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For other events, in the first phase (the “capture” phase) the event is
|
||||
delivered to each widget from the top-most (for example, the top-level
|
||||
#GtkWindow or grab widget) down to the target #GtkWidget.
|
||||
<link linkend="event-controllers-and-gestures">Gestures</link> that are
|
||||
attached with %GTK_PHASE_CAPTURE get a chance to react to the event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
After the “capture” phase, the widget that was intended to be the
|
||||
destination of the event will let run gestures attached to it with
|
||||
GTK_PHASE_TARGET. This is known as the “target” phase, and does only
|
||||
happen on that widget.
|
||||
destination of the event will run gestures attached to it with
|
||||
%GTK_PHASE_TARGET. This is known as the “target” phase, and only
|
||||
happens on that widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Next, the appropriate event signal is emitted for the event in question,
|
||||
e.g. “motion-notify-event”. Handling these signals was the primary
|
||||
way to handle input in GTK+ widgets before gestures were introduced.
|
||||
The signals are emitted from the target widget up to the toplevel,
|
||||
until a signal handler indicates that it has handled the event, by
|
||||
returning GDK_EVENT_STOP.
|
||||
Next, the #GtkWidget::event signal is emitted, then the appropriate signal
|
||||
for the event in question, for example #GtkWidget::motion-notify-event.
|
||||
Handling these signals was the primary way to handle input in GTK+ widgets
|
||||
before gestures were introduced. If the widget is realized, the
|
||||
#GtkWidget::event-after signal is emitted. The signals are emitted from
|
||||
the target widget up to the top-level, as part of the “bubble” phase.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The default handlers for the event signals send the event
|
||||
to gestures that are attached with GTK_PHASE_BUBBLE. Therefore,
|
||||
to gestures that are attached with %GTK_PHASE_BUBBLE. Therefore,
|
||||
gestures in the “bubble” phase are only used if the widget does
|
||||
not have its own event handlers, or takes care to chain up to the
|
||||
default GtkWidget handlers.
|
||||
default #GtkWidget handlers.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Anytime during the propagation phase, a widget may indicate that a
|
||||
Events are not delivered to a widget which is insensitive or unmapped.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Any time during the propagation phase, a widget may indicate that a
|
||||
received event was consumed and propagation should therefore be stopped.
|
||||
In traditional event handlers, this is hinted by returning GDK_EVENT_STOP,
|
||||
if gestures are used, this may happen when the widget tells the gesture
|
||||
In traditional event handlers, this is hinted by returning %GDK_EVENT_STOP.
|
||||
If gestures are used, this may happen when the widget tells the gesture
|
||||
to claim the event touch sequence (or the pointer events) for its own. See the
|
||||
"gesture states" section below to know more of the latter.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="event-masks">
|
||||
<title>Event masks</title>
|
||||
|
||||
<para>
|
||||
Each widget instance has a basic event mask and another per input device,
|
||||
which determine the types of input event it receives. Each event mask set
|
||||
on a widget is added to the corresponding (basic or per-device) event mask
|
||||
for the widget’s #GdkWindow, and all child #GdkWindows.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If a widget is windowless (gtk_widget_get_has_window() returns %FALSE) and
|
||||
an application wants to receive custom events on it, it must be placed
|
||||
inside a #GtkEventBox to receive the events, and an appropriate event mask
|
||||
must be set on the box. When implementing a widget, use a %GDK_INPUT_ONLY
|
||||
#GdkWindow to receive the events instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering events against event masks happens inside #GdkWindow, which
|
||||
exposes event masks to the windowing system to reduce the number of events
|
||||
GDK receives from it. On receiving an event, it is filtered against the
|
||||
#GdkWindow’s mask for the input device, if set. Otherwise, it is filtered
|
||||
against the #GdkWindow’s basic event mask.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This means that widgets must add to the event mask for each event type
|
||||
they expect to receive, using gtk_widget_set_events() or
|
||||
gtk_widget_add_events() to preserve the existing mask. Widgets which are
|
||||
aware of floating devices should use gtk_widget_set_device_events() or
|
||||
gtk_widget_add_device_events(), and must explicitly enable the device
|
||||
using gtk_widget_set_device_enabled(). See the #GdkDeviceManager
|
||||
documentation for more information.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All standard widgets set the event mask for all events they expect to
|
||||
receive, and it is not necessary to modify this. Masks should be set when
|
||||
implementing a new widget.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Touch events</title>
|
||||
|
||||
<para>
|
||||
Touch events are emitted as events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or
|
||||
GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
|
||||
Touch events are emitted as events of type %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE or
|
||||
%GDK_TOUCH_END, those events contain an “event sequence” that univocally identifies
|
||||
the physical touch until it is lifted from the device.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
On some windowing platforms, multitouch devices perform pointer emulation, this works
|
||||
by granting a “pointer emulating” hint to one of the currently interacting touch
|
||||
sequences, which will be reported on every GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting GDK_TOUCH_MASK on its
|
||||
event mask and didn't override GtkWidget::touch-event, GTK+ will transform these
|
||||
“pointer emulating” events into semantically similar GdkEventButton and GdkEventMotion
|
||||
events. Depending on GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences, which will be reported on every #GdkEventTouch event from that sequence. By
|
||||
default, if a widget didn't request touch events by setting %GDK_TOUCH_MASK on its
|
||||
event mask and didn't override #GtkWidget::touch-event, GTK+ will transform these
|
||||
“pointer emulating” events into semantically similar #GdkEventButton and #GdkEventMotion
|
||||
events. Depending on %GDK_TOUCH_MASK being in the event mask or not, non-pointer-emulating
|
||||
sequences could still trigger gestures or just get filtered out, regardless of the widget
|
||||
not handling those directly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the widget sets GDK_TOUCH_MASK on its event mask and doesn't chain up on
|
||||
GtkWidget::touch-event, only touch events will be received, and no pointer emulation
|
||||
If the widget sets %GDK_TOUCH_MASK on its event mask and doesn't chain up on
|
||||
#GtkWidget::touch-event, only touch events will be received, and no pointer emulation
|
||||
will be performed.
|
||||
</para>
|
||||
</refsect2>
|
||||
@@ -171,11 +258,11 @@
|
||||
<para>
|
||||
Grabs are a method to claim all input events from a device, they happen
|
||||
either implicitly on pointer and touch devices, or explicitly. Implicit grabs
|
||||
happen on user interaction, when a GdkEventButtonPress happens, all events from
|
||||
then on, until after the corresponding GdkEventButtonRelease, will be reported
|
||||
happen on user interaction, when a #GdkEventButtonPress happens, all events from
|
||||
then on, until after the corresponding #GdkEventButtonRelease, will be reported
|
||||
to the widget that got the first event. Likewise, on touch events, every
|
||||
GdkEventSequence will deliver only events to the widget that received its
|
||||
GDK_TOUCH_BEGIN event.
|
||||
#GdkEventSequence will deliver only events to the widget that received its
|
||||
%GDK_TOUCH_BEGIN event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -192,8 +279,8 @@
|
||||
point somewhere else, even while the pointer/touch device is already grabbed.
|
||||
This makes it necessary for widgets to handle the cancellation of any ongoing
|
||||
interaction. Depending on whether a GTK or GDK grab is causing this, the
|
||||
widget will respectively receive a GtkWidget::grab-notify signal, or a
|
||||
GdkEventGrabBroken event.
|
||||
widget will respectively receive a #GtkWidget::grab-notify signal, or a
|
||||
#GdkEventGrabBroken event.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -209,12 +296,12 @@
|
||||
<!-- mnemonics, accelerators, bindings -->
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<refsect2 id="event-controllers-and-gestures">
|
||||
<title>Event controllers and gestures</title>
|
||||
|
||||
<para>
|
||||
Event controllers are standalone objects that can perform specific actions
|
||||
upon received GdkEvents. These are tied to a GtkWidget, and can be told of
|
||||
upon received #GdkEvents. These are tied to a #GtkWidget, and can be told of
|
||||
the event propagation phase at which they will manage the events.
|
||||
</para>
|
||||
|
||||
@@ -270,7 +357,7 @@
|
||||
Alternatively, or at a later point in time, the widget may choose to deny the touch
|
||||
sequences, thus letting those go through again in event propagation. When this happens
|
||||
in the capture phase, and if there are no other claiming gestures in the widget,
|
||||
a GDK_TOUCH_BEGIN/GDK_BUTTON_PRESS event will be emulated and
|
||||
a %GDK_TOUCH_BEGIN/%GDK_BUTTON_PRESS event will be emulated and
|
||||
propagated downwards, in order to preserve consistency.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
widgets have been deprecated. These deprecations are clearly spelled
|
||||
out in the API reference, with hints about the recommended replacements.
|
||||
The API reference for GTK+ 2 also includes an
|
||||
<ulink url="http://developer.gnome.org/gtk/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
<ulink url="https://developer.gnome.org/gtk2/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
</para>
|
||||
<para>
|
||||
To verify that your program does not use any deprecated symbols,
|
||||
|
||||
+30
-21
@@ -129,17 +129,15 @@ close_window (void)
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *da;
|
||||
GtkWidget *drawing_area;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
@@ -150,35 +148,46 @@ main (int argc,
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
gtk_widget_set_size_request (drawing_area, 100, 100);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
gtk_container_add (GTK_CONTAINER (frame), drawing_area);
|
||||
|
||||
/* Signals used to handle the backing surface */
|
||||
g_signal_connect (da, "draw",
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (da,"configure-event",
|
||||
g_signal_connect (drawing_area,"configure-event",
|
||||
G_CALLBACK (configure_event_cb), NULL);
|
||||
|
||||
/* Event signals */
|
||||
g_signal_connect (da, "motion-notify-event",
|
||||
g_signal_connect (drawing_area, "motion-notify-event",
|
||||
G_CALLBACK (motion_notify_event_cb), NULL);
|
||||
g_signal_connect (da, "button-press-event",
|
||||
g_signal_connect (drawing_area, "button-press-event",
|
||||
G_CALLBACK (button_press_event_cb), NULL);
|
||||
|
||||
/* Ask to receive events the drawing area doesn't normally
|
||||
* subscribe to. In particular, we need to ask for the
|
||||
* button press and motion notify events that want to handle.
|
||||
*/
|
||||
gtk_widget_set_events (da, gtk_widget_get_events (da)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK);
|
||||
gtk_widget_set_events (drawing_area, gtk_widget_get_events (drawing_area)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
+27
-85
@@ -1,8 +1,5 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* This is a callback function. The data arguments are ignored
|
||||
* in this example. More on callbacks below.
|
||||
*/
|
||||
static void
|
||||
print_hello (GtkWidget *widget,
|
||||
gpointer data)
|
||||
@@ -10,95 +7,40 @@ print_hello (GtkWidget *widget,
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_delete_event (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
/* If you return FALSE in the "delete_event" signal handler,
|
||||
* GTK will emit the "destroy" signal. Returning TRUE means
|
||||
* you don't want the window to be destroyed.
|
||||
*
|
||||
* This is useful for popping up 'are you sure you want to quit?'
|
||||
* type dialogs.
|
||||
*/
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkWidget *button_box;
|
||||
|
||||
g_print ("delete event occurred\n");
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
|
||||
return TRUE;
|
||||
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (window), button_box);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
/* GtkWidget is the storage type for widgets */
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hello");
|
||||
|
||||
/* When the window emits the "delete-event" signal (which is emitted
|
||||
* by GTK+ in response to an event coming from the window manager,
|
||||
* usually as a result of clicking the "close" window control), we
|
||||
* ask it to call the on_delete_event() function as defined above.
|
||||
*
|
||||
* The data passed to the callback function is NULL and is ignored
|
||||
* in the callback function.
|
||||
*/
|
||||
g_signal_connect (window, "delete-event", G_CALLBACK (on_delete_event), NULL);
|
||||
|
||||
/* Here we connect the "destroy" event to the gtk_main_quit() function.
|
||||
*
|
||||
* This signal is emitted when we call gtk_widget_destroy() on the window,
|
||||
* or if we return FALSE in the "delete_event" callback.
|
||||
*/
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
/* Sets the border width of the window. */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Creates a new button with the label "Hello World". */
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
|
||||
/* When the button receives the "clicked" signal, it will call the
|
||||
* function print_hello() passing it NULL as its argument.
|
||||
*
|
||||
* The print_hello() function is defined above.
|
||||
*/
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
/* The g_signal_connect_swapped() function will connect the "clicked" signal
|
||||
* of the button to the gtk_widget_destroy() function; instead of calling it
|
||||
* using the button as its argument, it will swap it with the user data
|
||||
* argument. This will cause the window to be destroyed by calling
|
||||
* gtk_widget_destroy() on the window.
|
||||
*/
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
/* This packs the button into the window. A GtkWindow inherits from GtkBin,
|
||||
* which is a special container that can only have one child
|
||||
*/
|
||||
gtk_container_add (GTK_CONTAINER (window), button);
|
||||
|
||||
/* The final step is to display this newly created widget... */
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* ... and the window */
|
||||
gtk_widget_show (window);
|
||||
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -185,6 +185,9 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
|
||||
int n_channels;
|
||||
int j;
|
||||
|
||||
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
/* This function can't just copy any pixbuf to any surface, be
|
||||
* sure to read the invariants here before calling it */
|
||||
|
||||
|
||||
+10
-7
@@ -492,6 +492,7 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int major,
|
||||
int minor)
|
||||
{
|
||||
int version;
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
@@ -505,13 +506,15 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
return;
|
||||
}
|
||||
|
||||
priv->major = MAX (major, 3);
|
||||
|
||||
/* we only support versions ≥ 3.2 */
|
||||
if (priv->major == 3)
|
||||
priv->minor = MAX (minor, 2);
|
||||
else
|
||||
priv->minor = minor;
|
||||
/* Enforce a minimum context version number of 3.2 */
|
||||
version = (major * 100) + minor;
|
||||
if (version < 302)
|
||||
{
|
||||
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
|
||||
version = 302;
|
||||
}
|
||||
priv->major = version / 100;
|
||||
priv->minor = version % 100;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -372,6 +372,9 @@ typedef enum
|
||||
* Most of these masks map onto one or more of the #GdkEventType event types
|
||||
* above.
|
||||
*
|
||||
* See the [input handling overview][chap-input-handling] for details of
|
||||
* [event masks][event-masks] and [event propagation][event-propagation].
|
||||
*
|
||||
* %GDK_POINTER_MOTION_HINT_MASK is deprecated. It is a special mask
|
||||
* to reduce the number of %GDK_MOTION_NOTIFY events received. When using
|
||||
* %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will
|
||||
|
||||
+12
-5
@@ -1110,6 +1110,9 @@ find_native_sibling_above (GdkWindow *parent,
|
||||
{
|
||||
GdkWindow *w;
|
||||
|
||||
if (!parent)
|
||||
return NULL;
|
||||
|
||||
w = find_native_sibling_above_helper (parent, child);
|
||||
if (w)
|
||||
return w;
|
||||
@@ -3905,10 +3908,10 @@ gdk_window_process_updates (GdkWindow *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
return gdk_window_process_updates_with_mode (window,
|
||||
update_children ?
|
||||
PROCESS_UPDATES_WITH_ALL_CHILDREN :
|
||||
PROCESS_UPDATES_NO_RECURSE);
|
||||
gdk_window_process_updates_with_mode (window,
|
||||
update_children ?
|
||||
PROCESS_UPDATES_WITH_ALL_CHILDREN :
|
||||
PROCESS_UPDATES_NO_RECURSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -5425,6 +5428,8 @@ gdk_window_withdraw (GdkWindow *window)
|
||||
* including #GDK_BUTTON_PRESS_MASK means the window should report button
|
||||
* press events. The event mask is the bitwise OR of values from the
|
||||
* #GdkEventMask enumeration.
|
||||
*
|
||||
* See the [input handling overview][event-masks] for details.
|
||||
**/
|
||||
void
|
||||
gdk_window_set_events (GdkWindow *window,
|
||||
@@ -5495,6 +5500,8 @@ gdk_window_get_events (GdkWindow *window)
|
||||
* press events. The event mask is the bitwise OR of values from the
|
||||
* #GdkEventMask enumeration.
|
||||
*
|
||||
* See the [input handling overview][event-masks] for details.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
@@ -11123,7 +11130,7 @@ gdk_window_set_opaque_region (GdkWindow *window,
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->set_opaque_region)
|
||||
return impl_class->set_opaque_region (window, region);
|
||||
impl_class->set_opaque_region (window, region);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -818,7 +818,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
impl->view = NULL;
|
||||
|
||||
switch (attributes->window_type)
|
||||
switch (window->window_type)
|
||||
{
|
||||
case GDK_WINDOW_TOPLEVEL:
|
||||
case GDK_WINDOW_TEMP:
|
||||
@@ -846,8 +846,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
window->width,
|
||||
window->height);
|
||||
|
||||
if (attributes->window_type == GDK_WINDOW_TEMP ||
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
|
||||
if (window->window_type == GDK_WINDOW_TEMP ||
|
||||
((attributes_mask & GDK_WA_TYPE_HINT) &&
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
|
||||
{
|
||||
style_mask = NSBorderlessWindowMask;
|
||||
}
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
|
||||
static char *
|
||||
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
|
||||
GAppInfo *info,
|
||||
GList *files)
|
||||
GAppInfo *info,
|
||||
GList *files)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id)
|
||||
gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
|
||||
const char *startup_notify_id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -59,6 +59,7 @@ struct _GdkWaylandCursor
|
||||
} surface;
|
||||
|
||||
struct wl_cursor *wl_cursor;
|
||||
int scale;
|
||||
};
|
||||
|
||||
struct _GdkWaylandCursorClass
|
||||
@@ -83,10 +84,18 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
|
||||
_gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
GdkWaylandCursor *cursor)
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
/* Do nothing if this is not a wl_cursor cursor. */
|
||||
if (cursor->name == NULL)
|
||||
return FALSE;
|
||||
|
||||
theme = _gdk_wayland_display_get_scaled_cursor_theme (wayland_display,
|
||||
cursor->scale);
|
||||
c = wl_cursor_theme_get_cursor (theme, cursor->name);
|
||||
if (!c)
|
||||
{
|
||||
@@ -105,8 +114,7 @@ set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme)
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
const char *name;
|
||||
@@ -115,7 +123,7 @@ _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
g_hash_table_iter_init (&iter, display->cursor_cache);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &cursor))
|
||||
set_cursor_from_theme (cursor, theme);
|
||||
_gdk_wayland_cursor_update (display, cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -168,11 +176,11 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
*w = image->width;
|
||||
*h = image->height;
|
||||
*scale = 1;
|
||||
*scale = wayland_cursor->scale;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
else /* From surface */
|
||||
else if (wayland_cursor->name == NULL) /* From surface */
|
||||
{
|
||||
*hotspot_x = wayland_cursor->surface.hotspot_x;
|
||||
*hotspot_y = wayland_cursor->surface.hotspot_y;
|
||||
@@ -185,9 +193,9 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
if (wayland_cursor->surface.cairo_surface)
|
||||
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
guint
|
||||
@@ -216,6 +224,28 @@ _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
return current_image_index;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (gdk_cursor_get_display (cursor));
|
||||
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
|
||||
|
||||
if (scale > GDK_WAYLAND_MAX_THEME_SCALE)
|
||||
{
|
||||
g_warning (G_STRLOC ": cursor theme size %u too large", scale);
|
||||
scale = GDK_WAYLAND_MAX_THEME_SCALE;
|
||||
}
|
||||
|
||||
if (wayland_cursor->scale == scale)
|
||||
return;
|
||||
|
||||
wayland_cursor->scale = scale;
|
||||
|
||||
_gdk_wayland_cursor_update (wayland_display, wayland_cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_cursor_class_init (GdkWaylandCursorClass *wayland_cursor_class)
|
||||
{
|
||||
@@ -232,9 +262,15 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
GdkCursorType cursor_type,
|
||||
guint scale)
|
||||
{
|
||||
GEnumClass *enum_class;
|
||||
GEnumValue *enum_value;
|
||||
@@ -247,7 +283,9 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
g_strdelimit (cursor_name, "-", '_');
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
result = _gdk_wayland_display_get_cursor_for_name (display, cursor_name);
|
||||
result = _gdk_wayland_display_get_cursor_for_name_with_scale (display,
|
||||
cursor_name,
|
||||
scale);
|
||||
|
||||
g_free (cursor_name);
|
||||
|
||||
@@ -255,8 +293,18 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_type_with_scale (display,
|
||||
cursor_type,
|
||||
1);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandCursor *private;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
@@ -272,13 +320,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
"display", display,
|
||||
NULL);
|
||||
private->name = g_strdup (name);
|
||||
private->surface.scale = 1;
|
||||
private->scale = scale;
|
||||
|
||||
/* Blank cursor case */
|
||||
if (!name || g_str_equal (name, "blank_cursor"))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
if (!set_cursor_from_theme (private, wayland_display->cursor_theme))
|
||||
if (!_gdk_wayland_cursor_update (wayland_display, private))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
/* Insert into cache. */
|
||||
@@ -286,6 +334,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_name_with_scale (display, name, 1);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
cairo_surface_t *surface,
|
||||
|
||||
+195
-98
@@ -93,6 +93,8 @@ struct _GdkWaylandDeviceData
|
||||
GdkDragContext *drop_context;
|
||||
|
||||
struct wl_surface *pointer_surface;
|
||||
guint current_output_scale;
|
||||
GSList *pointer_surface_outputs;
|
||||
};
|
||||
|
||||
struct _GdkWaylandDevice
|
||||
@@ -254,10 +256,14 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
|
||||
*/
|
||||
if (!cursor)
|
||||
{
|
||||
/* FIXME: Is this the best sensible default ? */
|
||||
cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
|
||||
GDK_LEFT_PTR);
|
||||
guint scale = wd->current_output_scale;
|
||||
cursor =
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (wd->display,
|
||||
GDK_LEFT_PTR,
|
||||
scale);
|
||||
}
|
||||
else
|
||||
_gdk_wayland_cursor_set_scale (cursor, wd->current_output_scale);
|
||||
|
||||
if (cursor == wd->cursor)
|
||||
return;
|
||||
@@ -282,8 +288,10 @@ gdk_wayland_device_warp (GdkDevice *device,
|
||||
|
||||
static void
|
||||
get_coordinates (GdkWaylandDeviceData *data,
|
||||
double *x, double *y,
|
||||
double *x_root, double *y_root)
|
||||
double *x,
|
||||
double *y,
|
||||
double *x_root,
|
||||
double *y_root)
|
||||
{
|
||||
int root_x, root_y;
|
||||
|
||||
@@ -357,7 +365,6 @@ gdk_wayland_device_grab (GdkDevice *device,
|
||||
else
|
||||
{
|
||||
/* Device is a pointer */
|
||||
|
||||
if (wayland_device->pointer_grab_window != NULL &&
|
||||
time_ != 0 && wayland_device->pointer_grab_time > time_)
|
||||
{
|
||||
@@ -482,7 +489,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
|
||||
* gdk_wayland_device_get_wl_seat:
|
||||
* @device: (type GdkWaylandDevice): a #GdkDevice
|
||||
*
|
||||
* Returns the Wayland wl_seat of a #GdkDevice
|
||||
* Returns the Wayland wl_seat of a #GdkDevice.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_seat
|
||||
*
|
||||
@@ -491,7 +498,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
|
||||
struct wl_seat *
|
||||
gdk_wayland_device_get_wl_seat (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
|
||||
return GDK_WAYLAND_DEVICE (device)->device->wl_seat;
|
||||
}
|
||||
@@ -500,7 +507,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
|
||||
* gdk_wayland_device_get_wl_pointer:
|
||||
* @device: (type GdkWaylandDevice): a #GdkDevice
|
||||
*
|
||||
* Returns the Wayland wl_pointer of a #GdkDevice
|
||||
* Returns the Wayland wl_pointer of a #GdkDevice.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_pointer
|
||||
*
|
||||
@@ -509,7 +516,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
|
||||
struct wl_pointer *
|
||||
gdk_wayland_device_get_wl_pointer (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
|
||||
return GDK_WAYLAND_DEVICE (device)->device->wl_pointer;
|
||||
}
|
||||
@@ -518,7 +525,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
|
||||
* gdk_wayland_device_get_wl_keyboard:
|
||||
* @device: (type GdkWaylandDevice): a #GdkDevice
|
||||
*
|
||||
* Returns the Wayland wl_keyboard of a #GdkDevice
|
||||
* Returns the Wayland wl_keyboard of a #GdkDevice.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_keyboard
|
||||
*
|
||||
@@ -527,7 +534,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
|
||||
struct wl_keyboard *
|
||||
gdk_wayland_device_get_wl_keyboard (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
|
||||
|
||||
return GDK_WAYLAND_DEVICE (device)->device->wl_keyboard;
|
||||
}
|
||||
@@ -574,11 +581,15 @@ emit_selection_owner_change_forall (GdkAtom atom)
|
||||
static void
|
||||
data_device_data_offer (void *data,
|
||||
struct wl_data_device *data_device,
|
||||
struct wl_data_offer *_offer)
|
||||
struct wl_data_offer *offer)
|
||||
{
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *)data;
|
||||
gdk_wayland_selection_set_offer (device->display, _offer);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device data offer, data device %p, offer %p",
|
||||
data_device, offer));
|
||||
|
||||
gdk_wayland_selection_set_offer (device->display, offer);
|
||||
emit_selection_owner_change_forall (gdk_atom_intern_static_string ("GdkWaylandSelection"));
|
||||
}
|
||||
|
||||
@@ -599,8 +610,9 @@ data_device_enter (void *data,
|
||||
if (!GDK_IS_WINDOW (dest_window))
|
||||
return;
|
||||
|
||||
g_debug (G_STRLOC ": %s data_device = %p serial = %u, surface = %p, x = %d y = %d, offer = %p",
|
||||
G_STRFUNC, data_device, serial, surface, x, y, offer);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device enter, data device %p serial %u, surface %p, x %d y %d, offer %p",
|
||||
data_device, serial, surface, x, y, offer));
|
||||
|
||||
/* Update pointer state, so device state queries work during DnD */
|
||||
device->pointer_focus = g_object_ref (dest_window);
|
||||
@@ -632,8 +644,8 @@ data_device_leave (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
|
||||
|
||||
g_debug (G_STRLOC ": %s data_device = %p",
|
||||
G_STRFUNC, data_device);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device leave, data device %p", data_device));
|
||||
|
||||
if (!gdk_drag_context_get_dest_window (device->drop_context))
|
||||
return;
|
||||
@@ -680,8 +692,8 @@ data_device_drop (void *data,
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
|
||||
GdkWindow *local_dnd_owner;
|
||||
|
||||
g_debug (G_STRLOC ": %s data_device = %p",
|
||||
G_STRFUNC, data_device);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device drop, data device %p", data_device));
|
||||
|
||||
local_dnd_owner = gdk_selection_owner_get_for_display (device->display, gdk_drag_get_selection (device->drop_context));
|
||||
|
||||
@@ -704,8 +716,9 @@ data_device_selection (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = (GdkWaylandDeviceData *) data;
|
||||
|
||||
g_debug (G_STRLOC ": %s wl_data_device = %p wl_data_offer = %p",
|
||||
G_STRFUNC, wl_data_device, offer);
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("data device selection, data device %p, data offer %p",
|
||||
wl_data_device, offer));
|
||||
|
||||
gdk_wayland_selection_set_offer (device->display, offer);
|
||||
emit_selection_owner_change_forall (gdk_atom_intern_static_string ("CLIPBOARD"));
|
||||
@@ -735,6 +748,7 @@ pointer_handle_enter (void *data,
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
@@ -781,13 +795,14 @@ pointer_handle_leave (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
@@ -818,7 +833,7 @@ pointer_handle_leave (void *data,
|
||||
g_message ("leave, device %p surface %p",
|
||||
device, device->pointer_focus));
|
||||
|
||||
g_object_unref(device->pointer_focus);
|
||||
g_object_unref (device->pointer_focus);
|
||||
if (device->cursor)
|
||||
gdk_wayland_device_stop_window_cursor_animation (device);
|
||||
|
||||
@@ -862,8 +877,8 @@ pointer_handle_motion (void *data,
|
||||
&event->motion.y_root);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("motion %d %d, state %d",
|
||||
sx, sy, event->button.state));
|
||||
g_message ("motion %d %d, device %p state %d",
|
||||
sx, sy, device, event->button.state));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
@@ -881,25 +896,24 @@ pointer_handle_button (void *data,
|
||||
GdkEvent *event;
|
||||
uint32_t modifier;
|
||||
int gdk_button;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
switch (button) {
|
||||
case 273:
|
||||
gdk_button = 3;
|
||||
break;
|
||||
case 274:
|
||||
gdk_button = 2;
|
||||
break;
|
||||
default:
|
||||
gdk_button = button - 271;
|
||||
break;
|
||||
}
|
||||
switch (button)
|
||||
{
|
||||
case 273:
|
||||
gdk_button = 3;
|
||||
break;
|
||||
case 274:
|
||||
gdk_button = 2;
|
||||
break;
|
||||
default:
|
||||
gdk_button = button - 271;
|
||||
break;
|
||||
}
|
||||
|
||||
device->time = time;
|
||||
if (state)
|
||||
@@ -928,9 +942,11 @@ pointer_handle_button (void *data,
|
||||
device->modifiers &= ~modifier;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("button %d %s, state %d",
|
||||
g_message ("button %d %s, device %p state %d",
|
||||
event->button.button,
|
||||
state ? "press" : "release", event->button.state));
|
||||
state ? "press" : "release",
|
||||
device,
|
||||
event->button.state));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
@@ -951,18 +967,19 @@ pointer_handle_axis (void *data,
|
||||
return;
|
||||
|
||||
/* get the delta and convert it into the expected range */
|
||||
switch (axis) {
|
||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||
delta_x = 0;
|
||||
delta_y = wl_fixed_to_double (value) / 10.0;
|
||||
break;
|
||||
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
|
||||
delta_x = wl_fixed_to_double (value) / 10.0;
|
||||
delta_y = 0;
|
||||
break;
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
}
|
||||
switch (axis)
|
||||
{
|
||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||
delta_x = 0;
|
||||
delta_y = wl_fixed_to_double (value) / 10.0;
|
||||
break;
|
||||
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
|
||||
delta_x = wl_fixed_to_double (value) / 10.0;
|
||||
delta_y = 0;
|
||||
break;
|
||||
default:
|
||||
g_return_if_reached ();
|
||||
}
|
||||
|
||||
device->time = time;
|
||||
event = gdk_event_new (GDK_SCROLL);
|
||||
@@ -983,8 +1000,8 @@ pointer_handle_axis (void *data,
|
||||
&event->scroll.y_root);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("scroll %f %f",
|
||||
event->scroll.delta_x, event->scroll.delta_y));
|
||||
g_message ("scroll %f %f, device %p",
|
||||
event->scroll.delta_x, event->scroll.delta_y, device));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
@@ -1014,18 +1031,18 @@ keyboard_handle_enter (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
device->keyboard_focus = wl_surface_get_user_data(surface);
|
||||
g_object_ref(device->keyboard_focus);
|
||||
device->keyboard_focus = wl_surface_get_user_data (surface);
|
||||
g_object_ref (device->keyboard_focus);
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = g_object_ref (device->keyboard_focus);
|
||||
@@ -1035,7 +1052,7 @@ keyboard_handle_enter (void *data,
|
||||
gdk_event_set_source_device (event, device->keyboard);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("focus int, device %p surface %p",
|
||||
g_message ("focus in, device %p surface %p",
|
||||
device, device->keyboard_focus));
|
||||
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
@@ -1049,17 +1066,18 @@ keyboard_handle_leave (void *data,
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
if (!device->keyboard_focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = g_object_ref (device->keyboard_focus);
|
||||
@@ -1068,7 +1086,7 @@ keyboard_handle_leave (void *data,
|
||||
gdk_event_set_device (event, device->master_keyboard);
|
||||
gdk_event_set_source_device (event, device->keyboard);
|
||||
|
||||
g_object_unref(device->keyboard_focus);
|
||||
g_object_unref (device->keyboard_focus);
|
||||
device->keyboard_focus = NULL;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
@@ -1078,8 +1096,7 @@ keyboard_handle_leave (void *data,
|
||||
_gdk_wayland_display_deliver_event (device->display, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
keyboard_repeat (gpointer data);
|
||||
static gboolean keyboard_repeat (gpointer data);
|
||||
|
||||
static void
|
||||
translate_keyboard_string (GdkEventKey *event)
|
||||
@@ -1100,11 +1117,11 @@ translate_keyboard_string (GdkEventKey *event)
|
||||
gsize bytes_written;
|
||||
gint len;
|
||||
|
||||
/* Apply the control key - Taken from Xlib
|
||||
*/
|
||||
/* Apply the control key - Taken from Xlib */
|
||||
if (event->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
|
||||
if ((c >= '@' && c < '\177') || c == ' ')
|
||||
c &= 0x1F;
|
||||
else if (c == '2')
|
||||
{
|
||||
event->string = g_memdup ("\0\0", 2);
|
||||
@@ -1112,9 +1129,12 @@ translate_keyboard_string (GdkEventKey *event)
|
||||
buf[0] = '\0';
|
||||
return;
|
||||
}
|
||||
else if (c >= '3' && c <= '7') c -= ('3' - '\033');
|
||||
else if (c == '8') c = '\177';
|
||||
else if (c == '/') c = '_' & 0x1F;
|
||||
else if (c >= '3' && c <= '7')
|
||||
c -= ('3' - '\033');
|
||||
else if (c == '8')
|
||||
c = '\177';
|
||||
else if (c == '/')
|
||||
c = '_' & 0x1F;
|
||||
}
|
||||
|
||||
len = g_unichar_to_utf8 (c, buf);
|
||||
@@ -1277,7 +1297,6 @@ deliver_key_event (GdkWaylandDeviceData *device,
|
||||
g_source_remove (device->repeat_timer);
|
||||
device->repeat_timer = 0;
|
||||
}
|
||||
|
||||
device->repeat_timer =
|
||||
gdk_threads_add_timeout (delay, keyboard_repeat, device);
|
||||
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
|
||||
@@ -1310,14 +1329,13 @@ keyboard_handle_key (void *data,
|
||||
uint32_t state_w)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!device->keyboard_focus)
|
||||
return;
|
||||
|
||||
device->repeat_count = 0;
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
deliver_key_event (data, time, key + 8, state_w);
|
||||
}
|
||||
|
||||
@@ -1439,12 +1457,11 @@ touch_handle_down (void *data,
|
||||
wl_fixed_t y)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandTouchData *touch;
|
||||
GdkEvent *event;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_device_add_touch (device, id, wl_surface);
|
||||
touch->x = wl_fixed_to_double (x);
|
||||
@@ -1467,12 +1484,11 @@ touch_handle_up (void *data,
|
||||
int32_t id)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkWaylandTouchData *touch;
|
||||
GdkEvent *event;
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_device_get_touch (device, id);
|
||||
event = _create_touch_event (device, touch, GDK_TOUCH_END, time);
|
||||
@@ -1568,8 +1584,13 @@ seat_handle_capabilities (void *data,
|
||||
enum wl_seat_capability caps)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkWaylandDeviceManager *device_manager =
|
||||
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("seat %p with %s%s%s", seat,
|
||||
(caps & WL_SEAT_CAPABILITY_POINTER) ? " pointer, " : "",
|
||||
(caps & WL_SEAT_CAPABILITY_KEYBOARD) ? " keyboard, " : "",
|
||||
(caps & WL_SEAT_CAPABILITY_TOUCH) ? " touch" : ""));
|
||||
|
||||
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
|
||||
{
|
||||
@@ -1689,11 +1710,13 @@ seat_handle_capabilities (void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
seat_handle_name (void *data,
|
||||
struct wl_seat *seat,
|
||||
const char *name)
|
||||
seat_handle_name (void *data,
|
||||
struct wl_seat *seat,
|
||||
const char *name)
|
||||
{
|
||||
/* We don't care about the name. */
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("seat %p name %s", seat, name));
|
||||
}
|
||||
|
||||
static const struct wl_seat_listener seat_listener = {
|
||||
@@ -1704,8 +1727,7 @@ static const struct wl_seat_listener seat_listener = {
|
||||
static void
|
||||
init_devices (GdkWaylandDeviceData *device)
|
||||
{
|
||||
GdkWaylandDeviceManager *device_manager =
|
||||
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
|
||||
|
||||
/* pointer */
|
||||
device->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
|
||||
@@ -1744,6 +1766,78 @@ init_devices (GdkWaylandDeviceData *device)
|
||||
_gdk_device_set_associated_device (device->master_keyboard, device->master_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_update_scale (GdkWaylandDeviceData *device)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
guint32 scale;
|
||||
GSList *l;
|
||||
|
||||
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
/* We can't set the scale on this surface */
|
||||
return;
|
||||
}
|
||||
|
||||
scale = 1;
|
||||
for (l = device->pointer_surface_outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale =
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen,
|
||||
l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
||||
device->current_output_scale = scale;
|
||||
|
||||
if (device->grab_cursor)
|
||||
_gdk_wayland_cursor_set_scale (device->grab_cursor, scale);
|
||||
if (device->cursor)
|
||||
_gdk_wayland_cursor_set_scale (device->cursor, scale);
|
||||
|
||||
gdk_wayland_device_update_window_cursor (device);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_enter (void *data,
|
||||
struct wl_surface *wl_surface,
|
||||
struct wl_output *output)
|
||||
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("pointer surface of device %p entered output %p",
|
||||
device, output));
|
||||
|
||||
device->pointer_surface_outputs =
|
||||
g_slist_append (device->pointer_surface_outputs, output);
|
||||
|
||||
pointer_surface_update_scale (device);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_leave (void *data,
|
||||
struct wl_surface *wl_surface,
|
||||
struct wl_output *output)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("pointer surface of device %p left output %p",
|
||||
device, output));
|
||||
|
||||
device->pointer_surface_outputs =
|
||||
g_slist_remove (device->pointer_surface_outputs, output);
|
||||
|
||||
pointer_surface_update_scale (device);
|
||||
}
|
||||
|
||||
static const struct wl_surface_listener pointer_surface_listener = {
|
||||
pointer_surface_enter,
|
||||
pointer_surface_leave
|
||||
};
|
||||
|
||||
void
|
||||
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
guint32 id,
|
||||
@@ -1774,8 +1868,12 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
wl_data_device_add_listener (device->data_device,
|
||||
&data_device_listener, device);
|
||||
|
||||
device->current_output_scale = 1;
|
||||
device->pointer_surface =
|
||||
wl_compositor_create_surface (display_wayland->compositor);
|
||||
wl_surface_add_listener (device->pointer_surface,
|
||||
&pointer_surface_listener,
|
||||
device);
|
||||
|
||||
init_devices (device);
|
||||
}
|
||||
@@ -1832,7 +1930,7 @@ gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GList *devices = NULL, *l;
|
||||
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
|
||||
|
||||
for (l = wayland_device_manager->devices; l; l = l->next)
|
||||
{
|
||||
@@ -1849,7 +1947,7 @@ gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GList *l;
|
||||
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
|
||||
|
||||
/* Find the first master pointer device */
|
||||
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
|
||||
@@ -1943,6 +2041,7 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
|
||||
GdkWaylandDeviceData *device;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
|
||||
|
||||
gdk_wayland_device_remove_touch (device, GDK_EVENT_SEQUENCE_TO_SLOT (sequence));
|
||||
@@ -1953,12 +2052,9 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
|
||||
struct wl_data_device *
|
||||
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
|
||||
{
|
||||
GdkWaylandDeviceData *device;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device), NULL);
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
|
||||
|
||||
return device->data_device;
|
||||
return GDK_WAYLAND_DEVICE (gdk_device)->device->data_device;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1969,6 +2065,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
|
||||
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (gdk_device));
|
||||
|
||||
|
||||
@@ -132,6 +132,9 @@ xdg_shell_ping (void *data,
|
||||
|
||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
|
||||
|
||||
xdg_shell_pong (xdg_shell, serial);
|
||||
}
|
||||
|
||||
@@ -140,59 +143,83 @@ static const struct xdg_shell_listener xdg_shell_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
|
||||
const char *interface, uint32_t version)
|
||||
gdk_registry_handle_global (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id,
|
||||
const char *interface,
|
||||
uint32_t version)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
|
||||
struct wl_seat *seat;
|
||||
struct wl_output *output;
|
||||
|
||||
if (strcmp(interface, "wl_compositor") == 0) {
|
||||
display_wayland->compositor =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
|
||||
display_wayland->compositor_version = MIN (version, 3);
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
display_wayland->shm =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("add global %u, interface %s, version %u", id, interface, version));
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme(display_wayland);
|
||||
} else if (strcmp(interface, "xdg_shell") == 0) {
|
||||
display_wayland->xdg_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &xdg_shell_interface, 1);
|
||||
xdg_shell_use_unstable_version(display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
|
||||
xdg_shell_add_listener(display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
|
||||
} else if (strcmp(interface, "gtk_shell") == 0) {
|
||||
display_wayland->gtk_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, >k_shell_interface, 1);
|
||||
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
output =
|
||||
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
|
||||
_gdk_wayland_screen_add_output(display_wayland->screen, id, output, MIN (version, 2));
|
||||
} else if (strcmp(interface, "wl_seat") == 0) {
|
||||
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
|
||||
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
|
||||
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
|
||||
if (strcmp (interface, "wl_compositor") == 0)
|
||||
{
|
||||
display_wayland->compositor =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
|
||||
display_wayland->compositor_version = MIN (version, 3);
|
||||
}
|
||||
else if (strcmp (interface, "wl_shm") == 0)
|
||||
{
|
||||
display_wayland->shm =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_shm_interface, 1);
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme (display_wayland);
|
||||
}
|
||||
else if (strcmp (interface, "xdg_shell") == 0)
|
||||
{
|
||||
display_wayland->xdg_shell =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &xdg_shell_interface, 1);
|
||||
xdg_shell_use_unstable_version (display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
|
||||
xdg_shell_add_listener (display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
|
||||
}
|
||||
else if (strcmp (interface, "gtk_shell") == 0)
|
||||
{
|
||||
if (version == SUPPORTED_GTK_SHELL_VERSION)
|
||||
{
|
||||
display_wayland->gtk_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
>k_shell_interface, SUPPORTED_GTK_SHELL_VERSION);
|
||||
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
|
||||
}
|
||||
}
|
||||
else if (strcmp (interface, "wl_output") == 0)
|
||||
{
|
||||
output =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
|
||||
_gdk_wayland_screen_add_output (display_wayland->screen, id, output, MIN (version, 2));
|
||||
}
|
||||
else if (strcmp (interface, "wl_seat") == 0)
|
||||
{
|
||||
seat = wl_registry_bind (display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
|
||||
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
|
||||
}
|
||||
else if (strcmp (interface, "wl_data_device_manager") == 0)
|
||||
{
|
||||
display_wayland->data_device_manager =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
&wl_data_device_manager_interface, 1);
|
||||
} else if (strcmp (interface, "wl_subcompositor") == 0) {
|
||||
display_wayland->subcompositor =
|
||||
wl_registry_bind (display_wayland->wl_registry, id,
|
||||
&wl_subcompositor_interface, 1);
|
||||
}
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_data_device_manager_interface, 1);
|
||||
}
|
||||
else if (strcmp (interface, "wl_subcompositor") == 0)
|
||||
{
|
||||
display_wayland->subcompositor =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_registry_handle_global_remove(void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
gdk_registry_handle_global_remove (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *display = GDK_DISPLAY (display_wayland);
|
||||
|
||||
GDK_NOTE (MISC, g_message ("remove global %u", id));
|
||||
_gdk_wayland_device_manager_remove_seat (display->device_manager, id);
|
||||
_gdk_wayland_screen_remove_output (display_wayland->screen, id);
|
||||
|
||||
@@ -205,7 +232,7 @@ static const struct wl_registry_listener registry_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
log_handler(const char *format, va_list args)
|
||||
log_handler (const char *format, va_list args)
|
||||
{
|
||||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
|
||||
}
|
||||
@@ -217,6 +244,8 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
GdkDisplay *display;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
GDK_NOTE (MISC, g_message ("opening display %s", display_name ? display_name : ""));
|
||||
|
||||
/* If this variable is unset then wayland initialisation will surely
|
||||
* fail, logging a fatal error in the process. Save ourselves from
|
||||
* that.
|
||||
@@ -224,9 +253,9 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
|
||||
return NULL;
|
||||
|
||||
wl_log_set_handler_client(log_handler);
|
||||
wl_log_set_handler_client (log_handler);
|
||||
|
||||
wl_display = wl_display_connect(display_name);
|
||||
wl_display = wl_display_connect (display_name);
|
||||
if (!wl_display)
|
||||
return NULL;
|
||||
|
||||
@@ -239,8 +268,8 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
|
||||
_gdk_wayland_display_init_cursors (display_wayland);
|
||||
|
||||
display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
|
||||
wl_registry_add_listener(display_wayland->wl_registry, ®istry_listener, display_wayland);
|
||||
display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
|
||||
wl_registry_add_listener (display_wayland->wl_registry, ®istry_listener, display_wayland);
|
||||
|
||||
/* Wait until the dust has settled during init... */
|
||||
wl_display_roundtrip (display_wayland->wl_display);
|
||||
@@ -326,7 +355,7 @@ gdk_wayland_display_sync (GdkDisplay *display)
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
wl_display_roundtrip(display_wayland->wl_display);
|
||||
wl_display_roundtrip (display_wayland->wl_display);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -335,7 +364,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
if (!display->closed)
|
||||
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);
|
||||
wl_display_flush (GDK_WAYLAND_DISPLAY (display)->wl_display);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -485,7 +514,7 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
|
||||
gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
|
||||
@@ -550,10 +579,15 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
struct wl_cursor_theme *theme;
|
||||
int i;
|
||||
|
||||
g_assert (wayland_display);
|
||||
g_assert (wayland_display->shm);
|
||||
|
||||
if (g_strcmp0 (name, wayland_display->cursor_theme_name) == 0 &&
|
||||
wayland_display->cursor_theme_size == size)
|
||||
return;
|
||||
|
||||
theme = wl_cursor_theme_load (name, size, wayland_display->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
@@ -561,11 +595,49 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
return;
|
||||
}
|
||||
|
||||
_gdk_wayland_display_update_cursors (wayland_display, theme);
|
||||
for (i = 0; i < GDK_WAYLAND_THEME_SCALES_COUNT; i++)
|
||||
{
|
||||
if (wayland_display->scaled_cursor_themes[i])
|
||||
{
|
||||
wl_cursor_theme_destroy (wayland_display->scaled_cursor_themes[i]);
|
||||
wayland_display->scaled_cursor_themes[i] = NULL;
|
||||
}
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[0] = theme;
|
||||
if (wayland_display->cursor_theme_name != NULL)
|
||||
free (wayland_display->cursor_theme_name);
|
||||
wayland_display->cursor_theme_name = g_strdup (name);
|
||||
wayland_display->cursor_theme_size = size;
|
||||
|
||||
if (wayland_display->cursor_theme != NULL)
|
||||
wl_cursor_theme_destroy (wayland_display->cursor_theme);
|
||||
wayland_display->cursor_theme = theme;
|
||||
_gdk_wayland_display_update_cursors (wayland_display);
|
||||
}
|
||||
|
||||
struct wl_cursor_theme *
|
||||
_gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
guint scale)
|
||||
{
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
g_assert (wayland_display->cursor_theme_name);
|
||||
g_assert (scale <= GDK_WAYLAND_MAX_THEME_SCALE);
|
||||
g_assert (scale >= 1);
|
||||
|
||||
theme = wayland_display->scaled_cursor_themes[scale - 1];
|
||||
if (!theme)
|
||||
{
|
||||
theme = wl_cursor_theme_load (wayland_display->cursor_theme_name,
|
||||
wayland_display->cursor_theme_size * scale,
|
||||
wayland_display->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
g_warning ("Failed to load cursor theme %s with scale %u\n",
|
||||
wayland_display->cursor_theme_name, scale);
|
||||
return NULL;
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[scale - 1] = theme;
|
||||
}
|
||||
|
||||
return theme;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -591,8 +663,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
|
||||
else
|
||||
name = "default";
|
||||
|
||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display),
|
||||
name, size);
|
||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display), name, size);
|
||||
g_value_unset (&v);
|
||||
}
|
||||
|
||||
@@ -610,30 +681,28 @@ _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_wl_display
|
||||
* gdk_wayland_display_get_wl_display:
|
||||
* @display: (type GdkWaylandDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the Wayland wl_display of a #GdkDisplay
|
||||
* Returns the Wayland wl_display of a #GdkDisplay.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_display
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
struct wl_display *
|
||||
gdk_wayland_display_get_wl_display(GdkDisplay *display)
|
||||
gdk_wayland_display_get_wl_display (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
|
||||
|
||||
return wayland_display->wl_display;
|
||||
return GDK_WAYLAND_DISPLAY (display)->wl_display;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_wl_compositor
|
||||
* gdk_wayland_display_get_wl_compositor:
|
||||
* @display: (type GdkWaylandDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the Wayland global singleton compositor of a #GdkDisplay
|
||||
* Returns the Wayland global singleton compositor of a #GdkDisplay.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_compositor
|
||||
*
|
||||
@@ -642,18 +711,16 @@ gdk_wayland_display_get_wl_display(GdkDisplay *display)
|
||||
struct wl_compositor *
|
||||
gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
|
||||
|
||||
return wayland_display->compositor;
|
||||
return GDK_WAYLAND_DISPLAY (display)->compositor;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_display_get_xdg_shell
|
||||
* gdk_wayland_display_get_xdg_shell:
|
||||
* @display: (type GdkWaylandDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the Wayland global singleton shell of a #GdkDisplay
|
||||
* Returns the Wayland global singleton shell of a #GdkDisplay.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland xdg_shell
|
||||
*
|
||||
@@ -662,11 +729,9 @@ gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
|
||||
struct xdg_shell *
|
||||
gdk_wayland_display_get_xdg_shell (GdkDisplay *display)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
|
||||
|
||||
return wayland_display->xdg_shell;
|
||||
return GDK_WAYLAND_DISPLAY (display)->xdg_shell;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t gdk_wayland_cairo_key;
|
||||
@@ -737,7 +802,7 @@ create_shm_pool (struct wl_shm *shm,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pool = wl_shm_create_pool(shm, fd, size);
|
||||
pool = wl_shm_create_pool (shm, fd, size);
|
||||
|
||||
close (fd);
|
||||
|
||||
@@ -834,6 +899,12 @@ _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface)
|
||||
return data->busy;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_wayland_is_shm_surface (cairo_surface_t *surface)
|
||||
{
|
||||
return cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key) != NULL;
|
||||
}
|
||||
|
||||
GdkWaylandSelection *
|
||||
gdk_wayland_display_get_selection (GdkDisplay *display)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* gdkdisplay-wayland.h
|
||||
*
|
||||
* Copyright 2001 Sun Microsystems Inc.
|
||||
*
|
||||
* Copyright 2001 Sun Microsystems Inc.
|
||||
*
|
||||
* Erwann Chenede <erwann.chenede@sun.com>
|
||||
*
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_WAYLAND_MAX_THEME_SCALE 2
|
||||
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
|
||||
|
||||
typedef struct _GdkWaylandSelection GdkWaylandSelection;
|
||||
|
||||
struct _GdkWaylandDisplay
|
||||
@@ -69,7 +72,9 @@ struct _GdkWaylandDisplay
|
||||
struct wl_data_device_manager *data_device_manager;
|
||||
struct wl_subcompositor *subcompositor;
|
||||
|
||||
struct wl_cursor_theme *cursor_theme;
|
||||
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
|
||||
gchar *cursor_theme_name;
|
||||
int cursor_theme_size;
|
||||
GHashTable *cursor_cache;
|
||||
|
||||
GSource *event_source;
|
||||
@@ -99,4 +104,4 @@ struct _GdkWaylandDisplayClass
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WAYLAND_DISPLAY__ */
|
||||
#endif /* __GDK_WAYLAND_DISPLAY__ */
|
||||
|
||||
@@ -382,7 +382,11 @@ _gdk_wayland_drop_context_new (GdkDevice *device,
|
||||
void
|
||||
gdk_wayland_drop_context_update_targets (GdkDragContext *context)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (context->source_window);
|
||||
GdkDisplay *display;
|
||||
GdkDevice *device;
|
||||
|
||||
device = gdk_drag_context_get_device (context);
|
||||
display = gdk_device_get_display (device);
|
||||
g_list_free (context->targets);
|
||||
context->targets = g_list_copy (gdk_wayland_selection_get_targets (display));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef struct _GdkWaylandEventSource {
|
||||
@@ -32,7 +33,8 @@ typedef struct _GdkWaylandEventSource {
|
||||
static GList *event_sources = NULL;
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
gdk_event_source_prepare (GSource *base,
|
||||
gint *timeout)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
|
||||
@@ -59,7 +61,7 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_check(GSource *base)
|
||||
gdk_event_source_check (GSource *base)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
|
||||
@@ -71,9 +73,9 @@ gdk_event_source_check(GSource *base)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_dispatch(GSource *base,
|
||||
GSourceFunc callback,
|
||||
gpointer data)
|
||||
gdk_event_source_dispatch (GSource *base,
|
||||
GSourceFunc callback,
|
||||
gpointer data)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkDisplay *display = source->display;
|
||||
@@ -109,7 +111,8 @@ static GSourceFuncs wl_glib_source_funcs = {
|
||||
};
|
||||
|
||||
void
|
||||
_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
|
||||
_gdk_wayland_display_deliver_event (GdkDisplay *display,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
@@ -160,11 +163,17 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
if (source->pfd.revents & G_IO_IN)
|
||||
{
|
||||
if (wl_display_dispatch (display_wayland->wl_display) < 0)
|
||||
g_error ("Error dispatching display: %s", g_strerror (errno));
|
||||
{
|
||||
g_warning ("Error %d (%s) dispatching to Wayland display.",
|
||||
errno, g_strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
|
||||
g_error ("Lost connection to wayland compositor");
|
||||
|
||||
{
|
||||
g_warning ("Lost connection to Wayland compositor.");
|
||||
exit (1);
|
||||
}
|
||||
source->pfd.revents = 0;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ gdk_wayland_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
window_rect.height = gdk_window_get_height (window);
|
||||
|
||||
/* If nothing else is known, repaint everything so that the back
|
||||
buffer is fully up-to-date for the swapbuffer */
|
||||
* buffer is fully up-to-date for the swapbuffer
|
||||
*/
|
||||
cairo_region_union_rectangle (update_area, &window_rect);
|
||||
}
|
||||
}
|
||||
@@ -165,7 +166,7 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage)
|
||||
{
|
||||
@@ -180,7 +181,7 @@ gdk_wayland_gl_context_end_frame (GdkGLContext *context,
|
||||
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
|
||||
context_wayland->egl_config);
|
||||
|
||||
// TODO: Use eglSwapBuffersWithDamageEXT if available
|
||||
/* TODO: Use eglSwapBuffersWithDamageEXT if available */
|
||||
if (display_wayland->have_egl_swap_buffers_with_damage)
|
||||
{
|
||||
int i, j, n_rects = cairo_region_num_rectangles (damage);
|
||||
|
||||
@@ -250,7 +250,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
|
||||
if (state & GDK_MOD1_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
|
||||
if (state & GDK_MOD2_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2");
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM);
|
||||
if (state & GDK_MOD3_MASK)
|
||||
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3");
|
||||
if (state & GDK_MOD4_MASK)
|
||||
@@ -275,7 +275,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
|
||||
state |= GDK_MOD1_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2")))
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM)))
|
||||
state |= GDK_MOD2_MASK;
|
||||
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3")))
|
||||
state |= GDK_MOD3_MASK;
|
||||
@@ -457,7 +457,7 @@ update_direction (GdkWaylandKeymap *keymap)
|
||||
}
|
||||
|
||||
GdkKeymap *
|
||||
_gdk_wayland_keymap_new ()
|
||||
_gdk_wayland_keymap_new (void)
|
||||
{
|
||||
GdkWaylandKeymap *keymap;
|
||||
struct xkb_context *context;
|
||||
@@ -494,12 +494,12 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
|
||||
|
||||
context = xkb_context_new (0);
|
||||
|
||||
map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
map_str = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (map_str == MAP_FAILED)
|
||||
{
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
|
||||
munmap (map_str, size);
|
||||
@@ -523,12 +523,14 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
|
||||
update_direction (keymap_wayland);
|
||||
}
|
||||
|
||||
struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
|
||||
struct xkb_keymap *
|
||||
_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
|
||||
{
|
||||
return GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
|
||||
}
|
||||
|
||||
struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
|
||||
struct xkb_state *
|
||||
_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
|
||||
{
|
||||
return GDK_WAYLAND_KEYMAP (keymap)->xkb_state;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Private uninstalled header defining things local to X windowing code
|
||||
* Private uninstalled header defining things local to the Wayland backend
|
||||
*/
|
||||
|
||||
#ifndef __GDK_PRIVATE_WAYLAND_H__
|
||||
@@ -40,6 +40,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define WL_SURFACE_HAS_BUFFER_SCALE 3
|
||||
|
||||
#define SUPPORTED_GTK_SHELL_VERSION 1
|
||||
|
||||
#define GDK_WINDOW_IS_WAYLAND(win) (GDK_IS_WINDOW_IMPL_WAYLAND (((GdkWindow *)win)->impl))
|
||||
|
||||
GdkKeymap *_gdk_wayland_keymap_new (void);
|
||||
@@ -54,11 +58,16 @@ gboolean _gdk_wayland_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
|
||||
void _gdk_wayland_display_init_cursors (GdkWaylandDisplay *display);
|
||||
void _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display);
|
||||
void _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme);
|
||||
void _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display);
|
||||
|
||||
struct wl_cursor_theme * _gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type);
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
GdkCursorType cursor_type,
|
||||
guint scale);
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name);
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
@@ -85,6 +94,9 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
guint current_image_index,
|
||||
guint *next_image_delay);
|
||||
|
||||
void _gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale);
|
||||
|
||||
GdkDragProtocol _gdk_wayland_window_get_drag_protocol (GdkWindow *window,
|
||||
GdkWindow **target);
|
||||
|
||||
@@ -219,6 +231,7 @@ cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *di
|
||||
struct wl_buffer *_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface);
|
||||
void _gdk_wayland_shm_surface_set_busy (cairo_surface_t *surface);
|
||||
gboolean _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface);
|
||||
gboolean _gdk_wayland_is_shm_surface (cairo_surface_t *surface);
|
||||
|
||||
GdkWaylandSelection * gdk_wayland_display_get_selection (GdkDisplay *display);
|
||||
GdkWaylandSelection * gdk_wayland_selection_new (void);
|
||||
|
||||
@@ -223,7 +223,9 @@ gdk_wayland_screen_get_monitor_width_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
|
||||
GdkWaylandMonitor *monitor;
|
||||
|
||||
monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
|
||||
|
||||
return monitor->width_mm;
|
||||
}
|
||||
@@ -233,7 +235,9 @@ gdk_wayland_screen_get_monitor_height_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
|
||||
GdkWaylandMonitor *monitor;
|
||||
|
||||
monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
|
||||
|
||||
return monitor->height_mm;
|
||||
}
|
||||
@@ -243,7 +247,9 @@ gdk_wayland_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
|
||||
GdkWaylandMonitor *monitor;
|
||||
|
||||
monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
|
||||
|
||||
return g_strdup (monitor->output_name);
|
||||
}
|
||||
@@ -254,7 +260,9 @@ gdk_wayland_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
|
||||
GdkWaylandMonitor *monitor;
|
||||
|
||||
monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
|
||||
|
||||
if (dest)
|
||||
*dest = monitor->geometry;
|
||||
@@ -267,10 +275,7 @@ gdk_wayland_screen_get_monitor_scale_factor (GdkScreen *screen,
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
GdkWaylandMonitor *monitor;
|
||||
|
||||
if (monitor_num >= screen_wayland->monitors->len)
|
||||
return 1;
|
||||
|
||||
monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
|
||||
monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
|
||||
|
||||
return monitor->scale;
|
||||
}
|
||||
@@ -358,17 +363,17 @@ typedef enum
|
||||
static gdouble
|
||||
get_dpi_from_gsettings (GdkWaylandScreen *screen_wayland)
|
||||
{
|
||||
GSettings *interface_settings;
|
||||
gdouble factor;
|
||||
GSettings *settings;
|
||||
gdouble factor;
|
||||
|
||||
interface_settings = g_hash_table_lookup (screen_wayland->settings,
|
||||
"org.gnome.desktop.interface");
|
||||
if (interface_settings != NULL)
|
||||
factor = g_settings_get_double (interface_settings, "text-scaling-factor");
|
||||
else
|
||||
factor = 1.0;
|
||||
settings = g_hash_table_lookup (screen_wayland->settings,
|
||||
"org.gnome.desktop.interface");
|
||||
if (settings != NULL)
|
||||
factor = g_settings_get_double (settings, "text-scaling-factor");
|
||||
else
|
||||
factor = 1.0;
|
||||
|
||||
return 96.0 * factor;
|
||||
return 96.0 * factor;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -547,7 +552,8 @@ static TranslationEntry translations[] = {
|
||||
};
|
||||
|
||||
static TranslationEntry *
|
||||
find_translation_entry_by_key (GSettings *settings, const gchar *key)
|
||||
find_translation_entry_by_key (GSettings *settings,
|
||||
const gchar *key)
|
||||
{
|
||||
guint i;
|
||||
gchar *schema;
|
||||
@@ -750,8 +756,8 @@ set_decoration_layout_from_entry (GdkScreen *screen,
|
||||
|
||||
static gboolean
|
||||
set_capability_setting (GdkScreen *screen,
|
||||
GValue *value,
|
||||
enum gtk_shell_capability test)
|
||||
GValue *value,
|
||||
enum gtk_shell_capability test)
|
||||
{
|
||||
GdkWaylandScreen *wayland_screen = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
@@ -762,8 +768,8 @@ set_capability_setting (GdkScreen *screen,
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_screen_get_setting (GdkScreen *screen,
|
||||
const gchar *name,
|
||||
GValue *value)
|
||||
const gchar *name,
|
||||
GValue *value)
|
||||
{
|
||||
TranslationEntry *entry;
|
||||
|
||||
@@ -1017,11 +1023,16 @@ update_screen_size (GdkWaylandScreen *screen_wayland)
|
||||
}
|
||||
|
||||
static void
|
||||
output_handle_geometry(void *data,
|
||||
struct wl_output *wl_output,
|
||||
int x, int y, int physical_width, int physical_height,
|
||||
int subpixel, const char *make, const char *model,
|
||||
int32_t transform)
|
||||
output_handle_geometry (void *data,
|
||||
struct wl_output *wl_output,
|
||||
int x,
|
||||
int y,
|
||||
int physical_width,
|
||||
int physical_height,
|
||||
int subpixel,
|
||||
const char *make,
|
||||
const char *model,
|
||||
int32_t transform)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
||||
|
||||
@@ -1042,8 +1053,8 @@ output_handle_geometry(void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
output_handle_done(void *data,
|
||||
struct wl_output *wl_output)
|
||||
output_handle_done (void *data,
|
||||
struct wl_output *wl_output)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
||||
|
||||
@@ -1052,9 +1063,9 @@ output_handle_done(void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
output_handle_scale(void *data,
|
||||
struct wl_output *wl_output,
|
||||
int32_t factor)
|
||||
output_handle_scale (void *data,
|
||||
struct wl_output *wl_output,
|
||||
int32_t factor)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
||||
|
||||
@@ -1063,12 +1074,12 @@ output_handle_scale(void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
output_handle_mode(void *data,
|
||||
struct wl_output *wl_output,
|
||||
uint32_t flags,
|
||||
int width,
|
||||
int height,
|
||||
int refresh)
|
||||
output_handle_mode (void *data,
|
||||
struct wl_output *wl_output,
|
||||
uint32_t flags,
|
||||
int width,
|
||||
int height,
|
||||
int refresh)
|
||||
{
|
||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
||||
|
||||
@@ -1101,16 +1112,19 @@ _gdk_wayland_screen_add_output (GdkScreen *screen,
|
||||
guint32 version)
|
||||
{
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
GdkWaylandMonitor *monitor = g_new0(GdkWaylandMonitor, 1);
|
||||
GdkWaylandMonitor *monitor;
|
||||
|
||||
monitor = g_new0 (GdkWaylandMonitor, 1);
|
||||
|
||||
monitor->id = id;
|
||||
monitor->output = output;
|
||||
monitor->version = version;
|
||||
monitor->screen = screen_wayland;
|
||||
monitor->scale = 1;
|
||||
g_ptr_array_add(screen_wayland->monitors, monitor);
|
||||
|
||||
wl_output_add_listener(output, &output_listener, monitor);
|
||||
g_ptr_array_add (screen_wayland->monitors, monitor);
|
||||
|
||||
wl_output_add_listener (output, &output_listener, monitor);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -64,7 +64,8 @@ struct _DataSourceData
|
||||
GdkAtom selection;
|
||||
};
|
||||
|
||||
struct _AsyncWriteData {
|
||||
struct _AsyncWriteData
|
||||
{
|
||||
GOutputStream *stream;
|
||||
GdkWaylandSelection *selection;
|
||||
gsize index;
|
||||
@@ -268,8 +269,9 @@ gdk_wayland_selection_new (void)
|
||||
atoms[ATOM_DND] = gdk_atom_intern_static_string ("GdkWaylandSelection");
|
||||
|
||||
selection = g_new0 (GdkWaylandSelection, 1);
|
||||
selection->selection_buffers = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) selection_buffer_cancel_and_unref);
|
||||
selection->selection_buffers =
|
||||
g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) selection_buffer_cancel_and_unref);
|
||||
return selection;
|
||||
}
|
||||
|
||||
@@ -414,9 +416,11 @@ async_write_data_cb (GObject *object,
|
||||
res, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error writing selection data: %s", error->message);
|
||||
g_error_free (error);
|
||||
if (error->domain != G_IO_ERROR ||
|
||||
error->code != G_IO_ERROR_CANCELLED)
|
||||
g_warning ("Error writing selection data: %s", error->message);
|
||||
|
||||
g_error_free (error);
|
||||
async_write_data_free (write_data);
|
||||
return;
|
||||
}
|
||||
@@ -556,12 +560,12 @@ gdk_wayland_selection_request_target (GdkWaylandSelection *wayland_selection,
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
if (fd >= 0)
|
||||
wayland_selection->stored_selection.fd = fd;
|
||||
|
||||
if (wayland_selection->source_requested_target == target)
|
||||
if (wayland_selection->stored_selection.fd == fd &&
|
||||
wayland_selection->source_requested_target == target)
|
||||
return FALSE;
|
||||
|
||||
wayland_selection->stored_selection.fd = fd;
|
||||
|
||||
wayland_selection->source_requested_target = target;
|
||||
|
||||
if (window && target != GDK_NONE)
|
||||
@@ -666,16 +670,19 @@ data_source_cancelled (void *data,
|
||||
g_debug (G_STRLOC ": %s source = %p",
|
||||
G_STRFUNC, source);
|
||||
|
||||
context = gdk_wayland_drag_context_lookup_by_data_source (source);
|
||||
display = gdk_window_get_display (context->source_window);
|
||||
display = gdk_display_get_default ();
|
||||
|
||||
if (source == wayland_selection->dnd_source)
|
||||
gdk_wayland_selection_unset_data_source (display, atoms[ATOM_DND]);
|
||||
{
|
||||
gdk_wayland_selection_unset_data_source (display, atoms[ATOM_DND]);
|
||||
|
||||
context = gdk_wayland_drag_context_lookup_by_data_source (source);
|
||||
|
||||
if (context)
|
||||
gdk_wayland_drag_context_undo_grab (context);
|
||||
}
|
||||
else if (source == wayland_selection->clipboard_source)
|
||||
gdk_wayland_selection_unset_data_source (display, atoms[ATOM_CLIPBOARD]);
|
||||
|
||||
if (context)
|
||||
gdk_wayland_drag_context_undo_grab (context);
|
||||
}
|
||||
|
||||
static const struct wl_data_source_listener data_source_listener = {
|
||||
@@ -742,7 +749,8 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection)
|
||||
gdk_wayland_selection_unset_data_source (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
|
||||
|
||||
@@ -772,7 +780,7 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection)
|
||||
|
||||
GdkWindow *
|
||||
_gdk_wayland_display_get_selection_owner (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
GdkAtom selection)
|
||||
{
|
||||
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
|
||||
|
||||
@@ -786,10 +794,10 @@ _gdk_wayland_display_get_selection_owner (GdkDisplay *display,
|
||||
|
||||
gboolean
|
||||
_gdk_wayland_display_set_selection_owner (GdkDisplay *display,
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event)
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event)
|
||||
{
|
||||
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
|
||||
|
||||
@@ -809,20 +817,20 @@ _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
|
||||
|
||||
void
|
||||
_gdk_wayland_display_send_selection_notify (GdkDisplay *dispay,
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
{
|
||||
}
|
||||
|
||||
gint
|
||||
_gdk_wayland_display_get_selection_property (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format)
|
||||
GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format)
|
||||
{
|
||||
SelectionBuffer *buffer_data;
|
||||
gsize len;
|
||||
@@ -864,10 +872,10 @@ _gdk_wayland_display_get_selection_property (GdkDisplay *display,
|
||||
|
||||
void
|
||||
_gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
{
|
||||
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
|
||||
SelectionBuffer *buffer_data;
|
||||
@@ -890,9 +898,10 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
return;
|
||||
}
|
||||
|
||||
wl_data_offer_accept (wayland_selection->offer,
|
||||
_gdk_wayland_display_get_serial (GDK_WAYLAND_DISPLAY (display)),
|
||||
gdk_atom_name (target));
|
||||
if (target != gdk_atom_intern_static_string ("TARGETS"))
|
||||
wl_data_offer_accept (wayland_selection->offer,
|
||||
_gdk_wayland_display_get_serial (GDK_WAYLAND_DISPLAY (display)),
|
||||
gdk_atom_name (target));
|
||||
|
||||
buffer_data = g_hash_table_lookup (wayland_selection->selection_buffers,
|
||||
target);
|
||||
@@ -950,11 +959,11 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
|
||||
gint
|
||||
_gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
GPtrArray *array;
|
||||
const gchar *ptr;
|
||||
@@ -991,7 +1000,7 @@ _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
|
||||
gchar *
|
||||
_gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
|
||||
const gchar *str)
|
||||
const gchar *str)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -1029,7 +1038,8 @@ gdk_wayland_selection_add_targets (GdkWindow *window,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_selection_clear_targets (GdkDisplay *display, GdkAtom selection)
|
||||
gdk_wayland_selection_clear_targets (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
gdk_wayland_selection_unset_data_source (display, selection);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_WAYLAND_H__
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_WAYLAND_SELECTION_H__
|
||||
|
||||
+162
-126
@@ -37,8 +37,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define WL_SURFACE_HAS_BUFFER_SCALE 3
|
||||
|
||||
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
|
||||
@@ -51,11 +49,13 @@
|
||||
typedef struct _GdkWaylandWindow GdkWaylandWindow;
|
||||
typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass;
|
||||
|
||||
struct _GdkWaylandWindow {
|
||||
struct _GdkWaylandWindow
|
||||
{
|
||||
GdkWindow parent;
|
||||
};
|
||||
|
||||
struct _GdkWaylandWindowClass {
|
||||
struct _GdkWaylandWindowClass
|
||||
{
|
||||
GdkWindowClass parent_class;
|
||||
};
|
||||
|
||||
@@ -107,6 +107,7 @@ struct _GdkWindowImplWayland
|
||||
unsigned int mapped : 1;
|
||||
unsigned int use_custom_surface : 1;
|
||||
unsigned int pending_commit : 1;
|
||||
unsigned int awaiting_frame : 1;
|
||||
GdkWindowTypeHint hint;
|
||||
GdkWindow *transient_for;
|
||||
|
||||
@@ -140,7 +141,8 @@ struct _GdkWindowImplWaylandClass
|
||||
|
||||
static void gdk_wayland_window_configure (GdkWindow *window,
|
||||
int width,
|
||||
int height);
|
||||
int height,
|
||||
int scale);
|
||||
|
||||
GType _gdk_window_impl_wayland_get_type (void);
|
||||
|
||||
@@ -162,7 +164,8 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
|
||||
static void
|
||||
gdk_wayland_window_update_size (GdkWindow *window,
|
||||
int32_t width,
|
||||
int32_t height)
|
||||
int32_t height,
|
||||
int scale)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkRectangle area;
|
||||
@@ -176,9 +179,16 @@ gdk_wayland_window_update_size (GdkWindow *window,
|
||||
|
||||
window->width = width;
|
||||
window->height = height;
|
||||
impl->scale = scale;
|
||||
|
||||
if (impl->egl_window)
|
||||
wl_egl_window_resize (impl->egl_window, width, height, 0, 0);
|
||||
{
|
||||
wl_egl_window_resize (impl->egl_window,
|
||||
width * scale,
|
||||
height * scale,
|
||||
0, 0);
|
||||
wl_surface_set_buffer_scale (impl->surface, scale);
|
||||
}
|
||||
|
||||
area.x = 0;
|
||||
area.y = 0;
|
||||
@@ -195,10 +205,12 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (gdk_screen_get_display (screen));
|
||||
GdkWindow *window;
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
window = _gdk_display_create_window (gdk_screen_get_display (screen));
|
||||
window = _gdk_display_create_window (GDK_DISPLAY (wayland_display));
|
||||
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
|
||||
window->impl_window = window;
|
||||
window->visual = gdk_screen_get_system_visual (screen);
|
||||
@@ -206,16 +218,14 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
impl->wrapper = GDK_WINDOW (window);
|
||||
if (gdk_screen_get_n_monitors(screen) > 0)
|
||||
if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
|
||||
gdk_screen_get_n_monitors (screen) > 0)
|
||||
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
|
||||
else
|
||||
impl->scale = 1;
|
||||
|
||||
/* logical 1x1 fake buffer */
|
||||
impl->cairo_surface =
|
||||
cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
impl->scale,
|
||||
impl->scale);
|
||||
impl->cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
impl->scale,
|
||||
impl->scale);
|
||||
|
||||
cairo_surface_set_device_scale (impl->cairo_surface, impl->scale, impl->scale);
|
||||
|
||||
@@ -305,11 +315,18 @@ frame_callback (void *data,
|
||||
GdkFrameClock *clock = gdk_window_get_frame_clock (window);
|
||||
GdkFrameTimings *timings;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("frame %p", window));
|
||||
|
||||
wl_callback_destroy (callback);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!impl->awaiting_frame)
|
||||
return;
|
||||
|
||||
impl->awaiting_frame = FALSE;
|
||||
_gdk_frame_clock_thaw (clock);
|
||||
|
||||
timings = gdk_frame_clock_get_timings (clock, impl->pending_frame_counter);
|
||||
@@ -383,8 +400,11 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
if (!impl->pending_commit)
|
||||
return;
|
||||
|
||||
g_assert (_gdk_wayland_is_shm_surface (impl->cairo_surface));
|
||||
|
||||
impl->pending_commit = FALSE;
|
||||
impl->pending_frame_counter = gdk_frame_clock_get_frame_counter (clock);
|
||||
impl->awaiting_frame = TRUE;
|
||||
|
||||
callback = wl_surface_frame (impl->surface);
|
||||
wl_callback_add_listener (callback, &frame_listener, window);
|
||||
@@ -405,7 +425,6 @@ window_update_scale (GdkWindow *window)
|
||||
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
/* We can't set the scale on this surface */
|
||||
impl->scale = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -413,18 +432,12 @@ window_update_scale (GdkWindow *window)
|
||||
for (l = impl->outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale =
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen,
|
||||
l->data);
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen, l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
||||
if (scale != impl->scale)
|
||||
{
|
||||
impl->scale = scale;
|
||||
|
||||
/* Notify app that scale changed */
|
||||
gdk_wayland_window_configure (window, window->width, window->height);
|
||||
}
|
||||
/* Notify app that scale changed */
|
||||
gdk_wayland_window_configure (window, window->width, window->height, scale);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -446,6 +459,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWindowImplWayland *impl;
|
||||
GdkFrameClock *frame_clock;
|
||||
const char *title;
|
||||
@@ -454,21 +468,22 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
window->impl = GDK_WINDOW_IMPL (impl);
|
||||
impl->wrapper = GDK_WINDOW (window);
|
||||
|
||||
if (window->width > 65535 ||
|
||||
window->height > 65535)
|
||||
if (window->width > 65535)
|
||||
{
|
||||
g_warning ("Native Windows wider or taller than 65535 pixels are not supported");
|
||||
|
||||
if (window->width > 65535)
|
||||
window->width = 65535;
|
||||
if (window->height > 65535)
|
||||
window->height = 65535;
|
||||
g_warning ("Native Windows wider than 65535 pixels are not supported");
|
||||
window->width = 65535;
|
||||
}
|
||||
if (window->height > 65535)
|
||||
{
|
||||
g_warning ("Native Windows taller than 65535 pixels are not supported");
|
||||
window->height = 65535;
|
||||
}
|
||||
|
||||
g_object_ref (window);
|
||||
|
||||
/* More likely to be right than just assuming 1 */
|
||||
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
|
||||
if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
|
||||
|
||||
impl->title = NULL;
|
||||
|
||||
@@ -514,6 +529,8 @@ gdk_wayland_window_attach_image (GdkWindow *window)
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
g_assert (_gdk_wayland_is_shm_surface (impl->cairo_surface));
|
||||
|
||||
/* Attach this new buffer to the surface */
|
||||
wl_surface_attach (impl->surface,
|
||||
_gdk_wayland_shm_surface_get_wl_buffer (impl->cairo_surface),
|
||||
@@ -531,7 +548,21 @@ static void
|
||||
gdk_wayland_window_ensure_cairo_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
if (!impl->cairo_surface)
|
||||
|
||||
/* If we are drawing using OpenGL then we only need a logical 1x1 surface. */
|
||||
if (impl->egl_window)
|
||||
{
|
||||
if (impl->cairo_surface &&
|
||||
_gdk_wayland_is_shm_surface (impl->cairo_surface))
|
||||
cairo_surface_destroy (impl->cairo_surface);
|
||||
|
||||
impl->cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
impl->scale,
|
||||
impl->scale);
|
||||
cairo_surface_set_device_scale (impl->cairo_surface,
|
||||
impl->scale, impl->scale);
|
||||
}
|
||||
else if (!impl->cairo_surface)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper));
|
||||
|
||||
@@ -573,8 +604,13 @@ static gboolean
|
||||
gdk_window_impl_wayland_begin_paint (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
gdk_wayland_window_ensure_cairo_surface (window);
|
||||
return _gdk_wayland_shm_surface_get_busy (impl->cairo_surface);
|
||||
|
||||
if (_gdk_wayland_is_shm_surface (impl->cairo_surface))
|
||||
return _gdk_wayland_shm_surface_get_busy (impl->cairo_surface);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -592,8 +628,7 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window)
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (window->current_paint.region, i, &rect);
|
||||
wl_surface_damage (impl->surface,
|
||||
rect.x, rect.y, rect.width, rect.height);
|
||||
wl_surface_damage (impl->surface, rect.x, rect.y, rect.width, rect.height);
|
||||
impl->pending_commit = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -619,12 +654,16 @@ gdk_window_impl_wayland_finalize (GObject *object)
|
||||
static void
|
||||
gdk_wayland_window_configure (GdkWindow *window,
|
||||
int width,
|
||||
int height)
|
||||
int height,
|
||||
int scale)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkDisplay *display;
|
||||
GdkEvent *event;
|
||||
|
||||
if (window->width == width && window->height == height)
|
||||
if (window->width == width &&
|
||||
window->height == height &&
|
||||
impl->scale == scale)
|
||||
return;
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
@@ -633,7 +672,7 @@ gdk_wayland_window_configure (GdkWindow *window,
|
||||
event->configure.width = width;
|
||||
event->configure.height = height;
|
||||
|
||||
gdk_wayland_window_update_size (window, width, height);
|
||||
gdk_wayland_window_update_size (window, width, height, scale);
|
||||
_gdk_window_update_size (window);
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
@@ -764,6 +803,9 @@ surface_enter (void *data,
|
||||
GdkWindow *window = GDK_WINDOW (data);
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("surface enter, window %p output %p", window, output));
|
||||
|
||||
impl->outputs = g_slist_prepend (impl->outputs, output);
|
||||
|
||||
window_update_scale (window);
|
||||
@@ -777,6 +819,9 @@ surface_leave (void *data,
|
||||
GdkWindow *window = GDK_WINDOW (data);
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("surface leave, window %p output %p", window, output));
|
||||
|
||||
impl->outputs = g_slist_remove (impl->outputs, output);
|
||||
|
||||
window_update_scale (window);
|
||||
@@ -825,14 +870,10 @@ gdk_wayland_window_create_surface (GdkWindow *window)
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
impl->surface = wl_compositor_create_surface (display_wayland->compositor);
|
||||
wl_surface_set_user_data (impl->surface, window);
|
||||
wl_surface_add_listener (impl->surface, &surface_listener, window);
|
||||
|
||||
gdk_wayland_window_sync_opaque_region (window);
|
||||
gdk_wayland_window_sync_input_region (window);
|
||||
|
||||
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE)
|
||||
gdk_wayland_window_create_subsurface (window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -857,10 +898,10 @@ xdg_surface_configure (void *data,
|
||||
&width,
|
||||
&height);
|
||||
|
||||
gdk_wayland_window_configure (window, width, height);
|
||||
gdk_wayland_window_configure (window, width, height, impl->scale);
|
||||
}
|
||||
|
||||
wl_array_for_each(p, states)
|
||||
wl_array_for_each (p, states)
|
||||
{
|
||||
uint32_t state = *p;
|
||||
switch (state)
|
||||
@@ -882,19 +923,29 @@ xdg_surface_configure (void *data,
|
||||
}
|
||||
}
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("configure, window %p %dx%d,%s%s%s",
|
||||
window, width, height,
|
||||
(new_state & GDK_WINDOW_STATE_FULLSCREEN) ? " fullscreen" : "",
|
||||
(new_state & GDK_WINDOW_STATE_MAXIMIZED) ? " maximized" : "",
|
||||
(new_state & GDK_WINDOW_STATE_FOCUSED) ? " focused" : ""));
|
||||
|
||||
_gdk_set_window_state (window, new_state);
|
||||
gdk_wayland_window_sync_margin (window);
|
||||
xdg_surface_ack_configure (xdg_surface, serial);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_surface_close (void *data,
|
||||
xdg_surface_close (void *data,
|
||||
struct xdg_surface *xdg_surface)
|
||||
{
|
||||
GdkWindow *window = GDK_WINDOW (data);
|
||||
GdkDisplay *display;
|
||||
GdkEvent *event;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("close %p", window));
|
||||
|
||||
event = gdk_event_new (GDK_DELETE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.send_event = TRUE;
|
||||
@@ -920,6 +971,12 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
|
||||
gdk_wayland_window_sync_parent (window);
|
||||
gdk_wayland_window_sync_title (window);
|
||||
gdk_wayland_window_sync_margin (window);
|
||||
|
||||
if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
xdg_surface_set_maximized (impl->xdg_surface);
|
||||
if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
|
||||
xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
|
||||
|
||||
xdg_surface_set_app_id (impl->xdg_surface, gdk_get_program_class ());
|
||||
}
|
||||
|
||||
@@ -929,6 +986,9 @@ xdg_popup_done (void *data,
|
||||
{
|
||||
GdkWindow *window = GDK_WINDOW (data);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("done %p", window));
|
||||
|
||||
gdk_window_hide (window);
|
||||
}
|
||||
|
||||
@@ -992,11 +1052,11 @@ gdk_wayland_window_get_fake_root_coords (GdkWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_create_xdg_popup (GdkWindow *window,
|
||||
GdkWindow *parent,
|
||||
struct wl_seat *seat)
|
||||
gdk_wayland_window_create_xdg_popup (GdkWindow *window,
|
||||
GdkWindow *parent,
|
||||
struct wl_seat *seat)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWindowImplWayland *parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent->impl);
|
||||
GdkDeviceManager *device_manager;
|
||||
@@ -1010,7 +1070,7 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window,
|
||||
if (!parent_impl->surface)
|
||||
return;
|
||||
|
||||
device_manager = gdk_display_get_device_manager (GDK_DISPLAY (display_wayland));
|
||||
device_manager = gdk_display_get_device_manager (GDK_DISPLAY (display));
|
||||
device = GDK_WAYLAND_DEVICE (gdk_device_manager_get_client_pointer (device_manager));
|
||||
|
||||
gdk_wayland_window_get_fake_root_coords (parent, &parent_x, &parent_y);
|
||||
@@ -1024,7 +1084,7 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window,
|
||||
y -= parent_impl->margin_top;
|
||||
}
|
||||
|
||||
impl->xdg_popup = xdg_shell_get_xdg_popup (display_wayland->xdg_shell,
|
||||
impl->xdg_popup = xdg_shell_get_xdg_popup (display->xdg_shell,
|
||||
impl->surface,
|
||||
parent_impl->surface,
|
||||
seat,
|
||||
@@ -1148,6 +1208,9 @@ gdk_wayland_window_show (GdkWindow *window,
|
||||
if (!impl->surface)
|
||||
gdk_wayland_window_create_surface (window);
|
||||
|
||||
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE)
|
||||
gdk_wayland_window_create_subsurface (window);
|
||||
|
||||
gdk_wayland_window_map (window);
|
||||
|
||||
_gdk_make_event (window, GDK_MAP, NULL, FALSE);
|
||||
@@ -1205,6 +1268,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
|
||||
impl->subsurface = NULL;
|
||||
}
|
||||
|
||||
if (impl->awaiting_frame)
|
||||
{
|
||||
impl->awaiting_frame = FALSE;
|
||||
_gdk_frame_clock_thaw (gdk_window_get_frame_clock (window));
|
||||
}
|
||||
|
||||
wl_surface_destroy (impl->surface);
|
||||
impl->surface = NULL;
|
||||
|
||||
@@ -1310,12 +1379,10 @@ gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (with_move)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
/* Each toplevel has in its own "root" coordinate system */
|
||||
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TOPLEVEL)
|
||||
{
|
||||
@@ -1334,7 +1401,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
* just move the window - don't update its size
|
||||
*/
|
||||
if (width > 0 && height > 0)
|
||||
gdk_wayland_window_configure (window, width, height);
|
||||
gdk_wayland_window_configure (window, width, height, impl->scale);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1570,18 +1637,6 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
|
||||
|
||||
impl->geometry_hints = *geometry;
|
||||
impl->geometry_mask = geom_mask;
|
||||
|
||||
/*
|
||||
* GDK_HINT_POS
|
||||
* GDK_HINT_USER_POS
|
||||
* GDK_HINT_USER_SIZE
|
||||
* GDK_HINT_MIN_SIZE
|
||||
* GDK_HINT_MAX_SIZE
|
||||
* GDK_HINT_BASE_SIZE
|
||||
* GDK_HINT_RESIZE_INC
|
||||
* GDK_HINT_ASPECT
|
||||
* GDK_HINT_WIN_GRAVITY
|
||||
*/
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1633,7 +1688,7 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
|
||||
impl->subsurface = NULL;
|
||||
}
|
||||
|
||||
if (parent)
|
||||
if (parent && gdk_window_is_visible (window))
|
||||
gdk_wayland_window_create_subsurface (window);
|
||||
}
|
||||
}
|
||||
@@ -1711,15 +1766,11 @@ gdk_wayland_window_deiconify (GdkWindow *window)
|
||||
static void
|
||||
gdk_wayland_window_stick (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_unstick (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1730,10 +1781,10 @@ gdk_wayland_window_maximize (GdkWindow *window)
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!impl->xdg_surface)
|
||||
return;
|
||||
|
||||
xdg_surface_set_maximized (impl->xdg_surface);
|
||||
if (impl->xdg_surface)
|
||||
xdg_surface_set_maximized (impl->xdg_surface);
|
||||
else
|
||||
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1744,10 +1795,10 @@ gdk_wayland_window_unmaximize (GdkWindow *window)
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!impl->xdg_surface)
|
||||
return;
|
||||
|
||||
xdg_surface_unset_maximized (impl->xdg_surface);
|
||||
if (impl->xdg_surface)
|
||||
xdg_surface_unset_maximized (impl->xdg_surface);
|
||||
else
|
||||
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1758,10 +1809,10 @@ gdk_wayland_window_fullscreen (GdkWindow *window)
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!impl->xdg_surface)
|
||||
return;
|
||||
|
||||
xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
|
||||
if (impl->xdg_surface)
|
||||
xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
|
||||
else
|
||||
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1772,10 +1823,10 @@ gdk_wayland_window_unfullscreen (GdkWindow *window)
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!impl->xdg_surface)
|
||||
return;
|
||||
|
||||
xdg_surface_unset_fullscreen (impl->xdg_surface);
|
||||
if (impl->xdg_surface)
|
||||
xdg_surface_unset_fullscreen (impl->xdg_surface);
|
||||
else
|
||||
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1791,10 +1842,6 @@ gdk_wayland_window_set_keep_below (GdkWindow *window, gboolean setting)
|
||||
static GdkWindow *
|
||||
gdk_wayland_window_get_group (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL (window))
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1802,9 +1849,6 @@ static void
|
||||
gdk_wayland_window_set_group (GdkWindow *window,
|
||||
GdkWindow *leader)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
|
||||
g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2072,7 +2116,7 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window,
|
||||
(impl->margin_left + impl->margin_right) + (left + right);
|
||||
new_height = window->height -
|
||||
(impl->margin_top + impl->margin_bottom) + (top + bottom);
|
||||
gdk_wayland_window_configure (window, new_width, new_height);
|
||||
gdk_wayland_window_configure (window, new_width, new_height, impl->scale);
|
||||
|
||||
impl->margin_left = left;
|
||||
impl->margin_right = right;
|
||||
@@ -2224,10 +2268,10 @@ _gdk_wayland_window_set_device_grabbed (GdkWindow *window,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_window_get_wl_surface
|
||||
* gdk_wayland_window_get_wl_surface:
|
||||
* @window: (type GdkWaylandWindow): a #GdkWindow
|
||||
*
|
||||
* Returns the Wayland surface of a #GdkWindow
|
||||
* Returns the Wayland surface of a #GdkWindow.
|
||||
*
|
||||
* Returns: (transfer none): a Wayland wl_surface
|
||||
*
|
||||
@@ -2236,30 +2280,23 @@ _gdk_wayland_window_set_device_grabbed (GdkWindow *window,
|
||||
struct wl_surface *
|
||||
gdk_wayland_window_get_wl_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
return impl->surface;
|
||||
return GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface;
|
||||
}
|
||||
|
||||
static struct wl_egl_window *
|
||||
gdk_wayland_window_get_wl_egl_window (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (impl->egl_window == NULL)
|
||||
{
|
||||
impl->egl_window =
|
||||
wl_egl_window_create(impl->surface,
|
||||
impl->wrapper->width,
|
||||
impl->wrapper->height);
|
||||
wl_egl_window_create (impl->surface,
|
||||
impl->wrapper->width * impl->scale,
|
||||
impl->wrapper->height * impl->scale);
|
||||
wl_surface_set_buffer_scale (impl->surface, impl->scale);
|
||||
}
|
||||
|
||||
return impl->egl_window;
|
||||
@@ -2267,9 +2304,9 @@ gdk_wayland_window_get_wl_egl_window (GdkWindow *window)
|
||||
|
||||
EGLSurface
|
||||
gdk_wayland_window_get_egl_surface (GdkWindow *window,
|
||||
EGLConfig config)
|
||||
EGLConfig config)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindowImplWayland *impl;
|
||||
struct wl_egl_window *egl_window;
|
||||
|
||||
@@ -2282,8 +2319,7 @@ gdk_wayland_window_get_egl_surface (GdkWindow *window,
|
||||
egl_window = gdk_wayland_window_get_wl_egl_window (window);
|
||||
|
||||
impl->egl_surface =
|
||||
eglCreateWindowSurface (display_wayland->egl_display,
|
||||
config, egl_window, NULL);
|
||||
eglCreateWindowSurface (display->egl_display, config, egl_window, NULL);
|
||||
}
|
||||
|
||||
return impl->egl_surface;
|
||||
@@ -2291,9 +2327,9 @@ gdk_wayland_window_get_egl_surface (GdkWindow *window,
|
||||
|
||||
EGLSurface
|
||||
gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
|
||||
EGLConfig config)
|
||||
EGLConfig config)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
|
||||
@@ -2306,8 +2342,7 @@ gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
|
||||
wl_egl_window_create (impl->surface, 1, 1);
|
||||
|
||||
impl->dummy_egl_surface =
|
||||
eglCreateWindowSurface (display_wayland->egl_display,
|
||||
config, impl->dummy_egl_window, NULL);
|
||||
eglCreateWindowSurface (display->egl_display, config, impl->dummy_egl_window, NULL);
|
||||
}
|
||||
|
||||
return impl->dummy_egl_surface;
|
||||
@@ -2382,7 +2417,7 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window,
|
||||
const char *application_object_path,
|
||||
const char *unique_bus_name)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
|
||||
@@ -2393,10 +2428,11 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window,
|
||||
{
|
||||
if (impl->xdg_surface == NULL)
|
||||
return;
|
||||
if (display_wayland->gtk_shell == NULL)
|
||||
|
||||
if (display->gtk_shell == NULL)
|
||||
return;
|
||||
|
||||
impl->gtk_surface = gtk_shell_get_gtk_surface (display_wayland->gtk_shell, impl->surface);
|
||||
impl->gtk_surface = gtk_shell_get_gtk_surface (display->gtk_shell, impl->surface);
|
||||
}
|
||||
|
||||
gtk_surface_set_dbus_properties (impl->gtk_surface,
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
<protocol name="gtk">
|
||||
|
||||
<interface name="gtk_shell" version="1">
|
||||
<description summary="gtk specific extensions">
|
||||
gtk_shell is a protocol extension providing additional features for
|
||||
clients implementing it. It is not backward compatible, and a client must
|
||||
always only bind to the specific version it implements. If a client binds
|
||||
to a version different from the version the server provides, an error will
|
||||
be raised.
|
||||
</description>
|
||||
|
||||
<enum name="capability">
|
||||
<entry name="global_app_menu" value="1"/>
|
||||
<entry name="global_menu_bar" value="2"/>
|
||||
<entry name="desktop_icons" value="3"/>
|
||||
</enum>
|
||||
|
||||
|
||||
<event name="capabilities">
|
||||
<arg name="capabilities" type="uint"/>
|
||||
</event>
|
||||
|
||||
@@ -355,7 +355,12 @@ inner_clipboard_window_procedure (HWND hwnd,
|
||||
GdkWindow *owner;
|
||||
|
||||
success = OpenClipboard (hwnd);
|
||||
g_return_val_if_fail (success, 0);
|
||||
if (!success)
|
||||
{
|
||||
g_warning ("Failed to OpenClipboard on window handle %p", hwnd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
hwndOwner = GetClipboardOwner ();
|
||||
owner = gdk_win32_window_lookup_for_display (_gdk_display, hwndOwner);
|
||||
if (owner == NULL)
|
||||
|
||||
@@ -116,8 +116,6 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
|
||||
if (context_win32->do_frame_sync)
|
||||
{
|
||||
guint32 end_frame_counter = 0;
|
||||
|
||||
if (context_win32->do_frame_sync)
|
||||
{
|
||||
glFinish ();
|
||||
@@ -156,7 +154,6 @@ _gdk_win32_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
cairo_region_t *update_area)
|
||||
{
|
||||
cairo_rectangle_int_t window_rect;
|
||||
unsigned int buffer_age;
|
||||
gboolean invalidate_all = FALSE;
|
||||
GdkWin32GLContext *context_win32;
|
||||
cairo_rectangle_int_t whole_window = { 0, 0, gdk_window_get_width (window), gdk_window_get_height (window) };
|
||||
@@ -231,7 +228,6 @@ static void
|
||||
_get_dummy_window_hwnd (GdkWGLDummy *dummy)
|
||||
{
|
||||
WNDCLASSEX dummy_wc;
|
||||
HWND dummy_hwnd;
|
||||
|
||||
memset (&dummy_wc, 0, sizeof (WNDCLASSEX));
|
||||
|
||||
@@ -270,10 +266,7 @@ _get_wgl_pfd (HDC hdc,
|
||||
const gboolean need_alpha_bits,
|
||||
PIXELFORMATDESCRIPTOR *pfd)
|
||||
{
|
||||
gint configs;
|
||||
gint i;
|
||||
gint best_pf = 0;
|
||||
gboolean alpha_check;
|
||||
|
||||
pfd->nSize = sizeof (PIXELFORMATDESCRIPTOR);
|
||||
pfd->nVersion = 1;
|
||||
@@ -338,8 +331,6 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
const gboolean need_alpha_bits)
|
||||
{
|
||||
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
|
||||
gint glMajMinVersion;
|
||||
GdkWindowImplWin32 *impl;
|
||||
gint best_idx = 0;
|
||||
GdkWGLDummy dummy;
|
||||
|
||||
@@ -485,7 +476,7 @@ _gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("Creating core WGL context (version:%d.%d, debug:%s, forward:%s)\n",
|
||||
major, minor,
|
||||
glver_major, glver_minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
compat_bit ? "yes" : "no"));
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ struct _GdkX11DeviceXI2
|
||||
|
||||
gint device_id;
|
||||
GArray *scroll_valuators;
|
||||
gdouble *last_axes;
|
||||
};
|
||||
|
||||
struct _GdkX11DeviceXI2Class
|
||||
@@ -157,6 +158,7 @@ gdk_x11_device_xi2_finalize (GObject *object)
|
||||
GdkX11DeviceXI2 *device = GDK_X11_DEVICE_XI2 (object);
|
||||
|
||||
g_array_free (device->scroll_valuators, TRUE);
|
||||
g_free (device->last_axes);
|
||||
|
||||
G_OBJECT_CLASS (gdk_x11_device_xi2_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -891,3 +893,29 @@ _gdk_x11_device_xi2_get_id (GdkX11DeviceXI2 *device)
|
||||
|
||||
return device->device_id;
|
||||
}
|
||||
|
||||
gdouble
|
||||
gdk_x11_device_xi2_get_last_axis_value (GdkX11DeviceXI2 *device,
|
||||
gint n_axis)
|
||||
{
|
||||
if (n_axis >= gdk_device_get_n_axes (GDK_DEVICE (device)))
|
||||
return 0;
|
||||
|
||||
if (!device->last_axes)
|
||||
return 0;
|
||||
|
||||
return device->last_axes[n_axis];
|
||||
}
|
||||
|
||||
void
|
||||
gdk_x11_device_xi2_store_axes (GdkX11DeviceXI2 *device,
|
||||
gdouble *axes,
|
||||
gint n_axes)
|
||||
{
|
||||
g_free (device->last_axes);
|
||||
|
||||
if (axes && n_axes)
|
||||
device->last_axes = g_memdup (axes, sizeof (gdouble) * n_axes);
|
||||
else
|
||||
device->last_axes = NULL;
|
||||
}
|
||||
|
||||
@@ -837,6 +837,7 @@ handle_device_changed (GdkX11DeviceManagerXI2 *device_manager,
|
||||
{
|
||||
_gdk_device_reset_axes (device);
|
||||
_gdk_device_xi2_unset_scroll_valuators ((GdkX11DeviceXI2 *) device);
|
||||
gdk_x11_device_xi2_store_axes (GDK_X11_DEVICE_XI2 (device), NULL, 0);
|
||||
translate_device_classes (display, device, ev->classes, ev->num_classes);
|
||||
|
||||
g_signal_emit_by_name (G_OBJECT (device), "changed");
|
||||
@@ -939,13 +940,16 @@ translate_axes (GdkDevice *device,
|
||||
axes = g_new0 (gdouble, n_axes);
|
||||
vals = valuators->values;
|
||||
|
||||
for (i = 0; i < valuators->mask_len * 8; i++)
|
||||
for (i = 0; i < MIN (valuators->mask_len * 8, n_axes); i++)
|
||||
{
|
||||
GdkAxisUse use;
|
||||
gdouble val;
|
||||
|
||||
if (!XIMaskIsSet (valuators->mask, i))
|
||||
continue;
|
||||
{
|
||||
axes[i] = gdk_x11_device_xi2_get_last_axis_value (GDK_X11_DEVICE_XI2 (device), i);
|
||||
continue;
|
||||
}
|
||||
|
||||
use = gdk_device_get_axis_use (device, i);
|
||||
val = *vals++;
|
||||
@@ -970,6 +974,8 @@ translate_axes (GdkDevice *device,
|
||||
}
|
||||
}
|
||||
|
||||
gdk_x11_device_xi2_store_axes (GDK_X11_DEVICE_XI2 (device), axes, n_axes);
|
||||
|
||||
return axes;
|
||||
}
|
||||
|
||||
|
||||
@@ -1499,8 +1499,10 @@ gdk_x11_keymap_map_virtual_modifiers (GdkKeymap *keymap,
|
||||
int i, j;
|
||||
gboolean retval;
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
if (KEYMAP_USE_XKB (keymap))
|
||||
get_xkb (keymap_x11);
|
||||
#endif
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
|
||||
@@ -247,6 +247,12 @@ gboolean _gdk_x11_device_xi2_get_scroll_delta (GdkX11DeviceXI2 *device,
|
||||
gdouble *delta_ret);
|
||||
void _gdk_device_xi2_reset_scroll_valuators (GdkX11DeviceXI2 *device);
|
||||
|
||||
gdouble gdk_x11_device_xi2_get_last_axis_value (GdkX11DeviceXI2 *device,
|
||||
gint n_axis);
|
||||
|
||||
void gdk_x11_device_xi2_store_axes (GdkX11DeviceXI2 *device,
|
||||
gdouble *axes,
|
||||
gint n_axes);
|
||||
#endif
|
||||
|
||||
void _gdk_x11_event_translate_keyboard_string (GdkEventKey *event);
|
||||
|
||||
+16
-12
@@ -397,9 +397,12 @@ gtk_private_h_sources = \
|
||||
gtkcsskeyframesprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnodeprivate.h \
|
||||
gtkcssnodedeclarationprivate.h \
|
||||
gtkcssnodeutilsprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspathnodeprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
@@ -415,10 +418,12 @@ gtk_private_h_sources = \
|
||||
gtkcssstyleprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransformvalueprivate.h \
|
||||
gtkcsstransientnodeprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcssunsetvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkcsswidgetnodeprivate.h \
|
||||
gtkcustompaperunixdialog.h \
|
||||
gtkdialogprivate.h \
|
||||
gtkentryprivate.h \
|
||||
@@ -500,6 +505,7 @@ gtk_private_h_sources = \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtktextattributesprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextchildprivate.h \
|
||||
@@ -626,9 +632,12 @@ gtk_base_c_sources = \
|
||||
gtkcsskeyframes.c \
|
||||
gtkcsslookup.c \
|
||||
gtkcssmatcher.c \
|
||||
gtkcssnode.c \
|
||||
gtkcssnodedeclaration.c \
|
||||
gtkcssnodeutils.c \
|
||||
gtkcssnumbervalue.c \
|
||||
gtkcssparser.c \
|
||||
gtkcsspathnode.c \
|
||||
gtkcsspositionvalue.c \
|
||||
gtkcssprovider.c \
|
||||
gtkcssrepeatvalue.c \
|
||||
@@ -646,11 +655,13 @@ gtk_base_c_sources = \
|
||||
gtkcssstyleproperty.c \
|
||||
gtkcssstylepropertyimpl.c \
|
||||
gtkcsstransformvalue.c \
|
||||
gtkcsstransientnode.c \
|
||||
gtkcsstransition.c \
|
||||
gtkcsstypedvalue.c \
|
||||
gtkcssunsetvalue.c \
|
||||
gtkcssvalue.c \
|
||||
gtkcsstypes.c \
|
||||
gtkcssvalue.c \
|
||||
gtkcsswidgetnode.c \
|
||||
gtkdialog.c \
|
||||
gtkdrawingarea.c \
|
||||
gtkeditable.c \
|
||||
@@ -1078,12 +1089,6 @@ templates = \
|
||||
ui/gtkstatusbar.ui \
|
||||
ui/gtkvolumebutton.ui
|
||||
|
||||
template_headers = $(templates:.ui=.ui.h)
|
||||
|
||||
%.ui.h: %.ui
|
||||
$(AM_V_GEN) mkdir -p $(dir $@) \
|
||||
&& $(top_builddir)/util/extract-strings$(EXEEXT) $< > $@
|
||||
|
||||
#
|
||||
# rules to generate built sources
|
||||
#
|
||||
@@ -1127,7 +1132,7 @@ gtktypebuiltins.c: $(gtk_public_h_sources) $(a11y_h_sources) $(deprecated_h_sour
|
||||
&& cp xgen-gtbc gtktypebuiltins.c \
|
||||
&& rm -f xgen-gtbc
|
||||
|
||||
gtk.gresource.xml: Makefile.am
|
||||
gtk.gresource.xml: Makefile.am inspector/Makefile.inc
|
||||
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
|
||||
echo "<gresources>" >> $@; \
|
||||
echo " <gresource prefix='/org/gtk/libgtk'>" >> $@; \
|
||||
@@ -1158,10 +1163,10 @@ gtk.gresource.xml: Makefile.am
|
||||
n=`basename $$f`; \
|
||||
echo " <file compressed='true'>ui/$$n</file>" >> $@; \
|
||||
done; \
|
||||
shopt -s nullglob; \
|
||||
for s in 16x16 22x22 24x24 32x32 48x48; do \
|
||||
for c in actions status; do \
|
||||
for f in $(srcdir)/icons/$$s/$$c/*.png; do \
|
||||
test "$$f" = "$(srcdir)/icons/$$s/$$c/*.png" && continue; \
|
||||
n=`basename $$f`; \
|
||||
echo " <file>icons/$$s/$$c/$$n</file>" >> $@; \
|
||||
done; \
|
||||
@@ -1210,7 +1215,7 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
|
||||
gtkresources.h: gtk.gresource.xml
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
|
||||
gtkresources.c: gtk.gresource.xml $(resource_files) $(template_headers)
|
||||
gtkresources.c: gtk.gresource.xml $(resource_files)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
|
||||
|
||||
@@ -1336,7 +1341,7 @@ distclean-local:
|
||||
if HAVE_INTROSPECTION
|
||||
introspection_files = \
|
||||
$(filter-out %private.h gtktextdisplay.h gtktextlayout.h gtkx.h, $(gtkinclude_HEADERS) $(a11yinclude_HEADERS) $(deprecatedinclude_HEADERS)) \
|
||||
$(gtk_base_c_sources) \
|
||||
$(filter-out %win32.c %quartz.c, $(gtk_base_c_sources)) \
|
||||
gtkprintoperation-unix.c \
|
||||
gtktypebuiltins.h \
|
||||
gtktypebuiltins.c
|
||||
@@ -1470,7 +1475,6 @@ EXTRA_DIST += \
|
||||
$(resource_files) \
|
||||
$(theme_sources) \
|
||||
$(gsettings_SCHEMAS) \
|
||||
$(template_headers) \
|
||||
a11y/Makefile.inc \
|
||||
deprecated/Makefile.inc \
|
||||
inspector/Makefile.inc \
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include "gtkmenubuttonaccessible.h"
|
||||
|
||||
|
||||
@@ -84,11 +85,29 @@ gtk_menu_button_accessible_ref_child (AtkObject *obj,
|
||||
return accessible;
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
gtk_menu_button_accessible_get_name (AtkObject *obj)
|
||||
{
|
||||
const gchar *name = NULL;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
||||
if (widget == NULL)
|
||||
return NULL;
|
||||
|
||||
name = ATK_OBJECT_CLASS (gtk_menu_button_accessible_parent_class)->get_name (obj);
|
||||
if (name != NULL)
|
||||
return name;
|
||||
|
||||
return _("Menu");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_button_accessible_class_init (GtkMenuButtonAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->get_name = gtk_menu_button_accessible_get_name;
|
||||
class->initialize = gtk_menu_button_accessible_initialize;
|
||||
class->get_n_children = gtk_menu_button_accessible_get_n_children;
|
||||
class->ref_child = gtk_menu_button_accessible_ref_child;
|
||||
|
||||
@@ -97,11 +97,14 @@ gtk_text_view_accessible_ref_state_set (AtkObject *accessible)
|
||||
AtkStateSet *state_set;
|
||||
GtkWidget *widget;
|
||||
|
||||
state_set = ATK_OBJECT_CLASS (gtk_text_view_accessible_parent_class)->ref_state_set (accessible);
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
||||
if (widget == NULL)
|
||||
return NULL;
|
||||
|
||||
state_set = ATK_OBJECT_CLASS (gtk_text_view_accessible_parent_class)->ref_state_set (accessible);
|
||||
{
|
||||
atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
|
||||
return state_set;
|
||||
}
|
||||
|
||||
if (gtk_text_view_get_editable (GTK_TEXT_VIEW (widget)))
|
||||
atk_state_set_add_state (state_set, ATK_STATE_EDITABLE);
|
||||
|
||||
@@ -90,25 +90,16 @@ gtk_window_accessible_initialize (AtkObject *obj,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (data);
|
||||
const gchar *name;
|
||||
|
||||
ATK_OBJECT_CLASS (gtk_window_accessible_parent_class)->initialize (obj, data);
|
||||
|
||||
g_signal_connect (data, "window-state-event", G_CALLBACK (window_state_event_cb), NULL);
|
||||
_gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_WINDOW);
|
||||
|
||||
name = gtk_widget_get_name (widget);
|
||||
|
||||
if (!g_strcmp0 (name, "gtk-tooltip"))
|
||||
obj->role = ATK_ROLE_TOOL_TIP;
|
||||
else if (gtk_window_get_window_type (GTK_WINDOW (widget)) == GTK_WINDOW_POPUP)
|
||||
if (gtk_window_get_window_type (GTK_WINDOW (widget)) == GTK_WINDOW_POPUP)
|
||||
obj->role = ATK_ROLE_WINDOW;
|
||||
else
|
||||
obj->role = ATK_ROLE_FRAME;
|
||||
|
||||
/* Notify that tooltip is showing */
|
||||
if (obj->role == ATK_ROLE_TOOL_TIP && gtk_widget_get_mapped (widget))
|
||||
atk_object_notify_state_change (obj, ATK_STATE_SHOWING, 1);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
|
||||
@@ -305,18 +305,16 @@ gtk_gradient_resolve (GtkGradient *gradient,
|
||||
cairo_pattern_t *
|
||||
_gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
cairo_pattern_t *pattern;
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail (gradient != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (values), NULL);
|
||||
g_return_val_if_fail (parent_values == NULL || GTK_IS_CSS_STYLE (parent_values), NULL);
|
||||
g_return_val_if_fail (*dependencies == 0, NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
|
||||
|
||||
if (gradient->radius0 == 0 && gradient->radius1 == 0)
|
||||
pattern = cairo_pattern_create_linear (gradient->x0, gradient->y0,
|
||||
@@ -332,21 +330,17 @@ _gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
ColorStop *stop;
|
||||
GtkCssValue *val;
|
||||
GdkRGBA rgba;
|
||||
GtkCssDependencies stop_deps;
|
||||
|
||||
stop = &g_array_index (gradient->stops, ColorStop, i);
|
||||
|
||||
/* if color resolving fails, assume transparency */
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (stop->color),
|
||||
provider,
|
||||
gtk_css_style_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
&stop_deps,
|
||||
gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR),
|
||||
NULL);
|
||||
if (val)
|
||||
{
|
||||
rgba = *_gtk_css_rgba_value_get_rgba (val);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, stop_deps);
|
||||
_gtk_css_value_unref (val);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -25,9 +25,8 @@ G_BEGIN_DECLS
|
||||
|
||||
cairo_pattern_t * _gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style);
|
||||
|
||||
GtkGradient * _gtk_gradient_transition (GtkGradient *start,
|
||||
GtkGradient *end,
|
||||
|
||||
@@ -219,7 +219,7 @@ gtk_misc_get_property (GObject *object,
|
||||
*
|
||||
* Sets the alignment of the widget.
|
||||
*
|
||||
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
|
||||
* Deprecated: 3.14: Use #GtkWidget's alignment (#GtkWidget:halign and #GtkWidget:valign) and margin properties or #GtkLabel's #GtkLabel:xalign and #GtkLabel:yalign properties.
|
||||
*/
|
||||
void
|
||||
gtk_misc_set_alignment (GtkMisc *misc,
|
||||
|
||||
@@ -693,6 +693,24 @@ button_callback (gpointer data)
|
||||
|
||||
static UINT taskbar_created_msg = 0;
|
||||
static GSList *status_icons = NULL;
|
||||
static UINT status_icon_id = 0;
|
||||
|
||||
static GtkStatusIcon *
|
||||
find_status_icon (UINT id)
|
||||
{
|
||||
GSList *rover;
|
||||
|
||||
for (rover = status_icons; rover != NULL; rover = rover->next)
|
||||
{
|
||||
GtkStatusIcon *status_icon = GTK_STATUS_ICON (rover->data);
|
||||
GtkStatusIconPrivate *priv = status_icon->priv;
|
||||
|
||||
if (priv->nid.uID == id)
|
||||
return status_icon;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK
|
||||
wndproc (HWND hwnd,
|
||||
@@ -710,7 +728,7 @@ wndproc (HWND hwnd,
|
||||
GtkStatusIconPrivate *priv = status_icon->priv;
|
||||
|
||||
priv->nid.hWnd = hwnd;
|
||||
priv->nid.uID = GPOINTER_TO_UINT (status_icon);
|
||||
priv->nid.uID = status_icon_id++;
|
||||
priv->nid.uCallbackMessage = WM_GTK_TRAY_NOTIFICATION;
|
||||
priv->nid.uFlags = NIF_MESSAGE;
|
||||
|
||||
@@ -754,7 +772,7 @@ wndproc (HWND hwnd,
|
||||
buttondown0:
|
||||
bc = g_new (ButtonCallbackData, 1);
|
||||
bc->event = (GdkEventButton *) gdk_event_new (GDK_BUTTON_PRESS);
|
||||
bc->status_icon = GTK_STATUS_ICON (wparam);
|
||||
bc->status_icon = find_status_icon (wparam);
|
||||
build_button_event (bc->status_icon->priv, bc->event, button);
|
||||
g_idle_add (button_callback, bc);
|
||||
break;
|
||||
@@ -780,7 +798,7 @@ wndproc (HWND hwnd,
|
||||
buttonup0:
|
||||
bc = g_new (ButtonCallbackData, 1);
|
||||
bc->event = (GdkEventButton *) gdk_event_new (GDK_BUTTON_RELEASE);
|
||||
bc->status_icon = GTK_STATUS_ICON (wparam);
|
||||
bc->status_icon = find_status_icon (wparam);
|
||||
build_button_event (bc->status_icon->priv, bc->event, button);
|
||||
g_idle_add (button_callback, bc);
|
||||
break;
|
||||
@@ -927,7 +945,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
|
||||
memset (&priv->nid, 0, sizeof (priv->nid));
|
||||
|
||||
priv->nid.hWnd = create_tray_observer ();
|
||||
priv->nid.uID = GPOINTER_TO_UINT (status_icon);
|
||||
priv->nid.uID = status_icon_id++;
|
||||
priv->nid.uCallbackMessage = WM_GTK_TRAY_NOTIFICATION;
|
||||
priv->nid.uFlags = NIF_MESSAGE;
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ typedef char * GtkStock;
|
||||
*
|
||||
* The “Delete” item and icon.
|
||||
*
|
||||
* Deprecated: 3.10: Use the named icon "edit-cut" or the label "_Delete".
|
||||
* Deprecated: 3.10: Use the named icon "edit-delete" or the label "_Delete".
|
||||
*/
|
||||
#define GTK_STOCK_DELETE ((GtkStock)"gtk-delete")
|
||||
|
||||
@@ -824,7 +824,7 @@ typedef char * GtkStock;
|
||||
*
|
||||
* The “Paste” item and icon.
|
||||
*
|
||||
* Deprecated: 3.10: Do not use an icon. Use label "_Paste".
|
||||
* Deprecated: 3.10: Use named icon "edit-paste" or the label "_Paste".
|
||||
*/
|
||||
#define GTK_STOCK_PASTE ((GtkStock)"gtk-paste")
|
||||
|
||||
|
||||
@@ -306,8 +306,6 @@ gtk_symbolic_color_resolve (GtkSymbolicColor *color,
|
||||
v = _gtk_css_color_value_resolve (color->value,
|
||||
GTK_STYLE_PROVIDER_PRIVATE (props),
|
||||
current,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
_gtk_css_value_unref (current);
|
||||
if (v == NULL)
|
||||
|
||||
@@ -207,7 +207,7 @@ _gtk_allocated_bitmask_subtract (GtkBitmask *mask,
|
||||
const GtkBitmask *other)
|
||||
{
|
||||
GtkBitmask other_allocated;
|
||||
guint i;
|
||||
guint i, len;
|
||||
|
||||
g_return_val_if_fail (mask != NULL, NULL);
|
||||
g_return_val_if_fail (other != NULL, NULL);
|
||||
@@ -215,9 +215,10 @@ _gtk_allocated_bitmask_subtract (GtkBitmask *mask,
|
||||
mask = gtk_bitmask_ensure_allocated (mask);
|
||||
ENSURE_ALLOCATED (other, other_allocated);
|
||||
|
||||
for (i = 0; i < other->len; i++)
|
||||
len = MIN (mask->len, other->len);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
mask->data[i] |= ~other->data[i];
|
||||
mask->data[i] &= ~other->data[i];
|
||||
}
|
||||
|
||||
return gtk_allocated_bitmask_shrink (mask);
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "gtkheaderbar.h"
|
||||
#include "gtkdialogprivate.h"
|
||||
#include "gtksearchbar.h"
|
||||
#include "gtksizegroup.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
@@ -80,6 +81,8 @@ struct _GtkAppChooserDialogPrivate {
|
||||
GtkWidget *show_more_button;
|
||||
GtkWidget *software_button;
|
||||
|
||||
GtkSizeGroup *buttons;
|
||||
|
||||
gboolean show_more_clicked;
|
||||
gboolean dismissed;
|
||||
};
|
||||
@@ -460,10 +463,15 @@ software_button_clicked_cb (GtkButton *button,
|
||||
static void
|
||||
ensure_software_button (GtkAppChooserDialog *self)
|
||||
{
|
||||
if (g_find_program_in_path ("gnome-software"))
|
||||
gchar *path;
|
||||
|
||||
path = g_find_program_in_path ("gnome-software");
|
||||
if (path != NULL)
|
||||
gtk_widget_show (self->priv->software_button);
|
||||
else
|
||||
gtk_widget_hide (self->priv->software_button);
|
||||
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -489,6 +497,7 @@ setup_search (GtkAppChooserDialog *self)
|
||||
|
||||
header = gtk_dialog_get_header_bar (GTK_DIALOG (self));
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
gtk_size_group_add_widget (self->priv->buttons, button);
|
||||
|
||||
g_object_bind_property (button, "active",
|
||||
self->priv->search_bar, "search-mode-enabled",
|
||||
@@ -691,6 +700,7 @@ gtk_app_chooser_dialog_class_init (GtkAppChooserDialogClass *klass)
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, inner_box);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, search_bar);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, search_entry);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, buttons);
|
||||
gtk_widget_class_bind_template_callback (widget_class, show_more_button_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, software_button_clicked_cb);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ static inline void
|
||||
_gtk_bitmask_free (GtkBitmask *mask)
|
||||
{
|
||||
if (_gtk_bitmask_is_allocated (mask))
|
||||
return _gtk_allocated_bitmask_free (mask);
|
||||
_gtk_allocated_bitmask_free (mask);
|
||||
}
|
||||
|
||||
static inline char *
|
||||
@@ -55,7 +55,7 @@ static inline void
|
||||
_gtk_bitmask_print (const GtkBitmask *mask,
|
||||
GString *string)
|
||||
{
|
||||
return _gtk_allocated_bitmask_print (mask, string);
|
||||
_gtk_allocated_bitmask_print (mask, string);
|
||||
}
|
||||
|
||||
static inline GtkBitmask *
|
||||
|
||||
+127
-77
@@ -77,6 +77,8 @@
|
||||
|
||||
#include "gtkbox.h"
|
||||
#include "gtkboxprivate.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcssnodeutilsprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkorientable.h"
|
||||
#include "gtkorientableprivate.h"
|
||||
@@ -435,14 +437,12 @@ static gboolean
|
||||
gtk_box_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
GtkAllocation alloc;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_widget_get_allocation (widget, &alloc);
|
||||
|
||||
gtk_render_background (context, cr, 0, 0, alloc.width, alloc.height);
|
||||
gtk_render_frame (context, cr, 0, 0, alloc.width, alloc.height);
|
||||
gtk_css_node_draw (gtk_widget_get_css_node (widget),
|
||||
cr,
|
||||
gtk_widget_get_allocated_width (widget),
|
||||
gtk_widget_get_allocated_height (widget),
|
||||
NULL,
|
||||
widget);
|
||||
|
||||
return GTK_WIDGET_CLASS (gtk_box_parent_class)->draw (widget, cr);
|
||||
}
|
||||
@@ -472,9 +472,13 @@ count_expand_children (GtkBox *box,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
gtk_box_size_allocate_no_center (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (data);
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
GtkBoxChild *child;
|
||||
@@ -484,12 +488,12 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
|
||||
GtkTextDirection direction;
|
||||
GtkAllocation child_allocation;
|
||||
GtkAllocation child_clip;
|
||||
GtkRequestedSize *sizes;
|
||||
gint child_minimum_baseline, child_natural_baseline;
|
||||
gint minimum_above, natural_above;
|
||||
gint minimum_below, natural_below;
|
||||
gboolean have_baseline;
|
||||
gint baseline;
|
||||
|
||||
GtkPackType packing;
|
||||
|
||||
@@ -499,8 +503,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
gint x = 0, y = 0, i;
|
||||
gint child_size;
|
||||
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
*out_clip = *allocation;
|
||||
|
||||
count_expand_children (box, &nvis_children, &nexpand_children);
|
||||
|
||||
@@ -679,7 +682,6 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline == -1 && have_baseline)
|
||||
{
|
||||
gint height = MAX (1, allocation->height);
|
||||
@@ -798,18 +800,21 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
|
||||
|
||||
gtk_widget_get_clip (child->widget, &child_clip);
|
||||
gdk_rectangle_union (out_clip, out_clip, &child_clip);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
_gtk_widget_set_simple_clip (widget, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
gtk_box_size_allocate_with_center (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (data);
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *priv = box->priv;
|
||||
GtkBoxChild *child;
|
||||
@@ -817,14 +822,13 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
gint nvis[2];
|
||||
gint nexp[2];
|
||||
GtkTextDirection direction;
|
||||
GtkAllocation child_allocation;
|
||||
GtkAllocation child_allocation, child_clip;
|
||||
GtkRequestedSize *sizes[2];
|
||||
GtkRequestedSize center_req;
|
||||
gint child_minimum_baseline, child_natural_baseline;
|
||||
gint minimum_above, natural_above;
|
||||
gint minimum_below, natural_below;
|
||||
gboolean have_baseline;
|
||||
gint baseline;
|
||||
gint idx[2];
|
||||
gint center_pos;
|
||||
gint center_size;
|
||||
@@ -838,8 +842,6 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
gint x = 0, y = 0, i;
|
||||
gint child_size;
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
nvis[0] = nvis[1] = 0;
|
||||
nexp[0] = nexp[1] = 0;
|
||||
for (children = priv->children; children; children = children->next)
|
||||
@@ -871,6 +873,8 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
min_size[0] = nat_size[0] = nvis[0] * priv->spacing;
|
||||
min_size[1] = nat_size[1] = nvis[1] * priv->spacing;
|
||||
|
||||
*out_clip = *allocation;
|
||||
|
||||
/* Retrieve desired size for visible children. */
|
||||
idx[0] = idx[1] = 0;
|
||||
for (children = priv->children; children; children = children->next)
|
||||
@@ -1025,7 +1029,6 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline == -1 && have_baseline)
|
||||
{
|
||||
gint height = MAX (1, allocation->height);
|
||||
@@ -1139,6 +1142,8 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
|
||||
gtk_widget_get_clip (child->widget, &child_clip);
|
||||
gdk_rectangle_union (out_clip, out_clip, &child_clip);
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -1170,9 +1175,10 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
child_allocation.y = center_pos;
|
||||
child_allocation.height = center_size;
|
||||
}
|
||||
gtk_widget_size_allocate_with_baseline (priv->center->widget, &child_allocation, baseline);
|
||||
|
||||
_gtk_widget_set_simple_clip (widget, NULL);
|
||||
gtk_widget_size_allocate_with_baseline (priv->center->widget, &child_allocation, baseline);
|
||||
gtk_widget_get_clip (priv->center->widget, &child_clip);
|
||||
gdk_rectangle_union (out_clip, out_clip, &child_clip);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1180,12 +1186,20 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkAllocation clip;
|
||||
|
||||
if (box->priv->center &&
|
||||
gtk_widget_get_visible (box->priv->center->widget))
|
||||
gtk_box_size_allocate_with_center (widget, allocation);
|
||||
else
|
||||
gtk_box_size_allocate_no_center (widget, allocation);
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
gtk_css_node_allocate (gtk_widget_get_css_node (widget),
|
||||
allocation,
|
||||
gtk_widget_get_allocated_baseline (widget),
|
||||
&clip,
|
||||
box->priv->center && gtk_widget_get_visible (box->priv->center->widget)
|
||||
? gtk_box_size_allocate_with_center
|
||||
: gtk_box_size_allocate_no_center,
|
||||
box);
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static GType
|
||||
@@ -1434,17 +1448,25 @@ gtk_box_buildable_init (GtkBuildableIface *iface)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_invalidate_order_foreach (GtkWidget *widget)
|
||||
gtk_box_invalidate_order_foreach (GtkWidget *widget,
|
||||
gpointer prev)
|
||||
{
|
||||
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
|
||||
GtkCssNode **previous = prev;
|
||||
GtkCssNode *cur = gtk_widget_get_css_node (widget);
|
||||
|
||||
if (*previous)
|
||||
gtk_css_node_set_after (cur, *previous);
|
||||
|
||||
*previous = cur;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_invalidate_order (GtkBox *box)
|
||||
{
|
||||
GtkCssNode *previous = NULL;
|
||||
gtk_container_foreach (GTK_CONTAINER (box),
|
||||
(GtkCallback) gtk_box_invalidate_order_foreach,
|
||||
NULL);
|
||||
gtk_box_invalidate_order_foreach,
|
||||
&previous);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1490,8 +1512,8 @@ gtk_box_pack (GtkBox *box,
|
||||
|
||||
gtk_widget_freeze_child_notify (child);
|
||||
|
||||
gtk_box_invalidate_order (box);
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (box));
|
||||
gtk_box_invalidate_order (box);
|
||||
|
||||
g_signal_connect (child, "notify::visible",
|
||||
G_CALLBACK (box_child_visibility_notify_cb), box);
|
||||
@@ -1657,22 +1679,6 @@ gtk_box_get_size (GtkWidget *widget,
|
||||
*natural_baseline = nat_baseline;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
|
||||
gint avail_size,
|
||||
@@ -1956,19 +1962,74 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
|
||||
*natural_size = required_natural;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_size (GtkCssNode *cssnode,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = data;
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *priv = box->priv;
|
||||
|
||||
if (for_size < 0)
|
||||
{
|
||||
gtk_box_get_size (widget, orientation, minimum, natural, minimum_baseline, natural_baseline);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (priv->orientation == orientation)
|
||||
gtk_box_compute_size_for_orientation (box, for_size, minimum, natural);
|
||||
else
|
||||
gtk_box_compute_size_for_opposing_orientation (box, for_size, minimum, natural, minimum_baseline, natural_baseline);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
-1,
|
||||
minimum_size, natural_size,
|
||||
NULL, NULL,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
-1,
|
||||
minimum_size, natural_size,
|
||||
NULL, NULL,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_width_for_height (GtkWidget *widget,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
|
||||
if (private->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
gtk_box_compute_size_for_opposing_orientation (box, height, minimum_width, natural_width, NULL, NULL);
|
||||
else
|
||||
gtk_box_compute_size_for_orientation (box, height, minimum_width, natural_width);
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
height,
|
||||
minimum_width, natural_width,
|
||||
NULL, NULL,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1979,24 +2040,13 @@ gtk_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
|
||||
if (width < 0)
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_height, natural_height, minimum_baseline, natural_baseline);
|
||||
else
|
||||
{
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_box_compute_size_for_opposing_orientation (box, width, minimum_height, natural_height, minimum_baseline, natural_baseline);
|
||||
else
|
||||
{
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = -1;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = -1;
|
||||
gtk_box_compute_size_for_orientation (box, width, minimum_height, natural_height);
|
||||
}
|
||||
}
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
width,
|
||||
minimum_height, natural_height,
|
||||
minimum_baseline, natural_baseline,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -147,6 +147,8 @@ static void gtk_button_state_changed (GtkWidget *widget,
|
||||
GtkStateType previous_state);
|
||||
static void gtk_button_grab_notify (GtkWidget *widget,
|
||||
gboolean was_grabbed);
|
||||
static void gtk_button_do_release (GtkButton *button,
|
||||
gboolean emit_clicked);
|
||||
|
||||
static void gtk_button_actionable_iface_init (GtkActionableInterface *iface);
|
||||
static void gtk_button_activatable_interface_init(GtkActivatableIface *iface);
|
||||
@@ -644,6 +646,14 @@ multipress_gesture_update_cb (GtkGesture *gesture,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
multipress_gesture_cancel_cb (GtkGesture *gesture,
|
||||
GdkEventSequence *sequence,
|
||||
GtkButton *button)
|
||||
{
|
||||
gtk_button_do_release (button, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_init (GtkButton *button)
|
||||
{
|
||||
@@ -683,6 +693,7 @@ gtk_button_init (GtkButton *button)
|
||||
g_signal_connect (priv->gesture, "pressed", G_CALLBACK (multipress_pressed_cb), button);
|
||||
g_signal_connect (priv->gesture, "released", G_CALLBACK (multipress_released_cb), button);
|
||||
g_signal_connect (priv->gesture, "update", G_CALLBACK (multipress_gesture_update_cb), button);
|
||||
g_signal_connect (priv->gesture, "cancel", G_CALLBACK (multipress_gesture_cancel_cb), button);
|
||||
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->gesture), GTK_PHASE_BUBBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ gtk_cell_renderer_pixbuf_init (GtkCellRendererPixbuf *cellpixbuf)
|
||||
priv->icon_helper = _gtk_icon_helper_new ();
|
||||
_gtk_icon_helper_set_force_scale_pixbuf (priv->icon_helper, TRUE);
|
||||
priv->icon_size = GTK_ICON_SIZE_MENU;
|
||||
priv->follow_state = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -237,6 +238,8 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
|
||||
* according to the #GtkCellRendererState.
|
||||
*
|
||||
* Since: 2.8
|
||||
*
|
||||
* Deprecated: 3.16: Cell renderers always follow state.
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FOLLOW_STATE,
|
||||
@@ -244,8 +247,8 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
|
||||
P_("Follow State"),
|
||||
P_("Whether the rendered pixbuf should be "
|
||||
"colorized according to the state"),
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE));
|
||||
TRUE,
|
||||
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
|
||||
|
||||
/**
|
||||
* GtkCellRendererPixbuf:gicon:
|
||||
@@ -516,7 +519,6 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
GdkRectangle draw_rect;
|
||||
gboolean is_expander;
|
||||
gint xpad, ypad;
|
||||
GtkStateFlags state;
|
||||
GtkIconHelper *icon_helper = NULL;
|
||||
|
||||
gtk_cell_renderer_pixbuf_get_size (cell, widget, (GdkRectangle *) cell_area,
|
||||
@@ -537,12 +539,6 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_save (context);
|
||||
|
||||
state = gtk_cell_renderer_get_state (cell, widget, flags);
|
||||
|
||||
if (!priv->follow_state)
|
||||
state &= ~(GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED);
|
||||
|
||||
gtk_style_context_set_state (context, state);
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);
|
||||
|
||||
g_object_get (cell, "is-expander", &is_expander, NULL);
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ gtk_clipboard_finalize (GObject *object)
|
||||
if (clipboard->store_timeout != 0)
|
||||
g_source_remove (clipboard->store_timeout);
|
||||
|
||||
if (clipboard->notify_signal_id != 0)
|
||||
if (clipboard_widget != NULL && clipboard->notify_signal_id != 0)
|
||||
g_signal_handler_disconnect (clipboard_widget, clipboard->notify_signal_id);
|
||||
|
||||
g_free (clipboard->storable_targets);
|
||||
|
||||
+1
-1
@@ -309,7 +309,7 @@ scale_set_type (GtkColorScale *scale,
|
||||
atk_object_set_name (atk_obj, C_("Color channel", "Hue"));
|
||||
else if (type == GTK_COLOR_SCALE_ALPHA)
|
||||
atk_object_set_name (atk_obj, C_("Color channel", "Alpha"));
|
||||
atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (scale)), ATK_ROLE_COLOR_CHOOSER);
|
||||
atk_object_set_role (atk_obj, ATK_ROLE_COLOR_CHOOSER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-12
@@ -1846,19 +1846,8 @@ gtk_container_idle_sizer (GdkFrameClock *clock,
|
||||
*/
|
||||
if (container->priv->restyle_pending)
|
||||
{
|
||||
GtkBitmask *empty;
|
||||
gint64 current_time;
|
||||
|
||||
empty = _gtk_bitmask_new ();
|
||||
current_time = g_get_monotonic_time ();
|
||||
|
||||
container->priv->restyle_pending = FALSE;
|
||||
_gtk_style_context_validate (gtk_widget_get_style_context (GTK_WIDGET (container)),
|
||||
current_time,
|
||||
0,
|
||||
empty);
|
||||
|
||||
_gtk_bitmask_free (empty);
|
||||
gtk_css_node_validate (gtk_widget_get_css_node (GTK_WIDGET (container)));
|
||||
}
|
||||
|
||||
/* we may be invoked with a container_resize_queue of NULL, because
|
||||
|
||||
+22
-16
@@ -63,6 +63,21 @@ gtk_css_animated_style_get_section (GtkCssStyle *style,
|
||||
return gtk_css_style_get_section (animated->style, id);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_animated_style_is_static (GtkCssStyle *style)
|
||||
{
|
||||
GtkCssAnimatedStyle *animated = GTK_CSS_ANIMATED_STYLE (style);
|
||||
GSList *list;
|
||||
|
||||
for (list = animated->animations; list; list = list->next)
|
||||
{
|
||||
if (!_gtk_style_animation_is_static (list->data, animated->current_time))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_animated_style_dispose (GObject *object)
|
||||
{
|
||||
@@ -101,6 +116,7 @@ gtk_css_animated_style_class_init (GtkCssAnimatedStyleClass *klass)
|
||||
|
||||
style_class->get_value = gtk_css_animated_style_get_value;
|
||||
style_class->get_section = gtk_css_animated_style_get_section;
|
||||
style_class->is_static = gtk_css_animated_style_is_static;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -410,6 +426,9 @@ gtk_css_animated_style_new (GtkCssStyle *base_style,
|
||||
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
|
||||
gtk_internal_return_val_if_fail (previous_style == NULL || GTK_IS_CSS_STYLE (previous_style), NULL);
|
||||
|
||||
if (timestamp == 0)
|
||||
return g_object_ref (base_style);
|
||||
|
||||
animations = NULL;
|
||||
|
||||
if (previous_style != NULL)
|
||||
@@ -441,6 +460,9 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (source), NULL);
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (base), NULL);
|
||||
|
||||
if (timestamp == 0)
|
||||
return g_object_ref (source->style);
|
||||
|
||||
animations = NULL;
|
||||
for (l = source->animations; l; l = l->next)
|
||||
{
|
||||
@@ -466,19 +488,3 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
|
||||
|
||||
return GTK_CSS_STYLE (result);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_animated_style_is_static (GtkCssAnimatedStyle *style)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (style), TRUE);
|
||||
|
||||
for (list = style->animations; list; list = list->next)
|
||||
{
|
||||
if (!_gtk_style_animation_is_static (list->data, style->current_time))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,6 @@ void gtk_css_animated_style_set_animated_value(GtkCssAnimated
|
||||
GtkCssValue * gtk_css_animated_style_get_intrinsic_value (GtkCssAnimatedStyle *style,
|
||||
guint id);
|
||||
|
||||
gboolean gtk_css_animated_style_is_static (GtkCssAnimatedStyle *style);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_ANIMATED_STYLE_PRIVATE_H__ */
|
||||
|
||||
@@ -47,20 +47,16 @@ gtk_css_value_array_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
GtkCssValue *i_value;
|
||||
guint i, j;
|
||||
GtkCssDependencies child_deps;
|
||||
|
||||
result = NULL;
|
||||
for (i = 0; i < value->n_values; i++)
|
||||
{
|
||||
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
|
||||
if (result == NULL &&
|
||||
i_value != value->values[i])
|
||||
|
||||
@@ -45,25 +45,20 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
GtkCssDependencies x_deps, y_deps;
|
||||
|
||||
if (value->x == NULL && value->y == NULL)
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
x_deps = y_deps = 0;
|
||||
x = y = NULL;
|
||||
|
||||
if (value->x)
|
||||
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style, &x_deps);
|
||||
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style);
|
||||
|
||||
if (value->y)
|
||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style, &y_deps);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
|
||||
|
||||
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
|
||||
value->y ? y : NULL);
|
||||
|
||||
@@ -46,11 +46,9 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *computed;
|
||||
GtkCssDependencies child_deps;
|
||||
gboolean changed = FALSE;
|
||||
guint i;
|
||||
|
||||
@@ -61,8 +59,7 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
{
|
||||
if (value->values[i])
|
||||
{
|
||||
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
changed |= (computed->values[i] != value->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-36
@@ -124,8 +124,7 @@ gtk_css_value_color_get_fallback (guint property_id,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
NULL);
|
||||
parent_style);
|
||||
default:
|
||||
if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
|
||||
g_warning ("No fallback color defined for property '%s'",
|
||||
@@ -138,20 +137,13 @@ GtkCssValue *
|
||||
_gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies,
|
||||
GSList *cycle_list)
|
||||
{
|
||||
GtkCssDependencies unused;
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
g_return_val_if_fail (provider == NULL || GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
|
||||
|
||||
if (dependencies == NULL)
|
||||
dependencies = &unused;
|
||||
*dependencies = 0;
|
||||
|
||||
switch (color->type)
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
@@ -170,7 +162,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
if (named == NULL)
|
||||
return NULL;
|
||||
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, current_deps, dependencies, &cycle);
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, &cycle);
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
}
|
||||
@@ -182,12 +174,10 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkHSLA hsla;
|
||||
GdkRGBA shade;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, current_deps, dependencies, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
|
||||
|
||||
_gtk_hsla_init_from_rgba (&hsla, _gtk_css_rgba_value_get_rgba (val));
|
||||
_gtk_hsla_shade (&hsla, &hsla, color->sym_col.shade.factor);
|
||||
|
||||
@@ -204,11 +194,10 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkCssValue *val;
|
||||
GdkRGBA alpha;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, current_deps, dependencies, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
|
||||
alpha = *_gtk_css_rgba_value_get_rgba (val);
|
||||
alpha.alpha = CLAMP (alpha.alpha * color->sym_col.alpha.factor, 0, 1);
|
||||
|
||||
@@ -222,21 +211,19 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
{
|
||||
GtkCssValue *val;
|
||||
GdkRGBA color1, color2, res;
|
||||
GtkCssDependencies dep1, dep2;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, current_deps, &dep1, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
color1 = *_gtk_css_rgba_value_get_rgba (val);
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color2, provider, current, current_deps, &dep2, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color2, provider, current, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
color2 = *_gtk_css_rgba_value_get_rgba (val);
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (dep1, dep2);
|
||||
res.red = CLAMP (color1.red + ((color2.red - color1.red) * color->sym_col.mix.factor), 0, 1);
|
||||
res.green = CLAMP (color1.green + ((color2.green - color1.green) * color->sym_col.mix.factor), 0, 1);
|
||||
res.blue = CLAMP (color1.blue + ((color2.blue - color1.blue) * color->sym_col.mix.factor), 0, 1);
|
||||
@@ -262,7 +249,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
if (current)
|
||||
{
|
||||
*dependencies = current_deps;
|
||||
return _gtk_css_value_ref (current);
|
||||
}
|
||||
else
|
||||
@@ -270,8 +256,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
return _gtk_css_color_value_resolve (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR)),
|
||||
provider,
|
||||
NULL,
|
||||
0,
|
||||
dependencies,
|
||||
cycle_list);
|
||||
}
|
||||
break;
|
||||
@@ -301,11 +285,9 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *resolved, *current;
|
||||
GtkCssDependencies current_deps;
|
||||
|
||||
/* The computed value of the ‘currentColor’ keyword is the computed
|
||||
* value of the ‘color’ property. If the ‘currentColor’ keyword is
|
||||
@@ -314,27 +296,18 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
if (property_id == GTK_CSS_PROPERTY_COLOR)
|
||||
{
|
||||
if (parent_style)
|
||||
{
|
||||
current = gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_COLOR);
|
||||
current_deps = GTK_CSS_EQUALS_PARENT;
|
||||
}
|
||||
current = gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_COLOR);
|
||||
else
|
||||
{
|
||||
current = NULL;
|
||||
current_deps = 0;
|
||||
}
|
||||
current = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
current = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR);
|
||||
current_deps = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
}
|
||||
|
||||
resolved = _gtk_css_color_value_resolve (value,
|
||||
provider,
|
||||
current,
|
||||
current_deps,
|
||||
dependencies,
|
||||
NULL);
|
||||
|
||||
if (resolved == NULL)
|
||||
|
||||
@@ -46,8 +46,6 @@ GtkCssValue * _gtk_css_color_value_parse (GtkCssParser *parser)
|
||||
GtkCssValue * _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies,
|
||||
GSList *cycle_list);
|
||||
|
||||
|
||||
|
||||
@@ -41,15 +41,12 @@ gtk_css_value_corner_compute (GtkCssValue *corner,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
GtkCssDependencies x_deps, y_deps;
|
||||
|
||||
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style, &x_deps);
|
||||
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style, &y_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style);
|
||||
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style);
|
||||
if (x == corner->x && y == corner->y)
|
||||
{
|
||||
_gtk_css_value_unref (x);
|
||||
|
||||
@@ -54,8 +54,7 @@ gtk_css_value_ease_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,7 @@ gtk_css_value_engine_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
+74
-9
@@ -42,8 +42,7 @@ gtk_css_value_enum_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
@@ -165,8 +164,7 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
double font_size;
|
||||
|
||||
@@ -197,7 +195,6 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
font_size = _gtk_css_font_size_get_default (provider) * 2;
|
||||
break;
|
||||
case GTK_CSS_FONT_SIZE_SMALLER:
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
|
||||
if (parent_style)
|
||||
font_size = _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
|
||||
else
|
||||
@@ -206,7 +203,6 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
font_size /= 1.2;
|
||||
break;
|
||||
case GTK_CSS_FONT_SIZE_LARGER:
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
|
||||
if (parent_style)
|
||||
font_size = _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
|
||||
else
|
||||
@@ -368,15 +364,81 @@ _gtk_css_font_variant_value_get (const GtkCssValue *value)
|
||||
|
||||
/* PangoWeight */
|
||||
|
||||
#define BOLDER -1
|
||||
#define LIGHTER -2
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_font_weight_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
PangoWeight new_weight;
|
||||
int parent_value;
|
||||
|
||||
if (value->value >= 0)
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
if (parent_style)
|
||||
parent_value = gtk_css_style_get_value (parent_style, property_id)->value;
|
||||
else
|
||||
parent_value = 400;
|
||||
|
||||
if (value->value == BOLDER)
|
||||
{
|
||||
if (parent_value < 400)
|
||||
new_weight = PANGO_WEIGHT_NORMAL;
|
||||
else if (parent_value < 600)
|
||||
new_weight = PANGO_WEIGHT_BOLD;
|
||||
else
|
||||
new_weight = PANGO_WEIGHT_HEAVY;
|
||||
}
|
||||
else if (value->value == LIGHTER)
|
||||
{
|
||||
if (parent_value > 700)
|
||||
new_weight = PANGO_WEIGHT_BOLD;
|
||||
else if (parent_value > 500)
|
||||
new_weight = PANGO_WEIGHT_NORMAL;
|
||||
else
|
||||
new_weight = PANGO_WEIGHT_THIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
new_weight = PANGO_WEIGHT_NORMAL;
|
||||
}
|
||||
|
||||
return _gtk_css_font_weight_value_new (new_weight);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_font_weight_transition (GtkCssValue *start,
|
||||
GtkCssValue *end,
|
||||
guint property_id,
|
||||
double progress)
|
||||
{
|
||||
PangoWeight new_weight;
|
||||
|
||||
if (start->value < 0 || end->value < 0)
|
||||
return NULL;
|
||||
|
||||
new_weight = (start->value + end->value + 50) / 200 * 100;
|
||||
|
||||
return _gtk_css_font_weight_value_new (new_weight);
|
||||
}
|
||||
|
||||
static const GtkCssValueClass GTK_CSS_VALUE_FONT_WEIGHT = {
|
||||
gtk_css_value_enum_free,
|
||||
gtk_css_value_enum_compute,
|
||||
gtk_css_value_font_weight_compute,
|
||||
gtk_css_value_enum_equal,
|
||||
gtk_css_value_enum_transition,
|
||||
gtk_css_value_font_weight_transition,
|
||||
gtk_css_value_enum_print
|
||||
};
|
||||
|
||||
static GtkCssValue font_weight_values[] = {
|
||||
{ >K_CSS_VALUE_FONT_WEIGHT, 1, BOLDER, "bolder" },
|
||||
{ >K_CSS_VALUE_FONT_WEIGHT, 1, LIGHTER, "lighter" },
|
||||
{ >K_CSS_VALUE_FONT_WEIGHT, 1, PANGO_WEIGHT_THIN, "100" },
|
||||
{ >K_CSS_VALUE_FONT_WEIGHT, 1, PANGO_WEIGHT_ULTRALIGHT, "200" },
|
||||
{ >K_CSS_VALUE_FONT_WEIGHT, 1, PANGO_WEIGHT_LIGHT, "300" },
|
||||
@@ -396,7 +458,7 @@ _gtk_css_font_weight_value_new (PangoWeight font_weight)
|
||||
|
||||
w = ((font_weight + 50) / 100) * 100;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (font_weight_values); i++)
|
||||
for (i = 2; i < G_N_ELEMENTS (font_weight_values); i++)
|
||||
{
|
||||
if (font_weight_values[i].value == w)
|
||||
return _gtk_css_value_ref (&font_weight_values[i]);
|
||||
@@ -434,6 +496,9 @@ _gtk_css_font_weight_value_get (const GtkCssValue *value)
|
||||
return value->value;
|
||||
}
|
||||
|
||||
#undef BOLDER
|
||||
#undef LIGHTER
|
||||
|
||||
/* PangoStretch */
|
||||
|
||||
static const GtkCssValueClass GTK_CSS_VALUE_FONT_STRETCH = {
|
||||
|
||||
@@ -74,8 +74,7 @@ gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
GtkIconTheme *icontheme;
|
||||
|
||||
+3
-10
@@ -65,8 +65,7 @@ gtk_css_image_real_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return g_object_ref (image);
|
||||
}
|
||||
@@ -149,23 +148,17 @@ _gtk_css_image_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssDependencies unused;
|
||||
GtkCssImageClass *klass;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
|
||||
|
||||
if (dependencies == NULL)
|
||||
dependencies = &unused;
|
||||
*dependencies = 0;
|
||||
|
||||
klass = GTK_CSS_IMAGE_GET_CLASS (image);
|
||||
|
||||
return klass->compute (image, property_id, provider, style, parent_style, dependencies);
|
||||
return klass->compute (image, property_id, provider, style, parent_style);
|
||||
}
|
||||
|
||||
GtkCssImage *
|
||||
|
||||
@@ -806,8 +806,7 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageBuiltin *result;
|
||||
GtkBorderStyle border_style;
|
||||
@@ -832,9 +831,6 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
|
||||
result->bg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
|
||||
result->border_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
|
||||
|
||||
/* XXX: We also depend on other values, but I guess we cannot express that */
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
|
||||
return GTK_CSS_IMAGE (result);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageGradient *gradient = GTK_CSS_IMAGE_GRADIENT (image);
|
||||
GtkCssImageGradient *copy;
|
||||
@@ -46,7 +45,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
|
||||
|
||||
copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL);
|
||||
copy->gradient = gtk_gradient_ref (gradient->gradient);
|
||||
copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, style, parent_style, dependencies);
|
||||
copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, style, parent_style);
|
||||
|
||||
return GTK_CSS_IMAGE (copy);
|
||||
}
|
||||
|
||||
@@ -129,8 +129,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image);
|
||||
GtkCssImageIconTheme *copy;
|
||||
@@ -149,8 +148,6 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
copy->scale = _gtk_style_provider_private_get_scale (provider);
|
||||
copy->color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
|
||||
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
|
||||
return GTK_CSS_IMAGE (copy);
|
||||
}
|
||||
|
||||
|
||||
@@ -432,8 +432,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
|
||||
GtkCssImageLinear *copy;
|
||||
@@ -442,24 +441,21 @@ gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
|
||||
copy->repeating = linear->repeating;
|
||||
|
||||
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style, dependencies);
|
||||
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style);
|
||||
|
||||
g_array_set_size (copy->stops, linear->stops->len);
|
||||
for (i = 0; i < linear->stops->len; i++)
|
||||
{
|
||||
GtkCssImageLinearColorStop *stop, *scopy;
|
||||
GtkCssDependencies child_deps;
|
||||
|
||||
stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, i);
|
||||
scopy = &g_array_index (copy->stops, GtkCssImageLinearColorStop, i);
|
||||
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,8 +59,7 @@ struct _GtkCssImageClass
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssStyle *parent_style);
|
||||
/* compare two images for equality */
|
||||
gboolean (* equal) (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
@@ -96,8 +95,7 @@ GtkCssImage * _gtk_css_image_compute (GtkCssImage *
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssStyle *parent_style);
|
||||
gboolean _gtk_css_image_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
GtkCssImage * _gtk_css_image_transition (GtkCssImage *start,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user