Compare commits
337 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 08b276a6d4 | |||
| e6289f6169 | |||
| bf6743712d | |||
| 7ce746b9a5 | |||
| ddd9718cde | |||
| 0c69298c1c | |||
| 1104088cbf | |||
| ce50fc001a | |||
| 2e8f42da85 | |||
| 73864a350b | |||
| f3f5b6bd02 | |||
| 0835964a3d | |||
| 3b2cd941e3 | |||
| e8d7fa2d32 | |||
| a514240b72 | |||
| 5ae4249f37 | |||
| 6e2230b270 | |||
| 8eafde7353 | |||
| 582231fe18 | |||
| 4073e6b3f5 | |||
| 2ffc1945ad | |||
| d3566a9370 | |||
| f7fb50be8d | |||
| f0bc0d955d | |||
| 86623e1514 | |||
| e40795cbff | |||
| 2c6694dbd7 | |||
| 09f81372c0 | |||
| bc1328f7ae | |||
| 610b1bd561 | |||
| bfa2bedda0 | |||
| ee65b232d8 | |||
| b73b191e08 | |||
| 40207471d5 | |||
| 3e4167f06e | |||
| 0022c25ab6 | |||
| bd0e083ef2 | |||
| 5cea3ab1f3 | |||
| 674672dd66 | |||
| 7b9afbd5a0 | |||
| da9db83702 | |||
| 469dad556a | |||
| 5628a398ab | |||
| eaff88f0ec | |||
| 4e829c244e | |||
| 99310900bf | |||
| ec68c85c52 | |||
| c9e110870e | |||
| d2c8f0a84b | |||
| d6c1a6280d | |||
| f15f13a0fb | |||
| dc9d8e9202 | |||
| 350e76ae48 | |||
| d917bdc836 | |||
| 84f6eefec8 | |||
| d80ef2f827 | |||
| 234fec14f3 | |||
| c6c2408a8d | |||
| 67b2f0c9b4 | |||
| e8cccbb55c | |||
| 492b732872 | |||
| 392c9a46ad | |||
| 58a740b29a | |||
| a1a6ef613e | |||
| 123b424fb7 | |||
| d3c096e0cc | |||
| da55db257c | |||
| 27387a0944 | |||
| 274a8d3774 | |||
| ce1938651a | |||
| 063aa29f4b | |||
| c80892c3f2 | |||
| 2a0167f82c | |||
| 9d44ec92e5 | |||
| 1cb15abce9 | |||
| eb67f0208b | |||
| 45e65f2d49 | |||
| 605a8fc158 | |||
| c435ca8913 | |||
| 26a1a824eb | |||
| 7451b48708 | |||
| 5b651d0dae | |||
| 7ff1142ee9 | |||
| affd7c1d9d | |||
| 3a0b78fd98 | |||
| 5eb6f4d2ab | |||
| 35aec354d7 | |||
| 281ca4905a | |||
| e9ba546203 | |||
| 40926214c7 | |||
| 69b8aa8fcf | |||
| b99b0257c9 | |||
| ee9454ce55 | |||
| 539f18f998 | |||
| 01dac000a6 | |||
| c478e31448 | |||
| 313714c1e1 | |||
| 208b9f0bbe | |||
| fc34b4a2e3 | |||
| 3b0f7eb23e | |||
| 4ccc2494b3 | |||
| cb727c88dc | |||
| f9375b1f6f | |||
| a5ac6bb48a | |||
| fff108dd0a | |||
| 37799e1b97 | |||
| f8aab7f341 | |||
| 7a2f347678 | |||
| 8fc1a1e52a | |||
| 0263a9712a | |||
| 8da7f6861e | |||
| 391573ad2c | |||
| 6015befd96 | |||
| bf742b1e67 | |||
| 4823516339 | |||
| 03dd609544 | |||
| 074ce8958d | |||
| 0b911c3f41 | |||
| edcea7e60b | |||
| 0ffc8a1eec | |||
| 51aeb39bb0 | |||
| 750d7a2fe9 | |||
| 365819be8e | |||
| 7d2f3530e8 | |||
| 1f1cd64028 | |||
| e41999cf98 | |||
| 714c38c8b1 | |||
| 06010eead1 | |||
| 0ede4d53cf | |||
| 23dfc25583 | |||
| 651f1c566a | |||
| b7d55bfe14 | |||
| 85ba100f23 | |||
| 5f79ae53a2 | |||
| ae7b154cf7 | |||
| 2a26c39b29 | |||
| fee33b1a81 | |||
| 08e1c85add | |||
| 8c61e25e61 | |||
| 3540e6ca57 | |||
| fb9a6bb6d8 | |||
| 98ae6fd746 | |||
| f8b6bfe744 | |||
| 1bf2e0600f | |||
| 46802d33e1 | |||
| 78176cd311 | |||
| 17ee80aafe | |||
| bf79c8f0df | |||
| b29bbc6210 | |||
| e7962f5871 | |||
| b423b88580 | |||
| eee0d1f7a8 | |||
| 42f70716b6 | |||
| 3a806b97c9 | |||
| 0d53a581b4 | |||
| 4b80aa1c05 | |||
| 2ffd614ff4 | |||
| e229cff8de | |||
| c2b4891854 | |||
| d83b1275b4 | |||
| ec7179d01a | |||
| b678af07d7 | |||
| e0a80d165a | |||
| c58ed480e5 | |||
| 7d367a8952 | |||
| e8f09084bd | |||
| 2b36054a5d | |||
| ce9437daf5 | |||
| a0f2e6990f | |||
| 90b78f89d3 | |||
| 63b90bb5b8 | |||
| 7ac684e9e3 | |||
| bf8a169cb9 | |||
| 3d0b7314cd | |||
| 28377d4ffb | |||
| 45b982dc7f | |||
| 9e686d1fb5 | |||
| d6f9247f53 | |||
| 5c019bde15 | |||
| 75b0180829 | |||
| f71f7215ab | |||
| 454c485ebe | |||
| c85e8f276e | |||
| 26b17af77e | |||
| 37526b02ff | |||
| 59e1bc01cd | |||
| 88f1497c07 | |||
| a0b86e2e7d | |||
| 8a556a3a61 | |||
| 8ede929ef7 | |||
| 332688a075 | |||
| f881f985ab | |||
| 99dc47e7fd | |||
| 206d43dcb4 | |||
| 1685877635 | |||
| 5efea0825d | |||
| 46cfebfe97 | |||
| 9a05e55dfa | |||
| 6cc0130147 | |||
| baf4678087 | |||
| 21687bcedb | |||
| be7380a418 | |||
| 8374a58623 | |||
| fef14e0e87 | |||
| 02cd5737f6 | |||
| 7da97a3642 | |||
| 329263f091 | |||
| e3144b00ac | |||
| 5819ca7260 | |||
| c37ccdee76 | |||
| e8718c36c7 | |||
| bd44a4a6bd | |||
| e560a1f184 | |||
| 1561062b8f | |||
| 451692d432 | |||
| d669926130 | |||
| c99935a540 | |||
| 42b7122c87 | |||
| a8036a5143 | |||
| ad39298f6d | |||
| 6e4567e73b | |||
| 9ed2c8a719 | |||
| 9adfc8e2c4 | |||
| 0e7884f1a7 | |||
| 980c62a139 | |||
| 1eb2b92d9c | |||
| 084859d150 | |||
| 3472235232 | |||
| 385b55f203 | |||
| fbf99febf3 | |||
| b20d49fc04 | |||
| 6726f37309 | |||
| 6b4d79dd7a | |||
| 192766a541 | |||
| 67cc408905 | |||
| 6f36323ac6 | |||
| 4e3a2eea4d | |||
| 2144a810b5 | |||
| 38d1999f7b | |||
| d5792eb1fe | |||
| 5c10e8409f | |||
| f5dc69ab8e | |||
| 4ee775ebf9 | |||
| 1a2b7bbd0a | |||
| 703ae52214 | |||
| 70b4b622b4 | |||
| 36b3b9cbeb | |||
| 8a9dab8e29 | |||
| 16b5504eb9 | |||
| 4eb7dac75b | |||
| efdd68b3b0 | |||
| c663cabe7b | |||
| 0320c3be8e | |||
| 494e253e47 | |||
| 92833a0b82 | |||
| 35a1f49db5 | |||
| ac96c35230 | |||
| b95ce71b89 | |||
| 3693045566 | |||
| 41b73e409f | |||
| d1d4c602e0 | |||
| 20c764fc5e | |||
| 5b4a942260 | |||
| 6fddc0cf8a | |||
| 80ec521535 | |||
| 47c1a94424 | |||
| 08f8fd2f5c | |||
| 3504f49473 | |||
| 2f43800aa3 | |||
| c737045462 | |||
| 1779789f65 | |||
| 5b2236e3d7 | |||
| 40b6d907bf | |||
| 4ce5fcc5c8 | |||
| 827e5cb87b | |||
| 8d07911d73 | |||
| 63fe6de94d | |||
| c82f2169e5 | |||
| 66fae0330c | |||
| 1ff2161431 | |||
| de461f1424 | |||
| 6fbe287622 | |||
| 5b341e8e6e | |||
| ff0c470e34 | |||
| 3e9a9d8243 | |||
| 544963da24 | |||
| a86ca5c561 | |||
| 7b0a5674e2 | |||
| 130d8f100e | |||
| 60b0e89804 | |||
| 45d9076f49 | |||
| 89c4ef5873 | |||
| faa6db8485 | |||
| 31cd153050 | |||
| 168e4faf50 | |||
| d4d6968e1a | |||
| 9d54fee952 | |||
| fb51bbc565 | |||
| 05b8609f80 | |||
| c92a16fcf5 | |||
| f712cd8850 | |||
| 5aa00e4f66 | |||
| beaba95f39 | |||
| 0da3fc8b56 | |||
| 463714383a | |||
| 3bbbea5a08 | |||
| 9ce6f95b6e | |||
| 4768bf8a3b | |||
| 9239b8a8e3 | |||
| a624a62f8d | |||
| 59a928f7c8 | |||
| 99ac2f5c49 | |||
| 43b0eee81d | |||
| adf39dd291 | |||
| 8195244e3b | |||
| dc26dfd0c2 | |||
| efb4f2db50 | |||
| 15004e5930 | |||
| 43e8852829 | |||
| dcba77fcc4 | |||
| 08e9c93b17 | |||
| aa7e00fcb8 | |||
| 578d43c2ba | |||
| 836326bdc1 | |||
| a5d5106fcf | |||
| 158cb29e55 | |||
| 01fe1282fc | |||
| 25da672dbc | |||
| 32a420b7d6 | |||
| 936675aa01 | |||
| 96a69ce35e | |||
| 129dad6730 | |||
| b5f38a6726 | |||
| 5b1eeac96d | |||
| faba7df4fe | |||
| dab597d66e | |||
| 868974dbf6 |
@@ -33,11 +33,11 @@ MAINTAINERCLEANFILES = \
|
||||
|
||||
|
||||
## Copy .pc files to target-specific names
|
||||
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc: gtk+-3.0.pc
|
||||
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc gtk+-mir-3.0.pc: gtk+-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gtk+-3.0.pc $@
|
||||
|
||||
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc: gdk-3.0.pc
|
||||
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc gdk-mir-3.0.pc: gdk-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gdk-3.0.pc $@
|
||||
|
||||
@@ -59,12 +59,14 @@ DISTCLEANFILES = \
|
||||
gtk+-quartz-3.0.pc \
|
||||
gtk+-broadway-3.0.pc \
|
||||
gtk+-wayland-3.0.pc \
|
||||
gtk+-mir-3.0.pc \
|
||||
gdk-3.0.pc \
|
||||
gdk-x11-3.0.pc \
|
||||
gdk-win32-3.0.pc \
|
||||
gdk-quartz-3.0.pc \
|
||||
gdk-broadway-3.0.pc \
|
||||
gdk-wayland-3.0.pc \
|
||||
gdk-mir-3.0.pc \
|
||||
gail-3.0.pc \
|
||||
config.lt
|
||||
|
||||
|
||||
@@ -1,3 +1,162 @@
|
||||
Overview of Changes in GTK+ 3.12.1 to 3.12.2
|
||||
============================================
|
||||
|
||||
* Bug fixes:
|
||||
495105 Open recent file keyboard shortcuts do not work correctly
|
||||
686170 gdk/win32: VK_SNAPSHOT maps to GDK_Print
|
||||
726592 W32: problems with CSDed windows
|
||||
727487 Color picker check marks not cleared properly
|
||||
728093 Add missing transfer annotation to gtk_box_get_center_widget
|
||||
728140 Illegal parameter passed to g_variant_new in gtk_application...
|
||||
728183 Drag and drop (GdkFrameClock) does not work for hidden widgets
|
||||
728272 make broadway backend build on OpenBSD
|
||||
728284 Graphics artifact when scrolling with hover-selection
|
||||
728526 weird black border appear when dragging file
|
||||
728745 win32: add more clipboard data checks to avoid crash
|
||||
728806 W32: Check- and radio-buttons have a selection rectangle on ac...
|
||||
728807 W32: Checkbutton focus rectangle becomes almost white on prelight
|
||||
728808 W32: Checkboxes on modelbuttons are drawn like buttons themselves
|
||||
728810 W32: Modelbuttons look like buttons
|
||||
728992 GtkLockButton crash if clicked and permission is NULL
|
||||
729346 W32: App-notification has no theme, shows up transparent
|
||||
729451 Removing accels with application_set_accels_for_action
|
||||
729670 cairo surface leaked for each cursor created from pixmap
|
||||
|
||||
* Translation updates:
|
||||
Belarusian
|
||||
German
|
||||
Indonesian
|
||||
Japanese
|
||||
Russian
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.12.0 to 3.12.1
|
||||
============================================
|
||||
|
||||
* Bug fixes:
|
||||
712752 GtkClipboard: add _get_default and _get_primary
|
||||
722058 GtkTreeModelFilter bug
|
||||
722817 Add gobject-introspection for GdkWin32
|
||||
726298 gtk-font-name isn't correctly handled on Windows
|
||||
726475 After looking at Asielriot solitare, I get rendering glitches...
|
||||
726859 Assertion/crash if gtk_radio_menu_item_set_group() is called twice
|
||||
726870 all: Name more idles and timeouts
|
||||
726871 treeview: Lower the duration of validation iterations
|
||||
726996 Label-for/Labelled-by AtkRelations missing for containers in ...
|
||||
727009 redefinition of GtkPrinterCloudprint: cloudprint fails to build
|
||||
727022 W32: Both inc- and dec-buttons on GtkSpinbutton are "inc"
|
||||
727035 W32: Combobox button is drawn with two arrows
|
||||
727036 W32: Combobox dropdown color is button-gray instead of window-white
|
||||
727037 W32: Menu items look thin, while submenu arrows are huge
|
||||
727075 W32: Combobox (with an entry) is gigantic
|
||||
727078 W32: GtkPopover is transparent and non-interactable
|
||||
727080 W32: Window re-size grip looks UGLY.
|
||||
727210 W32: Prelight doesn't apply to check/radio marks
|
||||
727211 W32: Selection background color applies to check/radio marks
|
||||
727213 W32: Notebook widget is not styled correctly
|
||||
727244 W32: Items selected in listbox have correct background color,...
|
||||
727245 W32: No .dim-label style
|
||||
727313 a11y: do not use deprecated a11y functions.
|
||||
727322 docs: Remove '\' escape character from literals
|
||||
727391 W32: scrollbar sliders have no "active" and "insensitive" styles
|
||||
727410 W32: tooltips are not themed
|
||||
727414 Redundant text in titlebar
|
||||
727643 Segfault in gtk-3.12.0
|
||||
727662 [PATCH] GtkVolumeButton displays "missing image" icons
|
||||
727973 W32: focused button is visibly smaller
|
||||
728023 Warning when passing NULL window to inhibit
|
||||
727644 SEGV in gtk_window_propagate_key_event()
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Catalan
|
||||
Greek
|
||||
Russian
|
||||
|
||||
Overview of Changes in GTK+ 3.11.9 to 3.12.0
|
||||
============================================
|
||||
|
||||
* Wayland:
|
||||
- Add support for input regions
|
||||
- Correctly report display capabilities
|
||||
- Fix resizing from the north-east corner
|
||||
|
||||
* Bugs fixed:
|
||||
723045 Window re-size causes artifacts
|
||||
724728 GtkPrintOperation is below is parent in fullscreen mode
|
||||
726369 gnome-terminal crashes when closing a window
|
||||
726476 New fontchooser dialog doesn't update font list upon change
|
||||
726717 Nesting GtkExpander gives Gdk-CRITICAL error
|
||||
726749 Segmentation fault in libglib-2.0.so.0 with glib-2.39.92
|
||||
726825 possible invalid reads on delete event
|
||||
726838 crash when unsetting GtkTreeView model
|
||||
726855 When subdirectory selected, subdirectory name only briefly appears...
|
||||
726858 GTK_ENABLE_DEBUG should be G_ENABLE_DEBUG
|
||||
726900 gtk_recent_filter_filter() requirements aren't fully documented
|
||||
|
||||
* Translation updates:
|
||||
Czech
|
||||
Danish
|
||||
Germans
|
||||
Hungarian
|
||||
Indonesian
|
||||
Italian
|
||||
Scottish Gaelic
|
||||
Serbian
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.11.8 to 3.11.9
|
||||
============================================
|
||||
|
||||
* GtkPopover:
|
||||
- Improve focus and grab handling
|
||||
- Add accessibility support
|
||||
|
||||
* Client-side decorations:
|
||||
- Make F10 move focus to the header bar
|
||||
- Make header bars draggable on touch systems
|
||||
- Make shadows unclickable
|
||||
|
||||
* Bugs fixed:
|
||||
591258 Easy to accidentally select first option in popup menus
|
||||
693200 Printing via evince crashes badly when /tmp is not writable
|
||||
701884 lots of invalid reads in iconview a11y code
|
||||
709914 Cannot move windows on touchscreen (except from WM decorations)
|
||||
723668 Message Dialog Layout
|
||||
724785 Tooltips get shown even if the widget is hidden by a GtkPopover
|
||||
725141 Add shortcut to move focus to the GtkHeaderBar
|
||||
725727 Fix DnD on popovers
|
||||
725733 Crash when accessing freed AtkObject
|
||||
725754 Fix font size when gdk_x11_display_set_window_scale() is used
|
||||
725824 gtkentrycompletion: fix a critical warning
|
||||
725864 Add GtkPopover a11y
|
||||
725866 DnD fixes
|
||||
726125 Cannot click through CSD window shadows
|
||||
726135 documentation: clarify gtk_icon_theme_add_builtin_icon() usage
|
||||
726136 use && instead of 'and' in deprecation warnings
|
||||
726149 broadway: remove unused libcrypt
|
||||
726187 Use GDK's current window tracking when synthesizing events in GTK+
|
||||
726209 GtkTreeView: stop ignoring crossing events from grabs
|
||||
726492 Possible crash when setting titlebar
|
||||
|
||||
* Translation updates:
|
||||
Brazilian Portuguese
|
||||
Chinese
|
||||
Czech
|
||||
Finnish
|
||||
French
|
||||
Korean
|
||||
Latvian
|
||||
Norwegian bokmål
|
||||
Portuguese
|
||||
Punjabi
|
||||
Spanish
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.11.7 to 3.11.8
|
||||
============================================
|
||||
|
||||
|
||||
@@ -97,11 +97,6 @@ Release notes for 3.12
|
||||
and borders. This may require some adjustments in applications that
|
||||
were making assumptions about containers never rendering backgrounds.
|
||||
|
||||
* GTK+ is now choosing an RGBA visual for its windows by default if
|
||||
one is available. This can cause problems for applications which make
|
||||
assumptions about the default visual. You can set GDK_RGBA=0 in the
|
||||
environment to force GTK+ to use the default X11 visual, as before.
|
||||
|
||||
Release notes for 3.10
|
||||
======================
|
||||
|
||||
|
||||
@@ -28,10 +28,23 @@ def gen_gdk_filelist(srcroot, subdir, dest):
|
||||
for i in sources:
|
||||
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
||||
|
||||
def gen_filelist_gtk(srcroot, subdir, dest):
|
||||
def gen_gdkwin32_filelist(srcroot, subdir, dest):
|
||||
vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
|
||||
vars = {},
|
||||
conds = {'HAVE_INTROSPECTION': True,
|
||||
'OS_WIN32': True},
|
||||
filters = ['w32_introspection_files'])
|
||||
|
||||
files = vars['w32_introspection_files'].split()
|
||||
|
||||
with open(dest, 'w') as d:
|
||||
for i in files:
|
||||
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
||||
|
||||
def gen_gtk_filelist(srcroot, subdir, dest):
|
||||
vars = read_vars_from_AM(os.path.join(srcroot, 'gtk', 'Makefile.am'),
|
||||
vars = {},
|
||||
conds = {'USE_WIN32':True,
|
||||
conds = {'USE_WIN32': True,
|
||||
'USE_QUARTZ': False,
|
||||
'USE_X11': False,
|
||||
'USE_EXTERNAL_ICON_CACHE': False},
|
||||
@@ -60,7 +73,8 @@ def main(argv):
|
||||
subdir_gtk = 'gtk'
|
||||
|
||||
gen_gdk_filelist(srcroot, subdir_gdk, 'gdk_list')
|
||||
gen_filelist_gtk(srcroot, subdir_gtk, 'gtk_list')
|
||||
gen_gdkwin32_filelist(srcroot, subdir_gdk, 'gdkwin32_list')
|
||||
gen_gtk_filelist(srcroot, subdir_gtk, 'gtk_list')
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -6,6 +6,9 @@ APIVERSION = 3.0
|
||||
|
||||
CHECK_PACKAGE = gdk-pixbuf-2.0 atk pangocairo gio-2.0
|
||||
|
||||
built_install_girs = Gdk-$(APIVERSION).gir GdkWin32-$(APIVERSION).gir Gtk-$(APIVERSION).gir
|
||||
built_install_typelibs = Gdk-$(APIVERSION).typelib GdkWin32-$(APIVERSION).typelib Gtk-$(APIVERSION).typelib
|
||||
|
||||
!if "$(PLAT)" == "x64"
|
||||
TIME_T_DEFINE = -Dtime_t=long long
|
||||
!else
|
||||
@@ -15,9 +18,9 @@ TIME_T_DEFINE = -Dtime_t=long
|
||||
!include introspection-msvc.mak
|
||||
|
||||
!if "$(BUILD_INTROSPECTION)" == "TRUE"
|
||||
all: setgirbuildnev Gdk-$(APIVERSION).gir Gdk-$(APIVERSION).typelib Gtk-$(APIVERSION).gir Gtk-$(APIVERSION).typelib
|
||||
all: setgirbuildnev $(built_install_girs) $(built_install_typelibs)
|
||||
|
||||
gdk_list gtk_list:
|
||||
gdk_list gdkwin32_list gtk_list:
|
||||
@-echo Generating Filelist to Introspect for GDK/GTK...
|
||||
$(PYTHON2) gen-file-list-gtk.py
|
||||
|
||||
@@ -28,6 +31,10 @@ setgirbuildnev:
|
||||
@set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
|
||||
@set LIB=win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(LIB)
|
||||
|
||||
win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).lib: win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\gdk-$(APIVERSION).lib
|
||||
@-echo Copying win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).lib from win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\gdk-$(APIVERSION).lib...
|
||||
@-copy /b win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\gdk-$(APIVERSION).lib win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).lib
|
||||
|
||||
Gdk-$(APIVERSION).gir: gdk_list
|
||||
@-echo Generating Gdk-$(APIVERSION).gir...
|
||||
$(PYTHON2) $(G_IR_SCANNER) --verbose -I.. -I..\gdk \
|
||||
@@ -41,7 +48,22 @@ Gdk-$(APIVERSION).gir: gdk_list
|
||||
--reparse-validate --add-include-path=$(G_IR_INCLUDEDIR) --add-include-path=. \
|
||||
--pkg-export gdk-3.0 --warn-all --c-include="gdk/gdk.h" \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION \
|
||||
--filelist=gdk_list -o Gdk-3.0.gir
|
||||
--filelist=gdk_list -o $@
|
||||
|
||||
GdkWin32-$(APIVERSION).gir: gdkwin32_list win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).lib
|
||||
@-echo Generating GdkWin32-$(APIVERSION).gir...
|
||||
$(PYTHON2) $(G_IR_SCANNER) --verbose -I.. -I..\gdk \
|
||||
-I$(BASEDIR)\include\glib-2.0 -I$(BASEDIR)\lib\glib-2.0\include \
|
||||
-I$(BASEDIR)\include\pango-1.0 -I$(BASEDIR)\include\atk-1.0 \
|
||||
-I$(BASEDIR)\include\gdk-pixbuf-2.0 -I$(BASEDIR)\include \
|
||||
$(TIME_T_DEFINE) --namespace=GdkWin32 --nsversion=3.0 \
|
||||
--include=Gio-2.0 --include=GdkPixbuf-2.0 \
|
||||
--include=Pango-1.0 --include-uninstalled=./Gdk-$(APIVERSION).gir \
|
||||
--no-libtool --library=gdk-3.0 \
|
||||
--reparse-validate --add-include-path=$(G_IR_INCLUDEDIR) --add-include-path=. \
|
||||
--pkg-export gdk-win32-3.0 --warn-all --c-include="gdk/gdkwin32.h" \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION \
|
||||
--filelist=gdkwin32_list -o $@
|
||||
|
||||
Gtk-$(APIVERSION).gir: gtk_list
|
||||
$(PYTHON2) $(G_IR_SCANNER) --verbose -I.. -I..\gtk -I..\gdk \
|
||||
@@ -56,7 +78,7 @@ Gtk-$(APIVERSION).gir: gtk_list
|
||||
--pkg-export gtk+-3.0 --warn-all --c-include="gtk/gtkx.h" \
|
||||
-DG_LOG_DOMAIN=\"Gtk\" -DGTK_LIBDIR=\"/dummy/lib\" \
|
||||
$(TIME_T_DEFINE) -DGTK_DATADIR=\"/dummy/share\" -DGTK_DATA_PREFIX=\"/dummy\" \
|
||||
-DGTK_SYSCONFDIR=\"/dummy/etc\" -DGTK_VERSION=\"3.11.8\" \
|
||||
-DGTK_SYSCONFDIR=\"/dummy/etc\" -DGTK_VERSION=\"3.12.0\" \
|
||||
-DGTK_BINARY_VERSION=\"3.0.0\" -DGTK_HOST=\"i686-pc-vs$(VSVER)\" \
|
||||
-DGTK_COMPILATION -DGTK_PRINT_BACKENDS=\"file\" \
|
||||
-DGTK_PRINT_PREVIEW_COMMAND=\"undefined-gtk-print-preview-command\" \
|
||||
@@ -65,21 +87,15 @@ Gtk-$(APIVERSION).gir: gtk_list
|
||||
-DINCLUDE_IM_ime -DINCLUDE_IM_inuktitut -DINCLUDE_IM_ipa \
|
||||
-DINCLUDE_IM_multipress -DINCLUDE_IM_thai -DINCLUDE_IM_ti_er \
|
||||
-DINCLUDE_IM_ti_et -DINCLUDE_IM_viqr --filelist=gtk_list \
|
||||
-o Gtk-3.0.gir
|
||||
-o $@
|
||||
|
||||
Gdk-$(APIVERSION).typelib: Gdk-$(APIVERSION).gir
|
||||
@-echo Compiling Gdk-$(APIVERSION).typelib...
|
||||
$(G_IR_COMPILER) --includedir=. --debug --verbose Gdk-$(APIVERSION).gir -o Gdk-$(APIVERSION).typelib
|
||||
$(built_install_typelibs): $(built_install_girs)
|
||||
@-echo Compiling $*.typelib...
|
||||
@-$(G_IR_COMPILER) --includedir=. --debug --verbose $*.gir -o $@
|
||||
|
||||
Gtk-$(APIVERSION).typelib: Gtk-$(APIVERSION).gir Gdk-$(APIVERSION).typelib
|
||||
@-echo Compiling Gtk-$(APIVERSION).typelib...
|
||||
$(G_IR_COMPILER) --includedir=. --debug --verbose Gtk-$(APIVERSION).gir -o Gtk-$(APIVERSION).typelib
|
||||
|
||||
install-introspection: setgirbuildnev Gdk-$(APIVERSION).gir Gdk-$(APIVERSION).typelib Gtk-$(APIVERSION).gir Gtk-$(APIVERSION).typelib
|
||||
@-copy Gdk-$(APIVERSION).gir $(G_IR_INCLUDEDIR)
|
||||
@-copy /b Gdk-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
|
||||
@-copy Gtk-$(APIVERSION).gir $(G_IR_INCLUDEDIR)
|
||||
@-copy /b Gtk-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
|
||||
install-introspection: setgirbuildnev $(built_install_girs) $(built_install_typelibs)
|
||||
@-copy *.gir $(G_IR_INCLUDEDIR)
|
||||
@-copy /b *.typelib $(G_IR_TYPELIBDIR)
|
||||
|
||||
!else
|
||||
all:
|
||||
@@ -87,10 +103,10 @@ all:
|
||||
!endif
|
||||
|
||||
clean:
|
||||
@-del /f/q Gtk-$(APIVERSION).typelib
|
||||
@-del /f/q Gtk-$(APIVERSION).gir
|
||||
@-del /f/q Gdk-$(APIVERSION).typelib
|
||||
@-del /f/q Gdk-$(APIVERSION).gir
|
||||
@-del /f/q *.typelib
|
||||
@-del /f/q *.gir
|
||||
@-del /f/q win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).lib
|
||||
@-del /f/q gtk_list
|
||||
@-del /f/q gdkwin32_list
|
||||
@-del /f/q gdk_list
|
||||
@-del /f/q *.pyc
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<_PropertySheetDisplayName>gtkcopygdkbroadwayprops</_PropertySheetDisplayName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<AdditionalOptions>/EXPORT:gdk_win32_display_manager_get_type</AdditionalOptions>
|
||||
</Link
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
if "$(Configuration)" == "Release" goto END
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</ProjectReference>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(OutDir)\gdk-win32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/EXPORT:gdk_win32_display_manager_get_type</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
@@ -4,6 +4,10 @@
|
||||
<Import Project="gtk-build-defines.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<BinDir>$(SolutionDir)$(Configuration)\$(Platform)\bin</BinDir>
|
||||
<InstalledDlls>$(BinDir)\$(GtkDllPrefix)gdk(GtkDllSuffix).dll;$(BinDir)\$(GtkDllPrefix)gtk(GtkDllSuffix).dll;$(BinDir)\$(GtkDllPrefix)gailutil(GtkDllSuffix).dll</InstalledDlls>
|
||||
<InstalledBins>$(BinDir)\gtk3-demo.exe;$(BinDir)\gtk3-demo-application.exe</InstalledBins>
|
||||
<InstalledBroadwayBins>$(BinDir)\broadwayd.exe</InstalledBroadwayBins>
|
||||
<GtkDoInstallBin>
|
||||
mkdir $(CopyDir)\bin
|
||||
|
||||
@@ -15,22 +19,22 @@ if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
|
||||
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.dll $(CopyDir)\bin
|
||||
copy $(BinDir)\*.dll $(CopyDir)\bin
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy $(BinDir)\*-$(ApiVersion).lib $(CopyDir)\lib
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
copy $(BinDir)\*.exe $(CopyDir)\bin
|
||||
|
||||
goto DONE_BIN
|
||||
|
||||
|
||||
:DO_BROADWAY_BIN
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy $(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy $(BinDir)\gdk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
|
||||
copy $(Configuration)\$(Platform)\bin\broadwayd.exe $(CopyDir)\bin
|
||||
copy $(BinDir)\broadwayd.exe $(CopyDir)\bin
|
||||
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
@@ -214,6 +218,8 @@ copy ..\..\..\gtk\a11y\gtknotebookpageaccessible.h $(CopyDir)\include\gtk-$(ApiV
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkpanedaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkpopoveraccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkprogressbaraccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkradiobuttonaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
@@ -796,6 +802,18 @@ copy ..\..\..\gdk\broadway\gdkbroadwayvisual.h $(CopyDir)\include\gtk-$(ApiVersi
|
||||
<_PropertySheetDisplayName>gtkinstallsprops</_PropertySheetDisplayName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<BuildMacro Include="BinDir">
|
||||
<Value>$(BinDir)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="InstalledDlls">
|
||||
<Value>$(InstalledDlls)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="InstalledBins">
|
||||
<Value>$(InstalledBins)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="InstalledBroadwayBins">
|
||||
<Value>$(InstalledBroadwayBins)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="GtkDoInstallBin">
|
||||
<Value>$(GtkDoInstallBin)</Value>
|
||||
</BuildMacro>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<VSVer>10</VSVer>
|
||||
<GlibEtcInstallRoot>$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot>
|
||||
<GlibEtcInstallRootFromBuildWin32>..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRootFromBuildWin32>
|
||||
<CopyDir>..\..\..\..\vs$(VSVer)\$(Platform)</CopyDir>
|
||||
<ApiVersion>3.0</ApiVersion>
|
||||
<GtkLibtoolCompatibleDllPrefix>lib</GtkLibtoolCompatibleDllPrefix>
|
||||
@@ -24,9 +23,6 @@
|
||||
<BuildMacro Include="GlibEtcInstallRoot">
|
||||
<Value>$(GlibEtcInstallRoot)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="GlibEtcInstallRootFromBuildWin32">
|
||||
<Value>$(GlibEtcInstallRootFromBuildWin32)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="CopyDir">
|
||||
<Value>$(CopyDir)</Value>
|
||||
</BuildMacro>
|
||||
@@ -55,4 +51,4 @@
|
||||
<Value>$(PythonPath)</Value>
|
||||
</BuildMacro>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -139,45 +139,49 @@
|
||||
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\..\..\config.h.win32">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="gdk.vcxproj">
|
||||
<Project>{fc5aadb5-95cd-4bf0-ba8b-0c16fe7073f7}</Project>
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
Name="gtkcopygdkbroadwayprops"
|
||||
InheritedPropertySheets=".\gtk-build-defines.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/EXPORT:gdk_win32_display_manager_get_type"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="
|
||||
|
||||
@@ -9,5 +9,6 @@
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="false"
|
||||
AdditionalDependencies="$(OutDir)\gdk-win32.lib"
|
||||
AdditionalOptions="/EXPORT:gdk_win32_display_manager_get_type"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
@@ -121,6 +121,7 @@ copy ..\..\..\gtk\a11y\gtkmenushellaccessible.h $(CopyDir)\include\gtk-$(ApiVers
|
||||
copy ..\..\..\gtk\a11y\gtknotebookaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtknotebookpageaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkpanedaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkpopoveraccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkprogressbaraccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkradiobuttonaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkradiomenuitemaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
Name="GlibEtcInstallRoot"
|
||||
Value="$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(PlatformName)"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GlibEtcInstallRootFromBuildWin32"
|
||||
Value="..\..\..\vs$(VSVer)\$(PlatformName)"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="CopyDir"
|
||||
Value="..\..\..\..\vs$(VSVer)\$(PlatformName)"
|
||||
@@ -54,4 +50,4 @@
|
||||
Name="PythonPath"
|
||||
Value="c:\python27"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
</VisualStudioPropertySheet>
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [11])
|
||||
m4_define([gtk_micro_version], [8])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_minor_version], [12])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [3])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -322,6 +322,10 @@ AC_ARG_ENABLE(wayland-backend,
|
||||
[AS_HELP_STRING([--enable-wayland-backend],
|
||||
[enable the wayland gdk backend])],
|
||||
[backend_set=yes])
|
||||
AC_ARG_ENABLE(mir-backend,
|
||||
[AS_HELP_STRING([--enable-mir-backend],
|
||||
[enable the Mir gdk backend])],
|
||||
[backend_set=yes])
|
||||
|
||||
if test -z "$backend_set"; then
|
||||
if test "$platform_win32" = yes; then
|
||||
@@ -329,6 +333,7 @@ if test -z "$backend_set"; then
|
||||
else
|
||||
enable_x11_backend=yes
|
||||
enable_wayland_backend=maybe
|
||||
enable_mir_backend=maybe
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -397,6 +402,11 @@ else
|
||||
fi
|
||||
AC_SUBST(DISABLE_ON_QUARTZ)
|
||||
|
||||
AC_CHECK_LIB([rt], [shm_open], [SHM_LIBS="-lrt"], [SHM_LIBS=""])
|
||||
AC_SUBST(SHM_LIBS)
|
||||
|
||||
AC_CHECK_FUNCS(posix_fallocate)
|
||||
|
||||
if test "x$enable_broadway_backend" = xyes; then
|
||||
GDK_BACKENDS="$GDK_BACKENDS broadway"
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
@@ -445,6 +455,30 @@ else
|
||||
AM_CONDITIONAL(USE_WAYLAND, false)
|
||||
fi
|
||||
|
||||
MIR_DEPENDENCIES="mirclient"
|
||||
if test "$enable_mir_backend" = "maybe" ; then
|
||||
PKG_CHECK_EXISTS($MIR_DEPENDENCIES, [have_mir_deps=yes], [have_mir_deps=no])
|
||||
AC_MSG_CHECKING([for MIR_DEPENDENCIES])
|
||||
if test "$have_mir_deps" = "no" ; then
|
||||
enable_mir_backend=no
|
||||
else
|
||||
enable_mir_backend=yes
|
||||
fi
|
||||
AC_MSG_RESULT($enable_mir_backend)
|
||||
fi
|
||||
|
||||
if test "$enable_mir_backend" = "yes"; then
|
||||
cairo_backends="$cairo_backends cairo"
|
||||
GDK_BACKENDS="$GDK_BACKENDS mir"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_MIR"
|
||||
MIR_PACKAGES="$MIR_DEPENDENCIES"
|
||||
|
||||
AM_CONDITIONAL(USE_MIR, true)
|
||||
else
|
||||
AM_CONDITIONAL(USE_MIR, false)
|
||||
fi
|
||||
|
||||
# strip leading space
|
||||
GDK_BACKENDS=${GDK_BACKENDS#* }
|
||||
|
||||
@@ -1316,7 +1350,7 @@ CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1353,7 +1387,7 @@ fi
|
||||
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
|
||||
|
||||
GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1876,6 +1910,7 @@ gdk/win32/rc/Makefile
|
||||
gdk/win32/rc/gdk.rc
|
||||
gdk/quartz/Makefile
|
||||
gdk/wayland/Makefile
|
||||
gdk/mir/Makefile
|
||||
gdk/gdkversionmacros.h
|
||||
gtk/Makefile
|
||||
gtk/makefile.msc
|
||||
|
||||
@@ -270,6 +270,7 @@ do_iconview (GtkWidget *do_widget)
|
||||
|
||||
up_button = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (up_button), TRUE);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (up_button), "go-up");
|
||||
gtk_tool_item_set_is_important (up_button, TRUE);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE);
|
||||
@@ -277,6 +278,7 @@ do_iconview (GtkWidget *do_widget)
|
||||
|
||||
home_button = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (home_button), _("_Home"));
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (home_button), TRUE);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (home_button), "go-home");
|
||||
gtk_tool_item_set_is_important (home_button, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), home_button, -1);
|
||||
|
||||
@@ -50,18 +50,21 @@ progressive_updated_callback (GdkPixbufLoader *loader,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
image = GTK_WIDGET (data);
|
||||
|
||||
/* We know the pixbuf inside the GtkImage has changed, but the image
|
||||
* itself doesn't know this; so queue a redraw. If we wanted to be
|
||||
* really efficient, we could use a drawing area or something
|
||||
* instead of a GtkImage, so we could control the exact position of
|
||||
* the pixbuf on the display, then we could queue a draw for only
|
||||
* the updated area of the image.
|
||||
* itself doesn't know this; so give it a hint by setting the pixbuf
|
||||
* again. Queuing a redraw used to be sufficient, but nowadays GtkImage
|
||||
* uses GtkIconHelper which caches the pixbuf state and will just redraw
|
||||
* from the cache.
|
||||
*/
|
||||
|
||||
gtk_widget_queue_draw (image);
|
||||
pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (image));
|
||||
g_object_ref (pixbuf);
|
||||
gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -270,6 +273,7 @@ start_progressive_loading (GtkWidget *image)
|
||||
load_timeout = gdk_threads_add_timeout (150,
|
||||
progressive_timeout,
|
||||
image);
|
||||
g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -33,6 +33,7 @@ activate_link (GtkWidget *label,
|
||||
"The term <i>keynav</i> is a shorthand for "
|
||||
"keyboard navigation and refers to the process of using "
|
||||
"a program (exclusively) via keyboard input.");
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<object class="GtkButton" id="run_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="action_name">win.run</property>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
|
||||
@@ -18,6 +18,8 @@ change_direction (GtkRevealer *revealer)
|
||||
gtk_revealer_set_reveal_child (revealer, !revealed);
|
||||
}
|
||||
|
||||
static guint timeout = 0;
|
||||
|
||||
static gboolean
|
||||
reveal_one (gpointer data)
|
||||
{
|
||||
@@ -33,11 +35,15 @@ reveal_one (gpointer data)
|
||||
G_CALLBACK (change_direction), NULL);
|
||||
count++;
|
||||
|
||||
return count < 9;
|
||||
if (count >= 9)
|
||||
{
|
||||
timeout = 0;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static guint timeout = 0;
|
||||
|
||||
static void
|
||||
response_cb (GtkWidget *dialog,
|
||||
gint response_id,
|
||||
|
||||
@@ -117,6 +117,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
<property name="valign">center</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="menu_model">gear_menu</property>
|
||||
<property name="use_popover">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
|
||||
@@ -736,6 +736,7 @@ GdkTimeCoord
|
||||
gdk_device_get_axis
|
||||
gdk_device_list_axes
|
||||
gdk_device_get_axis_value
|
||||
gdk_device_get_last_event_window
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_TYPE_AXIS_USE
|
||||
|
||||
@@ -145,6 +145,7 @@ content_files = \
|
||||
osx.sgml \
|
||||
broadway.xml \
|
||||
wayland.xml \
|
||||
mir.xml \
|
||||
question_index.sgml \
|
||||
resources.sgml \
|
||||
text_widget.sgml \
|
||||
|
||||
@@ -394,6 +394,11 @@ How to compile GTK+ itself
|
||||
<arg choice="plain">--disable-wayland-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-mir-backend</arg>
|
||||
<arg choice="plain">--disable-mir-backend</arg>
|
||||
</group>
|
||||
<sbr/>
|
||||
<group>
|
||||
<arg choice="plain">--enable-introspection=[no/auto/yes]</arg>
|
||||
</group>
|
||||
@@ -595,8 +600,10 @@ How to compile GTK+ itself
|
||||
<systemitem>--disable-quartz-backend</systemitem>,
|
||||
<systemitem>--enable-broadway-backend</systemitem>,
|
||||
<systemitem>--disable-broadway-backend</systemitem>,
|
||||
<systemitem>--enable-wayland-backend</systemitem>, and
|
||||
<systemitem>--disable-wayland-backend</systemitem></title>
|
||||
<systemitem>--enable-wayland-backend</systemitem>,
|
||||
<systemitem>--disable-wayland-backend</systemitem>
|
||||
<systemitem>--enable-mir-backend</systemitem>, and
|
||||
<systemitem>--disable-mir-backend</systemitem></title>
|
||||
|
||||
<para>
|
||||
Enables specific backends for GDK. If none of these options
|
||||
|
||||
@@ -605,12 +605,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
@@ -633,7 +637,7 @@ example_app_class_init (ExampleAppClass *class)
|
||||
<para>Our preferences menu item does not do anything yet,
|
||||
but the Quit menu item is fully functional. Note that it
|
||||
can also be activated by the usual Ctrl-Q shortcut. The
|
||||
shortcut was specified in the ui file.
|
||||
shortcut was added with gtk_application_set_accels_for_action().
|
||||
</para>
|
||||
|
||||
<para>The application menu looks like this:</para>
|
||||
@@ -982,9 +986,8 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
<programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||
</informalexample>
|
||||
|
||||
<para>A small extra refinement that we have added here is to allow
|
||||
the header bar to provide a fallback application menu, by setting
|
||||
the show-fallback-app-menu property to TRUE. Here is how the
|
||||
<para>A small extra bonus of using a header bar is that we get
|
||||
a fallback application menu for free. Here is how the
|
||||
application now looks, if this fallback is used.</para>
|
||||
|
||||
<informalfigure>
|
||||
|
||||
@@ -394,6 +394,7 @@
|
||||
<xi:include href="osx.sgml" />
|
||||
<xi:include href="broadway.xml" />
|
||||
<xi:include href="wayland.xml" />
|
||||
<xi:include href="mir.xml" />
|
||||
</part>
|
||||
|
||||
<xi:include href="glossary.xml" />
|
||||
|
||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 46 KiB |
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-mir">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ with Mir</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>GTK Library</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Using GTK+ with Mir</refname>
|
||||
<refpurpose>
|
||||
Mir-specific aspects of using GTK+
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Using GTK+ with Mir</title>
|
||||
|
||||
<para>
|
||||
The GDK Mir backend provides support for running GTK+ applications
|
||||
under Mir based display servers. To run your application in this way,
|
||||
select the Mir backend by setting <literal>GDK_BACKEND=mir</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, the Mir backend does not use any additional commandline
|
||||
options or environment variables.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
@@ -322,6 +322,10 @@ additional environment variables.
|
||||
that is specified by the gtk-theme-name setting. This is intended
|
||||
mainly for easy debugging of theme issues.
|
||||
</para>
|
||||
<para>
|
||||
It is also possible to specify a theme variant to load, by appending
|
||||
the variant name with a colon, like this: `GTK_THEME=Adwaita:dark`.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<para>
|
||||
@@ -470,6 +474,11 @@ nevertheless.
|
||||
<listitem><para>Selects the Wayland backend for connecting to Wayland display servers</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>mir</term>
|
||||
<listitem><para>Selects the Mir backend for connecting to Mir display servers</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
Since 3.10, this environment variable can contain a comma-separated list
|
||||
of backend names, which are tried in order. The list may also contain
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -53,12 +53,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
|
||||
@@ -25,12 +25,6 @@ struct _ExampleAppPrefsPrivate
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppPrefs, example_app_prefs, GTK_TYPE_DIALOG)
|
||||
|
||||
static void
|
||||
preferences_closed (GtkWidget *button)
|
||||
{
|
||||
gtk_widget_destroy (gtk_widget_get_toplevel (button));
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_prefs_init (ExampleAppPrefs *prefs)
|
||||
{
|
||||
@@ -68,12 +62,10 @@ example_app_prefs_class_init (ExampleAppPrefsClass *class)
|
||||
"/org/gtk/exampleapp/prefs.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, font);
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, transition);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), preferences_closed);
|
||||
}
|
||||
|
||||
ExampleAppPrefs *
|
||||
example_app_prefs_new (ExampleAppWindow *win)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, NULL);
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, "use-header-bar", TRUE, NULL);
|
||||
}
|
||||
|
||||
@@ -64,19 +64,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="action_area">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="close">
|
||||
<signal name="clicked" handler="preferences_closed"/>
|
||||
<property name="visible">True</property>
|
||||
<property name="label">_Close</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-close-button">True</property>
|
||||
<property name="show-fallback-app-menu">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="lines_label">
|
||||
<property name="visible">False</property>
|
||||
@@ -30,6 +29,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -37,6 +37,9 @@
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="search-icon">
|
||||
<property name="visible">True</property>
|
||||
@@ -52,6 +55,10 @@
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="gears">
|
||||
<property name="visible">True</property>
|
||||
<property name="use-popover">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="gears-icon">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -46,12 +46,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -46,12 +46,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
#include "exampleappwin.h"
|
||||
#include "exampleappprefs.h"
|
||||
|
||||
struct ExampleApp {
|
||||
GtkApplication parent;
|
||||
struct ExampleApp
|
||||
{
|
||||
GtkApplication parent;
|
||||
};
|
||||
|
||||
struct ExampleAppClass {
|
||||
GtkApplicationClass parent_class;
|
||||
struct ExampleAppClass
|
||||
{
|
||||
GtkApplicationClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
|
||||
@@ -24,12 +26,12 @@ preferences_activated (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer app)
|
||||
{
|
||||
ExampleAppPrefs *prefs;
|
||||
GtkWindow *win;
|
||||
ExampleAppPrefs *prefs;
|
||||
GtkWindow *win;
|
||||
|
||||
win = gtk_application_get_active_window (GTK_APPLICATION (app));
|
||||
prefs = example_app_prefs_new (EXAMPLE_APP_WINDOW (win));
|
||||
gtk_window_present (GTK_WINDOW (prefs));
|
||||
win = gtk_application_get_active_window (GTK_APPLICATION (app));
|
||||
prefs = example_app_prefs_new (EXAMPLE_APP_WINDOW (win));
|
||||
gtk_window_present (GTK_WINDOW (prefs));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -40,36 +42,41 @@ quit_activated (GSimpleAction *action,
|
||||
g_application_quit (G_APPLICATION (app));
|
||||
}
|
||||
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "preferences", preferences_activated, NULL, NULL, NULL },
|
||||
{ "quit", quit_activated, NULL, NULL, NULL }
|
||||
static GActionEntry app_entries[] =
|
||||
{
|
||||
{ "preferences", preferences_activated, NULL, NULL, NULL },
|
||||
{ "quit", quit_activated, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
gtk_application_set_app_menu (GTK_APPLICATION (app), app_menu);
|
||||
g_object_unref (builder);
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
gtk_application_set_app_menu (GTK_APPLICATION (app), app_menu);
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_activate (GApplication *app)
|
||||
{
|
||||
ExampleAppWindow *win;
|
||||
ExampleAppWindow *win;
|
||||
|
||||
win = example_app_window_new (EXAMPLE_APP (app));
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
win = example_app_window_new (EXAMPLE_APP (app));
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -78,35 +85,35 @@ example_app_open (GApplication *app,
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
int i;
|
||||
GList *windows;
|
||||
ExampleAppWindow *win;
|
||||
int i;
|
||||
|
||||
windows = gtk_application_get_windows (GTK_APPLICATION (app));
|
||||
if (windows)
|
||||
win = EXAMPLE_APP_WINDOW (windows->data);
|
||||
else
|
||||
win = example_app_window_new (EXAMPLE_APP (app));
|
||||
windows = gtk_application_get_windows (GTK_APPLICATION (app));
|
||||
if (windows)
|
||||
win = EXAMPLE_APP_WINDOW (windows->data);
|
||||
else
|
||||
win = example_app_window_new (EXAMPLE_APP (app));
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
example_app_window_open (win, files[i]);
|
||||
for (i = 0; i < n_files; i++)
|
||||
example_app_window_open (win, files[i]);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
gtk_window_present (GTK_WINDOW (win));
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_class_init (ExampleAppClass *class)
|
||||
{
|
||||
G_APPLICATION_CLASS (class)->startup = example_app_startup;
|
||||
G_APPLICATION_CLASS (class)->activate = example_app_activate;
|
||||
G_APPLICATION_CLASS (class)->open = example_app_open;
|
||||
G_APPLICATION_CLASS (class)->startup = example_app_startup;
|
||||
G_APPLICATION_CLASS (class)->activate = example_app_activate;
|
||||
G_APPLICATION_CLASS (class)->open = example_app_open;
|
||||
}
|
||||
|
||||
ExampleApp *
|
||||
example_app_new (void)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_TYPE,
|
||||
"application-id", "org.gtk.exampleapp",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
NULL);
|
||||
return g_object_new (EXAMPLE_APP_TYPE,
|
||||
"application-id", "org.gtk.exampleapp",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -25,12 +25,6 @@ struct _ExampleAppPrefsPrivate
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppPrefs, example_app_prefs, GTK_TYPE_DIALOG)
|
||||
|
||||
static void
|
||||
preferences_closed (GtkWidget *button)
|
||||
{
|
||||
gtk_widget_destroy (gtk_widget_get_toplevel (button));
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_prefs_init (ExampleAppPrefs *prefs)
|
||||
{
|
||||
@@ -68,12 +62,10 @@ example_app_prefs_class_init (ExampleAppPrefsClass *class)
|
||||
"/org/gtk/exampleapp/prefs.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, font);
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, transition);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), preferences_closed);
|
||||
}
|
||||
|
||||
ExampleAppPrefs *
|
||||
example_app_prefs_new (ExampleAppWindow *win)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, NULL);
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, "use-header-bar", TRUE, NULL);
|
||||
}
|
||||
|
||||
@@ -2,19 +2,22 @@
|
||||
#include "exampleappwin.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
struct ExampleAppWindow {
|
||||
GtkApplicationWindow parent;
|
||||
struct ExampleAppWindow
|
||||
{
|
||||
GtkApplicationWindow parent;
|
||||
};
|
||||
|
||||
struct ExampleAppWindowClass {
|
||||
GtkApplicationWindowClass parent_class;
|
||||
struct ExampleAppWindowClass
|
||||
{
|
||||
GtkApplicationWindowClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct ExampleAppWindowPrivate ExampleAppWindowPrivate;
|
||||
|
||||
struct ExampleAppWindowPrivate {
|
||||
GSettings *settings;
|
||||
GtkWidget *stack;
|
||||
struct ExampleAppWindowPrivate
|
||||
{
|
||||
GSettings *settings;
|
||||
GtkWidget *stack;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
@@ -22,87 +25,88 @@ G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLIC
|
||||
static void
|
||||
example_app_window_init (ExampleAppWindow *win)
|
||||
{
|
||||
ExampleAppWindowPrivate *priv;
|
||||
ExampleAppWindowPrivate *priv;
|
||||
|
||||
priv = example_app_window_get_instance_private (win);
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
priv->settings = g_settings_new ("org.gtk.exampleapp");
|
||||
priv = example_app_window_get_instance_private (win);
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
priv->settings = g_settings_new ("org.gtk.exampleapp");
|
||||
|
||||
g_settings_bind (priv->settings, "transition",
|
||||
priv->stack, "transition-type",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
g_settings_bind (priv->settings, "transition",
|
||||
priv->stack, "transition-type",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_window_dispose (GObject *object)
|
||||
{
|
||||
ExampleAppWindow *win;
|
||||
ExampleAppWindowPrivate *priv;
|
||||
ExampleAppWindow *win;
|
||||
ExampleAppWindowPrivate *priv;
|
||||
|
||||
win = EXAMPLE_APP_WINDOW (object);
|
||||
priv = example_app_window_get_instance_private (win);
|
||||
win = EXAMPLE_APP_WINDOW (object);
|
||||
priv = example_app_window_get_instance_private (win);
|
||||
|
||||
g_clear_object (&priv->settings);
|
||||
g_clear_object (&priv->settings);
|
||||
|
||||
G_OBJECT_CLASS (example_app_window_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (example_app_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_window_class_init (ExampleAppWindowClass *class)
|
||||
{
|
||||
G_OBJECT_CLASS (class)->dispose = example_app_window_dispose;
|
||||
G_OBJECT_CLASS (class)->dispose = example_app_window_dispose;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/exampleapp/window.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppWindow, stack);
|
||||
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class),
|
||||
"/org/gtk/exampleapp/window.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppWindow, stack);
|
||||
}
|
||||
|
||||
ExampleAppWindow *
|
||||
example_app_window_new (ExampleApp *app)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_WINDOW_TYPE, "application", app, NULL);
|
||||
return g_object_new (EXAMPLE_APP_WINDOW_TYPE, "application", app, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
example_app_window_open (ExampleAppWindow *win,
|
||||
GFile *file)
|
||||
{
|
||||
ExampleAppWindowPrivate *priv;
|
||||
gchar *basename;
|
||||
GtkWidget *scrolled, *view;
|
||||
gchar *contents;
|
||||
gsize length;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextTag *tag;
|
||||
GtkTextIter start_iter, end_iter;
|
||||
ExampleAppWindowPrivate *priv;
|
||||
gchar *basename;
|
||||
GtkWidget *scrolled, *view;
|
||||
gchar *contents;
|
||||
gsize length;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextTag *tag;
|
||||
GtkTextIter start_iter, end_iter;
|
||||
|
||||
priv = example_app_window_get_instance_private (win);
|
||||
basename = g_file_get_basename (file);
|
||||
priv = example_app_window_get_instance_private (win);
|
||||
basename = g_file_get_basename (file);
|
||||
|
||||
scrolled = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (scrolled);
|
||||
gtk_widget_set_hexpand (scrolled, TRUE);
|
||||
gtk_widget_set_vexpand (scrolled, TRUE);
|
||||
view = gtk_text_view_new ();
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
|
||||
gtk_widget_show (view);
|
||||
gtk_container_add (GTK_CONTAINER (scrolled), view);
|
||||
gtk_stack_add_titled (GTK_STACK (priv->stack), scrolled, basename, basename);
|
||||
scrolled = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (scrolled);
|
||||
gtk_widget_set_hexpand (scrolled, TRUE);
|
||||
gtk_widget_set_vexpand (scrolled, TRUE);
|
||||
view = gtk_text_view_new ();
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
|
||||
gtk_widget_show (view);
|
||||
gtk_container_add (GTK_CONTAINER (scrolled), view);
|
||||
gtk_stack_add_titled (GTK_STACK (priv->stack), scrolled, basename, basename);
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
||||
|
||||
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL)) {
|
||||
gtk_text_buffer_set_text (buffer, contents, length);
|
||||
g_free (contents);
|
||||
}
|
||||
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))
|
||||
{
|
||||
gtk_text_buffer_set_text (buffer, contents, length);
|
||||
g_free (contents);
|
||||
}
|
||||
|
||||
tag = gtk_text_buffer_create_tag (buffer, NULL, NULL);
|
||||
g_settings_bind (priv->settings, "font", tag, "font", G_SETTINGS_BIND_DEFAULT);
|
||||
tag = gtk_text_buffer_create_tag (buffer, NULL, NULL);
|
||||
g_settings_bind (priv->settings, "font", tag, "font", G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
gtk_text_buffer_get_start_iter (buffer, &start_iter);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end_iter);
|
||||
gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter);
|
||||
gtk_text_buffer_get_start_iter (buffer, &start_iter);
|
||||
gtk_text_buffer_get_end_iter (buffer, &end_iter);
|
||||
gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter);
|
||||
|
||||
g_free (basename);
|
||||
g_free (basename);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
/* Since this example is running uninstalled,
|
||||
* we have to help it find its schema. This
|
||||
* is *not* necessary in properly installed
|
||||
* application.
|
||||
*/
|
||||
g_setenv ("GSETTINGS_SCHEMA_DIR", ".", FALSE);
|
||||
/* Since this example is running uninstalled,
|
||||
* we have to help it find its schema. This
|
||||
* is *not* necessary in properly installed
|
||||
* application.
|
||||
*/
|
||||
g_setenv ("GSETTINGS_SCHEMA_DIR", ".", FALSE);
|
||||
|
||||
return g_application_run (G_APPLICATION (example_app_new ()), argc, argv);
|
||||
return g_application_run (G_APPLICATION (example_app_new ()), argc, argv);
|
||||
}
|
||||
|
||||
@@ -64,19 +64,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="action_area">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="close">
|
||||
<signal name="clicked" handler="preferences_closed"/>
|
||||
<property name="visible">True</property>
|
||||
<property name="label">_Close</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -53,12 +53,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
|
||||
@@ -25,12 +25,6 @@ struct _ExampleAppPrefsPrivate
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppPrefs, example_app_prefs, GTK_TYPE_DIALOG)
|
||||
|
||||
static void
|
||||
preferences_closed (GtkWidget *button)
|
||||
{
|
||||
gtk_widget_destroy (gtk_widget_get_toplevel (button));
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_prefs_init (ExampleAppPrefs *prefs)
|
||||
{
|
||||
@@ -68,12 +62,10 @@ example_app_prefs_class_init (ExampleAppPrefsClass *class)
|
||||
"/org/gtk/exampleapp/prefs.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, font);
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, transition);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), preferences_closed);
|
||||
}
|
||||
|
||||
ExampleAppPrefs *
|
||||
example_app_prefs_new (ExampleAppWindow *win)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, NULL);
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, "use-header-bar", TRUE, NULL);
|
||||
}
|
||||
|
||||
@@ -64,19 +64,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="action_area">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="close">
|
||||
<signal name="clicked" handler="preferences_closed"/>
|
||||
<property name="visible">True</property>
|
||||
<property name="label">_Close</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -22,6 +23,9 @@
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="search-icon">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -53,12 +53,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
|
||||
@@ -25,12 +25,6 @@ struct _ExampleAppPrefsPrivate
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppPrefs, example_app_prefs, GTK_TYPE_DIALOG)
|
||||
|
||||
static void
|
||||
preferences_closed (GtkWidget *button)
|
||||
{
|
||||
gtk_widget_destroy (gtk_widget_get_toplevel (button));
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_prefs_init (ExampleAppPrefs *prefs)
|
||||
{
|
||||
@@ -68,12 +62,10 @@ example_app_prefs_class_init (ExampleAppPrefsClass *class)
|
||||
"/org/gtk/exampleapp/prefs.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, font);
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, transition);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), preferences_closed);
|
||||
}
|
||||
|
||||
ExampleAppPrefs *
|
||||
example_app_prefs_new (ExampleAppWindow *win)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, NULL);
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, "use-header-bar", TRUE, NULL);
|
||||
}
|
||||
|
||||
@@ -64,19 +64,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="action_area">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="close">
|
||||
<signal name="clicked" handler="preferences_closed"/>
|
||||
<property name="visible">True</property>
|
||||
<property name="label">_Close</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -22,6 +23,9 @@
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="search-icon">
|
||||
<property name="visible">True</property>
|
||||
@@ -37,6 +41,10 @@
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="gears">
|
||||
<property name="visible">True</property>
|
||||
<property name="use-popover">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="gears-icon">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
@@ -53,12 +53,16 @@ example_app_startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *app_menu;
|
||||
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
|
||||
|
||||
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
|
||||
"app.quit",
|
||||
quit_accels);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
|
||||
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
|
||||
|
||||
@@ -25,12 +25,6 @@ struct _ExampleAppPrefsPrivate
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppPrefs, example_app_prefs, GTK_TYPE_DIALOG)
|
||||
|
||||
static void
|
||||
preferences_closed (GtkWidget *button)
|
||||
{
|
||||
gtk_widget_destroy (gtk_widget_get_toplevel (button));
|
||||
}
|
||||
|
||||
static void
|
||||
example_app_prefs_init (ExampleAppPrefs *prefs)
|
||||
{
|
||||
@@ -68,12 +62,10 @@ example_app_prefs_class_init (ExampleAppPrefsClass *class)
|
||||
"/org/gtk/exampleapp/prefs.ui");
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, font);
|
||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, transition);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), preferences_closed);
|
||||
}
|
||||
|
||||
ExampleAppPrefs *
|
||||
example_app_prefs_new (ExampleAppWindow *win)
|
||||
{
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, NULL);
|
||||
return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, "use-header-bar", TRUE, NULL);
|
||||
}
|
||||
|
||||
@@ -64,19 +64,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="action_area">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="close">
|
||||
<signal name="clicked" handler="preferences_closed"/>
|
||||
<property name="visible">True</property>
|
||||
<property name="label">_Close</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<child type="title">
|
||||
<object class="GtkStackSwitcher" id="tabs">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="stack">stack</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -39,6 +40,9 @@
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="search-icon">
|
||||
<property name="visible">True</property>
|
||||
@@ -54,6 +58,10 @@
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="gears">
|
||||
<property name="visible">True</property>
|
||||
<property name="use-popover">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage" id="gears-icon">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -508,6 +508,7 @@ static void
|
||||
bloat_pad_startup (GApplication *application)
|
||||
{
|
||||
BloatPad *bloatpad = (BloatPad*) application;
|
||||
GtkApplication *app = GTK_APPLICATION (application);
|
||||
GtkBuilder *builder;
|
||||
GMenu *menu;
|
||||
GMenuItem *item;
|
||||
@@ -517,6 +518,19 @@ bloat_pad_startup (GApplication *application)
|
||||
GFile *file;
|
||||
gchar *data;
|
||||
gsize size;
|
||||
gint i;
|
||||
struct {
|
||||
const gchar *action_and_target;
|
||||
const gchar *accelerators[2];
|
||||
} accels[] = {
|
||||
{ "app.new", { "<Primary>n", NULL } },
|
||||
{ "app.quit", { "<Primary>q", NULL } },
|
||||
{ "win.copy", { "<Primary>c", NULL } },
|
||||
{ "win.paste", { "<Primary>p", NULL } },
|
||||
{ "win.justify::left", { "<Primary>l", NULL } },
|
||||
{ "win.justify::center", { "<Primary>m", NULL } },
|
||||
{ "win.justify::right", { "<Primary>r", NULL } }
|
||||
};
|
||||
|
||||
G_APPLICATION_CLASS (bloat_pad_parent_class)
|
||||
->startup (application);
|
||||
@@ -606,15 +620,10 @@ bloat_pad_startup (GApplication *application)
|
||||
" </submenu>"
|
||||
" </menu>"
|
||||
"</interface>", -1, NULL);
|
||||
gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
|
||||
gtk_application_set_menubar (GTK_APPLICATION (application), G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>n", "app.new", NULL);
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>q", "app.quit", NULL);
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>c", "win.copy", NULL);
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>p", "win.paste", NULL);
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>l", "win.justify", g_variant_new_string ("left"));
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>m", "win.justify", g_variant_new_string ("center"));
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>r", "win.justify", g_variant_new_string ("right"));
|
||||
gtk_application_set_app_menu (app, G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
|
||||
gtk_application_set_menubar (app, G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
|
||||
for (i = 0; i < G_N_ELEMENTS (accels); i++)
|
||||
gtk_application_set_accels_for_action (app, accels[i].action_and_target, accels[i].accelerators);
|
||||
|
||||
menu = G_MENU (gtk_builder_get_object (builder, "icon-menu"));
|
||||
|
||||
@@ -743,11 +752,12 @@ main (int argc, char **argv)
|
||||
{
|
||||
BloatPad *bloat_pad;
|
||||
int status;
|
||||
const gchar *accels[] = { "F11", NULL };
|
||||
|
||||
bloat_pad = bloat_pad_new ();
|
||||
|
||||
gtk_application_add_accelerator (GTK_APPLICATION (bloat_pad),
|
||||
"F11", "win.fullscreen", NULL);
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (bloat_pad),
|
||||
"win.fullscreen", accels);
|
||||
|
||||
status = g_application_run (G_APPLICATION (bloat_pad), argc, argv);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
-include $(INTROSPECTION_MAKEFILE)
|
||||
INTROSPECTION_GIRS =
|
||||
INTROSPECTION_SCANNER_ENV = \
|
||||
CC="$(CC)"
|
||||
INTROSPECTION_SCANNER_ARGS = \
|
||||
--add-include-path=../gdk \
|
||||
--warn-all
|
||||
@@ -11,7 +13,7 @@ INTROSPECTION_COMPILER_ARGS = \
|
||||
|
||||
SUBDIRS = $(GDK_BACKENDS) .
|
||||
|
||||
DIST_SUBDIRS = win32 x11 quartz broadway wayland
|
||||
DIST_SUBDIRS = win32 x11 quartz broadway wayland mir
|
||||
|
||||
CLEANFILES =
|
||||
|
||||
@@ -191,6 +193,10 @@ if USE_WAYLAND
|
||||
libgdk_3_la_LIBADD += wayland/libgdk-wayland.la
|
||||
endif
|
||||
|
||||
if USE_MIR
|
||||
libgdk_3_la_LIBADD += mir/libgdk-mir.la
|
||||
endif
|
||||
|
||||
if HAVE_INTROSPECTION
|
||||
|
||||
introspection_files = \
|
||||
@@ -208,7 +214,9 @@ Gdk_3_0_gir_FILES = $(introspection_files)
|
||||
Gdk_3_0_gir_CFLAGS = $(AM_CPPFLAGS)
|
||||
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
|
||||
INTROSPECTION_GIRS += Gdk-3.0.gir
|
||||
|
||||
if OS_WIN32
|
||||
Gdk_3_0_gir_CFLAGS += -I$(srcdir)/win32 -I$(srcdir)
|
||||
endif
|
||||
if USE_X11
|
||||
x11_introspection_files = \
|
||||
x11/gdkapplaunchcontext-x11.c \
|
||||
@@ -271,6 +279,53 @@ INTROSPECTION_GIRS += GdkX11-3.0.gir
|
||||
|
||||
endif # USE_X11
|
||||
|
||||
if OS_WIN32
|
||||
w32_introspection_files = \
|
||||
win32/gdkcursor-win32.c \
|
||||
win32/gdkdevicemanager-win32.c \
|
||||
win32/gdkdevice-virtual.c \
|
||||
win32/gdkdevice-win32.c \
|
||||
win32/gdkdevice-wintab.c \
|
||||
win32/gdkdisplaymanager-win32.c \
|
||||
win32/gdkdisplay-win32.c \
|
||||
win32/gdkdnd-win32.c \
|
||||
win32/gdkevents-win32.c \
|
||||
win32/gdkgeometry-win32.c \
|
||||
win32/gdkglobals-win32.c \
|
||||
win32/gdkinput.c \
|
||||
win32/gdkkeys-win32.c \
|
||||
win32/gdkmain-win32.c \
|
||||
win32/gdkproperty-win32.c \
|
||||
win32/gdkscreen-win32.c \
|
||||
win32/gdkselection-win32.c \
|
||||
win32/gdktestutils-win32.c \
|
||||
win32/gdkvisual-win32.c \
|
||||
win32/gdkwin32.h \
|
||||
win32/gdkwin32cursor.h \
|
||||
win32/gdkwin32display.h \
|
||||
win32/gdkwin32displaymanager.h \
|
||||
win32/gdkwin32dnd.h \
|
||||
win32/gdkwin32id.c \
|
||||
win32/gdkwin32keys.h \
|
||||
win32/gdkwin32misc.h \
|
||||
win32/gdkwin32screen.h \
|
||||
win32/gdkwin32window.h \
|
||||
win32/gdkwindow-win32.c
|
||||
|
||||
|
||||
GdkWin32-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
|
||||
GdkWin32_3_0_gir_SCANNERFLAGS = \
|
||||
--identifier-prefix=Gdk \
|
||||
--c-include="gdk/gdkwin32.h" \
|
||||
--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
|
||||
GdkWin32_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0
|
||||
GdkWin32_3_0_gir_LIBS = libgdk-3.la
|
||||
GdkWin32_3_0_gir_FILES = $(w32_introspection_files)
|
||||
GdkWin32_3_0_gir_CFLAGS = $(AM_CPPFLAGS) -L$(top_builddir)/gdk -I$(srcdir)/win32 -I$(srcdir)
|
||||
INTROSPECTION_GIRS += GdkWin32-3.0.gir
|
||||
|
||||
endif # OS_WIN32
|
||||
|
||||
girdir = $(datadir)/gir-1.0
|
||||
gir_DATA = $(INTROSPECTION_GIRS)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
NULL =
|
||||
|
||||
libgdkincludedir = $(includedir)/gtk-3.0/gdk
|
||||
libgdkbroadwayincludedir = $(includedir)/gtk-3.0/gdk/broadway
|
||||
@@ -75,7 +76,8 @@ libgdk_broadway_la_SOURCES = \
|
||||
|
||||
if OS_UNIX
|
||||
libgdk_broadway_la_LIBADD = \
|
||||
-lrt
|
||||
$(SHM_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
broadwayd_SOURCES = \
|
||||
@@ -89,9 +91,9 @@ broadwayd_SOURCES = \
|
||||
broadway-output.c
|
||||
|
||||
if OS_WIN32
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lcrypt -lws2_32
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lws2_32
|
||||
else
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt -lcrypt
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) @SHM_LIBS@
|
||||
endif
|
||||
|
||||
MAINTAINERCLEANFILES = $(broadway_built_sources)
|
||||
|
||||
@@ -228,7 +228,9 @@ encode_pixel (struct encoder *encoder, guint32 color, guint32 prev_color)
|
||||
(encoder->delta != delta &&
|
||||
encoder->delta_run > encoder->color_run) ||
|
||||
|
||||
(encoder->delta != delta && encoder->color != color))
|
||||
(encoder->delta != delta && encoder->color != color) ||
|
||||
|
||||
(encoder->delta_run == 0xFFFFF || encoder->color_run == 0xFFFFF))
|
||||
{
|
||||
encode_run (encoder);
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
#include "broadway-output.h"
|
||||
|
||||
#define _XOPEN_SOURCE /* for crypt */
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include "gdktypes.h"
|
||||
@@ -18,7 +16,6 @@
|
||||
#elif defined (G_OS_WIN32)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include <crypt.h>
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
@@ -540,12 +540,14 @@ map_named_shm (char *name, gsize size)
|
||||
res = ftruncate (fd, size);
|
||||
g_assert (res != -1);
|
||||
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
res = posix_fallocate (fd, 0, size);
|
||||
if (res != 0)
|
||||
{
|
||||
shm_unlink (name);
|
||||
g_error ("Not enough shared memory for window surface");
|
||||
}
|
||||
#endif
|
||||
|
||||
ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ _gdk_broadway_display_open (const gchar *display_name)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
GError *error = NULL;
|
||||
|
||||
display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
@@ -151,10 +152,11 @@ _gdk_broadway_display_open (const gchar *display_name)
|
||||
if (display_name == NULL)
|
||||
display_name = g_getenv ("BROADWAY_DISPLAY");
|
||||
|
||||
broadway_display->server = _gdk_broadway_server_new (display_name, NULL);
|
||||
broadway_display->server = _gdk_broadway_server_new (display_name, &error);
|
||||
if (broadway_display->server == NULL)
|
||||
{
|
||||
g_printerr ("Unable to init server\n");
|
||||
g_printerr ("Unable to init server: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,10 @@ static void
|
||||
queue_flush (GdkWindow *window)
|
||||
{
|
||||
if (flush_id == 0)
|
||||
flush_id = gdk_threads_add_idle (flush_idle, NULL);
|
||||
{
|
||||
flush_id = gdk_threads_add_idle (flush_idle, NULL);
|
||||
g_source_set_name_by_id (flush_id, "[gtk+] flush_idle");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -724,24 +727,6 @@ gdk_window_broadway_get_root_coords (GdkWindow *window,
|
||||
*root_y = y + impl->wrapper->y;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_window_get_root_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
GdkWindowImplBroadway *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
|
||||
/* TODO: This should take wm frame into account */
|
||||
|
||||
if (x)
|
||||
*x = impl->wrapper->x;
|
||||
|
||||
if (y)
|
||||
*y = impl->wrapper->x;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_window_get_frame_extents (GdkWindow *window,
|
||||
GdkRectangle *rect)
|
||||
@@ -1584,7 +1569,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
|
||||
impl_class->set_role = gdk_broadway_window_set_role;
|
||||
impl_class->set_startup_id = gdk_broadway_window_set_startup_id;
|
||||
impl_class->set_transient_for = gdk_broadway_window_set_transient_for;
|
||||
impl_class->get_root_origin = gdk_broadway_window_get_root_origin;
|
||||
impl_class->get_frame_extents = gdk_broadway_window_get_frame_extents;
|
||||
impl_class->set_override_redirect = gdk_broadway_window_set_override_redirect;
|
||||
impl_class->set_accept_focus = gdk_broadway_window_set_accept_focus;
|
||||
|
||||
@@ -267,7 +267,7 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
|
||||
* gdk_cairo_surface_create_from_pixbuf:
|
||||
* @pixbuf: a #GdkPixbuf
|
||||
* @scale: the scale of the new surface, or 0 to use same as @window
|
||||
* @for_window: The window this will be drawn to, on %NULL.
|
||||
* @for_window: (allow-none): The window this will be drawn to, or %NULL
|
||||
*
|
||||
* Creates an image surface with the same contents as
|
||||
* the pixbuf.
|
||||
|
||||
@@ -163,7 +163,7 @@ gdk_color_parse (const gchar *spec,
|
||||
* @color: a #GdkColor
|
||||
*
|
||||
* Returns a textual specification of @color in the hexadecimal
|
||||
* form `\#rrrrggggbbbb`, where `r`, `g` and `b` are hex digits
|
||||
* form “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits
|
||||
* representing the red, green and blue components respectively.
|
||||
*
|
||||
* The returned string can be parsed by gdk_color_parse().
|
||||
|
||||
@@ -318,6 +318,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
const char *option;
|
||||
char *end;
|
||||
gint64 value;
|
||||
GdkCursor *cursor;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
||||
@@ -346,7 +347,11 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
|
||||
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL);
|
||||
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_surface (display, surface, x, y);
|
||||
cursor = GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_surface (display, surface, x, y);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1717,3 +1717,32 @@ _gdk_device_window_at_position (GdkDevice *device,
|
||||
mask,
|
||||
get_toplevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_last_event_window:
|
||||
* @device: a #GdkDevice, with a source other than %GDK_SOURCE_KEYBOARD
|
||||
*
|
||||
* Gets information about which window the given pointer device is in, based on
|
||||
* that have been received so far from the display server. If another application
|
||||
* has a pointer grab, or this application has a grab with owner_events = %FALSE,
|
||||
* %NULL may be returned even if the pointer is physically over one of this
|
||||
* application's windows.
|
||||
*
|
||||
* Returns: (transfer none) (allow-none): the last window the device
|
||||
*
|
||||
* Since: 3.12
|
||||
*/
|
||||
GdkWindow *
|
||||
gdk_device_get_last_event_window (GdkDevice *device)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkPointerWindowInfo *info;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
||||
|
||||
display = gdk_device_get_display (device);
|
||||
info = _gdk_display_get_pointer_info (display, device);
|
||||
|
||||
return info->window_under_pointer;
|
||||
}
|
||||
|
||||
@@ -271,6 +271,8 @@ gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events);
|
||||
|
||||
GDK_AVAILABLE_IN_3_12
|
||||
GdkWindow *gdk_device_get_last_event_window (GdkDevice *device);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
#include "wayland/gdkprivate-wayland.h"
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_MIR
|
||||
#include "mir/gdkmir-private.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SECTION:gdkdisplaymanager
|
||||
* @Short_description: Maintains a list of all open GdkDisplays
|
||||
@@ -272,6 +276,9 @@ static GdkBackend gdk_backends[] = {
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
{ "wayland", _gdk_wayland_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_MIR
|
||||
{ "mir", _gdk_mir_display_open },
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
{ "broadway", _gdk_broadway_display_open },
|
||||
#endif
|
||||
|
||||
@@ -743,7 +743,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->set_role = gdk_offscreen_window_set_string;
|
||||
impl_class->set_startup_id = gdk_offscreen_window_set_string;
|
||||
impl_class->set_transient_for = gdk_offscreen_window_set_transient_for;
|
||||
impl_class->get_root_origin = NULL;
|
||||
impl_class->get_frame_extents = gdk_offscreen_window_get_frame_extents;
|
||||
impl_class->set_override_redirect = NULL;
|
||||
impl_class->set_accept_focus = NULL;
|
||||
|
||||
@@ -52,8 +52,6 @@
|
||||
*
|
||||
* ## Draw transformed text with Pango and cairo ## {#rotated-example}
|
||||
*
|
||||
* <!-- Note that this example is basically the same as
|
||||
* demos/gtk-demo/rotated_text.c -->
|
||||
* |[<!-- language="C" -->
|
||||
* #define RADIUS 100
|
||||
* #define N_WORDS 10
|
||||
@@ -67,9 +65,9 @@
|
||||
* int width, height;
|
||||
* int i;
|
||||
*
|
||||
* /<!---->* Set up a transformation matrix so that the user space coordinates for
|
||||
* * where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
|
||||
* * We first center, then change the scale *<!---->/
|
||||
* // Set up a transformation matrix so that the user space coordinates for
|
||||
* // where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
|
||||
* // We first center, then change the scale
|
||||
*
|
||||
* width = gdk_window_get_width (window);
|
||||
* height = gdk_window_get_height (window);
|
||||
@@ -80,7 +78,7 @@
|
||||
* radius + (height - 2 * radius) / 2);
|
||||
* cairo_scale (cr, radius / RADIUS, radius / RADIUS);
|
||||
*
|
||||
* /<!---->* Create a PangoLayout, set the font and text *<!---->/
|
||||
* // Create a PangoLayout, set the font and text
|
||||
* context = gdk_pango_context_get_for_screen (screen);
|
||||
* layout = pango_layout_new (context);
|
||||
* pango_layout_set_text (layout, "Text", -1);
|
||||
@@ -88,7 +86,7 @@
|
||||
* pango_layout_set_font_description (layout, desc);
|
||||
* pango_font_description_free (desc);
|
||||
*
|
||||
* /<!---->* Draw the layout N_WORDS times in a circle *<!---->/
|
||||
* // Draw the layout N_WORDS times in a circle
|
||||
* for (i = 0; i < N_WORDS; i++)
|
||||
* {
|
||||
* double red, green, blue;
|
||||
@@ -96,7 +94,7 @@
|
||||
*
|
||||
* cairo_save (cr);
|
||||
*
|
||||
* /<!---->* Gradient from red at angle == 60 to blue at angle == 300 *<!---->/
|
||||
* // Gradient from red at angle == 60 to blue at angle == 300
|
||||
* red = (1 + cos (angle - 60)) / 2;
|
||||
* green = 0;
|
||||
* blue = 1 - red;
|
||||
@@ -104,7 +102,7 @@
|
||||
* cairo_set_source_rgb (cr, red, green, blue);
|
||||
* cairo_rotate (cr, angle);
|
||||
*
|
||||
* /<!---->* Inform Pango to re-layout the text with the new transformation matrix *<!---->/
|
||||
* // Inform Pango to re-layout the text with the new transformation matrix
|
||||
* pango_cairo_update_layout (cr, layout);
|
||||
*
|
||||
* pango_layout_get_size (layout, &width, &height);
|
||||
|
||||
@@ -259,10 +259,9 @@ typedef enum
|
||||
* menu accelerators.
|
||||
* @GDK_MODIFIER_INTENT_CONTEXT_MENU: the modifier used to invoke context menus.
|
||||
* Note that mouse button 3 always triggers context menus. When this modifier
|
||||
* is not 0, it <strong>additionally</strong> triggers context menus when used
|
||||
* with mouse button 1.
|
||||
* is not 0, it additionally triggers context menus when used with mouse button 1.
|
||||
* @GDK_MODIFIER_INTENT_EXTEND_SELECTION: the modifier used to extend selections
|
||||
* using <modifier>-click or <modifier>-cursor-key
|
||||
* using `modifier`-click or `modifier`-cursor-key
|
||||
* @GDK_MODIFIER_INTENT_MODIFY_SELECTION: the modifier used to modify selections,
|
||||
* which in most cases means toggling the clicked item into or out of the selection.
|
||||
* @GDK_MODIFIER_INTENT_NO_TEXT_INPUT: when any of these modifiers is pressed, the
|
||||
|
||||
@@ -8229,12 +8229,15 @@ _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
|
||||
|
||||
if (!toplevel->synthesize_crossing_event_queued)
|
||||
{
|
||||
guint id;
|
||||
|
||||
toplevel->synthesize_crossing_event_queued = TRUE;
|
||||
|
||||
gdk_threads_add_idle_full (GDK_PRIORITY_EVENTS - 1,
|
||||
do_synthesize_crossing_event,
|
||||
g_object_ref (toplevel),
|
||||
g_object_unref);
|
||||
id = gdk_threads_add_idle_full (GDK_PRIORITY_EVENTS - 1,
|
||||
do_synthesize_crossing_event,
|
||||
g_object_ref (toplevel),
|
||||
g_object_unref);
|
||||
g_source_set_name_by_id (id, "[gtk+] do_synthesize_crossing_event");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9630,7 +9633,15 @@ gdk_window_get_root_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_root_origin (window, x, y);
|
||||
GdkRectangle rect;
|
||||
|
||||
gdk_window_get_frame_extents (window, &rect);
|
||||
|
||||
if (x)
|
||||
*x = rect.x;
|
||||
|
||||
if (y)
|
||||
*y = rect.y;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -194,9 +194,6 @@ struct _GdkWindowImplClass
|
||||
const gchar *startup_id);
|
||||
void (* set_transient_for) (GdkWindow *window,
|
||||
GdkWindow *parent);
|
||||
void (* get_root_origin) (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void (* get_frame_extents) (GdkWindow *window,
|
||||
GdkRectangle *rect);
|
||||
void (* set_override_redirect) (GdkWindow *window,
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
libgdkincludedir = $(includedir)/gtk-3.0/gdk
|
||||
libgdkmirincludedir = $(includedir)/gtk-3.0/gdk/mir
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Gdk\" \
|
||||
-DGDK_COMPILATION \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/gdk \
|
||||
-I$(top_builddir)/gdk \
|
||||
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GDK_DEP_CFLAGS)
|
||||
|
||||
LDADDS = $(GDK_DEP_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
libgdk-mir.la
|
||||
|
||||
libgdk_mir_la_SOURCES = \
|
||||
gdkmircursor.c \
|
||||
gdkmirdevicemanager.c \
|
||||
gdkmirdisplay.c \
|
||||
gdkmireventsource.c \
|
||||
gdkmirkeyboard.c \
|
||||
gdkmirkeymap.c \
|
||||
gdkmirpointer.c \
|
||||
gdkmirscreen.c \
|
||||
gdkmirwindow.c \
|
||||
gdkmirwindowimpl.c \
|
||||
gdkmir-debug.c \
|
||||
gdkmir.h
|
||||
|
||||
libgdkinclude_HEADERS = \
|
||||
gdkmir.h
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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 "gdkmir-private.h"
|
||||
|
||||
void
|
||||
_gdk_mir_print_modifiers (unsigned int modifiers)
|
||||
{
|
||||
g_printerr (" Modifiers");
|
||||
if ((modifiers & mir_key_modifier_alt) != 0)
|
||||
g_printerr (" alt");
|
||||
if ((modifiers & mir_key_modifier_alt_left) != 0)
|
||||
g_printerr (" alt-left");
|
||||
if ((modifiers & mir_key_modifier_alt_right) != 0)
|
||||
g_printerr (" alt-right");
|
||||
if ((modifiers & mir_key_modifier_shift) != 0)
|
||||
g_printerr (" shift");
|
||||
if ((modifiers & mir_key_modifier_shift_left) != 0)
|
||||
g_printerr (" shift-left");
|
||||
if ((modifiers & mir_key_modifier_shift_right) != 0)
|
||||
g_printerr (" shift-right");
|
||||
if ((modifiers & mir_key_modifier_sym) != 0)
|
||||
g_printerr (" sym");
|
||||
if ((modifiers & mir_key_modifier_function) != 0)
|
||||
g_printerr (" function");
|
||||
if ((modifiers & mir_key_modifier_ctrl) != 0)
|
||||
g_printerr (" ctrl");
|
||||
if ((modifiers & mir_key_modifier_ctrl_left) != 0)
|
||||
g_printerr (" ctrl-left");
|
||||
if ((modifiers & mir_key_modifier_ctrl_right) != 0)
|
||||
g_printerr (" ctrl-right");
|
||||
if ((modifiers & mir_key_modifier_meta) != 0)
|
||||
g_printerr (" meta");
|
||||
if ((modifiers & mir_key_modifier_meta_left) != 0)
|
||||
g_printerr (" meta-left");
|
||||
if ((modifiers & mir_key_modifier_meta_right) != 0)
|
||||
g_printerr (" meta-right");
|
||||
if ((modifiers & mir_key_modifier_caps_lock) != 0)
|
||||
g_printerr (" caps-lock");
|
||||
if ((modifiers & mir_key_modifier_num_lock) != 0)
|
||||
g_printerr (" num-lock");
|
||||
if ((modifiers & mir_key_modifier_scroll_lock) != 0)
|
||||
g_printerr (" scroll-lock");
|
||||
g_printerr ("\n");
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_key_event (const MirKeyEvent *event)
|
||||
{
|
||||
g_printerr ("KEY\n");
|
||||
g_printerr (" Device %i\n", event->device_id);
|
||||
g_printerr (" Source %i\n", event->source_id);
|
||||
g_printerr (" Action ");
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_key_action_down:
|
||||
g_printerr ("down");
|
||||
break;
|
||||
case mir_key_action_up:
|
||||
g_printerr ("up");
|
||||
break;
|
||||
case mir_key_action_multiple:
|
||||
g_printerr ("multiple");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->action);
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Flags");
|
||||
if ((event->flags & mir_key_flag_woke_here) != 0)
|
||||
g_printerr (" woke-here");
|
||||
if ((event->flags & mir_key_flag_soft_keyboard) != 0)
|
||||
g_printerr (" soft-keyboard");
|
||||
if ((event->flags & mir_key_flag_keep_touch_mode) != 0)
|
||||
g_printerr (" keep-touch-mode");
|
||||
if ((event->flags & mir_key_flag_from_system) != 0)
|
||||
g_printerr (" from-system");
|
||||
if ((event->flags & mir_key_flag_editor_action) != 0)
|
||||
g_printerr (" editor-action");
|
||||
if ((event->flags & mir_key_flag_canceled) != 0)
|
||||
g_printerr (" canceled");
|
||||
if ((event->flags & mir_key_flag_virtual_hard_key) != 0)
|
||||
g_printerr (" virtual-hard-key");
|
||||
if ((event->flags & mir_key_flag_long_press) != 0)
|
||||
g_printerr (" long-press");
|
||||
if ((event->flags & mir_key_flag_canceled_long_press) != 0)
|
||||
g_printerr (" canceled-long-press");
|
||||
if ((event->flags & mir_key_flag_tracking) != 0)
|
||||
g_printerr (" tracking");
|
||||
if ((event->flags & mir_key_flag_fallback) != 0)
|
||||
g_printerr (" fallback");
|
||||
g_printerr ("\n");
|
||||
_gdk_mir_print_modifiers (event->modifiers);
|
||||
g_printerr (" Key Code %i\n", event->key_code);
|
||||
g_printerr (" Scan Code %i\n", event->scan_code);
|
||||
g_printerr (" Repeat Count %i\n", event->repeat_count);
|
||||
g_printerr (" Down Time %lli\n", (long long int) event->down_time);
|
||||
g_printerr (" Event Time %lli\n", (long long int) event->event_time);
|
||||
g_printerr (" Is System Key %s\n", event->is_system_key ? "true" : "false");
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_motion_event (const MirMotionEvent *event)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
g_printerr ("MOTION\n");
|
||||
g_printerr (" Device %i\n", event->device_id);
|
||||
g_printerr (" Source %i\n", event->source_id);
|
||||
g_printerr (" Action ");
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_motion_action_down:
|
||||
g_printerr ("down");
|
||||
break;
|
||||
case mir_motion_action_up:
|
||||
g_printerr ("up");
|
||||
break;
|
||||
case mir_motion_action_move:
|
||||
g_printerr ("move");
|
||||
break;
|
||||
case mir_motion_action_cancel:
|
||||
g_printerr ("cancel");
|
||||
break;
|
||||
case mir_motion_action_outside:
|
||||
g_printerr ("outside");
|
||||
break;
|
||||
case mir_motion_action_pointer_down:
|
||||
g_printerr ("pointer-down");
|
||||
break;
|
||||
case mir_motion_action_pointer_up:
|
||||
g_printerr ("pointer-up");
|
||||
break;
|
||||
case mir_motion_action_hover_move:
|
||||
g_printerr ("hover-move");
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
g_printerr ("scroll");
|
||||
break;
|
||||
case mir_motion_action_hover_enter:
|
||||
g_printerr ("hover-enter");
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
g_printerr ("hover-exit");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->action);
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Flags");
|
||||
switch (event->flags)
|
||||
{
|
||||
case mir_motion_flag_window_is_obscured:
|
||||
g_printerr (" window-is-obscured");
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
_gdk_mir_print_modifiers (event->modifiers);
|
||||
g_printerr (" Edge Flags %i\n", event->edge_flags);
|
||||
g_printerr (" Button State");
|
||||
switch (event->button_state)
|
||||
{
|
||||
case mir_motion_button_primary:
|
||||
g_printerr (" primary");
|
||||
break;
|
||||
case mir_motion_button_secondary:
|
||||
g_printerr (" secondary");
|
||||
break;
|
||||
case mir_motion_button_tertiary:
|
||||
g_printerr (" tertiary");
|
||||
break;
|
||||
case mir_motion_button_back:
|
||||
g_printerr (" back");
|
||||
break;
|
||||
case mir_motion_button_forward:
|
||||
g_printerr (" forward");
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Offset (%f, %f)\n", event->x_offset, event->y_offset);
|
||||
g_printerr (" Precision (%f, %f)\n", event->x_precision, event->y_precision);
|
||||
g_printerr (" Down Time %lli\n", (long long int) event->down_time);
|
||||
g_printerr (" Event Time %lli\n", (long long int) event->event_time);
|
||||
g_printerr (" Pointer Coordinates\n");
|
||||
for (i = 0; i < event->pointer_count; i++)
|
||||
{
|
||||
g_printerr (" ID=%i location=(%f, %f) raw=(%f, %f) touch=(%f, %f) size=%f pressure=%f orientation=%f scroll=(%f, %f) tool=",
|
||||
event->pointer_coordinates[i].id,
|
||||
event->pointer_coordinates[i].x, event->pointer_coordinates[i].y,
|
||||
event->pointer_coordinates[i].raw_x, event->pointer_coordinates[i].raw_y,
|
||||
event->pointer_coordinates[i].touch_major, event->pointer_coordinates[i].touch_minor,
|
||||
event->pointer_coordinates[i].size,
|
||||
event->pointer_coordinates[i].pressure,
|
||||
event->pointer_coordinates[i].orientation,
|
||||
event->pointer_coordinates[i].hscroll, event->pointer_coordinates[i].vscroll);
|
||||
switch (event->pointer_coordinates[i].tool_type)
|
||||
{
|
||||
case mir_motion_tool_type_unknown:
|
||||
g_printerr ("unknown");
|
||||
break;
|
||||
case mir_motion_tool_type_finger:
|
||||
g_printerr ("finger");
|
||||
break;
|
||||
case mir_motion_tool_type_stylus:
|
||||
g_printerr ("stylus");
|
||||
break;
|
||||
case mir_motion_tool_type_mouse:
|
||||
g_printerr ("mouse");
|
||||
break;
|
||||
case mir_motion_tool_type_eraser:
|
||||
g_printerr ("eraser");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->pointer_coordinates[i].tool_type);
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_surface_event (const MirSurfaceEvent *event)
|
||||
{
|
||||
g_printerr ("SURFACE\n");
|
||||
g_printerr (" Surface %i\n", event->id);
|
||||
g_printerr (" Attribute ");
|
||||
switch (event->attrib)
|
||||
{
|
||||
case mir_surface_attrib_type:
|
||||
g_printerr ("type");
|
||||
break;
|
||||
case mir_surface_attrib_state:
|
||||
g_printerr ("state");
|
||||
break;
|
||||
case mir_surface_attrib_swapinterval:
|
||||
g_printerr ("swapinterval");
|
||||
break;
|
||||
case mir_surface_attrib_focus:
|
||||
g_printerr ("focus");
|
||||
break;
|
||||
default:
|
||||
g_printerr ("%u", event->attrib);
|
||||
break;
|
||||
}
|
||||
g_printerr ("\n");
|
||||
g_printerr (" Value %i\n", event->value);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_resize_event (const MirResizeEvent *event)
|
||||
{
|
||||
g_printerr ("RESIZE\n");
|
||||
g_printerr (" Surface %i\n", event->surface_id);
|
||||
g_printerr (" Size (%i, %i)\n", event->width, event->height);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_print_event (const MirEvent *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case mir_event_type_key:
|
||||
_gdk_mir_print_key_event (&event->key);
|
||||
break;
|
||||
case mir_event_type_motion:
|
||||
_gdk_mir_print_motion_event (&event->motion);
|
||||
break;
|
||||
case mir_event_type_surface:
|
||||
_gdk_mir_print_surface_event (&event->surface);
|
||||
break;
|
||||
case mir_event_type_resize:
|
||||
_gdk_mir_print_resize_event (&event->resize);
|
||||
break;
|
||||
default:
|
||||
g_printerr ("EVENT %u\n", event->type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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_PRIVATE_MIR_H__
|
||||
#define __GDK_PRIVATE_MIR_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkscreen.h"
|
||||
#include "gdkdevicemanager.h"
|
||||
#include "gdkkeys.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
|
||||
typedef struct _GdkMirWindowImpl GdkMirWindowImpl;
|
||||
typedef struct _GdkMirWindowReference GdkMirWindowReference;
|
||||
typedef struct _GdkMirEventSource GdkMirEventSource;
|
||||
|
||||
#define GDK_TYPE_MIR_WINDOW_IMPL (gdk_mir_window_impl_get_type ())
|
||||
#define GDK_MIR_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_MIR, GdkMirWindowImpl))
|
||||
#define GDK_IS_WINDOW_IMPL_MIR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_MIR))
|
||||
|
||||
GdkDisplay *_gdk_mir_display_open (const gchar *display_name);
|
||||
|
||||
GdkScreen *_gdk_mir_screen_new (GdkDisplay *display);
|
||||
|
||||
GdkDeviceManager *_gdk_mir_device_manager_new (GdkDisplay *display);
|
||||
|
||||
GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manager);
|
||||
|
||||
GdkKeymap *_gdk_mir_keymap_new (void);
|
||||
|
||||
GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
|
||||
GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name);
|
||||
|
||||
void _gdk_mir_pointer_set_location (GdkDevice *pointer, gdouble x, gdouble y, GdkWindow *window, GdkModifierType mask);
|
||||
|
||||
GdkCursor *_gdk_mir_cursor_new (GdkDisplay *display, GdkCursorType type);
|
||||
|
||||
GdkWindowImpl *_gdk_mir_window_impl_new (void);
|
||||
|
||||
void _gdk_mir_window_impl_set_surface_state (GdkMirWindowImpl *impl, MirSurfaceState state);
|
||||
|
||||
void _gdk_mir_window_impl_set_cursor_state (GdkMirWindowImpl *impl, gdouble x, gdouble y, gboolean cursor_inside, MirMotionButton button_state);
|
||||
|
||||
void _gdk_mir_window_impl_get_cursor_state (GdkMirWindowImpl *impl, gdouble *x, gdouble *y, gboolean *cursor_inside, MirMotionButton *button_state);
|
||||
|
||||
GdkMirEventSource *_gdk_mir_display_get_event_source (GdkDisplay *display);
|
||||
|
||||
GdkMirEventSource *_gdk_mir_event_source_new (GdkDisplay *display);
|
||||
|
||||
GdkMirWindowReference *_gdk_mir_event_source_get_window_reference (GdkWindow *window);
|
||||
|
||||
void _gdk_mir_window_reference_unref (GdkMirWindowReference *ref);
|
||||
|
||||
void _gdk_mir_event_source_queue (GdkMirWindowReference *window_ref, const MirEvent *event);
|
||||
|
||||
void _gdk_mir_print_modifiers (unsigned int modifiers);
|
||||
|
||||
void _gdk_mir_print_key_event (const MirKeyEvent *event);
|
||||
|
||||
void _gdk_mir_print_motion_event (const MirMotionEvent *event);
|
||||
|
||||
void _gdk_mir_print_surface_event (const MirSurfaceEvent *event);
|
||||
|
||||
void _gdk_mir_print_resize_event (const MirResizeEvent *event);
|
||||
|
||||
void _gdk_mir_print_event (const MirEvent *event);
|
||||
|
||||
#endif /* __GDK_PRIVATE_MIR_H__ */
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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_MIR_H__
|
||||
#define __GDK_MIR_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <mir_toolkit/mir_client_library.h>
|
||||
|
||||
#define GDK_TYPE_MIR_DISPLAY (gdk_mir_display_get_type ())
|
||||
#define GDK_IS_MIR_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_DISPLAY))
|
||||
|
||||
#define GDK_TYPE_MIR_WINDOW (gdk_mir_window_get_type ())
|
||||
#define GDK_IS_WINDOW_MIR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_MIR))
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gdk_mir_display_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
struct MirConnection *gdk_mir_display_get_mir_connection (GdkDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gdk_mir_window_get_type (void);
|
||||
|
||||
#endif /* __GDK_MIR_H__ */
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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 "gdkcursorprivate.h"
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
typedef struct GdkMirCursor GdkMirCursor;
|
||||
typedef struct GdkMirCursorClass GdkMirCursorClass;
|
||||
|
||||
#define GDK_TYPE_MIR_CURSOR (gdk_mir_cursor_get_type ())
|
||||
#define GDK_MIR_CURSOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_MIR_CURSOR, GdkMirCursor))
|
||||
#define GDK_MIR_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_MIR_CURSOR, GdkMirCursorClass))
|
||||
#define GDK_IS_MIR_CURSOR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_CURSOR))
|
||||
#define GDK_IS_MIR_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_CURSOR))
|
||||
#define GDK_MIR_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_CURSOR, GdkMirCursorClass))
|
||||
|
||||
struct GdkMirCursor
|
||||
{
|
||||
GdkCursor parent_instance;
|
||||
};
|
||||
|
||||
struct GdkMirCursorClass
|
||||
{
|
||||
GdkCursorClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkMirCursor, gdk_mir_cursor, GDK_TYPE_CURSOR)
|
||||
|
||||
GdkCursor *
|
||||
_gdk_mir_cursor_new (GdkDisplay *display, GdkCursorType type)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_MIR_CURSOR, "display", display, "cursor-type", type, NULL);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
gdk_mir_cursor_get_surface (GdkCursor *cursor,
|
||||
gdouble *x_hot,
|
||||
gdouble *y_hot)
|
||||
{
|
||||
g_printerr ("gdk_mir_cursor_get_surface\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_cursor_init (GdkMirCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_cursor_class_init (GdkMirCursorClass *klass)
|
||||
{
|
||||
GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (klass);
|
||||
|
||||
cursor_class->get_surface = gdk_mir_cursor_get_surface;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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 "gdkdevicemanagerprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
typedef struct GdkMirDeviceManager GdkMirDeviceManager;
|
||||
typedef struct GdkMirDeviceManagerClass GdkMirDeviceManagerClass;
|
||||
|
||||
#define GDK_TYPE_MIR_DEVICE_MANAGER (gdk_mir_device_manager_get_type ())
|
||||
#define GDK_MIR_DEVICE_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_MIR_DEVICE_MANAGER, GdkMirDeviceManager))
|
||||
#define GDK_MIR_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_MIR_DEVICE_MANAGER, GdkMirDeviceManagerClass))
|
||||
#define GDK_IS_MIR_DEVICE_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_DEVICE_MANAGER))
|
||||
#define GDK_IS_MIR_DEVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_DEVICE_MANAGER))
|
||||
#define GDK_MIR_DEVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_DEVICE_MANAGER, GdkMirDeviceManagerClass))
|
||||
|
||||
struct GdkMirDeviceManager
|
||||
{
|
||||
GdkDeviceManager parent_instance;
|
||||
|
||||
GdkDevice *pointer;
|
||||
GdkDevice *keyboard;
|
||||
};
|
||||
|
||||
struct GdkMirDeviceManagerClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkMirDeviceManager, gdk_mir_device_manager, GDK_TYPE_DEVICE_MANAGER)
|
||||
|
||||
GdkDeviceManager *
|
||||
_gdk_mir_device_manager_new (GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_MIR_DEVICE_MANAGER, "display", display, NULL);
|
||||
}
|
||||
|
||||
static GList *
|
||||
gdk_mir_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
//g_printerr ("gdk_mir_device_manager_list_devices (%u)\n", type);
|
||||
GdkMirDeviceManager *dm = GDK_MIR_DEVICE_MANAGER (device_manager);
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
GList *devices;
|
||||
|
||||
devices = g_list_append (NULL, dm->keyboard);
|
||||
devices = g_list_append (devices, dm->pointer);
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
gdk_mir_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
{
|
||||
//g_printerr ("gdk_mir_device_manager_get_client_pointer\n");
|
||||
return GDK_MIR_DEVICE_MANAGER (device_manager)->pointer;
|
||||
}
|
||||
|
||||
GdkDevice *
|
||||
_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manager)
|
||||
{
|
||||
return GDK_MIR_DEVICE_MANAGER (device_manager)->keyboard;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_device_manager_init (GdkMirDeviceManager *device_manager)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_device_manager_constructed (GObject *object)
|
||||
{
|
||||
GdkMirDeviceManager *device_manager = GDK_MIR_DEVICE_MANAGER (object);
|
||||
|
||||
device_manager->keyboard = _gdk_mir_keyboard_new (GDK_DEVICE_MANAGER (device_manager), "Mir Keyboard");
|
||||
device_manager->pointer = _gdk_mir_pointer_new (GDK_DEVICE_MANAGER (device_manager), "Mir Pointer");
|
||||
_gdk_device_set_associated_device (device_manager->keyboard, device_manager->pointer);
|
||||
_gdk_device_set_associated_device (device_manager->pointer, device_manager->keyboard);
|
||||
|
||||
gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager))->core_pointer = device_manager->pointer;
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_device_manager_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_device_manager_class_init (GdkMirDeviceManagerClass *klass)
|
||||
{
|
||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
device_manager_class->list_devices = gdk_mir_device_manager_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_mir_device_manager_get_client_pointer;
|
||||
object_class->constructed = gdk_mir_device_manager_constructed;
|
||||
}
|
||||
@@ -0,0 +1,571 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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 "gdkdisplayprivate.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
#define GDK_MIR_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MIR, GdkMirDisplay))
|
||||
#define GDK_MIR_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY_MIR, GdkMirDisplayClass))
|
||||
#define GDK_IS_MIR_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_DISPLAY))
|
||||
#define GDK_MIR_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_DISPLAY, GdkMirDisplayImplClass))
|
||||
|
||||
typedef struct GdkMirDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
|
||||
/* Connection to Mir server */
|
||||
MirConnection *connection;
|
||||
|
||||
/* Event source */
|
||||
GdkMirEventSource *event_source;
|
||||
|
||||
/* Serial number? */
|
||||
gulong serial;
|
||||
|
||||
/* Screen information */
|
||||
GdkScreen *screen;
|
||||
|
||||
GdkCursor *cursor;
|
||||
|
||||
GdkKeymap *keymap;
|
||||
} GdkMirDisplay;
|
||||
|
||||
typedef struct GdkMirDisplayClass
|
||||
{
|
||||
GdkDisplayClass parent_class;
|
||||
} GdkMirDisplayClass;
|
||||
|
||||
/**
|
||||
* SECTION:mir_interaction
|
||||
* @Short_description: Mir backend-specific functions
|
||||
* @Title: Mir Interaction
|
||||
*
|
||||
* The functions in this section are specific to the GDK Mir backend.
|
||||
* To use them, you need to include the <literal><gdk/gdkmir.h></literal>
|
||||
* header and use the Mir-specific pkg-config files to build your
|
||||
* application (either <literal>gdk-mir-3.0</literal> or
|
||||
* <literal>gtk+-mir-3.0</literal>).
|
||||
*
|
||||
* To make your code compile with other GDK backends, guard backend-specific
|
||||
* calls by an ifdef as follows. Since GDK may be built with multiple
|
||||
* backends, you should also check for the backend that is in use (e.g. by
|
||||
* using the GDK_IS_MIR_DISPLAY() macro).
|
||||
* |[
|
||||
* #ifdef GDK_WINDOWING_MIR
|
||||
* if (GDK_IS_MIR_DISPLAY (display))
|
||||
* {
|
||||
* /* make Mir-specific calls here */
|
||||
* }
|
||||
* else
|
||||
* #endif
|
||||
* #ifdef GDK_WINDOWING_X11
|
||||
* if (GDK_IS_X11_DISPLAY (display))
|
||||
* {
|
||||
* /* make X11-specific calls here */
|
||||
* }
|
||||
* else
|
||||
* #endif
|
||||
* g_error ("Unsupported GDK backend");
|
||||
* ]|
|
||||
*/
|
||||
|
||||
G_DEFINE_TYPE (GdkMirDisplay, gdk_mir_display, GDK_TYPE_DISPLAY)
|
||||
|
||||
GdkDisplay *
|
||||
_gdk_mir_display_open (const gchar *display_name)
|
||||
{
|
||||
MirConnection *connection;
|
||||
GdkMirDisplay *display;
|
||||
|
||||
g_printerr ("gdk_mir_display_open\n");
|
||||
|
||||
connection = mir_connect_sync (NULL, "GDK-Mir");
|
||||
if (!connection)
|
||||
return NULL;
|
||||
if (!mir_connection_is_valid (connection))
|
||||
{
|
||||
g_printerr ("Failed to connect to Mir: %s\n", mir_connection_get_error_message (connection));
|
||||
mir_connection_release (connection);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
display = g_object_new (GDK_TYPE_MIR_DISPLAY, NULL);
|
||||
|
||||
display->connection = connection;
|
||||
GDK_DISPLAY (display)->device_manager = _gdk_mir_device_manager_new (GDK_DISPLAY (display));
|
||||
display->screen = _gdk_mir_screen_new (GDK_DISPLAY (display));
|
||||
|
||||
g_signal_emit_by_name (display, "opened");
|
||||
|
||||
return GDK_DISPLAY (display);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_mir_display_get_mir_connection
|
||||
* @display: (type GdkMirDisplay): a #GdkDisplay
|
||||
*
|
||||
* Returns the #MirConnection for a #GdkDisplay
|
||||
*
|
||||
* Returns: (transfer none): a #MirConnection
|
||||
*
|
||||
* Since: 3.14
|
||||
*/
|
||||
struct MirConnection *
|
||||
gdk_mir_display_get_mir_connection (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_MIR_DISPLAY (display), NULL);
|
||||
return GDK_MIR_DISPLAY (display)->connection;
|
||||
}
|
||||
|
||||
GdkMirEventSource *
|
||||
_gdk_mir_display_get_event_source (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_MIR_DISPLAY (display), NULL);
|
||||
|
||||
return GDK_MIR_DISPLAY (display)->event_source;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_dispose (GObject *object)
|
||||
{
|
||||
GdkMirDisplay *display = GDK_MIR_DISPLAY (object);
|
||||
|
||||
g_object_unref (display->screen);
|
||||
display->screen = NULL;
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_display_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_finalize (GObject *object)
|
||||
{
|
||||
GdkMirDisplay *display = GDK_MIR_DISPLAY (object);
|
||||
|
||||
mir_connection_release (display->connection);
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_display_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
gdk_mir_display_get_name (GdkDisplay *display)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_get_name\n");
|
||||
return "Mir";
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
gdk_mir_display_get_default_screen (GdkDisplay *display)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_get_default_screen\n");
|
||||
return GDK_MIR_DISPLAY (display)->screen;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_beep (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_beep\n");
|
||||
/* No system level beep... */
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_sync (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_sync\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_flush (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_flush\n");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_has_pending (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_has_pending\n");
|
||||
/* We don't need to poll for events - so nothing pending */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_queue_events (GdkDisplay *display)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_queue_events\n");
|
||||
/* We don't need to poll for events - so don't do anything*/
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_make_default (GdkDisplay *display)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_make_default\n");
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_mir_display_get_default_group (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_default_group\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_shapes (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_shapes\n");
|
||||
/* Mir doesn't support shaped windows */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_input_shapes (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_input_shapes\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_composite (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_composite\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_clipboard_persistence\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_cursor_alpha\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_cursor_color (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_cursor_color\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_supports_selection_notification\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_request_selection_notification\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_store_clipboard\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_get_default_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_default_cursor_size\n");
|
||||
*width = *height = 32; // FIXME: Random value
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_maximal_cursor_size\n");
|
||||
*width = *height = 32; // FIXME: Random value
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
gdk_mir_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_get_cursor_for_type (%u)\n", cursor_type);
|
||||
/* We don't support configurable cursors */
|
||||
return g_object_ref (GDK_MIR_DISPLAY (display)->cursor);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
gdk_mir_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_cursor_for_name (\"%s\")\n", name);
|
||||
/* We don't support configurable cursors */
|
||||
return g_object_ref (GDK_MIR_DISPLAY (display)->cursor);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
gdk_mir_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
cairo_surface_t *surface,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_cursor_for_surface (%f, %f)\n", x, y);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GList *
|
||||
gdk_mir_display_list_devices (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_list_devices\n");
|
||||
// FIXME: Should this access the device manager?
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GdkAppLaunchContext *
|
||||
gdk_mir_display_get_app_launch_context (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_app_launch_context\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_before_process_all_updates (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_before_process_all_updates\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_after_process_all_updates (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_after_process_all_updates\n");
|
||||
}
|
||||
|
||||
static gulong
|
||||
gdk_mir_display_get_next_serial (GdkDisplay *display)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_get_next_serial\n");
|
||||
return GDK_MIR_DISPLAY (display)->serial++;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_notify_startup_complete (GdkDisplay *display,
|
||||
const gchar *startup_id)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_notify_startup_complete\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_event_data_copy\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *event)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_event_data_free\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_create_window_impl");
|
||||
g_printerr (" window=%p", window);
|
||||
g_printerr (" location=(%d, %d)", window->x, window->y);
|
||||
g_printerr (" size=(%d, %d)", window->width, window->height);
|
||||
g_printerr ("\n");
|
||||
if (attributes->wclass != GDK_INPUT_OUTPUT)
|
||||
return;
|
||||
window->impl = _gdk_mir_window_impl_new ();
|
||||
}
|
||||
|
||||
static GdkKeymap *
|
||||
gdk_mir_display_get_keymap (GdkDisplay *display)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_get_keymap\n");
|
||||
return GDK_MIR_DISPLAY (display)->keymap;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_push_error_trap (GdkDisplay *display)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_push_error_trap\n");
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_mir_display_pop_error_trap (GdkDisplay *display,
|
||||
gboolean ignored)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_pop_error_trap\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_mir_display_get_selection_owner (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_selection_owner\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_set_selection_owner (GdkDisplay *display,
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
guint32 time,
|
||||
gboolean send_event)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_set_selection_owner\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_send_selection_notify (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_send_selection_notify\n");
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_mir_display_get_selection_property (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
guchar **data,
|
||||
GdkAtom *ret_type,
|
||||
gint *ret_format)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_get_selection_property\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_convert_selection (GdkDisplay *display,
|
||||
GdkWindow *requestor,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_convert_selection\n");
|
||||
}
|
||||
|
||||
static gint
|
||||
gdk_mir_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
GdkAtom encoding,
|
||||
gint format,
|
||||
const guchar *text,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_text_property_to_utf8_list\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
gdk_mir_display_utf8_to_string_target (GdkDisplay *display,
|
||||
const gchar *str)
|
||||
{
|
||||
g_printerr ("gdk_mir_display_utf8_to_string_target\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_init (GdkMirDisplay *display)
|
||||
{
|
||||
display->event_source = _gdk_mir_event_source_new (GDK_DISPLAY (display));
|
||||
display->cursor = _gdk_mir_cursor_new (GDK_DISPLAY (display), GDK_ARROW);
|
||||
display->keymap = _gdk_mir_keymap_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_class_init (GdkMirDisplayClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (klass);
|
||||
|
||||
object_class->dispose = gdk_mir_display_dispose;
|
||||
object_class->finalize = gdk_mir_display_finalize;
|
||||
|
||||
display_class->window_type = gdk_mir_window_get_type ();
|
||||
|
||||
display_class->get_name = gdk_mir_display_get_name;
|
||||
display_class->get_default_screen = gdk_mir_display_get_default_screen;
|
||||
display_class->beep = gdk_mir_display_beep;
|
||||
display_class->sync = gdk_mir_display_sync;
|
||||
display_class->flush = gdk_mir_display_flush;
|
||||
display_class->has_pending = gdk_mir_display_has_pending;
|
||||
display_class->queue_events = gdk_mir_display_queue_events;
|
||||
display_class->make_default = gdk_mir_display_make_default;
|
||||
display_class->get_default_group = gdk_mir_display_get_default_group;
|
||||
display_class->supports_shapes = gdk_mir_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_mir_display_supports_input_shapes;
|
||||
display_class->supports_composite = gdk_mir_display_supports_composite;
|
||||
display_class->supports_clipboard_persistence = gdk_mir_display_supports_clipboard_persistence;
|
||||
display_class->supports_cursor_alpha = gdk_mir_display_supports_cursor_alpha;
|
||||
display_class->supports_cursor_color = gdk_mir_display_supports_cursor_color;
|
||||
display_class->supports_selection_notification = gdk_mir_display_supports_selection_notification;
|
||||
display_class->request_selection_notification = gdk_mir_display_request_selection_notification;
|
||||
display_class->store_clipboard = gdk_mir_display_store_clipboard;
|
||||
display_class->get_default_cursor_size = gdk_mir_display_get_default_cursor_size;
|
||||
display_class->get_maximal_cursor_size = gdk_mir_display_get_maximal_cursor_size;
|
||||
display_class->get_cursor_for_type = gdk_mir_display_get_cursor_for_type;
|
||||
display_class->get_cursor_for_name = gdk_mir_display_get_cursor_for_name;
|
||||
display_class->get_cursor_for_surface = gdk_mir_display_get_cursor_for_surface;
|
||||
display_class->list_devices = gdk_mir_display_list_devices;
|
||||
display_class->get_app_launch_context = gdk_mir_display_get_app_launch_context;
|
||||
display_class->before_process_all_updates = gdk_mir_display_before_process_all_updates;
|
||||
display_class->after_process_all_updates = gdk_mir_display_after_process_all_updates;
|
||||
display_class->get_next_serial = gdk_mir_display_get_next_serial;
|
||||
display_class->notify_startup_complete = gdk_mir_display_notify_startup_complete;
|
||||
display_class->event_data_copy = gdk_mir_display_event_data_copy;
|
||||
display_class->event_data_free = gdk_mir_display_event_data_free;
|
||||
display_class->create_window_impl = gdk_mir_display_create_window_impl;
|
||||
display_class->get_keymap = gdk_mir_display_get_keymap;
|
||||
display_class->push_error_trap = gdk_mir_display_push_error_trap;
|
||||
display_class->pop_error_trap = gdk_mir_display_pop_error_trap;
|
||||
display_class->get_selection_owner = gdk_mir_display_get_selection_owner;
|
||||
display_class->set_selection_owner = gdk_mir_display_set_selection_owner;
|
||||
display_class->send_selection_notify = gdk_mir_display_send_selection_notify;
|
||||
display_class->get_selection_property = gdk_mir_display_get_selection_property;
|
||||
display_class->convert_selection = gdk_mir_display_convert_selection;
|
||||
display_class->text_property_to_utf8_list = gdk_mir_display_text_property_to_utf8_list;
|
||||
display_class->utf8_to_string_target = gdk_mir_display_utf8_to_string_target;
|
||||
}
|
||||
@@ -0,0 +1,624 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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 "gdkinternals.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkmir.h"
|
||||
#include "gdkmir-private.h"
|
||||
|
||||
struct _GdkMirWindowReference {
|
||||
GdkMirEventSource *source;
|
||||
GdkWindow *window;
|
||||
gint ref_count;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
GdkMirWindowReference *window_ref;
|
||||
MirEvent event;
|
||||
} GdkMirQueuedEvent;
|
||||
|
||||
struct _GdkMirEventSource
|
||||
{
|
||||
GSource parent_instance;
|
||||
|
||||
GMutex mir_event_lock;
|
||||
GQueue mir_events;
|
||||
|
||||
GdkDisplay *display;
|
||||
};
|
||||
|
||||
static void
|
||||
send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GList *node;
|
||||
|
||||
gdk_event_set_device (event, device);
|
||||
gdk_event_set_screen (event, gdk_display_get_screen (gdk_window_get_display (window), 0));
|
||||
event->any.window = g_object_ref (window);
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, _gdk_display_get_next_serial (display));
|
||||
}
|
||||
|
||||
static void
|
||||
set_key_event_string (GdkEventKey *event)
|
||||
{
|
||||
gunichar c = 0;
|
||||
|
||||
if (event->keyval != GDK_KEY_VoidSymbol)
|
||||
c = gdk_keyval_to_unicode (event->keyval);
|
||||
|
||||
if (c)
|
||||
{
|
||||
gchar buf[7];
|
||||
gint len;
|
||||
gsize bytes_written;
|
||||
|
||||
/* Apply the control key - Taken from Xlib
|
||||
*/
|
||||
if (event->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
|
||||
else if (c == '2')
|
||||
{
|
||||
event->string = g_memdup ("\0\0", 2);
|
||||
event->length = 1;
|
||||
buf[0] = '\0';
|
||||
return;
|
||||
}
|
||||
else if (c >= '3' && c <= '7') c -= ('3' - '\033');
|
||||
else if (c == '8') c = '\177';
|
||||
else if (c == '/') c = '_' & 0x1F;
|
||||
}
|
||||
|
||||
len = g_unichar_to_utf8 (c, buf);
|
||||
buf[len] = '\0';
|
||||
|
||||
event->string = g_locale_from_utf8 (buf, len,
|
||||
NULL, &bytes_written,
|
||||
NULL);
|
||||
if (event->string)
|
||||
event->length = bytes_written;
|
||||
}
|
||||
else if (event->keyval == GDK_KEY_Escape)
|
||||
{
|
||||
event->length = 1;
|
||||
event->string = g_strdup ("\033");
|
||||
}
|
||||
else if (event->keyval == GDK_KEY_Return ||
|
||||
event->keyval == GDK_KEY_KP_Enter)
|
||||
{
|
||||
event->length = 1;
|
||||
event->string = g_strdup ("\r");
|
||||
}
|
||||
|
||||
if (!event->string)
|
||||
{
|
||||
event->length = 0;
|
||||
event->string = g_strdup ("");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
generate_key_event (GdkWindow *window, GdkEventType type, guint state, guint keyval, guint16 keycode, gboolean is_modifier)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (type);
|
||||
event->key.state = state;
|
||||
event->key.keyval = keyval;
|
||||
event->key.hardware_keycode = keycode + 8;
|
||||
event->key.is_modifier = is_modifier;
|
||||
set_key_event_string (&event->key);
|
||||
|
||||
send_event (window, _gdk_mir_device_manager_get_keyboard (gdk_display_get_device_manager (gdk_window_get_display (window))), event);
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
get_pointer (GdkWindow *window)
|
||||
{
|
||||
return gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gdk_window_get_display (window)));
|
||||
}
|
||||
|
||||
static void
|
||||
generate_button_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y, guint button, guint state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (type);
|
||||
event->button.x = x;
|
||||
event->button.y = y;
|
||||
event->button.state = state;
|
||||
event->button.button = button;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x, gdouble delta_y, guint state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (GDK_SCROLL);
|
||||
event->scroll.x = x;
|
||||
event->scroll.y = y;
|
||||
event->scroll.state = state;
|
||||
event->scroll.direction = GDK_SCROLL_SMOOTH;
|
||||
event->scroll.delta_x = delta_x;
|
||||
event->scroll.delta_y = delta_y;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_motion_event (GdkWindow *window, gdouble x, gdouble y, guint state)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->motion.x = x;
|
||||
event->motion.y = y;
|
||||
event->motion.state = state;
|
||||
event->motion.is_hint = FALSE;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_crossing_event (GdkWindow *window, GdkEventType type, gdouble x, gdouble y)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (type);
|
||||
event->crossing.x = x;
|
||||
event->crossing.y = y;
|
||||
event->crossing.mode = GDK_CROSSING_NORMAL;
|
||||
event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
||||
event->crossing.focus = TRUE;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_focus_event (GdkWindow *window, gboolean focused)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
if (focused)
|
||||
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED);
|
||||
else
|
||||
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
|
||||
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->focus_change.send_event = FALSE;
|
||||
event->focus_change.in = focused;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static guint
|
||||
get_modifier_state (unsigned int modifiers, unsigned int button_state)
|
||||
{
|
||||
guint modifier_state = 0;
|
||||
|
||||
if ((modifiers & mir_key_modifier_alt) != 0)
|
||||
modifier_state |= GDK_MOD1_MASK;
|
||||
if ((modifiers & mir_key_modifier_shift) != 0)
|
||||
modifier_state |= GDK_SHIFT_MASK;
|
||||
if ((modifiers & mir_key_modifier_ctrl) != 0)
|
||||
modifier_state |= GDK_CONTROL_MASK;
|
||||
if ((modifiers & mir_key_modifier_meta) != 0)
|
||||
modifier_state |= GDK_SUPER_MASK;
|
||||
if ((modifiers & mir_key_modifier_caps_lock) != 0)
|
||||
modifier_state |= GDK_LOCK_MASK;
|
||||
if ((button_state & mir_motion_button_primary) != 0)
|
||||
modifier_state |= GDK_BUTTON1_MASK;
|
||||
if ((button_state & mir_motion_button_secondary) != 0)
|
||||
modifier_state |= GDK_BUTTON3_MASK;
|
||||
if ((button_state & mir_motion_button_tertiary) != 0)
|
||||
modifier_state |= GDK_BUTTON2_MASK;
|
||||
|
||||
return modifier_state;
|
||||
}
|
||||
|
||||
/*
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (event_data->window->impl);
|
||||
MirMotionButton changed_button_state;
|
||||
GdkEventType event_type;
|
||||
gdouble x, y;
|
||||
guint modifier_state;
|
||||
gboolean is_modifier = FALSE;
|
||||
*/
|
||||
|
||||
static void
|
||||
handle_key_event (GdkWindow *window, const MirKeyEvent *event)
|
||||
{
|
||||
guint modifier_state;
|
||||
gboolean is_modifier = FALSE;
|
||||
|
||||
modifier_state = get_modifier_state (event->modifiers, 0); // FIXME: Need to track button state
|
||||
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_key_action_down:
|
||||
case mir_key_action_up:
|
||||
// FIXME: Convert keycode
|
||||
// FIXME: is_modifier
|
||||
generate_key_event (window,
|
||||
event->action == mir_key_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
|
||||
modifier_state,
|
||||
event->key_code,
|
||||
event->scan_code,
|
||||
is_modifier);
|
||||
break;
|
||||
default:
|
||||
//case mir_key_action_multiple:
|
||||
// FIXME
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
gdouble x, y;
|
||||
gboolean cursor_inside;
|
||||
MirMotionButton button_state;
|
||||
guint modifier_state;
|
||||
GdkEventType event_type;
|
||||
MirMotionButton changed_button_state;
|
||||
|
||||
_gdk_mir_window_impl_get_cursor_state (impl, &x, &y, &cursor_inside, &button_state);
|
||||
if (event->pointer_count > 0)
|
||||
{
|
||||
x = event->pointer_coordinates[0].x;
|
||||
y = event->pointer_coordinates[0].y;
|
||||
}
|
||||
modifier_state = get_modifier_state (event->modifiers, event->button_state);
|
||||
|
||||
/* The Mir events generate hover-exits even while inside the window so
|
||||
counteract this by always generating an enter notify on all other events */
|
||||
if (!cursor_inside && event->action != mir_motion_action_hover_exit)
|
||||
{
|
||||
cursor_inside = TRUE;
|
||||
generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y);
|
||||
}
|
||||
|
||||
/* Update which window has focus */
|
||||
_gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
|
||||
switch (event->action)
|
||||
{
|
||||
case mir_motion_action_down:
|
||||
case mir_motion_action_up:
|
||||
event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
|
||||
changed_button_state = button_state ^ event->button_state;
|
||||
if ((changed_button_state & mir_motion_button_primary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state);
|
||||
if ((changed_button_state & mir_motion_button_secondary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state);
|
||||
if ((changed_button_state & mir_motion_button_tertiary) != 0)
|
||||
generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state);
|
||||
button_state = event->button_state;
|
||||
break;
|
||||
case mir_motion_action_scroll:
|
||||
generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state);
|
||||
break;
|
||||
case mir_motion_action_move: // move with button
|
||||
case mir_motion_action_hover_move: // move without button
|
||||
generate_motion_event (window, x, y, modifier_state);
|
||||
break;
|
||||
case mir_motion_action_hover_exit:
|
||||
cursor_inside = FALSE;
|
||||
generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y);
|
||||
break;
|
||||
}
|
||||
|
||||
_gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_surface_event (GdkWindow *window, const MirSurfaceEvent *event)
|
||||
{
|
||||
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
|
||||
|
||||
switch (event->attrib)
|
||||
{
|
||||
case mir_surface_attrib_type:
|
||||
break;
|
||||
case mir_surface_attrib_state:
|
||||
_gdk_mir_window_impl_set_surface_state (impl, event->value);
|
||||
// FIXME: notify
|
||||
break;
|
||||
case mir_surface_attrib_swapinterval:
|
||||
break;
|
||||
case mir_surface_attrib_focus:
|
||||
generate_focus_event (window, event->value != 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
generate_configure_event (GdkWindow *window,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->configure.send_event = FALSE;
|
||||
event->configure.width = width;
|
||||
event->configure.height = height;
|
||||
|
||||
send_event (window, get_pointer (window), event);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_resize_event (GdkWindow *window,
|
||||
const MirResizeEvent *event)
|
||||
{
|
||||
window->width = event->width;
|
||||
window->height = event->height;
|
||||
_gdk_window_update_size (window);
|
||||
|
||||
generate_configure_event (window, event->width, event->height);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWindow *window;
|
||||
MirEvent event;
|
||||
} EventData;
|
||||
|
||||
static void
|
||||
gdk_mir_event_source_queue_event (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
const MirEvent *event)
|
||||
{
|
||||
if (g_getenv ("GDK_MIR_LOG_EVENTS"))
|
||||
_gdk_mir_print_event (event);
|
||||
|
||||
// FIXME: Only generate events if the window wanted them?
|
||||
switch (event->type)
|
||||
{
|
||||
case mir_event_type_key:
|
||||
handle_key_event (window, &event->key);
|
||||
break;
|
||||
case mir_event_type_motion:
|
||||
handle_motion_event (window, &event->motion);
|
||||
break;
|
||||
case mir_event_type_surface:
|
||||
handle_surface_event (window, &event->surface);
|
||||
break;
|
||||
case mir_event_type_resize:
|
||||
handle_resize_event (window, &event->resize);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
// FIXME?
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static GdkMirQueuedEvent *
|
||||
gdk_mir_event_source_take_queued_event (GdkMirEventSource *source)
|
||||
{
|
||||
GdkMirQueuedEvent *queued_event;
|
||||
|
||||
g_mutex_lock (&source->mir_event_lock);
|
||||
queued_event = g_queue_pop_head (&source->mir_events);
|
||||
g_mutex_unlock (&source->mir_event_lock);
|
||||
|
||||
return queued_event;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_queued_event_free (GdkMirQueuedEvent *event)
|
||||
{
|
||||
_gdk_mir_window_reference_unref (event->window_ref);
|
||||
g_slice_free (GdkMirQueuedEvent, event);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_event_source_convert_events (GdkMirEventSource *source)
|
||||
{
|
||||
GdkMirQueuedEvent *event;
|
||||
|
||||
while ((event = gdk_mir_event_source_take_queued_event (source)))
|
||||
{
|
||||
GdkWindow *window = event->window_ref->window;
|
||||
|
||||
/* The window may have been destroyed in the main thread while the
|
||||
* event was being dispatched...
|
||||
*/
|
||||
if (window != NULL)
|
||||
gdk_mir_event_source_queue_event (source->display, window, &event->event);
|
||||
else
|
||||
g_warning ("window was destroyed before event arrived...");
|
||||
|
||||
gdk_mir_queued_event_free (event);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_event_source_prepare (GSource *g_source,
|
||||
gint *timeout)
|
||||
{
|
||||
GdkMirEventSource *source = (GdkMirEventSource *) g_source;
|
||||
gboolean mir_events_in_queue;
|
||||
|
||||
if (_gdk_event_queue_find_first (source->display))
|
||||
return TRUE;
|
||||
|
||||
g_mutex_lock (&source->mir_event_lock);
|
||||
mir_events_in_queue = g_queue_get_length (&source->mir_events) > 0;
|
||||
g_mutex_unlock (&source->mir_event_lock);
|
||||
|
||||
return mir_events_in_queue;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_event_source_check (GSource *g_source)
|
||||
{
|
||||
return gdk_mir_event_source_prepare (g_source, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_event_source_dispatch (GSource *g_source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GdkMirEventSource *source = (GdkMirEventSource *) g_source;
|
||||
GdkEvent *event;
|
||||
|
||||
/* First, run the queue of events from the thread */
|
||||
gdk_mir_event_source_convert_events (source);
|
||||
|
||||
/* Next, dispatch one single event from the display's queue.
|
||||
*
|
||||
* If there is more than one event then we will soon find ourselves
|
||||
* back here again.
|
||||
*/
|
||||
|
||||
gdk_threads_enter ();
|
||||
|
||||
event = gdk_display_get_event (source->display);
|
||||
|
||||
if (event)
|
||||
{
|
||||
_gdk_event_emit (event);
|
||||
|
||||
gdk_event_free (event);
|
||||
}
|
||||
|
||||
gdk_threads_leave ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_event_source_finalize (GSource *g_source)
|
||||
{
|
||||
GdkMirEventSource *source = (GdkMirEventSource *) g_source;
|
||||
GdkMirQueuedEvent *event;
|
||||
|
||||
while ((event = gdk_mir_event_source_take_queued_event (source)))
|
||||
gdk_mir_queued_event_free (event);
|
||||
|
||||
g_mutex_clear (&source->mir_event_lock);
|
||||
}
|
||||
|
||||
static GSourceFuncs gdk_mir_event_source_funcs = {
|
||||
gdk_mir_event_source_prepare,
|
||||
gdk_mir_event_source_check,
|
||||
gdk_mir_event_source_dispatch,
|
||||
gdk_mir_event_source_finalize
|
||||
};
|
||||
|
||||
GdkMirEventSource *
|
||||
_gdk_mir_event_source_new (GdkDisplay *display)
|
||||
{
|
||||
GdkMirEventSource *source;
|
||||
GSource *g_source;
|
||||
|
||||
g_source = g_source_new (&gdk_mir_event_source_funcs, sizeof (GdkMirEventSource));
|
||||
g_source_attach (g_source, NULL);
|
||||
|
||||
source = (GdkMirEventSource *) g_source;
|
||||
g_mutex_init (&source->mir_event_lock);
|
||||
source->display = display;
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
GdkMirWindowReference *
|
||||
_gdk_mir_event_source_get_window_reference (GdkWindow *window)
|
||||
{
|
||||
static GQuark win_ref_quark;
|
||||
GdkMirWindowReference *ref;
|
||||
|
||||
if G_UNLIKELY (!win_ref_quark)
|
||||
win_ref_quark = g_quark_from_string ("GdkMirEventSource window reference");
|
||||
|
||||
ref = g_object_get_qdata (G_OBJECT (window), win_ref_quark);
|
||||
|
||||
if (!ref)
|
||||
{
|
||||
GdkMirEventSource *source;
|
||||
|
||||
source = _gdk_mir_display_get_event_source (gdk_window_get_display (window));
|
||||
g_source_ref ((GSource *) source);
|
||||
|
||||
ref = g_slice_new (GdkMirWindowReference);
|
||||
ref->window = window;
|
||||
ref->source = source;
|
||||
ref->ref_count = 0;
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *) &ref->window);
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (window), win_ref_quark,
|
||||
ref, (GDestroyNotify) _gdk_mir_window_reference_unref);
|
||||
}
|
||||
|
||||
g_atomic_int_inc (&ref->ref_count);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_window_reference_unref (GdkMirWindowReference *ref)
|
||||
{
|
||||
if (g_atomic_int_dec_and_test (&ref->ref_count))
|
||||
{
|
||||
if (ref->window)
|
||||
g_object_remove_weak_pointer (G_OBJECT (ref->window), (gpointer *) &ref->window);
|
||||
|
||||
g_source_unref ((GSource *) ref->source);
|
||||
|
||||
g_slice_free (GdkMirWindowReference, ref);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_mir_event_source_queue (GdkMirWindowReference *window_ref,
|
||||
const MirEvent *event)
|
||||
{
|
||||
GdkMirEventSource *source = window_ref->source;
|
||||
GdkMirQueuedEvent *queued_event;
|
||||
|
||||
/* We are in the wrong thread right now. We absolutely cannot touch
|
||||
* the window.
|
||||
*
|
||||
* We can do pretty much anything we want with the source, though...
|
||||
*/
|
||||
|
||||
queued_event = g_slice_new (GdkMirQueuedEvent);
|
||||
g_atomic_int_inc (&window_ref->ref_count);
|
||||
queued_event->window_ref = window_ref;
|
||||
queued_event->event = *event;
|
||||
|
||||
g_mutex_lock (&source->mir_event_lock);
|
||||
g_queue_push_tail (&source->mir_events, queued_event);
|
||||
g_mutex_unlock (&source->mir_event_lock);
|
||||
|
||||
g_main_context_wakeup (NULL);
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* 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 "gdkdeviceprivate.h"
|
||||
|
||||
typedef struct GdkMirKeyboard GdkMirKeyboard;
|
||||
typedef struct GdkMirKeyboardClass GdkMirKeyboardClass;
|
||||
|
||||
#define GDK_TYPE_MIR_KEYBOARD (gdk_mir_keyboard_get_type ())
|
||||
#define GDK_MIR_KEYBOARD(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_MIR_KEYBOARD, GdkMirKeyboard))
|
||||
#define GDK_MIR_KEYBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_MIR_KEYBOARD, GdkMirKeyboardClass))
|
||||
#define GDK_IS_MIR_KEYBOARD(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_KEYBOARD))
|
||||
#define GDK_IS_MIR_KEYBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_MIR_KEYBOARD))
|
||||
#define GDK_MIR_KEYBOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_MIR_KEYBOARD, GdkMirKeyboardClass))
|
||||
|
||||
struct GdkMirKeyboard
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
};
|
||||
|
||||
struct GdkMirKeyboardClass
|
||||
{
|
||||
GdkDeviceClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkMirKeyboard, gdk_mir_keyboard, GDK_TYPE_DEVICE)
|
||||
|
||||
GdkDevice *
|
||||
_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_MIR_KEYBOARD,
|
||||
"display", gdk_device_manager_get_display (device_manager),
|
||||
"device-manager", device_manager,
|
||||
"name", name,
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
"input-source", GDK_SOURCE_KEYBOARD,
|
||||
"input-mode", GDK_MODE_SCREEN,
|
||||
"has-cursor", FALSE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_keyboard_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events)
|
||||
{
|
||||
g_printerr ("gdk_mir_keyboard_get_history\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
g_printerr ("gdk_mir_keyboard_get_state\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
//g_printerr ("gdk_mir_keyboard_set_window_cursor\n");
|
||||
/* Keyboards don't have cursors... */
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
//g_printerr ("gdk_mir_keyboard_warp\n");
|
||||
/* Can't warp a keyboard... */
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
gdouble *root_x,
|
||||
gdouble *root_y,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
g_printerr ("gdk_mir_keyboard_query_state\n");
|
||||
}
|
||||
|
||||
static GdkGrabStatus
|
||||
gdk_mir_keyboard_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_)
|
||||
{
|
||||
//g_printerr ("gdk_mir_keyboard_grab\n");
|
||||
/* Mir doesn't do grabs, so sure, you have the grab */
|
||||
return GDK_GRAB_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
//g_printerr ("gdk_mir_keyboard_ungrab\n");
|
||||
/* Mir doesn't do grabs */
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_mir_keyboard_window_at_position (GdkDevice *device,
|
||||
gdouble *win_x,
|
||||
gdouble *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel)
|
||||
{
|
||||
//g_printerr ("gdk_mir_keyboard_window_at_position (%f, %f)\n", *win_x, *win_y);
|
||||
/* Keyboard don't have locations... */
|
||||
return NULL; // FIXME: Or the window with the keyboard focus?
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
g_printerr ("gdk_mir_keyboard_select_window_events\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_init (GdkMirKeyboard *device)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_keyboard_class_init (GdkMirKeyboardClass *klass)
|
||||
{
|
||||
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
|
||||
|
||||
device_class->get_history = gdk_mir_keyboard_get_history;
|
||||
device_class->get_state = gdk_mir_keyboard_get_state;
|
||||
device_class->set_window_cursor = gdk_mir_keyboard_set_window_cursor;
|
||||
device_class->warp = gdk_mir_keyboard_warp;
|
||||
device_class->query_state = gdk_mir_keyboard_query_state;
|
||||
device_class->grab = gdk_mir_keyboard_grab;
|
||||
device_class->ungrab = gdk_mir_keyboard_ungrab;
|
||||
device_class->window_at_position = gdk_mir_keyboard_window_at_position;
|
||||
device_class->select_window_events = gdk_mir_keyboard_select_window_events;
|
||||
}
|
||||