Compare commits
416 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd8306f340 | |||
| e12b785653 | |||
| fe421e1a7d | |||
| 3bb8419dff | |||
| b5dc516704 | |||
| e34702911b | |||
| 5822782963 | |||
| 02bc5022fa | |||
| b794cdbb0a | |||
| d736d06db8 | |||
| e31fb77c22 | |||
| e8eeb39d98 | |||
| f51c9d4154 | |||
| a0f155e839 | |||
| a4d76439e6 | |||
| 985881ffcc | |||
| b5bcdbc10f | |||
| e00847b0d5 | |||
| 5722f9ab0f | |||
| 86cebc9b43 | |||
| 78638f798b | |||
| 20583c6d98 | |||
| e133c6cb71 | |||
| e187cda5e9 | |||
| d20d7c54d3 | |||
| b7385ffcab | |||
| d406bf96d4 | |||
| 2da7a6d803 | |||
| 65ad492c24 | |||
| 63ddb3f2c7 | |||
| ee91e272a8 | |||
| 7604e2d418 | |||
| 3b0cd0eb8a | |||
| 4884a7c1af | |||
| 321d06117f | |||
| 3ad3a6699a | |||
| e5f0e30843 | |||
| 5a8e2b5995 | |||
| 644070b551 | |||
| 3f54cf9e78 | |||
| a18f018d87 | |||
| 2d10c8844e | |||
| e6daedae0a | |||
| da1a90bcaf | |||
| c1f01eb929 | |||
| 88c63903a5 | |||
| 154ce014a8 | |||
| 4d7c7ec32f | |||
| 7c038b1b33 | |||
| 549ec0d190 | |||
| 823ee6d529 | |||
| b9eb02ebbe | |||
| 4b4ec4472c | |||
| ff66d0d8e5 | |||
| 824776cb02 | |||
| 5f61f40601 | |||
| a5626c489e | |||
| 4f56f53ad7 | |||
| c97f0b660c | |||
| 2969db9993 | |||
| aeb5cb2caa | |||
| 0743cef50d | |||
| 01b75f19a6 | |||
| 532c66df81 | |||
| 793748eadd | |||
| b0317280e7 | |||
| d22a632b54 | |||
| 40915d9a34 | |||
| d7992d0f4e | |||
| fd549e432f | |||
| b07e51bfee | |||
| c0708f23df | |||
| 3be5c09a90 | |||
| 333a5b4307 | |||
| b4195cb408 | |||
| 6c63842e68 | |||
| 12846d821c | |||
| 7bb19b85c2 | |||
| 4531da17e4 | |||
| de9ffc99c2 | |||
| 23907e1d53 | |||
| e9e557a353 | |||
| af71917015 | |||
| babd137e32 | |||
| cdf473ec10 | |||
| 0aa989ae76 | |||
| 2f81a58573 | |||
| 9af5d89f26 | |||
| 868b28b503 | |||
| 03bf85ba07 | |||
| 20f8dd2309 | |||
| b310ba29d0 | |||
| 18db64749f | |||
| 328add40ca | |||
| 922b404091 | |||
| ceb3fecd11 | |||
| f10176e49f | |||
| 9f5e580821 | |||
| bbb7b2987e | |||
| fa0d6127c3 | |||
| bf71b88319 | |||
| 0c6d158373 | |||
| d44edc1f7d | |||
| 676441398a | |||
| b3a66c59ad | |||
| 22eb687264 | |||
| 162614aab4 | |||
| 1d5ba789d5 | |||
| 4e18e5f687 | |||
| 0cf3791c28 | |||
| 145b59b4b1 | |||
| 271adacfad | |||
| 7e917e54a3 | |||
| d12fd1435a | |||
| 5538552ebc | |||
| d9eb667776 | |||
| d13740b2ba | |||
| af8e4ee8e7 | |||
| 568b310eb3 | |||
| 55261f4e3f | |||
| 87cd49371a | |||
| 2e873e3fdc | |||
| 2058ea09a7 | |||
| 46385aff03 | |||
| 2c000c8e61 | |||
| 02f57f9642 | |||
| 3e354a17ef | |||
| 58ca84584a | |||
| d10d34e0ec | |||
| 651f7b4b93 | |||
| 4945b832b2 | |||
| 60969ff951 | |||
| bfad99ad52 | |||
| dee341fc35 | |||
| 9d6811859f | |||
| 8bb3a2001f | |||
| 37149668c0 | |||
| 5a41b74c5c | |||
| 9107074795 | |||
| 89f166b542 | |||
| 88ed04cc37 | |||
| ffc5c214d2 | |||
| 8ede7473de | |||
| e84809c56a | |||
| 2c1839ae5f | |||
| f6e2d0947d | |||
| 516fb89065 | |||
| aa3d30e256 | |||
| ffafe80f5b | |||
| a94f4a4387 | |||
| 00440e32a4 | |||
| 1aa2a7f821 | |||
| b5845514ec | |||
| d4c1b46a9e | |||
| cad8aaadce | |||
| 0fc7c92235 | |||
| eea0cb3a68 | |||
| 8febbcaf6a | |||
| 4118e13596 | |||
| 724a985465 | |||
| 81121ad271 | |||
| cd831b1390 | |||
| 553f516eb7 | |||
| aa1ff574b5 | |||
| 6f9ad538d9 | |||
| fc58ff1e6a | |||
| 14fb4984ce | |||
| 04c85a5b3b | |||
| 17ccbe4843 | |||
| 53e714199a | |||
| 35e36b9fe5 | |||
| 2179580c8e | |||
| 632a84af8c | |||
| 9c57b96f56 | |||
| 7b7027c971 | |||
| 8b1385804e | |||
| d8b99d47ea | |||
| 1d54e4e867 | |||
| 60eff87d08 | |||
| 42d2430498 | |||
| b8c72a0bdb | |||
| deefb64661 | |||
| fe89e710ea | |||
| a240808824 | |||
| 50fdb6a13f | |||
| b6594d1ac9 | |||
| 97dc45f8a5 | |||
| 090f30c559 | |||
| 8bda7442c8 | |||
| e2f89c0c6a | |||
| 6443baadb9 | |||
| 74f4c6f6bd | |||
| 29fbfcb8f5 | |||
| aaedc7b67f | |||
| 95a4b46f8b | |||
| 33f111a47c | |||
| 6ac754cdd1 | |||
| 3ddb104302 | |||
| 2fec112422 | |||
| 40283e7c27 | |||
| 883c871be6 | |||
| ba7141b92e | |||
| 0111b9d507 | |||
| 0048c8baf5 | |||
| 505fefbec7 | |||
| 51da8cb263 | |||
| 83be7e5dbd | |||
| 1223d53a82 | |||
| 7606fcb52e | |||
| b403a1b550 | |||
| c3f46ab5c0 | |||
| 04c5fdaca6 | |||
| dcd54e20d1 | |||
| 1b69f1d7c2 | |||
| 1170ecfd2e | |||
| 56f79fecce | |||
| cfc6462730 | |||
| f785f7177c | |||
| 5377169ef3 | |||
| aed7600425 | |||
| 4f63c1c7ca | |||
| edbc8e4f57 | |||
| 05f2249d08 | |||
| c366b5b8b7 | |||
| ac6d61f6bb | |||
| 8f240275fd | |||
| b8ccda4140 | |||
| 7bdcba189e | |||
| ca17270187 | |||
| c5878e8f6f | |||
| b9ebe8c226 | |||
| 580b5e4a83 | |||
| a8efb784d7 | |||
| ed45a3c2f0 | |||
| 9e4341f730 | |||
| e597f4d6a9 | |||
| d853a8f2f7 | |||
| 8ad8a4febf | |||
| 41ce29767c | |||
| 7511109103 | |||
| 2ff47ed26d | |||
| 662d6787f3 | |||
| 68b7d3e410 | |||
| a360e77a7b | |||
| 31565139ba | |||
| 5d8789680e | |||
| 1a9dfab825 | |||
| bf92f2f7ac | |||
| ad05604b3e | |||
| 7c75611bc2 | |||
| 0cce3520d3 | |||
| 4ba9be5b97 | |||
| 8e17f9c233 | |||
| 40982eabbb | |||
| 751187aa0c | |||
| a737adadf8 | |||
| 82b769ddde | |||
| 8c49cd97a7 | |||
| d63b11e56b | |||
| b65d17dda8 | |||
| 58b6d492b8 | |||
| dcec7a5529 | |||
| 81dfc2776e | |||
| 645309e98b | |||
| ec5c77a552 | |||
| da40ba431d | |||
| 96948576bd | |||
| ccd443796c | |||
| 38ac68790e | |||
| ca4a080c8a | |||
| 281d094b42 | |||
| a33df2d1d6 | |||
| f7c0c7677b | |||
| 6ef76f4a92 | |||
| c8e57d63ec | |||
| 75a5f04352 | |||
| a5d001b2ba | |||
| 0fdc287339 | |||
| 7fbc583b88 | |||
| dd144c2bad | |||
| 86a387f571 | |||
| b5fc484c99 | |||
| bc9060a591 | |||
| ffe50c3b67 | |||
| 3e601691d9 | |||
| b0e764000f | |||
| e7acdec220 | |||
| 9b7640b898 | |||
| 718ceaec45 | |||
| 04f5c8708a | |||
| df45983fcb | |||
| 8e3e3d582f | |||
| 5ac9ba714a | |||
| 58e4fdf911 | |||
| b728cfd3e8 | |||
| 3cdb9c91ca | |||
| d5a2392cc7 | |||
| 44187ca3b5 | |||
| 115c34498e | |||
| 5bbf59b519 | |||
| 4a12717e4d | |||
| 585a1fae4f | |||
| eb537b60f4 | |||
| ece9d2fd92 | |||
| e7a984b337 | |||
| 27c9352df3 | |||
| 969daec353 | |||
| d589566f40 | |||
| 48a8ca8bbe | |||
| 257d961a01 | |||
| 198cf93f0f | |||
| 15be680540 | |||
| 44d49c900d | |||
| 39ff874a11 | |||
| 1a51ea3ea3 | |||
| 7f511f2b33 | |||
| e5ab48ac59 | |||
| 1aa4a196dc | |||
| 102d10016f | |||
| 5f5bf27287 | |||
| d115441a57 | |||
| cbe40f27e1 | |||
| 3bdde54aaf | |||
| 8dbe8c8349 | |||
| b0b6c8ad4b | |||
| 2d01f7786d | |||
| 53317aed55 | |||
| b368c5f10a | |||
| a94b85d375 | |||
| c0b7c3321d | |||
| a2ded8b72a | |||
| 015e3a768f | |||
| a52336bedc | |||
| 1de2e3ce00 | |||
| ea78bcb7c5 | |||
| 234c7fcf28 | |||
| ba81a3a14c | |||
| 71ca53993e | |||
| cddfcf1418 | |||
| cdf5c2af62 | |||
| 6977ea0bd1 | |||
| d9ca1a8636 | |||
| a8d03c9970 | |||
| a820962b2b | |||
| 49abf425a4 | |||
| 872d170fd1 | |||
| 19e55d620f | |||
| 298ba51d31 | |||
| 158784f66b | |||
| 39a9472e3b | |||
| 398ba38cfe | |||
| 1713cbe8d0 | |||
| 050cba6a31 | |||
| da755ada52 | |||
| 94116aec8e | |||
| 7e778aa033 | |||
| d5ac2bd372 | |||
| c10b65519c | |||
| 812c5e7f25 | |||
| 0b171c8490 | |||
| 39fd069a0d | |||
| 555cf516fd | |||
| 3610ef90c3 | |||
| 8b5910f8d7 | |||
| 9573ed467d | |||
| 8243b16ad7 | |||
| fde43d01e5 | |||
| 43c56d70ea | |||
| 122cde9528 | |||
| b7ad432654 | |||
| 331bba1ad6 | |||
| df37446f9b | |||
| 7a7e2ed92b | |||
| 246269faac | |||
| 605a472c99 | |||
| 1ca8098543 | |||
| 7204724c9f | |||
| b5714ea265 | |||
| bd400b0957 | |||
| 826360a214 | |||
| 2ef4b930c7 | |||
| 432f0151eb | |||
| 1f5537c689 | |||
| d8f13c933a | |||
| 917ca6a802 | |||
| d55961adf9 | |||
| 12d6b0fe62 | |||
| 7b0fd635fa | |||
| 8dcbe9e2de | |||
| 987baaba5c | |||
| 45a5151f94 | |||
| b7e3702d32 | |||
| 5d9ab2621d | |||
| a4cde82365 | |||
| c5a8f3cb61 | |||
| 24f9ca92ab | |||
| ddd24761fd | |||
| 2697ac5770 | |||
| 440e9cdfd3 | |||
| 245a08a1a0 | |||
| 1473db7f1e | |||
| 356c3a3b29 | |||
| d51840ccf3 | |||
| 71a82b1e98 | |||
| 0b26605ab0 | |||
| 13b2720308 | |||
| 4e8f724391 | |||
| c00cfda370 | |||
| f900ae4aaa | |||
| 94dbefda1c | |||
| 52bd5f2f1f | |||
| c1a7da05a4 | |||
| 4f7011c931 | |||
| eb40954a8c | |||
| 5407881d09 | |||
| a3dbc65ced |
@@ -1,3 +1,93 @@
|
||||
Overview of Changes in GTK+ 3.5.1
|
||||
=================================
|
||||
|
||||
* Wayland:
|
||||
- Allow the wayland backend to be used without cairo-gl
|
||||
- Expose GdkWaylandDisplayManager for runtime checks
|
||||
|
||||
* Theming:
|
||||
- Optimizations to style invalidation
|
||||
- Support CSS animatable properties
|
||||
|
||||
* Bugs fixed
|
||||
563688 GtkScale (GtkRange) should jump to clicked position
|
||||
668931 Scrolling down via PageDown/PageUp keys impossible ...
|
||||
669989 gtk_grid_attach(): Documentation doesn't mention mu...
|
||||
670373 modules/printing/cups/gtkprintbackendcups.c won't b...
|
||||
672361 Remove cairo-gl dependency from wayland backend
|
||||
672789 gtk_builder_add_objects_from_file() crashes on GtkU...
|
||||
672993 print dialog overrides default cups number-up settings
|
||||
673259 The gdk/gdkkeysyms-update.pl script and the keysym ...
|
||||
673644 Scroll not working in document overview
|
||||
673650 Evince 3.4: adding new annotation is not possible (...
|
||||
674050 Free image->priv->icon_helper in gtk_image_finalize...
|
||||
674102 Defaults to wayland over x11 backend
|
||||
674118 application-window: Desktop file handling improvements
|
||||
674200 ./configure gives wrong error message if -lXext is ...
|
||||
674286 "Delete confirmation" dialog has wrong padding
|
||||
674326 Use localizations of option names and values contai...
|
||||
674468 Add GTK_STYLE_CLASS_DIM_LABEL
|
||||
674577 Non static variable in GtkStyleProviderPrivate
|
||||
674587 treemodelsort: allow iter_previous() to go past the...
|
||||
674806 icontheme: search first in all themes if the reques...
|
||||
674807 spinbutton: port to GtkIconHelper
|
||||
674808 themingengine: render a frame in gtk_render_handle()
|
||||
674809 themingengine: simplify render_extension() default ...
|
||||
674890 Fix the colord support in GtkPrinterCups when the P...
|
||||
646631 GTK should use XDG base dir spec instead of home
|
||||
|
||||
* Translation updates
|
||||
Bulgarian
|
||||
Crimean Tatar
|
||||
Czech
|
||||
Galician
|
||||
German
|
||||
Hebrew
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
Serbian
|
||||
Simplified Chinese
|
||||
Slovenian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.4.1
|
||||
=================================
|
||||
|
||||
* Win32 fixes:
|
||||
- Fix wintab support
|
||||
- Fall back to Raleigh with th eclassic theme
|
||||
|
||||
* OS X fixes:
|
||||
- Fix manual resizing of windows
|
||||
|
||||
* Bugs fixed:
|
||||
672961 Custom theme can crash apps with GtkEntryCompletion
|
||||
587441 Window expands horizontally rather than the text entry growing...
|
||||
672133 conflict between srcdir != builddir and generated enum types
|
||||
672358 Wayland and X11 backends simultaneously enabled is broken
|
||||
672544 Anchored widgets inside GtkTextView are drawn out of place...
|
||||
673090 gtk file-chooser: Autocompletion - Dropdown-list: selection fails
|
||||
673125 windows draw as unfocused/backdrop on window managers that do...
|
||||
673139 URL to mailing lists in README incorrect
|
||||
673200 gactionmuxer: Fix list_actions
|
||||
673328 After clicking empty parts of a toolbar/menubar the next mouse...
|
||||
673440 shouldn't set GDK_SOURCE_TOUCHSCREEN based on the name
|
||||
673441 GtkTreeView should not handle extra mouse buttons
|
||||
673458 GdkEventButton contains wrong buttons in modifier mask...
|
||||
673693 entrycompletion: set_property() should use property setter...
|
||||
673882 application-window: try to use the desktop name in the fallback...
|
||||
Deal more gracefully with a flood of scroll events
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
Czech
|
||||
German
|
||||
Marathi
|
||||
Odia
|
||||
Swedish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.4.0
|
||||
=================================
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ The official web site is:
|
||||
http://www.gtk.org/
|
||||
|
||||
Information about mailing lists can be found at
|
||||
http://www.gtk.org/mailing-lists.html
|
||||
http://www.gtk.org/mailing-lists.php
|
||||
|
||||
|
||||
Installation
|
||||
@@ -72,16 +72,61 @@ and attach the patch to that bug report.
|
||||
Patches should be in unified diff form. (The -up option to GNU diff.)
|
||||
|
||||
|
||||
Release notes for 3.6
|
||||
=====================
|
||||
|
||||
* Now follows the XDG Base Directory specification for user
|
||||
configuration and data files. In detail,
|
||||
* $XDG_CONFIG_HOME/gtk-3.0/custom-papers is the new location
|
||||
for $HOME/.gtk-custom-papers
|
||||
* $XDG_CONFIG_HOME/gtk-3.0/bookmarks is the new location
|
||||
for $HOME/.gtk-bookmarks
|
||||
* $XDG_DATA_HOME/themes is preferred over $HOME/.themes
|
||||
* $XDG_DATA_HOME/icons is preferred over $HOME/.icons.
|
||||
Existing files from the old location will still be read
|
||||
if the new location does not exist.
|
||||
|
||||
* $HOME/.gtk-3.0 is no longer in the default module load path.
|
||||
If you want to load modules from there, add it to the GTK_PATH
|
||||
environment variable.
|
||||
|
||||
Release notes for 3.4
|
||||
=====================
|
||||
|
||||
* Scroll events have been separated from button events, and smooth
|
||||
scrolling has been added with a separate event mask. Widgets now
|
||||
need to have either GDK_SCROLL_MASK or GDK_SMOOTH_SCROLL_MASK in
|
||||
their event mask to receive scroll events.
|
||||
their event mask to receive scroll events. In addition, the
|
||||
GdkScrollDirection enumeration has gained a new member,
|
||||
GDK_SCROLL_SMOOTH, so switch statements will have to be amended
|
||||
to cover this case.
|
||||
|
||||
* GTK+ now uses <Primary> instead of <Control> in keyboard accelerators,
|
||||
for improved cross-platform handling. This should not affect
|
||||
applications, unless they parse or create these accelerator
|
||||
manually.
|
||||
|
||||
* The tacit assumption that the Alt key corresponds to the MOD1
|
||||
modifier under X11 is now a hard requirement.
|
||||
|
||||
* The beagle search backend for the file chooser has been dropped.
|
||||
Tracker is the only supported search backend on Linux now.
|
||||
|
||||
* GtkNotebook has been changed to destroy its action widgets when
|
||||
it gets destroyed itself. If your application is using action
|
||||
widgets in notebooks, you may have to adjust your code to take
|
||||
this into account.
|
||||
|
||||
* GtkApplication no longer uses the gtk mainloop wrappers, so
|
||||
it is no longer possible to use gtk_main_quit() to stop it.
|
||||
|
||||
* The -uninstalled variants of the pkg-config files have been dropped.
|
||||
|
||||
* Excessive dependencies have been culled from Requires: lines
|
||||
in .pc files. Dependent modules may have to declare dependencies
|
||||
that there were getting 'for free' in the past.
|
||||
|
||||
|
||||
Release notes for 3.2
|
||||
=====================
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
@@ -110,7 +110,7 @@
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -132,7 +132,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -157,7 +157,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName).lib</ImportLibrary>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkcursor-win32.c" />
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-virtual.c" />
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-win32.c" />
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-wintab.c" />
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkdevicemanager-win32.c" />
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkcursor-win32.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-virtual.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\gdk\win32\gdkdevice-win32.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
GenerateDebugInformation="true"
|
||||
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName).lib"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
@@ -81,7 +81,7 @@
|
||||
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName).lib"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
</Configuration>
|
||||
@@ -114,7 +114,7 @@
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll"
|
||||
GenerateDebugInformation="true"
|
||||
ModuleDefinitionFile="..\..\..\libgail-util\gailutil.def"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName).lib"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
@@ -149,7 +149,7 @@
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName).lib"
|
||||
ImportLibrary="$(TargetDir)$(ProjectName)-$(GtkApiVersion).lib"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
</Configuration>
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkcursor-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevice-virtual.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevice-win32.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevice-wintab.c" />
|
||||
<File RelativePath="..\..\..\gdk\win32\gdkdevicemanager-win32.c" />
|
||||
|
||||
+60
-74
@@ -9,8 +9,8 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [4])
|
||||
m4_define([gtk_micro_version], [0])
|
||||
m4_define([gtk_minor_version], [5])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -39,12 +39,12 @@ AC_CONFIG_AUX_DIR([build-aux])
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.31.20])
|
||||
m4_define([pango_required_version], [1.29.0])
|
||||
m4_define([atk_required_version], [2.1.5])
|
||||
m4_define([glib_required_version], [2.33.1])
|
||||
m4_define([pango_required_version], [1.30.0])
|
||||
m4_define([atk_required_version], [2.2.0])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.25.2])
|
||||
m4_define([introspection_required_version], [0.10.1])
|
||||
m4_define([gdk_pixbuf_required_version], [2.26.0])
|
||||
m4_define([introspection_required_version], [1.32.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
ATK_REQUIRED_VERSION=atk_required_version
|
||||
@@ -316,13 +316,19 @@ AC_ARG_ENABLE(quartz-relocation,
|
||||
[enable bundle-based relocation functions])],
|
||||
[quartz_relocation=yes])
|
||||
|
||||
AC_ARG_ENABLE(wayland-cairo-gl,
|
||||
AS_HELP_STRING([--enable-wayland-cairo-gl],
|
||||
[enable the use of Cairo GL in the Wayland backend]),
|
||||
[enable_wayland_cairo_gl=yes])
|
||||
|
||||
|
||||
cairo_backends=
|
||||
backend_immodules=
|
||||
have_gio_unix=no
|
||||
GDK_BACKENDS=
|
||||
GDK_EXTRA_LIBS=
|
||||
GDK_EXTRA_CFLAGS=
|
||||
GDK_WINDOWING=
|
||||
GIO_PACKAGE=gio-2.0
|
||||
PANGO_PACKAGES="pango pangocairo"
|
||||
|
||||
if test "$enable_x11_backend" = "yes"; then
|
||||
@@ -332,7 +338,7 @@ if test "$enable_x11_backend" = "yes"; then
|
||||
GDK_BACKENDS="$GDK_BACKENDS x11"
|
||||
# Pull in gio-unix for GDesktopAppInfo usage, see at least
|
||||
# gdkapplaunchcontext-x11.c
|
||||
GIO_PACKAGE=gio-unix-2.0
|
||||
have_gio_unix=yes
|
||||
backend_immodules="$backend_immodules,xim"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_X11"
|
||||
@@ -379,13 +385,22 @@ else
|
||||
fi
|
||||
|
||||
if test "x$enable_wayland_backend" == "xyes"; then
|
||||
# Wayland uses cairo-gl
|
||||
cairo_backends="$cairo_backends cairo-gl"
|
||||
if test "x$enable_wayland_cairo_gl" == "xyes"; then
|
||||
# Wayland can use cairo-gl
|
||||
cairo_backends="$cairo_backends cairo-gl"
|
||||
AC_DEFINE(GDK_WAYLAND_USE_EGL, [1], [Whether to use EGL in Wayland backend])
|
||||
else
|
||||
# For the cairo image backend
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
fi
|
||||
GDK_BACKENDS="$GDK_BACKENDS wayland"
|
||||
GIO_PACKAGE=gio-unix-2.0
|
||||
have_gio_unix=yes
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WAYLAND"
|
||||
WAYLAND_PACKAGES="wayland-client xkbcommon wayland-egl egl"
|
||||
WAYLAND_PACKAGES="wayland-client xkbcommon "
|
||||
if test "x$enable_wayland_cairo_gl" == "xyes"; then
|
||||
WAYLAND_PACKAGES="$WAYLAND_PACKAGES wayland-egl egl"
|
||||
fi
|
||||
AM_CONDITIONAL(USE_WAYLAND, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_WAYLAND, false)
|
||||
@@ -407,7 +422,7 @@ else
|
||||
if test "x$enable_debug" = "xno"; then
|
||||
GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
|
||||
else
|
||||
GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
|
||||
GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -734,26 +749,9 @@ AC_CHECK_FUNCS(mallinfo)
|
||||
AC_CHECK_FUNCS(getresuid)
|
||||
AC_TYPE_UID_T
|
||||
|
||||
# Check for uxtheme.h (for MS-Windows Engine)
|
||||
AC_MSG_CHECKING(for uxtheme.h)
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <uxtheme.h>]])],
|
||||
[gtk_uxtheme_h=yes], [gtk_uxtheme_h=no])
|
||||
if test $gtk_uxtheme_h = yes; then
|
||||
AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
|
||||
fi
|
||||
AC_MSG_RESULT($gtk_uxtheme_h)
|
||||
|
||||
# Check for round()
|
||||
AC_CHECK_LIB(m,round,have_round=yes,have_round=no)
|
||||
if test $have_round = yes; then
|
||||
AC_DEFINE(HAVE_ROUND, 1, [Define to 1 if round() is available])
|
||||
fi
|
||||
|
||||
# Check for rint()
|
||||
AC_CHECK_LIB(m,rint,have_rint=yes,have_rint=no)
|
||||
if test $have_rint = yes; then
|
||||
AC_DEFINE(HAVE_RINT, 1, [Define to 1 if rint() is available])
|
||||
fi
|
||||
# Check for round(), rint(), isnan(), isinf() and nearbyint()
|
||||
AC_CHECK_LIB(m,round,,)
|
||||
AC_CHECK_FUNCS(round rint isnan isinf nearbyint)
|
||||
|
||||
# Checks for gdkspawn
|
||||
AC_CHECK_HEADERS(crt_externs.h)
|
||||
@@ -970,9 +968,9 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
# Xext is optional, the chances a system has *none* of these things is so
|
||||
# small that we just unconditionally require it.
|
||||
AC_CHECK_FUNC(XOpenDisplay, :,
|
||||
AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
|
||||
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
|
||||
AC_CHECK_FUNC(XextFindDisplay, :,
|
||||
AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
|
||||
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
|
||||
|
||||
# Check for xReply
|
||||
|
||||
@@ -1203,6 +1201,15 @@ else
|
||||
AM_CONDITIONAL(USE_X11, false)
|
||||
fi
|
||||
|
||||
# Check for gio-unix
|
||||
if test "$have_gio_unix" = "yes"; then
|
||||
GDK_GIO_PACKAGE=gio-unix-2.0
|
||||
AC_DEFINE([HAVE_GIO_UNIX], [1],
|
||||
[Define if gio-unix is available])
|
||||
else
|
||||
GDK_GIO_PACKAGE=gio-2.0
|
||||
fi
|
||||
|
||||
# Check for Pango flags
|
||||
|
||||
AC_MSG_CHECKING(Pango flags)
|
||||
@@ -1235,13 +1242,14 @@ CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 cairo cairo-gobject"
|
||||
GDK_PRIVATE_PACKAGES="$GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
|
||||
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES $GDK_PRIVATE_PACKAGES` $MATH_LIB"
|
||||
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PACKAGES $GDK_PRIVATE_PACKAGES` $GDK_EXTRA_CFLAGS"
|
||||
PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
|
||||
GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
|
||||
GDK_DEP_CFLAGS="$GDK_DEP_CFLAGS $GDK_EXTRA_CFLAGS"
|
||||
#
|
||||
# If we aren't writing explicit dependencies, then don't put the extra libraries we need
|
||||
# into the pkg-config files
|
||||
@@ -1263,40 +1271,22 @@ AC_SUBST(GDK_DEP_CFLAGS)
|
||||
########################################
|
||||
|
||||
ATK_PACKAGES=atk
|
||||
AC_MSG_CHECKING(ATK flags)
|
||||
if $PKG_CONFIG --exists $ATK_PACKAGES ; then
|
||||
ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
|
||||
ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
|
||||
|
||||
AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
*** Accessibility Toolkit not found. Accessibility Toolkit is required
|
||||
*** to build GTK+.
|
||||
])
|
||||
fi
|
||||
|
||||
if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
|
||||
:
|
||||
else
|
||||
gtk_save_LIBS="$LIBS"
|
||||
LIBS="$ATK_LIBS $LIBS"
|
||||
AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
|
||||
*** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
|
||||
*** to build GTK+]))
|
||||
LIBS="$gtk_save_LIBS"
|
||||
fi
|
||||
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
|
||||
|
||||
GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
|
||||
GTK_PRIVATE_PACKAGES=""
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
if test "$have_gio_unix" = "yes"; then
|
||||
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES gio-unix-2.0"
|
||||
fi
|
||||
GTK_EXTRA_LIBS=
|
||||
|
||||
GTK_EXTRA_CFLAGS=
|
||||
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES $GTK_PRIVATE_PACKAGES` $GTK_EXTRA_LIBS $MATH_LIB"
|
||||
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PACKAGES $GTK_PACKAGES $GTK_PRIVATE_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
|
||||
PKG_CHECK_MODULES(GTK_DEP, $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES $GTK_PRIVATE_PACKAGES)
|
||||
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X $GTK_DEP_LIBS $GTK_EXTRA_LIBS $MATH_LIB"
|
||||
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
|
||||
|
||||
if test x"$os_win32" = xyes; then
|
||||
GTK_EXTRA_CFLAGS="$msnative_struct"
|
||||
@@ -1391,6 +1381,12 @@ else
|
||||
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -lt 2; then
|
||||
AC_MSG_ERROR([CUPS >= 1.2 not found])
|
||||
fi
|
||||
if test $CUPS_API_MAJOR -gt 1 -o \
|
||||
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6; then
|
||||
AC_DEFINE(HAVE_CUPS_API_1_6, 1,
|
||||
[Define to 1 if CUPS 1.6 API is available])
|
||||
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_API_MAJOR)
|
||||
AC_SUBST(CUPS_API_MINOR)
|
||||
@@ -1506,13 +1502,6 @@ fi
|
||||
|
||||
GLIB_GSETTINGS
|
||||
|
||||
#############
|
||||
# Resources #
|
||||
#############
|
||||
|
||||
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
|
||||
AC_SUBST(GLIB_COMPILE_RESOURCES)
|
||||
|
||||
##################################################
|
||||
# GObject introspection
|
||||
##################################################
|
||||
@@ -1752,9 +1741,6 @@ libgail-util/Makefile
|
||||
modules/Makefile
|
||||
modules/engines/Makefile
|
||||
modules/engines/pixbuf/Makefile
|
||||
modules/engines/ms-windows/Makefile
|
||||
modules/engines/ms-windows/Theme/Makefile
|
||||
modules/engines/ms-windows/Theme/gtk-3.0/Makefile
|
||||
modules/input/Makefile
|
||||
modules/printbackends/Makefile
|
||||
modules/printbackends/cups/Makefile
|
||||
|
||||
@@ -427,6 +427,12 @@ on_name_vanished (GDBusConnection *connection,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define APP_EXTENSION ".exe"
|
||||
#else
|
||||
#define APP_EXTENSION
|
||||
#endif
|
||||
|
||||
GtkWidget *
|
||||
do_application (GtkWidget *toplevel)
|
||||
{
|
||||
@@ -445,8 +451,8 @@ do_application (GtkWidget *toplevel)
|
||||
const gchar *command;
|
||||
GError *error = NULL;
|
||||
|
||||
if (g_file_test ("./gtk3-demo-application", G_FILE_TEST_IS_EXECUTABLE))
|
||||
command = "./gtk3-demo-application";
|
||||
if (g_file_test ("./gtk3-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
|
||||
command = "./gtk3-demo-application" APP_EXTENSION;
|
||||
else
|
||||
command = "gtk3-demo-application";
|
||||
|
||||
|
||||
@@ -522,6 +522,7 @@ do_toolpalette (GtkWidget *do_widget)
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (palette_scroller), 6);
|
||||
gtk_widget_set_hexpand (palette_scroller, TRUE);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (palette_scroller), palette);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), palette_scroller);
|
||||
|
||||
@@ -22,7 +22,7 @@ gtk3_widget_factory_LDADD = \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(GTK_DEP_LIBS)
|
||||
|
||||
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
|
||||
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
|
||||
|
||||
EXTRA_DIST += \
|
||||
|
||||
@@ -658,6 +658,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_homogeneous">True</property>
|
||||
<property name="column_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="checkbutton1">
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
@@ -908,6 +909,58 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="sensitive">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
||||
@@ -65,6 +65,10 @@
|
||||
<title>Index of new symbols in 3.4</title>
|
||||
<xi:include href="xml/api-index-3.4.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-6" role="3.6">
|
||||
<title>Index of new symbols in 3.6</title>
|
||||
<xi:include href="xml/api-index-3.6.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -991,6 +991,8 @@ gdk_x11_grab_server
|
||||
gdk_x11_ungrab_server
|
||||
gdk_x11_cursor_get_xcursor
|
||||
gdk_x11_cursor_get_xdisplay
|
||||
gdk_x11_keymap_get_group_for_state
|
||||
gdk_x11_keymap_key_is_modifier
|
||||
gdk_x11_visual_get_xvisual
|
||||
gdk_x11_atom_to_xatom
|
||||
gdk_x11_atom_to_xatom_for_display
|
||||
|
||||
@@ -526,6 +526,7 @@ GtkBuilderConnectFunc
|
||||
GtkBuilderError
|
||||
gtk_builder_new
|
||||
gtk_builder_add_from_file
|
||||
gtk_builder_add_from_resource
|
||||
gtk_builder_add_from_string
|
||||
gtk_builder_add_objects_from_file
|
||||
gtk_builder_add_objects_from_string
|
||||
@@ -5029,7 +5030,6 @@ GtkWidgetClass
|
||||
GtkCallback
|
||||
GtkRequisition
|
||||
GtkAllocation
|
||||
GtkSelectionData
|
||||
GtkWidgetAuxInfo
|
||||
GtkWidgetHelpType
|
||||
gtk_widget_new
|
||||
@@ -5678,6 +5678,7 @@ GTK_STYLE_CLASS_LEFT
|
||||
GTK_STYLE_CLASS_RIGHT
|
||||
GTK_STYLE_CLASS_LINKED
|
||||
GTK_STYLE_CLASS_ARROW
|
||||
GTK_STYLE_CLASS_OSD
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
@@ -5999,6 +6000,7 @@ GtkRcContext
|
||||
<SECTION>
|
||||
<FILE>gtkselection</FILE>
|
||||
<TITLE>Selections</TITLE>
|
||||
GtkSelectionData
|
||||
GtkTargetEntry
|
||||
GtkTargetList
|
||||
GtkTargetPair
|
||||
@@ -7018,6 +7020,7 @@ gtk_application_new
|
||||
gtk_application_add_window
|
||||
gtk_application_remove_window
|
||||
gtk_application_get_windows
|
||||
gtk_application_get_window_by_id
|
||||
|
||||
<SUBSECTION>
|
||||
GtkApplicationInhibitFlags
|
||||
@@ -7051,6 +7054,7 @@ GtkApplicationWindow
|
||||
gtk_application_window_new
|
||||
gtk_application_window_set_show_menubar
|
||||
gtk_application_window_get_show_menubar
|
||||
gtk_application_window_get_id
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkApplicationWindowClass
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
<term><filename>gtk/gtk.h</filename></term>
|
||||
<listitem>for GTK</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>gtk/gtkx.h</filename></term>
|
||||
<listitem>for the X-specfic widgets #GtkSocket and #GtkPlug</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>gtk/gtkunixprint.h</filename></term>
|
||||
<listitem>for low-level, UNIX-specific printing functions</listitem>
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<row><entry>EggSMClient::quit-requested</entry><entry>instead of calling will_quit (FALSE,...) in response to this signal, install an inhibitor</entry></row>
|
||||
<row><entry>EggSMClient::quit</entry><entry>the #GtkApplication::quit signal</entry></row>
|
||||
<row><entry>EggSMClient::quit-cancelled</entry><entry></entry></row>
|
||||
<row><entry>EggSMClient::quit</entry><entry>the #GApplication::shutdown signal</entry></row>
|
||||
<row><entry>EggSMClient::quit-cancelled</entry><entry>-</entry></row>
|
||||
<row><entry>egg_sm_client_will_quit</entry><entry>instead of calling will_quit (FALSE,...), install an inhibitor</entry></row>
|
||||
<row><entry>egg_sm_client_end_session</entry><entry>gtk_application_end_session()</entry></row>
|
||||
<row><entry>egg_sm_client_end_session</entry><entry>-</entry></row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<para>
|
||||
At this point, GtkApplication has no special support for state saving.
|
||||
Applications can use GSettings or GKeyFile and save as much state as
|
||||
they see fit in response to #GtkApplication::quit or whenever they
|
||||
consider appropriate.
|
||||
At this point, GtkApplication has no special support for state saving
|
||||
and restarting. Applications can use GSettings or GKeyFile and save as
|
||||
much state as they see fit in response to #GApplication::shutdown or
|
||||
whenever they consider appropriate.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
@@ -58,8 +58,8 @@ warning that occurs.
|
||||
<para>
|
||||
A list of <link linkend="GTK-Debug-Options">debug options</link>
|
||||
to turn on in addition to those specified in the <envar>GTK_DEBUG</envar>
|
||||
environment variable. This option is only available if GTK+ has been
|
||||
configured with <option>--enable-debug=yes</option>.
|
||||
environment variable. This option is not available if GTK+ has been
|
||||
configured with <option>--enable-debug=no</option>.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@@ -134,7 +134,7 @@ additional environment variables.
|
||||
<title><envar>GTK_DEBUG</envar></title>
|
||||
|
||||
<para>
|
||||
If GTK+ has been configured with <option>--enable-debug=yes</option>,
|
||||
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
|
||||
this variable can be set to a list of debug options, which cause GTK+
|
||||
to print out different types of debugging information.
|
||||
<variablelist>
|
||||
@@ -186,6 +186,14 @@ additional environment variables.
|
||||
<term>builder</term>
|
||||
<listitem><para>GtkBuilder support</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>size-request</term>
|
||||
<listitem><para>Size requests</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>no-css-cache</term>
|
||||
<listitem><para>Bypass caching for CSS style properties.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
The special value <literal>all</literal> can be used to turn on all
|
||||
|
||||
+4
-2
@@ -36,9 +36,9 @@ EXTRA_DIST += \
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" \
|
||||
-DGDK_COMPILATION \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/gdk \
|
||||
-I$(top_srcdir) \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GDK_DEP_CFLAGS)
|
||||
|
||||
@@ -306,7 +306,9 @@ endif
|
||||
lib_LTLIBRARIES = libgdk-3.la
|
||||
|
||||
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
|
||||
EXTRA_DIST += $(gdk_built_sources)
|
||||
EXTRA_DIST += \
|
||||
$(gdk_built_sources) \
|
||||
fallback-c89.c
|
||||
|
||||
install-exec-hook:
|
||||
if DISABLE_EXPLICIT_DEPS
|
||||
|
||||
@@ -40,15 +40,15 @@ static void gdk_broadway_device_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y);
|
||||
static gboolean gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
@@ -140,7 +140,7 @@ gdk_broadway_device_warp (GdkDevice *device,
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
gdk_broadway_device_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
@@ -159,7 +159,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
gint device_root_x, device_root_y;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
|
||||
return FALSE;
|
||||
return;
|
||||
|
||||
display = gdk_device_get_display (device);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
@@ -196,7 +196,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
else
|
||||
*child_window = toplevel; /* No native children */
|
||||
}
|
||||
return TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fallback when unconnected */
|
||||
@@ -229,7 +229,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2011 Chun-wei Fan <fanc999@yahoo.com.tw>
|
||||
*
|
||||
* Author: Chun-wei Fan <fanc999@yahoo.com.tw>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
|
||||
#ifndef HAVE_ISNAN
|
||||
/* it seems of the supported compilers only
|
||||
* MSVC does not have isnan(), but it does
|
||||
* have _isnan() which does the same as isnan()
|
||||
*/
|
||||
static inline gboolean
|
||||
isnan (double x)
|
||||
{
|
||||
return _isnan (x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ISINF
|
||||
/* Unfortunately MSVC does not have finite()
|
||||
* but it does have _finite() which is the same
|
||||
* as finite() except when x is a NaN
|
||||
*/
|
||||
static inline gboolean
|
||||
isinf (double x)
|
||||
{
|
||||
return (!_finite (x) && !_isnan (x));
|
||||
}
|
||||
#endif
|
||||
@@ -561,6 +561,8 @@ gdk_x11_get_xatom_name
|
||||
gdk_x11_get_xatom_name_for_display
|
||||
gdk_x11_grab_server
|
||||
gdk_x11_keymap_get_type
|
||||
gdk_x11_keymap_get_group_for_state
|
||||
gdk_x11_keymap_key_is_modifier
|
||||
gdk_x11_lookup_xdisplay
|
||||
gdk_x11_register_standard_event_type
|
||||
gdk_x11_screen_get_monitor_output
|
||||
|
||||
@@ -1369,6 +1369,29 @@ _gdk_device_add_axis (GdkDevice *device,
|
||||
return pos;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_device_get_axis_info (GdkDevice *device,
|
||||
guint index_,
|
||||
GdkAtom *label_atom,
|
||||
GdkAxisUse *use,
|
||||
gdouble *min_value,
|
||||
gdouble *max_value,
|
||||
gdouble *resolution)
|
||||
{
|
||||
GdkAxisInfo *info;
|
||||
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
g_return_if_fail (index_ < device->axes->len);
|
||||
|
||||
info = &g_array_index (device->axes, GdkAxisInfo, index_);
|
||||
|
||||
*label_atom = info->label;
|
||||
*use = info->use;
|
||||
*min_value = info->min_value;
|
||||
*max_value = info->max_value;
|
||||
*resolution = info->resolution;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_device_set_keys (GdkDevice *device,
|
||||
guint num_keys)
|
||||
|
||||
@@ -121,6 +121,13 @@ guint _gdk_device_add_axis (GdkDevice *device,
|
||||
gdouble min_value,
|
||||
gdouble max_value,
|
||||
gdouble resolution);
|
||||
void _gdk_device_get_axis_info (GdkDevice *device,
|
||||
guint index,
|
||||
GdkAtom *label_atom,
|
||||
GdkAxisUse *use,
|
||||
gdouble *min_value,
|
||||
gdouble *max_value,
|
||||
gdouble *resolution);
|
||||
|
||||
void _gdk_device_set_keys (GdkDevice *device,
|
||||
guint num_keys);
|
||||
|
||||
+3
-4
@@ -970,8 +970,7 @@ switch_to_pointer_grab (GdkDisplay *display,
|
||||
* synthesized when needed.
|
||||
*/
|
||||
if (source_device &&
|
||||
(gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN ||
|
||||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHPAD))
|
||||
(gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN))
|
||||
info->need_touch_press_enter = TRUE;
|
||||
|
||||
pointer_window = NULL;
|
||||
@@ -1603,7 +1602,7 @@ gdk_display_request_selection_notification (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_supports_clipboard_persistence
|
||||
* gdk_display_supports_clipboard_persistence:
|
||||
* @display: a #GdkDisplay
|
||||
*
|
||||
* Returns whether the speicifed display supports clipboard
|
||||
@@ -1624,7 +1623,7 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_store_clipboard
|
||||
* gdk_display_store_clipboard:
|
||||
* @display: a #GdkDisplay
|
||||
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
|
||||
* @time_: a timestamp
|
||||
|
||||
@@ -244,16 +244,16 @@ gdk_display_manager_get (void)
|
||||
manager = g_object_new (gdk_win32_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
if (backend == NULL || strcmp (backend, "wayland") == 0)
|
||||
manager = g_object_new (gdk_wayland_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (backend == NULL || strcmp (backend, "x11") == 0)
|
||||
manager = g_object_new (gdk_x11_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
if (backend == NULL || strcmp (backend, "wayland") == 0)
|
||||
manager = g_object_new (gdk_wayland_display_manager_get_type (), NULL);
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
if (backend == NULL || strcmp (backend, "broadway") == 0)
|
||||
manager = g_object_new (gdk_broadway_display_manager_get_type (), NULL);
|
||||
|
||||
@@ -114,7 +114,6 @@ struct _GdkDisplay
|
||||
GdkDevice *core_pointer; /* Core pointer device */
|
||||
|
||||
guint closed : 1; /* Whether this display has been closed */
|
||||
guint ignore_core_events : 1; /* Don't send core motion and button event */
|
||||
|
||||
GArray *touch_implicit_grabs;
|
||||
GHashTable *device_grabs;
|
||||
|
||||
+6
-6
@@ -170,15 +170,15 @@ _gdk_event_queue_insert_after (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_event_queue_insert_after:
|
||||
* _gdk_event_queue_insert_before:
|
||||
* @display: a #GdkDisplay
|
||||
* @sibling: Append after this event.
|
||||
* @event: Event to append.
|
||||
* @sibling: Append before this event
|
||||
* @event: Event to prepend
|
||||
*
|
||||
* Appends an event before the specified event, or if it isn't in
|
||||
* the queue, onto the tail of the event queue.
|
||||
* Prepends an event before the specified event, or if it isn't in
|
||||
* the queue, onto the head of the event queue.
|
||||
*
|
||||
* Returns: the newly appended list node.
|
||||
* Returns: the newly prepended list node.
|
||||
*
|
||||
* Since: 2.16
|
||||
*/
|
||||
|
||||
+18
-1
@@ -225,8 +225,10 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
|
||||
* @GDK_2BUTTON_PRESS: a mouse button has been double-clicked (clicked twice
|
||||
* within a short period of time). Note that each click also generates a
|
||||
* %GDK_BUTTON_PRESS event.
|
||||
* @GDK_DOUBLE_BUTTON_PRESS: alias for %GDK_2BUTTON_PRESS, added in 3.6.
|
||||
* @GDK_3BUTTON_PRESS: a mouse button has been clicked 3 times in a short period
|
||||
* of time. Note that each click also generates a %GDK_BUTTON_PRESS event.
|
||||
* @GDK_TRIPLE_BUTTON_PRESS: alias for %GDK_3BUTTON_PRESS, added in 3.6.
|
||||
* @GDK_BUTTON_RELEASE: a mouse button has been released.
|
||||
* @GDK_KEY_PRESS: a key has been pressed.
|
||||
* @GDK_KEY_RELEASE: a key has been released.
|
||||
@@ -280,6 +282,13 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
|
||||
* Do not confuse these events with the signals that GTK+ widgets emit.
|
||||
* Although many of these events result in corresponding signals being emitted,
|
||||
* the events are often transformed or filtered along the way.
|
||||
*
|
||||
* In some language bindings, the values %GDK_2BUTTON_PRESS and
|
||||
* %GDK_3BUTTON_PRESS would translate into something syntactically
|
||||
* invalid (eg <literal>Gdk.EventType.2ButtonPress</literal>, where a
|
||||
* symbol is not allowed to start with a number). In that case, the
|
||||
* aliases %GDK_DOUBLE_BUTTON_PRESS and %GDK_TRIPLE_BUTTON_PRESS can
|
||||
* be used instead.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@@ -290,7 +299,9 @@ typedef enum
|
||||
GDK_MOTION_NOTIFY = 3,
|
||||
GDK_BUTTON_PRESS = 4,
|
||||
GDK_2BUTTON_PRESS = 5,
|
||||
GDK_DOUBLE_BUTTON_PRESS = GDK_2BUTTON_PRESS,
|
||||
GDK_3BUTTON_PRESS = 6,
|
||||
GDK_TRIPLE_BUTTON_PRESS = GDK_3BUTTON_PRESS,
|
||||
GDK_BUTTON_RELEASE = 7,
|
||||
GDK_KEY_PRESS = 8,
|
||||
GDK_KEY_RELEASE = 9,
|
||||
@@ -736,7 +747,8 @@ struct _GdkEventTouch
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @direction: the direction to scroll to (one of %GDK_SCROLL_UP,
|
||||
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT and %GDK_SCROLL_RIGHT).
|
||||
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT, %GDK_SCROLL_RIGHT or
|
||||
* %GDK_SCROLL_SMOOTH).
|
||||
* @device: the device where the event originated.
|
||||
* @x_root: the x coordinate of the pointer relative to the root of the
|
||||
* screen.
|
||||
@@ -746,6 +758,11 @@ struct _GdkEventTouch
|
||||
* Generated from button presses for the buttons 4 to 7. Wheel mice are
|
||||
* usually configured to generate button press events for buttons 4 and 5
|
||||
* when the wheel is turned.
|
||||
*
|
||||
* Some GDK backends can also generate 'smooth' scroll events, which
|
||||
* can be recognized by the %GDK_SCROLL_SMOOTH scroll direction. For
|
||||
* these, the scroll deltas can be obtained with
|
||||
* gdk_event_get_scroll_deltas().
|
||||
*/
|
||||
struct _GdkEventScroll
|
||||
{
|
||||
|
||||
+108
-14
@@ -286,6 +286,7 @@
|
||||
#define GDK_dead_U 0xfe89
|
||||
#define GDK_dead_small_schwa 0xfe8a
|
||||
#define GDK_dead_capital_schwa 0xfe8b
|
||||
#define GDK_dead_greek 0xfe8c
|
||||
#define GDK_First_Virtual_Screen 0xfed0
|
||||
#define GDK_Prev_Virtual_Screen 0xfed1
|
||||
#define GDK_Next_Virtual_Screen 0xfed2
|
||||
@@ -332,6 +333,12 @@
|
||||
#define GDK_Pointer_Accelerate 0xfefa
|
||||
#define GDK_Pointer_DfltBtnNext 0xfefb
|
||||
#define GDK_Pointer_DfltBtnPrev 0xfefc
|
||||
#define GDK_ch 0xfea0
|
||||
#define GDK_Ch 0xfea1
|
||||
#define GDK_CH 0xfea2
|
||||
#define GDK_c_h 0xfea3
|
||||
#define GDK_C_h 0xfea4
|
||||
#define GDK_C_H 0xfea5
|
||||
#define GDK_3270_Duplicate 0xfd01
|
||||
#define GDK_3270_FieldMark 0xfd02
|
||||
#define GDK_3270_Right2 0xfd03
|
||||
@@ -611,9 +618,9 @@
|
||||
#define GDK_nacute 0x1f1
|
||||
#define GDK_ncaron 0x1f2
|
||||
#define GDK_odoubleacute 0x1f5
|
||||
#define GDK_udoubleacute 0x1fb
|
||||
#define GDK_rcaron 0x1f8
|
||||
#define GDK_uring 0x1f9
|
||||
#define GDK_udoubleacute 0x1fb
|
||||
#define GDK_tcedilla 0x1fe
|
||||
#define GDK_abovedot 0x1ff
|
||||
#define GDK_Hstroke 0x2a1
|
||||
@@ -674,32 +681,32 @@
|
||||
#define GDK_uogonek 0x3f9
|
||||
#define GDK_utilde 0x3fd
|
||||
#define GDK_umacron 0x3fe
|
||||
#define GDK_Wcircumflex 0x1000174
|
||||
#define GDK_wcircumflex 0x1000175
|
||||
#define GDK_Ycircumflex 0x1000176
|
||||
#define GDK_ycircumflex 0x1000177
|
||||
#define GDK_Babovedot 0x1001e02
|
||||
#define GDK_babovedot 0x1001e03
|
||||
#define GDK_Dabovedot 0x1001e0a
|
||||
#define GDK_Wgrave 0x1001e80
|
||||
#define GDK_Wacute 0x1001e82
|
||||
#define GDK_dabovedot 0x1001e0b
|
||||
#define GDK_Ygrave 0x1001ef2
|
||||
#define GDK_Fabovedot 0x1001e1e
|
||||
#define GDK_fabovedot 0x1001e1f
|
||||
#define GDK_Mabovedot 0x1001e40
|
||||
#define GDK_mabovedot 0x1001e41
|
||||
#define GDK_Pabovedot 0x1001e56
|
||||
#define GDK_wgrave 0x1001e81
|
||||
#define GDK_pabovedot 0x1001e57
|
||||
#define GDK_wacute 0x1001e83
|
||||
#define GDK_Sabovedot 0x1001e60
|
||||
#define GDK_ygrave 0x1001ef3
|
||||
#define GDK_sabovedot 0x1001e61
|
||||
#define GDK_Tabovedot 0x1001e6a
|
||||
#define GDK_tabovedot 0x1001e6b
|
||||
#define GDK_Wgrave 0x1001e80
|
||||
#define GDK_wgrave 0x1001e81
|
||||
#define GDK_Wacute 0x1001e82
|
||||
#define GDK_wacute 0x1001e83
|
||||
#define GDK_Wdiaeresis 0x1001e84
|
||||
#define GDK_wdiaeresis 0x1001e85
|
||||
#define GDK_sabovedot 0x1001e61
|
||||
#define GDK_Wcircumflex 0x1000174
|
||||
#define GDK_Tabovedot 0x1001e6a
|
||||
#define GDK_Ycircumflex 0x1000176
|
||||
#define GDK_wcircumflex 0x1000175
|
||||
#define GDK_tabovedot 0x1001e6b
|
||||
#define GDK_ycircumflex 0x1000177
|
||||
#define GDK_Ygrave 0x1001ef2
|
||||
#define GDK_ygrave 0x1001ef3
|
||||
#define GDK_OE 0x13bc
|
||||
#define GDK_oe 0x13bd
|
||||
#define GDK_Ydiaeresis 0x13be
|
||||
@@ -1194,6 +1201,7 @@
|
||||
#define GDK_leftdoublequotemark 0xad2
|
||||
#define GDK_rightdoublequotemark 0xad3
|
||||
#define GDK_prescription 0xad4
|
||||
#define GDK_permille 0xad5
|
||||
#define GDK_minutes 0xad6
|
||||
#define GDK_seconds 0xad7
|
||||
#define GDK_latincross 0xad9
|
||||
@@ -1627,6 +1635,8 @@
|
||||
#define GDK_obarred 0x1000275
|
||||
#define GDK_SCHWA 0x100018f
|
||||
#define GDK_schwa 0x1000259
|
||||
#define GDK_EZH 0x10001b7
|
||||
#define GDK_ezh 0x1000292
|
||||
#define GDK_Lbelowdot 0x1001e36
|
||||
#define GDK_lbelowdot 0x1001e37
|
||||
#define GDK_Abelowdot 0x1001ea0
|
||||
@@ -2032,6 +2042,86 @@
|
||||
#define GDK_braille_dots_1345678 0x10028fd
|
||||
#define GDK_braille_dots_2345678 0x10028fe
|
||||
#define GDK_braille_dots_12345678 0x10028ff
|
||||
#define GDK_Sinh_ng 0x1000d82
|
||||
#define GDK_Sinh_h2 0x1000d83
|
||||
#define GDK_Sinh_a 0x1000d85
|
||||
#define GDK_Sinh_aa 0x1000d86
|
||||
#define GDK_Sinh_ae 0x1000d87
|
||||
#define GDK_Sinh_aee 0x1000d88
|
||||
#define GDK_Sinh_i 0x1000d89
|
||||
#define GDK_Sinh_ii 0x1000d8a
|
||||
#define GDK_Sinh_u 0x1000d8b
|
||||
#define GDK_Sinh_uu 0x1000d8c
|
||||
#define GDK_Sinh_ri 0x1000d8d
|
||||
#define GDK_Sinh_rii 0x1000d8e
|
||||
#define GDK_Sinh_lu 0x1000d8f
|
||||
#define GDK_Sinh_luu 0x1000d90
|
||||
#define GDK_Sinh_e 0x1000d91
|
||||
#define GDK_Sinh_ee 0x1000d92
|
||||
#define GDK_Sinh_ai 0x1000d93
|
||||
#define GDK_Sinh_o 0x1000d94
|
||||
#define GDK_Sinh_oo 0x1000d95
|
||||
#define GDK_Sinh_au 0x1000d96
|
||||
#define GDK_Sinh_ka 0x1000d9a
|
||||
#define GDK_Sinh_kha 0x1000d9b
|
||||
#define GDK_Sinh_ga 0x1000d9c
|
||||
#define GDK_Sinh_gha 0x1000d9d
|
||||
#define GDK_Sinh_ng2 0x1000d9e
|
||||
#define GDK_Sinh_nga 0x1000d9f
|
||||
#define GDK_Sinh_ca 0x1000da0
|
||||
#define GDK_Sinh_cha 0x1000da1
|
||||
#define GDK_Sinh_ja 0x1000da2
|
||||
#define GDK_Sinh_jha 0x1000da3
|
||||
#define GDK_Sinh_nya 0x1000da4
|
||||
#define GDK_Sinh_jnya 0x1000da5
|
||||
#define GDK_Sinh_nja 0x1000da6
|
||||
#define GDK_Sinh_tta 0x1000da7
|
||||
#define GDK_Sinh_ttha 0x1000da8
|
||||
#define GDK_Sinh_dda 0x1000da9
|
||||
#define GDK_Sinh_ddha 0x1000daa
|
||||
#define GDK_Sinh_nna 0x1000dab
|
||||
#define GDK_Sinh_ndda 0x1000dac
|
||||
#define GDK_Sinh_tha 0x1000dad
|
||||
#define GDK_Sinh_thha 0x1000dae
|
||||
#define GDK_Sinh_dha 0x1000daf
|
||||
#define GDK_Sinh_dhha 0x1000db0
|
||||
#define GDK_Sinh_na 0x1000db1
|
||||
#define GDK_Sinh_ndha 0x1000db3
|
||||
#define GDK_Sinh_pa 0x1000db4
|
||||
#define GDK_Sinh_pha 0x1000db5
|
||||
#define GDK_Sinh_ba 0x1000db6
|
||||
#define GDK_Sinh_bha 0x1000db7
|
||||
#define GDK_Sinh_ma 0x1000db8
|
||||
#define GDK_Sinh_mba 0x1000db9
|
||||
#define GDK_Sinh_ya 0x1000dba
|
||||
#define GDK_Sinh_ra 0x1000dbb
|
||||
#define GDK_Sinh_la 0x1000dbd
|
||||
#define GDK_Sinh_va 0x1000dc0
|
||||
#define GDK_Sinh_sha 0x1000dc1
|
||||
#define GDK_Sinh_ssha 0x1000dc2
|
||||
#define GDK_Sinh_sa 0x1000dc3
|
||||
#define GDK_Sinh_ha 0x1000dc4
|
||||
#define GDK_Sinh_lla 0x1000dc5
|
||||
#define GDK_Sinh_fa 0x1000dc6
|
||||
#define GDK_Sinh_al 0x1000dca
|
||||
#define GDK_Sinh_aa2 0x1000dcf
|
||||
#define GDK_Sinh_ae2 0x1000dd0
|
||||
#define GDK_Sinh_aee2 0x1000dd1
|
||||
#define GDK_Sinh_i2 0x1000dd2
|
||||
#define GDK_Sinh_ii2 0x1000dd3
|
||||
#define GDK_Sinh_u2 0x1000dd4
|
||||
#define GDK_Sinh_uu2 0x1000dd6
|
||||
#define GDK_Sinh_ru2 0x1000dd8
|
||||
#define GDK_Sinh_e2 0x1000dd9
|
||||
#define GDK_Sinh_ee2 0x1000dda
|
||||
#define GDK_Sinh_ai2 0x1000ddb
|
||||
#define GDK_Sinh_o2 0x1000ddc
|
||||
#define GDK_Sinh_oo2 0x1000ddd
|
||||
#define GDK_Sinh_au2 0x1000dde
|
||||
#define GDK_Sinh_lu2 0x1000ddf
|
||||
#define GDK_Sinh_ruu2 0x1000df2
|
||||
#define GDK_Sinh_luu2 0x1000df3
|
||||
#define GDK_Sinh_kunddaliya 0x1000df4
|
||||
#define GDK_ModeLock 0x1008ff01
|
||||
#define GDK_MonBrightnessUp 0x1008ff02
|
||||
#define GDK_MonBrightnessDown 0x1008ff03
|
||||
@@ -2186,6 +2276,8 @@
|
||||
#define GDK_Suspend 0x1008ffa7
|
||||
#define GDK_Hibernate 0x1008ffa8
|
||||
#define GDK_TouchpadToggle 0x1008ffa9
|
||||
#define GDK_TouchpadOn 0x1008ffb0
|
||||
#define GDK_TouchpadOff 0x1008ffb1
|
||||
#define GDK_Switch_VT_1 0x1008fe01
|
||||
#define GDK_Switch_VT_2 0x1008fe02
|
||||
#define GDK_Switch_VT_3 0x1008fe03
|
||||
@@ -2202,5 +2294,7 @@
|
||||
#define GDK_ClearGrab 0x1008fe21
|
||||
#define GDK_Next_VMode 0x1008fe22
|
||||
#define GDK_Prev_VMode 0x1008fe23
|
||||
#define GDK_LogWindowTree 0x1008fe24
|
||||
#define GDK_LogGrabInfo 0x1008fe25
|
||||
|
||||
#endif /* __GDK_KEYSYMS_COMPAT_H__ */
|
||||
|
||||
+18
-18
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# Updates http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x),
|
||||
# from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
|
||||
# Updates http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x),
|
||||
# from http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
|
||||
#
|
||||
# Author : Simos Xenitellis <simos at gnome dot org>.
|
||||
# Authos : Bastien Nocera <hadess@hadess.net>
|
||||
# Version : 1.2
|
||||
#
|
||||
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
|
||||
# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
|
||||
# Output : http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h
|
||||
# Input : http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
|
||||
# Input : http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
|
||||
# Output : http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms.h
|
||||
#
|
||||
# Notes : It downloads keysymdef.h from the Internet, if not found locally,
|
||||
# Notes : and creates an updated gdkkeysyms.h
|
||||
@@ -23,31 +23,31 @@ my @keysymelements;
|
||||
if ( ! -f "keysymdef.h" )
|
||||
{
|
||||
print "Trying to download keysymdef.h from\n";
|
||||
print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h\n";
|
||||
die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h\n"
|
||||
unless system("wget -c -O keysymdef.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h\"") == 0;
|
||||
print "http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\n";
|
||||
die "Unable to download keysymdef.h from http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\n"
|
||||
unless system("wget -c -O keysymdef.h \"http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\"") == 0;
|
||||
print " done.\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "We are using existing keysymdef.h found in this directory.\n";
|
||||
print "It is assumed that you took care and it is a recent version\n";
|
||||
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h\n\n";
|
||||
print "as found at http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h\n\n";
|
||||
}
|
||||
|
||||
if ( ! -f "XF86keysym.h" )
|
||||
{
|
||||
print "Trying to download XF86keysym.h from\n";
|
||||
print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n";
|
||||
die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n"
|
||||
unless system("wget -c -O XF86keysym.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\"") == 0;
|
||||
print "http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\n";
|
||||
die "Unable to download keysymdef.h from http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\n"
|
||||
unless system("wget -c -O XF86keysym.h \"http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\"") == 0;
|
||||
print " done.\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "We are using existing XF86keysym.h found in this directory.\n";
|
||||
print "It is assumed that you took care and it is a recent version\n";
|
||||
print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h\n\n";
|
||||
print "as found at http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h\n\n";
|
||||
}
|
||||
|
||||
if ( -f "gdkkeysyms.h" )
|
||||
@@ -57,7 +57,7 @@ if ( -f "gdkkeysyms.h" )
|
||||
die "Exiting...\n\n";
|
||||
}
|
||||
|
||||
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h
|
||||
# Source: http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
|
||||
die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8", "keysymdef.h");
|
||||
|
||||
# Output: gtk+/gdk/gdkkeysyms.h
|
||||
@@ -93,11 +93,11 @@ print OUT_GDKKEYSYMS_COMPAT $LICENSE_HEADER;
|
||||
print OUT_GDKKEYSYMS<<EOF;
|
||||
|
||||
/*
|
||||
* File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl
|
||||
* File auto-generated from script http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms-update.pl
|
||||
* using the input file
|
||||
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
|
||||
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
|
||||
* and
|
||||
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
|
||||
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -154,7 +154,7 @@ close IN_KEYSYMDEF;
|
||||
|
||||
#$gdksyms{"0"} = "0000";
|
||||
|
||||
# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h
|
||||
# Source: http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
|
||||
die "Could not open file XF86keysym.h: $!\n" unless open(IN_XF86KEYSYM, "<:utf8", "XF86keysym.h");
|
||||
|
||||
while (<IN_XF86KEYSYM>)
|
||||
|
||||
+29
-17
@@ -18,11 +18,11 @@
|
||||
|
||||
|
||||
/*
|
||||
* File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl
|
||||
* File auto-generated from script http://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms-update.pl
|
||||
* using the input file
|
||||
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h
|
||||
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h
|
||||
* and
|
||||
* http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h
|
||||
* http://cgit.freedesktop.org/xorg/proto/x11proto/plain/XF86keysym.h
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -295,6 +295,7 @@
|
||||
#define GDK_KEY_dead_U 0xfe89
|
||||
#define GDK_KEY_dead_small_schwa 0xfe8a
|
||||
#define GDK_KEY_dead_capital_schwa 0xfe8b
|
||||
#define GDK_KEY_dead_greek 0xfe8c
|
||||
#define GDK_KEY_First_Virtual_Screen 0xfed0
|
||||
#define GDK_KEY_Prev_Virtual_Screen 0xfed1
|
||||
#define GDK_KEY_Next_Virtual_Screen 0xfed2
|
||||
@@ -341,6 +342,12 @@
|
||||
#define GDK_KEY_Pointer_Accelerate 0xfefa
|
||||
#define GDK_KEY_Pointer_DfltBtnNext 0xfefb
|
||||
#define GDK_KEY_Pointer_DfltBtnPrev 0xfefc
|
||||
#define GDK_KEY_ch 0xfea0
|
||||
#define GDK_KEY_Ch 0xfea1
|
||||
#define GDK_KEY_CH 0xfea2
|
||||
#define GDK_KEY_c_h 0xfea3
|
||||
#define GDK_KEY_C_h 0xfea4
|
||||
#define GDK_KEY_C_H 0xfea5
|
||||
#define GDK_KEY_3270_Duplicate 0xfd01
|
||||
#define GDK_KEY_3270_FieldMark 0xfd02
|
||||
#define GDK_KEY_3270_Right2 0xfd03
|
||||
@@ -620,9 +627,9 @@
|
||||
#define GDK_KEY_nacute 0x1f1
|
||||
#define GDK_KEY_ncaron 0x1f2
|
||||
#define GDK_KEY_odoubleacute 0x1f5
|
||||
#define GDK_KEY_udoubleacute 0x1fb
|
||||
#define GDK_KEY_rcaron 0x1f8
|
||||
#define GDK_KEY_uring 0x1f9
|
||||
#define GDK_KEY_udoubleacute 0x1fb
|
||||
#define GDK_KEY_tcedilla 0x1fe
|
||||
#define GDK_KEY_abovedot 0x1ff
|
||||
#define GDK_KEY_Hstroke 0x2a1
|
||||
@@ -683,32 +690,32 @@
|
||||
#define GDK_KEY_uogonek 0x3f9
|
||||
#define GDK_KEY_utilde 0x3fd
|
||||
#define GDK_KEY_umacron 0x3fe
|
||||
#define GDK_KEY_Wcircumflex 0x1000174
|
||||
#define GDK_KEY_wcircumflex 0x1000175
|
||||
#define GDK_KEY_Ycircumflex 0x1000176
|
||||
#define GDK_KEY_ycircumflex 0x1000177
|
||||
#define GDK_KEY_Babovedot 0x1001e02
|
||||
#define GDK_KEY_babovedot 0x1001e03
|
||||
#define GDK_KEY_Dabovedot 0x1001e0a
|
||||
#define GDK_KEY_Wgrave 0x1001e80
|
||||
#define GDK_KEY_Wacute 0x1001e82
|
||||
#define GDK_KEY_dabovedot 0x1001e0b
|
||||
#define GDK_KEY_Ygrave 0x1001ef2
|
||||
#define GDK_KEY_Fabovedot 0x1001e1e
|
||||
#define GDK_KEY_fabovedot 0x1001e1f
|
||||
#define GDK_KEY_Mabovedot 0x1001e40
|
||||
#define GDK_KEY_mabovedot 0x1001e41
|
||||
#define GDK_KEY_Pabovedot 0x1001e56
|
||||
#define GDK_KEY_wgrave 0x1001e81
|
||||
#define GDK_KEY_pabovedot 0x1001e57
|
||||
#define GDK_KEY_wacute 0x1001e83
|
||||
#define GDK_KEY_Sabovedot 0x1001e60
|
||||
#define GDK_KEY_ygrave 0x1001ef3
|
||||
#define GDK_KEY_sabovedot 0x1001e61
|
||||
#define GDK_KEY_Tabovedot 0x1001e6a
|
||||
#define GDK_KEY_tabovedot 0x1001e6b
|
||||
#define GDK_KEY_Wgrave 0x1001e80
|
||||
#define GDK_KEY_wgrave 0x1001e81
|
||||
#define GDK_KEY_Wacute 0x1001e82
|
||||
#define GDK_KEY_wacute 0x1001e83
|
||||
#define GDK_KEY_Wdiaeresis 0x1001e84
|
||||
#define GDK_KEY_wdiaeresis 0x1001e85
|
||||
#define GDK_KEY_sabovedot 0x1001e61
|
||||
#define GDK_KEY_Wcircumflex 0x1000174
|
||||
#define GDK_KEY_Tabovedot 0x1001e6a
|
||||
#define GDK_KEY_Ycircumflex 0x1000176
|
||||
#define GDK_KEY_wcircumflex 0x1000175
|
||||
#define GDK_KEY_tabovedot 0x1001e6b
|
||||
#define GDK_KEY_ycircumflex 0x1000177
|
||||
#define GDK_KEY_Ygrave 0x1001ef2
|
||||
#define GDK_KEY_ygrave 0x1001ef3
|
||||
#define GDK_KEY_OE 0x13bc
|
||||
#define GDK_KEY_oe 0x13bd
|
||||
#define GDK_KEY_Ydiaeresis 0x13be
|
||||
@@ -1203,6 +1210,7 @@
|
||||
#define GDK_KEY_leftdoublequotemark 0xad2
|
||||
#define GDK_KEY_rightdoublequotemark 0xad3
|
||||
#define GDK_KEY_prescription 0xad4
|
||||
#define GDK_KEY_permille 0xad5
|
||||
#define GDK_KEY_minutes 0xad6
|
||||
#define GDK_KEY_seconds 0xad7
|
||||
#define GDK_KEY_latincross 0xad9
|
||||
@@ -1636,6 +1644,8 @@
|
||||
#define GDK_KEY_obarred 0x1000275
|
||||
#define GDK_KEY_SCHWA 0x100018f
|
||||
#define GDK_KEY_schwa 0x1000259
|
||||
#define GDK_KEY_EZH 0x10001b7
|
||||
#define GDK_KEY_ezh 0x1000292
|
||||
#define GDK_KEY_Lbelowdot 0x1001e36
|
||||
#define GDK_KEY_lbelowdot 0x1001e37
|
||||
#define GDK_KEY_Abelowdot 0x1001ea0
|
||||
@@ -2293,5 +2303,7 @@
|
||||
#define GDK_KEY_ClearGrab 0x1008fe21
|
||||
#define GDK_KEY_Next_VMode 0x1008fe22
|
||||
#define GDK_KEY_Prev_VMode 0x1008fe23
|
||||
#define GDK_KEY_LogWindowTree 0x1008fe24
|
||||
#define GDK_KEY_LogGrabInfo 0x1008fe25
|
||||
|
||||
#endif /* __GDK_KEYSYMS_H__ */
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "fallback-c89.c"
|
||||
|
||||
/**
|
||||
* SECTION:rgba_colors
|
||||
* @Short_description: RGBA colors
|
||||
|
||||
@@ -80,6 +80,16 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_4 (G_ENCODE_VERSION (3, 4))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_6:
|
||||
*
|
||||
* A macro that evaluates to the 3.6 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.6
|
||||
*/
|
||||
#define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
@@ -105,7 +115,7 @@
|
||||
* The definition should be one of the predefined GDK version
|
||||
* macros: %GDK_VERSION_3_0, %GDK_VERSION_3_2,...
|
||||
*
|
||||
* This macro defines the lower bound for the GLib API to use.
|
||||
* This macro defines the lower bound for the GDK API to use.
|
||||
*
|
||||
* If a function has been deprecated in a newer version of GDK,
|
||||
* it is possible to use this symbol to avoid the compiler warnings
|
||||
@@ -114,7 +124,7 @@
|
||||
* Since: 3.4
|
||||
*/
|
||||
#ifndef GDK_VERSION_MIN_REQUIRED
|
||||
# define GDK_VERSION_MIN_REQUIRED (GDK_VERSION_PREV_STABLE)
|
||||
# define GDK_VERSION_MIN_REQUIRED (GDK_VERSION_CUR_STABLE)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -193,4 +203,18 @@
|
||||
# define GDK_AVAILABLE_IN_3_4
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_6
|
||||
# define GDK_DEPRECATED_IN_3_6 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_6_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_6
|
||||
# define GDK_DEPRECATED_IN_3_6_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_6
|
||||
# define GDK_AVAILABLE_IN_3_6 GDK_UNAVAILABLE(3, 6)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_6
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
+45
-49
@@ -9469,56 +9469,53 @@ proxy_pointer_event (GdkDisplay *display,
|
||||
if (!event_win)
|
||||
return TRUE;
|
||||
|
||||
if (!display->ignore_core_events)
|
||||
{
|
||||
event = gdk_event_new (event_type);
|
||||
event->any.window = g_object_ref (event_win);
|
||||
event->any.send_event = source_event->any.send_event;
|
||||
event = gdk_event_new (event_type);
|
||||
event->any.window = g_object_ref (event_win);
|
||||
event->any.send_event = source_event->any.send_event;
|
||||
|
||||
gdk_event_set_device (event, gdk_event_get_device (source_event));
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
gdk_event_set_device (event, gdk_event_get_device (source_event));
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
if (event_type == GDK_TOUCH_UPDATE)
|
||||
{
|
||||
event->touch.time = time_;
|
||||
event->touch.state = state | GDK_BUTTON1_MASK;
|
||||
event->touch.sequence = source_event->touch.sequence;
|
||||
event->touch.emulating_pointer = source_event->touch.emulating_pointer;
|
||||
convert_toplevel_coords_to_window (event_win,
|
||||
toplevel_x, toplevel_y,
|
||||
&event->touch.x, &event->touch.y);
|
||||
gdk_event_get_root_coords (source_event,
|
||||
&event->touch.x_root,
|
||||
&event->touch.y_root);
|
||||
if (event_type == GDK_TOUCH_UPDATE)
|
||||
{
|
||||
event->touch.time = time_;
|
||||
event->touch.state = state | GDK_BUTTON1_MASK;
|
||||
event->touch.sequence = source_event->touch.sequence;
|
||||
event->touch.emulating_pointer = source_event->touch.emulating_pointer;
|
||||
convert_toplevel_coords_to_window (event_win,
|
||||
toplevel_x, toplevel_y,
|
||||
&event->touch.x, &event->touch.y);
|
||||
gdk_event_get_root_coords (source_event,
|
||||
&event->touch.x_root,
|
||||
&event->touch.y_root);
|
||||
|
||||
event->touch.axes = g_memdup (source_event->touch.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->motion.time = time_;
|
||||
event->motion.state = state;
|
||||
event->motion.is_hint = is_hint;
|
||||
event->touch.axes = g_memdup (source_event->touch.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->motion.time = time_;
|
||||
event->motion.state = state;
|
||||
event->motion.is_hint = is_hint;
|
||||
|
||||
convert_toplevel_coords_to_window (event_win,
|
||||
toplevel_x, toplevel_y,
|
||||
&event->motion.x, &event->motion.y);
|
||||
gdk_event_get_root_coords (source_event,
|
||||
&event->motion.x_root,
|
||||
&event->motion.y_root);
|
||||
convert_toplevel_coords_to_window (event_win,
|
||||
toplevel_x, toplevel_y,
|
||||
&event->motion.x, &event->motion.y);
|
||||
gdk_event_get_root_coords (source_event,
|
||||
&event->motion.x_root,
|
||||
&event->motion.y_root);
|
||||
|
||||
if (is_touch_type (source_event->type))
|
||||
event->motion.axes = g_memdup (source_event->touch.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
|
||||
else
|
||||
event->motion.axes = g_memdup (source_event->motion.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->motion.device));
|
||||
}
|
||||
if (is_touch_type (source_event->type))
|
||||
event->motion.axes = g_memdup (source_event->touch.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
|
||||
else
|
||||
event->motion.axes = g_memdup (source_event->motion.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->motion.device));
|
||||
}
|
||||
|
||||
/* Just insert the event */
|
||||
_gdk_event_queue_insert_after (gdk_window_get_display (event_win),
|
||||
source_event, event);
|
||||
}
|
||||
/* Just insert the event */
|
||||
_gdk_event_queue_insert_after (gdk_window_get_display (event_win),
|
||||
source_event, event);
|
||||
}
|
||||
|
||||
/* unlink all move events from queue.
|
||||
@@ -9663,7 +9660,7 @@ proxy_button_event (GdkEvent *source_event,
|
||||
if (source_event->type == GDK_TOUCH_END && !is_touch_type (type))
|
||||
state |= GDK_BUTTON1_MASK;
|
||||
|
||||
if (event_win == NULL || display->ignore_core_events)
|
||||
if (event_win == NULL)
|
||||
return TRUE;
|
||||
|
||||
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER &&
|
||||
@@ -9719,11 +9716,10 @@ proxy_button_event (GdkEvent *source_event,
|
||||
gdk_event_set_device (event, gdk_event_get_device (source_event));
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
if (type == GDK_BUTTON_RELEASE)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
|
||||
if (is_touch_type (source_event->type))
|
||||
{
|
||||
{
|
||||
if (type == GDK_BUTTON_RELEASE)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
event->button.button = 1;
|
||||
event->button.axes = g_memdup (source_event->touch.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (source_event->touch.device));
|
||||
|
||||
@@ -114,10 +114,15 @@
|
||||
switch ([event type])
|
||||
{
|
||||
case NSLeftMouseUp:
|
||||
{
|
||||
double time = ((double)[event timestamp]) * 1000.0;
|
||||
|
||||
_gdk_quartz_events_break_all_grabs (time);
|
||||
inManualMove = NO;
|
||||
inManualResize = NO;
|
||||
inMove = NO;
|
||||
break;
|
||||
}
|
||||
|
||||
case NSLeftMouseDragged:
|
||||
if ([self trackManualMove] || [self trackManualResize])
|
||||
@@ -313,6 +318,11 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(BOOL)isInManualResize
|
||||
{
|
||||
return inManualResize;
|
||||
}
|
||||
|
||||
-(void)beginManualMove
|
||||
{
|
||||
NSRect frame = [self frame];
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
-(BOOL)isInMove;
|
||||
-(void)beginManualMove;
|
||||
-(BOOL)trackManualMove;
|
||||
-(BOOL)isInManualResize;
|
||||
-(void)beginManualResize;
|
||||
-(BOOL)trackManualResize;
|
||||
-(void)showAndMakeKey:(BOOL)makeKey;
|
||||
|
||||
@@ -73,8 +73,8 @@ _gdk_quartz_display_has_pending (GdkDisplay *display)
|
||||
(_gdk_quartz_event_loop_check_pending ()));
|
||||
}
|
||||
|
||||
static void
|
||||
break_all_grabs (guint32 time)
|
||||
void
|
||||
_gdk_quartz_events_break_all_grabs (guint32 time)
|
||||
{
|
||||
GList *list, *l;
|
||||
GdkDeviceManager *device_manager;
|
||||
@@ -1178,7 +1178,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
if (event_type == NSAppKitDefined)
|
||||
{
|
||||
if ([nsevent subtype] == NSApplicationDeactivatedEventType)
|
||||
break_all_grabs (get_time_from_ns_event (nsevent));
|
||||
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
|
||||
|
||||
/* This could potentially be used to break grabs when clicking
|
||||
* on the title. The subtype 20 is undocumented so it's probably
|
||||
@@ -1237,10 +1237,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
*/
|
||||
if ([(GdkQuartzNSWindow *)nswindow isInMove])
|
||||
{
|
||||
break_all_grabs (get_time_from_ns_event (nsevent));
|
||||
_gdk_quartz_events_break_all_grabs (get_time_from_ns_event (nsevent));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Also when in a manual resize, we ignore events so that these are
|
||||
* pushed to GdkQuartzWindow's sendEvent handler.
|
||||
*/
|
||||
if ([(GdkQuartzWindow *)nswindow isInManualResize])
|
||||
return FALSE;
|
||||
|
||||
/* Find the right GDK window to send the event to, taking grabs and
|
||||
* event masks into consideration.
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,7 @@ GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
|
||||
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
|
||||
|
||||
void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window);
|
||||
void _gdk_quartz_events_break_all_grabs (guint32 time);
|
||||
|
||||
/* Event loop */
|
||||
gboolean _gdk_quartz_event_loop_check_pending (void);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define GDK_TYPE_WAYLAND_CURSOR (_gdk_wayland_cursor_get_type ())
|
||||
#define GDK_WAYLAND_CURSOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_CURSOR, GdkWaylandCursor))
|
||||
@@ -163,7 +164,7 @@ set_pixbuf (GdkWaylandCursor *cursor, GdkPixbuf *pixbuf)
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
create_cursor(GdkDisplayWayland *display, GdkPixbuf *pixbuf, int x, int y)
|
||||
create_cursor(GdkWaylandDisplay *display, GdkPixbuf *pixbuf, int x, int y)
|
||||
{
|
||||
GdkWaylandCursor *cursor;
|
||||
int stride, fd;
|
||||
@@ -193,28 +194,34 @@ create_cursor(GdkDisplayWayland *display, GdkPixbuf *pixbuf, int x, int y)
|
||||
cursor->size = stride * cursor->height;
|
||||
|
||||
fd = g_file_open_tmp("wayland-shm-XXXXXX", &filename, &error);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "g_file_open_tmp failed: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
if (fd < 0)
|
||||
{
|
||||
g_critical (G_STRLOC ": Error opening temporary file for buffer: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unlink (filename);
|
||||
g_free (filename);
|
||||
|
||||
if (ftruncate(fd, cursor->size) < 0) {
|
||||
fprintf(stderr, "ftruncate failed: %m\n");
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
if (ftruncate(fd, cursor->size) < 0)
|
||||
{
|
||||
g_critical (G_STRLOC ": Error truncating file for buffer: %s",
|
||||
g_strerror (errno));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor->map = mmap(NULL, cursor->size,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
if (cursor->map == MAP_FAILED) {
|
||||
fprintf(stderr, "mmap failed: %m\n");
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
if (cursor->map == MAP_FAILED)
|
||||
{
|
||||
g_critical (G_STRLOC ": Error mmap'ing file for buffer: %s",
|
||||
g_strerror (errno));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
set_pixbuf (cursor, pixbuf);
|
||||
@@ -251,7 +258,7 @@ GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
GdkDisplayWayland *wayland_display;
|
||||
GdkWaylandDisplay *wayland_display;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
GError *error = NULL;
|
||||
int i;
|
||||
@@ -269,7 +276,7 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
i = 0;
|
||||
}
|
||||
|
||||
wayland_display = GDK_DISPLAY_WAYLAND (display);
|
||||
wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
if (!wayland_display->cursors)
|
||||
wayland_display->cursors =
|
||||
g_new0 (GdkCursor *, G_N_ELEMENTS(cursor_definitions));
|
||||
|
||||
@@ -350,7 +350,7 @@ input_handle_motion(void *data, struct wl_input_device *input_device,
|
||||
int32_t x, int32_t y, int32_t sx, int32_t sy)
|
||||
{
|
||||
GdkWaylandDevice *device = data;
|
||||
GdkDisplayWayland *display = GDK_DISPLAY_WAYLAND (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
@@ -386,7 +386,7 @@ input_handle_button(void *data, struct wl_input_device *input_device,
|
||||
uint32_t time, uint32_t button, uint32_t state)
|
||||
{
|
||||
GdkWaylandDevice *device = data;
|
||||
GdkDisplayWayland *display = GDK_DISPLAY_WAYLAND (device->display);
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
GdkEvent *event;
|
||||
uint32_t modifier;
|
||||
int gdk_button;
|
||||
@@ -911,14 +911,14 @@ _gdk_wayland_device_manager_add_device (GdkDeviceManager *device_manager,
|
||||
struct wl_input_device *wl_device)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
GdkDeviceManagerCore *device_manager_core =
|
||||
GDK_DEVICE_MANAGER_CORE(device_manager);
|
||||
GdkWaylandDevice *device;
|
||||
|
||||
device = g_new0 (GdkWaylandDevice, 1);
|
||||
display = gdk_device_manager_get_display (device_manager);
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
device->display = display;
|
||||
device->pointer = g_object_new (GDK_TYPE_DEVICE_CORE,
|
||||
@@ -1258,7 +1258,7 @@ gdk_wayland_device_offer_selection_content (GdkDevice
|
||||
gpointer userdata)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
GdkWaylandSelectionOffer *offer;
|
||||
GdkWaylandDevice *device;
|
||||
gint i;
|
||||
@@ -1267,7 +1267,7 @@ gdk_wayland_device_offer_selection_content (GdkDevice
|
||||
device = GDK_DEVICE_CORE (gdk_device)->device;
|
||||
|
||||
display = device->display;
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
offer = g_new0 (GdkWaylandSelectionOffer, 1);
|
||||
offer->cb = cb;
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
#include <wayland-egl.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -36,17 +38,17 @@
|
||||
#include "gdkkeysprivate.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
G_DEFINE_TYPE (GdkDisplayWayland, _gdk_display_wayland, GDK_TYPE_DISPLAY)
|
||||
G_DEFINE_TYPE (GdkWaylandDisplay, _gdk_wayland_display, GDK_TYPE_DISPLAY)
|
||||
|
||||
static void
|
||||
gdk_input_init (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
GdkDeviceManager *device_manager;
|
||||
GdkDevice *device;
|
||||
GList *list, *l;
|
||||
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
/* For backwards compatibility, just add
|
||||
@@ -118,7 +120,7 @@ static void
|
||||
gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
const char *interface, uint32_t version, void *data)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland = data;
|
||||
GdkWaylandDisplay *display_wayland = data;
|
||||
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
|
||||
struct wl_input_device *input;
|
||||
|
||||
@@ -145,18 +147,19 @@ gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
static gboolean
|
||||
gdk_display_init_egl(GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
EGLint major, minor, i;
|
||||
void *p;
|
||||
|
||||
static const struct { const char *f; unsigned int offset; }
|
||||
extension_functions[] = {
|
||||
{ "glEGLImageTargetTexture2DOES", offsetof(GdkDisplayWayland, image_target_texture_2d) },
|
||||
{ "eglCreateImageKHR", offsetof(GdkDisplayWayland, create_image) },
|
||||
{ "eglDestroyImageKHR", offsetof(GdkDisplayWayland, destroy_image) }
|
||||
{ "glEGLImageTargetTexture2DOES", offsetof(GdkWaylandDisplay, image_target_texture_2d) },
|
||||
{ "eglCreateImageKHR", offsetof(GdkWaylandDisplay, create_image) },
|
||||
{ "eglDestroyImageKHR", offsetof(GdkWaylandDisplay, destroy_image) }
|
||||
};
|
||||
|
||||
display_wayland->egl_display =
|
||||
@@ -200,20 +203,21 @@ gdk_display_init_egl(GdkDisplay *display)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
GdkDisplay *
|
||||
_gdk_wayland_display_open (const gchar *display_name)
|
||||
{
|
||||
struct wl_display *wl_display;
|
||||
GdkDisplay *display;
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
wl_display = wl_display_connect(display_name);
|
||||
if (!wl_display)
|
||||
return NULL;
|
||||
|
||||
display = g_object_new (GDK_TYPE_DISPLAY_WAYLAND, NULL);
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display = g_object_new (GDK_TYPE_WAYLAND_DISPLAY, NULL);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
display_wayland->wl_display = wl_display;
|
||||
|
||||
@@ -225,7 +229,12 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
wl_display_add_global_listener(display_wayland->wl_display,
|
||||
gdk_display_handle_global, display_wayland);
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
gdk_display_init_egl(display);
|
||||
#else
|
||||
wl_display_iterate(wl_display, WL_DISPLAY_READABLE);
|
||||
wl_display_roundtrip(wl_display);
|
||||
#endif
|
||||
|
||||
display_wayland->event_source =
|
||||
_gdk_wayland_display_event_source_new (display);
|
||||
@@ -241,7 +250,7 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
static void
|
||||
gdk_wayland_display_dispose (GObject *object)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (object);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (object);
|
||||
|
||||
_gdk_wayland_display_manager_remove_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY (display_wayland));
|
||||
@@ -257,15 +266,17 @@ gdk_wayland_display_dispose (GObject *object)
|
||||
display_wayland->event_source = NULL;
|
||||
}
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
eglTerminate(display_wayland->egl_display);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (_gdk_display_wayland_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (_gdk_wayland_display_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_display_finalize (GObject *object)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (object);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (object);
|
||||
|
||||
/* Keymap */
|
||||
if (display_wayland->keymap)
|
||||
@@ -278,7 +289,7 @@ gdk_wayland_display_finalize (GObject *object)
|
||||
|
||||
g_free (display_wayland->startup_notification_id);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_display_wayland_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (_gdk_wayland_display_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
@@ -300,7 +311,7 @@ gdk_wayland_display_get_screen (GdkDisplay *display,
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (screen_num == 0, NULL);
|
||||
|
||||
return GDK_DISPLAY_WAYLAND (display)->screen;
|
||||
return GDK_WAYLAND_DISPLAY (display)->screen;
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
@@ -308,7 +319,7 @@ gdk_wayland_display_get_default_screen (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return GDK_DISPLAY_WAYLAND (display)->screen;
|
||||
return GDK_WAYLAND_DISPLAY (display)->screen;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -320,11 +331,11 @@ gdk_wayland_display_beep (GdkDisplay *display)
|
||||
static void
|
||||
gdk_wayland_display_sync (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
wl_display_roundtrip(display_wayland->wl_display);
|
||||
}
|
||||
@@ -336,7 +347,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
|
||||
|
||||
if (!display->closed)
|
||||
_gdk_wayland_display_flush (display,
|
||||
GDK_DISPLAY_WAYLAND (display)->event_source);
|
||||
GDK_WAYLAND_DISPLAY (display)->event_source);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -406,7 +417,7 @@ gdk_wayland_display_list_devices (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return GDK_DISPLAY_WAYLAND (display)->input_devices;
|
||||
return GDK_WAYLAND_DISPLAY (display)->input_devices;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -520,10 +531,10 @@ gdk_wayland_display_event_data_free (GdkDisplay *display,
|
||||
static GdkKeymap *
|
||||
gdk_wayland_display_get_keymap (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
if (!display_wayland->keymap)
|
||||
display_wayland->keymap = _gdk_wayland_keymap_new (display);
|
||||
@@ -544,7 +555,7 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_display_wayland_class_init (GdkDisplayWaylandClass * class)
|
||||
_gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
|
||||
@@ -599,7 +610,7 @@ _gdk_display_wayland_class_init (GdkDisplayWaylandClass * class)
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_display_wayland_init (GdkDisplayWayland *display)
|
||||
_gdk_wayland_display_init (GdkWaylandDisplay *display)
|
||||
{
|
||||
_gdk_wayland_display_manager_add_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY (display));
|
||||
|
||||
@@ -19,17 +19,22 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DISPLAY_WAYLAND__
|
||||
#define __GDK_DISPLAY_WAYLAND__
|
||||
#ifndef __GDK_WAYLAND_DISPLAY__
|
||||
#define __GDK_WAYLAND_DISPLAY__
|
||||
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <wayland-client.h>
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
#include <wayland-egl.h>
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
#include <cairo-gl.h>
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
#include <gdk/gdkwindow.h>
|
||||
@@ -40,17 +45,17 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkDisplayWayland GdkDisplayWayland;
|
||||
typedef struct _GdkDisplayWaylandClass GdkDisplayWaylandClass;
|
||||
typedef struct _GdkWaylandDisplay GdkWaylandDisplay;
|
||||
typedef struct _GdkWaylandDisplayClass GdkWaylandDisplayClass;
|
||||
|
||||
#define GDK_TYPE_DISPLAY_WAYLAND (_gdk_display_wayland_get_type())
|
||||
#define GDK_DISPLAY_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_WAYLAND, GdkDisplayWayland))
|
||||
#define GDK_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY_WAYLAND, GdkDisplayWaylandClass))
|
||||
#define GDK_IS_DISPLAY_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_WAYLAND))
|
||||
#define GDK_IS_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_WAYLAND))
|
||||
#define GDK_DISPLAY_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_WAYLAND, GdkDisplayWaylandClass))
|
||||
#define GDK_TYPE_WAYLAND_DISPLAY (_gdk_wayland_display_get_type())
|
||||
#define GDK_WAYLAND_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplay))
|
||||
#define GDK_WAYLAND_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplayClass))
|
||||
#define GDK_IS_WAYLAND_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY))
|
||||
#define GDK_IS_WAYLAND_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY))
|
||||
#define GDK_WAYLAND_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplayClass))
|
||||
|
||||
struct _GdkDisplayWayland
|
||||
struct _GdkWaylandDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
GdkScreen *screen;
|
||||
@@ -76,24 +81,29 @@ struct _GdkDisplayWayland
|
||||
struct wl_input_device *input_device;
|
||||
struct wl_data_device_manager *data_device_manager;
|
||||
GSource *event_source;
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
EGLDisplay egl_display;
|
||||
EGLContext egl_context;
|
||||
cairo_device_t *cairo_device;
|
||||
#endif
|
||||
|
||||
GdkCursor **cursors;
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;
|
||||
PFNEGLCREATEIMAGEKHRPROC create_image;
|
||||
PFNEGLDESTROYIMAGEKHRPROC destroy_image;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _GdkDisplayWaylandClass
|
||||
struct _GdkWaylandDisplayClass
|
||||
{
|
||||
GdkDisplayClass parent_class;
|
||||
};
|
||||
|
||||
GType _gdk_display_wayland_get_type (void);
|
||||
GType _gdk_wayland_display_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DISPLAY_WAYLAND__ */
|
||||
#endif /* __GDK_WAYLAND_DISPLAY__ */
|
||||
|
||||
@@ -24,21 +24,11 @@
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkdisplay-wayland.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
#include "gdkwayland.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include <X11/extensions/XKBcommon.h>
|
||||
|
||||
typedef struct _GdkWaylandDisplayManager GdkWaylandDisplayManager;
|
||||
typedef struct _GdkWaylandDisplayManagerClass GdkWaylandDisplayManagerClass;
|
||||
|
||||
#define GDK_TYPE_WAYLAND_DISPLAY_MANAGER (gdk_wayland_display_manager_get_type())
|
||||
#define GDK_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManager))
|
||||
#define GDK_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
|
||||
#define GDK_IS_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
|
||||
#define GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
|
||||
#define GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
|
||||
|
||||
struct _GdkWaylandDisplayManager
|
||||
{
|
||||
GdkDisplayManager parent;
|
||||
|
||||
@@ -33,7 +33,7 @@ static gboolean
|
||||
gdk_event_source_prepare(GSource *base, gint *timeout)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkDisplayWayland *display = (GdkDisplayWayland *) source->display;
|
||||
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
|
||||
|
||||
*timeout = -1;
|
||||
|
||||
@@ -122,7 +122,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
{
|
||||
GSource *source;
|
||||
GdkWaylandEventSource *wl_source;
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
char *name;
|
||||
|
||||
source = g_source_new (&wl_glib_source_funcs,
|
||||
@@ -132,7 +132,7 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
g_free (name);
|
||||
wl_source = (GdkWaylandEventSource *) source;
|
||||
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
wl_source->display = display;
|
||||
wl_source->pfd.fd = wl_display_get_fd(display_wayland->wl_display,
|
||||
gdk_event_source_update, source);
|
||||
@@ -154,17 +154,17 @@ _gdk_wayland_display_flush (GdkDisplay *display, GSource *source)
|
||||
GdkWaylandEventSource *wayland_source = (GdkWaylandEventSource *) source;
|
||||
|
||||
while (wayland_source->mask & WL_DISPLAY_WRITABLE)
|
||||
wl_display_iterate(GDK_DISPLAY_WAYLAND (display)->wl_display,
|
||||
wl_display_iterate(GDK_WAYLAND_DISPLAY (display)->wl_display,
|
||||
WL_DISPLAY_WRITABLE);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
{
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
GdkWaylandEventSource *source;
|
||||
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
source = (GdkWaylandEventSource *) display_wayland->event_source;
|
||||
|
||||
if (source->pfd.revents)
|
||||
|
||||
@@ -28,19 +28,19 @@
|
||||
#include "gdkwayland.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
typedef struct _GdkScreenWayland GdkScreenWayland;
|
||||
typedef struct _GdkScreenWaylandClass GdkScreenWaylandClass;
|
||||
typedef struct _GdkWaylandScreen GdkWaylandScreen;
|
||||
typedef struct _GdkWaylandScreenClass GdkWaylandScreenClass;
|
||||
|
||||
#define GDK_TYPE_SCREEN_WAYLAND (_gdk_screen_wayland_get_type ())
|
||||
#define GDK_SCREEN_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SCREEN_WAYLAND, GdkScreenWayland))
|
||||
#define GDK_SCREEN_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SCREEN_WAYLAND, GdkScreenWaylandClass))
|
||||
#define GDK_IS_SCREEN_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SCREEN_WAYLAND))
|
||||
#define GDK_IS_SCREEN_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SCREEN_WAYLAND))
|
||||
#define GDK_SCREEN_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SCREEN_WAYLAND, GdkScreenWaylandClass))
|
||||
#define GDK_TYPE_WAYLAND_SCREEN (_gdk_wayland_screen_get_type ())
|
||||
#define GDK_WAYLAND_SCREEN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_SCREEN, GdkWaylandScreen))
|
||||
#define GDK_WAYLAND_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SCREEN, GdkWaylandScreenClass))
|
||||
#define GDK_IS_WAYLAND_SCREEN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_SCREEN))
|
||||
#define GDK_IS_WAYLAND_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_SCREEN))
|
||||
#define GDK_WAYLAND_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SCREEN, GdkWaylandScreenClass))
|
||||
|
||||
typedef struct _GdkWaylandMonitor GdkWaylandMonitor;
|
||||
|
||||
struct _GdkScreenWayland
|
||||
struct _GdkWaylandScreen
|
||||
{
|
||||
GdkScreen parent_instance;
|
||||
|
||||
@@ -59,11 +59,11 @@ struct _GdkScreenWayland
|
||||
gint primary_monitor;
|
||||
};
|
||||
|
||||
struct _GdkScreenWaylandClass
|
||||
struct _GdkWaylandScreenClass
|
||||
{
|
||||
GdkScreenClass parent_class;
|
||||
|
||||
void (* window_manager_changed) (GdkScreenWayland *screen_wayland);
|
||||
void (* window_manager_changed) (GdkWaylandScreen *screen_wayland);
|
||||
};
|
||||
|
||||
struct _GdkWaylandMonitor
|
||||
@@ -75,7 +75,7 @@ struct _GdkWaylandMonitor
|
||||
char * manufacturer;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkScreenWayland, _gdk_screen_wayland, GDK_TYPE_SCREEN)
|
||||
G_DEFINE_TYPE (GdkWaylandScreen, _gdk_wayland_screen, GDK_TYPE_SCREEN)
|
||||
|
||||
static void
|
||||
init_monitor_geometry (GdkWaylandMonitor *monitor,
|
||||
@@ -110,7 +110,7 @@ free_monitors (GdkWaylandMonitor *monitors,
|
||||
static void
|
||||
deinit_multihead (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
free_monitors (screen_wayland->monitors, screen_wayland->n_monitors);
|
||||
|
||||
@@ -121,7 +121,7 @@ deinit_multihead (GdkScreen *screen)
|
||||
static void
|
||||
init_multihead (GdkScreen *screen)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
/* No multihead support of any kind for this screen */
|
||||
screen_wayland->n_monitors = 1;
|
||||
@@ -135,18 +135,18 @@ init_multihead (GdkScreen *screen)
|
||||
static void
|
||||
gdk_wayland_screen_dispose (GObject *object)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (object);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (object);
|
||||
|
||||
if (screen_wayland->root_window)
|
||||
_gdk_window_destroy (screen_wayland->root_window, TRUE);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_screen_wayland_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (_gdk_wayland_screen_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_screen_finalize (GObject *object)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (object);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (object);
|
||||
|
||||
if (screen_wayland->root_window)
|
||||
g_object_unref (screen_wayland->root_window);
|
||||
@@ -155,37 +155,37 @@ gdk_wayland_screen_finalize (GObject *object)
|
||||
|
||||
deinit_multihead (GDK_SCREEN (object));
|
||||
|
||||
G_OBJECT_CLASS (_gdk_screen_wayland_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (_gdk_wayland_screen_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
gdk_wayland_screen_get_display (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->display;
|
||||
return GDK_WAYLAND_SCREEN (screen)->display;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_width (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->width;
|
||||
return GDK_WAYLAND_SCREEN (screen)->width;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_height (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->height;
|
||||
return GDK_WAYLAND_SCREEN (screen)->height;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_width_mm (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->width_mm;
|
||||
return GDK_WAYLAND_SCREEN (screen)->width_mm;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_height_mm (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->height_mm;
|
||||
return GDK_WAYLAND_SCREEN (screen)->height_mm;
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -197,26 +197,26 @@ gdk_wayland_screen_get_number (GdkScreen *screen)
|
||||
static GdkWindow *
|
||||
gdk_wayland_screen_get_root_window (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->root_window;
|
||||
return GDK_WAYLAND_SCREEN (screen)->root_window;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_n_monitors (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->n_monitors;
|
||||
return GDK_WAYLAND_SCREEN (screen)->n_monitors;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_primary_monitor (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->primary_monitor;
|
||||
return GDK_WAYLAND_SCREEN (screen)->primary_monitor;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_wayland_screen_get_monitor_width_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
return screen_wayland->monitors[monitor_num].width_mm;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ static gint
|
||||
gdk_wayland_screen_get_monitor_height_mm (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
return screen_wayland->monitors[monitor_num].height_mm;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ static gchar *
|
||||
gdk_wayland_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
gint monitor_num)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
return g_strdup (screen_wayland->monitors[monitor_num].output_name);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ gdk_wayland_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
gint monitor_num,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
GdkScreenWayland *screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
if (dest)
|
||||
*dest = screen_wayland->monitors[monitor_num].geometry;
|
||||
@@ -253,13 +253,13 @@ gdk_wayland_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
static GdkVisual *
|
||||
gdk_wayland_screen_get_system_visual (GdkScreen * screen)
|
||||
{
|
||||
return (GdkVisual *) GDK_SCREEN_WAYLAND (screen)->visual;
|
||||
return (GdkVisual *) GDK_WAYLAND_SCREEN (screen)->visual;
|
||||
}
|
||||
|
||||
static GdkVisual *
|
||||
gdk_wayland_screen_get_rgba_visual (GdkScreen *screen)
|
||||
{
|
||||
return (GdkVisual *) GDK_SCREEN_WAYLAND (screen)->visual;
|
||||
return (GdkVisual *) GDK_WAYLAND_SCREEN (screen)->visual;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -340,21 +340,21 @@ gdk_wayland_screen_visual_get_best_type (GdkScreen *screen)
|
||||
static GdkVisual*
|
||||
gdk_wayland_screen_visual_get_best (GdkScreen *screen)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->visual;
|
||||
return GDK_WAYLAND_SCREEN (screen)->visual;
|
||||
}
|
||||
|
||||
static GdkVisual*
|
||||
gdk_wayland_screen_visual_get_best_with_depth (GdkScreen *screen,
|
||||
gint depth)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->visual;
|
||||
return GDK_WAYLAND_SCREEN (screen)->visual;
|
||||
}
|
||||
|
||||
static GdkVisual*
|
||||
gdk_wayland_screen_visual_get_best_with_type (GdkScreen *screen,
|
||||
GdkVisualType visual_type)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->visual;
|
||||
return GDK_WAYLAND_SCREEN (screen)->visual;
|
||||
}
|
||||
|
||||
static GdkVisual*
|
||||
@@ -362,7 +362,7 @@ gdk_wayland_screen_visual_get_best_with_both (GdkScreen *screen,
|
||||
gint depth,
|
||||
GdkVisualType visual_type)
|
||||
{
|
||||
return GDK_SCREEN_WAYLAND (screen)->visual;
|
||||
return GDK_WAYLAND_SCREEN (screen)->visual;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -391,10 +391,10 @@ static GList *
|
||||
gdk_wayland_screen_list_visuals (GdkScreen *screen)
|
||||
{
|
||||
GList *list;
|
||||
GdkScreenWayland *screen_wayland;
|
||||
GdkWaylandScreen *screen_wayland;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
|
||||
list = g_list_append (NULL, screen_wayland->visual);
|
||||
|
||||
@@ -421,11 +421,11 @@ GdkScreen *
|
||||
_gdk_wayland_screen_new (GdkDisplay *display)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GdkScreenWayland *screen_wayland;
|
||||
GdkWaylandScreen *screen_wayland;
|
||||
|
||||
screen = g_object_new (GDK_TYPE_SCREEN_WAYLAND, NULL);
|
||||
screen = g_object_new (GDK_TYPE_WAYLAND_SCREEN, NULL);
|
||||
|
||||
screen_wayland = GDK_SCREEN_WAYLAND (screen);
|
||||
screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||
screen_wayland->display = display;
|
||||
screen_wayland->width = 8192;
|
||||
screen_wayland->height = 8192;
|
||||
@@ -443,7 +443,7 @@ _gdk_wayland_screen_new (GdkDisplay *display)
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_screen_wayland_class_init (GdkScreenWaylandClass *klass)
|
||||
_gdk_wayland_screen_class_init (GdkWaylandScreenClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkScreenClass *screen_class = GDK_SCREEN_CLASS (klass);
|
||||
@@ -485,6 +485,6 @@ _gdk_screen_wayland_class_init (GdkScreenWaylandClass *klass)
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_screen_wayland_init (GdkScreenWayland *screen_wayland)
|
||||
_gdk_wayland_screen_init (GdkWaylandScreen *screen_wayland)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,6 +29,16 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkWaylandDisplayManager GdkWaylandDisplayManager;
|
||||
typedef struct _GdkWaylandDisplayManagerClass GdkWaylandDisplayManagerClass;
|
||||
|
||||
#define GDK_TYPE_WAYLAND_DISPLAY_MANAGER (gdk_wayland_display_manager_get_type())
|
||||
#define GDK_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManager))
|
||||
#define GDK_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
|
||||
#define GDK_IS_WAYLAND_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
|
||||
#define GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY_MANAGER))
|
||||
#define GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY_MANAGER, GdkWaylandDisplayManagerClass))
|
||||
|
||||
GType gdk_wayland_display_manager_get_type (void);
|
||||
|
||||
#if defined (GTK_COMPILATION) || defined (GDK_COMPILATION)
|
||||
|
||||
+206
-62
@@ -33,6 +33,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <wayland-egl.h>
|
||||
|
||||
@@ -113,7 +115,6 @@ struct _GdkWindowImplWayland
|
||||
*/
|
||||
cairo_surface_t *server_surface;
|
||||
|
||||
GLuint texture;
|
||||
uint32_t resize_edges;
|
||||
|
||||
int focus_count;
|
||||
@@ -301,11 +302,16 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
static const cairo_user_data_key_t gdk_wayland_cairo_key;
|
||||
|
||||
typedef struct _GdkWaylandCairoSurfaceData {
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
EGLImageKHR image;
|
||||
GLuint texture;
|
||||
struct wl_egl_pixmap *pixmap;
|
||||
#else
|
||||
gpointer buf;
|
||||
size_t buf_length;
|
||||
#endif
|
||||
struct wl_buffer *buffer;
|
||||
GdkDisplayWayland *display;
|
||||
GdkWaylandDisplay *display;
|
||||
int32_t width, height;
|
||||
} GdkWaylandCairoSurfaceData;
|
||||
|
||||
@@ -352,9 +358,6 @@ gdk_wayland_window_attach_image (GdkWindow *window)
|
||||
/* Get a Wayland buffer from this new surface */
|
||||
data = cairo_surface_get_user_data (impl->cairo_surface,
|
||||
&gdk_wayland_cairo_key);
|
||||
if (!data->buffer)
|
||||
data->buffer =
|
||||
wl_egl_pixmap_create_buffer(data->pixmap);
|
||||
|
||||
if (impl->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT)
|
||||
dx = server_width - data->width;
|
||||
@@ -370,23 +373,7 @@ gdk_wayland_window_attach_image (GdkWindow *window)
|
||||
wl_surface_attach (impl->surface, data->buffer, dx, dy);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_impl_wayland_finalize (GObject *object)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (object);
|
||||
|
||||
if (impl->cursor)
|
||||
g_object_unref (impl->cursor);
|
||||
if (impl->server_surface)
|
||||
cairo_surface_destroy (impl->server_surface);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
static void
|
||||
gdk_wayland_cairo_surface_destroy (void *p)
|
||||
{
|
||||
@@ -402,11 +389,12 @@ gdk_wayland_cairo_surface_destroy (void *p)
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
|
||||
gdk_wayland_create_cairo_surface (GdkWaylandDisplay *display,
|
||||
int width, int height)
|
||||
{
|
||||
GdkWaylandCairoSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
cairo_status_t status;
|
||||
|
||||
data = g_new (GdkWaylandCairoSurfaceData, 1);
|
||||
data->display = display;
|
||||
@@ -431,11 +419,122 @@ gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
|
||||
cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key,
|
||||
data, gdk_wayland_cairo_surface_destroy);
|
||||
|
||||
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
|
||||
fprintf (stderr, "create gl surface failed\n");
|
||||
status = cairo_surface_status (surface);
|
||||
if (status != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
g_critical (G_STRLOC ": Unable to create Cairo GL surface: %s",
|
||||
cairo_status_to_string (status));
|
||||
|
||||
}
|
||||
|
||||
if (!data->buffer)
|
||||
data->buffer =
|
||||
wl_egl_pixmap_create_buffer(data->pixmap);
|
||||
|
||||
return surface;
|
||||
}
|
||||
#else
|
||||
static struct wl_buffer *
|
||||
create_shm_buffer (struct wl_shm *shm,
|
||||
int width,
|
||||
int height,
|
||||
uint32_t format,
|
||||
size_t *buf_length,
|
||||
void **data_out)
|
||||
{
|
||||
char filename[] = "/tmp/wayland-shm-XXXXXX";
|
||||
struct wl_buffer *buffer;
|
||||
int fd, size, stride;
|
||||
void *data;
|
||||
|
||||
fd = mkstemp (filename);
|
||||
if (fd < 0) {
|
||||
g_critical (G_STRLOC ": Unable to create temporary file (%s): %s",
|
||||
filename, g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
stride = width * 4;
|
||||
size = stride * height;
|
||||
if (ftruncate (fd, size) < 0) {
|
||||
g_critical (G_STRLOC ": Truncating temporary file failed: %s",
|
||||
g_strerror (errno));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
unlink (filename);
|
||||
|
||||
if (data == MAP_FAILED) {
|
||||
g_critical (G_STRLOC ": mmap'ping temporary file failed: %s",
|
||||
g_strerror (errno));
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buffer = wl_shm_create_buffer (shm, fd,
|
||||
width, height,
|
||||
stride, format);
|
||||
|
||||
close (fd);
|
||||
|
||||
*data_out = data;
|
||||
*buf_length = size;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_cairo_surface_destroy (void *p)
|
||||
{
|
||||
GdkWaylandCairoSurfaceData *data = p;
|
||||
|
||||
if (data->buffer)
|
||||
wl_buffer_destroy (data->buffer);
|
||||
|
||||
munmap (data->buf, data->buf_length);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
gdk_wayland_create_cairo_surface (GdkWaylandDisplay *display,
|
||||
int width, int height)
|
||||
{
|
||||
GdkWaylandCairoSurfaceData *data;
|
||||
cairo_surface_t *surface = NULL;
|
||||
cairo_status_t status;
|
||||
|
||||
data = g_new (GdkWaylandCairoSurfaceData, 1);
|
||||
data->display = display;
|
||||
data->buffer = NULL;
|
||||
data->width = width;
|
||||
data->height = height;
|
||||
|
||||
data->buffer = create_shm_buffer (display->shm,
|
||||
width,
|
||||
height,
|
||||
WL_SHM_FORMAT_ARGB8888,
|
||||
&data->buf_length,
|
||||
&data->buf);
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data->buf,
|
||||
CAIRO_FORMAT_ARGB32,
|
||||
width,
|
||||
height,
|
||||
width * 4);
|
||||
|
||||
cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key,
|
||||
data, gdk_wayland_cairo_surface_destroy);
|
||||
|
||||
status = cairo_surface_status (surface);
|
||||
if (status != CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
g_critical (G_STRLOC ": Unable to create Cairo image surface: %s",
|
||||
cairo_status_to_string (status));
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* On this first call this creates a double reference - the first reference
|
||||
* is held by the GdkWindowImplWayland struct - since unlike other backends
|
||||
@@ -446,8 +545,8 @@ static cairo_surface_t *
|
||||
gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkDisplayWayland *display_wayland =
|
||||
GDK_DISPLAY_WAYLAND (gdk_window_get_display (impl->wrapper));
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper));
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (impl->wrapper))
|
||||
return NULL;
|
||||
@@ -465,6 +564,24 @@ gdk_wayland_window_ref_cairo_surface (GdkWindow *window)
|
||||
return impl->cairo_surface;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gdk_window_impl_wayland_finalize (GObject *object)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (object);
|
||||
|
||||
if (impl->cursor)
|
||||
g_object_unref (impl->cursor);
|
||||
if (impl->server_surface)
|
||||
cairo_surface_destroy (impl->server_surface);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_configure (GdkWindow *window,
|
||||
int width, int height, int edges)
|
||||
@@ -577,12 +694,12 @@ static void
|
||||
gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayWayland *display_wayland;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkEvent *event;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
display_wayland = GDK_DISPLAY_WAYLAND (display);
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
if (impl->user_time != 0 &&
|
||||
display_wayland->user_time != 0 &&
|
||||
@@ -691,14 +808,17 @@ gdk_window_wayland_restack_toplevel (GdkWindow *window,
|
||||
|
||||
static void
|
||||
gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
if (with_move)
|
||||
{
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
}
|
||||
|
||||
/* If this function is called with width and height = -1 then that means
|
||||
* just move the window - don't update its size
|
||||
@@ -754,6 +874,32 @@ gdk_window_wayland_get_geometry (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_window_offset (GdkWindow *window,
|
||||
gint *x_out,
|
||||
gint *y_out)
|
||||
{
|
||||
GdkWindowImplWayland *impl, *parent_impl;
|
||||
GdkWindow *parent_window;
|
||||
gint x_offset = 0, y_offset = 0;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
parent_window = impl->transient_for;
|
||||
while (parent_window)
|
||||
{
|
||||
parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent_window->impl);
|
||||
|
||||
x_offset += window->x;
|
||||
y_offset += window->y;
|
||||
|
||||
parent_window = parent_impl->transient_for;
|
||||
}
|
||||
|
||||
*x_out = x_offset;
|
||||
*y_out = y_offset;
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_window_wayland_get_root_coords (GdkWindow *window,
|
||||
gint x,
|
||||
@@ -761,11 +907,12 @@ gdk_window_wayland_get_root_coords (GdkWindow *window,
|
||||
gint *root_x,
|
||||
gint *root_y)
|
||||
{
|
||||
/* We can't do this. */
|
||||
if (root_x)
|
||||
*root_x = 0;
|
||||
if (root_y)
|
||||
*root_y = 0;
|
||||
gint x_offset, y_offset;
|
||||
|
||||
_gdk_wayland_window_offset (window, &x_offset, &y_offset);
|
||||
|
||||
*root_x = x_offset + x;
|
||||
*root_y = y_offset + y;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -833,21 +980,7 @@ gdk_wayland_window_translate (GdkWindow *window,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
||||
surface = gdk_wayland_window_ref_cairo_surface (window->impl_window);
|
||||
cr = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
gdk_cairo_region (cr, area);
|
||||
cairo_clip (cr);
|
||||
cairo_set_source_surface (cr, cairo_get_target (cr), dx, dy);
|
||||
cairo_push_group (cr);
|
||||
cairo_paint (cr);
|
||||
cairo_pop_group_to_source (cr);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
_gdk_window_invalidate_for_expose (window, area);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -866,9 +999,6 @@ gdk_wayland_window_destroy (GdkWindow *window,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
if (impl->texture)
|
||||
glDeleteTextures(1, &impl->texture);
|
||||
|
||||
if (!recursing && !foreign_destroy)
|
||||
{
|
||||
if (GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface)
|
||||
@@ -1362,10 +1492,13 @@ gdk_wayland_window_destroy_notify (GdkWindow *window)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_process_updates_recurse (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
gdk_wayland_window_process_updates_recurse (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
#ifndef GDK_WAYLAND_USE_EGL
|
||||
GdkWaylandCairoSurfaceData *data = NULL;
|
||||
#endif
|
||||
cairo_rectangle_int_t rect;
|
||||
int i, n;
|
||||
|
||||
@@ -1374,12 +1507,23 @@ gdk_wayland_window_process_updates_recurse (GdkWindow *window,
|
||||
if (impl->cairo_surface)
|
||||
gdk_wayland_window_attach_image (window);
|
||||
|
||||
#ifndef GDK_WAYLAND_USE_EGL
|
||||
if (impl->server_surface)
|
||||
data = cairo_surface_get_user_data (impl->server_surface,
|
||||
&gdk_wayland_cairo_key);
|
||||
#endif
|
||||
|
||||
n = cairo_region_num_rectangles(region);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, i, &rect);
|
||||
#ifndef GDK_WAYLAND_USE_EGL
|
||||
if (data && data->buffer)
|
||||
wl_buffer_damage (data->buffer,
|
||||
rect.x, rect.y, rect.width, rect.height);
|
||||
#endif
|
||||
wl_surface_damage (impl->surface,
|
||||
rect.x, rect.y, rect.width, rect.height);
|
||||
rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
_gdk_window_process_updates_recurse (window, region);
|
||||
|
||||
@@ -29,6 +29,8 @@ libgdk_win32_la_SOURCES = \
|
||||
gdkcursor-win32.c \
|
||||
gdkdevicemanager-win32.c \
|
||||
gdkdevicemanager-win32.h \
|
||||
gdkdevice-virtual.c \
|
||||
gdkdevice-virtual.h \
|
||||
gdkdevice-win32.c \
|
||||
gdkdevice-win32.h \
|
||||
gdkdevice-wintab.c \
|
||||
|
||||
@@ -0,0 +1,429 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk/gdkwindow.h>
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <objbase.h>
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkdevice-virtual.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
static gboolean gdk_device_virtual_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events);
|
||||
static void gdk_device_virtual_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_device_virtual_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
static void gdk_device_virtual_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y);
|
||||
static void gdk_device_virtual_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
static GdkGrabStatus gdk_device_virtual_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_);
|
||||
static void gdk_device_virtual_ungrab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
static GdkWindow * gdk_device_virtual_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel);
|
||||
static void gdk_device_virtual_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkDeviceVirtual, gdk_device_virtual, GDK_TYPE_DEVICE)
|
||||
|
||||
static void
|
||||
gdk_device_virtual_class_init (GdkDeviceVirtualClass *klass)
|
||||
{
|
||||
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
|
||||
|
||||
device_class->get_history = gdk_device_virtual_get_history;
|
||||
device_class->get_state = gdk_device_virtual_get_state;
|
||||
device_class->set_window_cursor = gdk_device_virtual_set_window_cursor;
|
||||
device_class->warp = gdk_device_virtual_warp;
|
||||
device_class->query_state = gdk_device_virtual_query_state;
|
||||
device_class->grab = gdk_device_virtual_grab;
|
||||
device_class->ungrab = gdk_device_virtual_ungrab;
|
||||
device_class->window_at_position = gdk_device_virtual_window_at_position;
|
||||
device_class->select_window_events = gdk_device_virtual_select_window_events;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_init (GdkDeviceVirtual *device_virtual)
|
||||
{
|
||||
GdkDevice *device;
|
||||
|
||||
device = GDK_DEVICE (device_virtual);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_device_virtual_set_active (GdkDevice *device,
|
||||
GdkDevice *new_active)
|
||||
{
|
||||
GdkDeviceVirtual *virtual = GDK_DEVICE_VIRTUAL (device);
|
||||
int n_axes, i;
|
||||
GdkAtom label_atom;
|
||||
GdkAxisUse use;
|
||||
gdouble min_value, max_value, resolution;
|
||||
|
||||
if (virtual->active_device == new_active)
|
||||
return;
|
||||
|
||||
virtual->active_device = new_active;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
_gdk_device_reset_axes (device);
|
||||
n_axes = gdk_device_get_n_axes (new_active);
|
||||
for (i = 0; i < n_axes; i++)
|
||||
{
|
||||
_gdk_device_get_axis_info (new_active, i,
|
||||
&label_atom, &use,
|
||||
&min_value, &max_value, &resolution);
|
||||
_gdk_device_add_axis (device,
|
||||
label_atom, use,
|
||||
min_value, max_value, resolution);
|
||||
}
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (G_OBJECT (device), "changed");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_device_virtual_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events)
|
||||
{
|
||||
/* History is only per slave device */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkDeviceVirtual *virtual = GDK_DEVICE_VIRTUAL (device);
|
||||
GdkDevice *active = virtual->active_device;
|
||||
|
||||
GDK_DEVICE_GET_CLASS (active)->get_state (active,
|
||||
window, axes, mask);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
GdkWin32Cursor *cursor_private;
|
||||
GdkWindow *parent_window;
|
||||
GdkWindowImplWin32 *impl;
|
||||
HCURSOR hcursor;
|
||||
HCURSOR hprevcursor;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
cursor_private = (GdkWin32Cursor*) cursor;
|
||||
|
||||
hprevcursor = impl->hcursor;
|
||||
|
||||
if (!cursor)
|
||||
hcursor = NULL;
|
||||
else
|
||||
hcursor = cursor_private->hcursor;
|
||||
|
||||
if (hcursor != NULL)
|
||||
{
|
||||
/* If the pointer is over our window, set new cursor */
|
||||
GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL);
|
||||
|
||||
if (curr_window == window ||
|
||||
(curr_window && window == gdk_window_get_toplevel (curr_window)))
|
||||
SetCursor (hcursor);
|
||||
else
|
||||
{
|
||||
/* Climb up the tree and find whether our window is the
|
||||
* first ancestor that has cursor defined, and if so, set
|
||||
* new cursor.
|
||||
*/
|
||||
while (curr_window && curr_window->impl &&
|
||||
!GDK_WINDOW_IMPL_WIN32 (curr_window->impl)->hcursor)
|
||||
{
|
||||
curr_window = curr_window->parent;
|
||||
if (curr_window == GDK_WINDOW (window))
|
||||
{
|
||||
SetCursor (hcursor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Unset the previous cursor: Need to make sure it's no longer in
|
||||
* use before we destroy it, in case we're not over our window but
|
||||
* the cursor is still set to our old one.
|
||||
*/
|
||||
if (hprevcursor != NULL &&
|
||||
GetCursor () == hprevcursor)
|
||||
{
|
||||
/* Look for a suitable cursor to use instead */
|
||||
hcursor = NULL;
|
||||
parent_window = GDK_WINDOW (window)->parent;
|
||||
|
||||
while (hcursor == NULL)
|
||||
{
|
||||
if (parent_window)
|
||||
{
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl);
|
||||
hcursor = impl->hcursor;
|
||||
parent_window = parent_window->parent;
|
||||
}
|
||||
else
|
||||
hcursor = LoadCursor (NULL, IDC_ARROW);
|
||||
}
|
||||
|
||||
SetCursor (hcursor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
SetCursorPos (x - _gdk_offset_x, y - _gdk_offset_y);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gint *root_x,
|
||||
gint *root_y,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkDeviceVirtual *virtual = GDK_DEVICE_VIRTUAL (device);
|
||||
|
||||
_gdk_device_query_state (virtual->active_device,
|
||||
window, root_window, child_window,
|
||||
root_x, root_y,
|
||||
win_x, win_y,
|
||||
mask);
|
||||
}
|
||||
|
||||
static GdkGrabStatus
|
||||
gdk_device_virtual_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
HCURSOR hcursor;
|
||||
GdkWin32Cursor *cursor_private;
|
||||
|
||||
cursor_private = (GdkWin32Cursor*) cursor;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
if (!cursor)
|
||||
hcursor = NULL;
|
||||
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
|
||||
WIN32_API_FAILED ("CopyCursor");
|
||||
|
||||
if (_gdk_win32_grab_cursor != NULL)
|
||||
{
|
||||
if (GetCursor () == _gdk_win32_grab_cursor)
|
||||
SetCursor (NULL);
|
||||
DestroyCursor (_gdk_win32_grab_cursor);
|
||||
}
|
||||
|
||||
_gdk_win32_grab_cursor = hcursor;
|
||||
|
||||
if (_gdk_win32_grab_cursor != NULL)
|
||||
SetCursor (_gdk_win32_grab_cursor);
|
||||
else if (impl->hcursor != NULL)
|
||||
SetCursor (impl->hcursor);
|
||||
else
|
||||
SetCursor (LoadCursor (NULL, IDC_ARROW));
|
||||
|
||||
SetCapture (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
|
||||
return GDK_GRAB_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkDeviceGrabInfo *info;
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_device_get_display (device);
|
||||
info = _gdk_display_get_last_device_grab (display, device);
|
||||
|
||||
if (info)
|
||||
info->serial_end = 0;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
if (_gdk_win32_grab_cursor != NULL)
|
||||
{
|
||||
if (GetCursor () == _gdk_win32_grab_cursor)
|
||||
SetCursor (NULL);
|
||||
DestroyCursor (_gdk_win32_grab_cursor);
|
||||
}
|
||||
_gdk_win32_grab_cursor = NULL;
|
||||
|
||||
ReleaseCapture ();
|
||||
}
|
||||
|
||||
_gdk_display_device_grab_update (display, device, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
|
||||
{
|
||||
*client_pt = screen_pt;
|
||||
ScreenToClient (hwnd, client_pt);
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_device_virtual_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
{
|
||||
GdkWindow *window = NULL;
|
||||
POINT screen_pt, client_pt;
|
||||
HWND hwnd, hwndc;
|
||||
RECT rect;
|
||||
|
||||
GetCursorPos (&screen_pt);
|
||||
|
||||
if (get_toplevel)
|
||||
{
|
||||
/* Only consider visible children of the desktop to avoid the various
|
||||
* non-visible windows you often find on a running Windows box. These
|
||||
* might overlap our windows and cause our walk to fail. As we assume
|
||||
* WindowFromPoint() can find our windows, we follow similar logic
|
||||
* here, and ignore invisible and disabled windows.
|
||||
*/
|
||||
hwnd = GetDesktopWindow ();
|
||||
do {
|
||||
window = gdk_win32_handle_table_lookup (hwnd);
|
||||
|
||||
if (window != NULL &&
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_ROOT &&
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
|
||||
break;
|
||||
|
||||
screen_to_client (hwnd, screen_pt, &client_pt);
|
||||
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
|
||||
CWP_SKIPINVISIBLE);
|
||||
|
||||
/* Verify that we're really inside the client area of the window */
|
||||
if (hwndc != hwnd)
|
||||
{
|
||||
GetClientRect (hwndc, &rect);
|
||||
screen_to_client (hwndc, screen_pt, &client_pt);
|
||||
if (!PtInRect (&rect, client_pt))
|
||||
hwndc = hwnd;
|
||||
}
|
||||
|
||||
} while (hwndc != hwnd && (hwnd = hwndc, 1));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
hwnd = WindowFromPoint (screen_pt);
|
||||
|
||||
/* Verify that we're really inside the client area of the window */
|
||||
GetClientRect (hwnd, &rect);
|
||||
screen_to_client (hwnd, screen_pt, &client_pt);
|
||||
if (!PtInRect (&rect, client_pt))
|
||||
hwnd = NULL;
|
||||
|
||||
/* If we didn't hit any window at that point, return the desktop */
|
||||
if (hwnd == NULL)
|
||||
{
|
||||
if (win_x)
|
||||
*win_x = screen_pt.x + _gdk_offset_x;
|
||||
if (win_y)
|
||||
*win_y = screen_pt.y + _gdk_offset_y;
|
||||
return _gdk_root;
|
||||
}
|
||||
|
||||
window = gdk_win32_handle_table_lookup (hwnd);
|
||||
}
|
||||
|
||||
if (window && (win_x || win_y))
|
||||
{
|
||||
if (win_x)
|
||||
*win_x = client_pt.x;
|
||||
if (win_y)
|
||||
*win_y = client_pt.y;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_virtual_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DEVICE_VIRTUAL_H__
|
||||
#define __GDK_DEVICE_VIRTUAL_H__
|
||||
|
||||
#include <gdk/gdkdeviceprivate.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_DEVICE_VIRTUAL (gdk_device_virtual_get_type ())
|
||||
#define GDK_DEVICE_VIRTUAL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_VIRTUAL, GdkDeviceVirtual))
|
||||
#define GDK_DEVICE_VIRTUAL_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_VIRTUAL, GdkDeviceVirtualClass))
|
||||
#define GDK_IS_DEVICE_VIRTUAL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_VIRTUAL))
|
||||
#define GDK_IS_DEVICE_VIRTUAL_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_VIRTUAL))
|
||||
#define GDK_DEVICE_VIRTUAL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_VIRTUAL, GdkDeviceVirtualClass))
|
||||
|
||||
typedef struct _GdkDeviceVirtual GdkDeviceVirtual;
|
||||
typedef struct _GdkDeviceVirtualClass GdkDeviceVirtualClass;
|
||||
|
||||
struct _GdkDeviceVirtual
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
GdkDevice *active_device;
|
||||
};
|
||||
|
||||
struct _GdkDeviceVirtualClass
|
||||
{
|
||||
GdkDeviceClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_device_virtual_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void _gdk_device_virtual_set_active (GdkDevice *device,
|
||||
GdkDevice *new_active);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DEVICE_VIRTUAL_H__ */
|
||||
+2
-125
@@ -133,74 +133,6 @@ gdk_device_win32_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
GdkWin32Cursor *cursor_private;
|
||||
GdkWindow *parent_window;
|
||||
GdkWindowImplWin32 *impl;
|
||||
HCURSOR hcursor;
|
||||
HCURSOR hprevcursor;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
cursor_private = (GdkWin32Cursor*) cursor;
|
||||
|
||||
hprevcursor = impl->hcursor;
|
||||
|
||||
if (!cursor)
|
||||
hcursor = NULL;
|
||||
else
|
||||
hcursor = cursor_private->hcursor;
|
||||
|
||||
if (hcursor != NULL)
|
||||
{
|
||||
/* If the pointer is over our window, set new cursor */
|
||||
GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL);
|
||||
|
||||
if (curr_window == window ||
|
||||
(curr_window && window == gdk_window_get_toplevel (curr_window)))
|
||||
SetCursor (hcursor);
|
||||
else
|
||||
{
|
||||
/* Climb up the tree and find whether our window is the
|
||||
* first ancestor that has cursor defined, and if so, set
|
||||
* new cursor.
|
||||
*/
|
||||
while (curr_window && curr_window->impl &&
|
||||
!GDK_WINDOW_IMPL_WIN32 (curr_window->impl)->hcursor)
|
||||
{
|
||||
curr_window = curr_window->parent;
|
||||
if (curr_window == GDK_WINDOW (window))
|
||||
{
|
||||
SetCursor (hcursor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Unset the previous cursor: Need to make sure it's no longer in
|
||||
* use before we destroy it, in case we're not over our window but
|
||||
* the cursor is still set to our old one.
|
||||
*/
|
||||
if (hprevcursor != NULL &&
|
||||
GetCursor () == hprevcursor)
|
||||
{
|
||||
/* Look for a suitable cursor to use instead */
|
||||
hcursor = NULL;
|
||||
parent_window = GDK_WINDOW (window)->parent;
|
||||
|
||||
while (hcursor == NULL)
|
||||
{
|
||||
if (parent_window)
|
||||
{
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl);
|
||||
hcursor = impl->hcursor;
|
||||
parent_window = parent_window->parent;
|
||||
}
|
||||
else
|
||||
hcursor = LoadCursor (NULL, IDC_ARROW);
|
||||
}
|
||||
|
||||
SetCursor (hcursor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -209,7 +141,6 @@ gdk_device_win32_warp (GdkDevice *device,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
SetCursorPos (x - _gdk_offset_x, y - _gdk_offset_y);
|
||||
}
|
||||
|
||||
static GdkModifierType
|
||||
@@ -309,68 +240,14 @@ gdk_device_win32_grab (GdkDevice *device,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
HCURSOR hcursor;
|
||||
GdkWin32Cursor *cursor_private;
|
||||
|
||||
cursor_private = (GdkWin32Cursor*) cursor;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
if (!cursor)
|
||||
hcursor = NULL;
|
||||
else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL)
|
||||
WIN32_API_FAILED ("CopyCursor");
|
||||
|
||||
if (_gdk_win32_grab_cursor != NULL)
|
||||
{
|
||||
if (GetCursor () == _gdk_win32_grab_cursor)
|
||||
SetCursor (NULL);
|
||||
DestroyCursor (_gdk_win32_grab_cursor);
|
||||
}
|
||||
|
||||
_gdk_win32_grab_cursor = hcursor;
|
||||
|
||||
if (_gdk_win32_grab_cursor != NULL)
|
||||
SetCursor (_gdk_win32_grab_cursor);
|
||||
else if (impl->hcursor != NULL)
|
||||
SetCursor (impl->hcursor);
|
||||
else
|
||||
SetCursor (LoadCursor (NULL, IDC_ARROW));
|
||||
|
||||
SetCapture (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
|
||||
return GDK_GRAB_SUCCESS;
|
||||
/* No support for grabbing the slave atm */
|
||||
return GDK_GRAB_NOT_VIEWABLE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_win32_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkDeviceGrabInfo *info;
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_device_get_display (device);
|
||||
info = _gdk_display_get_last_device_grab (display, device);
|
||||
|
||||
if (info)
|
||||
info->serial_end = 0;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
if (_gdk_win32_grab_cursor != NULL)
|
||||
{
|
||||
if (GetCursor () == _gdk_win32_grab_cursor)
|
||||
SetCursor (NULL);
|
||||
DestroyCursor (_gdk_win32_grab_cursor);
|
||||
}
|
||||
_gdk_win32_grab_cursor = NULL;
|
||||
|
||||
ReleaseCapture ();
|
||||
}
|
||||
|
||||
_gdk_display_device_grab_update (display, device, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+90
-119
@@ -25,16 +25,6 @@
|
||||
#include "gdkwin32.h"
|
||||
#include "gdkdevice-wintab.h"
|
||||
|
||||
static GQuark quark_window_input_info = 0;
|
||||
static GSList *input_windows = NULL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gdouble root_x;
|
||||
gdouble root_y;
|
||||
GHashTable *device_events;
|
||||
} GdkWindowInputInfo;
|
||||
|
||||
static gboolean gdk_device_wintab_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
@@ -96,8 +86,6 @@ gdk_device_wintab_class_init (GdkDeviceWintabClass *klass)
|
||||
device_class->ungrab = gdk_device_wintab_ungrab;
|
||||
device_class->window_at_position = gdk_device_wintab_window_at_position;
|
||||
device_class->select_window_events = gdk_device_wintab_select_window_events;
|
||||
|
||||
quark_window_input_info = g_quark_from_static_string ("gdk-window-input-info");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -119,6 +107,32 @@ gdk_device_wintab_get_history (GdkDevice *device,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkModifierType
|
||||
get_current_mask (void)
|
||||
{
|
||||
GdkModifierType mask;
|
||||
BYTE kbd[256];
|
||||
|
||||
GetKeyboardState (kbd);
|
||||
mask = 0;
|
||||
if (kbd[VK_SHIFT] & 0x80)
|
||||
mask |= GDK_SHIFT_MASK;
|
||||
if (kbd[VK_CAPITAL] & 0x80)
|
||||
mask |= GDK_LOCK_MASK;
|
||||
if (kbd[VK_CONTROL] & 0x80)
|
||||
mask |= GDK_CONTROL_MASK;
|
||||
if (kbd[VK_MENU] & 0x80)
|
||||
mask |= GDK_MOD1_MASK;
|
||||
if (kbd[VK_LBUTTON] & 0x80)
|
||||
mask |= GDK_BUTTON1_MASK;
|
||||
if (kbd[VK_MBUTTON] & 0x80)
|
||||
mask |= GDK_BUTTON2_MASK;
|
||||
if (kbd[VK_RBUTTON] & 0x80)
|
||||
mask |= GDK_BUTTON3_MASK;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_wintab_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
@@ -134,7 +148,7 @@ gdk_device_wintab_get_state (GdkDevice *device,
|
||||
* second, the info should be fairly up to date */
|
||||
if (mask)
|
||||
{
|
||||
gdk_window_get_pointer (window, NULL, NULL, mask);
|
||||
*mask = get_current_mask ();
|
||||
*mask &= 0xFF; /* Mask away core pointer buttons */
|
||||
*mask |= ((device_wintab->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
@@ -142,7 +156,7 @@ gdk_device_wintab_get_state (GdkDevice *device,
|
||||
| GDK_BUTTON5_MASK));
|
||||
}
|
||||
|
||||
if (device_wintab->last_axis_data)
|
||||
if (axes && device_wintab->last_axis_data)
|
||||
_gdk_device_wintab_translate_axes (device_wintab, window, axes, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -172,7 +186,66 @@ gdk_device_wintab_query_state (GdkDevice *device,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
g_warning ("query_state unimplemented for wintab devices. Expect bad things.");
|
||||
GdkDeviceWintab *device_wintab;
|
||||
POINT point;
|
||||
HWND hwnd, hwndc;
|
||||
|
||||
device_wintab = GDK_DEVICE_WINTAB (device);
|
||||
|
||||
hwnd = GDK_WINDOW_HWND (window);
|
||||
GetCursorPos (&point);
|
||||
|
||||
if (root_x)
|
||||
*root_x = point.x;
|
||||
|
||||
if (root_y)
|
||||
*root_y = point.y;
|
||||
|
||||
ScreenToClient (hwnd, &point);
|
||||
|
||||
if (win_x)
|
||||
*win_x = point.x;
|
||||
|
||||
if (win_y)
|
||||
*win_y = point.y;
|
||||
|
||||
if (window == _gdk_root)
|
||||
{
|
||||
if (win_x)
|
||||
*win_x += _gdk_offset_x;
|
||||
|
||||
if (win_y)
|
||||
*win_y += _gdk_offset_y;
|
||||
}
|
||||
|
||||
if (child_window)
|
||||
{
|
||||
hwndc = ChildWindowFromPoint (hwnd, point);
|
||||
|
||||
if (hwndc && hwndc != hwnd)
|
||||
*child_window = gdk_win32_handle_table_lookup (hwndc);
|
||||
else
|
||||
*child_window = NULL; /* Direct child unknown to gdk */
|
||||
}
|
||||
|
||||
if (root_window)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
|
||||
screen = gdk_window_get_screen (window);
|
||||
*root_window = gdk_screen_get_root_window (screen);
|
||||
}
|
||||
|
||||
if (mask)
|
||||
{
|
||||
*mask = get_current_mask ();
|
||||
*mask &= 0xFF; /* Mask away core pointer buttons */
|
||||
*mask |= ((device_wintab->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static GdkGrabStatus
|
||||
@@ -203,112 +276,11 @@ gdk_device_wintab_window_at_position (GdkDevice *device,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
input_info_free (GdkWindowInputInfo *info)
|
||||
{
|
||||
g_hash_table_destroy (info->device_events);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_wintab_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
GdkWindowInputInfo *info;
|
||||
|
||||
info = g_object_get_qdata (G_OBJECT (window),
|
||||
quark_window_input_info);
|
||||
if (event_mask)
|
||||
{
|
||||
if (!info)
|
||||
{
|
||||
info = g_new0 (GdkWindowInputInfo, 1);
|
||||
info->device_events = g_hash_table_new (NULL, NULL);
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (window),
|
||||
quark_window_input_info,
|
||||
info,
|
||||
(GDestroyNotify) input_info_free);
|
||||
input_windows = g_slist_prepend (input_windows, window);
|
||||
}
|
||||
|
||||
g_hash_table_insert (info->device_events, device,
|
||||
GUINT_TO_POINTER (event_mask));
|
||||
}
|
||||
else if (info)
|
||||
{
|
||||
g_hash_table_remove (info->device_events, device);
|
||||
|
||||
if (g_hash_table_size (info->device_events) == 0)
|
||||
{
|
||||
g_object_set_qdata (G_OBJECT (window),
|
||||
quark_window_input_info,
|
||||
NULL);
|
||||
input_windows = g_slist_remove (input_windows, window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_device_wintab_wants_events (GdkWindow *window)
|
||||
{
|
||||
GdkWindowInputInfo *info;
|
||||
|
||||
info = g_object_get_qdata (G_OBJECT (window),
|
||||
quark_window_input_info);
|
||||
|
||||
return info != NULL;
|
||||
}
|
||||
|
||||
GdkEventMask
|
||||
_gdk_device_wintab_get_events (GdkDeviceWintab *device,
|
||||
GdkWindow *window)
|
||||
{
|
||||
GdkWindowInputInfo *info;
|
||||
|
||||
info = g_object_get_qdata (G_OBJECT (window),
|
||||
quark_window_input_info);
|
||||
|
||||
if (!info)
|
||||
return 0;
|
||||
|
||||
return GPOINTER_TO_UINT (g_hash_table_lookup (info->device_events, device));
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_device_wintab_get_window_coords (GdkWindow *window,
|
||||
gdouble *root_x,
|
||||
gdouble *root_y)
|
||||
{
|
||||
GdkWindowInputInfo *info;
|
||||
|
||||
info = g_object_get_qdata (G_OBJECT (window),
|
||||
quark_window_input_info);
|
||||
|
||||
if (!info)
|
||||
return FALSE;
|
||||
|
||||
*root_x = info->root_x;
|
||||
*root_y = info->root_y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_device_wintab_update_window_coords (GdkWindow *window)
|
||||
{
|
||||
GdkWindowInputInfo *info;
|
||||
gint root_x, root_y;
|
||||
|
||||
info = g_object_get_qdata (G_OBJECT (window),
|
||||
quark_window_input_info);
|
||||
|
||||
g_return_if_fail (info != NULL);
|
||||
|
||||
gdk_window_get_origin (window, &root_x, &root_y);
|
||||
info->root_x = (gdouble) root_x;
|
||||
info->root_y = (gdouble) root_y;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -320,7 +292,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
|
||||
{
|
||||
GdkDevice *device;
|
||||
GdkWindow *impl_window;
|
||||
gdouble root_x, root_y;
|
||||
gint root_x, root_y;
|
||||
gdouble temp_x, temp_y;
|
||||
gint i;
|
||||
|
||||
@@ -328,8 +300,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
|
||||
impl_window = _gdk_window_get_impl_window (window);
|
||||
temp_x = temp_y = 0;
|
||||
|
||||
if (!_gdk_device_wintab_get_window_coords (impl_window, &root_x, &root_y))
|
||||
return;
|
||||
gdk_window_get_origin (impl_window, &root_x, &root_y);
|
||||
|
||||
for (i = 0; i < gdk_device_get_n_axes (device); i++)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ struct _GdkDeviceWintab
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
|
||||
gboolean sends_core;
|
||||
gint *last_axis_data;
|
||||
gint button_state;
|
||||
|
||||
@@ -59,14 +60,6 @@ struct _GdkDeviceWintabClass
|
||||
|
||||
GType gdk_device_wintab_get_type (void) G_GNUC_CONST;
|
||||
|
||||
gboolean _gdk_device_wintab_wants_events (GdkWindow *window);
|
||||
GdkEventMask _gdk_device_wintab_get_events (GdkDeviceWintab *device,
|
||||
GdkWindow *window);
|
||||
gboolean _gdk_device_wintab_get_window_coords (GdkWindow *window,
|
||||
gdouble *root_x,
|
||||
gdouble *root_y);
|
||||
void _gdk_device_wintab_update_window_coords (GdkWindow *window);
|
||||
|
||||
void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
|
||||
+145
-116
@@ -27,6 +27,7 @@
|
||||
#include "gdkdevicemanager-win32.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdevice-win32.h"
|
||||
#include "gdkdevice-virtual.h"
|
||||
#include "gdkdevice-wintab.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
|
||||
@@ -38,18 +39,18 @@
|
||||
#include <pktdef.h>
|
||||
|
||||
#define DEBUG_WINTAB 1 /* Verbose debug messages enabled */
|
||||
#define PROXIMITY_OUT_DELAY 200 /* In milliseconds, see set_ignore_core */
|
||||
#define TWOPI (2 * G_PI)
|
||||
|
||||
static GList *wintab_contexts = NULL;
|
||||
static GdkWindow *wintab_window = NULL;
|
||||
static guint ignore_core_timer = 0;
|
||||
extern gint _gdk_input_ignore_core;
|
||||
|
||||
typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c);
|
||||
typedef UINT (WINAPI *t_WTInfoW) (UINT a, UINT b, LPVOID c);
|
||||
typedef BOOL (WINAPI *t_WTEnable) (HCTX a, BOOL b);
|
||||
typedef HCTX (WINAPI *t_WTOpenA) (HWND a, LPLOGCONTEXTA b, BOOL c);
|
||||
typedef BOOL (WINAPI *t_WTGetA) (HCTX a, LPLOGCONTEXTA b);
|
||||
typedef BOOL (WINAPI *t_WTSetA) (HCTX a, LPLOGCONTEXTA b);
|
||||
typedef BOOL (WINAPI *t_WTOverlap) (HCTX a, BOOL b);
|
||||
typedef BOOL (WINAPI *t_WTPacket) (HCTX a, UINT b, LPVOID c);
|
||||
typedef int (WINAPI *t_WTQueueSizeSet) (HCTX a, int b);
|
||||
@@ -58,6 +59,8 @@ static t_WTInfoA p_WTInfoA;
|
||||
static t_WTInfoW p_WTInfoW;
|
||||
static t_WTEnable p_WTEnable;
|
||||
static t_WTOpenA p_WTOpenA;
|
||||
static t_WTGetA p_WTGetA;
|
||||
static t_WTSetA p_WTSetA;
|
||||
static t_WTOverlap p_WTOverlap;
|
||||
static t_WTPacket p_WTPacket;
|
||||
static t_WTQueueSizeSet p_WTQueueSizeSet;
|
||||
@@ -86,25 +89,31 @@ gdk_device_manager_win32_class_init (GdkDeviceManagerWin32Class *klass)
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
create_core_pointer (GdkDeviceManager *device_manager)
|
||||
create_pointer (GdkDeviceManager *device_manager,
|
||||
GType g_type,
|
||||
const char *name,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_WIN32,
|
||||
"name", "Core Pointer",
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
return g_object_new (g_type,
|
||||
"name", name,
|
||||
"type", type,
|
||||
"input-source", GDK_SOURCE_MOUSE,
|
||||
"input-mode", GDK_MODE_SCREEN,
|
||||
"has-cursor", TRUE,
|
||||
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
|
||||
"display", _gdk_display,
|
||||
"device-manager", device_manager,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
create_core_keyboard (GdkDeviceManager *device_manager)
|
||||
create_keyboard (GdkDeviceManager *device_manager,
|
||||
GType g_type,
|
||||
const char *name,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_WIN32,
|
||||
"name", "Core Keyboard",
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
return g_object_new (g_type,
|
||||
"name", name,
|
||||
"type", type,
|
||||
"input-source", GDK_SOURCE_KEYBOARD,
|
||||
"input-mode", GDK_MODE_SCREEN,
|
||||
"has-cursor", FALSE,
|
||||
@@ -419,6 +428,10 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
|
||||
return;
|
||||
if ((p_WTOpenA = (t_WTOpenA) GetProcAddress (wintab32, "WTOpenA")) == NULL)
|
||||
return;
|
||||
if ((p_WTGetA = (t_WTGetA) GetProcAddress (wintab32, "WTGetA")) == NULL)
|
||||
return;
|
||||
if ((p_WTSetA = (t_WTSetA) GetProcAddress (wintab32, "WTSetA")) == NULL)
|
||||
return;
|
||||
if ((p_WTOverlap = (t_WTOverlap) GetProcAddress (wintab32, "WTOverlap")) == NULL)
|
||||
return;
|
||||
if ((p_WTPacket = (t_WTPacket) GetProcAddress (wintab32, "WTPacket")) == NULL)
|
||||
@@ -496,7 +509,7 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
|
||||
#if DEBUG_WINTAB
|
||||
GDK_NOTE (INPUT, (g_print("Default context:\n"), print_lc(&lc)));
|
||||
#endif
|
||||
lc.lcOptions |= CXO_MESSAGES;
|
||||
lc.lcOptions |= CXO_MESSAGES | CXO_CSRMESSAGES;
|
||||
lc.lcStatus = 0;
|
||||
lc.lcMsgBase = WT_DEFBASE;
|
||||
lc.lcPktRate = 0;
|
||||
@@ -506,8 +519,8 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
|
||||
lc.lcBtnUpMask = lc.lcBtnDnMask = ~0;
|
||||
lc.lcOutOrgX = axis_x.axMin;
|
||||
lc.lcOutOrgY = axis_y.axMin;
|
||||
lc.lcOutExtX = axis_x.axMax - axis_x.axMin;
|
||||
lc.lcOutExtY = axis_y.axMax - axis_y.axMin;
|
||||
lc.lcOutExtX = axis_x.axMax - axis_x.axMin + 1;
|
||||
lc.lcOutExtY = axis_y.axMax - axis_y.axMin + 1;
|
||||
lc.lcOutExtY = -lc.lcOutExtY; /* We want Y growing downward */
|
||||
#if DEBUG_WINTAB
|
||||
GDK_NOTE (INPUT, (g_print("context for device %d:\n", devix),
|
||||
@@ -537,7 +550,7 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
|
||||
* with a smaller queue size.
|
||||
*/
|
||||
GDK_NOTE (INPUT, g_print("Attempting to increase queue size\n"));
|
||||
for (i = 32; i >= 1; i >>= 1)
|
||||
for (i = 128; i >= 1; i >>= 1)
|
||||
{
|
||||
if ((*p_WTQueueSizeSet) (*hctx, i))
|
||||
{
|
||||
@@ -575,14 +588,21 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
|
||||
|
||||
device = g_object_new (GDK_TYPE_DEVICE_WINTAB,
|
||||
"name", device_name,
|
||||
"type", GDK_DEVICE_TYPE_SLAVE,
|
||||
"type", GDK_DEVICE_TYPE_FLOATING,
|
||||
"input-source", GDK_SOURCE_PEN,
|
||||
"input-mode", GDK_MODE_SCREEN,
|
||||
"has-cursor", FALSE,
|
||||
"has-cursor", lc.lcOptions & CXO_SYSTEM,
|
||||
"display", _gdk_display,
|
||||
"device-manager", device_manager,
|
||||
NULL);
|
||||
|
||||
device->sends_core = lc.lcOptions & CXO_SYSTEM;
|
||||
if (device->sends_core)
|
||||
{
|
||||
_gdk_device_set_associated_device (device_manager->system_pointer, GDK_DEVICE (device));
|
||||
_gdk_device_add_slave (device_manager->core_pointer, GDK_DEVICE (device));
|
||||
}
|
||||
|
||||
g_free (csrname_utf8);
|
||||
|
||||
device->hctx = *hctx;
|
||||
@@ -684,8 +704,35 @@ gdk_device_manager_win32_constructed (GObject *object)
|
||||
GdkDeviceManagerWin32 *device_manager;
|
||||
|
||||
device_manager = GDK_DEVICE_MANAGER_WIN32 (object);
|
||||
device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager));
|
||||
device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager));
|
||||
device_manager->core_pointer =
|
||||
create_pointer (GDK_DEVICE_MANAGER (device_manager),
|
||||
GDK_TYPE_DEVICE_VIRTUAL,
|
||||
"Virtual Core Pointer",
|
||||
GDK_DEVICE_TYPE_MASTER);
|
||||
device_manager->system_pointer =
|
||||
create_pointer (GDK_DEVICE_MANAGER (device_manager),
|
||||
GDK_TYPE_DEVICE_WIN32,
|
||||
"System Aggregated Pointer",
|
||||
GDK_DEVICE_TYPE_SLAVE);
|
||||
_gdk_device_virtual_set_active (device_manager->core_pointer,
|
||||
device_manager->system_pointer);
|
||||
_gdk_device_set_associated_device (device_manager->system_pointer, device_manager->core_pointer);
|
||||
_gdk_device_add_slave (device_manager->core_pointer, device_manager->system_pointer);
|
||||
|
||||
device_manager->core_keyboard =
|
||||
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
|
||||
GDK_TYPE_DEVICE_VIRTUAL,
|
||||
"Virtual Core Keyboard",
|
||||
GDK_DEVICE_TYPE_MASTER);
|
||||
device_manager->system_keyboard =
|
||||
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
|
||||
GDK_TYPE_DEVICE_WIN32,
|
||||
"System Aggregated Keyboard",
|
||||
GDK_DEVICE_TYPE_SLAVE);
|
||||
_gdk_device_virtual_set_active (device_manager->core_keyboard,
|
||||
device_manager->system_keyboard);
|
||||
_gdk_device_set_associated_device (device_manager->system_keyboard, device_manager->core_keyboard);
|
||||
_gdk_device_add_slave (device_manager->core_keyboard, device_manager->system_keyboard);
|
||||
|
||||
_gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard);
|
||||
_gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer);
|
||||
@@ -696,7 +743,7 @@ gdk_device_manager_win32_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkDeviceManagerWin32 *device_manager_win32;
|
||||
GList *devices = NULL;
|
||||
GList *devices = NULL, *l;
|
||||
|
||||
device_manager_win32 = (GdkDeviceManagerWin32 *) device_manager;
|
||||
|
||||
@@ -705,10 +752,24 @@ gdk_device_manager_win32_list_devices (GdkDeviceManager *device_manager,
|
||||
devices = g_list_prepend (devices, device_manager_win32->core_keyboard);
|
||||
devices = g_list_prepend (devices, device_manager_win32->core_pointer);
|
||||
}
|
||||
else if (type == GDK_DEVICE_TYPE_FLOATING)
|
||||
devices = g_list_copy (device_manager_win32->wintab_devices);
|
||||
else
|
||||
{
|
||||
if (type == GDK_DEVICE_TYPE_SLAVE)
|
||||
{
|
||||
devices = g_list_prepend (devices, device_manager_win32->system_keyboard);
|
||||
devices = g_list_prepend (devices, device_manager_win32->system_pointer);
|
||||
}
|
||||
|
||||
return devices;
|
||||
for (l = device_manager_win32->wintab_devices; l != NULL; l = l->next)
|
||||
{
|
||||
GdkDevice *device = l->data;
|
||||
|
||||
if (gdk_device_get_device_type (device) == type)
|
||||
devices = g_list_prepend (devices, device);
|
||||
}
|
||||
}
|
||||
|
||||
return g_list_reverse (devices);
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
@@ -791,41 +852,6 @@ get_modifier_key_state (void)
|
||||
return state;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ignore_core_timefunc (gpointer data)
|
||||
{
|
||||
/* The delay has passed */
|
||||
_gdk_input_ignore_core = FALSE;
|
||||
ignore_core_timer = 0;
|
||||
|
||||
return FALSE; /* remove timeout */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set or unset the _gdk_input_ignore_core variable that tells GDK
|
||||
* to ignore events for the core pointer when the tablet is in proximity
|
||||
* The unsetting is delayed slightly so that if a tablet event arrives
|
||||
* just after proximity out, it does not cause a core pointer event
|
||||
* which e.g. causes GIMP to switch tools.
|
||||
*/
|
||||
static void
|
||||
set_ignore_core (gboolean ignore)
|
||||
{
|
||||
if (ignore)
|
||||
{
|
||||
_gdk_input_ignore_core = TRUE;
|
||||
/* Remove any pending clear */
|
||||
if (ignore_core_timer)
|
||||
{
|
||||
g_source_remove (ignore_core_timer);
|
||||
ignore_core_timer = 0;
|
||||
}
|
||||
}
|
||||
else if (!ignore_core_timer)
|
||||
ignore_core_timer = gdk_threads_add_timeout (PROXIMITY_OUT_DELAY,
|
||||
ignore_core_timefunc, NULL);
|
||||
}
|
||||
|
||||
static GdkDeviceWintab *
|
||||
_gdk_device_manager_find_wintab_device (HCTX hctx,
|
||||
UINT cursor)
|
||||
@@ -855,15 +881,16 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
MSG *msg,
|
||||
GdkWindow *window)
|
||||
{
|
||||
GdkDeviceManagerWin32 *device_manager;
|
||||
GdkDisplay *display;
|
||||
GdkDeviceWintab *device = NULL;
|
||||
GdkDeviceWintab *source_device = NULL;
|
||||
GdkDeviceGrabInfo *last_grab;
|
||||
GdkEventMask masktest;
|
||||
guint key_state;
|
||||
POINT pt;
|
||||
|
||||
PACKET packet;
|
||||
gdouble root_x, root_y;
|
||||
gint root_x, root_y;
|
||||
gint num_axes;
|
||||
gint x, y;
|
||||
guint translated_buttons, button_diff, button_mask;
|
||||
@@ -878,6 +905,8 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
|
||||
|
||||
window = gdk_window_at_pointer (&x, &y);
|
||||
if (window == NULL)
|
||||
window = _gdk_root;
|
||||
@@ -889,7 +918,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
g_print ("_gdk_input_other_event: window=%p %+d%+d\n",
|
||||
GDK_WINDOW_HWND (window), x, y));
|
||||
|
||||
if (msg->message == WT_PACKET)
|
||||
if (msg->message == WT_PACKET || msg->message == WT_CSRCHANGE)
|
||||
{
|
||||
if (!(*p_WTPacket) ((HCTX) msg->lParam, msg->wParam, &packet))
|
||||
return FALSE;
|
||||
@@ -907,14 +936,14 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam,
|
||||
packet.pkCursor)) == NULL)
|
||||
if ((source_device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam,
|
||||
packet.pkCursor)) == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (gdk_device_get_mode (GDK_DEVICE (device)) == GDK_MODE_DISABLED)
|
||||
if (gdk_device_get_mode (GDK_DEVICE (source_device)) == GDK_MODE_DISABLED)
|
||||
return FALSE;
|
||||
|
||||
last_grab = _gdk_display_get_last_device_grab (_gdk_display, GDK_DEVICE (device));
|
||||
last_grab = _gdk_display_get_last_device_grab (_gdk_display, GDK_DEVICE (source_device));
|
||||
|
||||
if (last_grab && last_grab->window)
|
||||
{
|
||||
@@ -930,29 +959,29 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
}
|
||||
|
||||
num_axes = 0;
|
||||
if (device->pktdata & PK_X)
|
||||
device->last_axis_data[num_axes++] = packet.pkX;
|
||||
if (device->pktdata & PK_Y)
|
||||
device->last_axis_data[num_axes++] = packet.pkY;
|
||||
if (device->pktdata & PK_NORMAL_PRESSURE)
|
||||
device->last_axis_data[num_axes++] = packet.pkNormalPressure;
|
||||
if (device->pktdata & PK_ORIENTATION)
|
||||
if (source_device->pktdata & PK_X)
|
||||
source_device->last_axis_data[num_axes++] = packet.pkX;
|
||||
if (source_device->pktdata & PK_Y)
|
||||
source_device->last_axis_data[num_axes++] = packet.pkY;
|
||||
if (source_device->pktdata & PK_NORMAL_PRESSURE)
|
||||
source_device->last_axis_data[num_axes++] = packet.pkNormalPressure;
|
||||
if (source_device->pktdata & PK_ORIENTATION)
|
||||
{
|
||||
decode_tilt (device->last_axis_data + num_axes,
|
||||
device->orientation_axes, &packet);
|
||||
decode_tilt (source_device->last_axis_data + num_axes,
|
||||
source_device->orientation_axes, &packet);
|
||||
num_axes += 2;
|
||||
}
|
||||
|
||||
translated_buttons = button_map[packet.pkButtons & 0x07] | (packet.pkButtons & ~0x07);
|
||||
|
||||
if (translated_buttons != device->button_state)
|
||||
if (translated_buttons != source_device->button_state)
|
||||
{
|
||||
/* At least one button has changed state so produce a button event
|
||||
* If more than one button has changed state (unlikely),
|
||||
* just care about the first and act on the next the next time
|
||||
* we get a packet
|
||||
*/
|
||||
button_diff = translated_buttons ^ device->button_state;
|
||||
button_diff = translated_buttons ^ source_device->button_state;
|
||||
|
||||
/* Gdk buttons are numbered 1.. */
|
||||
event->button.button = 1;
|
||||
@@ -977,39 +1006,33 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->any.type = GDK_BUTTON_PRESS;
|
||||
masktest = GDK_BUTTON_PRESS_MASK;
|
||||
}
|
||||
device->button_state ^= button_mask;
|
||||
source_device->button_state ^= button_mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->any.type = GDK_MOTION_NOTIFY;
|
||||
masktest = GDK_POINTER_MOTION_MASK;
|
||||
if (device->button_state & (1 << 0))
|
||||
if (source_device->button_state & (1 << 0))
|
||||
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK;
|
||||
if (device->button_state & (1 << 1))
|
||||
if (source_device->button_state & (1 << 1))
|
||||
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON2_MOTION_MASK;
|
||||
if (device->button_state & (1 << 2))
|
||||
if (source_device->button_state & (1 << 2))
|
||||
masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON3_MOTION_MASK;
|
||||
}
|
||||
|
||||
/* Now we can check if the window wants the event, and
|
||||
* propagate if necessary.
|
||||
*/
|
||||
while (gdk_window_get_device_events (window, GDK_DEVICE (device)) == 0)
|
||||
while ((gdk_window_get_device_events (window, GDK_DEVICE (source_device)) & masktest) == 0 &&
|
||||
(gdk_device_get_device_type (GDK_DEVICE (source_device)) == GDK_DEVICE_TYPE_SLAVE &&
|
||||
(gdk_window_get_events (window) & masktest) == 0))
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n"));
|
||||
|
||||
if (window->parent == GDK_WINDOW (_gdk_root))
|
||||
if (window->parent == GDK_WINDOW (_gdk_root) ||
|
||||
window->parent == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* It is not good to propagate the extended events up to the parent
|
||||
* if this window wants normal (not extended) motion/button events */
|
||||
if (window->event_mask & masktest)
|
||||
{
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("... wants ordinary event, ignoring this\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pt.x = x;
|
||||
pt.y = y;
|
||||
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
|
||||
@@ -1023,21 +1046,20 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
GDK_WINDOW_HWND (window), x, y));
|
||||
}
|
||||
|
||||
if (gdk_window_get_device_events (window, GDK_DEVICE (device)) == 0)
|
||||
return FALSE;
|
||||
|
||||
event->any.window = window;
|
||||
key_state = get_modifier_key_state ();
|
||||
if (event->any.type == GDK_BUTTON_PRESS ||
|
||||
event->any.type == GDK_BUTTON_RELEASE)
|
||||
{
|
||||
event->button.time = _gdk_win32_get_next_tick (msg->time);
|
||||
gdk_event_set_device (event, GDK_DEVICE (device));
|
||||
if (source_device->sends_core)
|
||||
gdk_event_set_device (event, device_manager->core_pointer);
|
||||
gdk_event_set_source_device (event, GDK_DEVICE (source_device));
|
||||
|
||||
event->button.axes = g_new (gdouble, num_axes);
|
||||
_gdk_device_wintab_get_window_coords (window, &root_x, &root_y);
|
||||
gdk_window_get_origin (window, &root_x, &root_y);
|
||||
|
||||
_gdk_device_wintab_translate_axes (device,
|
||||
_gdk_device_wintab_translate_axes (source_device,
|
||||
window,
|
||||
event->button.axes,
|
||||
&event->button.x,
|
||||
@@ -1047,7 +1069,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->button.y_root = event->button.y + root_y;
|
||||
|
||||
event->button.state =
|
||||
key_state | ((device->button_state << 8)
|
||||
key_state | ((source_device->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
@@ -1063,12 +1085,13 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
{
|
||||
event->motion.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->motion.is_hint = FALSE;
|
||||
gdk_event_set_device (event, GDK_DEVICE (device));
|
||||
gdk_event_set_device (event, device_manager->core_pointer);
|
||||
gdk_event_set_source_device (event, GDK_DEVICE (source_device));
|
||||
|
||||
event->motion.axes = g_new (gdouble, num_axes);
|
||||
_gdk_device_wintab_get_window_coords (window, &root_x, &root_y);
|
||||
gdk_window_get_origin (window, &root_x, &root_y);
|
||||
|
||||
_gdk_device_wintab_translate_axes (device,
|
||||
_gdk_device_wintab_translate_axes (source_device,
|
||||
window,
|
||||
event->motion.axes,
|
||||
&event->motion.x,
|
||||
@@ -1078,7 +1101,7 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
event->motion.y_root = event->motion.y + root_y;
|
||||
|
||||
event->motion.state =
|
||||
key_state | ((device->button_state << 8)
|
||||
key_state | ((source_device->button_state << 8)
|
||||
& (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
@@ -1089,25 +1112,31 @@ _gdk_input_other_event (GdkEvent *event,
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WT_CSRCHANGE:
|
||||
if ((source_device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam,
|
||||
packet.pkCursor)) == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (gdk_device_get_mode (GDK_DEVICE (source_device)) == GDK_MODE_DISABLED)
|
||||
return FALSE;
|
||||
|
||||
if (source_device->sends_core)
|
||||
{
|
||||
_gdk_device_virtual_set_active (device_manager->core_pointer, GDK_DEVICE (source_device));
|
||||
_gdk_input_ignore_core = TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
case WT_PROXIMITY:
|
||||
if (LOWORD (msg->lParam) == 0)
|
||||
{
|
||||
event->proximity.type = GDK_PROXIMITY_OUT;
|
||||
set_ignore_core (FALSE);
|
||||
_gdk_input_ignore_core = FALSE;
|
||||
_gdk_device_virtual_set_active (device_manager->core_pointer,
|
||||
device_manager->system_pointer);
|
||||
}
|
||||
else
|
||||
{
|
||||
event->proximity.type = GDK_PROXIMITY_IN;
|
||||
set_ignore_core (TRUE);
|
||||
}
|
||||
event->proximity.time = _gdk_win32_get_next_tick (msg->time);
|
||||
gdk_event_set_device (event, GDK_DEVICE (device));
|
||||
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB proximity %s\n",
|
||||
(event->proximity.type == GDK_PROXIMITY_IN ?
|
||||
"in" : "out")));
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
@@ -35,8 +35,12 @@ typedef struct _GdkDeviceManagerWin32Class GdkDeviceManagerWin32Class;
|
||||
struct _GdkDeviceManagerWin32
|
||||
{
|
||||
GdkDeviceManager parent_object;
|
||||
/* Master Devices */
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
/* Fake slave devices */
|
||||
GdkDevice *system_pointer;
|
||||
GdkDevice *system_keyboard;
|
||||
GList *wintab_devices;
|
||||
};
|
||||
|
||||
|
||||
+51
-29
@@ -192,14 +192,17 @@ generate_focus_event (GdkDeviceManager *device_manager,
|
||||
gboolean in)
|
||||
{
|
||||
GdkDevice *device;
|
||||
GdkDevice *source_device;
|
||||
GdkEvent *event;
|
||||
|
||||
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
|
||||
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_keyboard;
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.window = window;
|
||||
event->focus_change.in = in;
|
||||
gdk_event_set_device (event, device);
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
@@ -212,11 +215,18 @@ generate_grab_broken_event (GdkDeviceManager *device_manager,
|
||||
{
|
||||
GdkEvent *event = gdk_event_new (GDK_GRAB_BROKEN);
|
||||
GdkDevice *device;
|
||||
GdkDevice *source_device;
|
||||
|
||||
if (keyboard)
|
||||
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
|
||||
{
|
||||
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
|
||||
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_keyboard;
|
||||
}
|
||||
else
|
||||
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer;
|
||||
{
|
||||
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer;
|
||||
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_pointer;
|
||||
}
|
||||
|
||||
event->grab_broken.window = window;
|
||||
event->grab_broken.send_event = 0;
|
||||
@@ -224,6 +234,7 @@ generate_grab_broken_event (GdkDeviceManager *device_manager,
|
||||
event->grab_broken.implicit = FALSE;
|
||||
event->grab_broken.grab_window = grab_window;
|
||||
gdk_event_set_device (event, device);
|
||||
gdk_event_set_source_device (event, device);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
@@ -1130,13 +1141,10 @@ send_crossing_event (GdkDisplay *display,
|
||||
event->crossing.detail = notify_type;
|
||||
event->crossing.focus = FALSE;
|
||||
event->crossing.state = mask;
|
||||
gdk_event_set_device (event, _gdk_display->core_pointer);
|
||||
gdk_event_set_device (event, device_manager->core_pointer);
|
||||
gdk_event_set_source_device (event, device_manager->system_pointer);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
if (type == GDK_ENTER_NOTIFY &&
|
||||
_gdk_device_wintab_wants_events (window))
|
||||
_gdk_device_wintab_update_window_coords (window);
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
@@ -1655,6 +1663,12 @@ generate_button_event (GdkEventType type,
|
||||
MSG *msg)
|
||||
{
|
||||
GdkEvent *event = gdk_event_new (type);
|
||||
GdkDeviceManagerWin32 *device_manager;
|
||||
|
||||
if (_gdk_input_ignore_core)
|
||||
return;
|
||||
|
||||
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
|
||||
|
||||
event->button.window = window;
|
||||
event->button.time = _gdk_win32_get_next_tick (msg->time);
|
||||
@@ -1665,7 +1679,8 @@ generate_button_event (GdkEventType type,
|
||||
event->button.axes = NULL;
|
||||
event->button.state = build_pointer_event_state (msg);
|
||||
event->button.button = button;
|
||||
gdk_event_set_device (event, _gdk_display->core_pointer);
|
||||
gdk_event_set_device (event, device_manager->core_pointer);
|
||||
gdk_event_set_source_device (event, device_manager->system_pointer);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
@@ -1841,6 +1856,7 @@ gdk_event_translate (MSG *msg,
|
||||
GdkWindow *orig_window, *new_window;
|
||||
|
||||
GdkDeviceManager *device_manager;
|
||||
GdkDeviceManagerWin32 *device_manager_win32;
|
||||
|
||||
GdkDeviceGrabInfo *keyboard_grab = NULL;
|
||||
GdkDeviceGrabInfo *pointer_grab = NULL;
|
||||
@@ -1892,11 +1908,12 @@ gdk_event_translate (MSG *msg,
|
||||
}
|
||||
|
||||
device_manager = gdk_display_get_device_manager (_gdk_display);
|
||||
device_manager_win32 = GDK_DEVICE_MANAGER_WIN32 (device_manager);
|
||||
|
||||
keyboard_grab = _gdk_display_get_last_device_grab (_gdk_display,
|
||||
GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
|
||||
device_manager_win32->core_keyboard);
|
||||
pointer_grab = _gdk_display_get_last_device_grab (_gdk_display,
|
||||
GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer);
|
||||
device_manager_win32->core_pointer);
|
||||
|
||||
g_object_ref (window);
|
||||
|
||||
@@ -2051,7 +2068,8 @@ gdk_event_translate (MSG *msg,
|
||||
event->key.string = NULL;
|
||||
event->key.length = 0;
|
||||
event->key.hardware_keycode = msg->wParam;
|
||||
gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
|
||||
gdk_event_set_device (event, device_manager_win32->core_keyboard);
|
||||
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
|
||||
if (HIWORD (msg->lParam) & KF_EXTENDED)
|
||||
{
|
||||
switch (msg->wParam)
|
||||
@@ -2168,7 +2186,8 @@ gdk_event_translate (MSG *msg,
|
||||
/* Build a key press event */
|
||||
event = gdk_event_new (GDK_KEY_PRESS);
|
||||
event->key.window = window;
|
||||
gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
|
||||
gdk_event_set_device (event, device_manager_win32->core_keyboard);
|
||||
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
|
||||
build_wm_ime_composition_event (event, msg, wbuf[i], key_state);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
@@ -2179,7 +2198,8 @@ gdk_event_translate (MSG *msg,
|
||||
/* Build a key release event. */
|
||||
event = gdk_event_new (GDK_KEY_RELEASE);
|
||||
event->key.window = window;
|
||||
gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard);
|
||||
gdk_event_set_device (event, device_manager_win32->core_keyboard);
|
||||
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
|
||||
build_wm_ime_composition_event (event, msg, wbuf[i], key_state);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
@@ -2361,19 +2381,23 @@ gdk_event_translate (MSG *msg,
|
||||
current_root_x = msg->pt.x + _gdk_offset_x;
|
||||
current_root_y = msg->pt.y + _gdk_offset_y;
|
||||
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->motion.window = window;
|
||||
event->motion.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
event->motion.x_root = current_root_x;
|
||||
event->motion.y_root = current_root_y;
|
||||
event->motion.axes = NULL;
|
||||
event->motion.state = build_pointer_event_state (msg);
|
||||
event->motion.is_hint = FALSE;
|
||||
gdk_event_set_device (event, _gdk_display->core_pointer);
|
||||
if (!_gdk_input_ignore_core)
|
||||
{
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->motion.window = window;
|
||||
event->motion.time = _gdk_win32_get_next_tick (msg->time);
|
||||
event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
|
||||
event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
|
||||
event->motion.x_root = current_root_x;
|
||||
event->motion.y_root = current_root_y;
|
||||
event->motion.axes = NULL;
|
||||
event->motion.state = build_pointer_event_state (msg);
|
||||
event->motion.is_hint = FALSE;
|
||||
gdk_event_set_device (event, device_manager_win32->core_pointer);
|
||||
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
|
||||
return_val = TRUE;
|
||||
break;
|
||||
@@ -2485,7 +2509,8 @@ gdk_event_translate (MSG *msg,
|
||||
event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x;
|
||||
event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y;
|
||||
event->scroll.state = build_pointer_event_state (msg);
|
||||
gdk_event_set_device (event, _gdk_display->core_pointer);
|
||||
gdk_event_set_device (event, device_manager_win32->core_pointer);
|
||||
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@@ -2763,9 +2788,6 @@ gdk_event_translate (MSG *msg,
|
||||
!IsIconic (msg->hwnd) &&
|
||||
!GDK_WINDOW_DESTROYED (window))
|
||||
_gdk_win32_emit_configure_event (window);
|
||||
|
||||
if (_gdk_device_wintab_wants_events (window))
|
||||
_gdk_device_wintab_update_window_coords (window);
|
||||
}
|
||||
|
||||
if ((windowpos->flags & SWP_HIDEWINDOW) &&
|
||||
|
||||
@@ -75,6 +75,6 @@ _gdk_input_init (GdkDisplay *display)
|
||||
_gdk_input_devices = g_list_concat (_gdk_input_devices,
|
||||
g_list_copy (device_manager->wintab_devices));
|
||||
|
||||
_gdk_input_wintab_init_check (device_manager);
|
||||
_gdk_input_wintab_init_check (GDK_DEVICE_MANAGER (device_manager));
|
||||
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ translate_key_event (GdkDisplay *display,
|
||||
gdk_event_set_device (event, device_manager->core_keyboard);
|
||||
|
||||
event->key.state = (GdkModifierType) xevent->xkey.state;
|
||||
event->key.group = _gdk_x11_get_group_for_state (display, xevent->xkey.state);
|
||||
event->key.group = gdk_x11_keymap_get_group_for_state (keymap, xevent->xkey.state);
|
||||
event->key.hardware_keycode = xevent->xkey.keycode;
|
||||
|
||||
event->key.keyval = GDK_KEY_VoidSymbol;
|
||||
@@ -161,7 +161,7 @@ translate_key_event (GdkDisplay *display,
|
||||
_gdk_x11_keymap_add_virt_mods (keymap, &state);
|
||||
event->key.state |= state;
|
||||
|
||||
event->key.is_modifier = _gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
|
||||
event->key.is_modifier = gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
|
||||
|
||||
_gdk_x11_event_translate_keyboard_string (&event->key);
|
||||
|
||||
|
||||
@@ -331,10 +331,6 @@ create_device (GdkDeviceManager *device_manager,
|
||||
input_source = GDK_SOURCE_ERASER;
|
||||
else if (strstr (tmp_name, "cursor"))
|
||||
input_source = GDK_SOURCE_CURSOR;
|
||||
else if (strstr (tmp_name, "finger") ||
|
||||
(strstr (tmp_name, "touch") &&
|
||||
!strstr (tmp_name, "touchpad")))
|
||||
input_source = GDK_SOURCE_TOUCHSCREEN;
|
||||
else if (strstr (tmp_name, "wacom") ||
|
||||
strstr (tmp_name, "pen"))
|
||||
input_source = GDK_SOURCE_PEN;
|
||||
@@ -1066,7 +1062,7 @@ scroll_valuators_changed (GdkX11DeviceXI2 *device,
|
||||
gdouble *dx,
|
||||
gdouble *dy)
|
||||
{
|
||||
gdouble has_scroll_valuators = FALSE;
|
||||
gboolean has_scroll_valuators = FALSE;
|
||||
GdkScrollDirection direction;
|
||||
guint n_axes, i, n_val;
|
||||
gdouble *vals;
|
||||
@@ -1164,10 +1160,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
|
||||
event->key.time = xev->time;
|
||||
event->key.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
|
||||
event->key.group = _gdk_x11_get_group_for_state (display, event->key.state);
|
||||
event->key.group = xev->group.effective;
|
||||
|
||||
event->key.hardware_keycode = xev->detail;
|
||||
event->key.is_modifier = _gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
|
||||
event->key.is_modifier = gdk_x11_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
|
||||
|
||||
device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (xev->deviceid));
|
||||
@@ -1309,20 +1305,37 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
case XI_Motion:
|
||||
{
|
||||
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
|
||||
GdkDevice *source_device;
|
||||
GdkDevice *source_device, *device;
|
||||
gdouble delta_x, delta_y;
|
||||
|
||||
source_device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (xev->sourceid));
|
||||
device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (xev->deviceid));
|
||||
|
||||
if (scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
|
||||
/* When scrolling, X might send events twice here; once with both the
|
||||
* device and the source device set to the physical device, and once
|
||||
* with the device set to the master device.
|
||||
* Since we are only interested in the latter, and
|
||||
* scroll_valuators_changed() updates the valuator cache for the
|
||||
* source device, we need to explicitly ignore the first event in
|
||||
* order to get the correct delta for the second.
|
||||
*/
|
||||
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE &&
|
||||
scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
|
||||
&xev->valuators, &delta_x, &delta_y))
|
||||
{
|
||||
event->scroll.type = GDK_SCROLL;
|
||||
event->scroll.direction = GDK_SCROLL_SMOOTH;
|
||||
|
||||
GDK_NOTE(EVENTS,
|
||||
g_message ("smooth scroll:\twindow %ld\n\tdeltas: %f %f",
|
||||
g_message ("smooth scroll: %s\n\tdevice: %u\n\tsource device: %u\n\twindow %ld\n\tdeltas: %f %f",
|
||||
#ifdef XINPUT_2_2
|
||||
(xev->flags & XIPointerEmulated) ? "emulated" : "",
|
||||
#else
|
||||
"",
|
||||
#endif
|
||||
xev->deviceid, xev->sourceid,
|
||||
xev->event, delta_x, delta_y));
|
||||
|
||||
|
||||
@@ -1335,9 +1348,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
event->scroll.delta_x = delta_x;
|
||||
event->scroll.delta_y = delta_y;
|
||||
|
||||
event->scroll.device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (xev->deviceid));
|
||||
|
||||
event->scroll.device = device;
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
event->scroll.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
|
||||
@@ -1352,9 +1363,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
event->motion.x_root = (gdouble) xev->root_x;
|
||||
event->motion.y_root = (gdouble) xev->root_y;
|
||||
|
||||
event->motion.device = g_hash_table_lookup (device_manager->id_table,
|
||||
GINT_TO_POINTER (xev->deviceid));
|
||||
|
||||
event->motion.device = device;
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
event->motion.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
|
||||
|
||||
+45
-27
@@ -1510,9 +1510,11 @@ motif_send_enter (GdkX11DragContext *context_x11,
|
||||
if (!_gdk_x11_display_send_xevent (display,
|
||||
GDK_WINDOW_XID (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1539,9 +1541,11 @@ motif_send_leave (GdkX11DragContext *context_x11,
|
||||
if (!_gdk_x11_display_send_xevent (display,
|
||||
GDK_WINDOW_XID (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1589,9 +1593,11 @@ motif_send_motion (GdkX11DragContext *context_x11,
|
||||
if (!_gdk_x11_display_send_xevent (display,
|
||||
GDK_WINDOW_XID (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -1623,9 +1629,11 @@ motif_send_drop (GdkX11DragContext *context_x11,
|
||||
if (!_gdk_x11_display_send_xevent (display,
|
||||
GDK_WINDOW_XID (context->dest_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->dest_window)));
|
||||
}
|
||||
}
|
||||
|
||||
/* Target Side */
|
||||
@@ -2605,9 +2613,11 @@ xdnd_check_dest (GdkDisplay *display,
|
||||
proxy = *proxy_data;
|
||||
}
|
||||
else
|
||||
GDK_NOTE (DND,
|
||||
g_warning ("Invalid XdndProxy "
|
||||
"property on window %ld\n", win));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_warning ("Invalid XdndProxy "
|
||||
"property on window %ld\n", win));
|
||||
}
|
||||
|
||||
XFree (proxy_data);
|
||||
}
|
||||
@@ -2629,9 +2639,11 @@ xdnd_check_dest (GdkDisplay *display,
|
||||
*xdnd_version = *version;
|
||||
}
|
||||
else
|
||||
GDK_NOTE (DND,
|
||||
g_warning ("Invalid XdndAware "
|
||||
"property on window %ld\n", win));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_warning ("Invalid XdndAware "
|
||||
"property on window %ld\n", win));
|
||||
}
|
||||
|
||||
XFree (version);
|
||||
}
|
||||
@@ -3657,9 +3669,11 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context,
|
||||
if (!_gdk_x11_display_send_xevent (display,
|
||||
GDK_WINDOW_XID (context->source_window),
|
||||
FALSE, 0, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->source_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->source_window)));
|
||||
}
|
||||
}
|
||||
else if (context->protocol == GDK_DRAG_PROTO_XDND)
|
||||
{
|
||||
@@ -3674,9 +3688,11 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context,
|
||||
xev.xclient.data.l[3] = 0;
|
||||
xev.xclient.data.l[4] = xdnd_action_to_atom (display, action);
|
||||
if (!xdnd_send_xevent (context_x11, context->source_window, FALSE, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->source_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->source_window)));
|
||||
}
|
||||
}
|
||||
|
||||
context_x11->old_action = action;
|
||||
@@ -3754,9 +3770,11 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context,
|
||||
xev.xclient.data.l[4] = 0;
|
||||
|
||||
if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_window, FALSE, &xev))
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->source_window)));
|
||||
{
|
||||
GDK_NOTE (DND,
|
||||
g_message ("Send event to %lx failed",
|
||||
GDK_WINDOW_XID (context->source_window)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+42
-5
@@ -1429,11 +1429,30 @@ _gdk_x11_display_manager_keyval_convert_case (GdkDisplayManager *manager,
|
||||
*upper = xupper;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_keymap_get_group_for_state:
|
||||
* @keymap: a #GdkX11Keymap
|
||||
* @state: raw state returned from X
|
||||
*
|
||||
* Extracts the group from the state field sent in an X Key event.
|
||||
* This is only needed for code processing raw X events, since #GdkEventKey
|
||||
* directly includes an is_modifier field.
|
||||
*
|
||||
* Returns: the index of the active keyboard group for the event
|
||||
*
|
||||
* Since: 3.6
|
||||
*/
|
||||
gint
|
||||
_gdk_x11_get_group_for_state (GdkDisplay *display,
|
||||
GdkModifierType state)
|
||||
gdk_x11_keymap_get_group_for_state (GdkKeymap *keymap,
|
||||
guint state)
|
||||
{
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
GdkDisplay *display;
|
||||
GdkX11Display *display_x11;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_X11_KEYMAP (keymap), 0);
|
||||
|
||||
display = keymap->display;
|
||||
display_x11 = GDK_X11_DISPLAY (display);
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
if (display_x11->use_xkb)
|
||||
@@ -1498,13 +1517,31 @@ gdk_x11_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_keymap_key_is_modifier:
|
||||
* @keymap: a #GdkX11Keymap
|
||||
* @keycode: the hardware keycode from a key event
|
||||
*
|
||||
* Determines whether a particular key code represents a key that
|
||||
* is a modifier. That is, it's a key that normally just affects
|
||||
* the keyboard state and the behavior of other keys rather than
|
||||
* producing a direct effect itself. This is only needed for code
|
||||
* processing raw X events, since #GdkEventKey directly includes
|
||||
* an is_modifier field.
|
||||
*
|
||||
* Returns: %TRUE if the hardware keycode is a modifier key
|
||||
*
|
||||
* Since: 3.6
|
||||
*/
|
||||
gboolean
|
||||
_gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode)
|
||||
gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode)
|
||||
{
|
||||
GdkX11Keymap *keymap_x11 = GDK_X11_KEYMAP (keymap);
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_X11_KEYMAP (keymap), FALSE);
|
||||
|
||||
update_keyrange (keymap_x11);
|
||||
if (keycode < keymap_x11->min_keycode ||
|
||||
keycode > keymap_x11->max_keycode)
|
||||
|
||||
@@ -155,12 +155,8 @@ gboolean _gdk_x11_moveresize_configure_done (GdkDisplay *display,
|
||||
void _gdk_x11_keymap_state_changed (GdkDisplay *display,
|
||||
XEvent *event);
|
||||
void _gdk_x11_keymap_keys_changed (GdkDisplay *display);
|
||||
gint _gdk_x11_get_group_for_state (GdkDisplay *display,
|
||||
GdkModifierType state);
|
||||
void _gdk_x11_keymap_add_virt_mods (GdkKeymap *keymap,
|
||||
GdkModifierType *modifiers);
|
||||
gboolean _gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode);
|
||||
|
||||
void _gdk_x11_windowing_init (void);
|
||||
|
||||
|
||||
@@ -81,7 +81,9 @@ static const char gdk_settings_names[] =
|
||||
"Gtk/AutoMnemonics\0" "gtk-auto-mnemonics\0"
|
||||
"Gtk/VisibleFocus\0" "gtk-visible-focus\0"
|
||||
"Gtk/ShellShowsAppMenu\0" "gtk-shell-shows-app-menu\0"
|
||||
"Gtk/ShellShowsMenubar\0" "gtk-shell-shows-menubar\0";
|
||||
"Gtk/ShellShowsMenubar\0" "gtk-shell-shows-menubar\0"
|
||||
"Gtk/EnablePrimaryPaste\0" "gtk-enable-primary-paste\0";
|
||||
|
||||
|
||||
|
||||
static const struct
|
||||
@@ -137,5 +139,6 @@ static const struct
|
||||
{ 1730, 1748 },
|
||||
{ 1767, 1784 },
|
||||
{ 1802, 1824 },
|
||||
{ 1849, 1871 }
|
||||
{ 1849, 1871 },
|
||||
{ 1895, 1918 }
|
||||
};
|
||||
|
||||
+9
-11
@@ -170,7 +170,10 @@ _gdk_x11_window_get_toplevel (GdkWindow *window)
|
||||
impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
||||
|
||||
if (!impl->toplevel)
|
||||
impl->toplevel = g_new0 (GdkToplevelX11, 1);
|
||||
{
|
||||
impl->toplevel = g_new0 (GdkToplevelX11, 1);
|
||||
impl->toplevel->have_focused = TRUE;
|
||||
}
|
||||
|
||||
return impl->toplevel;
|
||||
}
|
||||
@@ -4076,7 +4079,7 @@ wmspec_send_message (GdkDisplay *display,
|
||||
(XEvent *)&xclient);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
handle_wmspec_button_release (GdkDisplay *display,
|
||||
XEvent *xevent)
|
||||
{
|
||||
@@ -4107,11 +4110,8 @@ handle_wmspec_button_release (GdkDisplay *display,
|
||||
{
|
||||
display_x11->wm_moveresize_button = 0;
|
||||
wmspec_send_message (display, window, 0, 0, _NET_WM_MOVERESIZE_CANCEL, 0);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4392,11 +4392,11 @@ _gdk_x11_moveresize_handle_event (XEvent *event)
|
||||
GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display);
|
||||
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
|
||||
|
||||
if (handle_wmspec_button_release (display, event))
|
||||
return TRUE;
|
||||
|
||||
if (!mv_resize || !mv_resize->moveresize_window)
|
||||
return FALSE;
|
||||
{
|
||||
handle_wmspec_button_release (display, event);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1);
|
||||
|
||||
@@ -4476,8 +4476,6 @@ _gdk_x11_moveresize_configure_done (GdkDisplay *display,
|
||||
XEvent *tmp_event;
|
||||
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
|
||||
|
||||
GDK_X11_DISPLAY (display)->wm_moveresize_button = 0;
|
||||
|
||||
if (!mv_resize || window != mv_resize->moveresize_window)
|
||||
return FALSE;
|
||||
|
||||
|
||||
@@ -42,6 +42,13 @@ typedef struct _GdkX11KeymapClass GdkX11KeymapClass;
|
||||
|
||||
GType gdk_x11_keymap_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
gint gdk_x11_keymap_get_group_for_state (GdkKeymap *keymap,
|
||||
guint state);
|
||||
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
gboolean gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
guint keycode);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_X11_KEYMAP_H__ */
|
||||
|
||||
+81
-20
@@ -267,6 +267,7 @@ gtk_public_h_sources = \
|
||||
gtklayout.h \
|
||||
gtklinkbutton.h \
|
||||
gtkliststore.h \
|
||||
gtklistview.h \
|
||||
gtklockbutton.h \
|
||||
gtkmain.h \
|
||||
gtkmenu.h \
|
||||
@@ -405,7 +406,6 @@ gtk_private_h_sources = \
|
||||
gtkaccelgroupprivate.h \
|
||||
gtkaccelmapprivate.h \
|
||||
gtkallocatedbitmaskprivate.h \
|
||||
gtkanimationdescription.h \
|
||||
gtkappchooserprivate.h \
|
||||
gtkappchoosermodule.h \
|
||||
gtkappchooseronline.h \
|
||||
@@ -423,21 +423,43 @@ gtk_private_h_sources = \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcontainerprivate.h \
|
||||
gtkcssanimatedvaluesprivate.h \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscomputedvaluesprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
gtkcsseasevalueprivate.h \
|
||||
gtkcssenginevalueprivate.h \
|
||||
gtkcssenumvalueprivate.h \
|
||||
gtkcssimagecrossfadeprivate.h \
|
||||
gtkcssimagegradientprivate.h \
|
||||
gtkcssimagelinearprivate.h \
|
||||
gtkcssimageprivate.h \
|
||||
gtkcssimageurlprivate.h \
|
||||
gtkcssimagevalueprivate.h \
|
||||
gtkcssimagewin32private.h \
|
||||
gtkcssinheritvalueprivate.h \
|
||||
gtkcssinitialvalueprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
gtkcssrgbavalueprivate.h \
|
||||
gtkcsssectionprivate.h \
|
||||
gtkcssselectorprivate.h \
|
||||
gtkcssshadowsvalueprivate.h \
|
||||
gtkcssshadowvalueprivate.h \
|
||||
gtkcssshorthandpropertyprivate.h \
|
||||
gtkcssstringvalueprivate.h \
|
||||
gtkcssstylefuncsprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkcustompaperunixdialog.h \
|
||||
gtkentryprivate.h \
|
||||
@@ -487,9 +509,10 @@ gtk_private_h_sources = \
|
||||
gtksearchenginesimple.h \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtkshadowprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertiesprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
@@ -506,7 +529,6 @@ gtk_private_h_sources = \
|
||||
gtktextutil.h \
|
||||
gtkthemingbackgroundprivate.h \
|
||||
gtkthemingengineprivate.h \
|
||||
gtktimeline.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktreedatalist.h \
|
||||
gtktreeprivate.h \
|
||||
@@ -572,7 +594,6 @@ gtk_base_c_sources = \
|
||||
gtkappchooseronline.c \
|
||||
gtkapplication.c \
|
||||
gtkapplicationwindow.c \
|
||||
gtkanimationdescription.c \
|
||||
gtkarrow.c \
|
||||
gtkaspectframe.c \
|
||||
gtkassistant.c \
|
||||
@@ -618,23 +639,45 @@ gtk_base_c_sources = \
|
||||
gtkcombobox.c \
|
||||
gtkcomboboxtext.c \
|
||||
gtkcontainer.c \
|
||||
gtkcssanimatedvalues.c \
|
||||
gtkcssarrayvalue.c \
|
||||
gtkcssbgsizevalue.c \
|
||||
gtkcssbordervalue.c \
|
||||
gtkcsscomputedvalues.c \
|
||||
gtkcsscornervalue.c \
|
||||
gtkcsscustomproperty.c \
|
||||
gtkcsseasevalue.c \
|
||||
gtkcssenumvalue.c \
|
||||
gtkcssenginevalue.c \
|
||||
gtkcssimage.c \
|
||||
gtkcssimagecrossfade.c \
|
||||
gtkcssimagegradient.c \
|
||||
gtkcssimagelinear.c \
|
||||
gtkcssimageurl.c \
|
||||
gtkcssimagevalue.c \
|
||||
gtkcssimagewin32.c \
|
||||
gtkcssinheritvalue.c \
|
||||
gtkcssinitialvalue.c \
|
||||
gtkcsslookup.c \
|
||||
gtkcssmatcher.c \
|
||||
gtkcssnumbervalue.c \
|
||||
gtkcssparser.c \
|
||||
gtkcsspositionvalue.c \
|
||||
gtkcssprovider.c \
|
||||
gtkcssrepeatvalue.c \
|
||||
gtkcssrgbavalue.c \
|
||||
gtkcsssection.c \
|
||||
gtkcssselector.c \
|
||||
gtkcssstringvalue.c \
|
||||
gtkcssshadowsvalue.c \
|
||||
gtkcssshadowvalue.c \
|
||||
gtkcssshorthandproperty.c \
|
||||
gtkcssshorthandpropertyimpl.c \
|
||||
gtkcssstylefuncs.c \
|
||||
gtkcssstyleproperty.c \
|
||||
gtkcssstylepropertyimpl.c \
|
||||
gtkcsstransition.c \
|
||||
gtkcsstypedvalue.c \
|
||||
gtkcssvalue.c \
|
||||
gtkcsstypes.c \
|
||||
gtkdialog.c \
|
||||
@@ -684,6 +727,7 @@ gtk_base_c_sources = \
|
||||
gtklayout.c \
|
||||
gtklinkbutton.c \
|
||||
gtkliststore.c \
|
||||
gtklistview.c \
|
||||
gtklockbutton.c \
|
||||
gtkmain.c \
|
||||
gtkmarshalers.c \
|
||||
@@ -748,13 +792,14 @@ gtk_base_c_sources = \
|
||||
gtksettings.c \
|
||||
gtksizegroup.c \
|
||||
gtksizerequest.c \
|
||||
gtkshadow.c \
|
||||
gtkshow.c \
|
||||
gtkspinbutton.c \
|
||||
gtkspinner.c \
|
||||
gtkstatusbar.c \
|
||||
gtkstatusicon.c \
|
||||
gtkstock.c \
|
||||
gtkstyleanimation.c \
|
||||
gtkstylecascade.c \
|
||||
gtkstylecontext.c \
|
||||
gtkstyleproperties.c \
|
||||
gtkstyleproperty.c \
|
||||
@@ -781,7 +826,6 @@ gtk_base_c_sources = \
|
||||
gtktextview.c \
|
||||
gtkthemingbackground.c \
|
||||
gtkthemingengine.c \
|
||||
gtktimeline.c \
|
||||
gtktoggleaction.c \
|
||||
gtktogglebutton.c \
|
||||
gtktoggletoolbutton.c \
|
||||
@@ -865,34 +909,46 @@ gtk_use_win32_c_sources = \
|
||||
gtk_use_quartz_c_sources = \
|
||||
gtksearchenginequartz.c \
|
||||
gtkmountoperation-stub.c \
|
||||
gtkquartz-menu.h \
|
||||
gtkquartz-menu.c \
|
||||
gtkmodelmenu-quartz.c \
|
||||
gtkquartz.c
|
||||
gtk_use_stub_c_sources = \
|
||||
gtkmountoperation-stub.c
|
||||
gtk_all_c_sources += $(gtk_use_x11_c_sources) $(gtk_use_win32_c_sources) $(gtk_use_quartz_c_sources) $(gtk_use_stub_c_sources)
|
||||
if USE_X11
|
||||
gtk_private_h_sources += \
|
||||
gtk_use_x11_private_h_sources = \
|
||||
gtkxembed.h \
|
||||
gtktrayicon.h \
|
||||
xembed.h
|
||||
if USE_X11
|
||||
gtk_c_sources += $(gtk_use_x11_c_sources)
|
||||
else
|
||||
if USE_WIN32
|
||||
gtk_private_h_sources += \
|
||||
gtk_private_h_sources += $(gtk_use_x11_private_h_sources)
|
||||
endif
|
||||
|
||||
gtk_use_win32_private_h_sources = \
|
||||
gtkwin32embed.h \
|
||||
gtkwin32embedwidget.h
|
||||
if USE_WIN32
|
||||
gtk_c_sources += $(gtk_use_win32_c_sources)
|
||||
else
|
||||
if USE_QUARTZ
|
||||
gtk_private_h_sources += \
|
||||
gtk_private_h_sources += $(gtk_use_win32_private_h_sources)
|
||||
endif
|
||||
|
||||
gtk_use_quartz_private_h_sources = \
|
||||
gtksearchenginequartz.h \
|
||||
gtkmenuquartz.h \
|
||||
gtkmodelmenu-quartz.h \
|
||||
gtkquartz.h
|
||||
if USE_QUARTZ
|
||||
gtk_c_sources += $(gtk_use_quartz_c_sources)
|
||||
libgtk_3_la_CFLAGS = "-xobjective-c"
|
||||
gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
|
||||
endif
|
||||
|
||||
else
|
||||
gtk_all_private_h_sources = \
|
||||
$(gtk_use_x11_private_h_sources) \
|
||||
$(gtk_use_win32_private_h_sources) \
|
||||
$(gtk_use_quartz_private_h_sources)
|
||||
|
||||
if !USE_X11
|
||||
if !USE_WIN32
|
||||
if !USE_QUARTZ
|
||||
gtk_c_sources += $(gtk_use_stub_c_sources)
|
||||
endif
|
||||
endif
|
||||
@@ -904,6 +960,7 @@ gtk_clipboard_dnd_c_sources = \
|
||||
gtkdnd-quartz.c
|
||||
else
|
||||
if USE_WAYLAND
|
||||
if !USE_X11
|
||||
# No wayland gtkdnd-wayland.c yet
|
||||
gtk_clipboard_dnd_c_sources = \
|
||||
gtkclipboard-wayland.c \
|
||||
@@ -911,6 +968,9 @@ gtk_clipboard_dnd_c_sources = \
|
||||
else
|
||||
gtk_clipboard_dnd_c_sources = gtkclipboard.c gtkdnd.c
|
||||
endif
|
||||
else
|
||||
gtk_clipboard_dnd_c_sources = gtkclipboard.c gtkdnd.c
|
||||
endif
|
||||
endif
|
||||
|
||||
# we use our own built_sources variable rules to avoid automake's
|
||||
@@ -957,6 +1017,7 @@ gtk_extra_sources = \
|
||||
gtk-win32-base.css \
|
||||
gtk-win32.css \
|
||||
gtk-win32-xp.css \
|
||||
gtk-win32-classic.css \
|
||||
gtkversion.h.in \
|
||||
gtkmarshalers.list \
|
||||
fallback-c89.c
|
||||
@@ -971,7 +1032,7 @@ MAINTAINERCLEANFILES = \
|
||||
stock-icons/icon-theme.cache
|
||||
|
||||
EXTRA_HEADERS =
|
||||
EXTRA_DIST += $(gtk_private_h_sources) $(gtk_extra_sources)
|
||||
EXTRA_DIST += $(gtk_all_private_h_sources) $(gtk_extra_sources)
|
||||
EXTRA_DIST += $(gtk_built_sources)
|
||||
EXTRA_DIST += $(STOCK_ICONS)
|
||||
|
||||
@@ -1032,7 +1093,7 @@ gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) $(deprecated_h_sources) gtk
|
||||
gtkresources.h: gtk.gresource.xml
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
|
||||
gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css $(DND_CURSORS)
|
||||
gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css gtk-win32-xp.css gtk-win32-base.css gtk-win32-classic.css $(DND_CURSORS)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gtk.gresource.xml \
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ get_pixbuf_box (GtkIconView *icon_view,
|
||||
_gtk_icon_view_set_cell_data (icon_view, item);
|
||||
gtk_cell_area_foreach_alloc (icon_view->priv->cell_area, context,
|
||||
GTK_WIDGET (icon_view),
|
||||
(GdkRectangle *)item, (GdkRectangle *)item,
|
||||
&item->cell_area, &item->cell_area,
|
||||
(GtkCellAllocCallback)get_pixbuf_foreach, &data);
|
||||
|
||||
return data.pixbuf_found;
|
||||
|
||||
@@ -333,7 +333,7 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkColorSelection:current-color
|
||||
* GtkColorSelection:current-color:
|
||||
*
|
||||
* The current GdkColor color.
|
||||
*
|
||||
@@ -355,7 +355,7 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkColorSelection:current-rgba
|
||||
* GtkColorSelection:current-rgba:
|
||||
*
|
||||
* The current RGBA color.
|
||||
*
|
||||
|
||||
@@ -610,7 +610,9 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
|
||||
*
|
||||
* Creates a new #GtkFontSelection.
|
||||
*
|
||||
* Return value: a n ew #GtkFontSelection
|
||||
* Return value: a new #GtkFontSelection
|
||||
*
|
||||
* Deprecated: 3.2: Use #GtkFontChooserWidget instead
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_font_selection_new (void)
|
||||
|
||||
+12
-1
@@ -53,4 +53,15 @@ rint (double x)
|
||||
return ceil (x - 0.5);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NEARBYINT
|
||||
/* Workaround for nearbyint() for non-GCC/non-C99 compilers */
|
||||
/* This is quite similar to rint() in most respects */
|
||||
|
||||
static inline double
|
||||
nearbyint (double x)
|
||||
{
|
||||
return floor (x + 0.5);
|
||||
}
|
||||
#endif
|
||||
|
||||
+13
-1
@@ -90,8 +90,20 @@ static gchar **
|
||||
g_action_muxer_list_actions (GActionGroup *action_group)
|
||||
{
|
||||
GActionMuxer *muxer = G_ACTION_MUXER (action_group);
|
||||
GHashTableIter iter;
|
||||
gchar *key;
|
||||
gchar **keys;
|
||||
gsize i;
|
||||
|
||||
return (gchar **) muxer->groups;
|
||||
keys = g_new (gchar *, g_hash_table_size (muxer->actions) + 1);
|
||||
|
||||
i = 0;
|
||||
g_hash_table_iter_init (&iter, muxer->actions);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &key, NULL))
|
||||
keys[i++] = g_strdup (key);
|
||||
keys[i] = NULL;
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
static Group *
|
||||
|
||||
@@ -36,10 +36,6 @@ GtkTreeView.view.expander:selected:hover {
|
||||
color: @text_color;
|
||||
}
|
||||
|
||||
.expander:active {
|
||||
transition: 200ms linear;
|
||||
}
|
||||
|
||||
*:insensitive {
|
||||
border-color: shade (@bg_color, 0.7);
|
||||
background-color: shade (@bg_color, 0.9);
|
||||
@@ -295,10 +291,6 @@ GtkLabel:selected:focused {
|
||||
background-color: @selected_bg_color;
|
||||
}
|
||||
|
||||
.spinner:active {
|
||||
transition: 750ms linear loop;
|
||||
}
|
||||
|
||||
.info {
|
||||
background-color: @info_bg_color;
|
||||
color: @info_fg_color;
|
||||
|
||||
@@ -77,10 +77,6 @@ GtkFrame {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.spinner:active {
|
||||
transition: 750ms linear loop;
|
||||
}
|
||||
|
||||
.notebook > GtkScrolledWindow.frame {
|
||||
border-style: none;
|
||||
}
|
||||
@@ -837,4 +833,4 @@ GtkStatusbar > GtkFrame {
|
||||
background-color: transparent;
|
||||
background-image: -gtk-win32-theme-part(status, 3 1);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/* We should have a real win32 classic theme that picks up
|
||||
colors from the settings. But for now, at least don't break
|
||||
when win32 is in classic mode by just using raleigh. */
|
||||
@import url("Raleigh.css");
|
||||
@@ -5,6 +5,7 @@
|
||||
<file>gtk-win32.css</file>
|
||||
<file>gtk-win32-xp.css</file>
|
||||
<file>gtk-win32-base.css</file>
|
||||
<file>gtk-win32-classic.css</file>
|
||||
<file alias="cursor/dnd-ask.png">cursor_dnd_ask.png</file>
|
||||
<file alias="cursor/dnd-link.png">cursor_dnd_link.png</file>
|
||||
<file alias="cursor/dnd-none.png">cursor_dnd_none.png</file>
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
#include <gtk/gtklayout.h>
|
||||
#include <gtk/gtklinkbutton.h>
|
||||
#include <gtk/gtkliststore.h>
|
||||
#include <gtk/gtklistview.h>
|
||||
#include <gtk/gtklockbutton.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenu.h>
|
||||
|
||||
@@ -231,6 +231,7 @@ gtk_application_get_app_menu
|
||||
gtk_application_get_menubar
|
||||
gtk_application_get_type
|
||||
gtk_application_get_windows
|
||||
gtk_application_get_window_by_id
|
||||
gtk_application_inhibit
|
||||
gtk_application_inhibit_flags_get_type
|
||||
gtk_application_is_inhibited
|
||||
@@ -242,6 +243,7 @@ gtk_application_set_menubar
|
||||
gtk_application_uninhibit
|
||||
gtk_application_window_get_show_menubar
|
||||
gtk_application_window_get_type
|
||||
gtk_application_window_get_id
|
||||
gtk_application_window_new
|
||||
gtk_application_window_set_show_menubar
|
||||
gtk_arrow_get_type
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkanimationdescription.h"
|
||||
#include "gtkintl.h"
|
||||
|
||||
struct GtkAnimationDescription
|
||||
{
|
||||
GtkTimelineProgressType progress_type;
|
||||
gdouble duration;
|
||||
guint loop : 1;
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
GtkAnimationDescription *
|
||||
_gtk_animation_description_new (gdouble duration,
|
||||
GtkTimelineProgressType progress_type,
|
||||
gboolean loop)
|
||||
{
|
||||
GtkAnimationDescription *desc;
|
||||
|
||||
desc = g_slice_new (GtkAnimationDescription);
|
||||
desc->duration = duration;
|
||||
desc->progress_type = progress_type;
|
||||
desc->loop = loop;
|
||||
desc->ref_count = 1;
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
gdouble
|
||||
_gtk_animation_description_get_duration (GtkAnimationDescription *desc)
|
||||
{
|
||||
return desc->duration;
|
||||
}
|
||||
|
||||
GtkTimelineProgressType
|
||||
_gtk_animation_description_get_progress_type (GtkAnimationDescription *desc)
|
||||
{
|
||||
return desc->progress_type;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gtk_animation_description_get_loop (GtkAnimationDescription *desc)
|
||||
{
|
||||
return (desc->loop != 0);
|
||||
}
|
||||
|
||||
GtkAnimationDescription *
|
||||
_gtk_animation_description_ref (GtkAnimationDescription *desc)
|
||||
{
|
||||
desc->ref_count++;
|
||||
return desc;
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_animation_description_unref (GtkAnimationDescription *desc)
|
||||
{
|
||||
desc->ref_count--;
|
||||
|
||||
if (desc->ref_count == 0)
|
||||
g_slice_free (GtkAnimationDescription, desc);
|
||||
}
|
||||
|
||||
GtkAnimationDescription *
|
||||
_gtk_animation_description_from_string (const gchar *str)
|
||||
{
|
||||
gchar timing_function[16] = { 0, };
|
||||
gchar duration_unit[3] = { 0, };
|
||||
gchar loop_str[5] = { 0, };
|
||||
GtkTimelineProgressType progress_type;
|
||||
guint duration = 0;
|
||||
gboolean loop;
|
||||
|
||||
if (sscanf (str, "%d%2s %15s %5s", &duration, duration_unit, timing_function, loop_str) == 4)
|
||||
loop = TRUE;
|
||||
else if (sscanf (str, "%d%2s %15s", &duration, duration_unit, timing_function) == 3)
|
||||
loop = FALSE;
|
||||
else
|
||||
return NULL;
|
||||
|
||||
if (strcmp (duration_unit, "s") == 0)
|
||||
duration *= 1000;
|
||||
else if (strcmp (duration_unit, "ms") != 0)
|
||||
{
|
||||
g_warning ("Unknown duration unit: %s\n", duration_unit);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp (timing_function, "linear") == 0)
|
||||
progress_type = GTK_TIMELINE_PROGRESS_LINEAR;
|
||||
else if (strcmp (timing_function, "ease") == 0)
|
||||
progress_type = GTK_TIMELINE_PROGRESS_EASE;
|
||||
else if (strcmp (timing_function, "ease-in") == 0)
|
||||
progress_type = GTK_TIMELINE_PROGRESS_EASE_IN;
|
||||
else if (strcmp (timing_function, "ease-out") == 0)
|
||||
progress_type = GTK_TIMELINE_PROGRESS_EASE_OUT;
|
||||
else if (strcmp (timing_function, "ease-in-out") == 0)
|
||||
progress_type = GTK_TIMELINE_PROGRESS_EASE_IN_OUT;
|
||||
else
|
||||
{
|
||||
g_warning ("Unknown timing function: %s\n", timing_function);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return _gtk_animation_description_new ((gdouble) duration, progress_type, loop);
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_animation_description_print (GtkAnimationDescription *desc,
|
||||
GString *str)
|
||||
{
|
||||
int duration;
|
||||
|
||||
g_return_if_fail (desc != NULL);
|
||||
g_return_if_fail (str != NULL);
|
||||
|
||||
duration = desc->duration;
|
||||
if (duration % 1000 == 0)
|
||||
g_string_append_printf (str, "%ds", (int) desc->duration / 1000);
|
||||
else
|
||||
g_string_append_printf (str, "%dms", (int) desc->duration);
|
||||
|
||||
switch (desc->progress_type)
|
||||
{
|
||||
case GTK_TIMELINE_PROGRESS_LINEAR:
|
||||
g_string_append (str, " linear");
|
||||
break;
|
||||
case GTK_TIMELINE_PROGRESS_EASE:
|
||||
g_string_append (str, " ease");
|
||||
break;
|
||||
case GTK_TIMELINE_PROGRESS_EASE_IN:
|
||||
g_string_append (str, " ease-in");
|
||||
break;
|
||||
case GTK_TIMELINE_PROGRESS_EASE_OUT:
|
||||
g_string_append (str, " ease-out");
|
||||
break;
|
||||
case GTK_TIMELINE_PROGRESS_EASE_IN_OUT:
|
||||
g_string_append (str, " ease-in-out");
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
if (desc->loop)
|
||||
g_string_append (str, " loop");
|
||||
}
|
||||
|
||||
GType
|
||||
_gtk_animation_description_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (G_UNLIKELY (!type))
|
||||
type = g_boxed_type_register_static (I_("GtkAnimationDescription"),
|
||||
(GBoxedCopyFunc) _gtk_animation_description_ref,
|
||||
(GBoxedFreeFunc) _gtk_animation_description_unref);
|
||||
|
||||
return type;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_ANIMATION_DESCRIPTION_H__
|
||||
#define __GTK_ANIMATION_DESCRIPTION_H__
|
||||
|
||||
#include "gtktimeline.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Dummy typedefs */
|
||||
typedef struct GtkAnimationDescription GtkAnimationDescription;
|
||||
|
||||
#define GTK_TYPE_ANIMATION_DESCRIPTION (_gtk_animation_description_get_type ())
|
||||
|
||||
GType _gtk_animation_description_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkAnimationDescription * _gtk_animation_description_new (gdouble duration,
|
||||
GtkTimelineProgressType progress_type,
|
||||
gboolean loop);
|
||||
|
||||
gdouble _gtk_animation_description_get_duration (GtkAnimationDescription *desc);
|
||||
GtkTimelineProgressType _gtk_animation_description_get_progress_type (GtkAnimationDescription *desc);
|
||||
gboolean _gtk_animation_description_get_loop (GtkAnimationDescription *desc);
|
||||
|
||||
GtkAnimationDescription * _gtk_animation_description_ref (GtkAnimationDescription *desc);
|
||||
void _gtk_animation_description_unref (GtkAnimationDescription *desc);
|
||||
|
||||
GtkAnimationDescription * _gtk_animation_description_from_string (const gchar *str);
|
||||
void _gtk_animation_description_print (GtkAnimationDescription *desc,
|
||||
GString *string);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_ANIMATION_DESCRIPTION_H__ */
|
||||
+57
-38
@@ -37,7 +37,7 @@
|
||||
#include "gtkintl.h"
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
#include "gtkquartz-menu.h"
|
||||
#include "gtkmodelmenu-quartz.h"
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include "gtkmessagedialog.h"
|
||||
@@ -149,7 +149,7 @@ struct _GtkApplicationPrivate
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GDBusConnection *session_bus;
|
||||
const gchar *application_id;
|
||||
gchar *object_path;
|
||||
const gchar *object_path;
|
||||
|
||||
gchar *app_menu_path;
|
||||
guint app_menu_id;
|
||||
@@ -185,6 +185,9 @@ gtk_application_x11_publish_menu (GtkApplication *application,
|
||||
{
|
||||
gint i;
|
||||
|
||||
if (application->priv->session_bus == NULL)
|
||||
return;
|
||||
|
||||
/* unexport any existing menu */
|
||||
if (*id)
|
||||
{
|
||||
@@ -252,8 +255,8 @@ gtk_application_window_added_x11 (GtkApplication *application,
|
||||
guint window_id;
|
||||
|
||||
window_id = application->priv->next_id++;
|
||||
window_path = g_strdup_printf ("%s/window/%d", application->priv->object_path, window_id);
|
||||
success = gtk_application_window_publish (app_window, application->priv->session_bus, window_path);
|
||||
window_path = g_strdup_printf ("%s/window/%u", application->priv->object_path, window_id);
|
||||
success = gtk_application_window_publish (app_window, application->priv->session_bus, window_path, window_id);
|
||||
g_free (window_path);
|
||||
}
|
||||
while (!success);
|
||||
@@ -271,34 +274,13 @@ gtk_application_window_removed_x11 (GtkApplication *application,
|
||||
gtk_application_window_unpublish (GTK_APPLICATION_WINDOW (window));
|
||||
}
|
||||
|
||||
static gchar *
|
||||
object_path_from_appid (const gchar *appid)
|
||||
{
|
||||
gchar *appid_path, *iter;
|
||||
|
||||
appid_path = g_strconcat ("/", appid, NULL);
|
||||
for (iter = appid_path; *iter; iter++)
|
||||
{
|
||||
if (*iter == '.')
|
||||
*iter = '/';
|
||||
|
||||
if (*iter == '-')
|
||||
*iter = '_';
|
||||
}
|
||||
|
||||
return appid_path;
|
||||
}
|
||||
|
||||
static void gtk_application_startup_session_dbus (GtkApplication *app);
|
||||
|
||||
static void
|
||||
gtk_application_startup_x11 (GtkApplication *application)
|
||||
{
|
||||
const gchar *application_id;
|
||||
|
||||
application_id = g_application_get_application_id (G_APPLICATION (application));
|
||||
application->priv->session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
||||
application->priv->object_path = object_path_from_appid (application_id);
|
||||
application->priv->session_bus = g_application_get_dbus_connection (G_APPLICATION (application));
|
||||
application->priv->object_path = g_application_get_dbus_object_path (G_APPLICATION (application));
|
||||
|
||||
gtk_application_startup_session_dbus (GTK_APPLICATION (application));
|
||||
}
|
||||
@@ -306,9 +288,8 @@ gtk_application_startup_x11 (GtkApplication *application)
|
||||
static void
|
||||
gtk_application_shutdown_x11 (GtkApplication *application)
|
||||
{
|
||||
g_free (application->priv->object_path);
|
||||
application->priv->session_bus = NULL;
|
||||
application->priv->object_path = NULL;
|
||||
g_clear_object (&application->priv->session_bus);
|
||||
|
||||
g_clear_object (&application->priv->sm_proxy);
|
||||
g_clear_object (&application->priv->client_proxy);
|
||||
@@ -316,12 +297,6 @@ gtk_application_shutdown_x11 (GtkApplication *application)
|
||||
g_free (application->priv->client_path);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gtk_application_get_dbus_object_path (GtkApplication *application)
|
||||
{
|
||||
return application->priv->object_path;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gtk_application_get_app_menu_object_path (GtkApplication *application)
|
||||
{
|
||||
@@ -526,6 +501,10 @@ gtk_application_init (GtkApplication *application)
|
||||
application->priv = G_TYPE_INSTANCE_GET_PRIVATE (application,
|
||||
GTK_TYPE_APPLICATION,
|
||||
GtkApplicationPrivate);
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
application->priv->next_id = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -784,8 +763,8 @@ gtk_application_class_init (GtkApplicationClass *class)
|
||||
* as soon as the application gets registered as the primary instance.
|
||||
*
|
||||
* Concretely, gtk_init() is called in the default handler for the
|
||||
* startup() signal. Therefore, #GtkApplication subclasses should
|
||||
* chain up in their startup() handler before using any GTK+ API.
|
||||
* #GApplication:startup signal. Therefore, #GtkApplication subclasses should
|
||||
* chain up in their #GApplication:startup handler before using any GTK+ API.
|
||||
*
|
||||
* Note that commandline arguments are not passed to gtk_init().
|
||||
* All GTK+ functionality that is available via commandline arguments
|
||||
@@ -820,7 +799,7 @@ gtk_application_new (const gchar *application_id,
|
||||
* @application: a #GtkApplication
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Adds a window from @application.
|
||||
* Adds a window to @application.
|
||||
*
|
||||
* This call is equivalent to setting the #GtkWindow:application
|
||||
* property of @window to @application.
|
||||
@@ -898,6 +877,34 @@ gtk_application_get_windows (GtkApplication *application)
|
||||
return application->priv->windows;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_application_get_window_by_id:
|
||||
* @application: a #GtkApplication
|
||||
* @id: an identifier number
|
||||
*
|
||||
* Returns: (transfer none): the #GtkApplicationWindow with ID @id, or
|
||||
* %NULL if there is no window with this ID
|
||||
*
|
||||
* Since: 3.6
|
||||
*/
|
||||
GtkWindow *
|
||||
gtk_application_get_window_by_id (GtkApplication *application,
|
||||
guint id)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_APPLICATION (application), NULL);
|
||||
|
||||
for (l = application->priv->windows; l != NULL; l = l->next)
|
||||
{
|
||||
if (GTK_IS_APPLICATION_WINDOW (l->data) &&
|
||||
gtk_application_window_get_id (GTK_APPLICATION_WINDOW (l->data)) == id)
|
||||
return l->data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_application_add_accelerator:
|
||||
* @application: a #GtkApplication
|
||||
@@ -999,6 +1006,10 @@ gtk_application_remove_accelerator (GtkApplication *application,
|
||||
*
|
||||
* Sets or unsets the application menu for @application.
|
||||
*
|
||||
* This can only be done in the primary instance of the application,
|
||||
* after it has been registered. #GApplication:startup is a good place
|
||||
* to call this.
|
||||
*
|
||||
* The application menu is a single menu containing items that typically
|
||||
* impact the application as a whole, rather than acting on a specific
|
||||
* window or document. For example, you would expect to see
|
||||
@@ -1018,6 +1029,8 @@ gtk_application_set_app_menu (GtkApplication *application,
|
||||
GMenuModel *app_menu)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_APPLICATION (application));
|
||||
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
|
||||
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
|
||||
|
||||
if (app_menu != application->priv->app_menu)
|
||||
{
|
||||
@@ -1067,6 +1080,10 @@ gtk_application_get_app_menu (GtkApplication *application)
|
||||
*
|
||||
* This is a menubar in the traditional sense.
|
||||
*
|
||||
* This can only be done in the primary instance of the application,
|
||||
* after it has been registered. #GApplication:startup is a good place
|
||||
* to call this.
|
||||
*
|
||||
* Depending on the desktop environment, this may appear at the top of
|
||||
* each window, or at the top of the screen. In some environments, if
|
||||
* both the application menu and the menubar are set, the application
|
||||
@@ -1085,6 +1102,8 @@ gtk_application_set_menubar (GtkApplication *application,
|
||||
GMenuModel *menubar)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_APPLICATION (application));
|
||||
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
|
||||
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
|
||||
|
||||
if (menubar != application->priv->menubar)
|
||||
{
|
||||
|
||||
@@ -115,6 +115,10 @@ GDK_AVAILABLE_IN_3_4
|
||||
gboolean gtk_application_is_inhibited (GtkApplication *application,
|
||||
GtkApplicationInhibitFlags flags);
|
||||
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
GtkWindow * gtk_application_get_window_by_id (GtkApplication *application,
|
||||
guint id);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_APPLICATION_H__ */
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
G_GNUC_INTERNAL
|
||||
gboolean gtk_application_window_publish (GtkApplicationWindow *window,
|
||||
GDBusConnection *session,
|
||||
const gchar *object_path);
|
||||
const gchar *object_path,
|
||||
guint object_id);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
void gtk_application_window_unpublish (GtkApplicationWindow *window);
|
||||
@@ -43,8 +44,6 @@ GActionObservable * gtk_application_window_get_observable (GtkAppl
|
||||
G_GNUC_INTERNAL
|
||||
GtkAccelGroup * gtk_application_window_get_accel_group (GtkApplicationWindow *window);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
const gchar * gtk_application_get_dbus_object_path (GtkApplication *application);
|
||||
G_GNUC_INTERNAL
|
||||
const gchar * gtk_application_get_app_menu_object_path (GtkApplication *application);
|
||||
G_GNUC_INTERNAL
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
#include <gdk/x11/gdkx.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gdesktopappinfo.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SECTION:gtkapplicationwindow
|
||||
* @title: GtkApplicationWindow
|
||||
@@ -214,6 +218,8 @@ struct _GtkApplicationWindowPrivate
|
||||
GDBusConnection *session;
|
||||
gchar *object_path;
|
||||
guint export_id;
|
||||
|
||||
guint id;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -253,6 +259,32 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
static gchar *
|
||||
gtk_application_window_get_app_desktop_name (void)
|
||||
{
|
||||
gchar *retval = NULL;
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
GDesktopAppInfo *app_info;
|
||||
const gchar *app_name = NULL;
|
||||
gchar *desktop_file;
|
||||
|
||||
desktop_file = g_strconcat (g_get_prgname (), ".desktop", NULL);
|
||||
app_info = g_desktop_app_info_new (desktop_file);
|
||||
g_free (desktop_file);
|
||||
|
||||
if (app_info != NULL)
|
||||
app_name = g_app_info_get_name (G_APP_INFO (app_info));
|
||||
|
||||
if (app_name != NULL)
|
||||
retval = g_strdup (app_name);
|
||||
|
||||
g_clear_object (&app_info);
|
||||
#endif /* HAVE_GIO_UNIX */
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_application_window_update_shell_shows_app_menu (GtkApplicationWindow *window,
|
||||
GtkSettings *settings)
|
||||
@@ -278,12 +310,25 @@ gtk_application_window_update_shell_shows_app_menu (GtkApplicationWindow *window
|
||||
|
||||
if (app_menu != NULL)
|
||||
{
|
||||
const gchar *name;
|
||||
const gchar *app_name;
|
||||
gchar *name;
|
||||
|
||||
app_name = g_get_application_name ();
|
||||
if (app_name != g_get_prgname ())
|
||||
{
|
||||
/* the app has set its application name, use it */
|
||||
name = g_strdup (app_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* get the name from .desktop file */
|
||||
name = gtk_application_window_get_app_desktop_name ();
|
||||
if (name == NULL)
|
||||
name = g_strdup (_("Application"));
|
||||
}
|
||||
|
||||
name = g_get_application_name ();
|
||||
if (name == g_get_prgname ())
|
||||
name = _("Application");
|
||||
g_menu_append_submenu (window->priv->app_menu_section, name, app_menu);
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -725,7 +770,7 @@ gtk_application_window_real_realize (GtkWidget *widget)
|
||||
|
||||
gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
|
||||
|
||||
if (GDK_IS_X11_WINDOW (gdkwindow))
|
||||
if (GDK_IS_X11_WINDOW (gdkwindow) && window->priv->session)
|
||||
{
|
||||
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_APPLICATION_ID",
|
||||
g_application_get_application_id (G_APPLICATION (application)));
|
||||
@@ -734,7 +779,7 @@ gtk_application_window_real_realize (GtkWidget *widget)
|
||||
g_dbus_connection_get_unique_name (window->priv->session));
|
||||
|
||||
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_APPLICATION_OBJECT_PATH",
|
||||
gtk_application_get_dbus_object_path (application));
|
||||
g_application_get_dbus_object_path (G_APPLICATION (application)));
|
||||
|
||||
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_WINDOW_OBJECT_PATH",
|
||||
window->priv->object_path);
|
||||
@@ -766,11 +811,13 @@ gtk_application_window_real_unrealize (GtkWidget *widget)
|
||||
gboolean
|
||||
gtk_application_window_publish (GtkApplicationWindow *window,
|
||||
GDBusConnection *session,
|
||||
const gchar *object_path)
|
||||
const gchar *object_path,
|
||||
guint object_id)
|
||||
{
|
||||
g_assert (window->priv->session == NULL);
|
||||
g_assert (window->priv->export_id == 0);
|
||||
g_assert (window->priv->object_path == NULL);
|
||||
g_assert (window->priv->id == 0);
|
||||
|
||||
window->priv->export_id = g_dbus_connection_export_action_group (session, object_path,
|
||||
G_ACTION_GROUP (window->priv->actions),
|
||||
@@ -781,6 +828,7 @@ gtk_application_window_publish (GtkApplicationWindow *window,
|
||||
|
||||
window->priv->session = session;
|
||||
window->priv->object_path = g_strdup (object_path);
|
||||
window->priv->id = object_id;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -791,10 +839,12 @@ gtk_application_window_unpublish (GtkApplicationWindow *window)
|
||||
g_assert (window->priv->session != NULL);
|
||||
g_assert (window->priv->export_id != 0);
|
||||
g_assert (window->priv->object_path != NULL);
|
||||
g_assert (window->priv->id != 0);
|
||||
|
||||
g_dbus_connection_unexport_action_group (window->priv->session, window->priv->export_id);
|
||||
window->priv->session = NULL;
|
||||
window->priv->export_id = 0;
|
||||
window->priv->id = 0;
|
||||
|
||||
g_free (window->priv->object_path);
|
||||
window->priv->object_path = NULL;
|
||||
@@ -1043,3 +1093,23 @@ gtk_application_window_get_accel_group (GtkApplicationWindow *window)
|
||||
{
|
||||
return window->priv->accels;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_application_window_get_id:
|
||||
* @window: a #GtkApplicationWindow
|
||||
*
|
||||
* Returns the unique ID of the window. If the window has not yet been added to
|
||||
* a #GtkApplication, returns <literal>0</literal>.
|
||||
*
|
||||
* Returns: the unique ID for @window, or <literal>0</literal> if the window
|
||||
* has not yet been added to a #GtkApplication
|
||||
*
|
||||
* Since: 3.6
|
||||
*/
|
||||
guint
|
||||
gtk_application_window_get_id (GtkApplicationWindow *window)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_APPLICATION_WINDOW (window), 0);
|
||||
|
||||
return window->priv->id;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ void gtk_application_window_set_show_menubar (GtkApplicationWindow *windo
|
||||
GDK_AVAILABLE_IN_3_4
|
||||
gboolean gtk_application_window_get_show_menubar (GtkApplicationWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
guint gtk_application_window_get_id (GtkApplicationWindow *window);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_APPLICATION_WINDOW_H__ */
|
||||
|
||||
+1
-1
@@ -391,7 +391,7 @@ gtk_button_box_get_child_secondary (GtkButtonBox *widget,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_button_box_set_child_secondary
|
||||
* gtk_button_box_set_child_secondary:
|
||||
* @widget: a #GtkButtonBox
|
||||
* @child: a child of @widget
|
||||
* @is_secondary: if %TRUE, the @child appears in a secondary group of the
|
||||
|
||||
+51
-38
@@ -25,6 +25,10 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "gtkborderimageprivate.h"
|
||||
#include "gtkcssbordervalueprivate.h"
|
||||
#include "gtkcssimagevalueprivate.h"
|
||||
#include "gtkcssnumbervalueprivate.h"
|
||||
#include "gtkcssrepeatvalueprivate.h"
|
||||
#include "gtkstylepropertiesprivate.h"
|
||||
#include "gtkthemingengineprivate.h"
|
||||
|
||||
@@ -37,23 +41,13 @@ gboolean
|
||||
_gtk_border_image_init (GtkBorderImage *image,
|
||||
GtkThemingEngine *engine)
|
||||
{
|
||||
GtkBorder *width;
|
||||
|
||||
image->source = _gtk_css_value_get_object (_gtk_theming_engine_peek_property (engine, "border-image-source"));
|
||||
image->source = _gtk_css_image_value_get_image (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE));
|
||||
if (image->source == NULL)
|
||||
return FALSE;
|
||||
|
||||
image->slice = *(GtkBorder *) _gtk_css_value_get_boxed (_gtk_theming_engine_peek_property (engine, "border-image-slice"));
|
||||
width = _gtk_css_value_get_boxed (_gtk_theming_engine_peek_property (engine, "border-image-width"));
|
||||
if (width)
|
||||
{
|
||||
image->width = *width;
|
||||
image->has_width = TRUE;
|
||||
}
|
||||
else
|
||||
image->has_width = FALSE;
|
||||
|
||||
image->repeat = *_gtk_css_value_get_border_image_repeat (_gtk_theming_engine_peek_property (engine, "border-image-repeat"));
|
||||
image->slice = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE);
|
||||
image->width = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH);
|
||||
image->repeat = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -65,20 +59,38 @@ struct _GtkBorderImageSliceSize {
|
||||
};
|
||||
|
||||
static void
|
||||
gtk_border_image_compute_border_size (GtkBorderImageSliceSize sizes[3],
|
||||
double offset,
|
||||
double area_size,
|
||||
int start_border,
|
||||
int end_border)
|
||||
gtk_border_image_compute_border_size (GtkBorderImageSliceSize sizes[3],
|
||||
double offset,
|
||||
double area_size,
|
||||
int start_border_width,
|
||||
int end_border_width,
|
||||
const GtkCssValue *start_border,
|
||||
const GtkCssValue *end_border)
|
||||
{
|
||||
/* This code assumes area_size >= start_border + end_border */
|
||||
double start, end;
|
||||
|
||||
if (_gtk_css_number_value_get_unit (start_border) == GTK_CSS_NUMBER)
|
||||
start = start_border_width * _gtk_css_number_value_get (start_border, 100);
|
||||
else
|
||||
start = _gtk_css_number_value_get (start_border, area_size);
|
||||
if (_gtk_css_number_value_get_unit (end_border) == GTK_CSS_NUMBER)
|
||||
end = end_border_width * _gtk_css_number_value_get (end_border, 100);
|
||||
else
|
||||
end = _gtk_css_number_value_get (end_border, area_size);
|
||||
|
||||
/* XXX: reduce vertical and horizontal by the same factor */
|
||||
if (start + end > area_size)
|
||||
{
|
||||
start = start * area_size / (start + end);
|
||||
end = end * area_size / (start + end);
|
||||
}
|
||||
|
||||
sizes[0].offset = offset;
|
||||
sizes[0].size = start_border;
|
||||
sizes[1].offset = offset + start_border;
|
||||
sizes[1].size = area_size - start_border - end_border;
|
||||
sizes[2].offset = offset + area_size - end_border;
|
||||
sizes[2].size = end_border;
|
||||
sizes[0].size = start;
|
||||
sizes[1].offset = offset + start;
|
||||
sizes[1].size = area_size - start - end;
|
||||
sizes[2].offset = offset + area_size - end;
|
||||
sizes[2].size = end;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -90,8 +102,8 @@ gtk_border_image_render_slice (cairo_t *cr,
|
||||
double y,
|
||||
double width,
|
||||
double height,
|
||||
GtkCssBorderRepeatStyle hrepeat,
|
||||
GtkCssBorderRepeatStyle vrepeat)
|
||||
GtkCssRepeatStyle hrepeat,
|
||||
GtkCssRepeatStyle vrepeat)
|
||||
{
|
||||
double hscale, vscale;
|
||||
double xstep, ystep;
|
||||
@@ -236,9 +248,6 @@ _gtk_border_image_render (GtkBorderImage *image,
|
||||
double source_width, source_height;
|
||||
int h, v;
|
||||
|
||||
if (image->has_width)
|
||||
border_width = &image->width;
|
||||
|
||||
_gtk_css_image_get_concrete_size (image->source,
|
||||
0, 0,
|
||||
width, height,
|
||||
@@ -252,22 +261,26 @@ _gtk_border_image_render (GtkBorderImage *image,
|
||||
|
||||
gtk_border_image_compute_slice_size (horizontal_slice,
|
||||
source_width,
|
||||
image->slice.left,
|
||||
image->slice.right);
|
||||
_gtk_css_number_value_get (_gtk_css_border_value_get_left (image->slice), source_width),
|
||||
_gtk_css_number_value_get (_gtk_css_border_value_get_right (image->slice), source_width));
|
||||
gtk_border_image_compute_slice_size (vertical_slice,
|
||||
source_height,
|
||||
image->slice.top,
|
||||
image->slice.bottom);
|
||||
_gtk_css_number_value_get (_gtk_css_border_value_get_top (image->slice), source_height),
|
||||
_gtk_css_number_value_get (_gtk_css_border_value_get_bottom (image->slice), source_height));
|
||||
gtk_border_image_compute_border_size (horizontal_border,
|
||||
x,
|
||||
width,
|
||||
border_width->left,
|
||||
border_width->right);
|
||||
border_width->right,
|
||||
_gtk_css_border_value_get_left (image->width),
|
||||
_gtk_css_border_value_get_right (image->width));
|
||||
gtk_border_image_compute_border_size (vertical_border,
|
||||
y,
|
||||
height,
|
||||
border_width->top,
|
||||
border_width->bottom);
|
||||
border_width->bottom,
|
||||
_gtk_css_border_value_get_top (image->width),
|
||||
_gtk_css_border_value_get_bottom(image->width));
|
||||
|
||||
for (v = 0; v < 3; v++)
|
||||
{
|
||||
@@ -298,8 +311,8 @@ _gtk_border_image_render (GtkBorderImage *image,
|
||||
vertical_border[v].offset,
|
||||
horizontal_border[h].size,
|
||||
vertical_border[v].size,
|
||||
h == 1 ? image->repeat.hrepeat : GTK_CSS_REPEAT_STYLE_STRETCH,
|
||||
v == 1 ? image->repeat.vrepeat : GTK_CSS_REPEAT_STYLE_STRETCH);
|
||||
h == 1 ? _gtk_css_border_repeat_value_get_x (image->repeat) : GTK_CSS_REPEAT_STYLE_STRETCH,
|
||||
v == 1 ? _gtk_css_border_repeat_value_get_y (image->repeat) : GTK_CSS_REPEAT_STYLE_STRETCH);
|
||||
|
||||
cairo_surface_destroy (slice);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
#include "gtkborder.h"
|
||||
#include "gtkcssimageprivate.h"
|
||||
#include "gtkcssvalueprivate.h"
|
||||
#include "gtkthemingengine.h"
|
||||
#include "gtkcsstypesprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -34,10 +34,9 @@ typedef struct _GtkBorderImage GtkBorderImage;
|
||||
struct _GtkBorderImage {
|
||||
GtkCssImage *source;
|
||||
|
||||
GtkBorder slice;
|
||||
gboolean has_width;
|
||||
GtkBorder width;
|
||||
GtkCssBorderImageRepeat repeat;
|
||||
GtkCssValue *slice;
|
||||
GtkCssValue *width;
|
||||
GtkCssValue *repeat;
|
||||
};
|
||||
|
||||
gboolean _gtk_border_image_init (GtkBorderImage *image,
|
||||
|
||||
+9
-2
@@ -85,6 +85,7 @@
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtksizerequest.h"
|
||||
#include "gtkwidgetpath.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "a11y/gtkboxaccessible.h"
|
||||
|
||||
|
||||
@@ -898,7 +899,7 @@ gtk_box_get_path_for_child (GtkContainer *container,
|
||||
box = GTK_BOX (container);
|
||||
private = box->priv;
|
||||
|
||||
path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
|
||||
path = _gtk_widget_create_path (GTK_WIDGET (container));
|
||||
|
||||
if (gtk_widget_get_visible (child))
|
||||
{
|
||||
@@ -937,11 +938,17 @@ gtk_box_get_path_for_child (GtkContainer *container,
|
||||
return path;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_invalidate_order_foreach (GtkWidget *widget)
|
||||
{
|
||||
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_invalidate_order (GtkBox *box)
|
||||
{
|
||||
gtk_container_foreach (GTK_CONTAINER (box),
|
||||
(GtkCallback) gtk_widget_reset_style,
|
||||
(GtkCallback) gtk_box_invalidate_order_foreach,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -963,15 +963,15 @@ end_element (GMarkupParseContext *context,
|
||||
else if (strcmp (element_name, "interface") == 0)
|
||||
{
|
||||
}
|
||||
else if (strcmp (element_name, "menu") == 0)
|
||||
{
|
||||
_gtk_builder_menu_end (data);
|
||||
}
|
||||
else if (data->requested_objects && !data->inside_requested_object)
|
||||
{
|
||||
/* If outside a requested object, simply ignore this tag */
|
||||
return;
|
||||
}
|
||||
else if (strcmp (element_name, "menu") == 0)
|
||||
{
|
||||
_gtk_builder_menu_end (data);
|
||||
}
|
||||
else if (strcmp (element_name, "object") == 0)
|
||||
{
|
||||
ObjectInfo *object_info = state_pop_info (data, ObjectInfo);
|
||||
|
||||
+9
-27
@@ -1677,15 +1677,12 @@ gtk_button_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_button_paint (GtkButton *button,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
GtkStateFlags state)
|
||||
static gboolean
|
||||
gtk_button_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
GtkButtonPrivate *priv = button->priv;
|
||||
GtkWidget *widget;
|
||||
gint x, y;
|
||||
GtkBorder default_border;
|
||||
GtkBorder default_outside_border;
|
||||
@@ -1694,13 +1691,12 @@ _gtk_button_paint (GtkButton *button,
|
||||
gint focus_pad;
|
||||
GtkAllocation allocation;
|
||||
GtkStyleContext *context;
|
||||
GtkStateFlags state;
|
||||
gboolean draw_focus;
|
||||
gint width, height;
|
||||
|
||||
widget = GTK_WIDGET (button);
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
gtk_style_context_save (context);
|
||||
gtk_style_context_set_state (context, state);
|
||||
state = gtk_style_context_get_state (context);
|
||||
|
||||
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, NULL, &interior_focus);
|
||||
gtk_style_context_get_style (context,
|
||||
@@ -1712,6 +1708,8 @@ _gtk_button_paint (GtkButton *button,
|
||||
|
||||
x = 0;
|
||||
y = 0;
|
||||
width = allocation.width;
|
||||
height = allocation.height;
|
||||
|
||||
if (gtk_widget_has_default (widget) &&
|
||||
priv->relief == GTK_RELIEF_NORMAL)
|
||||
@@ -1720,8 +1718,6 @@ _gtk_button_paint (GtkButton *button,
|
||||
y += default_border.top;
|
||||
width -= default_border.left + default_border.right;
|
||||
height -= default_border.top + default_border.bottom;
|
||||
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_DEFAULT);
|
||||
}
|
||||
else if (gtk_widget_get_can_default (widget))
|
||||
{
|
||||
@@ -1789,20 +1785,6 @@ _gtk_button_paint (GtkButton *button,
|
||||
gtk_render_focus (context, cr, x, y, width, height);
|
||||
}
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_button_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
|
||||
_gtk_button_paint (button, cr,
|
||||
gtk_widget_get_allocated_width (widget),
|
||||
gtk_widget_get_allocated_height (widget),
|
||||
gtk_widget_get_state_flags (widget));
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_button_parent_class)->draw (widget, cr);
|
||||
|
||||
return FALSE;
|
||||
|
||||
@@ -63,11 +63,6 @@ struct _GtkButtonPrivate
|
||||
|
||||
void _gtk_button_set_depressed (GtkButton *button,
|
||||
gboolean depressed);
|
||||
void _gtk_button_paint (GtkButton *button,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
GtkStateFlags state);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+3
-3
@@ -610,7 +610,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
|
||||
|
||||
|
||||
/**
|
||||
* GtkCalendar:inner-border
|
||||
* GtkCalendar:inner-border:
|
||||
*
|
||||
* The spacing around the day/week headers and main area.
|
||||
*/
|
||||
@@ -622,7 +622,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* GtkCalndar:vertical-separation
|
||||
* GtkCalndar:vertical-separation:
|
||||
*
|
||||
* Separation between day headers and main area.
|
||||
*/
|
||||
@@ -634,7 +634,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* GtkCalendar:horizontal-separation
|
||||
* GtkCalendar:horizontal-separation:
|
||||
*
|
||||
* Separation between week headers and main area.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -2335,7 +2335,7 @@ gtk_cell_area_attribute_disconnect (GtkCellArea *area,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_cell_area_apply_attributes
|
||||
* gtk_cell_area_apply_attributes:
|
||||
* @area: a #GtkCellArea
|
||||
* @tree_model: the #GtkTreeModel to pull values from
|
||||
* @iter: the #GtkTreeIter in @tree_model to apply values for
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#undef GDK_DEPRECATED_FOR
|
||||
#define GDK_DEPRECATED
|
||||
#define GDK_DEPRECATED_FOR(f)
|
||||
#undef GTK_DISABLE_DEPRECATED
|
||||
|
||||
#include "deprecated/gtkstyle.h"
|
||||
|
||||
|
||||
@@ -107,7 +107,8 @@ enum {
|
||||
PROP_MAX_WIDTH_CHARS,
|
||||
PROP_WRAP_WIDTH,
|
||||
PROP_ALIGN,
|
||||
|
||||
PROP_PLACEHOLDER_TEXT,
|
||||
|
||||
/* Style args */
|
||||
PROP_BACKGROUND,
|
||||
PROP_FOREGROUND,
|
||||
@@ -171,6 +172,7 @@ struct _GtkCellRendererTextPrivate
|
||||
PangoWrapMode wrap_mode;
|
||||
|
||||
gchar *text;
|
||||
gchar *placeholder_text;
|
||||
|
||||
gdouble font_scale;
|
||||
|
||||
@@ -619,7 +621,22 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
|
||||
PANGO_TYPE_ALIGNMENT,
|
||||
PANGO_ALIGN_LEFT,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
|
||||
/**
|
||||
* GtkCellRendererText:placeholder-text:
|
||||
*
|
||||
* The text that will be displayed in the #GtkCellRenderer if
|
||||
* #GtkCellRendererText:editable is %TRUE and the cell is empty.
|
||||
*
|
||||
* Since 3.6
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_PLACEHOLDER_TEXT,
|
||||
g_param_spec_string ("placeholder-text",
|
||||
P_("Placeholder text"),
|
||||
P_("Text rendered when an editable cell is empty"),
|
||||
NULL,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
|
||||
/* Style props are set or not */
|
||||
@@ -691,7 +708,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
|
||||
P_("Whether this tag affects the alignment mode"));
|
||||
|
||||
/**
|
||||
* GtkCellRendererText::edited
|
||||
* GtkCellRendererText::edited:
|
||||
* @renderer: the object which received the signal
|
||||
* @path: the path identifying the edited cell
|
||||
* @new_text: the new text
|
||||
@@ -726,6 +743,7 @@ gtk_cell_renderer_text_finalize (GObject *object)
|
||||
pango_font_description_free (priv->font);
|
||||
|
||||
g_free (priv->text);
|
||||
g_free (priv->placeholder_text);
|
||||
|
||||
if (priv->extra_attrs)
|
||||
pango_attr_list_unref (priv->extra_attrs);
|
||||
@@ -950,6 +968,10 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
||||
g_value_set_int (value, priv->max_width_chars);
|
||||
break;
|
||||
|
||||
case PROP_PLACEHOLDER_TEXT:
|
||||
g_value_set_string (value, priv->placeholder_text);
|
||||
break;
|
||||
|
||||
case PROP_BACKGROUND:
|
||||
case PROP_FOREGROUND:
|
||||
case PROP_MARKUP:
|
||||
@@ -1510,7 +1532,12 @@ gtk_cell_renderer_text_set_property (GObject *object,
|
||||
case PROP_ALIGN_SET:
|
||||
priv->align_set = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
|
||||
case PROP_PLACEHOLDER_TEXT:
|
||||
g_free (priv->placeholder_text);
|
||||
priv->placeholder_text = g_value_dup_string (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
break;
|
||||
@@ -1536,6 +1563,15 @@ gtk_cell_renderer_text_new (void)
|
||||
return g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, NULL);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
show_placeholder_text (GtkCellRendererText *celltext)
|
||||
{
|
||||
GtkCellRendererTextPrivate *priv = celltext->priv;
|
||||
|
||||
return priv->editable && priv->placeholder_text &&
|
||||
(!priv->text || !priv->text[0]);
|
||||
}
|
||||
|
||||
static void
|
||||
add_attr (PangoAttrList *attr_list,
|
||||
PangoAttribute *attr)
|
||||
@@ -1557,8 +1593,10 @@ get_layout (GtkCellRendererText *celltext,
|
||||
PangoLayout *layout;
|
||||
PangoUnderline uline;
|
||||
gint xpad;
|
||||
gboolean placeholder_layout = show_placeholder_text (celltext);
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, priv->text);
|
||||
layout = gtk_widget_create_pango_layout (widget, placeholder_layout ?
|
||||
priv->placeholder_text : priv->text);
|
||||
|
||||
gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (celltext), &xpad, NULL);
|
||||
|
||||
@@ -1569,7 +1607,7 @@ get_layout (GtkCellRendererText *celltext,
|
||||
|
||||
pango_layout_set_single_paragraph_mode (layout, priv->single_paragraph);
|
||||
|
||||
if (cell_area)
|
||||
if (!placeholder_layout && cell_area)
|
||||
{
|
||||
/* Add options that affect appearance but not size */
|
||||
|
||||
@@ -1594,6 +1632,22 @@ get_layout (GtkCellRendererText *celltext,
|
||||
add_attr (attr_list,
|
||||
pango_attr_strikethrough_new (priv->strikethrough));
|
||||
}
|
||||
else if (placeholder_layout)
|
||||
{
|
||||
PangoColor color;
|
||||
GtkStyleContext *context;
|
||||
GdkRGBA fg = { 0.5, 0.5, 0.5 };
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_lookup_color (context, "placeholder_text_color", &fg);
|
||||
|
||||
color.red = CLAMP (fg.red * 65535. + 0.5, 0, 65535);
|
||||
color.green = CLAMP (fg.green * 65535. + 0.5, 0, 65535);
|
||||
color.blue = CLAMP (fg.blue * 65535. + 0.5, 0, 65535);
|
||||
|
||||
add_attr (attr_list,
|
||||
pango_attr_foreground_new (color.red, color.green, color.blue));
|
||||
}
|
||||
|
||||
add_attr (attr_list, pango_attr_font_desc_new (priv->font));
|
||||
|
||||
|
||||
+7
-7
@@ -192,7 +192,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
GTK_PARAM_WRITABLE));
|
||||
|
||||
/**
|
||||
* GtkCellView:background-gdk
|
||||
* GtkCellView:background-gdk:
|
||||
*
|
||||
* The background color as a #GdkColor
|
||||
*
|
||||
@@ -206,7 +206,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
GDK_TYPE_COLOR,
|
||||
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
|
||||
/**
|
||||
* GtkCellView:background-rgba
|
||||
* GtkCellView:background-rgba:
|
||||
*
|
||||
* The background color as a #GdkRGBA
|
||||
*
|
||||
@@ -221,7 +221,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkCellView:model
|
||||
* GtkCellView:model:
|
||||
*
|
||||
* The model for cell view
|
||||
*
|
||||
@@ -237,7 +237,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
|
||||
|
||||
/**
|
||||
* GtkCellView:cell-area
|
||||
* GtkCellView:cell-area:
|
||||
*
|
||||
* The #GtkCellArea rendering cells
|
||||
*
|
||||
@@ -255,7 +255,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||
|
||||
/**
|
||||
* GtkCellView:cell-area-context
|
||||
* GtkCellView:cell-area-context:
|
||||
*
|
||||
* The #GtkCellAreaContext used to compute the geometry of the cell view.
|
||||
*
|
||||
@@ -280,7 +280,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||
|
||||
/**
|
||||
* GtkCellView:draw-sensitive
|
||||
* GtkCellView:draw-sensitive:
|
||||
*
|
||||
* Whether all cells should be draw as sensitive for this view regardless
|
||||
* of the actual cell properties (used to make menus with submenus appear
|
||||
@@ -298,7 +298,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkCellView:fit-model
|
||||
* GtkCellView:fit-model:
|
||||
*
|
||||
* Whether the view should request enough space to always fit
|
||||
* the size of every row in the model (used by the combo box to
|
||||
|
||||
+3
-3
@@ -1816,7 +1816,7 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_clipboard_wait_for_targets
|
||||
* gtk_clipboard_wait_for_targets:
|
||||
* @clipboard: a #GtkClipboard
|
||||
* @targets: (out) (array length=n_targets) (transfer container): location
|
||||
* to store an array of targets. The result stored here must
|
||||
@@ -1824,9 +1824,9 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
|
||||
* @n_targets: location to store number of items in @targets.
|
||||
*
|
||||
* Returns a list of targets that are present on the clipboard, or %NULL
|
||||
* if there aren't any targets available. The returned list must be
|
||||
* if there aren't any targets available. The returned list must be
|
||||
* freed with g_free().
|
||||
* This function waits for the data to be received using the main
|
||||
* This function waits for the data to be received using the main
|
||||
* loop, so events, timeouts, etc, may be dispatched during the wait.
|
||||
*
|
||||
* Return value: %TRUE if any targets are present on the clipboard,
|
||||
|
||||
+1
-10
@@ -60,8 +60,6 @@
|
||||
#define CHECK_DARK (1.0 / 3.0)
|
||||
#define CHECK_LIGHT (2.0 / 3.0)
|
||||
|
||||
#define COLOR_SAMPLE_MARGIN 1
|
||||
|
||||
struct _GtkColorButtonPrivate
|
||||
{
|
||||
GtkWidget *draw_area; /* Widget where we draw the color sample */
|
||||
@@ -437,19 +435,12 @@ gtk_color_button_init (GtkColorButton *button)
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
button->priv->draw_area = gtk_drawing_area_new ();
|
||||
g_object_set (button->priv->draw_area,
|
||||
"margin-top", COLOR_SAMPLE_MARGIN,
|
||||
"margin-bottom", COLOR_SAMPLE_MARGIN,
|
||||
"margin-left", 16,
|
||||
"margin-right", 16,
|
||||
NULL);
|
||||
|
||||
layout = gtk_widget_create_pango_layout (GTK_WIDGET (button), "Black");
|
||||
pango_layout_get_pixel_extents (layout, NULL, &rect);
|
||||
g_object_unref (layout);
|
||||
|
||||
gtk_widget_set_size_request (button->priv->draw_area,
|
||||
rect.width, rect.height - 2 * COLOR_SAMPLE_MARGIN);
|
||||
rect.width, rect.height);
|
||||
|
||||
g_signal_connect (button->priv->draw_area, "draw",
|
||||
G_CALLBACK (gtk_color_button_draw_cb), button);
|
||||
|
||||
+9
-2
@@ -41,6 +41,7 @@
|
||||
#include "gtktreeselection.h"
|
||||
#include "gtkseparator.h"
|
||||
#include "gtkwidgetpath.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkwindow.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkprivate.h"
|
||||
@@ -1381,11 +1382,17 @@ gtk_combo_box_button_state_flags_changed (GtkWidget *widget,
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_box_invalidate_order_foreach (GtkWidget *widget)
|
||||
{
|
||||
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_box_invalidate_order (GtkComboBox *combo_box)
|
||||
{
|
||||
gtk_container_forall (GTK_CONTAINER (combo_box),
|
||||
(GtkCallback) gtk_widget_reset_style,
|
||||
(GtkCallback) gtk_combo_box_invalidate_order_foreach,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -1408,7 +1415,7 @@ gtk_combo_box_get_path_for_child (GtkContainer *container,
|
||||
GtkWidgetPath *sibling_path;
|
||||
int pos;
|
||||
|
||||
path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
|
||||
path = _gtk_widget_create_path (GTK_WIDGET (container));
|
||||
|
||||
if (gtk_widget_get_visible (child))
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user