Compare commits
160 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07f8ecd4cf | ||
|
|
1cfbf16617 | ||
|
|
ff669c6b12 | ||
|
|
866c9a498d | ||
|
|
87c5c662c0 | ||
|
|
d6b4bd0967 | ||
|
|
023fbb91d6 | ||
|
|
623f3e00e4 | ||
|
|
1d17891eaa | ||
|
|
292a9b4a02 | ||
|
|
812109cc3f | ||
|
|
4621142e0c | ||
|
|
28c39fb0f8 | ||
|
|
c68490ee17 | ||
|
|
7833835930 | ||
|
|
1a1c1091da | ||
|
|
7e21425228 | ||
|
|
e65112aaef | ||
|
|
7d066258f3 | ||
|
|
527d262804 | ||
|
|
b8a154ad69 | ||
|
|
bd893461b0 | ||
|
|
63d0cf2a83 | ||
|
|
2f5adb1f76 | ||
|
|
40aadf8502 | ||
|
|
10319e1f3d | ||
|
|
b4ec98dbec | ||
|
|
ab5a8e6bb9 | ||
|
|
af3efad099 | ||
|
|
4d1fdfeb10 | ||
|
|
2749b473ce | ||
|
|
8d6b5ece9f | ||
|
|
98b961a1d6 | ||
|
|
7c213fa980 | ||
|
|
8a2bf9f853 | ||
|
|
047dd914a3 | ||
|
|
e3ce367e18 | ||
|
|
9cab6be752 | ||
|
|
3a683e46e7 | ||
|
|
3617c3bd15 | ||
|
|
0b8f666e02 | ||
|
|
a329677311 | ||
|
|
f935432ac5 | ||
|
|
d7bff60140 | ||
|
|
55174e3f62 | ||
|
|
1977ad5bb7 | ||
|
|
695ff3882b | ||
|
|
e9c4313337 | ||
|
|
0ddb4fd989 | ||
|
|
02bae1885b | ||
|
|
81f94245ba | ||
|
|
7acbd5fd24 | ||
|
|
c01578284d | ||
|
|
8055a37230 | ||
|
|
5e7630c1ee | ||
|
|
637ef1df38 | ||
|
|
ed0e7f61af | ||
|
|
830a72b307 | ||
|
|
7d3991f275 | ||
|
|
fe6b3e552e | ||
|
|
9e96e13d28 | ||
|
|
752170e8d6 | ||
|
|
8336d56af9 | ||
|
|
59769a0046 | ||
|
|
7c804dbf21 | ||
|
|
84d6b0f35c | ||
|
|
ccdcc8a1ec | ||
|
|
ca26f696c6 | ||
|
|
4a25c48a01 | ||
|
|
5d9d1f161b | ||
|
|
01dd0eb4c2 | ||
|
|
0b883daf15 | ||
|
|
ad6de7637b | ||
|
|
79e7934eb3 | ||
|
|
ea8a281543 | ||
|
|
cd443f34c7 | ||
|
|
210c3d0129 | ||
|
|
8f1c6e3717 | ||
|
|
989330a9fd | ||
|
|
5930c55d42 | ||
|
|
4f9f52c513 | ||
|
|
cd6caea94c | ||
|
|
5291d0870b | ||
|
|
78bb68685b | ||
|
|
baf2b5c57b | ||
|
|
94b471aaed | ||
|
|
5ce6756f96 | ||
|
|
63076ad085 | ||
|
|
21e5031103 | ||
|
|
7abd5a5636 | ||
|
|
c4fe388255 | ||
|
|
06842a2dc5 | ||
|
|
30a1c4ab35 | ||
|
|
973b52e8cf | ||
|
|
c25e8cefae | ||
|
|
627c285b4c | ||
|
|
36bc6c82f9 | ||
|
|
1670ba1d51 | ||
|
|
adfb60dff7 | ||
|
|
ffc4111fea | ||
|
|
8710a14d34 | ||
|
|
654c989f22 | ||
|
|
1515a5a8f9 | ||
|
|
9c1ecdf112 | ||
|
|
b261ca7ec2 | ||
|
|
4e569765be | ||
|
|
d840504741 | ||
|
|
b1345c0218 | ||
|
|
e119422927 | ||
|
|
9a24f8295b | ||
|
|
a9ebdd3aa8 | ||
|
|
6e42eb1224 | ||
|
|
57121ffe2c | ||
|
|
69fd4348a8 | ||
|
|
590ed447e8 | ||
|
|
3b2466b1ac | ||
|
|
5d4d144103 | ||
|
|
7ca79b2ca5 | ||
|
|
693b568b99 | ||
|
|
8247e44874 | ||
|
|
231cac4f78 | ||
|
|
597aa8b74d | ||
|
|
3eba66d11d | ||
|
|
cc953409d5 | ||
|
|
8aece58e2b | ||
|
|
85f1c1f8bc | ||
|
|
d94f9e5680 | ||
|
|
cb670543bc | ||
|
|
7f406f2db1 | ||
|
|
ea205f75d2 | ||
|
|
951b59ffbe | ||
|
|
590955dcce | ||
|
|
8b83ec9b59 | ||
|
|
700b3e7d8a | ||
|
|
a0b2cf402f | ||
|
|
d46a271112 | ||
|
|
846c91c66d | ||
|
|
05d7be8a54 | ||
|
|
0851a16d90 | ||
|
|
ee25d35cd0 | ||
|
|
666f7d35e4 | ||
|
|
0891ff83b6 | ||
|
|
90c639fe46 | ||
|
|
d65b8e6ff1 | ||
|
|
c5e39fd4c1 | ||
|
|
928a51533f | ||
|
|
cfb51ddb4a | ||
|
|
7599f1804c | ||
|
|
4fc47c800d | ||
|
|
19e8357471 | ||
|
|
4de087262e | ||
|
|
2c9c2f704c | ||
|
|
84f5091459 | ||
|
|
2ce384cc5a | ||
|
|
94592be5bc | ||
|
|
d763169bb5 | ||
|
|
3ae6d33667 | ||
|
|
73f386169c | ||
|
|
deed16b151 | ||
|
|
e2355b55e4 |
@@ -9,13 +9,9 @@ GTK+ requires the following packages:
|
||||
GdkPixbuf @GDK_PIXBUF_REQUIRED_VERSION@, ATK @ATK_REQUIRED_VERSION@
|
||||
and cairo @CAIRO_REQUIRED_VERSION@.
|
||||
|
||||
- libepoxy, for cross-platform OpenGL support.
|
||||
It can be found here: https://github.com/anholt/libepoxy
|
||||
|
||||
- Each GDK backend has its own backend-specific requirements. For
|
||||
the X11 backend, X11 R6 and XInput version 2 (as well as a number
|
||||
of other extensions) are required. The Wayland backend requires
|
||||
(obviously) the Wayland libraries.
|
||||
of other extensions) are required.
|
||||
|
||||
- gobject-introspection @INTROSPECTION_REQUIRED_VERSION@ or newer.
|
||||
|
||||
|
||||
@@ -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+-mir-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+-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-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-3.0.pc
|
||||
rm -f $@ && \
|
||||
cp gdk-3.0.pc $@
|
||||
|
||||
@@ -59,14 +59,12 @@ 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
|
||||
|
||||
|
||||
219
NEWS
219
NEWS
@@ -1,140 +1,125 @@
|
||||
Overview of Changes in GTK+ 3.15.1
|
||||
==================================
|
||||
|
||||
* An experimental mir backend has been added.
|
||||
Use --enable-mir-backend to build it.
|
||||
|
||||
* Inspector:
|
||||
- Show more information
|
||||
- Use a separate display connection
|
||||
|
||||
* Deprecations:
|
||||
- GtkStyleProperties
|
||||
Overview of Changes in GTK+ 3.14.5 to 3.14.6
|
||||
============================================
|
||||
|
||||
* Bugs fixed:
|
||||
707695 GtkLevelBar Colour CSS
|
||||
737561 quartz: gtk+ 3.14.0 fails to build on 10.6.8, 'NSFullScreen...
|
||||
738650 fix separator with iconic section and more
|
||||
738886 Out of bounds access in MyEnhancedXkbTranslateKeyCode
|
||||
738955 Client-side decoration window menus appear at wrong positio...
|
||||
738982 Add support for ATK_STATE_HAS_TOOLTIP
|
||||
739001 Fix Build of broadwayd on Visual Studio
|
||||
739005 gtkstatusicon.c won't build with both X11 and Quartz backen...
|
||||
739111 GtkFontChooserDialog fixes
|
||||
739150 Dragging bookmark crashes nautilus
|
||||
364566 Text editing widgets should support keypad Insert/Delete...
|
||||
461249 gtk_icon_theme_list_contexts() documentation: What is a ...
|
||||
721939 Editable cells demo: Add new row at cursor
|
||||
722781 Foreach call on sort model fails with sort function
|
||||
730232 print dialog clips off left page size label on A4 landsc...
|
||||
739453 Home and Desktop do not link to correct place in PlacesS...
|
||||
739885 gtk3-3.14.5 - fail to link - undefined reference to `GTK...
|
||||
739977 Don't wait for ENTER to initiate search
|
||||
740287 GtkWindow's hide-titlebar-when-maximized no longer does ...
|
||||
740374 Is enum GtkCssProviderError really deprecated?
|
||||
740612 Cups secret service auth_info lookup fails to read auth_...
|
||||
740613 XConvertSelection crashes Gtk+ apps
|
||||
740642 Fix different height for buttons with Hebrew character
|
||||
740742 Don't scale before translation
|
||||
740770 Missing style when the GtkCellRenderer:sensitive propert...
|
||||
740896 GtkPlacesSidebar: add support for unmount notifications
|
||||
741249 gtk_menu_tracker_section_find_model returns FALSE
|
||||
741250 gtk_places_sidebar_list_shortcuts returns FALSE
|
||||
741251 gtk_widget_get_frame_clock returns 0
|
||||
741252 tests/variable.h header guard typo
|
||||
741254 Improper headers guards
|
||||
741314 Adwaita: draw drag hilight on treeview rows
|
||||
Redraw problems with cairo 1.14
|
||||
Avoid excessive redraws due to CSD shadows
|
||||
|
||||
Translation updates:
|
||||
* Translation updates:
|
||||
Greek
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.14.4 to 3.14.5
|
||||
============================================
|
||||
|
||||
* Bugs fixed:
|
||||
726316 Backdrop inconvenient on multimonitor for reading text
|
||||
737561 quartz: gtk+ 3.14.0 fails to build on 10.6.8, 'NSFullScreen...
|
||||
737891 mounting LUKS partition from nautilus takes very long
|
||||
738321 GtkMenu has unnecessary scroll buttons
|
||||
738648 gdk_window_get_content() causes creation/destruction of bac...
|
||||
738650 fix separator with iconic section and more
|
||||
738886 Out of bounds access in MyEnhancedXkbTranslateKeyCode`
|
||||
738955 Client-side decoration window menus appear at wrong positio...
|
||||
739005 gtkstatusicon.c won't build with both X11 and Quartz backen...
|
||||
739111 GtkFontChooserDialog fixes
|
||||
|
||||
* Translation updates:
|
||||
Czech
|
||||
German
|
||||
Hungarian
|
||||
Lithuanian
|
||||
Serbian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.14.3 to 3.14.4
|
||||
============================================
|
||||
|
||||
* Bugs fixed:
|
||||
730893 Dialogs use headerbars even when DialogsUseHeader is unset
|
||||
737986 Transparent icon background rendered black on XFCE
|
||||
738636 GtkStackSwitcher focus overlap border
|
||||
738873 wayland backend aborts [...] if XDG_RUNTIME_DIR unset
|
||||
Only allow one center widget in boxes
|
||||
Memory leak fixes
|
||||
|
||||
* Translation updates
|
||||
Brazilian Portuguese
|
||||
Indonesian
|
||||
Kazakh
|
||||
Norwegian bokmål
|
||||
Polish
|
||||
Slovak
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.0
|
||||
==================================
|
||||
|
||||
* GDK supports rendering windows using OpenGL; currently
|
||||
this is implemented for X11 and Wayland using libepoxy
|
||||
|
||||
* GtkGLArea: A new widget for rendering with OpenGL
|
||||
|
||||
* GtkSidebar: A new switcher for GtkStack that looks like
|
||||
a sidebar
|
||||
|
||||
* Better typography: In many places, we now use proper Unicode
|
||||
characters for dashes, quotes, multiplication signs and the
|
||||
like, instead of ASCII approximations
|
||||
|
||||
* Theming:
|
||||
- Context menus use the default font instead of inheriting from
|
||||
the widget they are attached to
|
||||
- Theming engines are no longer used
|
||||
- Backdrop style has been fine-tuned to make the difference to
|
||||
the active window more evident without affecting readability
|
||||
|
||||
* Inspector:
|
||||
- Show nested tree models
|
||||
- Add a checkbox to disable the warning dialog
|
||||
- Rearrange the UI to gain space
|
||||
- Show object counts
|
||||
|
||||
* GtkTextView has a monospace property
|
||||
|
||||
* GtkPaned has a wide-handle property
|
||||
|
||||
* GtkPrintUnixDialog
|
||||
- Has improved appearance without headerbars
|
||||
- Better rendering of sheet icons
|
||||
- No more missing icons
|
||||
|
||||
* GtkScrolledWindow
|
||||
- A new policy, GTK_POLICY_EXTERNAL, which allows scrolling
|
||||
without showing a scrollbar
|
||||
- Scroll events can now overshoot as well
|
||||
- The new signal ::edge-overshot is emitted when the scrolled
|
||||
window is fully overshot
|
||||
- Scrollbars will be overlayed as narrow indicators when
|
||||
there is no mouse
|
||||
|
||||
* Deprecations:
|
||||
- gdk_window_set_static_gravities
|
||||
- gdk_window_set_composited
|
||||
- gtk_style_context_get_background_color
|
||||
- gtk_style_context_get_border_color
|
||||
- gtk_settings_set_string/long/double_property
|
||||
- gtk_settings_install_property
|
||||
Overview of Changes in GTK+ 3.14.2 to 3.14.3
|
||||
============================================
|
||||
|
||||
* Bugs fixed:
|
||||
119189 Add OpenGL support to GTK+
|
||||
154709 don't use the cursor for preview
|
||||
582799 GtkContainer should parse a list of widgets for a focus chain
|
||||
671138 About dialog contains scary warranty disclaimer in copyright...
|
||||
672946 Add gtk_css_provider_load_resource_from_file
|
||||
681185 Document precedence between tooltip-markup and tooltip-text
|
||||
724096 search-bar: don't show the widget until we're ready to reveal
|
||||
725441 Print Dialog: Add support for PPD-less printing on IPP print...
|
||||
730730 scrolling is broken when sharing adjustments
|
||||
730893 Dialogs use headerbars even when DialogsUseHeader is unset
|
||||
733157 Remove redundant checks for NULL
|
||||
735192 Use better typography for paper names
|
||||
735293 No vertical stack switcher component available (Sidebar)
|
||||
735841 EmptyBoxes: instructions_label's alignment is off
|
||||
737670 GtkCalendar days cannot be selected if vertical size is grea...
|
||||
737679 Bookmarks are visually duplicated in sidebar
|
||||
737777 Applications crash randomly while printing with a password-s...
|
||||
737929 Long tooltips extend too far horizontally without wrapping
|
||||
737952 Documentation missing for GtkTextView's new draw-layer funct...
|
||||
737981 Strange frame in GtkScrolledWindow
|
||||
737983 gtkplacessidebar: Open $HOME after unmounting or ejecting
|
||||
737985 Unnecessary "GtkScrolledWindow .frame"
|
||||
737986 Transparent icon background rendered black on XFCE
|
||||
738083 GtkMenuButton is not disabled even if corresponding GAction is
|
||||
738111 GtkListBox should allow for setting "placeholder" via GtkBui...
|
||||
738158 Flat context menu button
|
||||
738272 inspector: Add a tab for object counts
|
||||
738533 Show overshoot on scroll events
|
||||
738534 Add ::edge-hit signal
|
||||
738591 Can't select file after showing header context menu
|
||||
738636 GtkStackSwitcher focus overlap border
|
||||
738670 GL Context on NVIDIA
|
||||
738860 GtkPaned: Add a "wide-handle" property
|
||||
738873 wayland backend aborts entire program if XDG_RUNTIME_DIR unset
|
||||
738912 wayland: Don't try to create a subsurface again
|
||||
738158 Flat context menu button
|
||||
|
||||
* Translation updates
|
||||
* Translation updates:
|
||||
Italian
|
||||
Persian
|
||||
Serbian
|
||||
Slovak
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.14.1 to 3.14.2
|
||||
============================================
|
||||
|
||||
* GtkInspector now shows nested tree models
|
||||
|
||||
* Bugs fixed:
|
||||
737670 GtkCalendar days cannot be selected if vertical size is greater...
|
||||
737679 Bookmarks are visually duplicated in sidebar
|
||||
737952 Documentation missing for GtkTextView's new draw-layer function...
|
||||
737929 Long tooltips extend too far horizontally without wrapping
|
||||
737777 printing: Properly initialize auth_info in gtkprintbackend.c
|
||||
Teach GtkExpander:resize-toplevel about height-for-width
|
||||
Fix setting GtkRadioButton:group from .ui files
|
||||
Improve sheet drawing in the print dialog
|
||||
Avoid missing icons in the print dialog
|
||||
GtkStackSwitcher: Fix initially active button
|
||||
|
||||
* Translation updates:
|
||||
Assamese
|
||||
Brazilian Portuguese
|
||||
Czech
|
||||
French
|
||||
German
|
||||
Hebrew
|
||||
Indonesian
|
||||
Italian
|
||||
Kazakh
|
||||
Korean
|
||||
Persian
|
||||
Polish
|
||||
Scottish Gaelic
|
||||
Spanish
|
||||
|
||||
Lithuanian
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.14.0 to 3.14.1
|
||||
============================================
|
||||
|
||||
14
README.in
14
README.in
@@ -73,12 +73,6 @@ Patches should be in unified diff form. (The -up option to GNU diff)
|
||||
Even better are git-formatted patches. (Use git format-patch)
|
||||
|
||||
|
||||
Release notes for 3.16
|
||||
======================
|
||||
|
||||
* GTK+ now includes an OpenGL rendering widget. To support GL on various
|
||||
platforms, GTK+ uses libepoxy.
|
||||
|
||||
Release notes for 3.14
|
||||
======================
|
||||
|
||||
@@ -105,14 +99,6 @@ Release notes for 3.14
|
||||
to be problematic. This combination is using code paths in cairo and
|
||||
graphics drivers which are rarely tested and likely buggy.
|
||||
|
||||
* GtkTextView is now using a pixel-cache internally, and is drawing
|
||||
a background underneath the text. This can cause problems for applications
|
||||
which assumed that they could draw things below and above the text
|
||||
by chaining up in the ::draw implementation of their GtkTextView subclass.
|
||||
As a short-term workaround, you can make the application apply a
|
||||
custom theme to the text view with a transparent background. For
|
||||
a proper fix, use the new ::draw_layer vfunc.
|
||||
|
||||
Release notes for 3.12
|
||||
======================
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -53,7 +53,6 @@ copy ..\..\..\gdk\gdkdisplaymanager.h $(CopyDir)\include\gtk-3.0\gdk\gdkdisplaym
|
||||
copy ..\..\..\gdk\gdkdnd.h $(CopyDir)\include\gtk-3.0\gdk\gdkdnd.h
|
||||
copy ..\..\..\gdk\gdkevents.h $(CopyDir)\include\gtk-3.0\gdk\gdkevents.h
|
||||
copy ..\..\..\gdk\gdkframetimings.h $(CopyDir)\include\gtk-3.0\gdk\gdkframetimings.h
|
||||
copy ..\..\..\gdk\gdkglcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkglcontext.h
|
||||
copy ..\..\..\gdk\gdkkeys.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeys.h
|
||||
copy ..\..\..\gdk\gdkkeysyms.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms.h
|
||||
copy ..\..\..\gdk\gdkkeysyms-compat.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms-compat.h
|
||||
@@ -173,7 +172,6 @@ copy ..\..\..\gtk\gtkgesturerotate.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturero
|
||||
copy ..\..\..\gtk\gtkgesturesingle.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturesingle.h
|
||||
copy ..\..\..\gtk\gtkgestureswipe.h $(CopyDir)\include\gtk-3.0\gtk\gtkgestureswipe.h
|
||||
copy ..\..\..\gtk\gtkgesturezoom.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturezoom.h
|
||||
copy ..\..\..\gtk\gtkglarea.h $(CopyDir)\include\gtk-3.0\gtk\gtkglarea.h
|
||||
copy ..\..\..\gtk\gtkgrid.h $(CopyDir)\include\gtk-3.0\gtk\gtkgrid.h
|
||||
copy ..\..\..\gtk\gtkheaderbar.h $(CopyDir)\include\gtk-3.0\gtk\gtkheaderbar.h
|
||||
copy ..\..\..\gtk\gtkicontheme.h $(CopyDir)\include\gtk-3.0\gtk\gtkicontheme.h
|
||||
@@ -228,7 +226,6 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecen
|
||||
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentchooserwidget.h
|
||||
copy ..\..\..\gtk\gtkrecentfilter.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentfilter.h
|
||||
copy ..\..\..\gtk\gtkrecentmanager.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentmanager.h
|
||||
copy ..\..\..\gtk\gtkrender.h $(CopyDir)\include\gtk-3.0\gtk\gtkrender.h
|
||||
copy ..\..\..\gtk\gtkrevealer.h $(CopyDir)\include\gtk-3.0\gtk\gtkrevealer.h
|
||||
copy ..\..\..\gtk\gtkscale.h $(CopyDir)\include\gtk-3.0\gtk\gtkscale.h
|
||||
copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-3.0\gtk\gtkscalebutton.h
|
||||
@@ -243,7 +240,6 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
|
||||
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h
|
||||
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h
|
||||
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h
|
||||
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h
|
||||
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h
|
||||
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h
|
||||
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.h
|
||||
|
||||
@@ -190,7 +190,6 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\event_axes.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\expander.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\gestures.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\glarea.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\headerbar.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\hypertext.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\iconview.c" />
|
||||
@@ -214,7 +213,6 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\rotated_text.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry2.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sidebar.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sizegroup.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\spinner.c" />
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\stack.c" />
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\event_axes.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\expander.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\gestures.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\glarea.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\headerbar.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\hypertext.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\iconview.c"><Filter>Source Files</Filter></ClCompile>
|
||||
@@ -56,7 +55,6 @@
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\rotated_text.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\search_entry2.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sidebar.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\sizegroup.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\spinner.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\gtk-demo\stack.c"><Filter>Source Files</Filter></ClCompile>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="gdk_pixbuf-2.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib epoxy.lib"
|
||||
AdditionalDependencies="gdk_pixbuf-2.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib"
|
||||
AdditionalLibraryDirectories="$(GlibEtcInstallRoot)\lib"
|
||||
/>
|
||||
<UserMacro
|
||||
|
||||
@@ -55,7 +55,6 @@ copy ..\..\..\gdk\gdkdisplaymanager.h $(CopyDir)\include\gtk-3.0\gdk\gdkdisplaym
|
||||
copy ..\..\..\gdk\gdkdnd.h $(CopyDir)\include\gtk-3.0\gdk\gdkdnd.h

|
||||
copy ..\..\..\gdk\gdkevents.h $(CopyDir)\include\gtk-3.0\gdk\gdkevents.h

|
||||
copy ..\..\..\gdk\gdkframetimings.h $(CopyDir)\include\gtk-3.0\gdk\gdkframetimings.h

|
||||
copy ..\..\..\gdk\gdkglcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkglcontext.h

|
||||
copy ..\..\..\gdk\gdkkeys.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeys.h

|
||||
copy ..\..\..\gdk\gdkkeysyms.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms.h

|
||||
copy ..\..\..\gdk\gdkkeysyms-compat.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms-compat.h

|
||||
@@ -175,7 +174,6 @@ copy ..\..\..\gtk\gtkgesturerotate.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturero
|
||||
copy ..\..\..\gtk\gtkgesturesingle.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturesingle.h

|
||||
copy ..\..\..\gtk\gtkgestureswipe.h $(CopyDir)\include\gtk-3.0\gtk\gtkgestureswipe.h

|
||||
copy ..\..\..\gtk\gtkgesturezoom.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturezoom.h

|
||||
copy ..\..\..\gtk\gtkglarea.h $(CopyDir)\include\gtk-3.0\gtk\gtkglarea.h

|
||||
copy ..\..\..\gtk\gtkgrid.h $(CopyDir)\include\gtk-3.0\gtk\gtkgrid.h

|
||||
copy ..\..\..\gtk\gtkheaderbar.h $(CopyDir)\include\gtk-3.0\gtk\gtkheaderbar.h

|
||||
copy ..\..\..\gtk\gtkicontheme.h $(CopyDir)\include\gtk-3.0\gtk\gtkicontheme.h

|
||||
@@ -230,7 +228,6 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecen
|
||||
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentchooserwidget.h

|
||||
copy ..\..\..\gtk\gtkrecentfilter.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentfilter.h

|
||||
copy ..\..\..\gtk\gtkrecentmanager.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentmanager.h

|
||||
copy ..\..\..\gtk\gtkrender.h $(CopyDir)\include\gtk-3.0\gtk\gtkrender.h

|
||||
copy ..\..\..\gtk\gtkrevealer.h $(CopyDir)\include\gtk-3.0\gtk\gtkrevealer.h

|
||||
copy ..\..\..\gtk\gtkscale.h $(CopyDir)\include\gtk-3.0\gtk\gtkscale.h

|
||||
copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-3.0\gtk\gtkscalebutton.h

|
||||
@@ -245,7 +242,6 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
|
||||
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h

|
||||
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h

|
||||
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h

|
||||
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h

|
||||
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h

|
||||
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h

|
||||
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.h

|
||||
|
||||
@@ -181,7 +181,6 @@
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\event_axes.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\expander.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\gestures.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\glarea.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\headerbar.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\hypertext.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\iconview.c" />
|
||||
@@ -205,7 +204,6 @@
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\rotated_text.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\search_entry.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\search_entry2.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\sidebar.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\sizegroup.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\spinner.c" />
|
||||
<File RelativePath="..\..\..\demos\gtk-demo\stack.c" />
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
|
||||
/* Define to 1 if you have the `cairo_surface_set_device_scale' function. */
|
||||
/* #undef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE */
|
||||
|
||||
/* define if we have colord */
|
||||
/* #undef HAVE_COLORD */
|
||||
|
||||
|
||||
90
configure.ac
90
configure.ac
@@ -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], [15])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_minor_version], [14])
|
||||
m4_define([gtk_micro_version], [6])
|
||||
m4_define([gtk_interface_age], [6])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -41,15 +41,13 @@ AC_CANONICAL_HOST
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.43.0])
|
||||
m4_define([glib_required_version], [2.41.2])
|
||||
m4_define([pango_required_version], [1.36.7])
|
||||
m4_define([atk_required_version], [2.15.1])
|
||||
m4_define([cairo_required_version], [1.14.0])
|
||||
m4_define([atk_required_version], [2.12.0])
|
||||
m4_define([cairo_required_version], [1.12.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.30.0])
|
||||
m4_define([introspection_required_version], [1.39.0])
|
||||
m4_define([wayland_required_version], [1.5.91])
|
||||
m4_define([mirclient_required_version], [0.9.0])
|
||||
m4_define([epoxy_required_version], [1.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
ATK_REQUIRED_VERSION=atk_required_version
|
||||
@@ -310,10 +308,6 @@ AC_ARG_ENABLE(xdamage,
|
||||
[AS_HELP_STRING([--enable-xdamage],
|
||||
[support X Damage extension [default=maybe]])],,
|
||||
[enable_xdamage="maybe"])
|
||||
AC_ARG_ENABLE(xpresent,
|
||||
[AS_HELP_STRING([--enable-xpresent],
|
||||
[support X Present extension [default=maybe]])],,
|
||||
[enable_xpresent="maybe"])
|
||||
|
||||
AC_ARG_ENABLE(x11-backend,
|
||||
[AS_HELP_STRING([--enable-x11-backend],
|
||||
@@ -335,10 +329,6 @@ 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
|
||||
@@ -346,7 +336,6 @@ if test -z "$backend_set"; then
|
||||
else
|
||||
enable_x11_backend=yes
|
||||
enable_wayland_backend=maybe
|
||||
enable_mir_backend=no
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -360,8 +349,7 @@ backend_immodules=
|
||||
have_gio_unix=no
|
||||
GDK_BACKENDS=
|
||||
GDK_EXTRA_LIBS=
|
||||
# expoxy.pc has Cflags: -I${includedir}, but pkg-config swallows that :-(
|
||||
GDK_EXTRA_CFLAGS="-I${prefix}/include"
|
||||
GDK_EXTRA_CFLAGS=
|
||||
GDK_WINDOWING=
|
||||
PANGO_PACKAGES="pango pangocairo"
|
||||
|
||||
@@ -438,7 +426,7 @@ fi
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl"
|
||||
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version"
|
||||
if test "$enable_wayland_backend" = "maybe" ; then
|
||||
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
|
||||
PKG_CHECK_EXISTS($WAYLAND_DEPENDENCIES, [have_wayland_deps=yes], [have_wayland_deps=no])
|
||||
@@ -469,30 +457,6 @@ else
|
||||
AM_CONDITIONAL(USE_WAYLAND, false)
|
||||
fi
|
||||
|
||||
MIR_DEPENDENCIES="mirclient >= mirclient_required_version"
|
||||
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#* }
|
||||
|
||||
@@ -1290,18 +1254,6 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$enable_xpresent" != xno; then
|
||||
if $PKG_CONFIG --exists xcb-present ; then
|
||||
AC_DEFINE(HAVE_PRESENT, 1, [Have the Present X extension])
|
||||
|
||||
X_PACKAGES="$X_PACKAGES xcb-present"
|
||||
X_EXTENSIONS="$X_EXTENSIONS Present"
|
||||
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcb-present"
|
||||
elif test x"$enable_xpresent" = xyes; then
|
||||
AC_MSG_ERROR([Present support requested but xcb-present not found])
|
||||
fi
|
||||
fi
|
||||
|
||||
if $have_base_x_pc ; then
|
||||
GDK_EXTRA_LIBS="$x_extra_libs"
|
||||
else
|
||||
@@ -1359,11 +1311,22 @@ else
|
||||
LIBS="$gtk_save_LIBS"
|
||||
fi
|
||||
|
||||
# Check for cairo_set_device_scale, as we don't want to depend hard on
|
||||
# this until there is a stable release with it
|
||||
CAIRO_CFLAGS=`$PKG_CONFIG --cflags cairo`
|
||||
CAIRO_LIBS=`$PKG_CONFIG --libs cairo`
|
||||
CFLAGS="$CFLAGS $CAIRO_CFLAGS"
|
||||
gtk_save_LIBS="$LIBS"
|
||||
LIBS="$CAIRO_LIBS $LIBS"
|
||||
AC_CHECK_FUNCS(cairo_surface_set_device_scale)
|
||||
LIBS="$gtk_save_LIBS"
|
||||
|
||||
|
||||
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 $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version"
|
||||
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $cairo_backends"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1400,7 +1363,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 $WAYLAND_PACKAGES $MIR_PACKAGES"
|
||||
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES"
|
||||
if test "x$enable_x11_backend" = xyes; then
|
||||
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1707,16 +1670,6 @@ if test "$have_colord" = "yes"; then
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
|
||||
|
||||
##################################################
|
||||
# Check for libcanberra (only used in examples)
|
||||
##################################################
|
||||
|
||||
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
|
||||
have_libcanberra=yes, have_libcanberra=no)
|
||||
if test "$have_libcanberra" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
|
||||
fi
|
||||
|
||||
##################################################
|
||||
# Checks for gtk-doc and docbook-tools
|
||||
##################################################
|
||||
@@ -1950,7 +1903,6 @@ 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
|
||||
|
||||
@@ -25,7 +25,6 @@ demos = \
|
||||
event_axes.c \
|
||||
expander.c \
|
||||
gestures.c \
|
||||
glarea.c \
|
||||
headerbar.c \
|
||||
hypertext.c \
|
||||
iconview.c \
|
||||
@@ -49,7 +48,6 @@ demos = \
|
||||
rotated_text.c \
|
||||
search_entry.c \
|
||||
search_entry2.c \
|
||||
sidebar.c \
|
||||
sizegroup.c \
|
||||
spinner.c \
|
||||
stack.c \
|
||||
@@ -75,7 +73,6 @@ LDADDS = \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(top_builddir)/gdk/libgdk-3.la \
|
||||
$(GTK_DEP_LIBS) \
|
||||
$(GDK_DEP_LIBS) \
|
||||
-lm
|
||||
|
||||
bin_PROGRAMS = gtk3-demo gtk3-demo-application
|
||||
|
||||
@@ -20,7 +20,12 @@ draw_callback (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
{
|
||||
gdk_cairo_set_source_rgba (cr, &color);
|
||||
GtkStyleContext *context;
|
||||
GdkRGBA rgba;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &rgba);
|
||||
gdk_cairo_set_source_rgba (cr, &rgba);
|
||||
cairo_paint (cr);
|
||||
|
||||
return TRUE;
|
||||
@@ -34,6 +39,7 @@ response_cb (GtkDialog *dialog,
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
|
||||
gtk_widget_override_background_color (da, 0, &color);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
@@ -99,6 +105,8 @@ do_colorsel (GtkWidget *do_widget)
|
||||
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 200, 200);
|
||||
/* set the color */
|
||||
gtk_widget_override_background_color (da, 0, &color);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
|
||||
@@ -259,21 +259,18 @@ G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
|
||||
static void
|
||||
mask_entry_set_background (MaskEntry *entry)
|
||||
{
|
||||
static const GdkRGBA error_color = { 1.0, 0.9, 0.9, 1.0 };
|
||||
|
||||
if (entry->mask)
|
||||
{
|
||||
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
|
||||
{
|
||||
PangoAttrList *attrs;
|
||||
|
||||
attrs = pango_attr_list_new ();
|
||||
pango_attr_list_insert (attrs, pango_attr_foreground_new (65535, 32767, 32767));
|
||||
gtk_entry_set_attributes (GTK_ENTRY (entry), attrs);
|
||||
pango_attr_list_unref (attrs);
|
||||
gtk_widget_override_color (GTK_WIDGET (entry), 0, &error_color);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_entry_set_attributes (GTK_ENTRY (entry), NULL);
|
||||
gtk_widget_override_color (GTK_WIDGET (entry), 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@
|
||||
<file>expander.c</file>
|
||||
<file>flowbox.c</file>
|
||||
<file>gestures.c</file>
|
||||
<file>glarea.c</file>
|
||||
<file>headerbar.c</file>
|
||||
<file>hypertext.c</file>
|
||||
<file>iconview.c</file>
|
||||
@@ -119,7 +118,6 @@
|
||||
<file>search_entry.c</file>
|
||||
<file>search_entry2.c</file>
|
||||
<file>sizegroup.c</file>
|
||||
<file>sidebar.c</file>
|
||||
<file>stack.c</file>
|
||||
<file>spinner.c</file>
|
||||
<file>textview.c</file>
|
||||
|
||||
@@ -142,8 +142,11 @@ static void
|
||||
add_item (GtkWidget *button, gpointer data)
|
||||
{
|
||||
Item foo;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model = (GtkTreeModel *)data;
|
||||
GtkTreeIter current, iter;
|
||||
GtkTreePath *path;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeView *treeview = (GtkTreeView *)data;
|
||||
|
||||
g_return_if_fail (articles != NULL);
|
||||
|
||||
@@ -152,12 +155,26 @@ add_item (GtkWidget *button, gpointer data)
|
||||
foo.yummy = 50;
|
||||
g_array_append_vals (articles, &foo, 1);
|
||||
|
||||
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
|
||||
/* Insert a new row below the current one */
|
||||
gtk_tree_view_get_cursor (treeview, &path, NULL);
|
||||
model = gtk_tree_view_get_model (treeview);
|
||||
gtk_tree_model_get_iter (model, ¤t, path);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
/* Set the data for the new row */
|
||||
gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, ¤t);
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
|
||||
COLUMN_ITEM_NUMBER, foo.number,
|
||||
COLUMN_ITEM_PRODUCT, foo.product,
|
||||
COLUMN_ITEM_YUMMY, foo.yummy,
|
||||
-1);
|
||||
|
||||
/* Move focus to the new row */
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
column = gtk_tree_view_get_column (treeview, 0);
|
||||
gtk_tree_view_set_cursor (treeview, path, column, FALSE);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -368,7 +385,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
|
||||
button = gtk_button_new_with_label ("Add item");
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (add_item), items_model);
|
||||
G_CALLBACK (add_item), treeview);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("Remove item");
|
||||
|
||||
@@ -12,31 +12,18 @@
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static gboolean
|
||||
draw_color (GtkWidget *drawingarea,
|
||||
cairo_t *cr,
|
||||
const char *color_name)
|
||||
{
|
||||
GdkRGBA rgba;
|
||||
|
||||
if (gdk_rgba_parse (&rgba, color_name))
|
||||
{
|
||||
gdk_cairo_set_source_rgba (cr, &rgba);
|
||||
cairo_paint (cr);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
color_swatch_new (const gchar *color)
|
||||
{
|
||||
GtkWidget *button, *area;
|
||||
GdkRGBA rgba;
|
||||
|
||||
gdk_rgba_parse (&rgba, color);
|
||||
|
||||
button = gtk_button_new ();
|
||||
area = gtk_drawing_area_new ();
|
||||
g_signal_connect (area, "draw", G_CALLBACK (draw_color), (gpointer) color);
|
||||
gtk_widget_set_size_request (area, 24, 24);
|
||||
gtk_widget_override_background_color (area, 0, &rgba);
|
||||
gtk_container_add (GTK_CONTAINER (button), area);
|
||||
gtk_widget_show_all (button);
|
||||
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
/* OpenGL Area
|
||||
*
|
||||
* GtkGLArea is a widget that allows custom drawing using OpenGL calls.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
static GtkWidget *demo_window = NULL;
|
||||
|
||||
/* the GtkGLArea widget */
|
||||
static GtkWidget *gl_area = NULL;
|
||||
|
||||
enum {
|
||||
X_AXIS,
|
||||
Y_AXIS,
|
||||
Z_AXIS,
|
||||
|
||||
N_AXIS
|
||||
};
|
||||
|
||||
/* Rotation angles on each axis */
|
||||
static float rotation_angles[N_AXIS] = { 0.0 };
|
||||
|
||||
/* The object we are drawing */
|
||||
static void
|
||||
draw_triangle (void)
|
||||
{
|
||||
glColor3f (1.0f, 0.85f, 0.35f);
|
||||
glBegin (GL_TRIANGLES);
|
||||
{
|
||||
glVertex3f ( 0.0, 0.6, 0.0);
|
||||
glVertex3f (-0.2, -0.3, 0.0);
|
||||
glVertex3f ( 0.2, -0.3, 0.0);
|
||||
}
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
/* The main rendering callback */
|
||||
static gboolean
|
||||
render (GtkGLArea *area,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
glClearColor (0.5, 0.5, 0.5, 1.0);
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glRotatef (rotation_angles[X_AXIS], 1, 0, 0);
|
||||
glRotatef (rotation_angles[Y_AXIS], 0, 1, 0);
|
||||
glRotatef (rotation_angles[Z_AXIS], 0, 0, 1);
|
||||
|
||||
draw_triangle ();
|
||||
|
||||
glFlush ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_axis_value_change (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
int axis = GPOINTER_TO_INT (data);
|
||||
|
||||
g_assert (axis >= 0 && axis < N_AXIS);
|
||||
|
||||
/* Update the rotation angle */
|
||||
rotation_angles[axis] = gtk_adjustment_get_value (adjustment);
|
||||
|
||||
/* Update the contents of the GL drawing area */
|
||||
gtk_widget_queue_draw (gl_area);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_axis_slider (int axis)
|
||||
{
|
||||
GtkWidget *box, *label, *slider;
|
||||
GtkAdjustment *adj;
|
||||
const char *text;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case X_AXIS:
|
||||
text = "X axis";
|
||||
break;
|
||||
|
||||
case Y_AXIS:
|
||||
text = "Y axis";
|
||||
break;
|
||||
|
||||
case Z_AXIS:
|
||||
text = "Z axis";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
gtk_widget_show (label);
|
||||
|
||||
adj = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (on_axis_value_change),
|
||||
GINT_TO_POINTER (axis));
|
||||
slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj);
|
||||
gtk_container_add (GTK_CONTAINER (box), slider);
|
||||
gtk_widget_set_hexpand (slider, TRUE);
|
||||
gtk_widget_show (slider);
|
||||
|
||||
gtk_widget_show (box);
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
static void
|
||||
close_window (GtkWidget *widget)
|
||||
{
|
||||
/* Reset the state */
|
||||
demo_window = NULL;
|
||||
gl_area = NULL;
|
||||
|
||||
rotation_angles[X_AXIS] = 0.0;
|
||||
rotation_angles[Y_AXIS] = 0.0;
|
||||
rotation_angles[Z_AXIS] = 0.0;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
create_glarea_window (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *window, *box, *button, *controls;
|
||||
int i;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
gl_area = gtk_gl_area_new ();
|
||||
gtk_widget_set_hexpand (gl_area, TRUE);
|
||||
gtk_widget_set_vexpand (gl_area, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), gl_area);
|
||||
|
||||
/* the main "draw" call for GtkGLArea */
|
||||
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
|
||||
|
||||
controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (box), controls);
|
||||
gtk_widget_set_hexpand (controls, TRUE);
|
||||
|
||||
for (i = 0; i < N_AXIS; i++)
|
||||
gtk_container_add (GTK_CONTAINER (controls), create_axis_slider (i));
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_widget_set_hexpand (button, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
do_glarea (GtkWidget *do_widget)
|
||||
{
|
||||
if (demo_window == NULL)
|
||||
demo_window = create_glarea_window (do_widget);
|
||||
|
||||
if (!gtk_widget_get_visible (demo_window))
|
||||
gtk_widget_show_all (demo_window);
|
||||
else
|
||||
gtk_widget_destroy (demo_window);
|
||||
|
||||
return demo_window;
|
||||
}
|
||||
@@ -239,8 +239,8 @@ do_hypertext (GtkWidget *do_widget)
|
||||
GtkWidget *sw;
|
||||
GtkTextBuffer *buffer;
|
||||
|
||||
hand_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (do_widget), GDK_HAND2);
|
||||
regular_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (do_widget), GDK_XTERM);
|
||||
hand_cursor = gdk_cursor_new (GDK_HAND2);
|
||||
regular_cursor = gdk_cursor_new (GDK_XTERM);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
|
||||
@@ -772,53 +772,19 @@ load_file (const gchar *demoname,
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
gtk_text_buffer_insert (source_buffer, &start, p, -1);
|
||||
if (lines[i+1] != NULL)
|
||||
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
|
||||
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (lines);
|
||||
|
||||
fontify (source_buffer);
|
||||
|
||||
gtk_text_buffer_create_tag (source_buffer, "top-margin",
|
||||
"pixels-above-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_start_iter (source_buffer, &start);
|
||||
end = start;
|
||||
gtk_text_iter_forward_word_end (&end);
|
||||
gtk_text_buffer_apply_tag_by_name (source_buffer, "top-margin", &start, &end);
|
||||
|
||||
gtk_text_buffer_create_tag (source_buffer, "bottom-margin",
|
||||
"pixels-below-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_end_iter (source_buffer, &end);
|
||||
start = end;
|
||||
gtk_text_iter_backward_word_start (&start);
|
||||
gtk_text_buffer_apply_tag_by_name (source_buffer, "bottom-margin", &start, &end);
|
||||
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (source_view), source_buffer);
|
||||
g_object_unref (source_buffer);
|
||||
|
||||
gtk_text_buffer_create_tag (info_buffer, "top-margin",
|
||||
"pixels-above-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_start_iter (info_buffer, &start);
|
||||
end = start;
|
||||
gtk_text_iter_forward_word_end (&end);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "top-margin", &start, &end);
|
||||
|
||||
gtk_text_buffer_create_tag (info_buffer, "bottom-margin",
|
||||
"pixels-below-lines", 20,
|
||||
NULL);
|
||||
gtk_text_buffer_get_end_iter (info_buffer, &end);
|
||||
start = end;
|
||||
gtk_text_iter_backward_word_start (&start);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "bottom-margin", &start, &end);
|
||||
g_strfreev (lines);
|
||||
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (info_view), info_buffer);
|
||||
g_object_unref (info_buffer);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (source_view), source_buffer);
|
||||
g_object_unref (source_buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -855,6 +821,7 @@ create_text (GtkWidget **view,
|
||||
{
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *text_view;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
@@ -864,10 +831,7 @@ create_text (GtkWidget **view,
|
||||
GTK_SHADOW_NONE);
|
||||
|
||||
*view = text_view = gtk_text_view_new ();
|
||||
g_object_set (text_view,
|
||||
"left-margin", 20,
|
||||
"right-margin", 20,
|
||||
NULL);
|
||||
g_object_set (text_view, "margin", 20, NULL);
|
||||
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
@@ -876,15 +840,22 @@ create_text (GtkWidget **view,
|
||||
|
||||
if (is_source)
|
||||
{
|
||||
gtk_text_view_set_monospace (GTK_TEXT_VIEW (text_view), TRUE);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_NONE);
|
||||
font_desc = pango_font_description_from_string ("monospace");
|
||||
gtk_widget_override_font (text_view, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
|
||||
GTK_WRAP_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Make it a bit nicer for text. */
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
|
||||
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (text_view), 2);
|
||||
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (text_view), 2);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
|
||||
GTK_WRAP_WORD);
|
||||
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (text_view),
|
||||
2);
|
||||
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (text_view),
|
||||
2);
|
||||
}
|
||||
|
||||
return scrolled_window;
|
||||
|
||||
@@ -70,41 +70,36 @@
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">0</property>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="width_request">120</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="min_content_width">150</property>
|
||||
<style>
|
||||
<class name="sidebar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="width_request">120</property>
|
||||
<object class="GtkTreeView" id="treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="min_content_width">150</property>
|
||||
<style>
|
||||
<class name="sidebar"/>
|
||||
</style>
|
||||
<property name="model">treestore</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection">
|
||||
<property name="mode">browse</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">treestore</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection">
|
||||
<property name="mode">browse</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||
<attributes>
|
||||
<attribute name="style">4</attribute>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||
<attributes>
|
||||
<attribute name="style">4</attribute>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@@ -133,8 +128,10 @@
|
||||
<object class="GtkTextView" id="info-textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="margin_start">20</property>
|
||||
<property name="margin_end">20</property>
|
||||
<property name="margin_top">20</property>
|
||||
<property name="margin_bottom">20</property>
|
||||
<property name="pixels_above_lines">2</property>
|
||||
<property name="pixels_below_lines">2</property>
|
||||
<property name="editable">False</property>
|
||||
@@ -168,8 +165,10 @@
|
||||
<object class="GtkTextView" id="source-textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="margin_start">20</property>
|
||||
<property name="margin_end">20</property>
|
||||
<property name="margin_top">20</property>
|
||||
<property name="margin_bottom">20</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="cursor_visible">False</property>
|
||||
</object>
|
||||
|
||||
@@ -573,6 +573,7 @@ do_offscreen_window (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *bin, *vbox, *scale, *button;
|
||||
GdkRGBA black;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
@@ -582,6 +583,8 @@ do_offscreen_window (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gdk_rgba_parse (&black, "black");
|
||||
gtk_widget_override_background_color (window, 0, &black);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
|
||||
@@ -181,6 +181,8 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
PangoLayout *layout;
|
||||
PangoAttrList *attrs;
|
||||
|
||||
const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
@@ -193,15 +195,18 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
/* Add a drawing area */
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (box), drawing_area);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area),
|
||||
GTK_STYLE_CLASS_VIEW);
|
||||
|
||||
/* This overrides the background color from the theme */
|
||||
gtk_widget_override_background_color (drawing_area, 0, &white);
|
||||
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
G_CALLBACK (rotated_text_draw), NULL);
|
||||
|
||||
/* And a label */
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/* Sidebar
|
||||
*
|
||||
* GtkSidebar provides an automatic sidebar widget to control navigation
|
||||
* of a GtkStack object. This widget automatically updates it content
|
||||
* based on what is presently available in the GtkStack object, and
|
||||
* using the "title" child property to set the display labels.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_sidebar (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *sidebar;
|
||||
GtkWidget *stack;
|
||||
GtkWidget *box;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *header;
|
||||
const gchar* pages[] = {
|
||||
"Welcome to GTK+",
|
||||
"GtkSidebar Widget",
|
||||
"Automatic navigation",
|
||||
"Consistent appearance",
|
||||
"Scrolling",
|
||||
"Page 6",
|
||||
"Page 7",
|
||||
"Page 8",
|
||||
"Page 9",
|
||||
NULL
|
||||
};
|
||||
const gchar *c = NULL;
|
||||
guint i;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_widget_set_size_request (window, 500, 350);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW(window), header);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
/* Separator between sidebar and stack */
|
||||
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_box_pack_start (GTK_BOX(box), widget, FALSE, FALSE, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (box), stack, TRUE, TRUE, 0);
|
||||
|
||||
for (i=0; (c = *(pages+i)) != NULL; i++ )
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
widget = gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_MENU);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (widget), 256);
|
||||
}
|
||||
else
|
||||
{
|
||||
widget = gtk_label_new (c);
|
||||
}
|
||||
gtk_stack_add_named (GTK_STACK (stack), widget, c);
|
||||
gtk_container_child_set (GTK_CONTAINER (stack), widget, "title", c, NULL);
|
||||
}
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -539,18 +539,26 @@ recursive_attach_view (int depth,
|
||||
GtkTextView *view,
|
||||
GtkTextChildAnchor *anchor)
|
||||
{
|
||||
GtkWidget *child_view, *frame;
|
||||
GtkWidget *child_view;
|
||||
GtkWidget *event_box;
|
||||
GdkRGBA color;
|
||||
|
||||
if (depth > 4)
|
||||
return;
|
||||
|
||||
child_view = gtk_text_view_new_with_buffer (gtk_text_view_get_buffer (view));
|
||||
|
||||
/* Frame is to add a black border around each child view */
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_container_add (GTK_CONTAINER (frame), child_view);
|
||||
/* Event box is to add a black border around each child view */
|
||||
event_box = gtk_event_box_new ();
|
||||
gdk_rgba_parse (&color, "black");
|
||||
gtk_widget_override_background_color (event_box, 0, &color);
|
||||
|
||||
gtk_text_view_add_child_at_anchor (view, frame, anchor);
|
||||
gtk_widget_set_halign (child_view, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (child_view, GTK_ALIGN_FILL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (event_box), child_view);
|
||||
|
||||
gtk_text_view_add_child_at_anchor (view, event_box, anchor);
|
||||
|
||||
recursive_attach_view (depth + 1, GTK_TEXT_VIEW (child_view), anchor);
|
||||
}
|
||||
|
||||
@@ -190,6 +190,7 @@ do_transparent (GtkWidget *do_widget)
|
||||
GtkWidget *sw;
|
||||
GtkWidget *overlay;
|
||||
GtkWidget *entry;
|
||||
GdkRGBA transparent = {0, 0, 0, 0};
|
||||
GtkCssProvider *provider;
|
||||
gchar *css;
|
||||
|
||||
@@ -217,6 +218,8 @@ do_transparent (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (overlay), sw);
|
||||
gtk_container_add (GTK_CONTAINER (window), overlay);
|
||||
|
||||
gtk_widget_override_background_color (overlay, 0, &transparent);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
provider = gtk_css_provider_new ();
|
||||
css = g_strdup_printf ("* { border-width: 0px %dpx %dpx 0px; }",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <string.h>
|
||||
#include "iconbrowserapp.h"
|
||||
#include "iconbrowserwin.h"
|
||||
#include <gtk/gtk.h>
|
||||
@@ -52,7 +51,7 @@ enum {
|
||||
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static void
|
||||
search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
search_text_changed (GtkEntry *entry)
|
||||
{
|
||||
const gchar *text;
|
||||
|
||||
@@ -60,8 +59,6 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
|
||||
if (text[0] == '\0')
|
||||
return;
|
||||
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -194,8 +191,6 @@ selected_context_changed (GtkListBox *list, IconBrowserWindow *win)
|
||||
if (row == NULL)
|
||||
return;
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (win->search), FALSE);
|
||||
|
||||
label = gtk_bin_get_child (GTK_BIN (row));
|
||||
win->current_context = g_object_get_data (G_OBJECT (label), "context");
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
@@ -676,13 +671,11 @@ populate (IconBrowserWindow *win)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
key_press_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
key_press_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GtkSearchBar *bar)
|
||||
{
|
||||
IconBrowserWindow *win = data;
|
||||
|
||||
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (win->searchbar), event);
|
||||
return gtk_search_bar_handle_event (bar, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -694,13 +687,8 @@ icon_visible_func (GtkTreeModel *model,
|
||||
gchar *context;
|
||||
gchar *name;
|
||||
gint column;
|
||||
gboolean search;
|
||||
const gchar *search_text;
|
||||
gboolean visible;
|
||||
|
||||
search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (win->search));
|
||||
search_text = gtk_entry_get_text (GTK_ENTRY (win->searchentry));
|
||||
|
||||
if (win->symbolic)
|
||||
column = SYMBOLIC_NAME_COLUMN;
|
||||
else
|
||||
@@ -710,12 +698,8 @@ icon_visible_func (GtkTreeModel *model,
|
||||
column, &name,
|
||||
CONTEXT_COLUMN, &context,
|
||||
-1);
|
||||
if (!name)
|
||||
visible = FALSE;
|
||||
else if (search)
|
||||
visible = strstr (name, search_text) != NULL;
|
||||
else
|
||||
visible = win->current_context != NULL && g_strcmp0 (context, win->current_context->id) == 0;
|
||||
|
||||
visible = name != NULL && win->current_context != NULL && g_strcmp0 (context, win->current_context->id) == 0;
|
||||
|
||||
g_free (name);
|
||||
g_free (context);
|
||||
@@ -742,13 +726,6 @@ symbolic_toggled (GtkToggleButton *toggle, IconBrowserWindow *win)
|
||||
gtk_widget_queue_draw (win->list);
|
||||
}
|
||||
|
||||
static void
|
||||
search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *win)
|
||||
{
|
||||
if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (searchbar)))
|
||||
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_init (IconBrowserWindow *win)
|
||||
{
|
||||
@@ -756,13 +733,16 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
|
||||
g_object_bind_property (win->search, "active",
|
||||
win->searchbar, "search-mode-enabled",
|
||||
G_BINDING_BIDIRECTIONAL);
|
||||
|
||||
// gtk_tree_view_set_search_entry (GTK_TREE_VIEW (win->list), GTK_ENTRY (win->searchentry));
|
||||
g_signal_connect (win, "key-press-event", G_CALLBACK (key_press_event_cb), win->searchbar);
|
||||
|
||||
gtk_tree_model_filter_set_visible_func (win->filter_model, icon_visible_func, win, NULL);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (win->details), GTK_WINDOW (win));
|
||||
|
||||
|
||||
g_signal_connect (win->searchbar, "notify::search-mode-enabled",
|
||||
G_CALLBACK (search_mode_toggled), win);
|
||||
|
||||
symbolic_toggled (GTK_TOGGLE_BUTTON (win->symbolic_radio), win);
|
||||
|
||||
populate (win);
|
||||
@@ -798,7 +778,6 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), item_activated);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), selected_context_changed);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), symbolic_toggled);
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), key_press_event_cb);
|
||||
}
|
||||
|
||||
IconBrowserWindow *
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<property name="title" translatable="yes">Icon Browser</property>
|
||||
<property name="default-width">600</property>
|
||||
<property name="default-height">800</property>
|
||||
<signal name="key-press-event" handler="key_press_event_cb"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="visible">True</property>
|
||||
@@ -48,7 +47,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="visible">True</property>
|
||||
<property name="visible">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
@@ -84,11 +83,10 @@
|
||||
<child>
|
||||
<object class="GtkSearchBar" id="searchbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="search-mode-enabled" bind-source="search" bind-property="active" bind-flags="bidirectional"/>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="searchentry">
|
||||
<property name="visible">True</property>
|
||||
<signal name="search-changed" handler="search_text_changed"/>
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -18,14 +18,12 @@ gtk3_widget_factory_DEPENDENCIES = \
|
||||
gtk3_widget_factory_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GTK_DEP_CFLAGS) \
|
||||
$(LIBCANBERRA_CFLAGS)
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
gtk3_widget_factory_LDADD = \
|
||||
$(top_builddir)/gdk/libgdk-3.la \
|
||||
$(top_builddir)/gtk/libgtk-3.la \
|
||||
$(GTK_DEP_LIBS) \
|
||||
$(LIBCANBERRA_LIBS)
|
||||
$(GTK_DEP_LIBS)
|
||||
|
||||
widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/widget-factory.gresource.xml)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
|
||||
|
||||
@@ -19,12 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#ifdef HAVE_LIBCANBERRA
|
||||
#include <canberra-gtk.h>
|
||||
#endif
|
||||
|
||||
static void
|
||||
change_theme_state (GSimpleAction *action,
|
||||
@@ -239,134 +234,7 @@ on_entry_icon_release (GtkEntry *entry,
|
||||
pulse_it (GTK_WIDGET (entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define EPSILON (1e-10)
|
||||
|
||||
static gboolean
|
||||
on_scale_button_query_tooltip (GtkWidget *button,
|
||||
gint x,
|
||||
gint y,
|
||||
gboolean keyboard_mode,
|
||||
GtkTooltip *tooltip,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button);
|
||||
GtkAdjustment *adjustment;
|
||||
gdouble val;
|
||||
gchar *str;
|
||||
AtkImage *image;
|
||||
|
||||
image = ATK_IMAGE (gtk_widget_get_accessible (button));
|
||||
|
||||
adjustment = gtk_scale_button_get_adjustment (scale_button);
|
||||
val = gtk_scale_button_get_value (scale_button);
|
||||
|
||||
if (val < (gtk_adjustment_get_lower (adjustment) + EPSILON))
|
||||
{
|
||||
str = g_strdup (_("Muted"));
|
||||
}
|
||||
else if (val >= (gtk_adjustment_get_upper (adjustment) - EPSILON))
|
||||
{
|
||||
str = g_strdup (_("Full Volume"));
|
||||
}
|
||||
else
|
||||
{
|
||||
gint percent;
|
||||
|
||||
percent = (gint) (100. * val / (gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_lower (adjustment)) + .5);
|
||||
|
||||
str = g_strdup_printf (C_("volume percentage", "%d %%"), percent);
|
||||
}
|
||||
|
||||
gtk_tooltip_set_text (tooltip, str);
|
||||
atk_image_set_image_description (image, str);
|
||||
g_free (str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_scale_button_value_changed (GtkScaleButton *button,
|
||||
gdouble value,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_widget_trigger_tooltip_query (GTK_WIDGET (button));
|
||||
}
|
||||
|
||||
static void
|
||||
on_record_button_toggled (GtkToggleButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (GTK_WIDGET (button));
|
||||
if (gtk_toggle_button_get_active (button))
|
||||
gtk_style_context_remove_class (context, "destructive-action");
|
||||
else
|
||||
gtk_style_context_add_class (context, "destructive-action");
|
||||
}
|
||||
|
||||
static void
|
||||
on_page_combo_changed (GtkComboBox *combo,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *from;
|
||||
GtkWidget *to;
|
||||
|
||||
from = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_from_spin"));
|
||||
to = GTK_WIDGET (g_object_get_data (G_OBJECT (combo), "range_to_spin"));
|
||||
|
||||
switch (gtk_combo_box_get_active (combo))
|
||||
{
|
||||
case 0: /* Range */
|
||||
gtk_widget_set_sensitive (from, TRUE);
|
||||
gtk_widget_set_sensitive (to, TRUE);
|
||||
break;
|
||||
case 1: /* All */
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 1);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 99);
|
||||
break;
|
||||
case 2: /* Current */
|
||||
gtk_widget_set_sensitive (from, FALSE);
|
||||
gtk_widget_set_sensitive (to, FALSE);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (from), 7);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (to), 7);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_range_from_changed (GtkSpinButton *from)
|
||||
{
|
||||
GtkSpinButton *to;
|
||||
gint v1, v2;
|
||||
|
||||
to = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (from), "range_to_spin"));
|
||||
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
|
||||
if (v1 > v2)
|
||||
gtk_spin_button_set_value (to, v1);
|
||||
}
|
||||
|
||||
static void
|
||||
on_range_to_changed (GtkSpinButton *to)
|
||||
{
|
||||
GtkSpinButton *from;
|
||||
gint v1, v2;
|
||||
|
||||
from = GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (to), "range_from_spin"));
|
||||
|
||||
v1 = gtk_spin_button_get_value_as_int (from);
|
||||
v2 = gtk_spin_button_get_value_as_int (to);
|
||||
|
||||
if (v1 > v2)
|
||||
gtk_spin_button_set_value (from, v2);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -578,82 +446,6 @@ update_title_header (GtkListBoxRow *row,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *box, *row, *label, *swatch;
|
||||
GdkRGBA rgba;
|
||||
const gchar *color;
|
||||
gchar *text;
|
||||
GtkWidget *silver;
|
||||
GtkWidget *gold;
|
||||
|
||||
silver = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "Silver"));
|
||||
gold = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "Gold"));
|
||||
|
||||
if (pos == GTK_POS_TOP)
|
||||
{
|
||||
if (silver)
|
||||
{
|
||||
gtk_container_remove (GTK_CONTAINER (widget), silver);
|
||||
g_object_set_data (G_OBJECT (widget), "Silver", NULL);
|
||||
}
|
||||
if (gold)
|
||||
{
|
||||
gtk_container_remove (GTK_CONTAINER (widget), gold);
|
||||
g_object_set_data (G_OBJECT (widget), "Gold", NULL);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBCANBERRA
|
||||
if (silver || gold)
|
||||
ca_gtk_play_for_widget (widget, 0, "event.id", "message", NULL);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (gold)
|
||||
return;
|
||||
else if (silver)
|
||||
color = "Gold";
|
||||
else
|
||||
color = "Silver";
|
||||
|
||||
row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
|
||||
text = g_strconcat ("<b>", color, "</b>", NULL);
|
||||
label = gtk_label_new (text);
|
||||
g_free (text);
|
||||
g_object_set (label,
|
||||
"use-markup", TRUE,
|
||||
"halign", GTK_ALIGN_START,
|
||||
"valign", GTK_ALIGN_CENTER,
|
||||
"margin", 6,
|
||||
"xalign", 0.0,
|
||||
NULL);
|
||||
gtk_box_pack_start (GTK_BOX (row), label, TRUE, TRUE, 0);
|
||||
gdk_rgba_parse (&rgba, color);
|
||||
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
|
||||
"rgba", &rgba,
|
||||
"selectable", FALSE,
|
||||
"halign", GTK_ALIGN_END,
|
||||
"valign", GTK_ALIGN_CENTER,
|
||||
"margin", 6,
|
||||
"height-request", 24,
|
||||
NULL);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (box), swatch);
|
||||
gtk_box_pack_start (GTK_BOX (row), box, FALSE, FALSE, 0);
|
||||
gtk_widget_show_all (row);
|
||||
gtk_list_box_insert (GTK_LIST_BOX (widget), row, -1);
|
||||
row = gtk_widget_get_parent (row);
|
||||
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
|
||||
g_object_set_data (G_OBJECT (widget), color, row);
|
||||
#ifdef HAVE_LIBCANBERRA
|
||||
ca_gtk_play_for_widget (widget, 0, "event.id", "complete", NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
populate_colors (GtkWidget *widget)
|
||||
{
|
||||
@@ -701,7 +493,6 @@ populate_colors (GtkWidget *widget)
|
||||
};
|
||||
gint i;
|
||||
GtkWidget *row, *box, *label, *swatch;
|
||||
GtkWidget *sw;
|
||||
GdkRGBA rgba;
|
||||
|
||||
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_title_header, NULL, NULL);
|
||||
@@ -738,9 +529,6 @@ populate_colors (GtkWidget *widget)
|
||||
}
|
||||
|
||||
gtk_list_box_invalidate_headers (GTK_LIST_BOX (widget));
|
||||
|
||||
sw = gtk_widget_get_ancestor (widget, GTK_TYPE_SCROLLED_WINDOW);
|
||||
g_signal_connect (sw, "edge-overshot", G_CALLBACK (overshot), widget);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -761,7 +549,7 @@ background_loaded_cb (GObject *source,
|
||||
pixbuf = gdk_pixbuf_new_from_stream_finish (res, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error loading '%s': %s", bd->filename, error->message);
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
@@ -1000,92 +788,6 @@ toggle_selection_mode (GtkSwitch *sw,
|
||||
gtk_list_box_set_activate_on_single_click (listbox, !gtk_switch_get_active (sw));
|
||||
}
|
||||
|
||||
static void
|
||||
handle_insert (GtkWidget *button, GtkWidget *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
const gchar *id;
|
||||
const gchar *text;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
|
||||
if (strcmp (id, "toolbutton1") == 0)
|
||||
text = "⌘";
|
||||
else if (strcmp (id, "toolbutton2") == 0)
|
||||
text = "⚽";
|
||||
else if (strcmp (id, "toolbutton3") == 0)
|
||||
text = "⤢";
|
||||
else if (strcmp (id, "toolbutton4") == 0)
|
||||
text = "☆";
|
||||
else
|
||||
text = "";
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
|
||||
gtk_text_buffer_insert_at_cursor (buffer, text, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_cutcopypaste (GtkWidget *button, GtkWidget *textview)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkClipboard *clipboard;
|
||||
const gchar *id;
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (textview, GDK_SELECTION_CLIPBOARD);
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
|
||||
if (strcmp (id, "cutbutton") == 0)
|
||||
gtk_text_buffer_cut_clipboard (buffer, clipboard, TRUE);
|
||||
else if (strcmp (id, "copybutton") == 0)
|
||||
gtk_text_buffer_copy_clipboard (buffer, clipboard);
|
||||
else if (strcmp (id, "pastebutton") == 0)
|
||||
gtk_text_buffer_paste_clipboard (buffer, clipboard, NULL, TRUE);
|
||||
else if (strcmp (id, "deletebutton") == 0)
|
||||
gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
clipboard_owner_change (GtkClipboard *clipboard, GdkEvent *event, GtkWidget *button)
|
||||
{
|
||||
const gchar *id;
|
||||
gboolean has_text;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
has_text = gtk_clipboard_wait_is_text_available (clipboard);
|
||||
|
||||
if (strcmp (id, "pastebutton") == 0)
|
||||
gtk_widget_set_sensitive (button, has_text);
|
||||
}
|
||||
|
||||
static void
|
||||
textbuffer_notify_selection (GObject *object, GParamSpec *pspec, GtkWidget *button)
|
||||
{
|
||||
const gchar *id;
|
||||
gboolean has_selection;
|
||||
|
||||
id = gtk_buildable_get_name (GTK_BUILDABLE (button));
|
||||
has_selection = gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (object));
|
||||
|
||||
if (strcmp (id, "cutbutton") == 0 ||
|
||||
strcmp (id, "copybutton") == 0 ||
|
||||
strcmp (id, "deletebutton") == 0)
|
||||
gtk_widget_set_sensitive (button, has_selection);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
osd_frame_button_press (GtkWidget *frame, GdkEventButton *event, gpointer data)
|
||||
{
|
||||
GtkWidget *osd;
|
||||
gboolean visible;
|
||||
|
||||
osd = g_object_get_data (G_OBJECT (frame), "osd");
|
||||
visible = gtk_widget_get_visible (osd);
|
||||
gtk_widget_set_visible (osd, !visible);
|
||||
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -1093,11 +795,9 @@ activate (GApplication *app)
|
||||
GtkWindow *window;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *widget2;
|
||||
GtkWidget *widget3;
|
||||
GtkWidget *stack;
|
||||
GtkWidget *dialog;
|
||||
GtkAdjustment *adj;
|
||||
GtkCssProvider *provider;
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "dark", NULL, NULL, "false", change_theme_state },
|
||||
{ "search", activate_search, NULL, NULL, NULL },
|
||||
@@ -1117,23 +817,8 @@ activate (GApplication *app)
|
||||
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
g_object_unref (provider);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/WidgetFactory/widget-factory.ui");
|
||||
gtk_builder_add_callback_symbol (builder, "on_entry_icon_release", (GCallback)on_entry_icon_release);
|
||||
gtk_builder_add_callback_symbol (builder, "on_scale_button_value_changed", (GCallback)on_scale_button_value_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_scale_button_query_tooltip", (GCallback)on_scale_button_query_tooltip);
|
||||
gtk_builder_add_callback_symbol (builder, "on_record_button_toggled", (GCallback)on_record_button_toggled);
|
||||
gtk_builder_add_callback_symbol (builder, "on_page_combo_changed", (GCallback)on_page_combo_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_range_from_changed", (GCallback)on_range_from_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_range_to_changed", (GCallback)on_range_to_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "osd_frame_button_press", (GCallback)osd_frame_button_press);
|
||||
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
|
||||
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
|
||||
@@ -1239,51 +924,12 @@ activate (GApplication *app)
|
||||
|
||||
populate_colors ((GtkWidget *)gtk_builder_get_object (builder, "munsell"));
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
|
||||
widget3 = (GtkWidget *)gtk_builder_get_object (builder, "range_to_spin");
|
||||
g_object_set_data (G_OBJECT (widget), "range_from_spin", widget2);
|
||||
g_object_set_data (G_OBJECT (widget3), "range_from_spin", widget2);
|
||||
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
||||
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "searchmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "darkmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "aboutmenuitem")));
|
||||
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton1");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton2");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton3");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton4");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_insert), widget2);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "cutbutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget2)), "notify::has-selection",
|
||||
G_CALLBACK (textbuffer_notify_selection), widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "copybutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget2)), "notify::has-selection",
|
||||
G_CALLBACK (textbuffer_notify_selection), widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "deletebutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget2)), "notify::has-selection",
|
||||
G_CALLBACK (textbuffer_notify_selection), widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "pastebutton");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (handle_cutcopypaste), widget2);
|
||||
g_signal_connect (gtk_widget_get_clipboard (widget2, GDK_SELECTION_CLIPBOARD), "owner-change",
|
||||
G_CALLBACK (clipboard_owner_change), widget);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "osd_frame");
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "totem_like_osd");
|
||||
g_object_set_data (G_OBJECT (widget), "osd", widget2);
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET (window));
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
</menu>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
@@ -94,20 +93,6 @@
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="pg_adjustment">
|
||||
<property name="upper">99</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">2</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="pg_adjustment2">
|
||||
<property name="upper">99</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">4</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkListStore" id="liststore1">
|
||||
<columns>
|
||||
<!-- column-name Cool -->
|
||||
@@ -169,7 +154,7 @@ Morbi massa libero, congue vitae scelerisque vel, ultricies vel nisl.
|
||||
Vestibulum in tortor diam, quis aliquet quam. Praesent ut justo neque, tempus rutrum est.
|
||||
Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar eleifend nisi.
|
||||
Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque.
|
||||
Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
Suspendisse feugiat quam quis dolor accumsan cursus. </property>
|
||||
</object>
|
||||
<object class="GtkTextBuffer" id="textbuffer2">
|
||||
<property name="text">* Translation updates:
|
||||
@@ -1602,8 +1587,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="buffer">textbuffer1</property>
|
||||
<property name="wrap_mode">2</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2070,7 +2053,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="row-spacing">6</property>
|
||||
<property name="column-spacing">6</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkVolumeButton">
|
||||
@@ -2087,19 +2069,13 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScaleButton" id="mic-button">
|
||||
<object class="GtkVolumeButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="has-tooltip">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="icons">microphone-sensitivity-muted-symbolic
|
||||
microphone-sensitivity-high-symbolic
|
||||
microphone-sensitivity-low-symbolic
|
||||
microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="use-symbolic">True</property>
|
||||
<property name="value">.5</property>
|
||||
<property name="halign">center</property>
|
||||
<signal name="query-tooltip" handler="on_scale_button_query_tooltip" swapped="no"/>
|
||||
<signal name="value-changed" handler="on_scale_button_value_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -2107,6 +2083,9 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
@@ -2139,8 +2118,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="buffer">textbuffer2</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2903,8 +2880,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="buffer">textbuffer1</property>
|
||||
<property name="wrap_mode">2</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -3026,7 +3001,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="expanded">True</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow3">
|
||||
<property name="visible">True</property>
|
||||
@@ -3218,662 +3192,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="icon_name">pan-down-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="record_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">center</property>
|
||||
<signal name="toggled" handler="on_record_button_toggled"/>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
<class name="image-button"/>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="icon_name">media-record-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Record</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="grid_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="active">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">view-grid-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="list_button">
|
||||
<property name="active">True</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="draw-indicator">False</property>
|
||||
<property name="group">grid_button</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">view-list-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
<class name="circular-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">emblem-system-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkSidebar">
|
||||
<property name="visible">True</property>
|
||||
<property name="stack">sidebar_stack</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="sidebar_stack">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">First Name</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Last Name</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">id</property>
|
||||
<property name="title">Identity</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="visible">True</property>
|
||||
<property name="active">9</property>
|
||||
<items>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
<item>11</item>
|
||||
<item>12</item>
|
||||
<item>13</item>
|
||||
<item>14</item>
|
||||
<item>15</item>
|
||||
<item>16</item>
|
||||
<item>17</item>
|
||||
<item>18</item>
|
||||
<item>19</item>
|
||||
<item>20</item>
|
||||
<item>21</item>
|
||||
<item>22</item>
|
||||
<item>23</item>
|
||||
<item>24</item>
|
||||
<item>25</item>
|
||||
<item>26</item>
|
||||
<item>27</item>
|
||||
<item>28</item>
|
||||
<item>29</item>
|
||||
<item>30</item>
|
||||
<item>31</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="visible">True</property>
|
||||
<property name="active">9</property>
|
||||
<items>
|
||||
<item>January</item>
|
||||
<item>February</item>
|
||||
<item>March</item>
|
||||
<item>April</item>
|
||||
<item>May</item>
|
||||
<item>June</item>
|
||||
<item>July</item>
|
||||
<item>August</item>
|
||||
<item>September</item>
|
||||
<item>October</item>
|
||||
<item>November</item>
|
||||
<item>December</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Year</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">bd</property>
|
||||
<property name="title">Birthdate</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Street</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">City</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="placeholder-text">Province</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">ad</property>
|
||||
<property name="title">Address</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="page_combo">
|
||||
<property name="visible">True</property>
|
||||
<property name="active">0</property>
|
||||
<signal name="changed" handler="on_page_combo_changed"/>
|
||||
<items>
|
||||
<item>Range</item>
|
||||
<item>All</item>
|
||||
<item>Current</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="range_from_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="adjustment">pg_adjustment</property>
|
||||
<signal name="value-changed" handler="on_range_from_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="range_to_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="adjustment">pg_adjustment2</property>
|
||||
<signal name="value-changed" handler="on_range_to_changed"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">Print</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">pg</property>
|
||||
<property name="title">Pages</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="icon-size">1</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">document-open-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton2">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">send-to-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton3">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">view-fullscreen-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton4">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">star-new-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="hscrollbar-policy">automatic</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="tooltextview">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">6</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton" id="cutbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-cut-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="copybutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-copy-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="pastebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-paste-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="deletebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="valign">end</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-size">1</property>
|
||||
<property name="icon-name">edit-delete-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkOverlay">
|
||||
<property name="visible">True</property>
|
||||
<child type="overlay">
|
||||
<object class="GtkToolbar" id="totem_like_osd">
|
||||
<property name="no-show-all">True</property>
|
||||
<property name="opacity">0.9</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">end</property>
|
||||
<style>
|
||||
<class name="osd"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw-value">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkVolumeButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="use-symbolic">True</property>
|
||||
<property name="value">.5</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="osd_frame">
|
||||
<property name="visible">True</property>
|
||||
<signal name="button-press-event" handler="osd_frame_button_press"/>
|
||||
<child>
|
||||
<object class="GtkPaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="wide-handle">True</property>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-border">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="show-border">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner">
|
||||
<property name="visible">True</property>
|
||||
@@ -3978,9 +3296,7 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">_Details</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">details_entry</property>
|
||||
<property name="label">Details</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -3993,7 +3309,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="details_entry">
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -4010,9 +3326,7 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">More D_etails</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">more_details_entry</property>
|
||||
<property name="label">More Details</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -4025,7 +3339,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="more_details_entry">
|
||||
<object class="GtkEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -4042,9 +3356,7 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">_Level</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">level_scale</property>
|
||||
<property name="label">Level</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -4057,7 +3369,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="level_scale">
|
||||
<object class="GtkScale">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -4076,9 +3388,7 @@ bad things might happen.</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">_Mode</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">mode_switch</property>
|
||||
<property name="label">Mode</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -4091,7 +3401,7 @@ bad things might happen.</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="mode_switch">
|
||||
<object class="GtkSwitch">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
@@ -4149,7 +3459,7 @@ bad things might happen.</property>
|
||||
<action-widget response="cancel">cancel_selection_dialog</action-widget>
|
||||
<action-widget response="ok" default="true">select_selection_dialog</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</object>
|
||||
<object class="GtkSizeGroup">
|
||||
<property name="mode">vertical</property>
|
||||
<widgets>
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
<xi:include href="xml/windows.xml" />
|
||||
<xi:include href="xml/gdkframeclock.xml" />
|
||||
<xi:include href="xml/gdkframetimings.xml" />
|
||||
<xi:include href="xml/gdkglcontext.xml" />
|
||||
<xi:include href="xml/events.xml" />
|
||||
<xi:include href="xml/event_structs.xml" />
|
||||
<xi:include href="xml/keys.xml" />
|
||||
@@ -93,10 +92,6 @@
|
||||
<title>Index of new symbols in 3.14</title>
|
||||
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-16" role="3.16">
|
||||
<title>Index of new symbols in 3.16</title>
|
||||
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -394,8 +394,6 @@ gdk_window_constrain_size
|
||||
gdk_window_beep
|
||||
gdk_window_get_scale_factor
|
||||
gdk_window_set_opaque_region
|
||||
gdk_window_create_gl_context
|
||||
gdk_window_mark_paint_from_clip
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_window_get_clip_region
|
||||
@@ -619,7 +617,6 @@ gdk_cairo_rectangle
|
||||
gdk_cairo_region
|
||||
gdk_cairo_region_create_from_surface
|
||||
gdk_cairo_surface_create_from_pixbuf
|
||||
gdk_cairo_draw_from_gl
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -1007,7 +1004,6 @@ gdk_x11_display_error_trap_pop
|
||||
gdk_x11_display_error_trap_pop_ignored
|
||||
gdk_x11_display_set_cursor_theme
|
||||
gdk_x11_display_set_window_scale
|
||||
gdk_x11_display_get_glx_version
|
||||
gdk_x11_register_standard_event_type
|
||||
gdk_x11_screen_get_screen_number
|
||||
gdk_x11_screen_get_xscreen
|
||||
@@ -1127,11 +1123,6 @@ GDK_X11_KEYMAP_CLASS
|
||||
GDK_IS_X11_KEYMAP
|
||||
GDK_IS_X11_KEYMAP_CLASS
|
||||
GDK_X11_KEYMAP_GET_CLASS
|
||||
GDK_TYPE_X11_GL_CONTEXT
|
||||
GDK_X11_GL_CONTEXT
|
||||
GDK_X11_GL_CONTEXT_CLASS
|
||||
GDK_IS_X11_GL_CONTEXT
|
||||
GDK_IS_X11_GL_CONTEXT_CLASS
|
||||
GDK_TYPE_X11_SCREEN
|
||||
GDK_X11_SCREEN
|
||||
GDK_X11_SCREEN_CLASS
|
||||
@@ -1282,27 +1273,3 @@ gdk_frame_timings_get_predicted_presentation_time
|
||||
<SUBSECTION Private>
|
||||
gdk_frame_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gdkglcontext</FILE>
|
||||
GdkGLContext
|
||||
gdk_gl_context_get_window
|
||||
gdk_gl_context_make_current
|
||||
gdk_gl_context_clear_current
|
||||
gdk_gl_context_get_current
|
||||
GDK_GL_ERROR
|
||||
GDK_TYPE_GL_ERROR
|
||||
GDK_TYPE_GL_PROFILE
|
||||
GdkGLProfile
|
||||
GdkGLError
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_GL_CONTEXT
|
||||
GDK_IS_GL_CONTEXT
|
||||
GDK_TYPE_GL_CONTEXT
|
||||
GDK_GL_CONTEXT_CLASS
|
||||
GDK_GL_CONTEXT_GET_CLASS
|
||||
GDK_IS_GL_CONTEXT_CLASS
|
||||
gdk_gl_context_get_type
|
||||
gdk_gl_error_quark
|
||||
</SECTION>
|
||||
|
||||
@@ -8,7 +8,6 @@ gdk_display_get_type
|
||||
gdk_display_manager_get_type
|
||||
gdk_drag_context_get_type
|
||||
gdk_frame_clock_get_type
|
||||
gdk_gl_context_get_type
|
||||
gdk_keymap_get_type
|
||||
gdk_screen_get_type
|
||||
gdk_visual_get_type
|
||||
|
||||
@@ -84,7 +84,6 @@ IGNORE_HFILES= \
|
||||
gtktextbufferserializ.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktextdisplay.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextlayout.h \
|
||||
gtktextmarkprivate.h \
|
||||
@@ -146,7 +145,6 @@ content_files = \
|
||||
osx.sgml \
|
||||
broadway.xml \
|
||||
wayland.xml \
|
||||
mir.xml \
|
||||
question_index.sgml \
|
||||
resources.sgml \
|
||||
text_widget.sgml \
|
||||
@@ -154,7 +152,6 @@ content_files = \
|
||||
windows.sgml \
|
||||
x11.sgml \
|
||||
gtk3-demo.xml \
|
||||
gtk3-demo-application.xml \
|
||||
gtk3-widget-factory.xml \
|
||||
gtk3-icon-browser.xml \
|
||||
gtk-query-immodules-3.0.xml \
|
||||
@@ -207,7 +204,6 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/font-button.png \
|
||||
$(srcdir)/images/fontchooser.png \
|
||||
$(srcdir)/images/frame.png \
|
||||
$(srcdir)/images/glarea.png \
|
||||
$(srcdir)/images/headerbar.png \
|
||||
$(srcdir)/images/icon-view.png \
|
||||
$(srcdir)/images/image.png \
|
||||
@@ -239,7 +235,6 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/search-bar.png \
|
||||
$(srcdir)/images/search-entry.png \
|
||||
$(srcdir)/images/separator.png \
|
||||
$(srcdir)/images/sidebar.png \
|
||||
$(srcdir)/images/spinbutton.png \
|
||||
$(srcdir)/images/spinner.png \
|
||||
$(srcdir)/images/stack.png \
|
||||
@@ -344,7 +339,6 @@ man_MANS = \
|
||||
gtk-encode-symbolic-svg.1 \
|
||||
gtk-launch.1 \
|
||||
gtk3-demo.1 \
|
||||
gtk3-demo-application.1 \
|
||||
gtk3-widget-factory.1 \
|
||||
gtk3-icon-browser.1 \
|
||||
broadwayd.1
|
||||
|
||||
@@ -254,19 +254,6 @@ How to compile GTK+ itself
|
||||
drawing.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="https://github.com/anholt/libepoxy">libepoxy</ulink>
|
||||
is a library that abstracts the differences between different
|
||||
OpenGL libraries. GTK+ uses it for cross-platform GL support.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="http://wayland.freedesktop.org">Wayland</ulink> libraries
|
||||
are needed to build GTK+ with the Wayland backend.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink url="http://www.freedesktop.org/wiki/Software/shared-mime-info">shared-mime-info</ulink>
|
||||
@@ -407,11 +394,6 @@ 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>
|
||||
@@ -613,10 +595,8 @@ 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>,
|
||||
<systemitem>--disable-wayland-backend</systemitem>
|
||||
<systemitem>--enable-mir-backend</systemitem>, and
|
||||
<systemitem>--disable-mir-backend</systemitem></title>
|
||||
<systemitem>--enable-wayland-backend</systemitem>, and
|
||||
<systemitem>--disable-wayland-backend</systemitem></title>
|
||||
|
||||
<para>
|
||||
Enables specific backends for GDK. If none of these options
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
<xi:include href="xml/gtkflowbox.xml" />
|
||||
<xi:include href="xml/gtkstack.xml" />
|
||||
<xi:include href="xml/gtkstackswitcher.xml" />
|
||||
<xi:include href="xml/gtksidebar.xml" />
|
||||
<xi:include href="xml/gtkactionbar.xml" />
|
||||
<xi:include href="xml/gtkheaderbar.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
@@ -114,7 +113,6 @@
|
||||
<xi:include href="xml/gtkscalebutton.xml" />
|
||||
<xi:include href="xml/gtkvolumebutton.xml" />
|
||||
<xi:include href="xml/gtklockbutton.xml" />
|
||||
<xi:include href="xml/gtkmodelbutton.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="NumericEntry">
|
||||
@@ -192,7 +190,6 @@
|
||||
<xi:include href="xml/gtktoggletoolbutton.xml" />
|
||||
<xi:include href="xml/gtkradiotoolbutton.xml" />
|
||||
<xi:include href="xml/gtkpopover.xml" />
|
||||
<xi:include href="xml/gtkpopovermenu.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="SelectorWidgets">
|
||||
@@ -244,7 +241,6 @@
|
||||
<xi:include href="xml/gtkadjustment.xml" />
|
||||
<xi:include href="xml/gtkcalendar.xml" />
|
||||
<xi:include href="xml/gtkdrawingarea.xml" />
|
||||
<xi:include href="xml/gtkglarea.xml" />
|
||||
<xi:include href="xml/gtkeventbox.xml" />
|
||||
<xi:include href="xml/gtkhandlebox.xml" />
|
||||
<xi:include href="xml/gtkimcontextsimple.xml" />
|
||||
@@ -398,7 +394,6 @@
|
||||
<part>
|
||||
<title>GTK+ Tools</title>
|
||||
<xi:include href="gtk3-demo.xml" />
|
||||
<xi:include href="gtk3-demo-application.xml" />
|
||||
<xi:include href="gtk3-widget-factory.xml" />
|
||||
<xi:include href="gtk3-icon-browser.xml" />
|
||||
<xi:include href="gtk-query-immodules-3.0.xml" />
|
||||
@@ -418,7 +413,6 @@
|
||||
<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" />
|
||||
@@ -463,10 +457,6 @@
|
||||
<title>Index of new symbols in 3.14</title>
|
||||
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-16" role="3.16">
|
||||
<title>Index of new symbols in 3.16</title>
|
||||
<xi:include href="xml/api-index-3.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?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="gtk3-demo-application">
|
||||
|
||||
<refentryinfo>
|
||||
<title>gtk3-demo-application</title>
|
||||
<productname>GTK+</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Matthias</firstname>
|
||||
<surname>Clasen</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk3-demo-application</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
<refmiscinfo class="manual">User Commands</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk3-demo-application</refname>
|
||||
<refpurpose>Demonstrate GtkApplication</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>gtk3-demo-application</command>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para>
|
||||
<command>gtk3-demo-application</command> is an example application
|
||||
used by <command>gtk3-demo</command>. There is no need to call it
|
||||
manually.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
@@ -2085,8 +2085,6 @@ gtk_label_set_markup
|
||||
gtk_label_set_markup_with_mnemonic
|
||||
gtk_label_set_pattern
|
||||
gtk_label_set_justify
|
||||
gtk_label_set_xalign
|
||||
gtk_label_set_yalign
|
||||
gtk_label_set_ellipsize
|
||||
gtk_label_set_width_chars
|
||||
gtk_label_set_max_width_chars
|
||||
@@ -2104,8 +2102,6 @@ gtk_label_set_selectable
|
||||
gtk_label_set_text_with_mnemonic
|
||||
gtk_label_get_attributes
|
||||
gtk_label_get_justify
|
||||
gtk_label_get_xalign
|
||||
gtk_label_get_yalign
|
||||
gtk_label_get_ellipsize
|
||||
gtk_label_get_width_chars
|
||||
gtk_label_get_max_width_chars
|
||||
@@ -2593,8 +2589,6 @@ gtk_paned_get_child2
|
||||
gtk_paned_set_position
|
||||
gtk_paned_get_position
|
||||
gtk_paned_get_handle_window
|
||||
gtk_paned_set_wide_handle
|
||||
gtk_paned_get_wide_handle
|
||||
<SUBSECTION Standard>
|
||||
GTK_PANED
|
||||
GTK_IS_PANED
|
||||
@@ -3154,8 +3148,6 @@ gtk_scrolled_window_set_kinetic_scrolling
|
||||
gtk_scrolled_window_get_kinetic_scrolling
|
||||
gtk_scrolled_window_set_capture_button_press
|
||||
gtk_scrolled_window_get_capture_button_press
|
||||
gtk_scrolled_window_set_overlay_scrolling
|
||||
gtk_scrolled_window_get_overlay_scrolling
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_SCROLLED_WINDOW
|
||||
@@ -3547,7 +3539,6 @@ gtk_tearoff_menu_item_get_type
|
||||
<FILE>gtktextbuffer</FILE>
|
||||
<TITLE>GtkTextBuffer</TITLE>
|
||||
GtkTextBuffer
|
||||
GtkTextBufferClass
|
||||
gtk_text_buffer_new
|
||||
gtk_text_buffer_get_line_count
|
||||
gtk_text_buffer_get_char_count
|
||||
@@ -3634,9 +3625,9 @@ GTK_TYPE_TEXT_BUFFER
|
||||
GTK_TEXT_BUFFER_CLASS
|
||||
GTK_IS_TEXT_BUFFER_CLASS
|
||||
GTK_TEXT_BUFFER_GET_CLASS
|
||||
gtk_text_buffer_get_type
|
||||
<SUBSECTION Private>
|
||||
GtkTextBufferPrivate
|
||||
gtk_text_buffer_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -3788,7 +3779,6 @@ GTK_IS_TEXT_TAG_CLASS
|
||||
GTK_TEXT_TAG_GET_CLASS
|
||||
GTK_TYPE_TEXT_ATTRIBUTES
|
||||
<SUBSECTION Private>
|
||||
GtkTextTagPrivate
|
||||
gtk_text_tag_get_type
|
||||
gtk_text_attributes_get_type
|
||||
</SECTION>
|
||||
@@ -3839,7 +3829,7 @@ gtk_text_view_get_visible_rect
|
||||
gtk_text_view_get_iter_location
|
||||
gtk_text_view_get_cursor_locations
|
||||
gtk_text_view_get_line_at_y
|
||||
gtk_text_view_get_line_yrange
|
||||
/gtk_text_view_get_line_yrange
|
||||
gtk_text_view_get_iter_at_location
|
||||
gtk_text_view_get_iter_at_position
|
||||
gtk_text_view_buffer_to_window_coords
|
||||
@@ -3894,8 +3884,6 @@ gtk_text_view_set_input_purpose
|
||||
gtk_text_view_get_input_purpose
|
||||
gtk_text_view_set_input_hints
|
||||
gtk_text_view_get_input_hints
|
||||
gtk_text_view_set_monospace
|
||||
gtk_text_view_get_monospace
|
||||
GTK_TEXT_VIEW_PRIORITY_VALIDATE
|
||||
<SUBSECTION Standard>
|
||||
GTK_TEXT_VIEW
|
||||
@@ -5747,7 +5735,6 @@ gtk_window_get_application
|
||||
gtk_window_set_application
|
||||
gtk_window_set_has_user_ref_count
|
||||
gtk_window_set_titlebar
|
||||
gtk_window_get_titlebar
|
||||
gtk_window_set_interactive_debugging
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -6009,7 +5996,6 @@ GTK_STYLE_CLASS_IMAGE
|
||||
GTK_STYLE_CLASS_INFO
|
||||
GTK_STYLE_CLASS_INLINE_TOOLBAR
|
||||
GTK_STYLE_CLASS_INSERTION_CURSOR
|
||||
GTK_STYLE_CLASS_LABEL
|
||||
GTK_STYLE_CLASS_LEFT
|
||||
GTK_STYLE_CLASS_LEVEL_BAR
|
||||
GTK_STYLE_CLASS_LINKED
|
||||
@@ -6020,13 +6006,11 @@ GTK_STYLE_CLASS_MENU
|
||||
GTK_STYLE_CLASS_MENUBAR
|
||||
GTK_STYLE_CLASS_MENUITEM
|
||||
GTK_STYLE_CLASS_MESSAGE_DIALOG
|
||||
GTK_STYLE_CLASS_MONOSPACE
|
||||
GTK_STYLE_CLASS_NEEDS_ATTENTION
|
||||
GTK_STYLE_CLASS_NOTEBOOK
|
||||
GTK_STYLE_CLASS_OSD
|
||||
GTK_STYLE_CLASS_OVERSHOOT
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
@@ -6046,7 +6030,6 @@ GTK_STYLE_CLASS_SIDEBAR
|
||||
GTK_STYLE_CLASS_SLIDER
|
||||
GTK_STYLE_CLASS_SPINBUTTON
|
||||
GTK_STYLE_CLASS_SPINNER
|
||||
GTK_STYLE_CLASS_STATUSBAR
|
||||
GTK_STYLE_CLASS_SUBTITLE
|
||||
GTK_STYLE_CLASS_SUGGESTED_ACTION
|
||||
GTK_STYLE_CLASS_TITLE
|
||||
@@ -6058,7 +6041,6 @@ GTK_STYLE_CLASS_TROUGH
|
||||
GTK_STYLE_CLASS_VERTICAL
|
||||
GTK_STYLE_CLASS_VIEW
|
||||
GTK_STYLE_CLASS_WARNING
|
||||
GTK_STYLE_CLASS_WIDE
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
@@ -6173,7 +6155,6 @@ gtk_css_provider_get_named
|
||||
gtk_css_provider_load_from_data
|
||||
gtk_css_provider_load_from_file
|
||||
gtk_css_provider_load_from_path
|
||||
gtk_css_provider_load_from_resource
|
||||
gtk_css_provider_new
|
||||
gtk_css_provider_to_string
|
||||
GTK_CSS_PROVIDER_ERROR
|
||||
@@ -7152,7 +7133,6 @@ GTK_PAPER_NAME_EXECUTIVE
|
||||
GTK_PAPER_NAME_LEGAL
|
||||
gtk_paper_size_new
|
||||
gtk_paper_size_new_from_ppd
|
||||
gtk_paper_size_new_from_ipp
|
||||
gtk_paper_size_new_custom
|
||||
gtk_paper_size_copy
|
||||
gtk_paper_size_free
|
||||
@@ -7163,7 +7143,6 @@ gtk_paper_size_get_display_name
|
||||
gtk_paper_size_get_ppd_name
|
||||
gtk_paper_size_get_width
|
||||
gtk_paper_size_get_height
|
||||
gtk_paper_size_is_ipp
|
||||
gtk_paper_size_is_custom
|
||||
gtk_paper_size_set_size
|
||||
gtk_paper_size_get_default_top_margin
|
||||
@@ -7847,10 +7826,6 @@ gtk_stack_get_visible_child_name
|
||||
gtk_stack_set_visible_child_full
|
||||
gtk_stack_set_homogeneous
|
||||
gtk_stack_get_homogeneous
|
||||
gtk_stack_set_hhomogeneous
|
||||
gtk_stack_get_hhomogeneous
|
||||
gtk_stack_set_vhomogeneous
|
||||
gtk_stack_get_vhomogeneous
|
||||
gtk_stack_set_transition_duration
|
||||
gtk_stack_get_transition_duration
|
||||
GtkStackTransitionType
|
||||
@@ -7956,22 +7931,6 @@ gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkpopovermenu</FILE>
|
||||
<TITLE>GtkPopoverMenu</TITLE>
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_open_submenu
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmodelbutton</FILE>
|
||||
<TITLE>GtkModelButton</TITLE>
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkeventcontroller</FILE>
|
||||
<TITLE>GtkEventController</TITLE>
|
||||
@@ -8196,46 +8155,3 @@ GTK_GESTURE_ZOOM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_gesture_zoom_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtksidebar</FILE>
|
||||
GtkSidebar
|
||||
GtkSidebarClass
|
||||
gtk_sidebar_new
|
||||
gtk_sidebar_set_stack
|
||||
gtk_sidebar_get_stack
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SIDEBAR
|
||||
GTK_SIDEBAR
|
||||
GTK_SIDEBAR_CLASS
|
||||
GTK_IS_SIDEBAR
|
||||
GTK_IS_SIDEBAR_CLASS
|
||||
GTK_SIDEBAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkSidebarPrivate
|
||||
gtk_sidebar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkglarea</FILE>
|
||||
GtkGLArea
|
||||
GtkGLAreaClass
|
||||
gtk_gl_area_new
|
||||
gtk_gl_area_get_context
|
||||
<SUBSECTION>
|
||||
gtk_gl_area_set_has_alpha
|
||||
gtk_gl_area_get_has_alpha
|
||||
gtk_gl_area_set_has_depth_buffer
|
||||
gtk_gl_area_get_has_depth_buffer
|
||||
gtk_gl_area_make_current
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GL_AREA
|
||||
GTK_GL_AREA
|
||||
GTK_GL_AREA_CLASS
|
||||
GTK_IS_GL_AREA
|
||||
GTK_IS_GL_AREA_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_gl_area_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -90,7 +90,6 @@ gtk_gesture_rotate_get_type
|
||||
gtk_gesture_single_get_type
|
||||
gtk_gesture_swipe_get_type
|
||||
gtk_gesture_zoom_get_type
|
||||
gtk_gl_area_get_type
|
||||
gtk_grid_get_type
|
||||
gtk_handle_box_get_type
|
||||
gtk_hbox_get_type
|
||||
@@ -126,7 +125,6 @@ gtk_menu_shell_get_type
|
||||
gtk_menu_tool_button_get_type
|
||||
gtk_message_dialog_get_type
|
||||
gtk_misc_get_type
|
||||
gtk_model_button_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_notebook_get_type
|
||||
gtk_numerable_icon_get_type
|
||||
@@ -140,7 +138,6 @@ gtk_paper_size_get_type
|
||||
gtk_places_sidebar_get_type
|
||||
@ENABLE_ON_X11@gtk_plug_get_type
|
||||
gtk_popover_get_type
|
||||
gtk_popover_menu_get_type
|
||||
@DISABLE_ON_W32@gtk_printer_get_type
|
||||
gtk_print_context_get_type
|
||||
@DISABLE_ON_W32@gtk_print_job_get_type
|
||||
@@ -173,7 +170,6 @@ gtk_separator_get_type
|
||||
gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_sidebar_get_type
|
||||
gtk_size_group_get_type
|
||||
@ENABLE_ON_X11@gtk_socket_get_type
|
||||
gtk_spin_button_get_type
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,35 +0,0 @@
|
||||
<?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>
|
||||
@@ -399,10 +399,6 @@ nevertheless.
|
||||
<term>misc</term>
|
||||
<listitem><para>Miscellaneous information</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>nogl</term>
|
||||
<listitem><para>Turn off OpenGL. GDK will behave as if OpenGL support was not available.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>nograbs</term>
|
||||
<listitem><para>Turn off all pointer and keyboard grabs</para></listitem>
|
||||
@@ -491,11 +487,6 @@ 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
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
<link linkend="GtkScale">
|
||||
<inlinegraphic fileref="scales.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkGLArea">
|
||||
<inlinegraphic fileref="glarea.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -144,9 +141,6 @@
|
||||
<link linkend="GtkStackSwitcher">
|
||||
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkSidebar">
|
||||
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkTreeView">
|
||||
<inlinegraphic fileref="list-and-tree.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
|
||||
@@ -5,7 +5,6 @@ AM_CPPFLAGS = \
|
||||
-I$(top_builddir)/gdk \
|
||||
-I$(top_srcdir)/gdk \
|
||||
-I$(top_srcdir)/gdk/x11 \
|
||||
-I$(top_srcdir)/tests \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GTK_DEP_CFLAGS)
|
||||
|
||||
@@ -31,9 +30,7 @@ doc_shooter_SOURCES= \
|
||||
shadow.h \
|
||||
shooter.c \
|
||||
widgets.c \
|
||||
widgets.h \
|
||||
$(top_srcdir)/tests/gtkgears.c \
|
||||
$(top_srcdir)/tests/gtkgears.h
|
||||
widgets.h
|
||||
|
||||
clean-local:
|
||||
for file in *.png; do \
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <X11/Xatom.h>
|
||||
#include <gdkx.h>
|
||||
#include "widgets.h"
|
||||
#include "gtkgears.h"
|
||||
|
||||
#define SMALL_WIDTH 240
|
||||
#define SMALL_HEIGHT 75
|
||||
@@ -1386,41 +1385,6 @@ create_stack_switcher (void)
|
||||
return new_widget_info ("stackswitcher", vbox, ASIS);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_sidebar (void)
|
||||
{
|
||||
GtkWidget *stack;
|
||||
GtkWidget *sidebar;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *view;
|
||||
GtkWidget *frame;
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_widget_set_size_request (stack, 120, 120);
|
||||
view = gtk_label_new ("Sidebar");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (view), "view");
|
||||
gtk_widget_set_halign (view, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (view, GTK_ALIGN_FILL);
|
||||
gtk_widget_show (view);
|
||||
gtk_stack_add_titled (GTK_STACK (stack), view, "page1", "Page 1");
|
||||
view = gtk_text_view_new ();
|
||||
gtk_widget_show (view);
|
||||
gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
|
||||
|
||||
sidebar = gtk_sidebar_new ();
|
||||
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), sidebar, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), stack, TRUE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||
|
||||
return new_widget_info ("sidebar", frame, ASIS);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_list_box (void)
|
||||
{
|
||||
@@ -1516,24 +1480,6 @@ create_flow_box (void)
|
||||
return info;
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_gl_area (void)
|
||||
{
|
||||
WidgetInfo *info;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *gears;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_container_add (GTK_CONTAINER (widget), gears);
|
||||
|
||||
info = new_widget_info ("glarea", widget, MEDIUM);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
GList *
|
||||
get_all_widgets (void)
|
||||
{
|
||||
@@ -1598,8 +1544,6 @@ get_all_widgets (void)
|
||||
retval = g_list_prepend (retval, create_search_entry ());
|
||||
retval = g_list_prepend (retval, create_level_bar ());
|
||||
retval = g_list_prepend (retval, create_info_bar ());
|
||||
retval = g_list_prepend (retval, create_gl_area ());
|
||||
retval = g_list_prepend (retval, create_sidebar ());
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -208,9 +208,7 @@ plugin_action (GAction *action,
|
||||
|
||||
gdk_rgba_parse (&color, g_action_get_name (action));
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_widget_override_color (text, 0, &color);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -13,7 +13,7 @@ INTROSPECTION_COMPILER_ARGS = \
|
||||
|
||||
SUBDIRS = $(GDK_BACKENDS) .
|
||||
|
||||
DIST_SUBDIRS = win32 x11 quartz broadway wayland mir
|
||||
DIST_SUBDIRS = win32 x11 quartz broadway wayland
|
||||
|
||||
CLEANFILES =
|
||||
|
||||
@@ -71,7 +71,6 @@ gdk_public_h_sources = \
|
||||
gdkdnd.h \
|
||||
gdkevents.h \
|
||||
gdkframetimings.h \
|
||||
gdkglcontext.h \
|
||||
gdkkeys.h \
|
||||
gdkkeysyms.h \
|
||||
gdkkeysyms-compat.h \
|
||||
@@ -99,7 +98,6 @@ gdk_h_sources = \
|
||||
$(deprecated_h_sources)
|
||||
|
||||
gdk_private_headers = \
|
||||
gdk-private.h \
|
||||
gdkapplaunchcontextprivate.h \
|
||||
gdkcursorprivate.h \
|
||||
gdkdevicemanagerprivate.h \
|
||||
@@ -109,7 +107,6 @@ gdk_private_headers = \
|
||||
gdkdndprivate.h \
|
||||
gdkframeclockidle.h \
|
||||
gdkframeclockprivate.h \
|
||||
gdkglcontextprivate.h \
|
||||
gdkscreenprivate.h \
|
||||
gdkinternals.h \
|
||||
gdkintl.h \
|
||||
@@ -122,7 +119,6 @@ deprecated_c_sources = \
|
||||
|
||||
gdk_c_sources = \
|
||||
$(deprecated_c_sources) \
|
||||
gdk-private.c \
|
||||
gdk.c \
|
||||
gdkapplaunchcontext.c \
|
||||
gdkcairo.c \
|
||||
@@ -135,8 +131,6 @@ gdk_c_sources = \
|
||||
gdkdnd.c \
|
||||
gdkevents.c \
|
||||
gdkframetimings.c \
|
||||
gdkgl.c \
|
||||
gdkglcontext.c \
|
||||
gdkglobals.c \
|
||||
gdkkeys.c \
|
||||
gdkkeyuni.c \
|
||||
@@ -207,10 +201,6 @@ 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 = \
|
||||
|
||||
@@ -1387,7 +1387,8 @@ broadway_server_destroy_window (BroadwayServer *server,
|
||||
g_hash_table_remove (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
|
||||
g_free (window->cached_surface_name);
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
if (window->cached_surface != NULL)
|
||||
cairo_surface_destroy (window->cached_surface);
|
||||
|
||||
@@ -1747,7 +1748,8 @@ broadway_server_open_surface (BroadwayServer *server,
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
g_free (window->cached_surface_name);
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
window->cached_surface_name = g_strdup (name);
|
||||
|
||||
if (window->cached_surface != NULL)
|
||||
|
||||
@@ -140,7 +140,7 @@ _gdk_broadway_server_new (const char *display, GError **error)
|
||||
else
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
_("Broadway display type not supported: %s"), display);
|
||||
_("broadway display type not supported '%s'"), display);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
|
||||
GdkWindow *root_window;
|
||||
GdkWindow *window;
|
||||
|
||||
screen = gdk_display_get_default_screen (gdk_device_get_display (device));
|
||||
screen = gdk_screen_get_default ();
|
||||
root_window = gdk_screen_get_root_window (screen);
|
||||
|
||||
gdk_broadway_device_query_state (device, root_window, NULL, &window, NULL, NULL, win_x, win_y, mask);
|
||||
|
||||
@@ -330,6 +330,19 @@ gdk_broadway_display_get_next_serial (GdkDisplay *display)
|
||||
return _gdk_broadway_server_get_next_serial (broadway_display->server);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_broadway_display_show_keyboard (GdkBroadwayDisplay *display)
|
||||
{
|
||||
@@ -385,6 +398,8 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
display_class->after_process_all_updates = _gdk_broadway_display_after_process_all_updates;
|
||||
display_class->get_next_serial = gdk_broadway_display_get_next_serial;
|
||||
display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete;
|
||||
display_class->event_data_copy = gdk_broadway_display_event_data_copy;
|
||||
display_class->event_data_free = gdk_broadway_display_event_data_free;
|
||||
display_class->create_window_impl = _gdk_broadway_display_create_window_impl;
|
||||
display_class->get_keymap = _gdk_broadway_display_get_keymap;
|
||||
display_class->get_selection_owner = _gdk_broadway_display_get_selection_owner;
|
||||
|
||||
@@ -92,31 +92,14 @@ gdk_event_source_check (GSource *source)
|
||||
void
|
||||
_gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkBroadwayDisplay *display_broadway;
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
GdkBroadwayDisplay *display_broadway = GDK_BROADWAY_DISPLAY (display);
|
||||
GdkBroadwayDeviceManager *device_manager;
|
||||
GdkScreen *screen;
|
||||
GdkWindow *window;
|
||||
GdkEvent *event = NULL;
|
||||
GList *node;
|
||||
GSList *list, *d;
|
||||
|
||||
display = NULL;
|
||||
|
||||
list = gdk_display_manager_list_displays (gdk_display_manager_get ());
|
||||
for (d = list; d; d = d->next)
|
||||
{
|
||||
if (GDK_IS_BROADWAY_DISPLAY (d->data))
|
||||
{
|
||||
display = d->data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_slist_free (list);
|
||||
|
||||
g_assert (display != NULL);
|
||||
|
||||
display_broadway = GDK_BROADWAY_DISPLAY (display);
|
||||
device_manager = GDK_BROADWAY_DEVICE_MANAGER (gdk_display_get_device_manager (display));
|
||||
|
||||
switch (message->base.type) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_EVENT_SOURCE_H__
|
||||
#define __GDK_EVENT_SOURCE_H__
|
||||
#ifndef __GDK_BROADWAY_EVENT_SOURCE_H__
|
||||
#define __GDK_BROADWAY_EVENT_SOURCE_H__
|
||||
|
||||
#include "gdkprivate-broadway.h"
|
||||
|
||||
@@ -29,4 +29,4 @@ GSource * _gdk_broadway_event_source_new (GdkDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_EVENT_SOURCE_H__ */
|
||||
#endif /* __GDK_BROADWAY_EVENT_SOURCE_H__ */
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#include "gdkwindow-broadway.h"
|
||||
#include "gdkscreen-broadway.h"
|
||||
|
||||
#include "gdkbroadwaydisplay.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkdisplay-broadway.h"
|
||||
@@ -83,28 +81,6 @@ G_DEFINE_TYPE (GdkWindowImplBroadway,
|
||||
gdk_window_impl_broadway,
|
||||
GDK_TYPE_WINDOW_IMPL)
|
||||
|
||||
static GdkDisplay *
|
||||
find_broadway_display (void)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GSList *list, *l;
|
||||
|
||||
display = NULL;
|
||||
|
||||
list = gdk_display_manager_list_displays (gdk_display_manager_get ());
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
if (GDK_IS_BROADWAY_DISPLAY (l->data))
|
||||
{
|
||||
display = l->data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_slist_free (list);
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static void
|
||||
update_dirty_windows_and_sync (void)
|
||||
{
|
||||
@@ -112,8 +88,7 @@ update_dirty_windows_and_sync (void)
|
||||
GdkBroadwayDisplay *display;
|
||||
gboolean updated_surface;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (find_broadway_display ());
|
||||
g_assert (display != NULL);
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
|
||||
|
||||
updated_surface = FALSE;
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
@@ -145,7 +120,7 @@ flush_idle (gpointer data)
|
||||
{
|
||||
flush_id = 0;
|
||||
|
||||
gdk_display_flush (find_broadway_display ());
|
||||
gdk_display_flush (gdk_display_get_default ());
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1012,6 +987,13 @@ gdk_broadway_window_end_paint (GdkWindow *window)
|
||||
impl->dirty = TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_broadway_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct _MoveResizeData MoveResizeData;
|
||||
|
||||
struct _MoveResizeData
|
||||
@@ -1147,7 +1129,12 @@ finish_drag (MoveResizeData *mv_resize)
|
||||
mv_resize->moveresize_emulation_window = NULL;
|
||||
g_object_unref (mv_resize->moveresize_window);
|
||||
mv_resize->moveresize_window = NULL;
|
||||
g_clear_pointer (&mv_resize->moveresize_pending_event, g_free);
|
||||
|
||||
if (mv_resize->moveresize_pending_event)
|
||||
{
|
||||
g_free (mv_resize->moveresize_pending_event);
|
||||
mv_resize->moveresize_pending_event = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1527,6 +1514,7 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
|
||||
impl_class->get_device_state = gdk_window_broadway_get_device_state;
|
||||
impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region;
|
||||
impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
|
||||
impl_class->set_static_gravities = gdk_window_broadway_set_static_gravities;
|
||||
impl_class->destroy = _gdk_broadway_window_destroy;
|
||||
impl_class->destroy_foreign = gdk_broadway_window_destroy_foreign;
|
||||
impl_class->get_shape = gdk_broadway_window_get_shape;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "config.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
GdkPrivateVTable *
|
||||
gdk__private__ (void)
|
||||
{
|
||||
static GdkPrivateVTable table = {
|
||||
gdk_device_grab_info,
|
||||
gdk_display_open_default,
|
||||
gdk_add_option_entries,
|
||||
gdk_pre_parse,
|
||||
gdk_gl_get_flags,
|
||||
gdk_gl_set_flags,
|
||||
gdk_window_freeze_toplevel_updates,
|
||||
gdk_window_thaw_toplevel_updates,
|
||||
gdk_display_get_rendering_mode,
|
||||
gdk_display_set_rendering_mode,
|
||||
gdk_display_get_debug_updates,
|
||||
gdk_display_set_debug_updates
|
||||
};
|
||||
|
||||
return &table;
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
#ifndef __GDK__PRIVATE_H__
|
||||
#define __GDK__PRIVATE_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include "gdk/gdkinternals.h"
|
||||
|
||||
#define GDK_PRIVATE_CALL(symbol) (gdk__private__ ()->symbol)
|
||||
|
||||
GdkDisplay * gdk_display_open_default (void);
|
||||
|
||||
gboolean gdk_device_grab_info (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events);
|
||||
|
||||
void gdk_add_option_entries (GOptionGroup *group);
|
||||
|
||||
void gdk_pre_parse (void);
|
||||
|
||||
GdkGLFlags gdk_gl_get_flags (void);
|
||||
void gdk_gl_set_flags (GdkGLFlags flags);
|
||||
|
||||
void gdk_window_freeze_toplevel_updates (GdkWindow *window);
|
||||
void gdk_window_thaw_toplevel_updates (GdkWindow *window);
|
||||
|
||||
GdkRenderingMode gdk_display_get_rendering_mode (GdkDisplay *display);
|
||||
void gdk_display_set_rendering_mode (GdkDisplay *display,
|
||||
GdkRenderingMode mode);
|
||||
|
||||
gboolean gdk_display_get_debug_updates (GdkDisplay *display);
|
||||
void gdk_display_set_debug_updates (GdkDisplay *display,
|
||||
gboolean debug_updates);
|
||||
|
||||
typedef struct {
|
||||
/* add all private functions here, initialize them in gdk-private.c */
|
||||
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events);
|
||||
|
||||
GdkDisplay *(* gdk_display_open_default) (void);
|
||||
|
||||
void (* gdk_add_option_entries) (GOptionGroup *group);
|
||||
void (* gdk_pre_parse) (void);
|
||||
|
||||
GdkGLFlags (* gdk_gl_get_flags) (void);
|
||||
void (* gdk_gl_set_flags) (GdkGLFlags flags);
|
||||
|
||||
void (* gdk_window_freeze_toplevel_updates) (GdkWindow *window);
|
||||
void (* gdk_window_thaw_toplevel_updates) (GdkWindow *window);
|
||||
|
||||
GdkRenderingMode (* gdk_display_get_rendering_mode) (GdkDisplay *display);
|
||||
void (* gdk_display_set_rendering_mode) (GdkDisplay *display,
|
||||
GdkRenderingMode mode);
|
||||
|
||||
gboolean (* gdk_display_get_debug_updates) (GdkDisplay *display);
|
||||
void (* gdk_display_set_debug_updates) (GdkDisplay *display,
|
||||
gboolean debug_updates);
|
||||
} GdkPrivateVTable;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkPrivateVTable * gdk__private__ (void);
|
||||
|
||||
#endif /* __GDK__PRIVATE_H__ */
|
||||
81
gdk/gdk.c
81
gdk/gdk.c
@@ -30,8 +30,6 @@
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkintl.h"
|
||||
|
||||
#include "gdk-private.h"
|
||||
|
||||
#ifndef HAVE_XCONVERTCASE
|
||||
#include "gdkkeysyms.h"
|
||||
#endif
|
||||
@@ -136,15 +134,6 @@ static GMutex gdk_threads_mutex;
|
||||
static GCallback gdk_threads_lock = NULL;
|
||||
static GCallback gdk_threads_unlock = NULL;
|
||||
|
||||
static const GDebugKey gdk_gl_keys[] = {
|
||||
{"disable", GDK_GL_DISABLE},
|
||||
{"always", GDK_GL_ALWAYS},
|
||||
{"software-draw", GDK_GL_SOFTWARE_DRAW_GL | GDK_GL_SOFTWARE_DRAW_SURFACE},
|
||||
{"software-draw-gl", GDK_GL_SOFTWARE_DRAW_GL},
|
||||
{"software-draw-surface", GDK_GL_SOFTWARE_DRAW_SURFACE},
|
||||
{"texture-rectangle", GDK_GL_TEXTURE_RECTANGLE},
|
||||
};
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const GDebugKey gdk_debug_keys[] = {
|
||||
{"events", GDK_DEBUG_EVENTS},
|
||||
@@ -159,8 +148,7 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{"draw", GDK_DEBUG_DRAW},
|
||||
{"eventloop", GDK_DEBUG_EVENTLOOP},
|
||||
{"frames", GDK_DEBUG_FRAMES},
|
||||
{"settings", GDK_DEBUG_SETTINGS},
|
||||
{"opengl", GDK_DEBUG_OPENGL},
|
||||
{"settings", GDK_DEBUG_SETTINGS}
|
||||
};
|
||||
|
||||
static gboolean
|
||||
@@ -241,33 +229,23 @@ static const GOptionEntry gdk_args[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
void
|
||||
gdk_add_option_entries (GOptionGroup *group)
|
||||
{
|
||||
g_option_group_add_entries (group, gdk_args);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_add_option_entries_libgtk_only:
|
||||
* @group: An option group.
|
||||
*
|
||||
* Appends gdk option entries to the passed in option group. This is
|
||||
* not public API and must not be used by applications.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
void
|
||||
gdk_add_option_entries_libgtk_only (GOptionGroup *group)
|
||||
{
|
||||
gdk_add_option_entries (group);
|
||||
g_option_group_add_entries (group, gdk_args);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_pre_parse (void)
|
||||
gdk_pre_parse_libgtk_only (void)
|
||||
{
|
||||
const char *rendering_mode;
|
||||
const gchar *gl_string;
|
||||
|
||||
gdk_initialized = TRUE;
|
||||
|
||||
@@ -288,12 +266,6 @@ gdk_pre_parse (void)
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
gl_string = getenv("GDK_GL");
|
||||
if (gl_string != NULL)
|
||||
_gdk_gl_flags = g_parse_debug_string (gl_string,
|
||||
(GDebugKey *) gdk_gl_keys,
|
||||
G_N_ELEMENTS (gdk_gl_keys));
|
||||
|
||||
if (getenv ("GDK_NATIVE_WINDOWS"))
|
||||
{
|
||||
g_warning ("The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.\n"
|
||||
@@ -313,20 +285,6 @@ gdk_pre_parse (void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pre_parse_libgtk_only:
|
||||
*
|
||||
* Prepare for parsing command line arguments for GDK. This is not
|
||||
* public API and should not be used in application code.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
void
|
||||
gdk_pre_parse_libgtk_only (void)
|
||||
{
|
||||
gdk_pre_parse ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_parse_args:
|
||||
@@ -355,7 +313,7 @@ gdk_parse_args (int *argc,
|
||||
if (gdk_initialized)
|
||||
return;
|
||||
|
||||
gdk_pre_parse ();
|
||||
gdk_pre_parse_libgtk_only ();
|
||||
|
||||
option_context = g_option_context_new (NULL);
|
||||
g_option_context_set_ignore_unknown_options (option_context, TRUE);
|
||||
@@ -414,8 +372,8 @@ gdk_get_display_arg_name (void)
|
||||
return _gdk_display_arg_name;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_display_open_default:
|
||||
/**
|
||||
* gdk_display_open_default_libgtk_only:
|
||||
*
|
||||
* Opens the default display specified by command line arguments or
|
||||
* environment variables, sets it as the default display, and returns
|
||||
@@ -425,9 +383,9 @@ gdk_get_display_arg_name (void)
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the default display, if it
|
||||
* could be opened, otherwise %NULL.
|
||||
*/
|
||||
**/
|
||||
GdkDisplay *
|
||||
gdk_display_open_default (void)
|
||||
gdk_display_open_default_libgtk_only (void)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
|
||||
@@ -442,27 +400,6 @@ gdk_display_open_default (void)
|
||||
return display;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_open_default_libgtk_only:
|
||||
*
|
||||
* Opens the default display specified by command line arguments or
|
||||
* environment variables, sets it as the default display, and returns
|
||||
* it. gdk_parse_args() must have been called first. If the default
|
||||
* display has previously been set, simply returns that. An internal
|
||||
* function that should not be used by applications.
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the default display, if it
|
||||
* could be opened, otherwise %NULL.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
GdkDisplay *
|
||||
gdk_display_open_default_libgtk_only (void)
|
||||
{
|
||||
return gdk_display_open_default ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_init_check:
|
||||
* @argc: (inout): the number of command line arguments.
|
||||
@@ -485,7 +422,7 @@ gdk_init_check (int *argc,
|
||||
{
|
||||
gdk_parse_args (argc, argv);
|
||||
|
||||
return gdk_display_open_default () != NULL;
|
||||
return gdk_display_open_default_libgtk_only () != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <gdk/gdkevents.h>
|
||||
#include <gdk/gdkframeclock.h>
|
||||
#include <gdk/gdkframetimings.h>
|
||||
#include <gdk/gdkglcontext.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gdk/gdkmain.h>
|
||||
|
||||
@@ -525,38 +525,3 @@ gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
gdk_cairo_region_from_clip (cairo_t *cr)
|
||||
{
|
||||
cairo_rectangle_list_t *rectangles;
|
||||
cairo_region_t *region;
|
||||
int i;
|
||||
|
||||
rectangles = cairo_copy_clip_rectangle_list (cr);
|
||||
|
||||
if (rectangles->status != CAIRO_STATUS_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
region = cairo_region_create ();
|
||||
for (i = 0; i < rectangles->num_rectangles; i++)
|
||||
{
|
||||
cairo_rectangle_int_t clip_rect;
|
||||
cairo_rectangle_t *rect;
|
||||
|
||||
rect = &rectangles->rectangles[i];
|
||||
|
||||
/* Here we assume clip rects are ints for direct targets, which
|
||||
is true for cairo */
|
||||
clip_rect.x = (int)rect->x;
|
||||
clip_rect.y = (int)rect->y;
|
||||
clip_rect.width = (int)rect->width;
|
||||
clip_rect.height = (int)rect->height;
|
||||
|
||||
cairo_region_union_rectangle (region, &clip_rect);
|
||||
}
|
||||
|
||||
cairo_rectangle_list_destroy (rectangles);
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
@@ -70,17 +70,6 @@ GDK_AVAILABLE_IN_3_10
|
||||
cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
|
||||
int scale,
|
||||
GdkWindow *for_window);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
GdkWindow *window,
|
||||
int source,
|
||||
int source_type,
|
||||
int buffer_scale,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -192,13 +192,11 @@ gdk_cursor_unref (GdkCursor *cursor)
|
||||
* To make the cursor invisible, use %GDK_BLANK_CURSOR.
|
||||
*
|
||||
* Returns: a new #GdkCursor
|
||||
*
|
||||
* Deprecated: 3.16: Use gdk_cursor_new_for_display() instead.
|
||||
*/
|
||||
GdkCursor*
|
||||
gdk_cursor_new (GdkCursorType cursor_type)
|
||||
{
|
||||
return gdk_cursor_new_for_display (gdk_display_get_default (), cursor_type);
|
||||
return gdk_cursor_new_for_display (gdk_display_get_default(), cursor_type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -450,7 +448,9 @@ gdk_cursor_get_image (GdkCursor *cursor)
|
||||
h = cairo_image_surface_get_height (surface);
|
||||
|
||||
x_scale = y_scale = 1;
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_get_device_scale (surface, &x_scale, &y_scale);
|
||||
#endif
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, w, h);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
@@ -219,7 +219,7 @@ GType gdk_cursor_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display,
|
||||
GdkCursorType cursor_type);
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
|
||||
@@ -313,7 +313,8 @@ gdk_device_set_property (GObject *object,
|
||||
device->manager = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_NAME:
|
||||
g_free (device->name);
|
||||
if (device->name)
|
||||
g_free (device->name);
|
||||
|
||||
device->name = g_value_dup_string (value);
|
||||
break;
|
||||
@@ -688,7 +689,6 @@ gdk_device_get_name (GdkDevice *device)
|
||||
* @device: a #GdkDevice
|
||||
*
|
||||
* Determines whether the pointer follows device motion.
|
||||
* This is not meaningful for keyboard devices, which don't have a pointer.
|
||||
*
|
||||
* Returns: %TRUE if the pointer follows device motion
|
||||
*
|
||||
@@ -698,6 +698,7 @@ gboolean
|
||||
gdk_device_get_has_cursor (GdkDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
|
||||
|
||||
return device->has_cursor;
|
||||
}
|
||||
@@ -1260,8 +1261,6 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
|
||||
* or the window becomes unviewable. This overrides any previous grab on the device
|
||||
* by this client.
|
||||
*
|
||||
* Note that @device and @window need to be on the same display.
|
||||
*
|
||||
* Device grabs are used for operations which need complete control over the
|
||||
* given device events (either pointer or keyboard). For example in GTK+ this
|
||||
* is used for Drag and Drop operations, popup menus and such.
|
||||
@@ -1293,9 +1292,8 @@ gdk_device_grab (GdkDevice *device,
|
||||
GdkGrabStatus res;
|
||||
GdkWindow *native;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (gdk_window_get_display (window) == gdk_device_get_display (device), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_SUCCESS);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_SUCCESS);
|
||||
|
||||
native = gdk_window_get_toplevel (window);
|
||||
|
||||
@@ -1479,7 +1477,8 @@ void
|
||||
_gdk_device_set_keys (GdkDevice *device,
|
||||
guint num_keys)
|
||||
{
|
||||
g_free (device->keys);
|
||||
if (device->keys)
|
||||
g_free (device->keys);
|
||||
|
||||
device->num_keys = num_keys;
|
||||
device->keys = g_new0 (GdkDeviceKey, num_keys);
|
||||
|
||||
@@ -265,7 +265,7 @@ void gdk_device_warp (GdkDevice *device,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
|
||||
108
gdk/gdkdisplay.c
108
gdk/gdkdisplay.c
@@ -24,8 +24,6 @@
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdisplaymanagerprivate.h"
|
||||
#include "gdkevents.h"
|
||||
@@ -112,19 +110,6 @@ gdk_display_real_opened (GdkDisplay *display)
|
||||
_gdk_display_manager_add_display (gdk_display_manager_get (), display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_real_event_data_copy (GdkDisplay *display,
|
||||
const GdkEvent *src,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_real_event_data_free (GdkDisplay *display,
|
||||
GdkEvent *dst)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_display_class_init (GdkDisplayClass *class)
|
||||
{
|
||||
@@ -138,8 +123,6 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
|
||||
class->opened = gdk_display_real_opened;
|
||||
class->make_default = gdk_display_real_make_default;
|
||||
class->event_data_copy = gdk_display_real_event_data_copy;
|
||||
class->event_data_free = gdk_display_real_event_data_free;
|
||||
|
||||
/**
|
||||
* GdkDisplay::opened:
|
||||
@@ -223,8 +206,6 @@ gdk_display_init (GdkDisplay *display)
|
||||
|
||||
display->multiple_click_info = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) g_free);
|
||||
|
||||
display->rendering_mode = _gdk_rendering_mode;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1297,8 +1278,8 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_device_grab_info:
|
||||
/**
|
||||
* gdk_device_grab_info_libgtk_only:
|
||||
* @display: the display for which to get the grab information
|
||||
* @device: device to get the grab information from
|
||||
* @grab_window: (out) (transfer none): location to store current grab window
|
||||
@@ -1311,12 +1292,12 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
|
||||
*
|
||||
* Returns: %TRUE if this application currently has the
|
||||
* keyboard grabbed.
|
||||
*/
|
||||
**/
|
||||
gboolean
|
||||
gdk_device_grab_info (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
{
|
||||
GdkDeviceGrabInfo *info;
|
||||
|
||||
@@ -1338,33 +1319,6 @@ gdk_device_grab_info (GdkDisplay *display,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_grab_info_libgtk_only:
|
||||
* @display: the display for which to get the grab information
|
||||
* @device: device to get the grab information from
|
||||
* @grab_window: (out) (transfer none): location to store current grab window
|
||||
* @owner_events: (out): location to store boolean indicating whether
|
||||
* the @owner_events flag to gdk_keyboard_grab() or
|
||||
* gdk_pointer_grab() was %TRUE.
|
||||
*
|
||||
* Determines information about the current keyboard grab.
|
||||
* This is not public API and must not be used by applications.
|
||||
*
|
||||
* Returns: %TRUE if this application currently has the
|
||||
* keyboard grabbed.
|
||||
*
|
||||
* Deprecated: 3.16: The symbol was never meant to be used outside
|
||||
* of GTK+
|
||||
*/
|
||||
gboolean
|
||||
gdk_device_grab_info_libgtk_only (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow **grab_window,
|
||||
gboolean *owner_events)
|
||||
{
|
||||
return gdk_device_grab_info (display, device, grab_window, owner_events);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_pointer_is_grabbed:
|
||||
* @display: a #GdkDisplay
|
||||
@@ -1760,9 +1714,6 @@ gdk_display_supports_input_shapes (GdkDisplay *display)
|
||||
* Returns: %TRUE if windows may be composited.
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 3.16: Compositing is an outdated technology that
|
||||
* only ever worked on X11.
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_supports_composite (GdkDisplay *display)
|
||||
@@ -2274,48 +2225,3 @@ gdk_error_trap_pop (void)
|
||||
{
|
||||
return gdk_error_trap_pop_internal (TRUE);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_display_make_gl_context_current:
|
||||
* @display: a #GdkDisplay
|
||||
* @context: (optional): a #GdkGLContext, or %NULL
|
||||
*
|
||||
* Makes the given @context the current GL context, or unsets
|
||||
* the current GL context if @context is %NULL.
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context);
|
||||
}
|
||||
|
||||
GdkRenderingMode
|
||||
gdk_display_get_rendering_mode (GdkDisplay *display)
|
||||
{
|
||||
return display->rendering_mode;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_set_rendering_mode (GdkDisplay *display,
|
||||
GdkRenderingMode mode)
|
||||
{
|
||||
display->rendering_mode = mode;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_display_set_debug_updates (GdkDisplay *display,
|
||||
gboolean debug_updates)
|
||||
{
|
||||
display->debug_updates = debug_updates;
|
||||
display->debug_updates_set = TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_display_get_debug_updates (GdkDisplay *display)
|
||||
{
|
||||
if (display->debug_updates_set)
|
||||
return display->debug_updates;
|
||||
else
|
||||
return _gdk_debug_updates;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void gdk_display_warp_pointer (GdkDisplay *disp
|
||||
gint y);
|
||||
#endif /* GDK_MULTIDEVICE_SAFE */
|
||||
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkDisplay *gdk_display_open_default_libgtk_only (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -159,7 +159,7 @@ GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_shapes (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_composite (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_display_notify_startup_complete (GdkDisplay *display,
|
||||
|
||||
@@ -60,10 +60,6 @@
|
||||
#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
|
||||
@@ -276,9 +272,6 @@ 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
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkcursor.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -117,14 +116,6 @@ struct _GdkDisplay
|
||||
|
||||
guint double_click_time; /* Maximum time between clicks in msecs */
|
||||
guint double_click_distance; /* Maximum distance between clicks in pixels */
|
||||
|
||||
guint has_gl_extension_texture_non_power_of_two : 1;
|
||||
guint has_gl_extension_texture_rectangle : 1;
|
||||
|
||||
guint debug_updates : 1;
|
||||
guint debug_updates_set : 1;
|
||||
|
||||
GdkRenderingMode rendering_mode;
|
||||
};
|
||||
|
||||
struct _GdkDisplayClass
|
||||
@@ -234,9 +225,6 @@ struct _GdkDisplayClass
|
||||
gchar * (*utf8_to_string_target) (GdkDisplay *display,
|
||||
const gchar *text);
|
||||
|
||||
gboolean (*make_gl_context_current) (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
||||
/* Signals */
|
||||
void (*opened) (GdkDisplay *display);
|
||||
void (*closed) (GdkDisplay *display,
|
||||
@@ -315,9 +303,6 @@ void _gdk_display_create_window_impl (GdkDisplay *display
|
||||
gint attributes_mask);
|
||||
GdkWindow * _gdk_display_create_window (GdkDisplay *display);
|
||||
|
||||
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DISPLAY_PRIVATE_H__ */
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#ifndef __GDK_ENUM_TYPES_H__
|
||||
#define __GDK_ENUM_TYPES_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_ENUM_TYPES_H__
|
||||
#define __GDK_ENUM_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
|
||||
|
||||
@@ -461,15 +461,6 @@ gdk_event_peek (void)
|
||||
return event;
|
||||
}
|
||||
|
||||
static GdkDisplay *
|
||||
event_get_display (const GdkEvent *event)
|
||||
{
|
||||
if (event->any.window)
|
||||
return gdk_window_get_display (event->any.window);
|
||||
else
|
||||
return gdk_display_get_default ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_event_put:
|
||||
* @event: a #GdkEvent.
|
||||
@@ -485,7 +476,10 @@ gdk_event_put (const GdkEvent *event)
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
display = event_get_display (event);
|
||||
if (event->any.window)
|
||||
display = gdk_window_get_display (event->any.window);
|
||||
else
|
||||
display = gdk_display_get_default ();
|
||||
|
||||
gdk_display_put_event (display, event);
|
||||
}
|
||||
@@ -719,7 +713,7 @@ gdk_event_copy (const GdkEvent *event)
|
||||
}
|
||||
|
||||
if (gdk_event_is_allocated (event))
|
||||
_gdk_display_event_data_copy (event_get_display (event), event, new_event);
|
||||
_gdk_display_event_data_copy (gdk_display_get_default (), event, new_event);
|
||||
|
||||
return new_event;
|
||||
}
|
||||
@@ -740,6 +734,9 @@ gdk_event_free (GdkEvent *event)
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
if (event->any.window)
|
||||
g_object_unref (event->any.window);
|
||||
|
||||
switch (event->any.type)
|
||||
{
|
||||
case GDK_KEY_PRESS:
|
||||
@@ -807,13 +804,10 @@ gdk_event_free (GdkEvent *event)
|
||||
break;
|
||||
}
|
||||
|
||||
display = event_get_display (event);
|
||||
display = gdk_display_get_default ();
|
||||
if (display)
|
||||
_gdk_display_event_data_free (display, event);
|
||||
|
||||
if (event->any.window)
|
||||
g_object_unref (event->any.window);
|
||||
|
||||
g_hash_table_remove (event_hash, event);
|
||||
g_slice_free (GdkEventPrivate, (GdkEventPrivate*) event);
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_FRAME_CLOCK_H__
|
||||
#define __GDK_FRAME_CLOCK_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_FRAME_CLOCK_H__
|
||||
#define __GDK_FRAME_CLOCK_H__
|
||||
|
||||
#include <gdk/gdkframetimings.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_FRAME_TIMINGS_H__
|
||||
#define __GDK_FRAME_TIMINGS_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __GDK_FRAME_TIMINGS_H__
|
||||
#define __GDK_FRAME_TIMINGS_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
|
||||
|
||||
746
gdk/gdkgl.c
746
gdk/gdkgl.c
@@ -1,746 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2014 Red Hat, Inc.
|
||||
*
|
||||
* 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 "gdkcairo.h"
|
||||
#include "gdkglcontextprivate.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
#include <math.h>
|
||||
|
||||
static cairo_user_data_key_t direct_key;
|
||||
|
||||
void
|
||||
gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
|
||||
GdkWindow *window)
|
||||
{
|
||||
cairo_surface_set_user_data (surface, &direct_key,
|
||||
g_object_ref (window), g_object_unref);
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_vertex_type_name (int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GL_VERTEX_SHADER:
|
||||
return "vertex";
|
||||
case GL_GEOMETRY_SHADER:
|
||||
return "geometry";
|
||||
case GL_FRAGMENT_SHADER:
|
||||
return "fragment";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static guint
|
||||
create_shader (int type, const char const *code)
|
||||
{
|
||||
guint shader;
|
||||
int status;
|
||||
|
||||
shader = glCreateShader (type);
|
||||
glShaderSource (shader, 1, &code, NULL);
|
||||
glCompileShader (shader);
|
||||
|
||||
glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetShaderInfoLog (shader, log_len, NULL, buffer);
|
||||
|
||||
g_warning ("Compile failure in %s shader:\n%s\n", get_vertex_type_name (type), buffer);
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteShader (shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
static guint
|
||||
make_program (const char const *vertex_shader_code, const char const *fragment_shader_code)
|
||||
{
|
||||
guint program, vertex_shader, fragment_shader;
|
||||
int status;
|
||||
|
||||
vertex_shader = create_shader (GL_VERTEX_SHADER, vertex_shader_code);
|
||||
if (vertex_shader == 0)
|
||||
return 0;
|
||||
|
||||
fragment_shader = create_shader (GL_FRAGMENT_SHADER, fragment_shader_code);
|
||||
if (fragment_shader == 0)
|
||||
{
|
||||
glDeleteShader (vertex_shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
program = glCreateProgram ();
|
||||
glAttachShader (program, vertex_shader);
|
||||
glAttachShader (program, fragment_shader);
|
||||
|
||||
glLinkProgram (program);
|
||||
|
||||
glDeleteShader (vertex_shader);
|
||||
glDeleteShader (fragment_shader);
|
||||
|
||||
glGetProgramiv (program, GL_LINK_STATUS, &status);
|
||||
if (status == GL_FALSE)
|
||||
{
|
||||
int log_len;
|
||||
char *buffer;
|
||||
|
||||
glGetProgramiv (program, GL_INFO_LOG_LENGTH, &log_len);
|
||||
|
||||
buffer = g_malloc (log_len + 1);
|
||||
glGetProgramInfoLog (program, log_len, NULL, buffer);
|
||||
g_warning ("Linker failure: %s\n", buffer);
|
||||
g_free (buffer);
|
||||
|
||||
glDeleteProgram (program);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
static void
|
||||
bind_vao (GdkGLContextPaintData *paint_data)
|
||||
{
|
||||
if (paint_data->vertex_array_object == 0)
|
||||
{
|
||||
glGenVertexArrays (1, &paint_data->vertex_array_object);
|
||||
/* ATM we only use one VAO, so always bind it */
|
||||
glBindVertexArray (paint_data->vertex_array_object);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
use_texture_2d_program (GdkGLContextPaintData *paint_data,
|
||||
guint *position_location,
|
||||
guint *uv_location,
|
||||
guint *map_location)
|
||||
{
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
"uniform sampler2D map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2D map;\n"
|
||||
"void main() {\n"
|
||||
" gl_FragColor = texture2D (map, vUv);\n"
|
||||
"}\n";
|
||||
|
||||
if (paint_data->texture_quad_program == 0)
|
||||
{
|
||||
paint_data->texture_quad_program = make_program (vertex_shader_code, fragment_shader_code);
|
||||
paint_data->texture_quad_program_position_location = glGetAttribLocation (paint_data->texture_quad_program, "position");
|
||||
paint_data->texture_quad_program_uv_location = glGetAttribLocation (paint_data->texture_quad_program, "uv");
|
||||
paint_data->texture_quad_program_map_location = glGetUniformLocation (paint_data->texture_quad_program, "map");
|
||||
}
|
||||
|
||||
if (paint_data->current_program != paint_data->texture_quad_program)
|
||||
{
|
||||
glUseProgram (paint_data->texture_quad_program);
|
||||
paint_data->current_program = paint_data->texture_quad_program;
|
||||
}
|
||||
|
||||
*position_location = paint_data->texture_quad_program_position_location;
|
||||
*uv_location = paint_data->texture_quad_program_uv_location;
|
||||
*map_location = paint_data->texture_quad_program_map_location;
|
||||
}
|
||||
|
||||
static void
|
||||
use_texture_rect_program (GdkGLContextPaintData *paint_data,
|
||||
guint *position_location,
|
||||
guint *uv_location,
|
||||
guint *map_location)
|
||||
{
|
||||
const char *vertex_shader_code =
|
||||
"#version 120\n"
|
||||
"uniform sampler2DRect map;"
|
||||
"attribute vec2 position;\n"
|
||||
"attribute vec2 uv;\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(position, 0, 1);\n"
|
||||
" vUv = uv;\n"
|
||||
"}\n";
|
||||
const char *fragment_shader_code =
|
||||
"#version 120\n"
|
||||
"varying vec2 vUv;\n"
|
||||
"uniform sampler2DRect map;\n"
|
||||
"void main() {\n"
|
||||
" gl_FragColor = texture2DRect (map, vUv);\n"
|
||||
"}\n";
|
||||
|
||||
if (paint_data->texture_quad_rect_program == 0)
|
||||
{
|
||||
paint_data->texture_quad_rect_program = make_program (vertex_shader_code, fragment_shader_code);
|
||||
paint_data->texture_quad_rect_program_position_location = glGetAttribLocation (paint_data->texture_quad_rect_program, "position");
|
||||
paint_data->texture_quad_rect_program_uv_location = glGetAttribLocation (paint_data->texture_quad_rect_program, "uv");
|
||||
paint_data->texture_quad_rect_program_map_location = glGetUniformLocation (paint_data->texture_quad_rect_program, "map");
|
||||
}
|
||||
|
||||
if (paint_data->current_program != paint_data->texture_quad_rect_program)
|
||||
{
|
||||
glUseProgram (paint_data->texture_quad_rect_program);
|
||||
paint_data->current_program = paint_data->texture_quad_rect_program;
|
||||
}
|
||||
|
||||
*position_location = paint_data->texture_quad_rect_program_position_location;
|
||||
*uv_location = paint_data->texture_quad_rect_program_uv_location;
|
||||
*map_location = paint_data->texture_quad_rect_program_map_location;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gdk_gl_texture_quad (GdkGLContext *paint_context,
|
||||
guint texture_target,
|
||||
float x1, float y1,
|
||||
float x2, float y2,
|
||||
float u1, float v1,
|
||||
float u2, float v2)
|
||||
{
|
||||
GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context);
|
||||
GdkWindow *window = gdk_gl_context_get_window (paint_context);
|
||||
int window_scale = gdk_window_get_scale_factor (window);
|
||||
float w = gdk_window_get_width (window) * window_scale;
|
||||
float h = gdk_window_get_height (window) * window_scale;
|
||||
float vertex_buffer_data[] = {
|
||||
(x2 * 2) / w - 1, (y1 * 2) / h - 1,
|
||||
(x2 * 2) / w - 1, (y2 * 2) / h - 1,
|
||||
(x1 * 2) / w - 1, (y2 * 2) / h - 1,
|
||||
(x1 * 2) / w - 1, (y1 * 2) / h - 1,
|
||||
};
|
||||
float uv_buffer_data[] = {
|
||||
u2, v1,
|
||||
u2, v2,
|
||||
u1, v2,
|
||||
u1, v1,
|
||||
};
|
||||
guint position_location, uv_location, map_location;
|
||||
|
||||
bind_vao (paint_data);
|
||||
|
||||
if (paint_data->tmp_vertex_buffer == 0)
|
||||
glGenBuffers(1, &paint_data->tmp_vertex_buffer);
|
||||
|
||||
if (paint_data->tmp_uv_buffer == 0)
|
||||
glGenBuffers(1, &paint_data->tmp_uv_buffer);
|
||||
|
||||
if (texture_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
use_texture_rect_program (paint_data, &position_location, &uv_location, &map_location);
|
||||
else
|
||||
use_texture_2d_program (paint_data, &position_location, &uv_location, &map_location);
|
||||
|
||||
glActiveTexture (GL_TEXTURE0);
|
||||
glUniform1i(map_location, 0); /* Use texture unit 0 */
|
||||
|
||||
glEnableVertexAttribArray (0);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_vertex_buffer);
|
||||
glBufferData (GL_ARRAY_BUFFER, sizeof(vertex_buffer_data), vertex_buffer_data, GL_STREAM_DRAW);
|
||||
glVertexAttribPointer (position_location, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||
glEnableVertexAttribArray (1);
|
||||
glBindBuffer (GL_ARRAY_BUFFER, paint_data->tmp_uv_buffer);
|
||||
glBufferData (GL_ARRAY_BUFFER, sizeof(uv_buffer_data), uv_buffer_data, GL_STREAM_DRAW);
|
||||
glVertexAttribPointer (uv_location, 2, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||
glDrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
||||
glDisableVertexAttribArray (0);
|
||||
glDisableVertexAttribArray (1);
|
||||
}
|
||||
|
||||
|
||||
/* x,y,width,height describes a rectangle in the gl render buffer
|
||||
coordinate space, and its top left corner is drawn at the current
|
||||
position according to the cairo translation. */
|
||||
|
||||
/**
|
||||
* gdk_cairo_draw_from_gl:
|
||||
* @cr: a cairo context
|
||||
* @window: The window we're rendering for (not necessarily into)
|
||||
* @source: The GL ID of the source buffer
|
||||
* @source_type: The type of the @source
|
||||
* @buffer_scale: The scale-factor that the @source buffer is allocated for
|
||||
* @x: The source x position in @source to start copying from in GL coordinates
|
||||
* @y: The source y position in @source to start copying from in GL coordinates
|
||||
* @width: The width of the region to draw
|
||||
* @height: The height of the region to draw
|
||||
*
|
||||
* This is the main way to draw GL content in GTK+. It takes a render buffer ID
|
||||
* (@source_type == #GL_RENDERBUFFER) or a texture id (@source_type == #GL_TEXTURE)
|
||||
* and draws it onto @cr with an OVER operation, respecting the current clip.
|
||||
* The top left corner of the rectangle specified by @x, @y, @width and @height
|
||||
* will be drawn at the current (0,0) position of the cairo_t.
|
||||
*
|
||||
* This will work for *all* cairo_t, as long as @window is realized, but the
|
||||
* fallback implementation that reads back the pixels from the buffer may be
|
||||
* used in the general case. In the case of direct drawing to a window with
|
||||
* no special effects applied to @cr it will however use a more efficient
|
||||
* approach.
|
||||
*
|
||||
* For #GL_RENDERBUFFER the code will always fall back to software for buffers
|
||||
* with alpha components, so make sure you use #GL_TEXTURE if using alpha.
|
||||
*
|
||||
* Calling this may change the current GL context.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
GdkWindow *window,
|
||||
int source,
|
||||
int source_type,
|
||||
int buffer_scale,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
cairo_surface_t *image;
|
||||
cairo_matrix_t matrix;
|
||||
int dx, dy, window_scale;
|
||||
gboolean trivial_transform;
|
||||
cairo_surface_t *group_target;
|
||||
GdkWindow *direct_window, *impl_window;
|
||||
guint framebuffer;
|
||||
int alpha_size = 0;
|
||||
cairo_region_t *clip_region;
|
||||
GdkGLContextPaintData *paint_data;
|
||||
|
||||
impl_window = window->impl_window;
|
||||
|
||||
window_scale = gdk_window_get_scale_factor (impl_window);
|
||||
|
||||
paint_context = gdk_window_get_paint_gl_context (window, NULL);
|
||||
if (paint_context == NULL)
|
||||
{
|
||||
g_warning ("gdk_cairo_draw_gl_render_buffer failed - no paint context");
|
||||
return;
|
||||
}
|
||||
|
||||
clip_region = gdk_cairo_region_from_clip (cr);
|
||||
|
||||
gdk_gl_context_make_current (paint_context);
|
||||
paint_data = gdk_gl_context_get_paint_data (paint_context);
|
||||
|
||||
if (paint_data->tmp_framebuffer == 0)
|
||||
glGenFramebuffersEXT (1, &paint_data->tmp_framebuffer);
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, source);
|
||||
glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else if (source_type == GL_TEXTURE)
|
||||
{
|
||||
glBindTexture (GL_TEXTURE_2D, source);
|
||||
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Unsupported gl source type %d\n", source_type);
|
||||
return;
|
||||
}
|
||||
|
||||
group_target = cairo_get_group_target (cr);
|
||||
direct_window = cairo_surface_get_user_data (group_target, &direct_key);
|
||||
|
||||
cairo_get_matrix (cr, &matrix);
|
||||
|
||||
dx = matrix.x0;
|
||||
dy = matrix.y0;
|
||||
|
||||
/* Trivial == integer-only translation */
|
||||
trivial_transform =
|
||||
(double)dx == matrix.x0 && (double)dy == matrix.y0 &&
|
||||
matrix.xx == 1.0 && matrix.xy == 0.0 &&
|
||||
matrix.yx == 0.0 && matrix.yy == 1.0;
|
||||
|
||||
/* For direct paint of non-alpha renderbuffer, we can
|
||||
just do a bitblit */
|
||||
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_GL) == 0 &&
|
||||
source_type == GL_RENDERBUFFER &&
|
||||
alpha_size == 0 &&
|
||||
direct_window != NULL &&
|
||||
direct_window->current_paint.use_gl &&
|
||||
trivial_transform &&
|
||||
clip_region != NULL)
|
||||
{
|
||||
int unscaled_window_height;
|
||||
int i;
|
||||
|
||||
/* Create a framebuffer with the source renderbuffer and
|
||||
make it the current target for reads */
|
||||
framebuffer = paint_data->tmp_framebuffer;
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_RENDERBUFFER_EXT, source);
|
||||
glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
/* Translate to impl coords */
|
||||
cairo_region_translate (clip_region, dx, dy);
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
|
||||
glDrawBuffer (GL_BACK);
|
||||
|
||||
#define FLIP_Y(_y) (unscaled_window_height - (_y))
|
||||
|
||||
for (i = 0; i < cairo_region_num_rectangles (clip_region); i++)
|
||||
{
|
||||
cairo_rectangle_int_t clip_rect, dest;
|
||||
|
||||
cairo_region_get_rectangle (clip_region, i, &clip_rect);
|
||||
clip_rect.x *= window_scale;
|
||||
clip_rect.y *= window_scale;
|
||||
clip_rect.width *= window_scale;
|
||||
clip_rect.height *= window_scale;
|
||||
|
||||
glScissor (clip_rect.x, FLIP_Y (clip_rect.y + clip_rect.height),
|
||||
clip_rect.width, clip_rect.height);
|
||||
|
||||
dest.x = dx * window_scale;
|
||||
dest.y = dy * window_scale;
|
||||
dest.width = width * window_scale / buffer_scale;
|
||||
dest.height = height * window_scale / buffer_scale;
|
||||
|
||||
if (gdk_rectangle_intersect (&clip_rect, &dest, &dest))
|
||||
{
|
||||
int clipped_src_x = x + (dest.x - dx * window_scale);
|
||||
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
|
||||
glBlitFramebufferEXT(clipped_src_x, clipped_src_y,
|
||||
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
|
||||
dest.x, FLIP_Y(dest.y + dest.height),
|
||||
dest.x + dest.width, FLIP_Y(dest.y),
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
if (impl_window->current_paint.flushed_region)
|
||||
{
|
||||
cairo_rectangle_int_t flushed_rect;
|
||||
|
||||
flushed_rect.x = dest.x / window_scale;
|
||||
flushed_rect.y = dest.y / window_scale;
|
||||
flushed_rect.width = (dest.x + dest.width + window_scale - 1) / window_scale - flushed_rect.x;
|
||||
flushed_rect.height = (dest.y + dest.height + window_scale - 1) / window_scale - flushed_rect.y;
|
||||
|
||||
cairo_region_union_rectangle (impl_window->current_paint.flushed_region,
|
||||
&flushed_rect);
|
||||
cairo_region_subtract_rectangle (impl_window->current_paint.need_blend_region,
|
||||
&flushed_rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
}
|
||||
/* For direct paint of alpha or non-alpha textures we can use texturing */
|
||||
else if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_GL) == 0 &&
|
||||
source_type == GL_TEXTURE &&
|
||||
direct_window != NULL &&
|
||||
direct_window->current_paint.use_gl &&
|
||||
trivial_transform &&
|
||||
clip_region != NULL)
|
||||
{
|
||||
int unscaled_window_height;
|
||||
GLint texture_width;
|
||||
GLint texture_height;
|
||||
int i;
|
||||
|
||||
/* Translate to impl coords */
|
||||
cairo_region_translate (clip_region, dx, dy);
|
||||
|
||||
if (alpha_size != 0)
|
||||
{
|
||||
cairo_region_t *opaque_region, *blend_region;
|
||||
|
||||
opaque_region = cairo_region_copy (clip_region);
|
||||
cairo_region_subtract (opaque_region, impl_window->current_paint.flushed_region);
|
||||
cairo_region_subtract (opaque_region, impl_window->current_paint.need_blend_region);
|
||||
|
||||
if (!cairo_region_is_empty (opaque_region))
|
||||
gdk_gl_texture_from_surface (impl_window->current_paint.surface,
|
||||
opaque_region);
|
||||
|
||||
blend_region = cairo_region_copy (clip_region);
|
||||
cairo_region_intersect (blend_region, impl_window->current_paint.need_blend_region);
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
if (!cairo_region_is_empty (blend_region))
|
||||
gdk_gl_texture_from_surface (impl_window->current_paint.surface,
|
||||
blend_region);
|
||||
|
||||
cairo_region_destroy (opaque_region);
|
||||
cairo_region_destroy (blend_region);
|
||||
}
|
||||
|
||||
glBindTexture (GL_TEXTURE_2D, source);
|
||||
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &texture_width);
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &texture_height);
|
||||
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
|
||||
gdk_window_get_unscaled_size (impl_window, NULL, &unscaled_window_height);
|
||||
|
||||
#define FLIP_Y(_y) (unscaled_window_height - (_y))
|
||||
|
||||
for (i = 0; i < cairo_region_num_rectangles (clip_region); i++)
|
||||
{
|
||||
cairo_rectangle_int_t clip_rect, dest;
|
||||
|
||||
cairo_region_get_rectangle (clip_region, i, &clip_rect);
|
||||
|
||||
clip_rect.x *= window_scale;
|
||||
clip_rect.y *= window_scale;
|
||||
clip_rect.width *= window_scale;
|
||||
clip_rect.height *= window_scale;
|
||||
|
||||
glScissor (clip_rect.x, FLIP_Y (clip_rect.y + clip_rect.height),
|
||||
clip_rect.width, clip_rect.height);
|
||||
|
||||
dest.x = dx * window_scale;
|
||||
dest.y = dy * window_scale;
|
||||
dest.width = width * window_scale / buffer_scale;
|
||||
dest.height = height * window_scale / buffer_scale;
|
||||
|
||||
if (gdk_rectangle_intersect (&clip_rect, &dest, &dest))
|
||||
{
|
||||
int clipped_src_x = x + (dest.x - dx * window_scale);
|
||||
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
|
||||
|
||||
gdk_gl_texture_quad (paint_context,
|
||||
GL_TEXTURE_2D,
|
||||
dest.x, FLIP_Y(dest.y),
|
||||
dest.x + dest.width, FLIP_Y(dest.y + dest.height),
|
||||
clipped_src_x / (float)texture_width, (clipped_src_y + dest.height) / (float)texture_height,
|
||||
(clipped_src_x + dest.width) / (float)texture_width, clipped_src_y / (float)texture_height);
|
||||
|
||||
if (impl_window->current_paint.flushed_region)
|
||||
{
|
||||
cairo_rectangle_int_t flushed_rect;
|
||||
|
||||
flushed_rect.x = dest.x / window_scale;
|
||||
flushed_rect.y = dest.y / window_scale;
|
||||
flushed_rect.width = (dest.x + dest.width + window_scale - 1) / window_scale - flushed_rect.x;
|
||||
flushed_rect.height = (dest.y + dest.height + window_scale - 1) / window_scale - flushed_rect.y;
|
||||
|
||||
cairo_region_union_rectangle (impl_window->current_paint.flushed_region,
|
||||
&flushed_rect);
|
||||
cairo_region_subtract_rectangle (impl_window->current_paint.need_blend_region,
|
||||
&flushed_rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (alpha_size != 0)
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
|
||||
#undef FLIP_Y
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Software fallback */
|
||||
|
||||
/* TODO: avoid reading back non-required data due to dest clip */
|
||||
image = cairo_surface_create_similar_image (cairo_get_target (cr),
|
||||
(alpha_size == 0) ? CAIRO_FORMAT_RGB24 : CAIRO_FORMAT_ARGB32,
|
||||
width, height);
|
||||
|
||||
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
|
||||
|
||||
framebuffer = paint_data->tmp_framebuffer;
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
/* Create a framebuffer with the source renderbuffer and
|
||||
make it the current target for reads */
|
||||
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_RENDERBUFFER_EXT, source);
|
||||
}
|
||||
else
|
||||
{
|
||||
glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_TEXTURE_2D, source, 0);
|
||||
}
|
||||
|
||||
glPixelStorei (GL_PACK_ALIGNMENT, 4);
|
||||
glPixelStorei (GL_PACK_ROW_LENGTH, cairo_image_surface_get_stride (image) / 4);
|
||||
|
||||
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image));
|
||||
|
||||
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
|
||||
|
||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
cairo_surface_mark_dirty (image);
|
||||
|
||||
/* Invert due to opengl having different origin */
|
||||
cairo_scale (cr, 1, -1);
|
||||
cairo_translate (cr, 0, -height / buffer_scale);
|
||||
|
||||
cairo_set_source_surface (cr, image, 0, 0);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_surface_destroy (image);
|
||||
}
|
||||
|
||||
if (clip_region)
|
||||
cairo_region_destroy (clip_region);
|
||||
}
|
||||
|
||||
/* This is always called with the paint context current */
|
||||
void
|
||||
gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
cairo_surface_t *image;
|
||||
double device_x_offset, device_y_offset;
|
||||
cairo_rectangle_int_t rect, e;
|
||||
int n_rects, i;
|
||||
GdkWindow *window;
|
||||
int unscaled_window_height;
|
||||
unsigned int texture_id;
|
||||
int window_scale;
|
||||
double sx, sy;
|
||||
float umax, vmax;
|
||||
gboolean use_texture_rectangle;
|
||||
guint target;
|
||||
|
||||
paint_context = gdk_gl_context_get_current ();
|
||||
if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
|
||||
paint_context &&
|
||||
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
|
||||
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region))
|
||||
return;
|
||||
|
||||
/* Software fallback */
|
||||
use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context);
|
||||
|
||||
window = gdk_gl_context_get_window (paint_context);
|
||||
window_scale = gdk_window_get_scale_factor (window);
|
||||
gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height);
|
||||
|
||||
sx = sy = 1;
|
||||
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
|
||||
|
||||
cairo_surface_get_device_offset (surface,
|
||||
&device_x_offset, &device_y_offset);
|
||||
|
||||
glGenTextures (1, &texture_id);
|
||||
if (use_texture_rectangle)
|
||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
else
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
glBindTexture (target, texture_id);
|
||||
glEnable (target);
|
||||
glEnable (GL_SCISSOR_TEST);
|
||||
|
||||
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri (target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri (target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri (target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
n_rects = cairo_region_num_rectangles (region);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, i, &rect);
|
||||
|
||||
glScissor (rect.x * window_scale, unscaled_window_height - (rect.y + rect.height) * window_scale,
|
||||
rect.width * window_scale, rect.height * window_scale);
|
||||
|
||||
e = rect;
|
||||
e.x *= sx;
|
||||
e.y *= sy;
|
||||
e.x += (int)device_x_offset;
|
||||
e.y += (int)device_y_offset;
|
||||
e.width *= sx;
|
||||
e.height *= sy;
|
||||
image = cairo_surface_map_to_image (surface, &e);
|
||||
|
||||
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, cairo_image_surface_get_stride (image)/4);
|
||||
glTexImage2D (target, 0, 4, e.width, e.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
|
||||
cairo_image_surface_get_data (image));
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
|
||||
cairo_surface_unmap_image (surface, image);
|
||||
|
||||
#define FLIP_Y(_y) (unscaled_window_height - (_y))
|
||||
|
||||
if (use_texture_rectangle)
|
||||
{
|
||||
umax = rect.width * sx;
|
||||
vmax = rect.height * sy;
|
||||
}
|
||||
else
|
||||
{
|
||||
umax = 1.0;
|
||||
vmax = 1.0;
|
||||
}
|
||||
|
||||
gdk_gl_texture_quad (paint_context, target,
|
||||
rect.x * window_scale, FLIP_Y(rect.y),
|
||||
(rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
|
||||
0, 0,
|
||||
umax, vmax);
|
||||
}
|
||||
|
||||
glDisable (GL_SCISSOR_TEST);
|
||||
glDisable (target);
|
||||
glDeleteTextures (1, &texture_id);
|
||||
}
|
||||
@@ -1,575 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext.c: GL context abstraction
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gdkglcontext
|
||||
* @Title: GdkGLContext
|
||||
* @Short_description: OpenGL context
|
||||
*
|
||||
* #GdkGLContext is an object representing the platform-specific
|
||||
* OpenGL drawing context.
|
||||
*
|
||||
* #GdkGLContexts are created for a #GdkWindow using
|
||||
* gdk_window_create_gl_context(), and the context will match
|
||||
* the #GdkVisual of the window.
|
||||
*
|
||||
* A #GdkGLContext is not tied to any particular normal framebuffer.
|
||||
* For instance, it cannot draw to the #GdkWindow back buffer. The GDK
|
||||
* repaint system is in full control of the painting to that. Instead,
|
||||
* you can create render buffers or textures and use gdk_cairo_draw_from_gl()
|
||||
* in the draw function of your widget to draw them. Then GDK will handle
|
||||
* the integration of your rendering with that of other widgets.
|
||||
*
|
||||
* Support for #GdkGLContext is platform-specific, context creation
|
||||
* can fail, returning %NULL context.
|
||||
*
|
||||
* A #GdkGLContext has to be made "current" in order to start using
|
||||
* it, otherwise any OpenGL call will be ignored.
|
||||
*
|
||||
* ## Creating a new OpenGL context ##
|
||||
*
|
||||
* In order to create a new #GdkGLContext instance you need a
|
||||
* #GdkWindow, which you typically get during the realize call
|
||||
* of a widget.
|
||||
*
|
||||
* ## Using a GdkGLContext ##
|
||||
*
|
||||
* You will need to make the #GdkGLContext the current context
|
||||
* before issuing OpenGL calls; the system sends OpenGL commands to
|
||||
* whichever context is current. It is possible to have multiple
|
||||
* contexts, so you always need to ensure that the one which you
|
||||
* want to draw with is the current one before issuing commands:
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* gdk_gl_context_make_current (context);
|
||||
* ]|
|
||||
*
|
||||
* You can now perform your drawing using OpenGL commands.
|
||||
*
|
||||
* You can check which #GdkGLContext is the current one by using
|
||||
* gdk_gl_context_get_current(); you can also unset any #GdkGLContext
|
||||
* that is currently set by calling gdk_gl_context_clear_current().
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
#include "gdkintl.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
typedef struct {
|
||||
GdkDisplay *display;
|
||||
GdkWindow *window;
|
||||
GdkGLContext *shared_context;
|
||||
GdkGLProfile profile;
|
||||
|
||||
guint realized : 1;
|
||||
guint use_texture_rectangle : 1;
|
||||
guint has_gl_framebuffer_blit : 1;
|
||||
guint has_frame_terminator : 1;
|
||||
|
||||
GdkGLContextPaintData *paint_data;
|
||||
} GdkGLContextPrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
|
||||
PROP_DISPLAY,
|
||||
PROP_WINDOW,
|
||||
PROP_PROFILE,
|
||||
PROP_SHARED_CONTEXT,
|
||||
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
static GParamSpec *obj_pspecs[LAST_PROP] = { NULL, };
|
||||
|
||||
G_DEFINE_QUARK (gdk-gl-error-quark, gdk_gl_error)
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkGLContext, gdk_gl_context, G_TYPE_OBJECT)
|
||||
|
||||
static GPrivate thread_current_context = G_PRIVATE_INIT (g_object_unref);
|
||||
|
||||
static void
|
||||
gdk_gl_context_dispose (GObject *gobject)
|
||||
{
|
||||
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
GdkGLContext *current;
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
if (current == context)
|
||||
g_private_replace (&thread_current_context, NULL);
|
||||
|
||||
g_clear_object (&priv->display);
|
||||
g_clear_object (&priv->window);
|
||||
g_clear_object (&priv->shared_context);
|
||||
|
||||
G_OBJECT_CLASS (gdk_gl_context_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_finalize (GObject *gobject)
|
||||
{
|
||||
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_clear_pointer (&priv->paint_data, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_set_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private ((GdkGLContext *) gobject);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
{
|
||||
GdkDisplay *display = g_value_get_object (value);
|
||||
|
||||
if (display)
|
||||
g_object_ref (display);
|
||||
|
||||
if (priv->display)
|
||||
g_object_unref (priv->display);
|
||||
|
||||
priv->display = display;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_WINDOW:
|
||||
{
|
||||
GdkWindow *window = g_value_get_object (value);
|
||||
|
||||
if (window)
|
||||
g_object_ref (window);
|
||||
|
||||
if (priv->window)
|
||||
g_object_unref (priv->window);
|
||||
|
||||
priv->window = window;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SHARED_CONTEXT:
|
||||
{
|
||||
GdkGLContext *context = g_value_get_object (value);
|
||||
|
||||
if (context != NULL)
|
||||
priv->shared_context = g_object_ref (context);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
priv->profile = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_get_property (GObject *gobject,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private ((GdkGLContext *) gobject);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
g_value_set_object (value, priv->display);
|
||||
break;
|
||||
|
||||
case PROP_WINDOW:
|
||||
g_value_set_object (value, priv->window);
|
||||
break;
|
||||
|
||||
case PROP_SHARED_CONTEXT:
|
||||
g_value_set_object (value, priv->shared_context);
|
||||
break;
|
||||
|
||||
case PROP_PROFILE:
|
||||
g_value_set_enum (value, priv->profile);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
/**
|
||||
* GdkGLContext:display:
|
||||
*
|
||||
* The #GdkWindow the gl context is bound to.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Display"),
|
||||
P_("The GDK display the context is from"),
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:window:
|
||||
*
|
||||
* The #GdkWindow the gl context is bound to.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_WINDOW] =
|
||||
g_param_spec_object ("window",
|
||||
P_("Window"),
|
||||
P_("The GDK window bound to the GL context"),
|
||||
GDK_TYPE_WINDOW,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:profile:
|
||||
*
|
||||
* The #GdkGLProfile of the context
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_PROFILE] =
|
||||
g_param_spec_enum ("profile",
|
||||
P_("Profile"),
|
||||
P_("The GL profile the context was created for"),
|
||||
GDK_TYPE_GL_PROFILE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GdkGLContext:shared-context:
|
||||
*
|
||||
* The #GdkGLContext that this context is sharing data with, or #NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
obj_pspecs[PROP_SHARED_CONTEXT] =
|
||||
g_param_spec_object ("shared-context",
|
||||
P_("Shared context"),
|
||||
P_("The GL context this context share data with"),
|
||||
GDK_TYPE_GL_CONTEXT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
gobject_class->set_property = gdk_gl_context_set_property;
|
||||
gobject_class->get_property = gdk_gl_context_get_property;
|
||||
gobject_class->dispose = gdk_gl_context_dispose;
|
||||
gobject_class->finalize = gdk_gl_context_finalize;
|
||||
|
||||
g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_init (GdkGLContext *self)
|
||||
{
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gdk_gl_context_end_frame:
|
||||
* @context: a #GdkGLContext
|
||||
* @painted: The area that has been redrawn this frame
|
||||
* @damage: The area that we know is actually different from the last frame
|
||||
*
|
||||
* Copies the back buffer to the front buffer.
|
||||
*
|
||||
* This function may call `glFlush()` implicitly before returning; it
|
||||
* is not recommended to call `glFlush()` explicitly before calling
|
||||
* this function.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
GDK_GL_CONTEXT_GET_CLASS (context)->end_frame (context, painted, damage);
|
||||
}
|
||||
|
||||
GdkGLContextPaintData *
|
||||
gdk_gl_context_get_paint_data (GdkGLContext *context)
|
||||
{
|
||||
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
if (priv->paint_data == NULL)
|
||||
priv->paint_data = g_new0 (GdkGLContextPaintData, 1);
|
||||
|
||||
return priv->paint_data;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_use_texture_rectangle (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->use_texture_rectangle;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_has_framebuffer_blit (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->has_gl_framebuffer_blit;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_has_frame_terminator (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->has_frame_terminator;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_realize (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
gboolean has_npot, has_texture_rectangle;
|
||||
|
||||
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
|
||||
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
|
||||
|
||||
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
|
||||
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
|
||||
|
||||
if (_gdk_gl_flags & GDK_GL_TEXTURE_RECTANGLE)
|
||||
priv->use_texture_rectangle = TRUE;
|
||||
else if (has_npot)
|
||||
priv->use_texture_rectangle = FALSE;
|
||||
else if (has_texture_rectangle)
|
||||
priv->use_texture_rectangle = TRUE;
|
||||
else
|
||||
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
|
||||
|
||||
priv->realized = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_make_current:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Makes the @context the current one.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_make_current (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
GdkGLContext *current;
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
if (current == context)
|
||||
return;
|
||||
|
||||
if (gdk_display_make_gl_context_current (priv->display, context))
|
||||
{
|
||||
g_private_replace (&thread_current_context, g_object_ref (context));
|
||||
if (!priv->realized)
|
||||
gdk_gl_context_realize (context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_display:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkDisplay the @context is created for
|
||||
*
|
||||
* Returns: (transfer none): a #GdkDisplay or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkDisplay *
|
||||
gdk_gl_context_get_display (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
return priv->display;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_window:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkWindow used by the @context.
|
||||
*
|
||||
* Returns: (transfer none): a #GdkWindow or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkWindow *
|
||||
gdk_gl_context_get_window (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
return priv->window;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_profile:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkGLProfile that @context was created for.
|
||||
*
|
||||
* Returns: a #GdkGLProfile
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLProfile
|
||||
gdk_gl_context_get_profile (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
|
||||
|
||||
return priv->profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_shared_context:
|
||||
* @context: a #GdkGLContext
|
||||
*
|
||||
* Retrieves the #GdkGLContext that this @context share data with.
|
||||
*
|
||||
* Returns: (transfer none): a #GdkGLContext or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLContext *
|
||||
gdk_gl_context_get_shared_context (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
return priv->shared_context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_clear_current:
|
||||
*
|
||||
* Clears the current #GdkGLContext.
|
||||
*
|
||||
* Any OpenGL call after this function returns will be ignored
|
||||
* until gdk_gl_context_make_current() is called.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_clear_current (void)
|
||||
{
|
||||
GdkGLContext *current;
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
if (current != NULL)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (current);
|
||||
|
||||
if (gdk_display_make_gl_context_current (priv->display, NULL))
|
||||
g_private_replace (&thread_current_context, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_get_current:
|
||||
*
|
||||
* Retrieves the current #GdkGLContext.
|
||||
*
|
||||
* Returns: (transfer none): the current #GdkGLContext, or %NULL
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLContext *
|
||||
gdk_gl_context_get_current (void)
|
||||
{
|
||||
GdkGLContext *current;
|
||||
|
||||
current = g_private_get (&thread_current_context);
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_get_flags:
|
||||
*
|
||||
* Returns the currently active GL flags.
|
||||
*
|
||||
* Returns: the GL flags
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
GdkGLFlags
|
||||
gdk_gl_get_flags (void)
|
||||
{
|
||||
return _gdk_gl_flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_set_flags:
|
||||
* @flags: #GdkGLFlags to set
|
||||
*
|
||||
* Sets GL flags.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
void
|
||||
gdk_gl_set_flags (GdkGLFlags flags)
|
||||
{
|
||||
_gdk_gl_flags = flags;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext.h: GL context abstraction
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_GL_CONTEXT_H__
|
||||
#define __GDK_GL_CONTEXT_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdkversionmacros.h>
|
||||
#include <gdk/gdktypes.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_GL_CONTEXT (gdk_gl_context_get_type ())
|
||||
#define GDK_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContext))
|
||||
#define GDK_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_CONTEXT))
|
||||
|
||||
#define GDK_GL_ERROR (gdk_gl_error_quark ())
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GQuark gdk_gl_error_quark (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_gl_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLProfile gdk_gl_context_get_profile (GdkGLContext *context);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_make_current (GdkGLContext *context);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_gl_context_get_current (void);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_gl_context_clear_current (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_GL_CONTEXT_H__ */
|
||||
@@ -1,77 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontextprivate.h: GL context abstraction
|
||||
*
|
||||
* Copyright © 2014 Emmanuele Bassi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_GL_CONTEXT_PRIVATE_H__
|
||||
#define __GDK_GL_CONTEXT_PRIVATE_H__
|
||||
|
||||
#include "gdkglcontext.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
|
||||
#define GDK_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_CONTEXT))
|
||||
#define GDK_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
|
||||
|
||||
typedef struct _GdkGLContextClass GdkGLContextClass;
|
||||
|
||||
struct _GdkGLContext
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
struct _GdkGLContextClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (* end_frame) (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
gboolean (* texture_from_surface) (GdkGLContext *context,
|
||||
cairo_surface_t *surface,
|
||||
cairo_region_t *region);
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
guint vertex_array_object;
|
||||
guint tmp_framebuffer;
|
||||
guint tmp_vertex_buffer;
|
||||
guint tmp_uv_buffer;
|
||||
guint current_program;
|
||||
guint texture_quad_program;
|
||||
guint texture_quad_program_position_location;
|
||||
guint texture_quad_program_uv_location;
|
||||
guint texture_quad_program_map_location;
|
||||
guint texture_quad_rect_program;
|
||||
guint texture_quad_rect_program_position_location;
|
||||
guint texture_quad_rect_program_uv_location;
|
||||
guint texture_quad_rect_program_map_location;
|
||||
} GdkGLContextPaintData;
|
||||
|
||||
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
void gdk_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_GL_CONTEXT_PRIVATE_H__ */
|
||||
@@ -34,5 +34,4 @@ GList *_gdk_default_filters = NULL;
|
||||
gchar *_gdk_display_name = NULL;
|
||||
gchar *_gdk_display_arg_name = NULL;
|
||||
gboolean _gdk_disable_multidevice = FALSE;
|
||||
guint _gdk_gl_flags = 0;
|
||||
GdkRenderingMode _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;
|
||||
|
||||
@@ -84,8 +84,7 @@ typedef enum {
|
||||
GDK_DEBUG_DRAW = 1 << 9,
|
||||
GDK_DEBUG_EVENTLOOP = 1 << 10,
|
||||
GDK_DEBUG_FRAMES = 1 << 11,
|
||||
GDK_DEBUG_SETTINGS = 1 << 12,
|
||||
GDK_DEBUG_OPENGL = 1 << 13,
|
||||
GDK_DEBUG_SETTINGS = 1 << 12
|
||||
} GdkDebugFlag;
|
||||
|
||||
typedef enum {
|
||||
@@ -94,21 +93,11 @@ typedef enum {
|
||||
GDK_RENDERING_MODE_RECORDING
|
||||
} GdkRenderingMode;
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_DISABLE = 1 << 0,
|
||||
GDK_GL_ALWAYS = 1 << 1,
|
||||
GDK_GL_SOFTWARE_DRAW_GL = 1 << 2,
|
||||
GDK_GL_SOFTWARE_DRAW_SURFACE = 1 << 3,
|
||||
GDK_GL_TEXTURE_RECTANGLE = 1 << 4
|
||||
} GdkGLFlags;
|
||||
|
||||
extern GList *_gdk_default_filters;
|
||||
extern GdkWindow *_gdk_parent_root;
|
||||
|
||||
extern guint _gdk_debug_flags;
|
||||
extern guint _gdk_gl_flags;
|
||||
extern GdkRenderingMode _gdk_rendering_mode;
|
||||
extern gboolean _gdk_debug_updates;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
@@ -219,33 +208,18 @@ struct _GdkWindow
|
||||
struct {
|
||||
cairo_region_t *region;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
/* Areas of region that have been copied to the back buffer already */
|
||||
cairo_region_t *flushed_region;
|
||||
/* Areas of region that have been copied to the back buffer but
|
||||
needs furter blending of surface data. These two regions are
|
||||
always non-intersecting. */
|
||||
cairo_region_t *need_blend_region;
|
||||
|
||||
gboolean surface_needs_composite;
|
||||
gboolean use_gl;
|
||||
} current_paint;
|
||||
GdkGLContext *gl_paint_context;
|
||||
|
||||
cairo_region_t *update_area;
|
||||
guint update_freeze_count;
|
||||
/* This is the update_area that was in effect when the current expose
|
||||
started. It may be smaller than the expose area if we'e painting
|
||||
more than we have to, but it represents the "true" damage. */
|
||||
cairo_region_t *active_update_area;
|
||||
/* We store the old expose areas to support buffer-age optimizations */
|
||||
cairo_region_t *old_updated_area[2];
|
||||
|
||||
GdkWindowState state;
|
||||
|
||||
guint8 alpha;
|
||||
guint8 fullscreen_mode;
|
||||
|
||||
guint guffaw_gravity : 1;
|
||||
guint input_only : 1;
|
||||
guint modal_hint : 1;
|
||||
guint composited : 1;
|
||||
@@ -346,20 +320,8 @@ void _gdk_windowing_event_data_free (GdkEvent *event);
|
||||
void _gdk_set_window_state (GdkWindow *window,
|
||||
GdkWindowState new_state);
|
||||
|
||||
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
GdkRectangle *extents);
|
||||
void gdk_gl_texture_from_surface (cairo_surface_t *surface,
|
||||
cairo_region_t *region);
|
||||
void gdk_gl_texture_quad (GdkGLContext *paint_context,
|
||||
guint texture_target,
|
||||
float x1, float y1,
|
||||
float x2, float y2,
|
||||
float u1, float v1,
|
||||
float u2, float v2);
|
||||
void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
|
||||
GdkWindow *window);
|
||||
cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr);
|
||||
|
||||
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
GdkRectangle *extents);
|
||||
|
||||
/*************************************
|
||||
* Interfaces used by windowing code *
|
||||
@@ -373,11 +335,6 @@ void _gdk_window_destroy (GdkWindow *window,
|
||||
void _gdk_window_clear_update_area (GdkWindow *window);
|
||||
void _gdk_window_update_size (GdkWindow *window);
|
||||
gboolean _gdk_window_update_viewable (GdkWindow *window);
|
||||
GdkGLContext * gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
GError **error);
|
||||
void gdk_window_get_unscaled_size (GdkWindow *window,
|
||||
int *unscaled_width,
|
||||
int *unscaled_height);
|
||||
|
||||
void _gdk_window_process_updates_recurse (GdkWindow *window,
|
||||
cairo_region_t *expose_region);
|
||||
|
||||
@@ -49,9 +49,9 @@ void gdk_init (gint *argc,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_init_check (gint *argc,
|
||||
gchar ***argv);
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_pre_parse_libgtk_only (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
@@ -515,6 +515,13 @@ gdk_offscreen_window_input_shape_combine_region (GdkWindow *window,
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_offscreen_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_get_geometry (GdkWindow *window,
|
||||
gint *x,
|
||||
@@ -696,6 +703,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->get_device_state = gdk_offscreen_window_get_device_state;
|
||||
impl_class->shape_combine_region = gdk_offscreen_window_shape_combine_region;
|
||||
impl_class->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
|
||||
impl_class->set_static_gravities = gdk_offscreen_window_set_static_gravities;
|
||||
impl_class->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
|
||||
impl_class->destroy = gdk_offscreen_window_destroy;
|
||||
impl_class->destroy_foreign = NULL;
|
||||
|
||||
@@ -128,8 +128,6 @@ typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkKeymap GdkKeymap;
|
||||
typedef struct _GdkAppLaunchContext GdkAppLaunchContext;
|
||||
|
||||
typedef struct _GdkGLContext GdkGLContext;
|
||||
|
||||
/**
|
||||
* GdkByteOrder:
|
||||
* @GDK_LSB_FIRST: The values are stored with the least-significant byte
|
||||
@@ -310,7 +308,6 @@ typedef enum
|
||||
* @GDK_GRAB_NOT_VIEWABLE: the grab window or the @confine_to window are not
|
||||
* viewable.
|
||||
* @GDK_GRAB_FROZEN: the resource is frozen by an active grab of another client.
|
||||
* @GDK_GRAB_FAILED: the grab failed for some other reason.
|
||||
*
|
||||
* Returned by gdk_device_grab(), gdk_pointer_grab() and gdk_keyboard_grab() to
|
||||
* indicate success or the reason for the failure of the grab attempt.
|
||||
@@ -321,8 +318,7 @@ typedef enum
|
||||
GDK_GRAB_ALREADY_GRABBED = 1,
|
||||
GDK_GRAB_INVALID_TIME = 2,
|
||||
GDK_GRAB_NOT_VIEWABLE = 3,
|
||||
GDK_GRAB_FROZEN = 4,
|
||||
GDK_GRAB_FAILED = 5
|
||||
GDK_GRAB_FROZEN = 4
|
||||
} GdkGrabStatus;
|
||||
|
||||
/**
|
||||
@@ -433,26 +429,8 @@ struct _GdkPoint
|
||||
gint y;
|
||||
};
|
||||
|
||||
/**
|
||||
* GdkGLProfile:
|
||||
* @GDK_GL_PROFILE_DEFAULT: ...
|
||||
* @GDK_GL_PROFILE_LEGACY: ...
|
||||
* @GDK_GL_PROFILE_3_2_CORE: ...
|
||||
*
|
||||
* ...
|
||||
*/
|
||||
typedef enum {
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
GDK_GL_PROFILE_LEGACY,
|
||||
GDK_GL_PROFILE_3_2_CORE
|
||||
} GdkGLProfile;
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE
|
||||
} GdkGLError;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __GDK_TYPES_H__ */
|
||||
|
||||
@@ -132,16 +132,6 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_14 (G_ENCODE_VERSION (3, 14))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_16:
|
||||
*
|
||||
* A macro that evaluates to the 3.16 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.16
|
||||
*/
|
||||
#define GDK_VERSION_3_16 (G_ENCODE_VERSION (3, 16))
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
*/
|
||||
@@ -326,19 +316,5 @@
|
||||
# define GDK_AVAILABLE_IN_3_14 _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_16
|
||||
# define GDK_DEPRECATED_IN_3_16 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_16_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_16 _GDK_EXTERN
|
||||
# define GDK_DEPRECATED_IN_3_16_FOR(f) _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_16
|
||||
# define GDK_AVAILABLE_IN_3_16 GDK_UNAVAILABLE(3, 16)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_16 _GDK_EXTERN
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
|
||||
522
gdk/gdkwindow.c
522
gdk/gdkwindow.c
@@ -39,13 +39,9 @@
|
||||
#include "gdkmarshalers.h"
|
||||
#include "gdkframeclockidle.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdk-private.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
/* for the use of round() */
|
||||
#include "fallback-c89.c"
|
||||
|
||||
@@ -189,11 +185,6 @@ static cairo_surface_t *gdk_window_ref_impl_surface (GdkWindow *window);
|
||||
static void gdk_window_set_frame_clock (GdkWindow *window,
|
||||
GdkFrameClock *clock);
|
||||
|
||||
static void draw_ugly_color (GdkWindow *window,
|
||||
const cairo_region_t *region,
|
||||
int color);
|
||||
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
@@ -1033,35 +1024,9 @@ recompute_visible_regions (GdkWindow *private,
|
||||
recalculate_children);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_clear_old_updated_area (GdkWindow *window)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (window->old_updated_area[i])
|
||||
{
|
||||
cairo_region_destroy (window->old_updated_area[i]);
|
||||
window->old_updated_area[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_append_old_updated_area (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
if (window->old_updated_area[1])
|
||||
cairo_region_destroy (window->old_updated_area[1]);
|
||||
window->old_updated_area[1] = window->old_updated_area[0];
|
||||
window->old_updated_area[0] = cairo_region_reference (region);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_window_update_size (GdkWindow *window)
|
||||
{
|
||||
gdk_window_clear_old_updated_area (window);
|
||||
recompute_visible_regions (window, FALSE);
|
||||
}
|
||||
|
||||
@@ -1370,7 +1335,8 @@ gdk_window_new (GdkWindow *parent,
|
||||
window->input_only = TRUE;
|
||||
}
|
||||
|
||||
window->parent->children = g_list_prepend (window->parent->children, window);
|
||||
if (window->parent)
|
||||
window->parent->children = g_list_prepend (window->parent->children, window);
|
||||
|
||||
if (window->parent->window_type == GDK_WINDOW_ROOT)
|
||||
{
|
||||
@@ -1396,7 +1362,8 @@ gdk_window_new (GdkWindow *parent,
|
||||
_gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes, attributes_mask);
|
||||
window->impl_window = window;
|
||||
|
||||
parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
|
||||
if (parent)
|
||||
parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
|
||||
|
||||
/* This will put the native window topmost in the native parent, which may
|
||||
* be wrong wrt other native windows in the non-native hierarchy, so restack */
|
||||
@@ -1419,18 +1386,6 @@ gdk_window_new (GdkWindow *parent,
|
||||
g_signal_connect (device_manager, "device-removed",
|
||||
G_CALLBACK (device_removed_cb), window);
|
||||
|
||||
|
||||
if ((_gdk_gl_flags & (GDK_GL_ALWAYS | GDK_GL_DISABLE)) == GDK_GL_ALWAYS)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (gdk_window_get_paint_gl_context (window, &error) == NULL)
|
||||
{
|
||||
g_warning ("Unable to force GL enabled: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
@@ -1757,8 +1712,9 @@ gdk_window_ensure_native (GdkWindow *window)
|
||||
NULL, 0);
|
||||
new_impl = window->impl;
|
||||
|
||||
parent->impl_window->native_children =
|
||||
g_list_prepend (parent->impl_window->native_children, window);
|
||||
if (parent)
|
||||
parent->impl_window->native_children =
|
||||
g_list_prepend (parent->impl_window->native_children, window);
|
||||
|
||||
window->impl = old_impl;
|
||||
change_impl (window, window, new_impl);
|
||||
@@ -1882,12 +1838,6 @@ gdk_window_free_current_paint (GdkWindow *window)
|
||||
cairo_region_destroy (window->current_paint.region);
|
||||
window->current_paint.region = NULL;
|
||||
|
||||
cairo_region_destroy (window->current_paint.flushed_region);
|
||||
window->current_paint.flushed_region = NULL;
|
||||
|
||||
cairo_region_destroy (window->current_paint.need_blend_region);
|
||||
window->current_paint.need_blend_region = NULL;
|
||||
|
||||
window->current_paint.surface_needs_composite = FALSE;
|
||||
}
|
||||
|
||||
@@ -1989,14 +1939,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (window->gl_paint_context)
|
||||
{
|
||||
/* Make sure to destroy if current */
|
||||
g_object_run_dispose (G_OBJECT (window->gl_paint_context));
|
||||
g_object_unref (window->gl_paint_context);
|
||||
window->gl_paint_context = NULL;
|
||||
}
|
||||
|
||||
if (window->frame_clock)
|
||||
{
|
||||
g_object_run_dispose (G_OBJECT (window->frame_clock));
|
||||
@@ -2723,80 +2665,6 @@ gdk_window_ref_impl_surface (GdkWindow *window)
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_window_get_impl_window (window));
|
||||
}
|
||||
|
||||
GdkGLContext *
|
||||
gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
|
||||
{
|
||||
if (_gdk_gl_flags & GDK_GL_DISABLE)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("GL support disabled via GDK_DEBUG"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (window->impl_window->gl_paint_context == NULL)
|
||||
{
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_3_2_CORE,
|
||||
NULL,
|
||||
error);
|
||||
if (window->impl_window->gl_paint_context == NULL &&
|
||||
g_error_matches (*error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_UNSUPPORTED_PROFILE))
|
||||
{
|
||||
g_clear_error (error);
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
TRUE,
|
||||
GDK_GL_PROFILE_DEFAULT,
|
||||
NULL,
|
||||
error);
|
||||
}
|
||||
}
|
||||
|
||||
return window->impl_window->gl_paint_context;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_create_gl_context:
|
||||
* @window: a #GdkWindow
|
||||
* @profile: the GL profile the context should target
|
||||
* @error: return location for an error
|
||||
*
|
||||
* Creates a new #GdkGLContext matching the
|
||||
* framebuffer format to the visual of the #GdkWindow. The context
|
||||
* is disconnected from any particular window or surface.
|
||||
*
|
||||
* If the creation of the #GdkGLContext failed, @error will be set.
|
||||
*
|
||||
* Returns: (transfer full): the newly created #GdkGLContext, or
|
||||
* %NULL on error
|
||||
*
|
||||
* Since: 3.16
|
||||
**/
|
||||
GdkGLContext *
|
||||
gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error)
|
||||
{
|
||||
GdkGLContext *paint_context;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
paint_context = gdk_window_get_paint_gl_context (window, error);
|
||||
if (paint_context == NULL)
|
||||
return NULL;
|
||||
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
|
||||
FALSE,
|
||||
profile,
|
||||
paint_context,
|
||||
error);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_begin_paint_rect:
|
||||
* @window: a #GdkWindow
|
||||
@@ -2873,7 +2741,6 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
GdkWindowImplClass *impl_class;
|
||||
double sx, sy;
|
||||
gboolean needs_surface;
|
||||
cairo_content_t surface_content;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -2895,59 +2762,21 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
needs_surface = impl_class->begin_paint_region (window, region);
|
||||
|
||||
window->current_paint.region = cairo_region_copy (region);
|
||||
|
||||
cairo_region_intersect (window->current_paint.region, window->clip_region);
|
||||
cairo_region_get_extents (window->current_paint.region, &clip_box);
|
||||
|
||||
window->current_paint.flushed_region = cairo_region_create ();
|
||||
window->current_paint.need_blend_region = cairo_region_create ();
|
||||
|
||||
surface_content = gdk_window_get_content (window);
|
||||
|
||||
window->current_paint.use_gl = window->impl_window->gl_paint_context != NULL;
|
||||
|
||||
if (window->current_paint.use_gl)
|
||||
{
|
||||
GdkGLContext *context;
|
||||
|
||||
int ww = gdk_window_get_width (window) * gdk_window_get_scale_factor (window);
|
||||
int wh = gdk_window_get_height (window) * gdk_window_get_scale_factor (window);
|
||||
|
||||
context = gdk_window_get_paint_gl_context (window, NULL);
|
||||
if (context == NULL)
|
||||
{
|
||||
g_warning ("gl rendering failed, context: %p", context);
|
||||
window->current_paint.use_gl = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_gl_context_make_current (context);
|
||||
/* With gl we always need a surface to combine the gl
|
||||
drawing with the native drawing. */
|
||||
needs_surface = TRUE;
|
||||
/* Also, we need the surface to include alpha */
|
||||
surface_content = CAIRO_CONTENT_COLOR_ALPHA;
|
||||
|
||||
/* Initial setup */
|
||||
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glViewport (0, 0, ww, wh);
|
||||
}
|
||||
}
|
||||
|
||||
if (needs_surface)
|
||||
{
|
||||
window->current_paint.surface = gdk_window_create_similar_surface (window,
|
||||
surface_content,
|
||||
gdk_window_get_content (window),
|
||||
MAX (clip_box.width, 1),
|
||||
MAX (clip_box.height, 1));
|
||||
sx = sy = 1;
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
|
||||
#endif
|
||||
cairo_surface_set_device_offset (window->current_paint.surface, -clip_box.x*sx, -clip_box.y*sy);
|
||||
gdk_cairo_surface_mark_as_direct (window->current_paint.surface, window);
|
||||
|
||||
window->current_paint.surface_needs_composite = TRUE;
|
||||
}
|
||||
@@ -2961,88 +2790,18 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
gdk_window_clear_backing_region (window);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_mark_paint_from_clip:
|
||||
* @window: a #GdkWindow
|
||||
* @cr: a #cairo_t
|
||||
*
|
||||
* If you call this during a paint (e.g. between gdk_window_begin_paint_region()
|
||||
* and gdk_window_end_paint() then GDK will mark the current clip region of the
|
||||
* window as being drawn. This is required when mixing GL rendering via
|
||||
* gdk_cairo_draw_from_gl() and cairo rendering, as otherwise GDK has no way
|
||||
* of knowing when something paints over the GL-drawn regions.
|
||||
*
|
||||
* This is typically called automatically by GTK+ and you don't need
|
||||
* to care about this.
|
||||
*
|
||||
* Since: 3.16
|
||||
**/
|
||||
void
|
||||
gdk_window_mark_paint_from_clip (GdkWindow *window,
|
||||
cairo_t *cr)
|
||||
{
|
||||
cairo_region_t *clip_region;
|
||||
GdkWindow *impl_window = window->impl_window;
|
||||
|
||||
if (impl_window->current_paint.surface == NULL ||
|
||||
cairo_get_target (cr) != impl_window->current_paint.surface)
|
||||
return;
|
||||
|
||||
if (cairo_region_is_empty (impl_window->current_paint.flushed_region))
|
||||
return;
|
||||
|
||||
/* This here seems a bit weird, but basically, we're taking the current
|
||||
clip and applying also the flushed region, and the result is that the
|
||||
new clip is the intersection of these. This is the area where the newly
|
||||
drawn region overlaps a previosly flushed area, which is an area of the
|
||||
double buffer surface that need to be blended OVER the back buffer rather
|
||||
than SRCed. */
|
||||
cairo_save (cr);
|
||||
/* We set the identity matrix here so we get and apply regions in native
|
||||
window coordinates. */
|
||||
cairo_identity_matrix (cr);
|
||||
gdk_cairo_region (cr, impl_window->current_paint.flushed_region);
|
||||
cairo_clip (cr);
|
||||
|
||||
clip_region = gdk_cairo_region_from_clip (cr);
|
||||
if (clip_region == NULL)
|
||||
{
|
||||
/* Failed to represent clip as region, mark all as requiring
|
||||
blend */
|
||||
cairo_region_union (impl_window->current_paint.need_blend_region,
|
||||
impl_window->current_paint.flushed_region);
|
||||
cairo_region_destroy (impl_window->current_paint.flushed_region);
|
||||
impl_window->current_paint.flushed_region = cairo_region_create ();
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_region_subtract (impl_window->current_paint.flushed_region, clip_region);
|
||||
cairo_region_union (impl_window->current_paint.need_blend_region, clip_region);
|
||||
}
|
||||
cairo_region_destroy (clip_region);
|
||||
|
||||
/* Clear the area on the double buffer surface to transparent so we
|
||||
can start drawing from scratch the area "above" the flushed
|
||||
region */
|
||||
cairo_set_source_rgba (cr, 0, 0, 0, 0);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_end_paint:
|
||||
* @window: a #GdkWindow
|
||||
*
|
||||
* Indicates that the backing store created by the most recent call
|
||||
* to gdk_window_begin_paint_region() should be copied onscreen and
|
||||
* Indicates that the backing store created by the most recent call to
|
||||
* gdk_window_begin_paint_region() should be copied onscreen and
|
||||
* deleted, leaving the next-most-recent backing store or no backing
|
||||
* store at all as the active paint region. See
|
||||
* gdk_window_begin_paint_region() for full details.
|
||||
*
|
||||
* It is an error to call this function without a matching
|
||||
* gdk_window_begin_paint_region() for full details. It is an error to
|
||||
* call this function without a matching
|
||||
* gdk_window_begin_paint_region() first.
|
||||
*
|
||||
**/
|
||||
void
|
||||
gdk_window_end_paint (GdkWindow *window)
|
||||
@@ -3050,6 +2809,7 @@ gdk_window_end_paint (GdkWindow *window)
|
||||
GdkWindow *composited;
|
||||
GdkWindowImplClass *impl_class;
|
||||
GdkRectangle clip_box = { 0, };
|
||||
cairo_region_t *full_clip;
|
||||
cairo_t *cr;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -3072,51 +2832,40 @@ gdk_window_end_paint (GdkWindow *window)
|
||||
if (window->current_paint.surface_needs_composite)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
gboolean skip_alpha_blending;
|
||||
|
||||
cairo_region_get_extents (window->current_paint.region, &clip_box);
|
||||
full_clip = cairo_region_copy (window->clip_region);
|
||||
cairo_region_intersect (full_clip, window->current_paint.region);
|
||||
|
||||
if (window->current_paint.use_gl)
|
||||
surface = gdk_window_ref_impl_surface (window);
|
||||
cr = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
|
||||
gdk_cairo_region (cr, full_clip);
|
||||
cairo_clip (cr);
|
||||
|
||||
/* We can skip alpha blending for a fast composite case
|
||||
* if we have an impl window or we're a fully opaque window. */
|
||||
skip_alpha_blending = (gdk_window_has_impl (window) ||
|
||||
window->alpha == 255);
|
||||
|
||||
if (skip_alpha_blending)
|
||||
{
|
||||
cairo_region_t *opaque_region = cairo_region_copy (window->current_paint.region);
|
||||
cairo_region_subtract (opaque_region, window->current_paint.flushed_region);
|
||||
cairo_region_subtract (opaque_region, window->current_paint.need_blend_region);
|
||||
|
||||
gdk_gl_context_make_current (window->gl_paint_context);
|
||||
|
||||
if (!cairo_region_is_empty (opaque_region))
|
||||
gdk_gl_texture_from_surface (window->current_paint.surface,
|
||||
opaque_region);
|
||||
if (!cairo_region_is_empty (window->current_paint.need_blend_region))
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
gdk_gl_texture_from_surface (window->current_paint.surface,
|
||||
window->current_paint.need_blend_region);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
cairo_region_destroy (opaque_region);
|
||||
|
||||
gdk_gl_context_end_frame (window->gl_paint_context,
|
||||
window->current_paint.region,
|
||||
window->active_update_area);
|
||||
}
|
||||
else if (!impl_class->do_composite (window))
|
||||
{
|
||||
surface = gdk_window_ref_impl_surface (window);
|
||||
cr = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_set_source_surface (cr, window->current_paint.surface, 0, 0);
|
||||
gdk_cairo_region (cr, window->current_paint.region);
|
||||
cairo_clip (cr);
|
||||
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
cairo_surface_flush (surface);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_paint_with_alpha (cr, window->alpha / 255.0);
|
||||
}
|
||||
|
||||
cairo_destroy (cr);
|
||||
cairo_region_destroy (full_clip);
|
||||
|
||||
cairo_surface_flush (surface);
|
||||
}
|
||||
|
||||
gdk_window_free_current_paint (window);
|
||||
@@ -3295,7 +3044,7 @@ _gdk_window_ref_cairo_surface (GdkWindow *window)
|
||||
* Creates a Cairo context for drawing to @window.
|
||||
*
|
||||
* Note that calling cairo_reset_clip() on the resulting #cairo_t will
|
||||
* produce undefined results, so avoid it at all costs.
|
||||
*rproduce undefined results, so avoid it at all costs.
|
||||
*
|
||||
* Returns: A newly created Cairo context. Free with
|
||||
* cairo_destroy() when you are done drawing.
|
||||
@@ -3337,7 +3086,7 @@ gdk_cairo_create (GdkWindow *window)
|
||||
/* Code for dirty-region queueing
|
||||
*/
|
||||
static GSList *update_windows = NULL;
|
||||
gboolean _gdk_debug_updates = FALSE;
|
||||
static gboolean debug_updates = FALSE;
|
||||
|
||||
static inline gboolean
|
||||
gdk_window_is_ancestor (GdkWindow *window,
|
||||
@@ -3612,9 +3361,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplClass *impl_class;
|
||||
GdkWindow *toplevel;
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
toplevel = gdk_window_get_toplevel (window);
|
||||
if (toplevel->geometry_dirty)
|
||||
{
|
||||
@@ -3633,34 +3380,18 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
*/
|
||||
if (window->update_area)
|
||||
{
|
||||
g_assert (window->active_update_area == NULL); /* No reentrancy */
|
||||
|
||||
window->active_update_area = window->update_area;
|
||||
cairo_region_t *update_area = window->update_area;
|
||||
window->update_area = NULL;
|
||||
|
||||
if (gdk_window_is_viewable (window))
|
||||
{
|
||||
cairo_region_t *expose_region;
|
||||
|
||||
expose_region = cairo_region_copy (window->active_update_area);
|
||||
|
||||
/* Sometimes we can't just paint only the new area, as the windowing system
|
||||
requires more to be repainted. For instance, with opengl you typically
|
||||
repaint all of each frame each time and then swap the buffer, although
|
||||
there are extensions that allow us to reuse part of an old frame */
|
||||
if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->invalidate_for_new_frame)
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->invalidate_for_new_frame (window, expose_region);
|
||||
|
||||
/* Clip to part visible in impl window */
|
||||
cairo_region_intersect (expose_region, window->clip_region);
|
||||
cairo_region_intersect (update_area, window->clip_region);
|
||||
|
||||
if (gdk_display_get_debug_updates (display))
|
||||
if (debug_updates)
|
||||
{
|
||||
cairo_region_t *swap_region = cairo_region_copy (expose_region);
|
||||
cairo_region_subtract (swap_region, window->active_update_area);
|
||||
draw_ugly_color (window, swap_region, 1);
|
||||
cairo_region_destroy (swap_region);
|
||||
|
||||
/* Make sure we see the red invalid area before redrawing. */
|
||||
gdk_display_sync (gdk_window_get_display (window));
|
||||
g_usleep (70000);
|
||||
@@ -3669,17 +3400,14 @@ gdk_window_process_updates_internal (GdkWindow *window)
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->queue_antiexpose)
|
||||
impl_class->queue_antiexpose (window, expose_region);
|
||||
impl_class->queue_antiexpose (window, update_area);
|
||||
|
||||
expose_region = cairo_region_copy (update_area);
|
||||
impl_class->process_updates_recurse (window, expose_region);
|
||||
cairo_region_destroy (expose_region);
|
||||
}
|
||||
|
||||
gdk_window_append_old_updated_area (window, window->active_update_area);
|
||||
|
||||
cairo_region_destroy (expose_region);
|
||||
}
|
||||
|
||||
cairo_region_destroy (window->active_update_area);
|
||||
window->active_update_area = NULL;
|
||||
cairo_region_destroy (update_area);
|
||||
}
|
||||
|
||||
window->in_update = FALSE;
|
||||
@@ -3982,17 +3710,13 @@ gdk_window_set_invalidate_handler (GdkWindow *window,
|
||||
|
||||
static void
|
||||
draw_ugly_color (GdkWindow *window,
|
||||
const cairo_region_t *region,
|
||||
int color)
|
||||
const cairo_region_t *region)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (window);
|
||||
/* Draw ugly color all over the newly-invalid region */
|
||||
if (color == 0)
|
||||
cairo_set_source_rgb (cr, 50000/65535., 10000/65535., 10000/65535.);
|
||||
else
|
||||
cairo_set_source_rgb (cr, 10000/65535., 50000/65535., 10000/65535.);
|
||||
cairo_set_source_rgb (cr, 50000/65535., 10000/65535., 10000/65535.);
|
||||
gdk_cairo_region (cr, region);
|
||||
cairo_fill (cr);
|
||||
|
||||
@@ -4068,7 +3792,6 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
|
||||
{
|
||||
cairo_region_t *visible_region;
|
||||
cairo_rectangle_int_t r;
|
||||
GdkDisplay *display;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -4088,9 +3811,8 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
|
||||
|
||||
invalidate_impl_subwindows (window, region, child_func, user_data, 0, 0);
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
if (gdk_display_get_debug_updates (display))
|
||||
draw_ugly_color (window, visible_region, 0);
|
||||
if (debug_updates)
|
||||
draw_ugly_color (window, visible_region);
|
||||
|
||||
while (window != NULL &&
|
||||
!cairo_region_is_empty (visible_region))
|
||||
@@ -4383,17 +4105,9 @@ gdk_window_thaw_updates (GdkWindow *window)
|
||||
*
|
||||
* This function is not part of the GDK public API and is only
|
||||
* for use by GTK+.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside of GTK+
|
||||
*/
|
||||
**/
|
||||
void
|
||||
gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window)
|
||||
{
|
||||
gdk_window_freeze_toplevel_updates (window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_freeze_toplevel_updates (GdkWindow *window)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
|
||||
@@ -4411,17 +4125,9 @@ gdk_window_freeze_toplevel_updates (GdkWindow *window)
|
||||
*
|
||||
* This function is not part of the GDK public API and is only
|
||||
* for use by GTK+.
|
||||
*
|
||||
* Deprecated: 3.16: This symbol was never meant to be used outside of GTK+
|
||||
*/
|
||||
**/
|
||||
void
|
||||
gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window)
|
||||
{
|
||||
gdk_window_thaw_toplevel_updates (window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_thaw_toplevel_updates (GdkWindow *window)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
|
||||
@@ -4461,7 +4167,7 @@ gdk_window_thaw_toplevel_updates (GdkWindow *window)
|
||||
void
|
||||
gdk_window_set_debug_updates (gboolean setting)
|
||||
{
|
||||
_gdk_debug_updates = setting;
|
||||
debug_updates = setting;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5345,7 +5051,6 @@ gdk_window_hide (GdkWindow *window)
|
||||
impl_class->hide (window);
|
||||
}
|
||||
|
||||
gdk_window_clear_old_updated_area (window);
|
||||
recompute_visible_regions (window, FALSE);
|
||||
|
||||
/* all decendants became non-visible, we need to send visibility notify */
|
||||
@@ -5405,7 +5110,6 @@ gdk_window_withdraw (GdkWindow *window)
|
||||
}
|
||||
|
||||
recompute_visible_regions (window, FALSE);
|
||||
gdk_window_clear_old_updated_area (window);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6043,9 +5747,6 @@ gdk_window_set_cursor_internal (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
g_assert (gdk_window_get_display (window) == gdk_device_get_display (device));
|
||||
g_assert (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor));
|
||||
|
||||
if (window->window_type == GDK_WINDOW_ROOT ||
|
||||
window->window_type == GDK_WINDOW_FOREIGN)
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_device_cursor (window, device, cursor);
|
||||
@@ -6091,15 +5792,11 @@ gdk_window_get_cursor (GdkWindow *window)
|
||||
* @window: a #GdkWindow
|
||||
* @cursor: (allow-none): a cursor
|
||||
*
|
||||
* Sets the default mouse pointer for a #GdkWindow.
|
||||
*
|
||||
* Note that @cursor must be for the same display as @window.
|
||||
*
|
||||
* Use gdk_cursor_new_for_display() or gdk_cursor_new_from_pixbuf() to
|
||||
* create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.
|
||||
* Passing %NULL for the @cursor argument to gdk_window_set_cursor() means
|
||||
* that @window will use the cursor of its parent window. Most windows
|
||||
* should use this default.
|
||||
* Sets the default mouse pointer for a #GdkWindow. Use gdk_cursor_new_for_display()
|
||||
* or gdk_cursor_new_from_pixbuf() to create the cursor. To make the cursor
|
||||
* invisible, use %GDK_BLANK_CURSOR. Passing %NULL for the @cursor argument
|
||||
* to gdk_window_set_cursor() means that @window will use the cursor of its
|
||||
* parent window. Most windows should use this default.
|
||||
*/
|
||||
void
|
||||
gdk_window_set_cursor (GdkWindow *window,
|
||||
@@ -6800,22 +6497,27 @@ gdk_window_merge_child_input_shapes (GdkWindow *window)
|
||||
* @window: a #GdkWindow
|
||||
* @use_static: %TRUE to turn on static gravity
|
||||
*
|
||||
* Used to set the bit gravity of the given window to static, and flag
|
||||
* it so all children get static subwindow gravity. This is used if you
|
||||
* are implementing scary features that involve deep knowledge of the
|
||||
* windowing system. Don’t worry about it.
|
||||
* Set the bit gravity of the given window to static, and flag it so
|
||||
* all children get static subwindow gravity. This is used if you are
|
||||
* implementing scary features that involve deep knowledge of the
|
||||
* windowing system. Don’t worry about it unless you have to.
|
||||
*
|
||||
* Returns: %FALSE
|
||||
*
|
||||
* Deprecated: 3.16: static gravities haven't worked on anything but X11
|
||||
* for a long time.
|
||||
* Returns: %TRUE if the server supports static gravity
|
||||
*/
|
||||
gboolean
|
||||
gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static)
|
||||
{
|
||||
GdkWindowImplClass *impl_class;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
if (gdk_window_has_impl (window))
|
||||
{
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
return impl_class->set_static_gravities (window, use_static);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -6830,9 +6532,6 @@ gdk_window_set_static_gravities (GdkWindow *window,
|
||||
* Returns: %TRUE if the window is composited.
|
||||
*
|
||||
* Since: 2.22
|
||||
*
|
||||
* Deprecated: 3.16: Compositing is an outdated technology that
|
||||
* only ever worked on X11.
|
||||
**/
|
||||
gboolean
|
||||
gdk_window_get_composited (GdkWindow *window)
|
||||
@@ -6871,9 +6570,6 @@ gdk_window_get_composited (GdkWindow *window)
|
||||
* attempting to do so.
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 3.16: Compositing is an outdated technology that
|
||||
* only ever worked on X11.
|
||||
*/
|
||||
void
|
||||
gdk_window_set_composited (GdkWindow *window,
|
||||
@@ -6896,14 +6592,12 @@ gdk_window_set_composited (GdkWindow *window,
|
||||
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (composited && (!gdk_display_supports_composite (display) || !impl_class->set_composited))
|
||||
{
|
||||
g_warning ("gdk_window_set_composited called but "
|
||||
"compositing is not supported");
|
||||
return;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
impl_class->set_composited (window, composited);
|
||||
|
||||
@@ -8028,9 +7722,9 @@ gdk_pointer_grab (GdkWindow * window,
|
||||
gulong serial;
|
||||
GList *devices, *dev;
|
||||
|
||||
g_return_val_if_fail (window != NULL, GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (window != NULL, 0);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
||||
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
|
||||
|
||||
/* We need a native window for confine to to work, ensure we have one */
|
||||
if (confine_to)
|
||||
@@ -8140,7 +7834,7 @@ gdk_keyboard_grab (GdkWindow *window,
|
||||
gulong serial;
|
||||
GList *devices, *dev;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
|
||||
|
||||
/* Non-viewable client side window => fail */
|
||||
if (!_gdk_window_has_impl (window) &&
|
||||
@@ -9451,7 +9145,6 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
cairo_surface_t *window_surface, *surface;
|
||||
double sx, sy;
|
||||
|
||||
@@ -9459,23 +9152,28 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
|
||||
window_surface = gdk_window_ref_impl_surface (window);
|
||||
sx = sy = 1;
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_get_device_scale (window_surface, &sx, &sy);
|
||||
#endif
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
switch (display->rendering_mode)
|
||||
switch (_gdk_rendering_mode)
|
||||
{
|
||||
case GDK_RENDERING_MODE_RECORDING:
|
||||
{
|
||||
cairo_rectangle_t rect = { 0, 0, width * sx, height *sy };
|
||||
surface = cairo_recording_surface_create (content, &rect);
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_set_device_scale (surface, sx, sy);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case GDK_RENDERING_MODE_IMAGE:
|
||||
surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
|
||||
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
|
||||
width * sx, height * sy);
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
cairo_surface_set_device_scale (surface, sx, sy);
|
||||
#endif
|
||||
break;
|
||||
case GDK_RENDERING_MODE_SIMILAR:
|
||||
default:
|
||||
@@ -9553,10 +9251,12 @@ gdk_window_create_similar_image_surface (GdkWindow * window,
|
||||
cairo_surface_destroy (window_surface);
|
||||
}
|
||||
|
||||
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
|
||||
if (scale == 0)
|
||||
scale = gdk_window_get_scale_factor (window);
|
||||
|
||||
cairo_surface_set_device_scale (surface, scale, scale);
|
||||
#endif
|
||||
|
||||
return surface;
|
||||
}
|
||||
@@ -10553,12 +10253,7 @@ gdk_window_configure_finished (GdkWindow *window)
|
||||
*
|
||||
* For toplevel windows this depends on support from the windowing system
|
||||
* that may not always be there. For instance, On X11, this works only on
|
||||
* X screens with a compositing manager running. On Wayland, there is no
|
||||
* per-window opacity value that the compositor would apply. Instead, use
|
||||
* `gdk_window_set_opaque_region (window, NULL)` to tell the compositor
|
||||
* that the entire window is (potentially) non-opaque, and draw your content
|
||||
* with alpha, or use gtk_widget_set_opacity() to set an overall opacity
|
||||
* for your widgets.
|
||||
* X screens with a compositing manager running.
|
||||
*
|
||||
* For child windows this function only works for non-native windows.
|
||||
*
|
||||
@@ -11044,37 +10739,6 @@ gdk_window_get_scale_factor (GdkWindow *window)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Returns the *real* unscaled size, which may be a fractional size
|
||||
in window scale coordinates. We need this to properly handle GL
|
||||
coordinates which are y-flipped in the real coordinates. */
|
||||
void
|
||||
gdk_window_get_unscaled_size (GdkWindow *window,
|
||||
int *unscaled_width,
|
||||
int *unscaled_height)
|
||||
{
|
||||
GdkWindowImplClass *impl_class;
|
||||
gint scale;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
if (window->impl_window == window)
|
||||
{
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->get_unscaled_size)
|
||||
return impl_class->get_unscaled_size (window, unscaled_width, unscaled_height);
|
||||
}
|
||||
|
||||
scale = gdk_window_get_scale_factor (window);
|
||||
|
||||
if (unscaled_width)
|
||||
*unscaled_width = window->width * scale;
|
||||
|
||||
if (unscaled_height)
|
||||
*unscaled_height = window->height * scale;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gdk_window_set_opaque_region:
|
||||
* @window: a top-level or non-native #GdkWindow
|
||||
|
||||
@@ -627,9 +627,9 @@ void gdk_window_shape_combine_region (GdkWindow *window,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_set_child_shapes (GdkWindow *window);
|
||||
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_window_get_composited (GdkWindow *window);
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_set_composited (GdkWindow *window,
|
||||
gboolean composited);
|
||||
|
||||
@@ -675,7 +675,7 @@ GdkWindowState gdk_window_get_state (GdkWindow *window);
|
||||
/* Set static bit gravity on the parent, and static
|
||||
* window gravity on all children.
|
||||
*/
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_window_set_static_gravities (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
|
||||
@@ -739,9 +739,6 @@ cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_begin_paint_rect (GdkWindow *window,
|
||||
const GdkRectangle *rectangle);
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
void gdk_window_mark_paint_from_clip (GdkWindow *window,
|
||||
cairo_t *cr);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_begin_paint_region (GdkWindow *window,
|
||||
const cairo_region_t *region);
|
||||
@@ -1037,9 +1034,9 @@ void gdk_window_freeze_updates (GdkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_thaw_updates (GdkWindow *window);
|
||||
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -1111,12 +1108,6 @@ GDK_AVAILABLE_IN_3_14
|
||||
gboolean gdk_window_show_window_menu (GdkWindow *window,
|
||||
GdkEvent *event);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
|
||||
GdkGLProfile profile,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WINDOW_H__ */
|
||||
|
||||
@@ -46,18 +46,11 @@ gdk_window_impl_process_updates_recurse (GdkWindow *window,
|
||||
_gdk_window_process_updates_recurse (window, region);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_impl_do_composite (GdkWindow *window)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_impl_class_init (GdkWindowImplClass *impl_class)
|
||||
{
|
||||
impl_class->beep = gdk_window_impl_beep;
|
||||
impl_class->process_updates_recurse = gdk_window_impl_process_updates_recurse;
|
||||
impl_class->do_composite = gdk_window_impl_do_composite;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -121,6 +121,9 @@ struct _GdkWindowImplClass
|
||||
gint offset_x,
|
||||
gint offset_y);
|
||||
|
||||
gboolean (* set_static_gravities) (GdkWindow *window,
|
||||
gboolean use_static);
|
||||
|
||||
/* Called before processing updates for a window. This gives the windowing
|
||||
* layer a chance to save the region for later use in avoiding duplicate
|
||||
* exposes.
|
||||
@@ -279,9 +282,6 @@ struct _GdkWindowImplClass
|
||||
GdkAtom property);
|
||||
|
||||
gint (* get_scale_factor) (GdkWindow *window);
|
||||
void (* get_unscaled_size) (GdkWindow *window,
|
||||
int *unscaled_width,
|
||||
int *unscaled_height);
|
||||
|
||||
void (* set_opaque_region) (GdkWindow *window,
|
||||
cairo_region_t *region);
|
||||
@@ -292,14 +292,6 @@ struct _GdkWindowImplClass
|
||||
gint bottom);
|
||||
gboolean (* show_window_menu) (GdkWindow *window,
|
||||
GdkEvent *event);
|
||||
GdkGLContext *(*create_gl_context) (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLProfile profile,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
void (*invalidate_for_new_frame)(GdkWindow *window,
|
||||
cairo_region_t *update_area);
|
||||
gboolean (*do_composite) (GdkWindow *window);
|
||||
};
|
||||
|
||||
/* Interface Functions */
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
## 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 \
|
||||
gdkmirglcontext.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
|
||||
@@ -1,293 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
* 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 <epoxy/egl.h>
|
||||
|
||||
#include "gdkmir.h"
|
||||
#include "gdkdisplay.h"
|
||||
#include "gdkscreen.h"
|
||||
#include "gdkdevicemanager.h"
|
||||
#include "gdkglcontextprivate.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_MIR_WINDOW_IMPL, GdkMirWindowImpl))
|
||||
#define GDK_IS_WINDOW_IMPL_MIR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW_IMPL))
|
||||
|
||||
GType gdk_mir_window_impl_get_type (void);
|
||||
|
||||
|
||||
struct _GdkMirGLContext
|
||||
{
|
||||
GdkGLContext parent_instance;
|
||||
|
||||
EGLContext egl_context;
|
||||
EGLConfig egl_config;
|
||||
gboolean is_attached;
|
||||
};
|
||||
|
||||
struct _GdkMirGLContextClass
|
||||
{
|
||||
GdkGLContextClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct _GdkMirGLContext GdkMirGLContext;
|
||||
typedef struct _GdkMirGLContextClass GdkMirGLContextClass;
|
||||
|
||||
#define GDK_MIR_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_MIR_GL_CONTEXT, GdkMirGLContext))
|
||||
|
||||
|
||||
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_for_type (GdkDisplay *display, GdkCursorType type);
|
||||
|
||||
GdkCursor *_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name);
|
||||
|
||||
const gchar *_gdk_mir_cursor_get_name (GdkCursor *cursor);
|
||||
|
||||
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_surface_type (GdkMirWindowImpl *impl, MirSurfaceType type);
|
||||
|
||||
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);
|
||||
|
||||
MirPixelFormat _gdk_mir_display_get_pixel_format (GdkDisplay *display, MirBufferUsage usage);
|
||||
|
||||
gboolean _gdk_mir_display_init_egl_display (GdkDisplay *display);
|
||||
|
||||
EGLDisplay _gdk_mir_display_get_egl_display (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_khr_create_context (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_buffer_age (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_swap_buffers_with_damage (GdkDisplay *display);
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_surfaceless_context (GdkDisplay *display);
|
||||
|
||||
EGLSurface _gdk_mir_window_get_egl_surface (GdkWindow *window, EGLConfig config);
|
||||
|
||||
EGLSurface _gdk_mir_window_get_dummy_egl_surface (GdkWindow *window, EGLConfig config);
|
||||
|
||||
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__ */
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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_GL_CONTEXT (gdk_mir_gl_context_get_type ())
|
||||
#define GDK_MIR_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_MIR_GL_CONTEXT))
|
||||
|
||||
#define GDK_TYPE_MIR_WINDOW (gdk_mir_window_get_type ())
|
||||
#define GDK_IS_MIR_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_MIR_WINDOW))
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gdk_mir_display_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
MirConnection *gdk_mir_display_get_mir_connection (GdkDisplay *display);
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gdk_mir_window_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
MirSurface *gdk_mir_window_get_mir_surface (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_16
|
||||
GType gdk_mir_gl_context_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#endif /* __GDK_MIR_H__ */
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
gchar *name;
|
||||
};
|
||||
|
||||
struct GdkMirCursorClass
|
||||
{
|
||||
GdkCursorClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkMirCursor, gdk_mir_cursor, GDK_TYPE_CURSOR)
|
||||
|
||||
static const gchar *
|
||||
get_cursor_name_for_cursor_type (GdkCursorType cursor_type)
|
||||
{
|
||||
switch (cursor_type)
|
||||
{
|
||||
case GDK_BLANK_CURSOR:
|
||||
return mir_disabled_cursor_name;
|
||||
case GDK_X_CURSOR:
|
||||
case GDK_ARROW:
|
||||
case GDK_CENTER_PTR:
|
||||
case GDK_DRAFT_LARGE:
|
||||
case GDK_DRAFT_SMALL:
|
||||
case GDK_LEFT_PTR:
|
||||
case GDK_RIGHT_PTR:
|
||||
case GDK_TOP_LEFT_ARROW:
|
||||
return mir_arrow_cursor_name;
|
||||
case GDK_CLOCK:
|
||||
case GDK_WATCH:
|
||||
return mir_busy_cursor_name;
|
||||
case GDK_XTERM:
|
||||
return mir_caret_cursor_name;
|
||||
case GDK_HAND1:
|
||||
case GDK_HAND2:
|
||||
return mir_pointing_hand_cursor_name;
|
||||
return mir_open_hand_cursor_name;
|
||||
case GDK_FLEUR:
|
||||
return mir_closed_hand_cursor_name;
|
||||
case GDK_LEFT_SIDE:
|
||||
case GDK_LEFT_TEE:
|
||||
case GDK_RIGHT_SIDE:
|
||||
case GDK_RIGHT_TEE:
|
||||
case GDK_SB_LEFT_ARROW:
|
||||
case GDK_SB_RIGHT_ARROW:
|
||||
return mir_horizontal_resize_cursor_name;
|
||||
case GDK_BASED_ARROW_DOWN:
|
||||
case GDK_BASED_ARROW_UP:
|
||||
case GDK_BOTTOM_SIDE:
|
||||
case GDK_BOTTOM_TEE:
|
||||
case GDK_DOUBLE_ARROW:
|
||||
case GDK_SB_DOWN_ARROW:
|
||||
case GDK_SB_UP_ARROW:
|
||||
case GDK_TOP_SIDE:
|
||||
case GDK_TOP_TEE:
|
||||
return mir_vertical_resize_cursor_name;
|
||||
case GDK_BOTTOM_LEFT_CORNER:
|
||||
case GDK_LL_ANGLE:
|
||||
case GDK_TOP_RIGHT_CORNER:
|
||||
case GDK_UR_ANGLE:
|
||||
return mir_diagonal_resize_bottom_to_top_cursor_name;
|
||||
case GDK_BOTTOM_RIGHT_CORNER:
|
||||
case GDK_LR_ANGLE:
|
||||
case GDK_SIZING:
|
||||
case GDK_TOP_LEFT_CORNER:
|
||||
case GDK_UL_ANGLE:
|
||||
return mir_diagonal_resize_top_to_bottom_cursor_name;
|
||||
return mir_omnidirectional_resize_cursor_name;
|
||||
case GDK_SB_V_DOUBLE_ARROW:
|
||||
return mir_vsplit_resize_cursor_name;
|
||||
case GDK_SB_H_DOUBLE_ARROW:
|
||||
return mir_hsplit_resize_cursor_name;
|
||||
default:
|
||||
return mir_default_cursor_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GdkCursor *
|
||||
_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name)
|
||||
{
|
||||
GdkMirCursor *cursor;
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_MIR_CURSOR, "display", display, "cursor-type", GDK_CURSOR_IS_PIXMAP, NULL);
|
||||
cursor->name = g_strdup (name);
|
||||
|
||||
return GDK_CURSOR (cursor);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_mir_cursor_new_for_type (GdkDisplay *display, GdkCursorType type)
|
||||
{
|
||||
GdkMirCursor *cursor;
|
||||
|
||||
cursor = g_object_new (GDK_TYPE_MIR_CURSOR, "display", display, "cursor-type", type, NULL);
|
||||
cursor->name = g_strdup (get_cursor_name_for_cursor_type (type));
|
||||
|
||||
return GDK_CURSOR (cursor);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
_gdk_mir_cursor_get_name (GdkCursor *cursor)
|
||||
{
|
||||
GdkMirCursor *mir_cursor = GDK_MIR_CURSOR (cursor);
|
||||
|
||||
return mir_cursor->name;
|
||||
}
|
||||
|
||||
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_finalize (GObject *object)
|
||||
{
|
||||
GdkMirCursor *mir_cursor = GDK_MIR_CURSOR (object);
|
||||
|
||||
g_free (mir_cursor->name);
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_cursor_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_cursor_class_init (GdkMirCursorClass *klass)
|
||||
{
|
||||
GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
cursor_class->get_surface = gdk_mir_cursor_get_surface;
|
||||
object_class->finalize = gdk_mir_cursor_finalize;
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
@@ -1,735 +0,0 @@
|
||||
/*
|
||||
* 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_TYPE_DISPLAY_MIR (gdk_mir_display_get_type ())
|
||||
#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;
|
||||
|
||||
GdkKeymap *keymap;
|
||||
|
||||
MirPixelFormat sw_pixel_format;
|
||||
MirPixelFormat hw_pixel_format;
|
||||
|
||||
EGLDisplay egl_display;
|
||||
guint have_egl_khr_create_context : 1;
|
||||
guint have_egl_buffer_age : 1;
|
||||
guint have_egl_swap_buffers_with_damage : 1;
|
||||
guint have_egl_surfaceless_context : 1;
|
||||
} GdkMirDisplay;
|
||||
|
||||
typedef struct GdkMirDisplayClass
|
||||
{
|
||||
GdkDisplayClass parent_class;
|
||||
} GdkMirDisplayClass;
|
||||
|
||||
static void initialize_pixel_formats (GdkMirDisplay *display);
|
||||
|
||||
/**
|
||||
* 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));
|
||||
initialize_pixel_formats (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)
|
||||
{
|
||||
return _gdk_mir_cursor_new_for_type (display, cursor_type);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
gdk_mir_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_mir_cursor_new_for_name (display, name);
|
||||
}
|
||||
|
||||
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_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
|
||||
initialize_pixel_formats (GdkMirDisplay *display)
|
||||
{
|
||||
MirPixelFormat formats[mir_pixel_formats];
|
||||
unsigned int n_formats, i;
|
||||
|
||||
mir_connection_get_available_surface_formats (display->connection, formats,
|
||||
mir_pixel_formats, &n_formats);
|
||||
|
||||
display->sw_pixel_format = mir_pixel_format_invalid;
|
||||
display->hw_pixel_format = mir_pixel_format_invalid;
|
||||
|
||||
for (i = 0; i < n_formats; i++)
|
||||
{
|
||||
switch (formats[i])
|
||||
{
|
||||
case mir_pixel_format_abgr_8888:
|
||||
case mir_pixel_format_xbgr_8888:
|
||||
case mir_pixel_format_argb_8888:
|
||||
case mir_pixel_format_xrgb_8888:
|
||||
display->hw_pixel_format = formats[i];
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (display->hw_pixel_format != mir_pixel_format_invalid)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < n_formats; i++)
|
||||
{
|
||||
if (formats[i] == mir_pixel_format_argb_8888)
|
||||
{
|
||||
display->sw_pixel_format = formats[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MirPixelFormat
|
||||
_gdk_mir_display_get_pixel_format (GdkDisplay *display,
|
||||
MirBufferUsage usage)
|
||||
{
|
||||
GdkMirDisplay *mir_dpy = GDK_MIR_DISPLAY (display);
|
||||
|
||||
if (usage == mir_buffer_usage_hardware)
|
||||
return mir_dpy->hw_pixel_format;
|
||||
|
||||
return mir_dpy->sw_pixel_format;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_mir_display_init_egl_display (GdkDisplay *display)
|
||||
{
|
||||
GdkMirDisplay *mir_dpy = GDK_MIR_DISPLAY (display);
|
||||
EGLint major_version, minor_version;
|
||||
EGLDisplay *dpy;
|
||||
|
||||
if (mir_dpy->egl_display)
|
||||
return TRUE;
|
||||
|
||||
dpy = eglGetDisplay (mir_connection_get_egl_native_display (mir_dpy->connection));
|
||||
if (dpy == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!eglInitialize (dpy, &major_version, &minor_version))
|
||||
return FALSE;
|
||||
|
||||
if (!eglBindAPI (EGL_OPENGL_API))
|
||||
return FALSE;
|
||||
|
||||
mir_dpy->egl_display = dpy;
|
||||
|
||||
mir_dpy->have_egl_khr_create_context =
|
||||
epoxy_has_egl_extension (dpy, "EGL_KHR_create_context");
|
||||
|
||||
mir_dpy->have_egl_buffer_age =
|
||||
epoxy_has_egl_extension (dpy, "EGL_EXT_buffer_age");
|
||||
|
||||
mir_dpy->have_egl_swap_buffers_with_damage =
|
||||
epoxy_has_egl_extension (dpy, "EGL_EXT_swap_buffers_with_damage");
|
||||
|
||||
mir_dpy->have_egl_surfaceless_context =
|
||||
epoxy_has_egl_extension (dpy, "EGL_KHR_surfaceless_context");
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("EGL API version %d.%d found\n"
|
||||
" - Vendor: %s\n"
|
||||
" - Version: %s\n"
|
||||
" - Client APIs: %s\n"
|
||||
" - Extensions:\n"
|
||||
"\t%s\n",
|
||||
major_version,
|
||||
minor_version,
|
||||
eglQueryString (dpy, EGL_VENDOR),
|
||||
eglQueryString (dpy, EGL_VERSION),
|
||||
eglQueryString (dpy, EGL_CLIENT_APIS),
|
||||
eglQueryString (dpy, EGL_EXTENSIONS)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context)
|
||||
{
|
||||
EGLDisplay egl_display = _gdk_mir_display_get_egl_display (display);
|
||||
GdkMirGLContext *mir_context;
|
||||
GdkWindow *window;
|
||||
EGLSurface egl_surface;
|
||||
|
||||
if (context == NULL)
|
||||
{
|
||||
eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
mir_context = GDK_MIR_GL_CONTEXT (context);
|
||||
window = gdk_gl_context_get_window (context);
|
||||
|
||||
if (mir_context->is_attached)
|
||||
{
|
||||
egl_surface = _gdk_mir_window_get_egl_surface (window,
|
||||
mir_context->egl_config);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_gdk_mir_display_have_egl_surfaceless_context (display))
|
||||
egl_surface = EGL_NO_SURFACE;
|
||||
else
|
||||
egl_surface = _gdk_mir_window_get_dummy_egl_surface (window,
|
||||
mir_context->egl_config);
|
||||
}
|
||||
|
||||
if (!eglMakeCurrent (egl_display, egl_surface, egl_surface, mir_context->egl_context))
|
||||
{
|
||||
g_warning ("eglMakeCurrent failed");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
EGLDisplay _gdk_mir_display_get_egl_display (GdkDisplay *display)
|
||||
{
|
||||
return GDK_MIR_DISPLAY (display)->egl_display;
|
||||
}
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_khr_create_context (GdkDisplay *display)
|
||||
{
|
||||
return GDK_MIR_DISPLAY (display)->have_egl_khr_create_context;
|
||||
}
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_buffer_age (GdkDisplay *display)
|
||||
{
|
||||
/* FIXME: this is not really supported by mir yet (despite is advertised) */
|
||||
// return GDK_MIR_DISPLAY (display)->have_egl_buffer_age;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_swap_buffers_with_damage (GdkDisplay *display)
|
||||
{
|
||||
/* FIXME: this is not really supported by mir yet (despite is advertised) */
|
||||
// return GDK_MIR_DISPLAY (display)->have_egl_swap_buffers_with_damage;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean _gdk_mir_display_have_egl_surfaceless_context (GdkDisplay *display)
|
||||
{
|
||||
return GDK_MIR_DISPLAY (display)->have_egl_surfaceless_context;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gdk_mir_display_init (GdkMirDisplay *display)
|
||||
{
|
||||
display->event_source = _gdk_mir_event_source_new (GDK_DISPLAY (display));
|
||||
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->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;
|
||||
display_class->make_gl_context_current = gdk_mir_display_make_gl_context_current;
|
||||
}
|
||||
@@ -1,631 +0,0 @@
|
||||
/*
|
||||
* 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 == 0 || (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:
|
||||
_gdk_mir_window_impl_set_surface_type (impl, event->value);
|
||||
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;
|
||||
case mir_event_type_prompt_session_state_change:
|
||||
// FIXME?
|
||||
break;
|
||||
case mir_event_type_orientation:
|
||||
// FIXME?
|
||||
break;
|
||||
default:
|
||||
g_warning ("Ignoring unknown Mir event %d", event->type);
|
||||
// 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);
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkmirglcontext.c: Mir specific OpenGL wrappers
|
||||
*
|
||||
* Copyright © 2014 Canonical Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkmir-private.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkintl.h"
|
||||
|
||||
G_DEFINE_TYPE (GdkMirGLContext, gdk_mir_gl_context, GDK_TYPE_GL_CONTEXT)
|
||||
|
||||
static void
|
||||
gdk_mir_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage)
|
||||
{
|
||||
GdkWindow *window = gdk_gl_context_get_window (context);
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkMirGLContext *context_mir = GDK_MIR_GL_CONTEXT (context);
|
||||
EGLDisplay egl_display = _gdk_mir_display_get_egl_display (display);
|
||||
EGLSurface egl_surface;
|
||||
|
||||
gdk_gl_context_make_current (context);
|
||||
|
||||
egl_surface = _gdk_mir_window_get_egl_surface (window,
|
||||
context_mir->egl_config);
|
||||
|
||||
if (_gdk_mir_display_have_egl_swap_buffers_with_damage (display))
|
||||
{
|
||||
int i, j, n_rects = cairo_region_num_rectangles (damage);
|
||||
EGLint *rects = g_new (EGLint, n_rects * 4);
|
||||
cairo_rectangle_int_t rect;
|
||||
int window_height = gdk_window_get_height (window);
|
||||
|
||||
for (i = 0, j = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (damage, i, &rect);
|
||||
rects[j++] = rect.x;
|
||||
rects[j++] = window_height - rect.height - rect.y;
|
||||
rects[j++] = rect.width;
|
||||
rects[j++] = rect.height;
|
||||
}
|
||||
eglSwapBuffersWithDamageEXT (egl_display, egl_surface, rects, n_rects);
|
||||
g_free (rects);
|
||||
}
|
||||
else
|
||||
{
|
||||
eglSwapBuffers (egl_display, egl_surface);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_gl_context_dispose (GObject *gobject)
|
||||
{
|
||||
GdkMirGLContext *context_mir = GDK_MIR_GL_CONTEXT (gobject);
|
||||
|
||||
if (context_mir->egl_context != NULL)
|
||||
{
|
||||
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
|
||||
GdkWindow *window = gdk_gl_context_get_window (context);
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
EGLDisplay egl_display = _gdk_mir_display_get_egl_display (display);
|
||||
|
||||
if (eglGetCurrentContext () == context_mir->egl_context)
|
||||
eglMakeCurrent (egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("Destroying EGL context\n"));
|
||||
|
||||
eglDestroyContext (egl_display, context_mir->egl_context);
|
||||
context_mir->egl_context = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gdk_mir_gl_context_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_gl_context_class_init (GdkMirGLContextClass *klass)
|
||||
{
|
||||
GdkGLContextClass *context_class = GDK_GL_CONTEXT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
context_class->end_frame = gdk_mir_gl_context_end_frame;
|
||||
gobject_class->dispose = gdk_mir_gl_context_dispose;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_gl_context_init (GdkMirGLContext *self)
|
||||
{
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user