Compare commits

..

736 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
d76bba5cb4 mir: swap buffer async only when a repaint has been requested
And ignore swapping while still processing a request.
2014-11-20 04:52:58 +01:00
Marco Trevisan (Treviño)
99d849412b mir: add public getter for the internal MirSurface 2014-11-20 04:41:45 +01:00
Marco Trevisan (Treviño)
60e185e496 mir: don't use struct MirConnection*, just the latter 2014-11-20 04:41:06 +01:00
Marco Trevisan (Treviño)
6e9db05601 mir: add OpenGL support
Implement GdkGLContext using EGL and use hardware mir surfaces
when a GdkWindow uses gl rendering.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740346
2014-11-20 04:33:38 +01:00
Matthias Clasen
45cfb405c0 GtkModelButton: Don't show both text and icon
The intention was that ::iconic indicates which representation is
preferred (text or icon). We fall back to the other representation
if one is missing.
2014-11-19 21:14:30 -05:00
Matthias Clasen
d51c9e0337 GtkPopoverMenu: be more careful about change notification
Only emit notify for ::visible-submenu when the visible page
in the stack actually changed.
2014-11-19 21:14:30 -05:00
Kjartan Maraas
46b6c2f024 Updated Norwegian bokmål translation. 2014-11-19 19:42:51 +01:00
Kjartan Maraas
048bbb0e6d Updated Norwegian bokmål translation. 2014-11-19 19:31:09 +01:00
Daniel Mustieles
17fce05123 Updated Spanish translation 2014-11-19 13:48:15 +01:00
Lapo Calamandrei
7197758600 Adwaita: typo fix 2014-11-18 15:17:06 +01:00
Matthias Clasen
955c798ab1 GtkPopoverMenu: expose more properties
Expose the position as a child property and the visible page
as a property. These are useful in glade.
2014-11-18 13:39:15 +01:00
Matthias Clasen
cd8576ec19 GtkStack: Fix an oversight in child renaming
We currently emit a warning if you rename a child to the name
it already has. We shouldn't do that.
2014-11-18 13:37:51 +01:00
Tom Tryfonidis
d31896bdba Updated Greek translation 2014-11-18 08:36:28 +00:00
Timm Bäder
0fac139057 Revert "GtkMenuSectionBox: Add tooltip to iconic buttons"
This reverts commit 7543e7b279.
2014-11-17 18:39:15 +01:00
Timm Bäder
9b83858d9a Revert "popover: Add show/hide transition"
This reverts commit 17f48e3a9e.
2014-11-17 18:39:00 +01:00
Timm Bäder
56133a1feb GtkDialog: Connect to activate signals only once
If the widget is an action widget, it's been previously added with
gtk_dialog_add_action_widget, which calls add_response_data on it, which
in turn connects to the clicked/activate signal of that widget, so we
don't need to connect to that signal a second time in
gtk_buildable_custom_finished.
2014-11-17 18:37:47 +01:00
Timm Bäder
17f48e3a9e popover: Add show/hide transition 2014-11-17 18:37:47 +01:00
Timm Bäder
7543e7b279 GtkMenuSectionBox: Add tooltip to iconic buttons 2014-11-17 18:37:47 +01:00
Marco Trevisan (Treviño)
e0e46a4f6b mir: update surface type based on events 2014-11-17 17:23:36 +01:00
Carlos Garnacho
7651061920 scrolledwindow: Avoid too frequent redraws of scrollbars
When overshooting through touchpad kinetic scrolling, the scrollbar remains
mostly static as it already hit a boundary. However, the fade in/out checks
are constantly run during scroll events, causing needless redraws in this
specific case.
2014-11-17 16:55:08 +01:00
Carlos Garnacho
6d5f2ff87e scrolledwindow: Only render background/frame on the widget window
Otherwise it is rendered too on each indicator window, possibly bringing
in an unintended opaque background there. Better seen with git show -b.
2014-11-17 14:55:05 +01:00
Marco Trevisan (Treviño)
da8fdab87b mir: fix typo in GDK_IS_WINDOW_MIR definition 2014-11-17 14:02:22 +01:00
Marco Trevisan (Treviño)
acfc4f8910 mir: invert scrolling delta 2014-11-17 14:02:22 +01:00
Robert Ancell
5ff39b207b mir: Require mirclient >= 0.9.0
Recent changes to the Mir backend require an unreleased version.
2014-11-17 10:49:13 +13:00
Matthias Clasen
ecfcb3e2cc Make gtk_container_remove work on popover menus
Extend the hack we have in place for composite containers to
GtkPopoverMenu.
2014-11-16 02:30:19 -05:00
Matthias Clasen
1e39790c49 GtkPopoverMenu: Implement forall
This is required to make glade work.
2014-11-16 02:30:19 -05:00
Lapo Calamandrei
4f7abe3762 Adwaita: no border radius for GtkTreeView:selected 2014-11-15 19:08:13 +01:00
Lapo Calamandrei
268efd1475 textview: remove osd style class from touch selection popover
The touch-selection class is sufficient since that needs special
casing whatever.
2014-11-15 16:09:39 +01:00
Lapo Calamandrei
df7b275de8 entry: remove osd style class from touch selection popover
The touch-selection class is sufficient since that needs special
casing whatever.
2014-11-15 16:08:15 +01:00
Lapo Calamandrei
beb28dd3e9 Adwaita: :selected cleanup and rationalization 2014-11-15 15:54:20 +01:00
Marco Trevisan (Treviño)
f5c5e9385e mir: handle more surface types 2014-11-14 23:19:15 +01:00
Marco Trevisan (Treviño)
8bc523ef59 mir: fix compilation in mirscreen 2014-11-14 23:19:15 +01:00
Lapo Calamandrei
32aa33e8d1 Adwaita: popover scss cleanup 2014-11-14 19:34:09 +01:00
Lapo Calamandrei
ebc379287f Adwaita: more overshoot tweakings and typo fix 2014-11-14 18:58:22 +01:00
Matthias Clasen
a7173d097f Make overlay scrollbar fading interruptible
When the pointer starts hovering the scrollbar after it already
started fading out, interrupt the fade and keep the scrollbar
around.
2014-11-14 11:49:33 -05:00
Matthias Clasen
95b075b8eb Drop unused variables
Keeps the compiler happy.
2014-11-14 11:48:50 -05:00
Lapo Calamandrei
a30a54a521 Adwaita: overshoot style tweaks
Trying to make it visible on the dark variant.
2014-11-14 15:37:02 +01:00
Matthias Clasen
2d1c7b8937 Trivial formatting fix 2014-11-14 06:16:41 -05:00
Matthias Clasen
49cf85509a GtkPopover: Survive attach_widget == NULL
We can't render a tail, but otherwise things should just work.
This will be useful in glade.
2014-11-14 06:16:41 -05:00
Chun-wei Fan
61286d5927 gdk/gdkgl.c: Fix Typo
The extra ';' actually broke builds on C89 compilers...
2014-11-14 17:26:29 +08:00
Josef Andersson
ef6d5ddf27 Updated Swedish translation 2014-11-13 22:01:55 +00:00
Carlos Garnacho
632accd9cc scrolledwindow: Use a fully transparent background for the overlay window
The background will be already given and updated in the GtkScrollbar widget,
plus the background remained static on the window since it is realized.
2014-11-13 21:25:52 +01:00
Kjartan Maraas
ed9202bf67 Updated Norwegian bokmål translation. 2014-11-13 21:13:02 +01:00
Carlos Garnacho
b591cacc39 scrolledwindow: Don't doubly draw overlay-indicator scrollbars
The scrollbars are still internal children of the GtkScrolledWindow
and handled in ::forall(), no need to propagate draw here again
after chaining up in ::draw().
2014-11-13 20:32:36 +01:00
Carlos Garnacho
733f70ea84 gtkpopover: Fix allocation of child widget wrt margins
During size request, all sides' margins are ensured to be as big
as TAIL_HEIGHT, just to avoid possible relocation loops if the
popover doesn't fit in its original position. This must be
accounted for in size_allocate() as well.
2014-11-13 20:32:36 +01:00
Carlos Garnacho
e0353b37a8 scrolledwindow: Only render overshoot on the widget window
Without any check, it was being rendered also on the indicator
GdkWindows, which resulted on an over-exposed effect there.
2014-11-13 20:32:36 +01:00
Lapo Calamandrei
69c30fda5c Adwaita: reset some properties in the overshoot mixin
Otherwise we may inherit them see:
https://bugzilla.gnome.org/show_bug.cgi?id=740011
2014-11-13 18:47:42 +01:00
Lapo Calamandrei
360b516ef4 Adwaita: overshoot styling 2014-11-13 18:31:50 +01:00
Daniel Mustieles
8a5092d1d9 Updated Spanish translation 2014-11-13 13:57:46 +01:00
Daniel Mustieles
7887badaa1 Updated Spanish translation 2014-11-13 13:54:12 +01:00
Lapo Calamandrei
c9d0bd8a72 Adwaita: simplify scrollbar styling
By the use of slider margins. In the process darken the overlay
scrollbar trough in fine-tune mode to make it noticiable.
2014-11-13 11:26:40 +01:00
Matthias Clasen
85a539ce6d inspector: Add frame clock info
Add the frame clocks of toplevel widgets to the object tree,
and show their frame count and frame rate in the misc tab.
2014-11-12 22:52:59 -05:00
Marco Trevisan (Treviño)
c42146d88c mir: get/set window surface type 2014-11-13 04:42:48 +01:00
Marco Trevisan (Treviño)
c7e7e35083 mir: don't request more surface formats than the supported ones 2014-11-13 03:59:29 +01:00
Matthias Clasen
45528440e6 inspector: Show the refcount on the misc tab 2014-11-12 21:58:08 -05:00
Matthias Clasen
72b9d2861c inspector: Update misc-info while the tab is shown
Update the values on the page once per second, while the tab
is shown.
2014-11-12 21:45:16 -05:00
Marco Trevisan (Treviño)
4e4ccb76cd mir: implement screen get_plug_name 2014-11-13 02:26:38 +01:00
Marco Trevisan (Treviño)
a77571c42e mir: clear screen objects correctly 2014-11-13 02:19:29 +01:00
Marco Trevisan (Treviño)
0d024c2df8 mir: don't crash when querying infos for an invalid monitor 2014-11-13 02:07:46 +01:00
Marco Trevisan (Treviño)
c8826ba8c7 mir: clear screen data 2014-11-13 01:59:21 +01:00
Marco Trevisan (Treviño)
98a8c66970 mir: correctly get screen mm sizes 2014-11-13 01:47:56 +01:00
Marco Trevisan (Treviño)
c6de20496c mir: unset config change callback on finalize 2014-11-13 01:34:10 +01:00
Marco Trevisan (Treviño)
92c2e99dda mir: actually pass the GdkMirScreen to display config change cb 2014-11-13 01:30:10 +01:00
Matthias Clasen
e2ce0700a6 GtkCssProvider: Load themes from versioned directories
Look for themes in $prefix/themes/$name/gtk-$version/ (for
version = 3.16, 3.14, ...), before using the old location
$prefix/themes/$name/gtk-3.0/. This gives theme authors a
way to support multiple versions of GTK+ 3 with separate
css files.
2014-11-12 19:22:55 -05:00
Matthias Clasen
55fd3a762c GtkCssProvider: Factor out a function
Move finding the gtk.css file into its own function. We will
make this more complicated in the near future.
2014-11-12 18:20:35 -05:00
Matthias Clasen
6a618bf48c widget-factory: Add some margins to text views 2014-11-12 17:23:45 -05:00
Matthias Clasen
d50dd1d33c gtk3-demo: Use better text margins
We really want margins around the scrollable content, not around
the viewport. Make it so by using textview-specific properties.
This is unfortunately a little complicated for top/bottom.
2014-11-12 16:05:49 -05:00
Lapo Calamandrei
bac7408be4 Adwaita: set scale trough margins where they belong. 2014-11-12 17:30:59 +01:00
Lapo Calamandrei
5108a27e6c gtkrange: consider css margin on the slider
Css margin now works on the slider as they do on the trough.
The margin is not considered in the space allocation as it is for
the trough, so the slider width will be the set slider-width -
margins. Spefifying margins on the main widget in the css will
clearly affect both the trough and the slider, so theme changes are
needed.
2014-11-12 17:20:53 +01:00
Matthias Clasen
e14cf55b31 Forgotten files 2014-11-12 07:36:04 -05:00
Daniel Mustieles
00631af967 Updated Spanish translation 2014-11-12 13:31:27 +01:00
Daniel Mustieles
79ac0caa98 Updated Spanish translation 2014-11-12 13:27:56 +01:00
Debarshi Ray
3f4bed4d8f query, searchengine: Drop unused and undefined function declarations
https://bugzilla.gnome.org/show_bug.cgi?id=739977
2014-11-12 13:23:59 +01:00
Matthias Clasen
fc855eea7a GtkActionBar: Make ::position writable 2014-11-11 23:02:11 -05:00
Matthias Clasen
047bb15cd7 GtkActionBar: Rename center_box to box 2014-11-11 23:01:16 -05:00
Matthias Clasen
21e3d4f2f7 inspector: Turn off search where we don't have a search bar yet
Avoid the builtin treeview search popup everywhere.
2014-11-11 22:42:51 -05:00
Lapo Calamandrei
4aca13e39e Statusbar: add 'statusbar' style class 2014-11-11 17:23:04 +01:00
Lapo Calamandrei
95aa4769f6 Adwaita: add a missing comma... 2014-11-11 16:12:47 +01:00
Matthias Clasen
c8d9e5b564 GtkStack: Remove some clumsy use of GList API
No need for g_list_next(), and don't open-code g_list_index().
2014-11-10 18:45:58 -05:00
Matthias Clasen
8b95515c0c inspector: Only set debug-updates for the default display
Use the new private API to isolate the inspector itself from
this setting.
2014-11-10 15:24:08 -05:00
Matthias Clasen
d9b02ea4a3 gdk: Make debug-updates a per-display setting
Add private API to set this per-display, and make the existing
gdk_window_set_debug_update function set a global default.
2014-11-10 15:23:14 -05:00
Matthias Clasen
5c5c8bdd81 inspector: Add a rendering mode control 2014-11-10 15:07:52 -05:00
Matthias Clasen
5536d9bcde gdk: Add private API for rendering mode
This will be used to expose rendering mode in the inspector.
2014-11-10 14:39:57 -05:00
Matthias Clasen
8338b7e4cd Move rendering mode into GdkDisplay
This is in preparation for making it runtime-settable in the
inspector.
2014-11-10 14:28:43 -05:00
Javier Jardón
710f332082 configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
2014-11-10 15:12:17 +00:00
Emmanuele Bassi
36fedb0c4b window: GtkPlug is conditionally supported on X11 only
We cannot do a type check on it if we don't have the X11 backend
compiled in.

https://bugzilla.gnome.org/show_bug.cgi?id=739885
2014-11-10 15:08:44 +00:00
Alexander Larsson
90555e06be gdk_window_end_paint: Flush destination surface after paint
It seems in cairo 1.14 we need this after having painted an image surface
to a X11 window surface (i.e. with GDK_RENDERING=image).
2014-11-10 15:25:31 +01:00
Baurzhan Muftakhidinov
a353e77db4 Updated Kazakh translation 2014-11-10 02:23:15 +00:00
Matthias Clasen
8a8c6c0722 Inspector: hide the selector tab for non-widgets 2014-11-08 21:43:26 -05:00
Matthias Clasen
9a84d8a261 inspector: Hide the size-groups tab when empty 2014-11-08 21:30:12 -05:00
Matthias Clasen
0c20ba7dcb inspector: Hide the inspector tab when empty 2014-11-08 21:29:51 -05:00
Matthias Clasen
7dd466ad74 Set the clip on range widgets
This will allow better scrollbar theming.
2014-11-08 12:55:37 -05:00
Lapo Calamandrei
c0c777077a Adwaita: increase scrollbar slider contrast 2014-11-08 17:35:52 +01:00
Matthias Clasen
ae4aaf7354 inspector: Set statistics button sensitivity
After moving the button the header, it is now visible when
statistics are not available. Disable it in this case.
2014-11-08 09:57:48 -05:00
Matthias Clasen
592a0d46b4 inspector: Add more GL information
Add version and extension information to the general tab.
2014-11-08 02:16:35 -05:00
Emmanuele Bassi
cdcd3ca359 Hide GdkWindow libgtk_only API in the private vtable
These are the last two global GDK symbols that have a libgtk_only
suffix.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Emmanuele Bassi
585af218a3 Move GDK GL flags accessors to the private vtable
This allows us to use the GDK_PRIVATE_CALL macro inside gtk.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Emmanuele Bassi
eedbec2066 Make global GDK libgtk_only functions more private
The current way of exposing GDK API that should be considered internal
to GTK+ is to append a 'libgtk_only' suffix to the function name; this
is not really safe.

GLib has been using a slightly different approach: a private table of
function pointers, and a macro that allows accessing the desired symbol
inside that vtable.

We can copy the approach, and deprecate the 'libgtk_only' symbols in
lieu of outright removal.

https://bugzilla.gnome.org/show_bug.cgi?id=739781
2014-11-08 00:20:15 -05:00
Matthias Clasen
713d3834f6 inspector: Reserve space for buttons
Make the button area in the top left a stack that is parallel
to the main page stack. This avoids size changes as we switch
between pages.
2014-11-08 00:09:30 -05:00
Matthias Clasen
e2949e7bf7 extract-strings: Handle property binding attributes
These attributes are now used in at least one place in the
GtkInspector ui files.
2014-11-08 00:09:30 -05:00
Matthias Clasen
d0973fdb78 inspector: Improve search on the statistics page
Use a search bar here as well, instead of the builtin treeview popup.
2014-11-07 23:40:31 -05:00
Matthias Clasen
5f701cf4c9 inspector: Move the record button up
Give all the page space to the content.
2014-11-07 23:19:28 -05:00
Matthias Clasen
1ddace0a5f inspector: Shorten some labels 2014-11-07 22:57:14 -05:00
Matthias Clasen
818d2e238b inspector: Improve search in the resource tree
Make search in the resource tree work the same way as the new
search in the object tree.
2014-11-07 22:44:23 -05:00
Matthias Clasen
48415955f0 inspector: Correct a tooltip 2014-11-07 22:44:23 -05:00
Jasper St. Pierre
433120ae5e gdkwindow-x11: Fix indentation 2014-11-07 17:39:43 -08:00
Jasper St. Pierre
a91c88768e inspector: Remove unused variable 2014-11-07 16:33:43 -08:00
Matthias Clasen
ee01ee249f inspector: Look for themes in the right places
Match the places that GtkCssProvider looks in, so we show all
the themes that GTK+ would actually find.
2014-11-07 14:19:59 -05:00
Carlos Garnacho
af6eab850e wayland: Schedule a clock tick instead of wl_surface_commit()ting directly
Instead of possibly calling wl_surface_commit() out of
GdkFrameClock::after-paint, tick the transient parent clock so ::after-paint
can be eventually run.

This ensures that the subsurface coordinates (considered part of the state
of the parent) aren't committed untimely, and guaranteed to be orderly with
the wl_subsurface-relative state.

This is a gtk-side fix for https://bugzilla.gnome.org/show_bug.cgi?id=738887
2014-11-07 17:24:10 +01:00
Carlos Garnacho
964abf7423 wayland: Don't translate a NULL region into an empty one
cairo_region_copy(NULL) will effectively return an empty region, as this
function is always meant to return valid memory. This however inverts the
meaning of the NULL region and results in entirely non-clickable windows.
2014-11-07 17:23:54 +01:00
Carlos Garnacho
52a90758f9 gtkwindow: claim the press sequence when clicking on the titlebar
This event might not have an action yet, but certainly accounts, and
should be triggering recognition.

This fixes a crash when attempting to drag CSD windows through touch. As
since cfaec2d2f5, gtk_gesture_single_get_current_sequence() would
rightfully return NULL if the gesture didn't enter recognition, making
event lookup fail.
2014-11-07 13:54:10 +01:00
Carlos Garnacho
4df13b7262 treeview: remove single-click activation from GtkGestureMultiPress::pressed
This is already handled in GtkGestureMultiPress::release, and more in
concordance with how it was done pre-gestures.

https://bugzilla.gnome.org/show_bug.cgi?id=737891
2014-11-07 13:49:43 +01:00
Matthias Clasen
1e3e544bfd Revert "Add new API to docs"
This reverts commit 41e9eaf64f.
2014-11-07 07:12:22 -05:00
Matthias Clasen
5442293ce7 inspector: include private gdk headers
...the advantages of living in the same tree.
2014-11-07 07:11:38 -05:00
Matthias Clasen
7e405c286f Don't make the gl flags API
We need to export the symbols so they can be used in the
inspector, but we don't really want to make this supported
public API, so keep them out of installed headers.
2014-11-07 07:10:49 -05:00
Matthias Clasen
41e9eaf64f Add new API to docs 2014-11-06 23:37:00 -05:00
Matthias Clasen
0ecd08ed04 inspector: Add GL flags 2014-11-06 23:35:38 -05:00
Matthias Clasen
5d0d1e524e Export API to set GL flags
This will be used in the inspector.
2014-11-06 23:29:16 -05:00
Lapo Calamandrei
d859cf19f6 Adwaita: scrollbar styling overhaul
- finally added the missing border;
  - proper backdrop state styling;
  - tweaked overlay indicator;
  - sidebar special casing gone for now.
2014-11-07 00:03:29 +01:00
Jasper St. Pierre
22ad7b7782 gdkgl: Make some helper functions static 2014-11-06 13:48:20 -08:00
Ryan Lortie
ec729d0649 mir: rework cursors a bit
Store the cursor name on the cursor (rather than always using its type).

Use this when setting a cursor on a surface.

The mir server will fallback to using standard cursors from the cursor
theme if the name used is not one of those defined by mir, which is more
or less what we want to happen here in case of creating a cursor by
name.
2014-11-06 16:18:53 -05:00
William Hua
063f79b594 mir: enable csd 2014-11-06 16:18:53 -05:00
William Hua
2fdb266c0d mir: set cursor 2014-11-06 16:18:53 -05:00
Matthias Clasen
f60b2a11c5 Drop an unneeded include 2014-11-06 15:17:09 -05:00
Matthias Clasen
f229f96d69 GtkModelButton: protect against show_all
We don't want the labels to be shown when there's already
an icon.
2014-11-06 15:03:51 -05:00
Alexander Larsson
41bf293efd GdkWindow: Drop gl matrix setup which is not needed anymore. 2014-11-06 20:37:24 +01:00
Alexander Larsson
61eabc4778 gdk_gl_texture_from_surface: Enable scissor test 2014-11-06 20:37:10 +01:00
Alexander Larsson
56631d02bd gdk_gl_texture_quad: Fix handling of window scales 2014-11-06 19:33:58 +01:00
Lapo Calamandrei
c756cef80a Adwaita: remove last child border on backdrop column headers 2014-11-06 17:21:50 +01:00
Lapo Calamandrei
d781599b0d Adwaita: initial overlay indicator styling 2014-11-06 12:40:40 +01:00
Alexander Larsson
1f3f933edf GdkX11GLContext: Use bitblit for swap if no buffer age support
If buffer age is undefined and the updated area is not the whole
window then we use bit-blits instead of swap-buffers to end the
frame.

This allows us to not repaint the entire window unnecessarily if
buffer_age is not supported, like e.g. with DRI2.
2014-11-06 12:24:43 +01:00
Alexander Larsson
21189b9f7e Add gdk_gl_context_has_framebuffer_blit()
This checks if the context supports GL_EXT_framebuffer_blit
2014-11-06 12:24:43 +01:00
Alexander Larsson
5f9e6ec2dc GdkGL: Fix up GL_ARB_texture_rectangle support
This broke when gdk_gl_texture_quad moved to shaders. We need
a specialized shader for the rectangle case.
2014-11-06 12:24:43 +01:00
Alexander Larsson
650c9f3b7e Add support for GDK_GL=texture-rectangles
This allows us to test our support for GL_ARB_texture_rectangle
2014-11-06 12:24:43 +01:00
Alexander Larsson
90a5fa80af Add GDK_GL env var and GdkGLFlags
This moves the GDK_ALWAYS_USE_GL env var to GDK_GL=always.
It also changes GDK_DEBUG=nogl to GDK_GL=disable, as GDK_DEBUG
is really only about debug loggin.

It also adds some completely new flags:

 software-draw-gl:
   Always use software fallback for drawing gl content to a cairo_t.
   This disables the fastpaths that exist for drawing directly to
   a window and instead reads back the pixels into a cairo image
   surface.

 software-draw-surface:
   Always use software fallback for drawing cairo surfaces onto a
   gl-using window.  This disables e.g. texture-from-pixmap on X11.

 software-draw:
   Enables both the above.
2014-11-06 12:24:43 +01:00
Alexander Larsson
7fde5213b0 gdk_cairo_draw_from_gl: Remove useless call
The glFramebufferTexture2DEXT call makes no sense here, we're
not using the texture as a framebuffer, just as a normal
texture source.
2014-11-06 12:24:43 +01:00
Alexander Larsson
9372cbdbf8 GdkWindow: Try to use a Core 3.2 GL profile for the paint context
If this is supported we avoid a lot of legacy baggage which we don't
need.
2014-11-06 12:24:43 +01:00
Alexander Larsson
e417b18373 gdk_gl_texture_quad: Use shaders to texture things
This is the modern way OpenGL works, and using it will let us
switch to a core context for the paint context, and work on
OpenGL ES 2.0.
2014-11-06 12:24:43 +01:00
Alexander Larsson
c78e7e7f17 GdkGL: Rename "context" to "paint_context" to clarify things a bit 2014-11-06 12:24:43 +01:00
Alexander Larsson
aaa335b9e8 gdk_cairo_draw_from_gl: Document that this changes the current context 2014-11-06 12:24:43 +01:00
Alexander Larsson
8c6395d8a1 GdkGLContextX11: Use passed in context, not get_current() 2014-11-06 12:24:43 +01:00
Alexander Larsson
10a44e8f7a Add gdk_gl_texture_quad() helper
Right now this just centralizes the glBegin/glEnd code, but
this will be replaced with buffer objects later.
2014-11-06 12:24:43 +01:00
Alexander Larsson
3c34ca3405 gdkgl: Don't constantly re-create the tmp framebuffer 2014-11-06 12:24:43 +01:00
Dimitris Spingos
0ac24904bd Updated Greek translation 2014-11-06 13:49:23 +02:00
Matthias Clasen
5a01208f55 GtkHeaderBar: Queue a resize when pack-type is changed
Otherwise, buttons appear to stick to the wrong side in glade.
2014-11-06 01:05:51 -05:00
Robert Ancell
053b65a21a mir: Handle pointer up/down events without a button mask set (i.e. touch events)
The Mir backend was checking for button mask changes to generate the appropriate
GDK event. When Mir generates a touch event it has no button mask. In this case
we'll just generate a primary button event.
2014-11-06 11:15:52 +13:00
Lapo Calamandrei
fdc01f80af Adwaita: dim GtkPlacesSidebar icons color 2014-11-05 16:01:28 +01:00
Benjamin Otte
0e44722fd8 tests: Add deprecation guards
It's the last test still spewing these and I'm too lazy to do a proper
fix.
2014-11-05 13:06:32 +01:00
Matthias Clasen
dd7a851f69 widget-factory: Fill up page 2 properly
The collapsed expander leaves and odd empty corner, so expand
it initially.
2014-11-05 06:29:47 -05:00
Matthias Clasen
45c0461f9b widget-factory: Add another osd
This is modeled after the totem osd.
2014-11-05 06:13:39 -05:00
Alexander Larsson
dd721acb84 GdkGLContextX11: Only set swap interval when it changed 2014-11-05 12:02:18 +01:00
Alexander Larsson
e4bf60224b GdkGL: Fix and clean up gdk_cairo_draw_from_gl()
This was unnecessarily creating a framebuffer in the texture case,
and it was not properly setting up a framebuffer with the texture
as source in the software fallback w/ texture source case.
2014-11-05 09:54:05 +01:00
Robert Ancell
c41231cc0f mir: Don't assert on unknown Mir events.
If we get a Mir event we don't understand generate a warning instead of an assert.
2014-11-05 15:50:55 +13:00
Matthias Clasen
e2882e4845 GtkHeaderBar: Make the position child property writable
Glade asssumes that it is, and without this, rearranging children
in glade is very cumbersome.
2014-11-04 16:56:25 -05:00
Carlos Garnacho
d9a433daf7 gtkwindow: Resort to regular event bubbling by all means on non-toplevels
If the multipress gesture is not created (ie. not a toplevel GtkWindow),
also avoid possibly calling gtk_widget_event() on the events gotten here.
2014-11-04 19:03:27 +01:00
Carlos Garnacho
03a30e462e gtkwindow: Do not create the multipress gesture for plugs
GtkPlugs may "qualify" as toplevels, even though they're not meant to
be WM manipulated, so refuse to create the multipress gesture for these
too.
2014-11-04 19:03:18 +01:00
Yosef Or Boczko
5f26876acb Updated Hebrew properties translation 2014-11-04 19:23:13 +02:00
Yosef Or Boczko
2eb874a8b0 Updated Hebrew translation 2014-11-04 19:22:40 +02:00
Lapo Calamandrei
c160340e6c Adwaita: brighter dark variant header-bar bottom shade 2014-11-04 14:59:24 +01:00
Matthias Clasen
113e1d1dc0 Make window scale changes work again
Commit afd9709aff made us keep impl window
cairo surfaces around across changes of window scale. But the
window scale setter forgot to update the size and scale of the
surface. The effect of this was that toggling the window scale
from 1 to 2 in the inspector was not causing the window to draw
at twice the size, although the X window was made twice as big,
and input was scaled too. Fix this by updating the surface when
the window scale changes.
2014-11-03 22:35:11 -05:00
Matthias Clasen
824fa0314d Add some more builder tests 2014-11-03 19:07:18 -05:00
Alexander Larsson
ef9ac24e95 GtkGLArea: Correctly position/size input window on realize 2014-11-03 13:35:00 +01:00
Alexander Larsson
6fbc439fd7 GdkGLContext: Add display property
We need to use this in the code path where we make the context
non-current during destroy, because at that point the window
could be destroyed and gdk_window_get_display() would return
NULL.
2014-11-03 13:20:55 +01:00
Alexander Larsson
3656c21030 GtkGLArea: Don't dispose gl context on unrealize
This was done to ensure the context is not current, but this is
pretty broken for shared contexts. We now just make it non-current.
2014-11-03 13:19:40 +01:00
Alexander Larsson
9930e6dcaa GtkGLArea: Add create-context signal
This lets you hook into the GL context creation which is useful
if you want to share one GL context between GtkGLArea widgets.
2014-11-03 10:43:31 +01:00
Matthias Clasen
4aa0d16865 Only warn once if inhibit-related dbus calls fail
No need to spam about it.

https://bugzilla.gnome.org/show_bug.cgi?id=734140
2014-11-03 00:48:42 -05:00
Matthias Clasen
95e8ae6e75 GtkIconTheme: Improve an error message
Mention the name of the theme when an icon lookup fails.
https://bugzilla.gnome.org/show_bug.cgi?id=687963
2014-11-03 00:25:14 -05:00
Matthias Clasen
2aa3eea781 GtkFileChooser: Add a menuitem for 'sort directories first'
This has been requested repeatedly.
2014-11-03 00:02:13 -05:00
Alberts Muktupāvels
bdaef1f88d gtkmenu: fix unnecessary scroll buttons
Don't change menu height if menu is out of monitor only by shadow
width.

https://bugzilla.gnome.org/show_bug.cgi?id=738321
2014-11-02 22:11:03 -05:00
Lapo Calamandrei
264cab2b52 Adwaita: add borders to menus in a non composited env
https://bugzilla.gnome.org/show_bug.cgi?id=738800
2014-11-02 22:04:14 -05:00
Matthias Clasen
2873195644 GtkHeaderBar: Fix a corner-case in child properties
The child property setting must be prepared to deal with any
child property for any child, even if it doesn't make sense,
like the pack-type for the custom title. This is happening
in glade when undoing a change in the custom-title property.
2014-11-02 17:49:47 -05:00
Dimitris Spingos
cc22325612 Updated Greek translation 2014-11-02 10:52:52 +02:00
Matthias Clasen
120abd9a6e csd: Improve appearance inside glade
glade turns windows into non-toplevels, so we can easily recognize
that situation and avoid adding a humongous shadow area.
2014-11-01 14:49:02 -04:00
Matthias Clasen
1a3bdefb00 Fix an ordering issue in event destruction
gdk_event_get_display accesses event->any.window, so don't
free that window first thing.
2014-11-01 14:44:03 -04:00
Matthias Clasen
18a2a6a90e GtkVolumeButton: Fix annoying double formatting
We meant to specify 0.2, and it came out as 0.2000000001.
2014-11-01 13:21:00 -04:00
Matthias Clasen
d8cc9d9a51 glade: Add GtkColorEditor to private widgets 2014-11-01 13:20:59 -04:00
Matthias Clasen
ffa49723a2 glade: Drop a no-longer existing private widget
GtkScaleButtonScale fell by the wayside when the scale button
was ported to a popover.
2014-11-01 13:20:59 -04:00
Cosimo Cecchi
276a510b4b radiobutton: don't consider hidden buttons in the group for focus
When a GtkRadioButton has no focus, it will accept it when there is no
other active button in its group.
If the active button in the group is hidden, for example because the UI
desires not to have a default option pre-selected, currently the focus
will not be accepted, which is not desired behavior.

This commit changes the code to only consider visible buttons in the
group when checking whether another button is active.

https://bugzilla.gnome.org/show_bug.cgi?id=739474
2014-11-01 10:08:42 -07:00
Matthias Clasen
e6e511eb46 GtkListBox: Fix a bug in unselection
Ensure that gtk_list_box_get_selected_row returns NULL after
gtk_list_box_unselect_all. Add a testcase that detects this
problem.
2014-10-31 22:34:09 -04:00
Matthias Clasen
fcdec5ac41 icon-browser: Add search
Most of the code was already in place, just some loose ends
to fix up.
2014-10-31 22:28:17 -04:00
Matthias Clasen
3c997239e9 inspector: Search refinements
Show close buttons on all search bars.
2014-10-31 21:14:09 -04:00
Matthias Clasen
3f3725d97b inspector: Refine object tree search
Behave similar to traditional treeview search, and center
the row when moving between matches.
2014-10-31 21:13:18 -04:00
Matthias Clasen
992c5f0dd6 inspector: Add search to the object tree
This is also an attempt to figure out a better story for search
in treeviews.
2014-10-31 21:02:50 -04:00
Matthias Clasen
69a0b31d2d Trivial: sort file list alphabetically 2014-10-31 14:16:02 -04:00
Lapo Calamandrei
00f618ea1a Adwaita: special case .default-decoration
Titlebars which are just window handles can be smaller.
2014-10-31 16:53:23 +01:00
Lapo Calamandrei
5a5e74bbe2 Adwaita: simpler gtkcalendar style (once again) 2014-10-31 16:44:21 +01:00
Matthias Clasen
89e12495b6 inspector: Improve search in style property list
Use a search bar with a search entry instead of the builtin
treeview search popup.
2014-10-30 20:54:54 -04:00
Matthias Clasen
574c774e4e inspector: Improve search in property list
Use a search bar with a search entry instead of the builtin
treeview search popup.
2014-10-30 20:54:04 -04:00
Matthias Clasen
42e1fad138 inspector: Stop overeager activation
Stop using activate-on-single click for the property list -
it is a little annoying to have the popover come up when you
just click in the list to get the focus there.
2014-10-30 18:47:46 -04:00
Alexander Larsson
f66060c422 GdkGLArea: fix has_alpha changes at runtime
We need to completely reallocate the buffers if we switch
has_alpha, because we may switch from render buffers to
texture.
2014-10-30 21:04:29 +01:00
Alexander Larsson
37d0159a84 GtkGLArea: Add resize signal
This is very useful, as almost all GL code wants to recalculate
the cameras each time the window size changes.
2014-10-30 21:04:29 +01:00
Alexander Larsson
969b9c6552 GtkGLArea: Add profile property
This lets you force a core 3.2 context if you want
2014-10-30 21:04:29 +01:00
Alexander Larsson
b519b642bd GtkGLArea: Add INPUT_ONLY window so that we can get events 2014-10-30 21:04:29 +01:00
Alexander Larsson
5ea3a1028d GtkGLArea: Major reworking
This restructures the way buffers are allocated and bound in a way
that is more flexible.

Buffer operation happens in three phases:
create_buffer() - Creates the gl objects
allocate_buffers() - Allocates space for the buffers at a given size
attach_buffers() - Attaches the buffers to the framebuffer and makes
                   the framebuffer the default drawing target
And destroy via
delete_buffers()

We call all these the first draw, and after that we allocate buffers
each time the widget changes size until the buffers are deleted.
We delete the buffers at unrealize.

However, anyone that wants to manually control buffer allocation strategies
can manually call allocate/delete_buffers().

There are also some other changes:
* Support for stencil buffers.
* A manual render mode where ::draw doesn't render unless you manually
  invalidated the previous rendering.
2014-10-30 21:04:29 +01:00
Alexander Larsson
869f300f0a gdk_x11_display_make_gl_context_current: move some code
This moves the code related to the frame sync code into
the is_attached check, which means we don't have to ever
run this when making non-window-paint contexts current.

This is a minior speed thing, but the main advantage
is that it makes making a non-paint context current
threadsafe.
2014-10-30 21:04:29 +01:00
Lapo Calamandrei
7a73ec1bb2 Adwaita: darken a bit OSD background color
To not make it vanish on dark variant background color.
2014-10-30 18:42:31 +01:00
Matthias Clasen
bb41cfe9d9 Improve warning
Mention the file that we're failing to load. That makes it obvious
what is wrong.
2014-10-30 13:41:13 -04:00
Matthias Clasen
cacda8086e inspector: Add HighContrast to built-in themes list 2014-10-30 12:52:25 -04:00
Matthias Clasen
d8ba193e9a HighContrast: integrate in build machinery 2014-10-30 12:52:25 -04:00
Matthias Clasen
fce2565673 Drop gtk.gresource.xml
Theme resources are controlled from the (generated) .gresource.xml
file two stories up.
2014-10-30 12:52:25 -04:00
Matthias Clasen
76b3fee093 HighContrast: Add sass parsing script
Just a copy of what we have next door in Adwaita.
2014-10-30 12:52:25 -04:00
Matthias Clasen
16d79e8883 HighContrast: Drop settings.ini
The only setting in there is already the default behavior,
and the setting is deprecated and ignored anyway.
2014-10-30 12:52:25 -04:00
Lapo Calamandrei
efaabdad0a Adwaita: slightly contrasting popover background 2014-10-30 17:51:22 +01:00
Lapo Calamandrei
fdbb93d78c Adwaita: border radiusses rationalization 2014-10-30 17:51:22 +01:00
Piotr Drąg
75d37acb25 Updated POTFILES.in 2014-10-30 17:21:40 +01:00
Jakub Steiner
495f764b3d theme: move HC theme from gnome-themes-standard
- HC is part of the toolkit the same way as Adwaita is
- No automake foo included
2014-10-30 16:14:37 +01:00
Alexander Larsson
0eb2fb01fd Add GdkGLContext::profile 2014-10-30 12:43:03 +01:00
Alexander Larsson
398697eb2f Clarify docs for gdk_cairo_draw_from_gl 2014-10-30 12:43:03 +01:00
Alexander Larsson
f0ae8da993 Remove GdkGLContext::visual
This is not really needed. The gl context is totally tied to the
window it is created from by virtue of sharing the context with the
paint context of that window and that context always has the visual
of the window (which we already can get).

Also, all user visible contexts are essentially offscreen contexts, so
a visual doesn't make sense for them. They only use FBOs which have
whatever format that the users sets up.
2014-10-30 12:43:03 +01:00
Alexander Larsson
ad30262fef GtkGLArea: Always destroy context on unrealize
We had some code that tried to reuse the context over realize, but
that doesn't work as we need to share with the possibly new
paint context of the re-realized window.
2014-10-30 12:43:03 +01:00
Alexander Larsson
5f14630b76 GdkWindow: destroy paint gl context on destroy 2014-10-30 12:43:03 +01:00
Alexander Larsson
dbbab0791d GdkGLContext: Track shared context
This allows us to read it back, but primarily it ensures
the shared context wrapper stays alive as long as the context.
2014-10-30 12:43:03 +01:00
Alexander Larsson
fb50015519 GdkGLContext: Change the way we track the current context
To properly support multithreaded use we use a global GPrivate
to track the current context. Since we also don't need to track
the current context on the display we move gdk_display_destroy_gl_context
to GdkGLContext::discard.
2014-10-30 12:43:03 +01:00
Lapo Calamandrei
eb8f60f141 Adwaita: osd rationalization and tweakings
Removed bright translucent outer border for "top level" osd widgets,
insensitive osd entry styled, more meaningfull color variables and
some code rationalization.
2014-10-30 11:50:27 +01:00
Alexander Larsson
afd9709aff GdkWindowX11: Keep the impl window cairo surface around until destroy
We used to have a weak ref to the cairo surface and it was keep
alive by the references in the normal windows, but that reference
was removed by d48adf9cee, causing
us to constantly create and destroy the surface.

https://bugzilla.gnome.org/show_bug.cgi?id=738648
2014-10-30 10:32:47 +01:00
Matthias Clasen
47191ce173 Make the inspector window translucent instead of lowering
Make the inspector window click-through and see-through
when we can, instead of lowering it. This is useful, since
Wayland has no lowering.
2014-10-29 23:29:20 -04:00
Lapo Calamandrei
7a1eabaf62 Adwaita: fix for the previous colorswatch fix...
Make the selected colorswatch inhert on backdrop.
2014-10-29 19:55:32 +01:00
Lapo Calamandrei
43a2676c3f Adwaita: fix selected colorswatch white border 2014-10-29 19:50:58 +01:00
Lapo Calamandrei
bfd4933aa3 Adwaita: first round of OSD style converage
Some code refactoring, entry and spinbuttons and flat buttons
styled, more to come...
2014-10-29 18:40:28 +01:00
Carlos Garnacho
b0313c7bcf wayland: Emit GDK_OWNER_CHANGE events around wl_data_offer changes
This way the upper GtkClipboard code emits correctly ::owner-change when
receiving these events.
2014-10-29 18:33:48 +01:00
Alexander Larsson
c7451bbf3b GdkX11GLContext: Fix leak 2014-10-29 13:52:04 +01:00
Alexander Larsson
8c7623de84 Cache default gdk visuals in the GDK_VISUALS property on the root window
This means we don't have to try to initialize opengl in every gtk
instance that is stated. It will only happen for the first one.

https://bugzilla.gnome.org/show_bug.cgi?id=738670
2014-10-29 13:35:17 +01:00
Alexander Larsson
dae447728d X11: Pick better system and rgba visuals for GL
We want to create windows with the default visuals such that we then
have the right visual for GLX when we want to create the paint GL
context for the window.

For instance, (in bug 738670) the default rgba visual we picked for the
NVidia driver had an alpha size of 0 which gave us a BadMatch when later
trying to initialize a gl context on it with a alpha FBConfig.

Instead of just picking what the Xserver likes for the default, and just
picking the first rgba visual we now actually call into GLX to pick
an appropriate visual.
2014-10-29 13:35:17 +01:00
Matthias Clasen
8765970ba1 Remove a redundant call
No need to set shapes twice in a row.
2014-10-29 06:49:59 -04:00
Matthias Clasen
0b4c37624a GtkPopoverMenu: Add API to open a submenu
This allows alternative menu switching to be implemented, besides
the builtin GtkModelButton support.
2014-10-29 06:49:59 -04:00
Matthias Clasen
f83c903ed8 Add a scale to the popover menu example
Demonsttrate that this is flexible enough for the intended uses.
2014-10-29 06:49:59 -04:00
Matthias Clasen
6e001acbf9 Add documentation
Document GtkModelButton and GtkPopoverMenu.
2014-10-29 06:49:59 -04:00
Matthias Clasen
228e51b319 Adapt the testpopover example
Add the required boxes for each submenu. We now need to specify the
submenu name only once per submenu.
2014-10-29 06:49:59 -04:00
Matthias Clasen
55b7838b4f GtkPopoverMenu: Simplify
Change things so each submenu is a single child, and users are
required to create the box themselves.
2014-10-29 06:49:59 -04:00
Matthias Clasen
2b5a49c285 Adapt the testpopover example
Drop all all explicit role setting from the testpopover example.
2014-10-29 06:49:59 -04:00
Matthias Clasen
689363a782 GtkModelButton: Don't require an explicit role
When we have an action-name, we can deduce the role from the
action that is looked up by the action helper.
2014-10-29 06:49:59 -04:00
Matthias Clasen
2401a6cb8e Adapt the testpopover example 2014-10-29 06:49:59 -04:00
Matthias Clasen
14e394d3d7 GtkModelButton: Rename action-role to role
Rename action-role to role, and make all properties readable.
2014-10-29 06:49:59 -04:00
Matthias Clasen
e776c665b0 GtkModelButton: Drop unused :accel property 2014-10-29 06:49:59 -04:00
Matthias Clasen
1fee63d097 Adapt the testpopover example
Drop all uses of has-submenu.
2014-10-29 06:49:59 -04:00
Matthias Clasen
ef22be9bb7 Drop GtkModelButton:has-submenu
Replace the has-submenu property with checking menu-name != NULL.
2014-10-29 06:49:59 -04:00
Matthias Clasen
4da281d20b Adapt the testpopover example
We now use GtkPopoverMenu, and just add the model buttons
directly to it.
2014-10-29 06:49:58 -04:00
Matthias Clasen
e095918128 GtkModelButton: Add a menu-name property
Add a menu-name property and use it in a default implementation
of ::clicked to switch menus if we are inside a stack. This means
GtkModelButton is no longer entirely generic, but rather expects
to be used inside a GtkPopoverMenu. It still works in other contexts
too, of course.
2014-10-29 06:49:58 -04:00
Matthias Clasen
1f81c83fd8 Add GtkPopoverMenu
GtkPopoverMenu is a GtkPopover subclass that has a menu-like stack
built-in.
2014-10-29 06:49:58 -04:00
Matthias Clasen
a8cc4787d2 Add a manual popover menu example
Reproduce the testpopover popover manually, by packing model
buttons into a stack in a popover.
2014-10-29 06:49:58 -04:00
Matthias Clasen
83976c47f8 Make GtkModelButton a better GtkActionable
Rename the "toggled" property to "active", since that is what
GtkActionHelper expects to update for check and radio actions.
Also make the property readable, since GtkActionHelper wants
to read it.
2014-10-29 06:49:58 -04:00
Matthias Clasen
fd945be50b Make GtkModelButton public 2014-10-29 06:49:58 -04:00
Matthias Clasen
c9ad936011 Drop an unused variable 2014-10-29 06:49:58 -04:00
Alexander Larsson
d5cd05a0f4 GdkGLContextX11: Don't free NULL visual info 2014-10-29 11:26:00 +01:00
Matthias Clasen
778865f316 Fix toplevel input shape for csd windows
We need to maintain the application-set and the the csd
input shape separately, and intersect them to pass them
down.
2014-10-28 20:23:47 -04:00
Matthias Clasen
3f1dc87188 Plug another memory leak
Also found by valgrind.
2014-10-28 16:07:57 -04:00
Matthias Clasen
c8d4eefa71 Plug some memory leaks in GL support
valgrind pointed these out.
2014-10-28 16:07:57 -04:00
Alexander Larsson
0814cd9f8b GdkGlContextWayland: Don't require specific bit depths
This just means we may fail to get a gl context, we just require
*some* color depth.
2014-10-28 18:30:09 +01:00
Alexander Larsson
3406bbd128 Pick the first rgba visual, not the last
The visuals are typically sorted by some sort of "most useful first"
order. And picking the last one is likely to give us the weirdest
matching glx visual.
2014-10-28 18:30:09 +01:00
Alexander Larsson
8d6d6dcca3 GdkGLContextX11: Ensure we get the fbconfig with the exact same visual
We really want a gl context with exactly the same visual, or we will
get a badmatch later, which hits us on nvidia as per:

https://bugzilla.gnome.org/show_bug.cgi?id=738670
2014-10-28 18:30:09 +01:00
Matthias Clasen
b673490a1b Document Wayland opacity handling 2014-10-28 10:48:49 -04:00
Matthias Clasen
4cf6edda55 wayland: Make window opacity work
Under wayland, the compositor doesn't have a 'overall window alpha'
knob, we just need to add the alpha to the buffers we send.
Client-side alpha, if you want to call it that.

Implement this by reusing the existing alpha support for non-toplevel
widgets. As a side-effect of the implementation, windows with RGBA
visual under X will now also use per-pixel alpha, instead of
overall alpha.
2014-10-28 10:28:23 -04:00
Matthias Clasen
d58c750db5 Bump atk dep
Needed for ATK_STATE_HAS_TOOLTIP.
2014-10-28 08:08:49 -04:00
Matthias Clasen
850143b7a0 Inspector: Make picking work without a grab
Turns out Weston takes an X grab while delivering button events.
Thus, trying to take a grab in response to a button press is
futile.
2014-10-28 07:05:45 -04:00
Jasper St. Pierre
c40ba85ace wayland: Don't use the default display
Pass a display in so that multi-display technology works.
2014-10-27 22:29:41 -07:00
Jasper St. Pierre
bbe9ef20da gdkevents: Use the correct display to copy event data 2014-10-27 22:29:41 -07:00
Jasper St. Pierre
887b7356c3 gdkdisplay: Provide a default event_data_copy / event_data_free
Every single implementation but Quartz is a no-op for this, so just
provide it once rather than in every backend.
2014-10-27 22:13:23 -07:00
Matthias Clasen
e36b57e7f9 gtk-demo: Drop uses of gdk_cursor_new()
Use gdk_cursor_new_for_display() instead.
2014-10-28 00:56:46 -04:00
Matthias Clasen
abe7187cfb Add another multi-device invariant
The device and window passed to gdk_device_grab() must be
on the same display, or things are unlikely to work.
Document and assert this.
2014-10-28 00:54:39 -04:00
Matthias Clasen
86f66d26fe Drop an unused variable 2014-10-28 00:53:59 -04:00
Matthias Clasen
4c69dabb6e Don't return GDK_GRAB_SUCCESS on failure
That seems ... counterproductive.
2014-10-28 00:51:32 -04:00
Matthias Clasen
d1dcac85f3 Mention the 'same display' requirement in the docs too 2014-10-28 00:44:33 -04:00
Matthias Clasen
eedff39413 Deprecate gdk_cursor_new()
Too easy to introduce an unintended assumption about the display
being the default this way.
2014-10-28 00:38:59 -04:00
Matthias Clasen
8aecf2c06a GtkAboutDialog: Don't use gdk_cursor_new
gdk_cursor_new returns cursors for the default display, and
thus is not safe to use in code that may run on non-default
displays.
2014-10-28 00:36:17 -04:00
Jasper St. Pierre
5f980cd8de gtkwindow: Use gdk_cursor_new_for_display
Otherwise, this crashes the inspector, since it now uses multi-display
technology, and on Wayland, resources like the cursor are client-private.
2014-10-27 21:22:44 -07:00
Jasper St. Pierre
52e3b88382 gdkwindow: Specify some invariants for cursors
Cursors should not be on a different display than their window /
device, as that would break Wayland.
2014-10-27 21:22:31 -07:00
Matthias Clasen
168a49426e Update for 3.15.1 2014-10-27 20:03:51 -04:00
Matthias Clasen
60a11333af Update expected results of a11y tests
The new has-tooltip state is showing up in a number of places,
as expected.
2014-10-27 20:03:51 -04:00
Jasper St. Pierre
0f79cb3d11 x11: Scale the frame extents as well 2014-10-27 16:54:33 -07:00
Matthias Clasen
a680631345 gtk3-demo: Add a frame to the sidebar
With overlay scrollbars, there's no visible separation between
the sidebar and the content otherwise.
2014-10-27 17:15:31 -04:00
Alexander Larsson
f7b1ba0943 opengl: Use GL_TEXTURE_2D rather than GL_TEXTURE_RECTANGLE_ARB when possible
This is more standard, and most driver support non-power-of-2 TEXTURE_2D
these days. We fall back for ancient drivers.
2014-10-27 21:17:08 +01:00
Alexander Larsson
08d44648ea opengl: Use proper blend function for premultiplied alpha 2014-10-27 21:17:08 +01:00
Alexander Larsson
72a6459d73 gdkglcontext: Track whether to use GL_TEXTURE_2D or GL_TEXTURE_RECTANGL_ARB 2014-10-27 21:17:08 +01:00
Jasper St. Pierre
5f40f58c36 cairoblur: Fix the blur again once more
The differences between the mutter and GTK+ code are subtle, but it
turns out that _gtk_cairo_blur_compute_pixels actually returns the
shadow *spread*. Since we use a triple box blur, the constant was
multiplied by 1.5 to approximate three chained box blurs. Split this
out and use the correct value for the lobe width.
2014-10-27 10:20:43 -07:00
Jasper St. Pierre
ac9ac55555 cairoblur: Fix the blur code
We weren't passing in the right "d" value, which was causing the blur to
behave incorrectly, especially in the case of 1px blurs, which would
cause no blurs at all.

The blur should now match the web.
2014-10-27 10:10:32 -07:00
Alexander Larsson
3013997e23 Rename gdk_gl_context_flush_buffer to gdk_gl_context_end_frame
This makes a lot more sense.
2014-10-27 16:33:37 +01:00
Matthias Clasen
f1fe70e4ad Indentation fix 2014-10-27 07:19:50 -04:00
Sebastien Lafargue
17f9eed14e popover menus: Take iconic into account
We don't want separators in both side of an iconic section
and use a 10px margin to separate two iconic sections.

Separators are also updated in case of dynamic insertion
( often used with menu items for plugins )

https://bugzilla.gnome.org/show_bug.cgi?id=738650
2014-10-27 07:08:37 -04:00
Matthias Clasen
fc6f22c3ce Ignore gdk-pixbuf deprecations 2014-10-27 07:05:22 -04:00
Cosimo Cecchi
96a3b23736 testlevelbar: fix CSS to be aligned with documentation
https://bugzilla.gnome.org/show_bug.cgi?id=707695
2014-10-27 06:56:19 -04:00
Cosimo Cecchi
631e2f4c9b levelbar: don't use the current value style class for empty blocks
We want to be able to style the empty blocks independently of all the
offset styles, so remove the current style class when painting an empty
block.

https://bugzilla.gnome.org/show_bug.cgi?id=707695
2014-10-27 06:56:19 -04:00
Cosimo Cecchi
0555ef20a4 testlevelbar: don't segfault when quitting testlevelbar
Quit the mainloop when the window is closed.

https://bugzilla.gnome.org/show_bug.cgi?id=707695
2014-10-27 06:56:19 -04:00
Matthias Clasen
3a2bf9d878 quartz: Move the FullscreenSavedGeometry definition earlier
Move the FullscreenSavedGeometry before the first (conditional)
use, to fix the build on OS X 10.6.

https://bugzilla.gnome.org/show_bug.cgi?id=737561
2014-10-27 06:49:46 -04:00
Marcus Karlsson
a703437796 quartz: fix build on 10.6 and below
It is not possible to successfully build GTK+ on OS X 10.6 and below
since NSFullScreenWindowMask is only available starting with 10.7. Add
ifdef guards around setStyleMask: in order to allow it to build on
earlier OS X releases.

https://bugzilla.gnome.org/show_bug.cgi?id=737561
2014-10-27 06:46:12 -04:00
Christophe Fergeau
506d59f526 Return correct font from gtk_font_chooser_widget_find_font
Commit 30a1c4ab fixed several memleaks including one in
gtk_font_chooser_widget_find_font.

However, the fix causes one extra call to gtk_tree_model_iter_next()
after finding the font we look for (ie pango_font_description_equal
returns TRUE): the 'increment' part of the for loop
(gtk_tree_model_iter_next) is run before the 'exit condition' of the for
loop is evaluated.

This commit reverts this part of commit 30a1c4ab and adds an extra
call to pango_font_description_free in order to fix the leak.

https://bugzilla.gnome.org/show_bug.cgi?id=739111
2014-10-26 21:53:33 -04:00
Christophe Fergeau
77487fef2f fontchooserwidget: Don't invalidate priv->font_iter in load_fonts
When using GtkFontChooserButton, the same GtkFontChooserWidget can be
hidden and shown multiple times. When doing that, the font that was
chosen the previous time should be the selected one in the
GtkFontChooserWidget, however this does not work as expected and a
somehow 'random' font gets selected (or none) instead.

Every time the font chooser widget is shown, its style will be updated,
causing gtk_font_chooser_widget_style_updated and then
gtk_font_chooser_widget_load_fonts to be called.

gtk_font_chooser_widget_load_fonts starts by clearing the GtkListStore
listing the available fonts, repopulates it, and then makes sure the
current font is selected.

However, this does not work as expected, as during the call to
gtk_list_store_clear, the cursor_changed_cb will be invoked multiple
times when the GtkTreeView cursor gets moved when the line where the
cursor currently is gets removed. This will cause the 'current font'
state (priv->font_desc) to be unexpectedly modified, and when
gtk_font_chooser_widget_load_fonts tries to reposition the cursor to the
'current font', we won't get the expect result.

This commit avoids that by making sure cursor_changed_cb does not get
called when we call gtk_list_store_clear in
gtk_font_chooser_widget_load_fonts.

https://bugzilla.gnome.org/show_bug.cgi?id=739111
2014-10-26 21:53:33 -04:00
Matthias Clasen
e75310a445 Fix an out-of-bounds access in MyEnhancedXkbTranslateKeyCode
Commits 314b6abbe8 and eb9223c008 were ignoring
the fact that the code where found is set to 1 was modifying
col - which was an ok thing to do when that part of the code
was still breaking out of the loop, but it is no longer doing
that (since 2003 !). Fix things up by storing the final col
value in a separate variable and using that after the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=738886
2014-10-26 21:48:59 -04:00
Matthias Clasen
f7813deb26 Test h/vhomogenenous in teststack
Add separate checkboxes for hhomogeneous and vhomogeneous.
2014-10-26 15:07:26 -04:00
Matthias Clasen
e41a8cf6fc Use GtkStack:vhomogeneous for popover menus
This allows us to get rid of a size group.
2014-10-26 15:03:58 -04:00
Matthias Clasen
b86356bc1c GtkStack: split homogeneous
Split homogeneous into separate hhomogeneous and vhomogeneous
properties. vhomogeneous is what we want for popover menus.
2014-10-26 14:59:21 -04:00
Timm Bäder
4d075cf202 popover: Use the right area for drawing the background
The border shouldn't be subtracted.
2014-10-26 15:21:06 +01:00
Matthias Clasen
8b6457732f GtkBox: Fix self-assignment for center widget
This is happening when glade is loading ui files containing
center widgets.
2014-10-25 20:30:08 -04:00
Marek Černocký
1376c6b1b7 Updated Czech translation 2014-10-26 00:35:56 +02:00
Marek Černocký
eec161ab3f Updated Czech translation 2014-10-26 00:35:50 +02:00
Matthias Clasen
041ccd7f87 GtkPlacesSidebar: Don't crash on dnd
gtk_get_current_event() can return NULL. Don't crash if it does.

https://bugzilla.gnome.org/show_bug.cgi?id=739150
2014-10-25 16:00:00 -04:00
Matthias Clasen
e35d91d18f Revert "Inspector backend hack"
This reverts commit f88a5dc8c7.

Didn't mean to push this.
2014-10-25 13:58:36 -04:00
Matthias Clasen
9ca9fccace GtkSpinButton: Set the screen on the panel contexts
Failure to do so results in custom styling leaking through in
the inspector. This is pretty obvious, now that the inspector
is using a separate display connection and is generally isolated
from style changes.
2014-10-25 13:31:57 -04:00
Matthias Clasen
f88a5dc8c7 Inspector backend hack 2014-10-25 10:33:22 -04:00
Matthias Clasen
f733fa88f5 Broadway: Remove display assumptions
In various places, the broadway backend was just using
the default display and assumed that it is the broadway
display. That may not be the case in a multi-backend world,
so instead iterate over all displays and use the first
broadway display - still not perfect, but enough to survive
for now.
2014-10-25 10:32:53 -04:00
Matthias Clasen
23641e3103 inspector: Plug a memory leak 2014-10-25 10:00:57 -04:00
Matthias Clasen
bd031b89c1 inspector: Add style classes to the object list
We have a lot of space here now, so show some
useful information.
2014-10-25 10:00:39 -04:00
Matthias Clasen
182dd3c1ea Fix a mixup in popover realization
When the window is on a non-default screen, popover_realize
ended up passing a visual and a parent_window from different
screens into gdk_window_new, which doesn't work. Fix it by
using the visual of the parent window.
2014-10-24 23:36:35 -04:00
Matthias Clasen
a46d4e51f7 inspector: Improve details buttons
Ensure that the details buttons are only sensitive when
we actually have details to show.
2014-10-24 21:52:23 -04:00
Matthias Clasen
70c3241bd3 inspector: Improve tab switching
Switch the object and resource trees away from activate-on-single-click
and add a 'view details' button.
2014-10-24 21:14:16 -04:00
Matthias Clasen
32326f826f X11: Don't assume all displays are X11 displays
When iterating over the list of displays gotten from the
display manager, we have to check if what we got is actually
an X11 display.
2014-10-24 19:05:09 -04:00
Matthias Clasen
4590501854 Properly update the style cascade on screen change
GtkStyleContext was not properly handling the style cascade when
setting a screen, causing the inspector global CSS to affect the
inspector window, even though the inspector is using a different
screen now.
2014-10-24 16:23:07 -04:00
Matthias Clasen
385e6beafe Fix the build
Some forgotten include path adjustments.
2014-10-24 16:12:33 -04:00
Matthias Clasen
c16fa45bfe inspector: Use a separate display connection
This helps isolate the inspector from some of the changes that
it can trigger. To specify a different display, set
GTK_INSPECTOR_DISPLAY to the name of the display to use for
the inspector window. If no display is specified, GTK+ will
use a separate connection to the default display.
2014-10-24 15:57:33 -04:00
Matthias Clasen
fea13fcfc1 Fix a problem with screen changes and csd
When a new screen is set on a window, we unrealize it, to
recreate all the resources. But we don't reset the client_decorated
flag, so realize() doesn't call create_decoration() - which makes
sense, since the decoration already exists. But the side-effect
of create_decoration() is to select the rgba visual, and visuals
are per-screen.

Fix this by looking for the rgba visual in set_screen(), and
replacing it with the rgba visual for the new screen, if necessary.
2014-10-24 15:57:33 -04:00
Benjamin Otte
2002613012 styleproperties: Move into deprecated directory 2014-10-24 21:31:40 +02:00
Benjamin Otte
a51378dda8 styleproperties: Deprecate 2014-10-24 21:31:40 +02:00
Benjamin Otte
433c20e59d styleproperties: Remove header where it's not used 2014-10-24 21:31:40 +02:00
Benjamin Otte
e2a0780543 styleproperties: Remove unused function 2014-10-24 21:31:40 +02:00
Benjamin Otte
a1f7c459b7 css: Disallow bypassing value computation
This special code was added back in the days when computation wasn't
idemptotent. These days it is.

Also, the bypass code path is only used in fallback code that is pretty
much unused.
2014-10-24 21:31:40 +02:00
Benjamin Otte
ec8a29b0c2 css: Remove unneeded header 2014-10-24 21:31:39 +02:00
Daniel Mustieles
40c129f906 Updated Spanish translation 2014-10-24 19:18:54 +02:00
Matthias Clasen
f32ec2e4be widget-factory: Add mnemonics in the prefs dialog
This helps testing the mmemonic label display in the inspector,
and is just good practice.
2014-10-24 08:34:13 -04:00
Matthias Clasen
1aa3000ae6 Inspector: Show more misc info about widgets
This adds clip area, accessible role, mapped, realize,
is-toplevel, child-visible, mnemonic labels and tick
callbacks to the displayed information.
2014-10-24 08:34:13 -04:00
Matthias Clasen
a55000613a Add private API to query tick callbacks
This information can be useful for debugging purposes.
2014-10-24 08:34:13 -04:00
Lapo Calamandrei
21536775d7 widget-factory: set show-border to false on page 3 notebooks 2014-10-24 13:08:06 +02:00
Lapo Calamandrei
1c3475d58a Revert "Adwaita: axes borders of notebooks inside frame"
This reverts commit 01e6811776.
This assumption doesn't work latelly
2014-10-24 13:01:41 +02:00
Мирослав Николић
6ae1dc73c7 Updated Serbian translation 2014-10-24 10:38:56 +02:00
Chun-wei Fan
579c56ffd7 Visual Studio Builds: Update "Installation"
Add the newly-added public headers for GDK and GTK into the list of files
to "install".
2014-10-24 15:59:18 +08:00
Chun-wei Fan
8b1648fe5b Visual Studio Builds: Update the gtk3-demo Projects
The gtkglarea and sidebar demos have been added, so build them in the
projects.  Note that the gtkglarea code is not usable under Windows at this
point as implementation is needed for the GDK-Win32 backend.
2014-10-24 15:58:20 +08:00
Chun-wei Fan
aa47269273 Visual Studio Builds: Link to libepoxy
Patches have been submitted to the libepoxy project so that it can be built
under Visual Studio.  This will allow the GDK, GTK and gtk3-demo projects
to build, but the gtkglarea code is not usable at this time as
implementation needs to be added to the GDK-Win32 backend for it.
2014-10-24 15:56:46 +08:00
Chun-wei Fan
a8c79c2da1 Fix Up Visual Studio Property Sheets
"Install" gdkbroadwaydisplay.h, as it is a public header of GDK Broadway,
also fix the MSVC 2010+ gtk-copy-gdk-broadway.props property sheet as a
'>' is missing.  Sorry for not noting these issues earlier, as MSVC
Broadway builds were recently restored.  My bad :|
2014-10-24 12:53:51 +08:00
Chun-wei Fan
1c099ec784 gtk/deprecated/gtkstatusicon.c: Fix Build on C89 Compilers
Declare variable at the top of the block, which is needed from the change
in commit 1bad7865.
2014-10-24 12:23:31 +08:00
Emmanuele Bassi
183257f9e1 docs: Add replacement example for ImageMenuItem
Otherwise we will be doomed to answer the question of how to replace
GtkImageMenuItem for all eternity.
2014-10-23 17:42:19 +01:00
Rico Tzschichholz
0144861dca gdkglcontext-x11: Use epoxy/glx.h rather then GL/glx.h 2014-10-23 14:29:45 +02:00
Rico Tzschichholz
86ff51b842 configure: wayland-egl drop version since it is part of mesa not wayland 2014-10-23 14:29:45 +02:00
Gábor Kelemen
98452efea2 Updated Hungarian translation 2014-10-23 10:50:50 +00:00
Brion Vibber
1bad7865d3 Fix to gtkstatusicon.c to allow building both X11 and Quartz backends
https://bugzilla.gnome.org/show_bug.cgi?id=739005
2014-10-22 22:56:51 -04:00
Joanmarie Diggs
2893a71a3e Implement support for ATK_STATE_HAS_TOOLTIP
https://bugzilla.gnome.org/show_bug.cgi?id=738982
2014-10-22 22:55:13 -04:00
Matthias Clasen
318c97c959 Fix mispositioned window menu in hi-dpi
We always want to send the position in device pixels,
so apply the window scale before sending them out.

https://bugzilla.gnome.org/show_bug.cgi?id=738955
2014-10-22 22:49:31 -04:00
Chun-wei Fan
35486e7990 gdk/broadway/toarray.pl: Fix Code Generation for MSVC
The current implementation of this script generate headers with \x-escaped
strings that can become too long (> 65535 characters) for Visual Studio
to consume, hence the build of broadwayd would break on Visual Studio.

This changes the script to instead format the string as an array of hex
characters, not unlike what GResource does, so that builds can continue as
normal on Visual Studio builds as well.

https://bugzilla.gnome.org/show_bug.cgi?id=739001
2014-10-23 09:12:22 +08:00
Emmanuele Bassi
7b6a6c9421 tests/gtk: Add GdkX11GLContext to the whitelist
We cannot create them directly anyway.
2014-10-22 21:20:52 +01:00
Emmanuele Bassi
9464415121 tests/a11y/about: Fix expected text
We recently changed the uppercase licensing text to lower case. The
reference test that checks the contents of the about dialog has to be
fixed to reflect that change.
2014-10-22 21:17:37 +01:00
Robert Ancell
0f26b26f1d Gdk: add an experimental backend for mir
This is disabled by default.  Enable with --enable-mir-backend.

This backend is a combined work of Robert Ancell and Ryan Lortie.
2014-10-22 11:17:15 -05:00
Chun-wei Fan
4e66cca58d Visual Studio Builds: Fix broadwayd Build
There is now a broadway-buffer.c source that needs to be built for this, so
add it into the projects.  Since crypt() is no longer used, don't include
crypt.c in the builds, and so clean up the projects a bit.
2014-10-22 19:40:48 +08:00
Matthias Clasen
911f3fb6d2 Drop a reference to gtkthemingengineprivate.h
That file does not exist.
2014-10-22 01:18:54 -04:00
Matthias Clasen
15845b53cd 3.15.0 2014-10-22 01:13:00 -04:00
Matthias Clasen
5ee7445048 Add GtkSidebar to the widget gallery 2014-10-22 01:13:00 -04:00
Matthias Clasen
247f2c9192 Add GtkGLArea to the widget gallery 2014-10-22 01:13:00 -04:00
Matthias Clasen
fc13ff501d GtkSidebar: Make docs show up 2014-10-22 01:13:00 -04:00
Matthias Clasen
e14c0bb394 Document gtk_sidebar_get_stack 2014-10-22 01:12:59 -04:00
Matthias Clasen
33851dbe24 Document gtk_printer_option_set_get_groups 2014-10-22 01:12:59 -04:00
Matthias Clasen
10f3d330be Fix docs for gtk_settings_set_property_value 2014-10-22 00:32:38 -04:00
Matthias Clasen
f73db86a63 Fix docs for gtk_css_provider_load_from_resource 2014-10-22 00:32:38 -04:00
Matthias Clasen
9fb44a3c67 Add all sidebar API to the docs 2014-10-22 00:32:38 -04:00
Matthias Clasen
3b3a623520 Add new papersize api to the docs 2014-10-22 00:32:32 -04:00
Matthias Clasen
cc31235d2e Add a 3.16 index
We have new GDK api already.
2014-10-21 23:56:36 -04:00
Matthias Clasen
0f309c9dcf Skip GdkX11GLContext in some object tests
Since it can't be constructed without specifying a GdkWindow,
which we don't have here.
2014-10-21 23:48:12 -04:00
Matthias Clasen
6440263ef3 GL: Follow naming conventions
All the GDK type defines are GDK_TYPE_..., so follow this
pattern for the GLContext subclasses as well.
2014-10-21 23:48:12 -04:00
Benjamin Otte
7d96770453 cssnodedeclaration: Fix src/dest swap in memmove()
The main cause here were the wrong style classes being removed, such as
"message-dialog" instead of "csd" for GtkMessageDialog.
2014-10-22 03:39:17 +02:00
Lapo Calamandrei
cf5f6759f0 Adwaita: use -gtk-icon-source: none on paned...
...to get rid of the handle decoration istead of setting a transparent
background and abuse a background image for the background color.
2014-10-21 20:35:50 +02:00
Benjamin Otte
c2864a81a4 modelbutton: Fix up for style context changes
- Don't do work anymore that's done in GtkButton
- Don't do a save/restore just to set the state, instead set the state
  in the right places.
2014-10-21 20:31:05 +02:00
Benjamin Otte
727bdd1929 inspector: Add missing directory when scanning for themes 2014-10-21 20:31:05 +02:00
Lapo Calamandrei
298974b9da Adwaita: colorswatch on selected elements style fix 2014-10-21 16:34:42 +02:00
Lapo Calamandrei
01e6811776 Adwaita: axes borders of notebooks inside frame
This is what the old adwaita did, not having a better solution for
removing double borders, better to have this back even if it can
be problematic in certain cases.
2014-10-21 15:37:39 +02:00
Lapo Calamandrei
51bfa10eed Adwaita: properly fix places sidebar
Forgot to treat treeview background... Some code refactoring in
the process.
2014-10-21 15:37:39 +02:00
Andika Triwidada
d58317728e Updated Indonesian translation 2014-10-21 12:46:13 +00:00
Ryan Lortie
6d7f5d4431 wayland: don't init if XDG_RUNTIME_DIR missing
wayland doesn't strictly follow the XDG_RUNTIME_DIR spec by falling back
to another directory in case the runtime dir is not properly set.

When this variable is unset, wayland will log an error to us, which we
treat as fatal, aborting the entire program.

Skip ourselves all the trouble and don't try to bring up the wayland
backend when we know it will fail in this way.

https://bugzilla.gnome.org/show_bug.cgi?id=738873
2014-10-21 08:12:12 -04:00
Adel Gadllah
45288ec40c gdkglcontext-x11: Fix pixmap creation
Always use NPOT textures

https://bugzilla.gnome.org/show_bug.cgi?id=738670
2014-10-21 13:58:28 +02:00
Alexander Larsson
82753bc72b x11 glcontext: Always use RGBA texture format, as we use alphas 2014-10-21 13:51:24 +02:00
Lapo Calamandrei
01b4720ec8 Adwaita: wide paned separator style
...paned separator decoration fixed in the process.
2014-10-21 13:25:17 +02:00
Bastien Nocera
4af0379aae wayland: Don't try to create a subsurface again
We already did that inside gdk_wayland_window_create_surface() that's
called 2 lines above.

https://bugzilla.gnome.org/show_bug.cgi?id=738912
2014-10-21 12:18:01 +02:00
Bastien Nocera
d0f4e73999 gtkwidget: Fix typo in comment 2014-10-21 10:10:50 +02:00
Benjamin Otte
8abc6e06b2 css: Add "-gtk-icon-source: builtin"
... and make it the default. This takes over the meaning from "none" for
this property in that it draws the fallback builtin image.
"none" now literally means no image will be drawn.
2014-10-21 05:53:19 +02:00
Benjamin Otte
7eb3b6c71f stylecontext: fix icon-source extents computation
for the builtin image or invalid matrix case. We used to return invalid
memory in those cases. And that was not good.
2014-10-21 05:53:19 +02:00
Benjamin Otte
57d24f173a render: We use CHECKED now, not ACTIVE
Update docs and custom rendering of checkmarks and radio buttons
2014-10-21 05:53:19 +02:00
Matthias Clasen
4ed98878c6 GtkScrolledWindow: Add documentation
Document the new overlay scrolling APIs, and add some more
documentation for the other touch support: kinetic scrolling
and overshoot.
2014-10-20 23:07:45 -04:00
Matthias Clasen
5ec56d2e6e Port the overlayscroll example
Make the overlayscroll example use the overlay scrolling that is
now built into GtkScrolledWindow, instead of the manual prototype.
2014-10-20 23:07:45 -04:00
Matthias Clasen
47ce01116b Add some overlay scrollbar theming to Adwaita 2014-10-20 23:07:45 -04:00
Matthias Clasen
4455266c5b GtkScrolledWindow: Add overlay scrollbars
This commit adds a mode to GtkScrolledWindow in which it puts
narrow, auto-hiding scrollbars over the content, instead of
allocating room for the scrollbars outside of the content. We
use traditional scrollbars if we find a mouse or if overlay
scrolling has explicitly turned off.

For test purposes, GTK_TEST_TOUCHSCREEN can be used to get
overlay scrolling even in the presence of a mouse. The
environment variable GTK_OVERLAY_SCROLLING can also be used
to force overlay scrolling on or off.
2014-10-20 23:07:45 -04:00
Matthias Clasen
05ab0f2227 Add an experiment for overlay scrollbars
This is just meant as a prototype for how we can show a
scroll position indicator for touch. This uses GTK_POLICY_EXTERNAL
to hide the scrolled windows scrollbar while still allowing
scrolling.
2014-10-20 23:07:45 -04:00
Matthias Clasen
1fad6b049b GtkRange: Add a style class during dragging
This will be used to identify a scrollbar is being dragged - we
don't actually need the style class; another way to keep track
of the dragging status would be ok too.
2014-10-20 23:07:45 -04:00
Benjamin Otte
a3995d8c86 stylecontext: Handle querying the wrong state better
When a getter function (like get_color()) is called and the passed in
state doesn't match the current state returned via get_state(), we used
to do a trick: We called save()/set_state() on the context before
getting the values.

Unfortunately, since 3a337156d1 this
has the unfortunate side effect that it also creates a child element.
This breaks various old codebases (spinbutton has been fixed in
998feeb2bc, Webkit is fixed in
https://bugs.webkit.org/show_bug.cgi?id=137803 ) unfortunately.

So instead, look up the values manually ensuring that no child element
is created but the correct state is used.
2014-10-21 03:03:28 +02:00
Benjamin Otte
caf709bb81 stylecontext: Return a ref in lookup_values_for_state
This will be necessary when we stop caching values for lookups with the
"wrong" state.
2014-10-21 03:03:28 +02:00
Benjamin Otte
cc2f2dd9b8 computedvalues: Add to_string() and print() functions
The functions are unused. But they are very convenient to use from a
debugger, if you know what I mean...
2014-10-21 03:03:28 +02:00
Benjamin Otte
4cc4e18d56 stylecontext: Don't copy CSS values on context_save()
Keeping them is a bad idea now where the widget paths are actually
changed by a save(). And almost all of the time, state or style classes
will be changed anyway.

Looking them up again is just a hash table lookup anyway.
2014-10-21 03:03:28 +02:00
Benjamin Otte
57cafc277b stylecontext: Use node declaration in hash
Don't use the StyleInfo anymore.
2014-10-21 03:03:28 +02:00
Benjamin Otte
5c2c659122 stylecontext: Split out functionality into custom object
GtkCssNodeDeclaration is a new struct with copy-on-write semantics.

It encapsulated the properties used to define a node in the CSS tree.

The idea is to use it in various places for caching, in particular as
key in hash tables.
2014-10-21 03:03:28 +02:00
Matthias Clasen
4cbc0191cb widget-factory: Example for edge-overshot
For extra fun, make some noise.
2014-10-20 20:54:31 -04:00
Matthias Clasen
7b28b1c9ba widget-factory: Add a wide-handle example 2014-10-20 18:48:37 -04:00
Andika Triwidada
aebb38fad8 Updated Indonesian translation 2014-10-20 18:44:26 +00:00
Carlos Garnacho
ca9d15df92 scrolledwindow: Add ::edge-overshot signal
This signal is emitted whenever user scrolling hits the overshoot
edge in the given direction. May be useful to add "reload" or "load
more" behaviors in apps.

https://bugzilla.gnome.org/show_bug.cgi?id=738534
2014-10-20 18:52:43 +02:00
Lapo Calamandrei
c84f544fc3 Adwaita: GtkPlacesSidebar treeview text color fix
With my latest changes we have a darker text color for views and
entries (which I assume are content), the places sidebar is totally
chrome though so it needs the chrome text color back.
2014-10-20 15:25:30 +02:00
Daniel Mustieles
84776a95f7 Updated Spanish translation 2014-10-20 15:08:33 +02:00
Daniel Mustieles
173a3a9eb8 Updated Spanish translation 2014-10-20 15:01:35 +02:00
Matthias Clasen
cf0c9eb158 GtkPaned: Add a "wide-handle" property
This can be used by applications to indicate that a paned is expected
to be actively used by the users for configuring the UI, and needs
a prominent handle.

https://bugzilla.gnome.org/show_bug.cgi?id=738860
2014-10-20 08:50:53 -04:00
Matthias Clasen
23f6ff3cec Add GtkGLArea fully to docs
It was missing from the type list.
2014-10-19 23:30:49 -04:00
Matthias Clasen
d7b64c63e0 Improve tooltip-text/markup docs
Clarify priorities between the two,
https://bugzilla.gnome.org/show_bug.cgi?id=681185
2014-10-19 23:28:34 -04:00
Matthias Clasen
a8f4269157 GtkAboutDialog: Don't shout
Don't use all-caps in the UI - it looks scary.

https://bugzilla.gnome.org/show_bug.cgi?id=671138
2014-10-19 23:16:06 -04:00
Matthias Clasen
e3ef5d6fd2 GtkTooltip: Move nonexported API to a private header
This is our standard practice nowadays.
2014-10-19 22:51:21 -04:00
Matthias Clasen
3f5d462305 GtkToggleButton: Move nonexported API to a private header
This is our standard practice nowadays.
2014-10-19 22:42:49 -04:00
Matthias Clasen
ce915dc6f0 Deprecate gtk_settings_install_property APIs
These are not useful outside GTK+.
2014-10-19 22:33:24 -04:00
Matthias Clasen
8889565735 GtkSpinButton: Simplify code
No need to explicitly specify a parser function, it will be
correctly guessed from the property type.
2014-10-19 22:07:19 -04:00
Matthias Clasen
f5d9644591 GtkMenuItem: Simplify code
No need to explicitly specify a parser function, it will be
correctly guessed from the property type.
2014-10-19 22:06:37 -04:00
Matthias Clasen
4f5db65a06 Deprecate some GtkSettings api
The gtk_settings_set_...property functions don't really add
anything over g_object_set(), and we never documented them.
2014-10-19 21:22:02 -04:00
Matthias Clasen
c8a6b8786a Clarify GtkSettings documentation
Just recommend g_object_set to override settings. The
gtk_settings_set_..._property functions don't really add
any value.
2014-10-19 20:47:05 -04:00
Matthias Clasen
0b0c6a6477 testfilechooser: Test the preview again
There is code in there to show a preview, use it.
2014-10-19 20:03:58 -04:00
Matthias Clasen
d3aa9df876 Forgotten file 2014-10-19 20:03:42 -04:00
Matthias Clasen
f678e48a08 GtkFileChooser: Make preview update more understandable
Implement Federico's suggestion:
In single-selection mode, just use the selected row,
In multi-selection mode, use the cursor row as long as it is
in the selection.

https://bugzilla.gnome.org/show_bug.cgi?id=154709
2014-10-19 17:54:28 -04:00
Matthias Clasen
38b315d0be Add a a drop-in test for the GtkBuilder parser 2014-10-18 22:18:59 -04:00
Piotr Drąg
74ba42a026 Updated Polish translation 2014-10-18 23:45:55 +02:00
Thomas Lange
a6ae8f6d96 aboutdialog: Mark strings as translatable
https://bugzilla.gnome.org/show_bug.cgi?id=730893
2014-10-18 22:56:28 +02:00
Sébastien Wilmet
55dddbc54a docs: add missing symbol in GtkTextView 2014-10-18 19:28:40 +02:00
Sébastien Wilmet
2e68e4fc09 docs: documentation for GtkTextBufferClass
It'll most probably be more useful in the near future.
2014-10-18 19:28:40 +02:00
Matthias Clasen
0f4bf3d8a0 Fix the build 2014-10-18 13:19:21 -04:00
Matthias Clasen
f7ede4edca Fix a few typos 2014-10-18 12:53:30 -04:00
Matthias Clasen
c5c21bb1cf GtkWindow: Add a getter for the custom titlebar
This is needed for the glade integration of CSD windows.
2014-10-18 12:51:30 -04:00
Matthias Clasen
57751fa391 Work around a pkg-config bug
It doesn't report -I${prefix}/include in cflags, even if .pc
files explicitly put it there. This was breaking the build
outside of a jhbuild shell when libepoxy is in the jhbuild tree
but not in /usr.
2014-10-18 12:51:30 -04:00
Matthias Clasen
50e73dc6c7 Some documentation updates
Mention libepoxy in various places as a new dependency, and also
mention Wayland in the build documentation.
2014-10-18 12:51:29 -04:00
Lapo Calamandrei
213274c128 Adwaita: darken a tiny bit more bright variant background color 2014-10-18 18:02:20 +02:00
Lapo Calamandrei
062f450709 Adwaita: add back text color.
See https://bugzilla.gnome.org/show_bug.cgi?id=726316 for details.
2014-10-18 17:27:15 +02:00
Lapo Calamandrei
9ea894a56d Adwaita: comment exported colors 2014-10-18 16:29:19 +02:00
Baurzhan Muftakhidinov
e9a0e243f5 Updated Kazakh translation 2014-10-18 00:36:19 +00:00
Carlos Garnacho
cfaec2d2f5 gtkgesturesingle: Unset button/sequence if parent handle_event failed
There are legit reasons for GtkGesture::handle_event to return FALSE,
GtkGestureSingle objects should be unsetting the current button/sequence
if that happens, in order to avoid inconsistent states.

https://bugzilla.gnome.org/show_bug.cgi?id=738591
2014-10-17 21:16:56 +02:00
Lapo Calamandrei
e46d23d819 Adwaita: darkened a tiny bit bright variant background
Trying to differentiate a bit more the focused window from the
backdrop ones.
2014-10-17 20:36:25 +02:00
Lapo Calamandrei
9dab00310d Adwaita: use $backdrop_fg_color where it should
.background:backdrop was not using that one so some labels didn't
look right in backdrop.
2014-10-17 20:11:25 +02:00
Lapo Calamandrei
c044220f62 Adwaita: dimmed backdrop foreground color
To make focused window more evident.
2014-10-17 20:11:25 +02:00
Matthias Clasen
8821d488c5 GtkWindow: Avoid an early exit
When gtk_window_set_titlebar (win, NULL) is called, we were taking
an early exit and forgot to re-map the window. This does not normally
happen in practice, but glade is about to get a 'csd' switch which
lets one toggle back and forth between titlebar and no titlebar.
2014-10-17 13:59:39 -04:00
Matthias Clasen
1a1c30adfa GtkEntry: plug a small memleak
GtkEntry was leaking a pango attribute list, if one was set.
2014-10-16 21:48:11 -04:00
Lapo Calamandrei
ed25153f2d Adwaita: fix stack-switcher button outline offset
See https://bugzilla.gnome.org/show_bug.cgi?id=738636
2014-10-16 20:05:12 +02:00
Benjamin Otte
998feeb2bc spinbutton: Set the correct state on the button contexts
With the recent save-is-child changes, using
  gtk_style_context_get_padding (context, different_state)
will now open a subelement.

This is not what we want, so we check the state whenever we get the
button contexts.
2014-10-16 17:18:34 +02:00
Marek Kasik
a4a38dff0d Get media-col-default attribute correctly
Fix a typo which caused that "number-up-supported" and "media-col-default"
IPP attributes were not requested correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=725441
2014-10-16 15:02:59 +02:00
Lapo Calamandrei
d644b2260f Adwaita: ease-out-quad in place of ease-out
Generally changed the transition timing function to ease-out-quad
which is described by cubic-bezier(0.25, 0.46, 0.45, 0.94), feels
better to me.
2014-10-16 14:36:23 +02:00
Lapo Calamandrei
111f72e891 Adwaita: list row hover color
Now it's based of fg color, so the list row gets darker on the
bright variant and brighter on the dark variant, similarly to what
we do for spinbutton buttons.
2014-10-16 14:23:24 +02:00
Lapo Calamandrei
52e91f1f74 Adwaita: tweak list row transition
Thanks to Carlos Soriano expertise.
2014-10-16 14:15:15 +02:00
Alexander Larsson
142368f095 X11: Fix crash in gdk_x11_gl_context_texture_from_surface
We need to look at the impl_window for the gl rendering, not
the subwindow we're rendering into.
2014-10-16 13:00:45 +02:00
Lapo Calamandrei
1e961001af Adwaita: avoid border clash on transitioning adiacent flat buttons
Flat buttons gets the button decoration on hover, while transitioning
the decorations of adiacent flat buttons are both shown (one fading in
and the other fading out) so the borders clashes, since normally there's
no spacing between them, to avoid it the transition on the normal state
is set to none and added back to the hover state, so the decoration
won't fade out. To make the transition more evident the duration is
increased.
2014-10-16 12:46:58 +02:00
Matthias Clasen
f3f0fc6bb2 widget-factory: Add a missing scrolled window 2014-10-15 21:53:53 -04:00
Matthias Clasen
2e093eafbf widget-factory: Add some vertical examples
This adds both a vertical toolbar and vertically linked buttons.
2014-10-15 21:42:51 -04:00
Benjamin Otte
44c8df62f2 glarea: Display the error message when an error occurred
Simply center a PangoLayout with the message text.
2014-10-16 03:33:15 +02:00
Benjamin Otte
672a67d0af gdk: Add GDK_DEBUG=nogl
This is mostly useful for fallback testing.

I suppose if people want finer grained GL ability testing, they can use
Mesa environment variables to tune things.
2014-10-16 03:33:15 +02:00
Lapo Calamandrei
8a7bd5cc00 Adwaita: color treeview tree/grid lines
Tree lines are visible now, unfortunatelly grid lines do not react
to selected state so they are way too bright.
2014-10-15 20:44:53 +02:00
Matthias Clasen
4f2feb97c2 Avoid deprecation warnings
We don't really care if we use deprecated API inside deprecated
code, so just ignore the warning.
2014-10-15 14:43:19 -04:00
Matthias Clasen
15af0e789b Revert "gtktrayicon-x11: Stop using set_double_buffered"
This reverts commit 4a72563c7b.

It turns out that this commit broke statusicons under Xfce when
not using a compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=737986
2014-10-15 14:43:19 -04:00
Lapo Calamandrei
bcbec384da Adwaita: fix colorchooser styling after latest gtk changes
...commenting stuff pretty accuratelly in the process, since the
widget is quite unobvious to figure out.
2014-10-15 19:49:13 +02:00
Benjamin Otte
2c04c5f08b scrolledwindow: Don't set .frame on overshoot boxes 2014-10-15 17:18:26 +02:00
Benjamin Otte
3a337156d1 stylecontext: Make save/restore create a child CSS node
This is a change for how CSS is applied.

Previously, subelements (I'll take GtkEntry icons as an example) were
treated as having the same parent as the regular elements. So a selector
such as
  .entry
would match an entry inside a window. But it'd also match the icon image
inside the entry. So CSS like
  .entry { padding: 10px; }
would add 10px of padding to both the entry itself and to the icon image
inside the entry, so the icon would effective have 20px padding. To get
around that, one would have to unset it again like so:
  .entry { padding: 10px; }
  .entry.image { padding: unset; }
This is getting more and more of a problem as we make subelements
respect more properties that aren't inherited by default anyway, like
backgrounds and padding/margin/border.

This patch has one caveat though: It makes calling
gtk_style_context_save() the first time have an important side effect.
It's important to audit code to make sure it is only used for
subelements.

And last but not least, this patch is only useful if code unsets
parent's style classes that it doesn't want to apply any longer. Because
style classes are inherited by default (and I don't think we want to
change that), the example will still apply until the subelements no
longer contain the .entry style class.
2014-10-15 17:08:47 +02:00
Benjamin Otte
9843837593 stylecontext: Move next pointer out of GtkStyleInfo
Instead, keep a GSList in the style context.
2014-10-15 17:08:47 +02:00
Benjamin Otte
c38095faed stylecontext: Don't cache the root values
Those are the ones that are special and get animated. Caching them only
causes confusion.
2014-10-15 17:08:47 +02:00
Benjamin Otte
0d380f43d6 stylecontext: Factor out a function 2014-10-15 17:08:47 +02:00
Carlos Garnacho
103e11c937 scrolledwindow: Allow overshooting on scroll events
The overshoot visual notification is probably also nice to have in this
context.

https://bugzilla.gnome.org/show_bug.cgi?id=738533
2014-10-15 17:00:36 +02:00
Lars Uebernickel
582adcab1a Add GDK_DEP_LIBS to demos and tests
Some of them depend on libepoxy now.
2014-10-15 16:15:35 +02:00
Matthias Clasen
c26b2c9209 GtkPlacesSidebar: Don't leak an icon
Found in valgrind.
2014-10-14 23:59:51 -04:00
Matthias Clasen
2eacaf2dd2 GtkFontChooserWidget: Plug several memleaks
These were showing up in valgrind.
2014-10-14 23:59:25 -04:00
Matthias Clasen
ef62a872f5 GtkContainerAccessible: avoid resurrecting accessibles
When removing a child, we don't want to resurrect its
accessible needlessly.
2014-10-14 23:58:37 -04:00
Matthias Clasen
f99cbdf49f Plug a memory leak
We were leaking cairo regions every time we draw.
2014-10-14 22:46:26 -04:00
Benjamin Otte
ccf6507f6a render: Fix uninitialized variables
Refactoring for performance in 39097ea2da
caused border_width to be uninitialized when rendering border images.

https://bugzilla.gnome.org/show_bug.cgi?id=738483
2014-10-15 02:16:24 +02:00
Carlos Garnacho
c184bd4675 scrolledwindow: Simplify _gtk_scrolled_window_set_adjustment_value()
The two boolean arguments always received the same values, so wipe these
out. Likewise, the boolean return value is unused and sort of meaningless.
2014-10-14 15:53:14 +02:00
Carlos Garnacho
1ae5c2a138 window: unset menubar before unsetting focus on dispose()
If the menubar has an app-menu popover, and it is shown at the time of
disposing the window, it will attempt to transfer focus back to the
previous focus widget when undoing modality, even though the dispose()
code already did set_focus(NULL) previously.

At the time the popover is removed, there aren't many hints as to whether
the toplevel or the focus widget are being destroyed (ie. not still under
in_destruction), so just swap the order of these two calls.

For every other popover, this would all happen within dispose/destroy,
which is handled better.
2014-10-14 15:47:06 +02:00
Benjamin Otte
e0040acefc tests: Make gtkgears compile without complaints 2014-10-14 14:33:08 +02:00
Benjamin Otte
f5da87dde8 inspector: Add missing files 2014-10-14 14:32:57 +02:00
Benjamin Otte
eaa872f6c3 inspector: Replace reload with record
and when pressed, record instance counts at 1fps.
2014-10-14 14:03:06 +02:00
Benjamin Otte
43ad7c9714 inspector: Add a graph cell renderer
... and use it to display graphs for how object counts changed.
2014-10-14 14:03:06 +02:00
Benjamin Otte
0a6755b57c inspector: Add a GraphData object for recording data
This way we can keep more data than just the 2 last values.
2014-10-14 14:03:06 +02:00
Benjamin Otte
14e0283413 inspector: Kepp tree iter in type data
This way we don't have to clear/refill the model every time but can keep
the existing model and only update the values.

A nice side benefit is that running an update keeps the current selection.
2014-10-14 14:03:06 +02:00
Benjamin Otte
e36bfb45cd inspector: Make all statistics columns visible always 2014-10-14 14:03:06 +02:00
Benjamin Otte
8d06b84670 inspector: Update all statistics in same place 2014-10-14 14:03:06 +02:00
Benjamin Otte
d123ea579f inspector: increase type by right amount
It's a shift, so we better shift it!
2014-10-14 14:03:05 +02:00
Benjamin Otte
525676435d inspector: Add type column to statistics
Rename old type column to "type name"
2014-10-14 14:03:05 +02:00
Benjamin Otte
db8cdd6392 inspector: Split out a function 2014-10-14 14:03:05 +02:00
Piotr Drąg
44539d98e9 Updated POTFILES.in 2014-10-13 20:21:09 +02:00
Matthias Clasen
b4a288a592 GtkBox: Ensure we only allow one center child
Glade was happily adding multiple center widgets. Oops.
2014-10-13 12:45:05 -04:00
Matthias Clasen
0939857e70 Add GdkGLProfile and GdkGLError to the docs 2014-10-13 10:43:32 -04:00
Matthias Clasen
7de9995f7d Pedantic formatting fix 2014-10-13 10:43:32 -04:00
Matthias Clasen
e7c16a5e82 Drop a reference to GtkGLArea::create-context
The signal no longer exists.
2014-10-13 10:43:32 -04:00
Matthias Clasen
98904b8910 Nitpicky documentation changes 2014-10-13 10:43:32 -04:00
Matthias Clasen
e5e9d87171 Nitpicky documentation fixes 2014-10-13 10:43:32 -04:00
Matthias Clasen
417e0894e7 Correct another Since tag 2014-10-13 10:43:32 -04:00
Matthias Clasen
706a7064a0 Trivial formatting fixes 2014-10-13 10:43:32 -04:00
Matthias Clasen
a74c5a1f39 Correct copyright year 2014-10-13 10:43:32 -04:00
Matthias Clasen
7a80c3b004 Correct Since tags 2014-10-13 10:43:32 -04:00
Alexander Larsson
fdeb4f8c16 gl: Make gdk_gl_context_make_current() return void
Its not really reasonable to handle failures to make_current, it
basically only happens if you pass invalid arguments to it, and
thats not something we trap on similar things on the X drawing side.

If GL is not supported that should be handled by the context creation
failing, and anything going wrong after that is essentially a critical
(or an async X error).
2014-10-13 10:43:32 -04:00
Alexander Larsson
017775f288 X11 GdkGLContext: Remove spurious XSync
This XSync doesn't seem to be necessary. Remove it until otherwise
proven.
2014-10-13 10:43:32 -04:00
Alexander Larsson
3d43a9b084 Fix warning 2014-10-13 10:43:32 -04:00
Alexander Larsson
236d08c3c5 gl: Make all user GdkGLContexts not attached to any window
We make user facing gl contexts not attached to a surface if possible,
or attached to dummy surfaces. This means nothing can accidentally
read/write to the toplevel back buffer.
2014-10-13 10:43:31 -04:00
Alexander Larsson
62a26eb3c8 Add glarea demo to gtk3-demo 2014-10-13 10:43:31 -04:00
Alexander Larsson
5d7e268aac Add tests/testglblending
This test stacks GL and cairo rendering in various
orders to test the layer handling.
2014-10-13 10:43:31 -04:00
Alexander Larsson
8f3e9d1b05 Add tests/gdkgears
A more complex test modeled on the traditional glxgears.
2014-10-13 10:43:31 -04:00
Alexander Larsson
3b3726ae57 Add tests/testglarea
This is a very simple test of GtkGLArea.
2014-10-13 10:43:31 -04:00
Alexander Larsson
535723ce86 Add GtkGLArea widget 2014-10-13 10:43:31 -04:00
Alexander Larsson
7eae4985e8 wayland: Add OpenGL support
This uses EGL to implement GdkGLContext for wayland.
2014-10-13 10:43:31 -04:00
Alexander Larsson
6717242d26 wayland: Set GdkVisual::bits_per_rgb to 8
This was 0 before.
2014-10-13 10:43:31 -04:00
Alexander Larsson
87970ea2d0 Add GDK_ALWAYS_USE_GL debug hack
If this is set we always use GL to render each window, even
if there are no GL widgets in the window.
2014-10-13 10:43:31 -04:00
Alexander Larsson
038aac6275 gdk: Add support for OpenGL
This adds the new type GdkGLContext that wraps an OpenGL context for a
particular native window. It also adds support for the gdk paint
machinery to use OpenGL to draw everything. As soon as anyone creates
a GL context for a native window we create a "paint context" for that
GdkWindow and switch to using GL for painting it.

This commit contains only an implementation for X11 (using GLX).

The way painting works is that all client gl contexts draw into
offscreen buffers rather than directly to the back buffer, and the
way something gets onto the window is by using gdk_cairo_draw_from_gl()
to draw part of that buffer onto the draw cairo context.

As a fallback (if we're doing redirected drawing or some effect like a
cairo_push_group()) we read back the gl buffer into memory and composite
using cairo. This means that GL rendering works in all cases, including
rendering to a PDF. However, this is not particularly fast.

In the *typical* case, where we're drawing directly to the window in
the regular paint loop we hit the fast path. The fast path uses opengl
to draw the buffer to the window back buffer, either by blitting or
texturing. Then we track the region that was drawn, and when the draw
ends we paint the normal cairo surface to the window (using
texture-from-pixmap in the X11 case, or texture from cairo image
otherwise) in the regions where there is no gl painted.

There are some complexities wrt layering of gl and cairo areas though:
* We track via gdk_window_mark_paint_from_clip() whenever gtk is
  painting over a region we previously rendered with opengl
  (flushed_region). This area (needs_blend_region) is blended
  rather than copied at the end of the frame.
* If we're drawing a gl texture with alpha we first copy the current
  cairo_surface inside the target region to the back buffer before
  we blend over it.

These two operations allow us full stacking of transparent gl and cairo
regions.
2014-10-13 10:43:31 -04:00
Alexander Larsson
d0147a6f2c Add gdk_window_mark_paint_from_clip and call from widget drawing
This is a new function that gets called every time we're drawing
some area in the Gtk paint machinery. It is a no-op right now, but
it will be required later to keep track of what areas which
we previously rendered with GL was overwritten with cairo contents.
2014-10-13 10:43:31 -04:00
Alexander Larsson
a8f11835c5 Change the way the update area is tracked during paint
First of all we track the current update area during an
update in window->active_update_area. This will be used later
in end_paint to know the damaged area.

Secondly we keep track of old update areas for the last 2
frames. This will later allow us to reuse old framebuffer
contents in double or tripple buffer setups, only painting
what has changed since then.
2014-10-13 10:43:31 -04:00
Alexander Larsson
ceeed1c48d Add internal gdk_cairo_region_from_clip helper
This extract the current cairo clip region if possible and
returns it as a cairo_region_T. It will be needed by later code.
2014-10-13 10:43:31 -04:00
Emmanuele Bassi
892c6bd6f9 build: Require libepoxy
If we want to use OpenGL in GDK then we have two choices; either:

  - find the GL headers on each platform
  - do extension discovery
  - implement all the crazy dlopen()/dlsym() dispatch tables

*or* use libepoxy, which shields us from all this madness and provides a
decent layer for GL clients to use, without creating its own namespace.

Epoxy is also used by other projects, like Xorg and piglit, and it's
portable to all the platforms GDK cares about.

https://bugzilla.gnome.org/show_bug.cgi?id=119189
2014-10-13 10:43:31 -04:00
Marek Kasik
493aa4e9b3 Get duplex option via IPP
Request "sides-supported" and "sides-default" attributes through
IPP if there is no PPD for selected printer.
Pass "sides" option with other options in printer_get_options().
Add function setup_ipp_option() for creating of IPP option
of given name with passed choices and default value.
Mark such an option as "is-ipp-option" so we can distinguish it
later.

https://bugzilla.gnome.org/show_bug.cgi?id=725441
2014-10-13 11:58:18 +02:00
Jasper St. Pierre
ea21c4563b gdkwindow-x11: Fix graphical regression from 5e325c4
Before 5e325c4, the default BitGravity was NorthWestGravity.
When static gravities were removed in 5e325c4, the BitGravity regressed
to the X11 default, Forget. Forget causes giant graphical glitches and
black flashes when resizing, especially in some environments that aren't
synchronized to a paint clock yet, like XWayland.

I'm assuming that the author assumed that the default of BitGravity was
NorthWestGravity, which is the default of WinGravity. Just go ahead and
fix this regression to make resizing look smooth again.
2014-10-13 02:19:36 -07:00
Benjamin Otte
abfc9cd4eb switch: Use trough style class by default
This allows animating the trough, and saves a save/restore pair.
2014-10-13 04:39:58 +02:00
Benjamin Otte
d1118071dd switch: Set PRELIGHT state on widget 2014-10-13 04:39:58 +02:00
Benjamin Otte
3534225c76 progressbar: Make the trough the default element
Gets rid of a bunch of save/restore calls and allows animating the
background (but not the slider, booo!)
2014-10-13 04:39:58 +02:00
Benjamin Otte
b09fbadddf viewport: Remove wrong save/restore 2014-10-13 04:39:57 +02:00
Matthias Clasen
291e4e107d GtkListBox: Support placeholders in ui files
This makes the gtk_list_box_set_placeholder functionality
available from GtkBuilder

https://bugzilla.gnome.org/show_bug.cgi?id=738111
2014-10-12 18:54:44 -04:00
Matthias Clasen
8fcf3a8e88 GtkSearchBar: don't peek out
When the searchbar is hidden, a 1-pixel-high piece of it is
still peeking out, because visible widgets are always allocated
at least 1x1. Work around this by setting child-visible to FALSE
in this situation.

https://bugzilla.gnome.org/show_bug.cgi?id=724096
2014-10-12 18:18:04 -04:00
Matthias Clasen
e1ff15549b GtkColorSwatch: Avoid style context underflow
The last change accidentally removed the later restore, and
left the earlier, so we ended up with a restore-save sequence.
Thankfully, GtkStyleContext warns about this.
2014-10-12 18:15:23 -04:00
Dušan Kazik
9f3dfa2031 Updated Slovak translation 2014-10-12 21:06:29 +00:00
Piotr Drąg
5f5fc1d530 Updated POTFILES.in and POTFILES.skip 2014-10-12 15:06:38 +02:00
Matthias Clasen
3a19c76017 inspector: Bring the selector back
Make it a separate page instead of the old button path.
2014-10-12 07:57:29 -04:00
Benjamin Otte
5018c7f7cb examples: Add deprecation guards
Apparently it's not possible in GtkTextView to say "this style should
apply to all text, including newly inserted text. Or I'm just too stupid
to use its API.

So instead, keep using override_color().
2014-10-12 05:51:11 +02:00
Benjamin Otte
75ed941ef1 tests: Update testexpand example for deprecations 2014-10-12 05:27:27 +02:00
Benjamin Otte
c96945b390 tests: Update testtooltips for deprecations 2014-10-12 05:21:01 +02:00
Benjamin Otte
3d45d53714 tests: Don't force black background in testwindows 2014-10-12 05:15:23 +02:00
Benjamin Otte
81fe943472 tests: Update testoverlaystyleclass test
Make it not use deprecations anymore and use CSS to show things work by
changing border-radius when a style class exists.
2014-10-12 05:11:13 +02:00
Benjamin Otte
0a6443ebaf testgtk: Don't trigger deprecation warnings
.. and various other assorted fixes, mostly related to drawing code that
assumed stuff wasn't transparent by default.
2014-10-12 04:54:40 +02:00
Benjamin Otte
508d31fe70 gdk: Deprecate compositing support
We might want to remove support for it completely and always return
FALSE.
2014-10-12 04:54:35 +02:00
Carlos Soriano
975d9d4314 gtkplacessidebar: Fix commit f6870e5b79
Commit f6870e5b79 introduced a some memory leaks and could be
improved in some areas.

Fix the memory leaks and apply the improvements.

https://bugzilla.gnome.org/show_bug.cgi?id=737983
2014-10-12 04:16:44 +02:00
Benjamin Otte
e991e4333d configure: Require glib 2.43 2014-10-12 04:16:44 +02:00
Benjamin Otte
0a31609201 colorswatch: Remove unneeded save/restore
for both style context and cairo context.
2014-10-12 04:16:44 +02:00
Benjamin Otte
f4e44e9e6e menu: Respect borders properly for scroll arrows 2014-10-12 00:25:23 +02:00
Yosef Or Boczko
7b58ca4623 Updated Hebrew translation 2014-10-12 01:11:36 +03:00
Yosef Or Boczko
2f2edbd620 Updated POTFILES.in 2014-10-12 01:11:26 +03:00
Matthias Clasen
5624da20e3 inspector: Some improvements for statistics
Show the last two snapshots, plus a delta.
2014-10-11 17:58:31 -04:00
Matthias Clasen
9f1d651e0b inspector: Add a tab for object counts
This can be useful in finding leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=738272
2014-10-11 16:54:24 -04:00
Piotr Drąg
ff9532db27 Updated POTFILES.in and POTFILES.skip 2014-10-11 17:57:42 +02:00
Lapo Calamandrei
74531123ae Adwaita: fix the special cased sidebar scrollbar...
...which I broke with the latest commit.
2014-10-11 16:25:57 +02:00
Lapo Calamandrei
5f11eaa168 Adwaita: finally kill the scrollbar junction frame...
See https://bugzilla.gnome.org/show_bug.cgi?id=737981
2014-10-11 14:32:19 +02:00
Matthias Clasen
30738fbfdd GtkToolButton: Apply expected button style classes
Add .image-button or .text-button to the button within,
so our css works as expected for toolbar buttons too.
2014-10-11 08:28:55 -04:00
Matthias Clasen
9a6aa8db68 inspector: Cosmetics
Add .image-button to the tool buttons in the CSS editor - still
not square.
2014-10-11 08:15:07 -04:00
Matthias Clasen
735cf98af1 inspector: Remove a stray separator 2014-10-11 08:07:04 -04:00
Matthias Clasen
3715fec02d inspector: Make the window smaller
No need for 1000 pixels of with anymore, after the reorg.
2014-10-11 08:01:57 -04:00
Matthias Clasen
615e4332ef inspector: Make resource list columns resizable
This tree has the potential to be deep, and contain long
names, so it forces the window to be wide, unless we
allow the columns to shrink.
2014-10-11 08:01:50 -04:00
Matthias Clasen
7b20bb917f inspector: Small improvements to the resource tab
Move the close button to the header bar and center the info grid.
2014-10-11 00:59:36 -04:00
Matthias Clasen
a5846645d1 inspector: Cosmetic fixes
Set scrollbars and shadows consistently.
2014-10-11 00:59:36 -04:00
Matthias Clasen
d2c0f37a69 inspector: Cosmetic fixes
Add a missing shadow in the css editor.
2014-10-11 00:59:36 -04:00
Matthias Clasen
326f0aad5d inspector: Cosmetic fixes
Expand the resource list initially.
2014-10-11 00:59:36 -04:00
Matthias Clasen
dffceb1a17 inspector: Avoid a split pane for objects
Like for the resources page, use a separate page for details
to gain more room for both the tree and the details.
2014-10-11 00:59:36 -04:00
Matthias Clasen
a8dc098699 inspector: More refactoring
Rename widget tree to object tree. It contains plenty of
non-widgets nowadays, after all.
2014-10-11 00:59:36 -04:00
Matthias Clasen
6194c90f74 inspector: More refactoring
Get rid of gtk_inspector_widget_tree_get_selected_object,
we can just pass the selected object along with the changed
signal.
2014-10-11 00:59:36 -04:00
Matthias Clasen
e8f9e7d472 inspector: Small reshuffling
Move the scrolled window into GtkInspectorWidgetTree.
2014-10-11 00:59:36 -04:00
Matthias Clasen
bee90aa8c8 inspector: Drop unused python shell code
This is getting in the way; if somebody comes by who wants
to add scripting support back, we can resurrect this.
2014-10-11 00:59:36 -04:00
Matthias Clasen
ee99ca6610 inspector: Avoid a split pane for resources
There is not much room in the inspector window; squeezing a
tree and a detailed view in the same page is not great. Instead,
make the details a separate page.
2014-10-11 00:59:36 -04:00
Matthias Clasen
0c77879bd0 inspector: Add more data to resource list 2014-10-11 00:59:36 -04:00
Matthias Clasen
6bbedfe5f3 inspector: Fix up resource tab appearance
Now that it is not in a notebook anymore, we lost the view
class in the background. Add it back.
2014-10-11 00:59:36 -04:00
Matthias Clasen
6128082f20 inspector: Save some more space
Instead of nesting two notebooks, use a stack switcher in
the headerbar for the outer notebook. This saves valuable
vertical space.
2014-10-11 00:59:36 -04:00
Matthias Clasen
4222e8d713 inspector: Drop the button path
The button path takes up quite a bit of room, and is not _that_
useful. If this information is useful, it can find a new home
on the misc tab.
2014-10-11 00:59:36 -04:00
Arash Mousavi
2f833d4f44 Updates Persian Translations 2014-10-11 00:55:22 +03:30
Carlos Garnacho
69d9746708 wayland: write wl_data_offer data asynchronously
Currently writing wl_data_offer data into the fd is 1) synchronous, which
is noticeable when transferring large amounts of data, and 2) buggy, write()
error checking is done on the accumulator, breaking both the written data
accounting and error checking itself.

Fix both by making writes asynchonous through GOutputStream, the operation
is spun off and either finished, or cancelled if new data is stored in the
selection while the transfer is active.
2014-10-10 20:58:55 +02:00
Carlos Soriano
f6870e5b79 gtkplacessidebar: Open $HOME after unmounting or ejecting
When a drive is ejected or a volume unmounted the current directory
doesn't change most of the times being empty or being a directory that
user shouldn't take care about, like /run/media

Seems more useful to change to $HOME directory in that case so the user
can see something useful and familiar just after unmounting.

https://bugzilla.gnome.org/show_bug.cgi?id=737983
2014-10-10 18:17:41 +02:00
Carlos Soriano
3c29212ce3 gtkplacessidebar: Don't change location if clicked on eject button
Currently we change the current location if we click the eject button of
a mount.

Check whether the user actually clicked the eject button and don't
change location in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=737983
2014-10-10 18:17:41 +02:00
Lapo Calamandrei
025b801663 Adwaita: dim menu overflow button border color 2014-10-10 14:01:38 +02:00
Lapo Calamandrei
940415b2eb Adwaita: style menu overflow button
See bug https://bugzilla.gnome.org/show_bug.cgi?id=738158
2014-10-10 13:54:36 +02:00
Milo Casagrande
d5a21e47e3 Updated Italian translation 2014-10-10 11:51:06 +00:00
Matthias Clasen
dcf80f3df5 Add top/bottom style classes to scroll arrows 2014-10-10 07:44:03 -04:00
Marek Kasik
e78c3e2c8c Get paper sizes from IPP query
Query printer via IPP for paper sizes if there is no
or empty PPD file.
Parse "media-supported" and "media-size-supported" attributes for list
of paper sizes. Parse "media-default" and "media-col-default" attributes
for default settings.

https://bugzilla.gnome.org/show_bug.cgi?id=725441
2014-10-10 13:40:27 +02:00
Marek Kasik
a73c858f4b Remove dead code from CUPS backend
https://bugzilla.gnome.org/show_bug.cgi?id=725441
2014-10-10 13:40:24 +02:00
Marek Kasik
6bdaa95164 Create paper size from IPP media name
Add function gtk_paper_size_new_from_ipp() which looks for
given name in standard paper size names list and create appropriate
GtkPaperSize.

https://bugzilla.gnome.org/show_bug.cgi?id=725441
2014-10-10 13:40:21 +02:00
Marek Kasik
ccbb51dff1 Update paper size names
Update list of standardized paper size names from
PWG Media Standardized Names 2.0 (MSN2) and from
CUPS' cups/pwg-media.c.

https://bugzilla.gnome.org/show_bug.cgi?id=725441
2014-10-10 13:40:17 +02:00
Matthias Clasen
42280f6c4e inspector: Add a way to disable the warning dialog 2014-10-09 23:38:44 -04:00
Matthias Clasen
4e974edde8 GtkScrolledWindow: Introduce a helper function
Instead of making assumptions about enum value ordering,
introduce a helper function to determine policy values
for which the scrollbar may be visible.
2014-10-09 21:03:40 -04:00
Matthias Clasen
9dcb33ad34 Add an example for synchronized scrolling
This example uses GTK_POLICY_EXTERNAL to share a scrollbar among
multiple scrolled windows.
2014-10-09 20:18:51 -04:00
Matthias Clasen
94b680c2cd GtkScrolledWindow: Allow scrolling without bars
Add a new policy, GTK_POLICY_EXTERNAL, which hides the scrollbar,
but does not force the scrolled windows size to be determined by
its child. This can be used to keep two scrolled windows in sync,
while sharing a single scrollbar.

https://bugzilla.gnome.org/show_bug.cgi?id=730730
2014-10-09 20:18:51 -04:00
Benjamin Otte
3f4bd447f8 shadows: Respect scaled factors for cached surface 2014-10-10 01:02:34 +02:00
Benjamin Otte
39097ea2da render: Optimize the no-borders case to exit early 2014-10-10 00:27:46 +02:00
Benjamin Otte
f46c31f2fb tests: Exit test when main window is closed 2014-10-10 00:27:45 +02:00
Matthias Clasen
6291899681 Add a note about text view issues
Mention text view background problems and the draw_layer
vfunc in the release notes.
2014-10-09 18:13:53 -04:00
Matthias Clasen
41b53ca603 GtkMenuButton: Submit to action
As an actionable (inherited from GtkButton), a GtkMenuButton
should not set its own sensitivity when it has an action-name
set, but just follow the enabled state of the associated
action.

https://bugzilla.gnome.org/show_bug.cgi?id=738083
2014-10-09 18:12:25 -04:00
Matthias Clasen
1331740dd6 Remove an unused internal export
_gtk_scrolled_window_get_scrollbar_spacing is only used in
gtkscrolledwindow.c, so keep it there.
2014-10-09 00:22:13 -04:00
Matthias Clasen
c9420aa1a3 ColorChooser: Fix an off-by-one error
We were not filling the last free space in the custom color
row.
2014-10-09 00:12:46 -04:00
Lapo Calamandrei
cc16a6ca6c Adwaita: color button changes
Dimmed inner colorswatch shadow to make brighter colors looks nice,
increased the padding to make button states more evident, 0 border
radius to match the padding change and no colorswatch shadows when
the button is insensitive.
2014-10-08 17:52:43 +02:00
Lars Uebernickel
0a200e29ca Distribute gtk/resources/ui/*.ui.h
POTFILES references them.
2014-10-08 17:27:23 +02:00
Lapo Calamandrei
e34bb3d483 Adwaita: colorchooser style rewrite
To reflect latest Benjamin changes. As a bonus the colorchooser
looks better to me, same for the scss code.
2014-10-08 17:23:45 +02:00
Lapo Calamandrei
140a64eea4 Adwaita: don't round scrolled window frame corners
See https://bugzilla.gnome.org/show_bug.cgi?id=737985
2014-10-08 14:08:04 +02:00
Benjamin Otte
e82093fc14 colorswatch: Use a better name for the overlay
Name it .overlay and not .image
2014-10-08 13:20:03 +02:00
Benjamin Otte
6b0d389bfd colorswatch: Draw the image overlay over the whole widget 2014-10-08 13:17:55 +02:00
Benjamin Otte
395db3afb6 themingbackground: Use fill() instead of clip() + paint()
It's simpler code and I believe it's faster, too.
2014-10-08 05:23:11 +02:00
Benjamin Otte
a3d68af950 themingbackground: Add a quick exit for default case
In the case where the background is completely transparent, exit the
rendering functions before doing any expensive calculations.
2014-10-08 05:20:31 +02:00
Benjamin Otte
14d166145a themingbackground: Call shadow function directly
... instead of having a custom function for it.
2014-10-08 05:20:31 +02:00
Benjamin Otte
5cdb9752a7 themingbackground: Don't store (almost) unused variables
Instead, parse them directly to the one function that uses them.
2014-10-08 05:20:31 +02:00
Benjamin Otte
6e68237191 themingbackground: Don't store bg_color in struct
Instead, keep it as a separate variable.
2014-10-08 05:20:31 +02:00
Benjamin Otte
8abf82fcf4 themingbackground: Use an array instead of 3 separate members
Simplifies code
2014-10-08 05:20:31 +02:00
Benjamin Otte
05460f4982 render: Make rendering the background a single function 2014-10-08 05:20:30 +02:00
Benjamin Otte
3c50c0988a render: Overhaul gtk_render_handle()
The code did weird things with drawing backgrounds sometimes but not
really. Now it does this:

(1) render a background
(2) render a frame
(3) render an icon
    - if no icon exists, draw the generic handle icon
2014-10-08 05:20:30 +02:00
Benjamin Otte
c39bd623f6 colorswatch: Render background properly
We want to render a background *and* the current color (if there is
one).

This also adds a custom function gtk_render_add_content_path() which
adds the path of the current content area to a cairo_t.
2014-10-08 05:20:30 +02:00
Benjamin Otte
7295c8f12b colorswatch: Remove an unused variable 2014-10-08 05:20:30 +02:00
Benjamin Otte
100623e455 colorswatch: Render focus with gtk_render_focus() 2014-10-08 05:20:30 +02:00
Benjamin Otte
be19ee29c2 colorswatch: Simplify drawing code
This adds a CSS box (complete with padding and border) for the icon. The
box is even drawn when no icon is present. Use the ".image" as the style
class here instead of -active-color-badge.

Use this box to draw the circle around the selection icon in Adwaita.
2014-10-08 05:20:30 +02:00
Matthias Clasen
3897041f4a More removal of deprecated API 2014-10-07 22:35:02 -04:00
Dariusz Gadomski
15dbadf389 printing: Properly initialize auth_info in gtkprintbackend.c
auth_info should be a NULL-terminated array as it is used in
e.g. g_strdupv invocations iterating over its elements until
a NULL element is encountered.

https://bugzilla.gnome.org/show_bug.cgi?id=737777
2014-10-07 18:53:57 -04:00
Matthias Clasen
0bf474e324 Make touch-selection popovers font-inert
Just like context menus, these should not inherit font
settings from the text view they are attached to.
2014-10-07 13:28:54 -04:00
Matthias Clasen
f93795d272 Add a style class for touch selection popovers 2014-10-07 13:27:52 -04:00
Lapo Calamandrei
93e61c1f24 Adwaita: change spinbutton button color on backdrop
Contextually dim the spinbutton button color a little bit.
2014-10-07 12:23:50 +02:00
Matthias Clasen
d120346992 gtk3-demo: Don't use deprecated API
Replace various override calls.
2014-10-07 00:48:30 -04:00
Matthias Clasen
5a0dc74ded Inspector: Use text attributes for monospace labels 2014-10-07 00:42:46 -04:00
Matthias Clasen
0c02bc4239 Inspector: Use the new monospace support 2014-10-07 00:42:21 -04:00
Matthias Clasen
a3dfffa8b8 Adwaita: Add .monospace style 2014-10-07 00:40:55 -04:00
Matthias Clasen
0004e667ab GtkTextView: Add a monospace property
This is a convenient shortcut for a common case. It is implemented
by adding a .monospace style class to the text view, and letting
the theme decide about the monospace font to use.
2014-10-07 00:39:42 -04:00
Matthias Clasen
2dfc03bdb5 GtkSidebar: Pick up the visible child from the stack
Same here: We need to synchronize the visible child with the
selected row when setting a stack on the sidebar. I've noticed
this problem in the sidebar example in gtk3-widget-factory.
2014-10-06 23:07:35 -04:00
Matthias Clasen
c53f4bb342 GtkStackSwitcher: Pick up the visible child from the stack
We forgot to synchronize the visible child when setting a
stack on the switcher. Oops.
2014-10-06 23:06:09 -04:00
Matthias Clasen
ba63f95a4a Add GtkTextViewClass to the docs
So that the existing information about draw_layer actually
ends up in the docs. While we are at it, document the other
vfuncs.

https://bugzilla.gnome.org/show_bug.cgi?id=737952
2014-10-06 22:33:19 -04:00
Michael Catanzaro
62da080bd0 tooltip: fix line wrapping
We enable line wrap on the internal GtkLabel, but nowadays this does
nothing unless we also set a max number of characters.

https://bugzilla.gnome.org/show_bug.cgi?id=737929
2014-10-06 21:30:18 -04:00
Vasiliy Nuzha
ba6522d3f2 Fix monitors enumeration bug
Fix monitors enumeration bug. By default used MONITORINFOEXW (UTF-16 Build) with wrong structure size
2014-10-06 22:48:08 +00:00
Jasper St. Pierre
1914e65591 gdkwindow: Fix small typo 2014-10-06 13:36:59 -07:00
Benjamin Otte
f3bd78a3cf gdk: Fix gdk_cairo_create() without begin_paint()
We were translating the clip region twice in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=737825
2014-10-06 22:24:28 +02:00
Changwoo Ryu
916d9e4a52 Updated Korean translation 2014-10-07 01:35:23 +09:00
Kalev Lember
112e74ed64 gdk: Allow calling gdk_cairo_surface_create_from_pixbuf with scale 0
The documentation explicitly states that 0 is an allowed value for using
the same scale as the window. This 0 value is also explicitly checked
down in the call chain and handled.
2014-10-06 14:39:22 +02:00
Benjamin Otte
5e4672092a gdk: Deprecate static gravities
... and remove all implementations. The API allows to not work "if the
server doesn't support it. So from now on, no server does!
2014-10-06 02:38:40 +02:00
Jasper St. Pierre
dadc37e64d cssshadowvalue: Add a cache for blurred Pango layouts
Drawing text with Pango is quite expensive, and drawing text and also
blurring it is *really* expensive. To prevent us from drawing a lot of
text and then blurring it a lot is *really* expensive.

We now cache the blurred pixels for the last layout and shadow we made,
which means we can repeatedly draw labels with a blurred text-shadow
extremely fast.

To detect whether the shadow is up-to-date, we track the serial of the
PangoLayout alongside the radius of the box shadow. We don't support
inset shadows nor spread on text-shadow, so we don't need to track
these.
2014-10-06 01:58:31 +02:00
Matthias Clasen
919bdff7ac GdkDevice: Avoid unnecessary critical
There is no need for a critical warning just because somebody
asked for a property that is not meaningful for the device.
Just document it as not useful for keyboard devices.
2014-10-05 19:43:06 -04:00
Matthias Clasen
d1fd8267ef Cosmetic formatting fix 2014-10-05 13:39:37 -04:00
Matthias Clasen
b858d45e3c GtkPlacesSidebar: Don't pile up duplicate bookmarks
We get multiple notifications from the bookmark manager when
something changes. Every time, we reconstruct the sidebar contents
completely, by clearing the store. The bookmarks are added with
async calls though, and the code was forgetting to cancel outstanding
async requests, leading to multiple instances of the same bookmark
getting added. Use the cancellable we already have to prevent that.

This could be made much more efficient by not recreating the entire
sidebar quite so often (3-5 times for a single bookmark rename).

https://bugzilla.gnome.org/show_bug.cgi?id=737679
2014-10-05 13:39:37 -04:00
Wolfgang Stöggl
fbad4f6c03 Updated German translation 2014-10-05 14:25:27 +00:00
Lapo Calamandrei
e3fa5592be Adwaita: fix last vertically linked focused entry 2014-10-05 12:29:04 +02:00
Benjamin Otte
cff37ce26e x11: Remove overeager check
window->parent must exist, it's dereferenced a few lines below.

Avoids clang complaints.
2014-10-05 11:25:06 +02:00
Benjamin Otte
66be6a018c gdk: Remove overeager checks
Parent is guaranteed to not be NULL. It can only ever be NULL for root
windows and root windows cannot be created with gdk_window_new() and
gdk_window_ensure_native() will exit early because they already are
native.

Also, both functions would crash a few lines below where parent gets
dereferenced.
2014-10-05 11:25:05 +02:00
Benjamin Otte
3526f2081b x11: Remove unneeded and wrong return_if_fail()
It triggers coverity warnings.
2014-10-05 11:25:05 +02:00
Matthias Clasen
dd8db0f5cb GtkScrolledWindow: code cleanup
Remove return-if-fail parameter checks from static functions,
where we don't normally do these.
2014-10-05 00:19:51 -04:00
Matthias Clasen
bcfa41cec6 Cosmetic documentation improvements 2014-10-05 00:13:09 -04:00
Matthias Clasen
9a2327a35e Use .label in the theme css 2014-10-04 21:53:29 -04:00
Matthias Clasen
75bcecb363 Add a label style class 2014-10-04 21:53:29 -04:00
Lapo Calamandrei
f2cd7f151e Adwaita: add vertically linked combos 2014-10-05 00:56:48 +02:00
Matthias Clasen
cfdbd59963 docs: Add an index for 3.16 additions 2014-10-04 16:09:21 -04:00
Matthias Clasen
978afce04a Fix a thinko in the previous commit
GTK+ relies on this function silently failing for invalid data.
2014-10-04 16:06:30 -04:00
Matthias Clasen
a00842fa99 Add a function to load css from a resource
This is common enough that we should just provide an API for it
- we already had a function for this purpose anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=672946
2014-10-04 15:52:02 -04:00
Matthias Clasen
40049581bc Trivial documentation tweaks 2014-10-04 15:48:07 -04:00
Matthias Clasen
c79ccfd6f1 widget-factory: Cosmetic improvement 2014-10-04 15:14:26 -04:00
Matthias Clasen
79afd7c8d7 widget-factory: More vertical linking examples 2014-10-04 15:01:29 -04:00
Lapo Calamandrei
1f8b0852a4 Adwaita: added style for vertically linked entries 2014-10-04 20:24:24 +02:00
Matthias Clasen
a03583d14f printing: Avoid missing icons
I've noticed a missing image show up in my print dialog, where
the printer reported "printer-paused" as icon. Rearrange things
so we always fall back to "printer" for printer icons.
2014-10-04 12:20:23 -04:00
Matthias Clasen
c0573272f3 printing: Make GtkPrinter have a useful icon by default
It causes complication elsewhere if gtk_printer_get_icon_name()
returns NULL initially. So make the icon name default to
"printer".
2014-10-04 12:20:17 -04:00
Matthias Clasen
f634684eeb printing: Another tweak to sheet drawing
After consultation, revisit the vertical centering to center
the first 'stack', and put the second one behind it.
2014-10-04 11:56:44 -04:00
Matthias Clasen
72a809be0a inspector: Down the model tree
Show nested tree models, inside filter or sort models. Without
this, you can't get at the data.
2014-10-04 11:53:14 -04:00
Matthias Clasen
051eedcea1 Small code rearrangement 2014-10-04 11:43:50 -04:00
Benjamin Otte
9752ab1711 docs: Fix some copy/paste errors 2014-10-04 17:18:50 +02:00
Benjamin Otte
82b7d21f6e print: Add a .paper style class
... and use it in the print preview.
2014-10-04 17:18:50 +02:00
Benjamin Otte
f7d7d345da docs: Add a man page fro gtk3-demo-application
It is an installed binary, so it needs a man page!
2014-10-04 17:18:50 +02:00
Matthias Clasen
4bc09a6a17 printing: Simplify sheet drawing
We don't need the scaling support anymore - icon sizes are
no longer settable.
2014-10-04 11:00:10 -04:00
Matthias Clasen
10d0dad2cf print: Center sheet drawing horizontally
Center the page ordering indicator horizontally, relative to the
spinbutton above it.
2014-10-04 10:55:13 -04:00
Matthias Clasen
99c65b1587 print: Center sheet drawing vertically
Center the page ordering indicator vertically, relative to the
checkboxes next to it.
2014-10-04 10:55:06 -04:00
Matthias Clasen
7866d4ba21 Remove an unused variable 2014-10-03 23:20:18 -04:00
Matthias Clasen
fee46bda00 inspector: Fix a thinko
We still need to possibly scan the toplevel after selecting
a widget, since we don't monitor the list of toplevels, so
the window may not be in our tree yet. This was broken in
commit e7bd73f2b0.
2014-10-03 22:12:54 -04:00
Piotr Drąg
af7e73f9df Updated POTFILES.skip 2014-10-03 17:38:20 +02:00
Benjamin Otte
3b83e4ee5c libgail: Add deprecation guards 2014-10-03 15:51:45 +02:00
Benjamin Otte
c750cea4e5 imcontextxim: Remove broken custom drawing code
Just use regular GtkWindow styling instead.
2014-10-03 15:51:45 +02:00
Matthias Clasen
2e83e7d335 GtkBuilder: Don't use deprecated types in examples 2014-10-03 09:33:35 -04:00
Matthias Clasen
80226ca926 GtkBuilder: Undo the type name heuristic changes
These turned out to break existing ui files, concretely
GWeatherLocationEntry was no longer guessed correctly.

Update the testcases to reflect this, and add a testcase
for GWeather.
2014-10-03 09:29:45 -04:00
Matthias Clasen
b22919220b widget-factory: Make the record button more interesting 2014-10-03 01:13:02 -04:00
Matthias Clasen
3b18ea71c3 widget-factory: Add a sidebar example 2014-10-03 01:04:29 -04:00
Benjamin Otte
c9d9c9158f gtk-demo: Replace old code
"Hey I know, let's do an easter egg!"
"What kind of easter egg?"
"We can nest lots of textviews!"
"Sounds cool!"
...
"But how does one see a textview inside a textview?"
"What do you mean?"
"Well, it just looks like black text on a white background."
"You mean it's the same as if we just duplicated the text?"
"Yeah!"
"Hrm, maybe we can put a frame around it."
"Sounds good. I'll stuff the textviews in a GtkFrame."
"What? Why? Let's use a GtkEventBox and override its background"
"Why is that a good idea when we have GtkFrame?"
"Because I said so!"
"Okay."
2014-10-03 06:59:14 +02:00
Benjamin Otte
2b6a4ba890 gtk-demo: Remove useless code in colorsel example
We have the color stored in a global variable already. There is
absolutely no need to also force it into the CSS machinery.
2014-10-03 06:48:18 +02:00
Benjamin Otte
23a4affb6f gtk-demo: Improve flowbox demo code
Overriding the background color for a color swatch is wrong. The color
is not the background, it's the foreground, so it should be painted in
a draw signal handler.
2014-10-03 06:45:38 +02:00
Benjamin Otte
40e0973709 gtk-demo: Remove unneeded code
Overlays are transparent by default, no need to override them to be.
2014-10-03 06:40:13 +02:00
Benjamin Otte
2fbc77fce1 gtk-demo: Properly override font color in combobox example 2014-10-03 06:38:21 +02:00
Benjamin Otte
a2f550d91b stylecontext: Add missing docs for deprecations 2014-10-03 06:27:49 +02:00
Benjamin Otte
0e34c87211 fontchooserwidget: Use text attributes for the preview
... instead of adding a custom CSS provider.
2014-10-03 06:18:07 +02:00
Benjamin Otte
54c6c7ae87 cellrendereraccel: Remove unused variables 2014-10-03 06:18:07 +02:00
Benjamin Otte
91467a45fc stylecontext: Deprecate functions
- gtk_style_context_get_background_color()
- gtk_style_context_get_border_color()

Those functions shouldn't be used anymore, because they don't represent
anything from the CSS styling we support. The background color often
isn't used due to background images and there are actually 4 different
border colors (1 for each side) - if there isn't also a border image in
use.
2014-10-03 06:18:06 +02:00
Benjamin Otte
39453478ab print: Improve sheet drawing a bit
This is only one step in the right direction. Long term this code should
probably be replaced by real widgets.
2014-10-03 06:18:06 +02:00
Benjamin Otte
c543ddab3a theming: Use gtk_style_context_peek_property()
instead of outdated accessors.
2014-10-03 06:18:06 +02:00
Benjamin Otte
dd7c65a95a scrolledwindow: Rewrite overshoot code with regular styling
Instead of drawing a gradient in the background color, draw a CSS box.

And change the theme so instead of setting just a background color it
draws a gradient.

The resulting visuals are the same.
2014-10-03 06:18:06 +02:00
Benjamin Otte
a6f935bb77 scrolledwindow: Don't use LIGHTEN operator
For the overshoot gradient, using OVER is fine. Simplifies the code and
increases performance.
2014-10-03 06:18:06 +02:00
Benjamin Otte
d941e5f0c0 scrolledwindow: Remove unused variable 2014-10-03 06:18:06 +02:00
Benjamin Otte
8d1227a97c label: Simplify rendering code
Instead of drawing text for selections and links manually, use the
gtk_render_background() and gtk_render_layout() functions.

As a side effect, this allows shadows on selected text and links
and real backgrounds (like gradients or images), too.
2014-10-03 06:18:06 +02:00
Benjamin Otte
9744e86e04 combobox: Don't set cell view background
This can be done with CSS these days. Also, these days the background of
cell views is transparent, so it doesn't even have to be done.
2014-10-03 06:18:05 +02:00
Benjamin Otte
b547c0319a entrycompletion: Remove outdated code
I tried asking but nobody knew why it is necessary to set the background
color of the first cell. It seems with CSS styling this is completely
unnecessary.
2014-10-03 06:18:05 +02:00
Benjamin Otte
93aeb63f0c sidebar: Fix gcc warning 2014-10-03 06:18:05 +02:00
Benjamin Otte
a0bf0a0f70 themingengine: Call real API render functions
No need to call the private versions anymore now that the real ones
don't call into the theming engine.
2014-10-03 06:18:05 +02:00
Benjamin Otte
4d9d655b4e themingengine: Stop using it
Instead, call the default theme engine's code directly.
2014-10-03 06:18:05 +02:00
Benjamin Otte
23948d6a3a themingengine: Move actual render functions to gtkrender.c
GtkThemingEngine just always calls
  gtk_do_render_foo(engine->priv->context, ...)
now. Other than that, the code is unchanged.
2014-10-03 06:18:05 +02:00
Benjamin Otte
d3c147a62d stylecontext: Split render functions out into gtkrender.[ch] 2014-10-03 06:18:05 +02:00
Jasper St. Pierre
763aa4db94 cssshadowvalue: Move the check for blurring into its own function
This makes it easier to update the check later.
2014-10-03 06:18:04 +02:00
Jasper St. Pierre
6556e7e08d cssshadowvalue: Rename shadow_key to original_cr_key
shadow_key is a poor name for this, and we're going to add more user
data keys, so rename it to something more indicative of what it's used
for.
2014-10-03 06:18:04 +02:00
Benjamin Otte
e683e915b8 css: Queue resize for properties that affect clip
This fixes shadows that are animated not updating the clip of the widget
they are drawn on. An example of this are the buttons in the CSS shadows
example in gtk-demo.

Reftest included
2014-10-03 06:18:04 +02:00
Benjamin Otte
f7ee61c833 css: Have finer-grained definitions for effects of CSS props
This adds the GtkCssAffects enum and implements it for all style
properties.
So far, this is not exposed outside of the implementation file.
2014-10-03 06:18:04 +02:00
Benjamin Otte
7afac9670b image: Implement clipping support for icon-shadow
Testcase is attached.
2014-10-03 06:18:04 +02:00
Benjamin Otte
7d1e79ef4b tests: Add a test for a performance optimisation
text-shadow is too slow. Running this testcase reveals that.
2014-10-03 06:18:04 +02:00
Matthias Clasen
202116c60c Printing: Make the print dialog look better with bottom buttons
With buttons at the bottom, things were not looking good here:
no spacing, and a gray background. Add spacing, and put the buttons
on the white background.
2014-10-03 00:07:28 -04:00
Matthias Clasen
5c46db1d77 widget-factory: Add more buttons
Some more button variations, found in the wild.
2014-10-02 23:38:58 -04:00
Matthias Clasen
cc529c2423 GtkRadioButton: Allow setting group more than once
It turns out that GtkBuilder will sometimes set a property
twice. Normally, this is harmless, but for GtkRadioButton:group,
it triggered a critical. Remove that.
2014-10-02 23:37:38 -04:00
Matthias Clasen
d5531da7f8 Trivial typography improvement
Use an em dash instead of -- in documentation.
2014-10-02 22:37:37 -04:00
Matthias Clasen
8495c0c7ad GtkSidebar: Don't use internal API
This makes it possible to copy the gtksidebar.c source into
other projects, for early adopters.
2014-10-02 22:01:14 -04:00
Matthias Clasen
db5cbce4d5 GtkSidebar: Fix a property type
The GtkSidebar:stack was meant to be an object property
of type GTK_TYPE_STACK. Make it so.
2014-10-02 22:00:40 -04:00
Matthias Clasen
5b36bd704b widget-factory: Add a scale button
Instead of two volume buttons, make the second one a scale button
and use microphones.
2014-10-02 21:42:08 -04:00
Matthias Clasen
59637c95a6 Properly extract strings from gtkprintunixdialog.ui
Since 972136803a, gtkprintunixdialog.ui contains non-ASCII
in translatable strings. These were not properly extracted.
2014-10-02 21:29:54 -04:00
Matthias Clasen
b3d90fe51b Make non-ASCII strings in ui files work
Our extractor tool was not calling setlocale(), thus it only
produced output in the C locale, ie ASCII. Oops.
2014-10-02 21:28:43 -04:00
Matthias Clasen
6a214c9bcd GtkExpander: Fix a problem with resize-toplevel
The toplevel resizing was not working properly when the
content had non-trivial height-for-width behavior (such
as a wrapping label).
2014-10-02 18:06:02 -04:00
Matthias Clasen
eb88ce429c gtk-demo: Make the sidebar demo scroll 2014-10-02 18:06:02 -04:00
Matthias Clasen
2a615e2e45 GtkSidebar: Scroll when needed 2014-10-02 18:06:02 -04:00
Piotr Drąg
7eac2bc4c3 Updated POTFILES.in 2014-10-03 00:00:15 +02:00
Lapo Calamandrei
64fea1be04 Adwaita: needs-attention on sidebar-item
Unfortunatelly it doesn't animate (not my fault) and it just work
on GtkLabel (my fault).
2014-10-02 21:16:30 +02:00
Lapo Calamandrei
d2838a2408 Adwaita: selectors cleanup and some refactoring 2014-10-02 20:40:18 +02:00
Marek Kasik
8b5d30d439 Remove redundant checks for NULL
Remove checks for NULL before g_free() and g_clear_object().
Merge check for NULL, freeing of pointer and its setting
to NULL by g_clear_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=733157
2014-10-02 19:06:03 +02:00
Matthias Clasen
07722ae2dd GtkCellRendererAccel: Stop using deprecated API 2014-10-02 00:37:52 -04:00
Matthias Clasen
af4031d9fe GtkFontChooserWidget: Stop using deprecated API 2014-10-02 00:30:52 -04:00
Matthias Clasen
11015a49ae GtkColorEditor: Fix missing background in popups 2014-10-02 00:19:08 -04:00
Matthias Clasen
d26c8e0536 GtkColorEditor: Stop using deprecated API
This call was not needed at all.
2014-10-02 00:11:02 -04:00
Matthias Clasen
d6a467d48e GtkFontButton: Stop using deprecated API 2014-10-02 00:05:43 -04:00
Matthias Clasen
a2da26de04 GtkSidebar: not a listbox anymore
Applications are not expected to call GtkListBox API on a
sidebar, so don't make it one. Instead, make it have a
listbox.
2014-10-01 22:45:30 -04:00
Matthias Clasen
7b2e526c3a GtkCalendar: deal better with a large allocation
When allocated more than the requested height, GtkCalendar
was 'falling apart'. Not only was the main part rendered
at the far end of the allocation, clicking on days was
broken in this scenario.

Fix this by always placing the main part directly under
the header and day names.

https://bugzilla.gnome.org/show_bug.cgi?id=737670
2014-10-01 20:09:10 -04:00
Matthias Clasen
b46cef1809 Trivial formatting fix 2014-10-01 19:52:04 -04:00
Matthias Clasen
09551bf37a Fix a typo 2014-10-01 19:30:12 -04:00
Matthias Clasen
52c913156f Don't emit a useless warning
The warning may have had some value at some point, but if
people uninstall large icons just to make the warning go
away, it does more harm than good. So just remove it.
2014-10-01 13:17:14 -04:00
Matthias Clasen
7e9372bafa Fix fonts in context menus
Context menus inherit their style from the widget they are attached
to. This can have unexpected effects in particular for font, as can
be seen in gedit or gnome-calculator. Prevent this by resetting
the font of context-menus to the initial value.
2014-10-01 07:11:43 -04:00
Matthias Clasen
d0fb80d31b Avoid compiler warnings 2014-10-01 00:50:25 -04:00
Matthias Clasen
95d76d0132 Add a few missing include guards 2014-10-01 00:49:59 -04:00
Matthias Clasen
619aeb643f Provisional sidebar theming
needs-attention is not handled yet, here.
2014-10-01 00:46:13 -04:00
Ikey Doherty
cdd2651db0 Add GtkSidebar
GtkSidebar behaves internally much like GtkStackSwitcher, providing a vertical
sidebar like widget. It is virtually identical in appearance to the widget
currently used in GNOME Tweak Tool.

This widget is connected to a GtkStack, and builds its own contents as a
GtkListBox subclass, using the "title" child property to provide a consistent
navigatable widget.

Being a subclass of GtkListBox it benefits immediately from strong keyboard
navigation, and minimal changes are required for theming.

https://bugzilla.gnome.org/show_bug.cgi?id=735293

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2014-10-01 00:44:46 -04:00
Jasper St. Pierre
3b08ba24b3 reftests: Actually add a text-shadow to the text-shadow reftest
The reftest still passes, since the code still works, but we might as
well test what we claim to test.
2014-09-30 13:43:36 -06:00
Jasper St. Pierre
91d9ae1cc4 label: Don't add in the allocation to our clip again
_gtk_widget_set_simple_clip already takes the allocation into account,
so we don't need to do it here.
2014-09-30 13:43:36 -06:00
Alexandre Franke
3829554f3a Updated French translation 2014-09-30 17:50:27 +00:00
GNOME Translation Robot
c1ae4a2baf Updated Scottish Gaelic translation 2014-09-30 13:01:46 +00:00
Marek Černocký
da3cb153bc Updated Czech translation 2014-09-30 13:27:20 +02:00
Marek Černocký
563230b89d Updated Czech translation 2014-09-30 13:27:14 +02:00
Yosef Or Boczko
4bbcc4a397 Updated Hebrew translation 2014-09-30 13:58:17 +03:00
Chun-wei Fan
64fb9a6eb2 Update README.txt for MSVC Builds
Tell people that they need to download and install the Adwaita icon theme,
by following the instructions given on
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack.

Also tell people they can either use IJG JPEG or libjpeg-turbo for non-GDI+
builds of GDK-Pixbuf.
2014-09-30 13:01:17 +08:00
Matthias Clasen
558c6ea6b5 Better typography for ppd paper names
These often contain a <num>x<num> string, which we can display
nicer by rendering it as <num>×<num>.
2014-09-30 00:55:03 -04:00
Matthias Clasen
63efdca223 Deprecate GtkWidget override APIs
This is better done with css and style classes nowadays.
2014-09-30 00:08:59 -04:00
Matthias Clasen
61b636b8a4 Add 3.16 deprecation macros too 2014-09-30 00:03:25 -04:00
Matthias Clasen
aa3020a39e GtkContainer: Support focus chain in GtkBuilder
This adds support for a <focus-chain> element which can be
used to specify a custom focus order for the children of
a container.

https://bugzilla.gnome.org/show_bug.cgi?id=582799
2014-09-29 23:59:21 -04:00
Matthias Clasen
6d3c61856b GtkButton: Use GtkLabel:xalign 2014-09-29 23:57:13 -04:00
Matthias Clasen
811c4c699f GtkAssistant: Use GtkLabel:xalign 2014-09-29 23:56:20 -04:00
Matthias Clasen
059e33ecea Keep GtkMisc:xalign working for labels
Set the new label properties when gtk_misc_set_alignment is used,
to keep things working.
2014-09-29 23:56:20 -04:00
Matthias Clasen
a43e0177cf Revert "Undreprecate GtkMisc::x/yalign for now"
This reverts commit 29eae57be4.

We have GtkLabel:xalign now, so deprecate the GtkMisc property again.
2014-09-29 23:56:20 -04:00
Matthias Clasen
d39424fc1c GtkLabel: add x/yalign properties
Since it turns out that x/yalign can't be quite equivalently
replaced by h/valign, bring them back as label properties, so
we can eventually get rid of GtkMisc.

https://bugzilla.gnome.org/show_bug.cgi?id=735841
2014-09-29 23:56:20 -04:00
Matthias Clasen
c2330e7fd1 Add 3.16 version macros 2014-09-29 23:56:20 -04:00
Matthias Clasen
7182ae4f45 printing: Better typography
Use U+201C/U+201D for quoting.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
0192f3fe2d printing: Better typography
Use U+2013 for ranges.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
05a9006715 inspector: Better typography
Use U+201C/U+201D for quoting.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
0403d94d43 GtkRecentChooserMenu: Better typography
Avoid `' quoting.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
4866f0cec4 GtkPlacesSidebar: Be consistent in messages
Always quote drive/volume names.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
faa1909474 GtkFileChooserWidget: Better typography
No double space after .

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
3fc0c2a8ea GtkVolumeButton: Better typography
Use a small space before %. This matches what we do for percentages
elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
67b4f8ea75 GtkProgressBar: Mark the default text for translation
At the same time, use a small space before %.
This matches what is done in GtkCellRendererProgress.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
b3e1bb1654 Progress widgets: Better typography
Use a small space before %.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Matthias Clasen
e356841957 GtkBuilder: Improve error messages
No `' looks just terrible. For quoting in non-UI contexts, we
prefer either '' or "".

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:21 -04:00
Matthias Clasen
c7930417b4 GtkColorSelection: Better typography
Use U+201C/U+201D for quoting, and use U+2019 instead of apostrophe.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:21 -04:00
Matthias Clasen
9b5e70c9c2 Broadway: Improve formatting of an error message
https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:21 -04:00
Matthias Clasen
60f0445233 Printing: Better typography
Use U+007D MULTPLICATION SIGN for dimensions.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:20 -04:00
Matthias Clasen
972136803a GtkPrintUnixDialog: Better typography
Use U+2236 RATIO instead of ':' for times.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:20 -04:00
Matthias Clasen
60c7f22310 Use better typography for paper names
Use U+00D7 MULTIPLICATION SIGN instead of a plain old x in
paper names, following https://wiki.gnome.org/Design/OS/Typography.

This is a string change.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:20 -04:00
Matthias Clasen
5cd7a5282e Bump version 2014-09-29 22:14:49 -04:00
591 changed files with 103647 additions and 84028 deletions

View File

@@ -17,7 +17,7 @@ can be found here:
Information about using git with GNOME can be found here:
https://wiki.gnome.org/Git
http://live.gnome.org/Git
In order to get GIT GTK+ installed on your system, you need to have
the most recent GIT versions of GLib, Pango, and ATK installed as well.

View File

@@ -9,9 +9,13 @@ 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.
of other extensions) are required. The Wayland backend requires
(obviously) the Wayland libraries.
- gobject-introspection @INTROSPECTION_REQUIRED_VERSION@ or newer.

View File

@@ -33,11 +33,11 @@ MAINTAINERCLEANFILES = \
## Copy .pc files to target-specific names
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc: gtk+-3.0.pc
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc gtk+-mir-3.0.pc: gtk+-3.0.pc
rm -f $@ && \
cp gtk+-3.0.pc $@
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc: gdk-3.0.pc
gdk-x11-3.0.pc gdk-win32-3.0.pc gdk-quartz-3.0.pc gdk-broadway-3.0.pc gdk-wayland-3.0.pc gdk-mir-3.0.pc: gdk-3.0.pc
rm -f $@ && \
cp gdk-3.0.pc $@
@@ -59,12 +59,14 @@ DISTCLEANFILES = \
gtk+-quartz-3.0.pc \
gtk+-broadway-3.0.pc \
gtk+-wayland-3.0.pc \
gtk+-mir-3.0.pc \
gdk-3.0.pc \
gdk-x11-3.0.pc \
gdk-win32-3.0.pc \
gdk-quartz-3.0.pc \
gdk-broadway-3.0.pc \
gdk-wayland-3.0.pc \
gdk-mir-3.0.pc \
gail-3.0.pc \
config.lt

395
NEWS
View File

@@ -1,309 +1,140 @@
Overview of Changes in GTK+ 3.14.13 to 3.14.14
==============================================
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
* Bugs fixed:
693738 gtk print dialog shows "Getting printer information failed"...
738083 GtkMenuButton is not disabled even if corresponding GAction is
745957 GTK+/Quartz >= 3.14.8: Symbol not found: _gtk_drag_cancel (...
750011 Adwaita : missing background for menu
750605 icontheme: don't modify symbolic SVG dimensions when recoloring
750690 Recent Chooser Widget doesn't expand
750870 gtk3 does apparently ignore replayed events?
750994 X11: First mouse wheel event ignored after right click or Alt+Tab...
751050 Moving the mouse while a stepper is activated causes the scrollba...
751227 file picker list box height stretches to match extra widgets area...
751443 resource_path value cleared in gtk_image_set_from_resource
751739 Deadlock in X11 when setting XSetErrorHandler while another threa...
751752 Memleak when both opening shm and opening file in tmp fail
* Translation updates:
Icelandic
Occitan
Overview of Changes in GTK+ 3.14.12 to 3.14.13
==============================================
* Bugs fixed:
737175 most horizontal sliders are inverted when scrolled with wheel
747469 CSD: can't open window menu using right click after moving window
747553 Popovers inside local plugs don't get size_allocate() called
747805 Split Headerbar unmaximize
748061 GtkMessageDialog: Minor documentation update
748341 GdkOffscreenWindow should not segfault on gdk_window_beep()
GtkApplication: Prevent more crashes on shutdown
* Translation updates:
German
Icelandic
Overview of Changes in GTK+ 3.14.11 to 3.14.12
==============================================
* Bugs fixed:
744589 nautilus bookmarks changing places randomly
747539 popover: Remove signal handlers in dispose
Fix unwanted transparency of drag icons
Revert "image: Optimize non-resize changes"
Avoid a crash in GtkApplication
Avoid a crash with tree view rubberbanding
Make gtk-update-icon-cache more resilient
Overview of Changes in GTK+ 3.14.10 to 3.14.11
==============================================
* Bugs fixed:
734741 GtkScale's fill-level starts at the very left if show-fill-level...
737175 most horizontal sliders are inverted when scrolled with mouse wheel
746712 Range ignores the "inverted" property
746784 GtkBooleanCellAccessible emits state-changed:checked signals ins...
746817 GtkRadioButton keynav uses wrong succession
746821 W32: Maximized window is obscured by the taskbar
746862 popover clears shadow of underlying widgets
* Translation updates:
Czech
Overview of Changes in GTK+ 3.14.9 to 3.14.10
=============================================
* Bugs fixed:
613833 Unnecessary queue_resize() for GtkImage
669008 Kerberos authentication popup
671362 Fixes for GtkRadioMenuItem
703610 Problems with UC-Logic WA60 tablet
741511 Critical message: NULL is passed to g_object_unref() in spi_atk...
743323 avahi-discovered CUPS printers don't work
745225 eventcontroller: Don't crash if the widget is destroyed first
745829 crash when double-clicking close button while popover is visible
746253 has-tooltip property interferes with event-compression
746301 Opening "Sound" panel generates pixman error
746458 Inspector: show accessible name and description
746468 gtkcairoblur is slow
746586 crtical warnings in a11y if focus widget is destroyed
746602 Invalid writes through dangling weak pointers in DND code cause...
* Translation updates:
Bosnian
Czech
Dutch
Hungarian
Indonesian
Lithuanian
Polish
Serbian
Slovenian
Swedish
Turkish
Overview of Changes in GTK+ 3.14.8 to 3.14.9
============================================
* GtkScrolledWindow
- Avoid 'jumping' when zoom scrolling kicks in
- Make zoom scrolling less easy to trigger
* Bugs fixed:
743323 avahi-discovered CUPS printers don't work
744172 Wayland: Clients won't work on compositors that support wl_...
744683 Tooltips should have ATK_ROLE_TOOL_TIP (like they did before)
744942 quartz: Avoid segfaulting when calling gdk_window_ensure_native
744991 Fix loading of GResource SVGs
745052 Icon theme code assumes directories with mtime 0 don't exist
Fix crash and miscalculation in css bitmask manipulation
Fix a crash due to too large surfaces
Update on text scale factor changes
* Translation updates:
Slovenian
Turkish
Overview of Changes in GTK+ 3.14.7 to 3.14.8
============================================
* Bugs fixed:
613833 Unnecessary queue_resize() for GtkImage
732051 Crash can result if a child widget is destroyed while its tab is...
735316 Default font antialiasing results in wrong behavior on OS X
740613 XConvertSelection crashes Gtk+ apps
741259 gtkmodelmenuitem: force icon scaling
742181 "show images in menus" causes weird padding outside GNOME
742636 Freeze if window closed while resume-events pending
742664 Portabilitiy issues with GTK-Inspector 32-bit and non-gnome3 des...
742727 nautilus adding bookmark by dragging appear always at top
742764 Fix check for 'y' padding in gtk_cell_renderer_set_padding()
742771 Properly ignore BadWindow and BadDrawable in get_child_info_hand...
742774 Properly check result of g_utf8_get_char_validated()
742785 Fix event->button.y_root when using mouse buttons and dnd canceled
742786 Fix save_hot_y init in gtk_drag_get_icon()
742980 cannot start broadway on FreeBSD
743229 clipboard: support selection notification on wayland
743330 Wintab initialization glitches
743422 valgrind: Conditional jump or move depends on uninitialised valu...
743451 Drag and drop on GtkFileChooserButton doesn't work
743592 crash on link click in about dialogue
743593 GtkWidget's va_marshaller for "event-after" signal is incorrect
* Translation updates:
Icelandic
Overview of Changes in GTK+ 3.14.6 to 3.14.7
============================================
* Bugs fixed:
477454 libgtk crashed in gtk_notebook_button_release
705582 gtk_recent_manager_init fails to check settings==NULL
735122 GtkApplication: fix global menubar on Mac OS
739038 gtk_recent_manager_set_filename: assertion failed: (priv->fil...
739729 Bookmarks in sidebar sometimes randomly change their order
741130 Entry completion with multiple cells can size wrong on first ...
741652 Leaking menus when attaching to a button
741702 Right margin not respected with RTL text in non-wrapping mode...
741827 Typo in testsuite/reftests/Makefile.am causes build failure o...
741897 documentation fix
741969 GTK_STOCK_COPY
742010 GtkLabel eats thumb-button clicks
742170 cut/copy/paste binding entries are registered 2x
742311 On cellrenderertext, notify for "size" and "size-points" prop...
742343 Hide scrollbar in GtkFileChooser if appropriate
742631 Left padding on File Chooser List
742653 gtkfilechooserwidget: When using an extra widget, show or hid...
742664 Portabilitiy issues with GTK-Inspector 32-bit and non-gnome3 ...
GtkFileChooser: Don't crash if invisible files are deleted
* Translation updates:
British English
Kannada
Overview of Changes in GTK+ 3.14.5 to 3.14.6
============================================
* Bugs fixed:
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:
Greek
Overview of Changes in GTK+ 3.14.4 to 3.14.5
============================================
* Bugs fixed:
726316 Backdrop inconvenient on multimonitor for reading text
707695 GtkLevelBar Colour CSS
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`
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
739111 GtkFontChooserDialog fixes
739150 Dragging bookmark crashes nautilus
* Translation updates:
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.14.2 to 3.14.3
============================================
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
* 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"
738158 Flat context menu button
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
* 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
* Translation updates
Czech
French
German
Hebrew
Indonesian
Italian
Kazakh
Korean
Lithuanian
Norwegian bokmål
Russian
Persian
Polish
Scottish Gaelic
Spanish
Overview of Changes in GTK+ 3.14.0 to 3.14.1
============================================

View File

@@ -73,6 +73,12 @@ 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
======================
@@ -99,6 +105,14 @@ 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
======================

View File

@@ -166,7 +166,7 @@ Please refer to the following GNOME Live! page for a more detailed ouline
on the process of building the GTK+ stack and its dependencies with Visual
C++:
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack
Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from

View File

@@ -5,7 +5,7 @@ the use of the library.
A more detailed outline for instructions on building the GTK+ with Visual
C++ can be found in the following GNOME Live! page:
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack
This VS10 solution and the projects it includes are intented to be used
in a GTK+ source tree unpacked from a tarball. In a git checkout you

View File

@@ -89,7 +89,6 @@
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
@@ -114,7 +113,6 @@
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
@@ -137,7 +135,6 @@
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
@@ -161,7 +158,6 @@
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -147,7 +147,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
@@ -170,7 +169,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
@@ -190,7 +188,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -212,7 +209,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -237,7 +233,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
@@ -260,7 +255,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
@@ -280,7 +274,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -302,7 +295,6 @@
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -21,11 +21,9 @@
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;%(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;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>

View File

@@ -33,7 +33,7 @@ echo $(Configuration) &gt; ..\..\..\MSVC_$(Configuration)
:DONE_GDKCONFIG_H
</GenGdkConfigHWin32>
<GenGdkConfigHBroadway>
if exist ..\..\..\MSVC_$(Configuration)_Broadway goto DONE_GDKCONFIG_H
if exist ..\..\..\MSVC_$(Configuration) goto DONE_GDKCONFIG_H
if exist ..\..\..\gdk\gdkconfig.h del ..\..\..\gdk\gdkconfig.h
@@ -53,7 +53,7 @@ copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\gdk\gdkconfig.h
copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\GDK_BROADWAY_BUILD
echo $(Configuration) &gt; ..\..\..\MSVC_$(Configuration)_Broadway
echo $(Configuration) &gt; ..\..\..\MSVC_$(Configuration)
:DONE_GDKCONFIG_H
</GenGdkConfigHBroadway>

View File

@@ -11,69 +11,26 @@
<GtkDoInstallBin>
mkdir $(CopyDir)\bin
mkdir $(CopyDir)\lib
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\gailutil-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\gtk3-demo.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk3-demo.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk3-demo-application.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk3-demo-application.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk3-icon-browser.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk3-icon-browser.pdb" $(CopyDir)\bin
copy "$(BinDir)\gtk-encode-symbolic-svg.exe" $(CopyDir)\bin
copy "$(BinDir)\gtk-encode-symbolic-svg.pdb" $(CopyDir)\bin
copy "$(BinDir)\*.dll" $(CopyDir)\bin
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\*.exe" $(CopyDir)\bin
goto DONE_BIN
:DO_BROADWAY_BIN
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
:DO_BROADWAY_RELEASE
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
copy .\Release\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
goto DONE_BIN
:DO_BROADWAY_DEBUG
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
copy .\Debug\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin
:DONE_BIN
</GtkDoInstallBin>
<GtkDoInstall>
@@ -96,6 +53,7 @@ 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
@@ -215,6 +173,7 @@ 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
@@ -269,6 +228,7 @@ 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
@@ -283,6 +243,7 @@ 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

View File

@@ -89,7 +89,6 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
@@ -109,7 +108,6 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -134,7 +132,6 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
@@ -154,7 +151,6 @@
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -190,6 +190,7 @@
<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" />
@@ -213,6 +214,7 @@
<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" />

View File

@@ -32,6 +32,7 @@
<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>
@@ -55,6 +56,7 @@
<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>

View File

@@ -5,7 +5,7 @@ the use of the library.
A more detailed outline for instructions on building the GTK+ with Visual
C++ can be found in the following GNOME Live! page:
https://wiki.gnome.org/Projects/GTK+/Win32/MSVCCompilationOfGTKStack
https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack
This VS9 solution and the projects it includes are intented to be used
in a GTK+ source tree unpacked from a tarball. In a git checkout you

View File

@@ -12,11 +12,10 @@
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0"
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
ForcedIncludeFiles="msvc_recommended_pragmas.h"
AdditionalOptions="/MP"
/>
<Tool
Name="VCLinkerTool"
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"
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"
AdditionalLibraryDirectories="$(GlibEtcInstallRoot)\lib"
/>
<UserMacro

View File

@@ -36,7 +36,7 @@ echo $(ConfigurationName) &gt; ..\..\..\MSVC_$(ConfigurationName)&#x0D;&#x0A;
<UserMacro
Name="GenGdkConfigHBroadway"
Value="
if exist ..\..\..\MSVC_$(ConfigurationName)_Broadway goto DONE_GDKCONFIG_H&#x0D;&#x0A;
if exist ..\..\..\MSVC_$(ConfigurationName) goto DONE_GDKCONFIG_H&#x0D;&#x0A;
if exist ..\..\..\gdk\gdkconfig.h del ..\..\..\gdk\gdkconfig.h&#x0D;&#x0A;
if exist ..\..\..\GDK_WIN32ONLY_BUILD del ..\..\..\GDK_WIN32ONLY_BUILD&#x0D;&#x0A;
@@ -50,7 +50,7 @@ if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; del ..\..\..\M
copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\gdk\gdkconfig.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\GDK_BROADWAY_BUILD&#x0D;&#x0A;
echo $(ConfigurationName) &gt; ..\..\..\MSVC_$(ConfigurationName)_Broadway&#x0D;&#x0A;
echo $(ConfigurationName) &gt; ..\..\..\MSVC_$(ConfigurationName)&#x0D;&#x0A;
:DONE_GDKCONFIG_H&#x0D;&#x0A;
"
/>

View File

@@ -10,63 +10,26 @@
Value="
mkdir $(CopyDir)\bin&#x0D;&#x0A;
mkdir $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; goto DO_BROADWAY_BIN&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
goto DONE_BIN&#x0D;&#x0A;
:DO_BROADWAY_BIN&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.exe $(CopyDir)\bin&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; goto DO_BROADWAY_RELEASE&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; goto DO_BROADWAY_DEBUG&#x0D;&#x0A;
:DO_BROADWAY_RELEASE&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin&#x0D;&#x0A;
goto DONE_BIN&#x0D;&#x0A;
:DO_BROADWAY_DEBUG&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin&#x0D;&#x0A;
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Release_Broadway&quot; copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
if &quot;$(ConfigurationName)&quot; == &quot;Debug_Broadway&quot; copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin&#x0D;&#x0A;
:DONE_BIN&#x0D;&#x0A;
"
/>
@@ -92,6 +55,7 @@ copy ..\..\..\gdk\gdkdisplaymanager.h $(CopyDir)\include\gtk-3.0\gdk\gdkdisplaym
copy ..\..\..\gdk\gdkdnd.h $(CopyDir)\include\gtk-3.0\gdk\gdkdnd.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkevents.h $(CopyDir)\include\gtk-3.0\gdk\gdkevents.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkframetimings.h $(CopyDir)\include\gtk-3.0\gdk\gdkframetimings.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkglcontext.h $(CopyDir)\include\gtk-3.0\gdk\gdkglcontext.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkkeys.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeys.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkkeysyms.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms.h&#x0D;&#x0A;
copy ..\..\..\gdk\gdkkeysyms-compat.h $(CopyDir)\include\gtk-3.0\gdk\gdkkeysyms-compat.h&#x0D;&#x0A;
@@ -211,6 +175,7 @@ copy ..\..\..\gtk\gtkgesturerotate.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturero
copy ..\..\..\gtk\gtkgesturesingle.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturesingle.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkgestureswipe.h $(CopyDir)\include\gtk-3.0\gtk\gtkgestureswipe.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkgesturezoom.h $(CopyDir)\include\gtk-3.0\gtk\gtkgesturezoom.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkglarea.h $(CopyDir)\include\gtk-3.0\gtk\gtkglarea.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkgrid.h $(CopyDir)\include\gtk-3.0\gtk\gtkgrid.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkheaderbar.h $(CopyDir)\include\gtk-3.0\gtk\gtkheaderbar.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkicontheme.h $(CopyDir)\include\gtk-3.0\gtk\gtkicontheme.h&#x0D;&#x0A;
@@ -265,6 +230,7 @@ copy ..\..\..\gtk\gtkrecentchoosermenu.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecen
copy ..\..\..\gtk\gtkrecentchooserwidget.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentchooserwidget.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkrecentfilter.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentfilter.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkrecentmanager.h $(CopyDir)\include\gtk-3.0\gtk\gtkrecentmanager.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkrender.h $(CopyDir)\include\gtk-3.0\gtk\gtkrender.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkrevealer.h $(CopyDir)\include\gtk-3.0\gtk\gtkrevealer.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscale.h $(CopyDir)\include\gtk-3.0\gtk\gtkscale.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkscalebutton.h $(CopyDir)\include\gtk-3.0\gtk\gtkscalebutton.h&#x0D;&#x0A;
@@ -279,6 +245,7 @@ copy ..\..\..\gtk\gtkseparatormenuitem.h $(CopyDir)\include\gtk-3.0\gtk\gtksepar
copy ..\..\..\gtk\gtkseparatortoolitem.h $(CopyDir)\include\gtk-3.0\gtk\gtkseparatortoolitem.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksettings.h $(CopyDir)\include\gtk-3.0\gtk\gtksettings.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtkshow.h $(CopyDir)\include\gtk-3.0\gtk\gtkshow.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksidebar.h $(CopyDir)\include\gtk-3.0\gtk\gtksidebar.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksizegroup.h $(CopyDir)\include\gtk-3.0\gtk\gtksizegroup.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksizerequest.h $(CopyDir)\include\gtk-3.0\gtk\gtksizerequest.h&#x0D;&#x0A;
copy ..\..\..\gtk\gtksocket.h $(CopyDir)\include\gtk-3.0\gtk\gtksocket.h&#x0D;&#x0A;

View File

@@ -181,6 +181,7 @@
<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" />
@@ -204,6 +205,7 @@
<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" />

View File

@@ -23,9 +23,6 @@
/* 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 */

View File

@@ -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], [14])
m4_define([gtk_micro_version], [14])
m4_define([gtk_interface_age], [14])
m4_define([gtk_minor_version], [15])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -41,13 +41,15 @@ AC_CANONICAL_HOST
m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages
m4_define([glib_required_version], [2.41.2])
m4_define([glib_required_version], [2.43.0])
m4_define([pango_required_version], [1.36.7])
m4_define([atk_required_version], [2.12.0])
m4_define([cairo_required_version], [1.12.0])
m4_define([atk_required_version], [2.15.1])
m4_define([cairo_required_version], [1.14.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
@@ -329,6 +331,10 @@ AC_ARG_ENABLE(wayland-backend,
[AS_HELP_STRING([--enable-wayland-backend],
[enable the wayland gdk backend])],
[backend_set=yes])
AC_ARG_ENABLE(mir-backend,
[AS_HELP_STRING([--enable-mir-backend],
[enable the Mir gdk backend])],
[backend_set=yes])
if test -z "$backend_set"; then
if test "$platform_win32" = yes; then
@@ -336,6 +342,7 @@ if test -z "$backend_set"; then
else
enable_x11_backend=yes
enable_wayland_backend=maybe
enable_mir_backend=no
fi
fi
@@ -349,7 +356,8 @@ backend_immodules=
have_gio_unix=no
GDK_BACKENDS=
GDK_EXTRA_LIBS=
GDK_EXTRA_CFLAGS=
# expoxy.pc has Cflags: -I${includedir}, but pkg-config swallows that :-(
GDK_EXTRA_CFLAGS="-I${prefix}/include"
GDK_WINDOWING=
PANGO_PACKAGES="pango pangocairo"
@@ -426,7 +434,7 @@ fi
PKG_PROG_PKG_CONFIG
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version"
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl"
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])
@@ -457,6 +465,30 @@ 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#* }
@@ -477,6 +509,11 @@ else
fi
fi
AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
[Define if debugging is enabled])
# Build time sanity check...
AM_SANITY_CHECK
@@ -1306,22 +1343,11 @@ 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 $cairo_backends"
GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version"
if test "x$enable_x11_backend" = xyes; then
GDK_PRIVATE_PACKAGES="$GDK_PRIVATE_PACKAGES pangoft2"
fi
@@ -1358,7 +1384,7 @@ fi
PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES"
GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES"
if test "x$enable_x11_backend" = xyes; then
GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
fi
@@ -1665,6 +1691,16 @@ 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
##################################################
@@ -1702,7 +1738,7 @@ if test "$enable_man" != no; then
dnl check for DocBook XSL stylesheets in the local catalog
JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
[DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no])
if test "$have_docbook_style" != yes; then
if test "$have_docbook_dtd" != yes; then
if test "$enable_man" = yes ; then
AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-man])
fi
@@ -1898,6 +1934,7 @@ gdk/win32/rc/Makefile
gdk/win32/rc/gdk.rc
gdk/quartz/Makefile
gdk/wayland/Makefile
gdk/mir/Makefile
gdk/gdkversionmacros.h
gtk/Makefile
gtk/makefile.msc

View File

@@ -25,6 +25,7 @@ demos = \
event_axes.c \
expander.c \
gestures.c \
glarea.c \
headerbar.c \
hypertext.c \
iconview.c \
@@ -48,6 +49,7 @@ demos = \
rotated_text.c \
search_entry.c \
search_entry2.c \
sidebar.c \
sizegroup.c \
spinner.c \
stack.c \
@@ -73,6 +75,7 @@ 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

View File

@@ -20,12 +20,7 @@ draw_callback (GtkWidget *widget,
cairo_t *cr,
gpointer data)
{
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);
gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr);
return TRUE;
@@ -39,7 +34,6 @@ 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));
@@ -105,8 +99,6 @@ 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);

View File

@@ -259,18 +259,21 @@ 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))
{
gtk_widget_override_color (GTK_WIDGET (entry), 0, &error_color);
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);
return;
}
}
gtk_widget_override_color (GTK_WIDGET (entry), 0, NULL);
gtk_entry_set_attributes (GTK_ENTRY (entry), NULL);
}

View File

@@ -95,6 +95,7 @@
<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>
@@ -118,6 +119,7 @@
<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>

View File

@@ -142,11 +142,8 @@ static void
add_item (GtkWidget *button, gpointer data)
{
Item foo;
GtkTreeIter current, iter;
GtkTreePath *path;
GtkTreeModel *model;
GtkTreeViewColumn *column;
GtkTreeView *treeview = (GtkTreeView *)data;
GtkTreeIter iter;
GtkTreeModel *model = (GtkTreeModel *)data;
g_return_if_fail (articles != NULL);
@@ -155,26 +152,12 @@ add_item (GtkWidget *button, gpointer data)
foo.yummy = 50;
g_array_append_vals (articles, &foo, 1);
/* 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, &current, path);
gtk_tree_path_free (path);
/* Set the data for the new row */
gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, &current);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
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
@@ -385,7 +368,7 @@ do_editable_cells (GtkWidget *do_widget)
button = gtk_button_new_with_label ("Add item");
g_signal_connect (button, "clicked",
G_CALLBACK (add_item), treeview);
G_CALLBACK (add_item), items_model);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Remove item");

View File

@@ -12,18 +12,31 @@
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);

184
demos/gtk-demo/glarea.c Normal file
View File

@@ -0,0 +1,184 @@
/* 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;
}

View File

@@ -239,8 +239,8 @@ do_hypertext (GtkWidget *do_widget)
GtkWidget *sw;
GtkTextBuffer *buffer;
hand_cursor = gdk_cursor_new (GDK_HAND2);
regular_cursor = gdk_cursor_new (GDK_XTERM);
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);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),

View File

@@ -543,7 +543,7 @@ add_data_tab (const gchar *demoname)
* not an image. Let's try something else then.
*/
g_object_ref_sink (widget);
g_object_unref (widget);
gtk_widget_destroy (widget);
bytes = g_resources_lookup_data (resource_name, 0, NULL);
g_assert (bytes);
@@ -772,19 +772,53 @@ load_file (const gchar *demoname,
case 3:
/* Reading program body */
gtk_text_buffer_insert (source_buffer, &start, p, -1);
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
if (lines[i+1] != NULL)
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
break;
}
}
g_strfreev (lines);
fontify (source_buffer);
g_strfreev (lines);
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);
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
@@ -821,7 +855,6 @@ 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),
@@ -831,7 +864,10 @@ create_text (GtkWidget **view,
GTK_SHADOW_NONE);
*view = text_view = gtk_text_view_new ();
g_object_set (text_view, "margin", 20, NULL);
g_object_set (text_view,
"left-margin", 20,
"right-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);
@@ -840,22 +876,15 @@ create_text (GtkWidget **view,
if (is_source)
{
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);
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);
}
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;

View File

@@ -70,36 +70,41 @@
<property name="can_focus">False</property>
<property name="border_width">0</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="width_request">120</property>
<object class="GtkFrame">
<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="GtkTreeView" id="treeview">
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="width_request">120</property>
<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>
<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="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">column</property>
<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>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="style">4</attribute>
<attribute name="text">1</attribute>
</attributes>
<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>
</child>
</object>
</child>
@@ -128,10 +133,8 @@
<object class="GtkTextView" id="info-textview">
<property name="visible">True</property>
<property name="can_focus">True</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="left-margin">20</property>
<property name="right-margin">20</property>
<property name="pixels_above_lines">2</property>
<property name="pixels_below_lines">2</property>
<property name="editable">False</property>
@@ -165,10 +168,8 @@
<object class="GtkTextView" id="source-textview">
<property name="visible">True</property>
<property name="can_focus">True</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="left-margin">20</property>
<property name="right-margin">20</property>
<property name="editable">False</property>
<property name="cursor_visible">False</property>
</object>

View File

@@ -573,7 +573,6 @@ 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),
@@ -583,8 +582,6 @@ 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);

View File

@@ -181,8 +181,6 @@ 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));
@@ -195,18 +193,15 @@ 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);
/* This overrides the background color from the theme */
gtk_widget_override_background_color (drawing_area, 0, &white);
gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area),
GTK_STYLE_CLASS_VIEW);
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);

89
demos/gtk-demo/sidebar.c Normal file
View File

@@ -0,0 +1,89 @@
/* 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;
}

View File

@@ -539,26 +539,18 @@ recursive_attach_view (int depth,
GtkTextView *view,
GtkTextChildAnchor *anchor)
{
GtkWidget *child_view;
GtkWidget *event_box;
GdkRGBA color;
GtkWidget *child_view, *frame;
if (depth > 4)
return;
child_view = gtk_text_view_new_with_buffer (gtk_text_view_get_buffer (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);
/* Frame is to add a black border around each child view */
frame = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (frame), child_view);
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);
gtk_text_view_add_child_at_anchor (view, frame, anchor);
recursive_attach_view (depth + 1, GTK_TEXT_VIEW (child_view), anchor);
}

View File

@@ -190,7 +190,6 @@ do_transparent (GtkWidget *do_widget)
GtkWidget *sw;
GtkWidget *overlay;
GtkWidget *entry;
GdkRGBA transparent = {0, 0, 0, 0};
GtkCssProvider *provider;
gchar *css;
@@ -218,8 +217,6 @@ 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; }",

View File

@@ -1,3 +1,4 @@
#include <string.h>
#include "iconbrowserapp.h"
#include "iconbrowserwin.h"
#include <gtk/gtk.h>
@@ -51,7 +52,7 @@ enum {
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
static void
search_text_changed (GtkEntry *entry)
search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
{
const gchar *text;
@@ -59,6 +60,8 @@ search_text_changed (GtkEntry *entry)
if (text[0] == '\0')
return;
gtk_tree_model_filter_refilter (win->filter_model);
}
static void
@@ -191,6 +194,8 @@ 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);
@@ -671,11 +676,13 @@ populate (IconBrowserWindow *win)
}
static gboolean
key_press_event_cb (GtkWidget *widget,
GdkEvent *event,
GtkSearchBar *bar)
key_press_event_cb (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
return gtk_search_bar_handle_event (bar, event);
IconBrowserWindow *win = data;
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (win->searchbar), event);
}
static gboolean
@@ -687,8 +694,13 @@ 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
@@ -698,8 +710,12 @@ icon_visible_func (GtkTreeModel *model,
column, &name,
CONTEXT_COLUMN, &context,
-1);
visible = name != NULL && win->current_context != NULL && g_strcmp0 (context, win->current_context->id) == 0;
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;
g_free (name);
g_free (context);
@@ -726,6 +742,13 @@ 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)
{
@@ -733,16 +756,13 @@ 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);
@@ -778,6 +798,7 @@ 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 *

View File

@@ -16,6 +16,7 @@
<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>
@@ -47,7 +48,7 @@
</child>
<child>
<object class="GtkToggleButton" id="search">
<property name="visible">False</property>
<property name="visible">True</property>
<style>
<class name="image-button"/>
</style>
@@ -83,10 +84,11 @@
<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">
<signal name="search-changed" handler="search_text_changed"/>
<property name="visible">True</property>
<signal name="search-changed" handler="search_text_changed"/>
</object>
</child>
</object>

View File

@@ -18,12 +18,14 @@ gtk3_widget_factory_DEPENDENCIES = \
gtk3_widget_factory_CPPFLAGS = \
-I$(top_srcdir) \
$(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS)
$(GTK_DEP_CFLAGS) \
$(LIBCANBERRA_CFLAGS)
gtk3_widget_factory_LDADD = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-3.la \
$(GTK_DEP_LIBS)
$(GTK_DEP_LIBS) \
$(LIBCANBERRA_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 $<

View File

@@ -19,7 +19,12 @@
*/
#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,
@@ -234,7 +239,134 @@ 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
@@ -446,6 +578,82 @@ 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)
{
@@ -493,6 +701,7 @@ 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);
@@ -529,6 +738,9 @@ 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 {
@@ -549,7 +761,7 @@ background_loaded_cb (GObject *source,
pixbuf = gdk_pixbuf_new_from_stream_finish (res, &error);
if (error)
{
g_warning ("%s", error->message);
g_warning ("Error loading '%s': %s", bd->filename, error->message);
g_error_free (error);
return;
}
@@ -788,6 +1000,92 @@ 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)
{
@@ -795,9 +1093,11 @@ 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 },
@@ -817,8 +1117,23 @@ 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");
@@ -924,12 +1239,51 @@ 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);

View File

@@ -82,6 +82,7 @@
</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>
@@ -93,6 +94,20 @@
<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 -->
@@ -154,7 +169,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:
@@ -1037,7 +1052,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
<object class="GtkFileChooserButton" id="filechooserbutton1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="local_only">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1588,6 +1602,8 @@ 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>
@@ -2054,6 +2070,7 @@ 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">
@@ -2070,13 +2087,19 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
</packing>
</child>
<child>
<object class="GtkVolumeButton">
<object class="GtkScaleButton" id="mic-button">
<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>
@@ -2084,9 +2107,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
</packing>
</child>
</object>
</child>
@@ -2119,6 +2139,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </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>
@@ -2881,6 +2903,8 @@ 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>
@@ -3002,6 +3026,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </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>
@@ -3193,6 +3218,662 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </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>
@@ -3297,7 +3978,9 @@ 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="label">_Details</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">details_entry</property>
<style>
<class name="dim-label"/>
</style>
@@ -3310,7 +3993,7 @@ bad things might happen.</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="details_entry">
<property name="visible">True</property>
<property name="halign">fill</property>
<property name="valign">baseline</property>
@@ -3327,7 +4010,9 @@ bad things might happen.</property>
<property name="visible">True</property>
<property name="halign">end</property>
<property name="valign">baseline</property>
<property name="label">More Details</property>
<property name="label">More D_etails</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">more_details_entry</property>
<style>
<class name="dim-label"/>
</style>
@@ -3340,7 +4025,7 @@ bad things might happen.</property>
</packing>
</child>
<child>
<object class="GtkEntry">
<object class="GtkEntry" id="more_details_entry">
<property name="visible">True</property>
<property name="halign">fill</property>
<property name="valign">baseline</property>
@@ -3357,7 +4042,9 @@ 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="label">_Level</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">level_scale</property>
<style>
<class name="dim-label"/>
</style>
@@ -3370,7 +4057,7 @@ bad things might happen.</property>
</packing>
</child>
<child>
<object class="GtkScale">
<object class="GtkScale" id="level_scale">
<property name="visible">True</property>
<property name="halign">fill</property>
<property name="valign">baseline</property>
@@ -3389,7 +4076,9 @@ 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="label">_Mode</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">mode_switch</property>
<style>
<class name="dim-label"/>
</style>
@@ -3402,7 +4091,7 @@ bad things might happen.</property>
</packing>
</child>
<child>
<object class="GtkSwitch">
<object class="GtkSwitch" id="mode_switch">
<property name="visible">True</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
@@ -3460,7 +4149,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>

View File

@@ -32,6 +32,7 @@
<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" />
@@ -92,6 +93,10 @@
<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>

View File

@@ -394,6 +394,8 @@ 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
@@ -617,6 +619,7 @@ 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>
@@ -1004,6 +1007,7 @@ 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
@@ -1123,6 +1127,11 @@ 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
@@ -1273,3 +1282,27 @@ 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>

View File

@@ -8,6 +8,7 @@ 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

View File

@@ -84,6 +84,7 @@ IGNORE_HFILES= \
gtktextbufferserializ.h \
gtktextchildprivate.h \
gtktextdisplay.h \
gtktexthandleprivate.h \
gtktextiterprivate.h \
gtktextlayout.h \
gtktextmarkprivate.h \
@@ -145,6 +146,7 @@ content_files = \
osx.sgml \
broadway.xml \
wayland.xml \
mir.xml \
question_index.sgml \
resources.sgml \
text_widget.sgml \
@@ -205,6 +207,7 @@ 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 \
@@ -236,6 +239,7 @@ 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 \

View File

@@ -202,7 +202,7 @@ How to compile GTK+ itself
</listitem>
<listitem>
<para>
<ulink url="https://wiki.gnome.org/Projects/GObjectIntrospection">Gobject Introspection</ulink>
<ulink url="http://live.gnome.org/GObjectIntrospection">Gobject Introspection</ulink>
is a framework for making introspection data available to
language bindings. It is available
<ulink url="http://download.gnome.org/sources/gobject-introspection/">here</ulink>.
@@ -254,6 +254,19 @@ 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>
@@ -394,6 +407,11 @@ How to compile GTK+ itself
<arg choice="plain">--disable-wayland-backend</arg>
</group>
<sbr/>
<group>
<arg choice="plain">--enable-mir-backend</arg>
<arg choice="plain">--disable-mir-backend</arg>
</group>
<sbr/>
<group>
<arg choice="plain">--enable-introspection=[no/auto/yes]</arg>
</group>
@@ -595,8 +613,10 @@ How to compile GTK+ itself
<systemitem>--disable-quartz-backend</systemitem>,
<systemitem>--enable-broadway-backend</systemitem>,
<systemitem>--disable-broadway-backend</systemitem>,
<systemitem>--enable-wayland-backend</systemitem>, and
<systemitem>--disable-wayland-backend</systemitem></title>
<systemitem>--enable-wayland-backend</systemitem>,
<systemitem>--disable-wayland-backend</systemitem>
<systemitem>--enable-mir-backend</systemitem>, and
<systemitem>--disable-mir-backend</systemitem></title>
<para>
Enables specific backends for GDK. If none of these options

View File

@@ -76,6 +76,7 @@
<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" />
@@ -113,6 +114,7 @@
<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">
@@ -190,6 +192,7 @@
<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">
@@ -241,6 +244,7 @@
<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" />
@@ -414,6 +418,7 @@
<xi:include href="osx.sgml" />
<xi:include href="broadway.xml" />
<xi:include href="wayland.xml" />
<xi:include href="mir.xml" />
</part>
<xi:include href="glossary.xml" />
@@ -458,6 +463,10 @@
<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>

View File

@@ -2085,6 +2085,8 @@ 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
@@ -2102,6 +2104,8 @@ 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
@@ -2589,6 +2593,8 @@ 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
@@ -3148,6 +3154,8 @@ 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
@@ -3539,6 +3547,7 @@ 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
@@ -3625,9 +3634,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>
@@ -3779,6 +3788,7 @@ 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>
@@ -3829,7 +3839,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
@@ -3884,6 +3894,8 @@ 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
@@ -5735,6 +5747,7 @@ 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>
@@ -5996,6 +6009,7 @@ 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
@@ -6006,11 +6020,13 @@ 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
@@ -6030,6 +6046,7 @@ 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
@@ -6041,6 +6058,7 @@ 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
@@ -6155,6 +6173,7 @@ 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
@@ -6509,7 +6528,6 @@ gtk_drag_unhighlight
<SUBSECTION Source Side>
gtk_drag_begin
gtk_drag_begin_with_coordinates
gtk_drag_cancel
gtk_drag_set_icon_widget
gtk_drag_set_icon_pixbuf
gtk_drag_set_icon_stock
@@ -7134,6 +7152,7 @@ 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
@@ -7144,6 +7163,7 @@ 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
@@ -7827,6 +7847,10 @@ 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
@@ -7932,6 +7956,22 @@ 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>
@@ -8156,3 +8196,46 @@ 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>

View File

@@ -90,6 +90,7 @@ 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
@@ -125,6 +126,7 @@ 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
@@ -138,6 +140,7 @@ 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
@@ -170,6 +173,7 @@ 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.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk-mir">
<refmeta>
<refentrytitle>Using GTK+ with Mir</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Using GTK+ with Mir</refname>
<refpurpose>
Mir-specific aspects of using GTK+
</refpurpose>
</refnamediv>
<refsect1>
<title>Using GTK+ with Mir</title>
<para>
The GDK Mir backend provides support for running GTK+ applications
under Mir based display servers. To run your application in this way,
select the Mir backend by setting <literal>GDK_BACKEND=mir</literal>.
</para>
<para>
Currently, the Mir backend does not use any additional commandline
options or environment variables.
</para>
</refsect1>
</refentry>

View File

@@ -31,7 +31,7 @@ or environment variables.
<para>
For up-to-date information about the current status of this port, see the
<ulink url="https://wiki.gnome.org/Projects/GTK+/OSX">project page</ulink>.
<ulink url="http://live.gnome.org/GTK+/OSX">project page</ulink>.
</para>
</refsect1>

View File

@@ -399,6 +399,10 @@ 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>
@@ -487,6 +491,11 @@ nevertheless.
<listitem><para>Selects the Wayland backend for connecting to Wayland display servers</para></listitem>
</varlistentry>
<varlistentry>
<term>mir</term>
<listitem><para>Selects the Mir backend for connecting to Mir display servers</para></listitem>
</varlistentry>
</variablelist>
Since 3.10, this environment variable can contain a comma-separated list
of backend names, which are tried in order. The list may also contain

View File

@@ -42,6 +42,9 @@
<link linkend="GtkScale">
<inlinegraphic fileref="scales.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkGLArea">
<inlinegraphic fileref="glarea.png" format="PNG"></inlinegraphic>
</link>
</para>
</section>
@@ -141,6 +144,9 @@
<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>

View File

@@ -110,7 +110,7 @@ in 256 color mode.
<para>
More information about GTK+ on Windows, including detailed build
instructions, binary downloads, etc, can be found
<ulink url="https://wiki.gnome.org/Projects/GTK+/Win32">online</ulink>.
<ulink url="http://live.gnome.org/GTK+/Win32">online</ulink>.
</para>
</refsect1>

View File

@@ -5,6 +5,7 @@ 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)
@@ -30,7 +31,9 @@ doc_shooter_SOURCES= \
shadow.h \
shooter.c \
widgets.c \
widgets.h
widgets.h \
$(top_srcdir)/tests/gtkgears.c \
$(top_srcdir)/tests/gtkgears.h
clean-local:
for file in *.png; do \

View File

@@ -8,6 +8,7 @@
#include <X11/Xatom.h>
#include <gdkx.h>
#include "widgets.h"
#include "gtkgears.h"
#define SMALL_WIDTH 240
#define SMALL_HEIGHT 75
@@ -1385,6 +1386,41 @@ 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)
{
@@ -1480,6 +1516,24 @@ 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)
{
@@ -1544,6 +1598,8 @@ 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;
}

View File

@@ -208,7 +208,9 @@ 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

View File

@@ -13,7 +13,7 @@ INTROSPECTION_COMPILER_ARGS = \
SUBDIRS = $(GDK_BACKENDS) .
DIST_SUBDIRS = win32 x11 quartz broadway wayland
DIST_SUBDIRS = win32 x11 quartz broadway wayland mir
CLEANFILES =
@@ -71,6 +71,7 @@ gdk_public_h_sources = \
gdkdnd.h \
gdkevents.h \
gdkframetimings.h \
gdkglcontext.h \
gdkkeys.h \
gdkkeysyms.h \
gdkkeysyms-compat.h \
@@ -98,6 +99,7 @@ gdk_h_sources = \
$(deprecated_h_sources)
gdk_private_headers = \
gdk-private.h \
gdkapplaunchcontextprivate.h \
gdkcursorprivate.h \
gdkdevicemanagerprivate.h \
@@ -107,6 +109,7 @@ gdk_private_headers = \
gdkdndprivate.h \
gdkframeclockidle.h \
gdkframeclockprivate.h \
gdkglcontextprivate.h \
gdkscreenprivate.h \
gdkinternals.h \
gdkintl.h \
@@ -119,6 +122,7 @@ deprecated_c_sources = \
gdk_c_sources = \
$(deprecated_c_sources) \
gdk-private.c \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
@@ -131,6 +135,8 @@ gdk_c_sources = \
gdkdnd.c \
gdkevents.c \
gdkframetimings.c \
gdkgl.c \
gdkglcontext.c \
gdkglobals.c \
gdkkeys.c \
gdkkeyuni.c \
@@ -201,6 +207,10 @@ if USE_WAYLAND
libgdk_3_la_LIBADD += wayland/libgdk-wayland.la
endif
if USE_MIR
libgdk_3_la_LIBADD += mir/libgdk-mir.la
endif
if HAVE_INTROSPECTION
introspection_files = \

View File

@@ -819,33 +819,19 @@ map_named_shm (char *name, gsize size)
int fd;
void *ptr;
char *filename = NULL;
fd = shm_open (name, O_RDONLY, 0600);
fd = shm_open(name, O_RDONLY, 0600);
if (fd == -1)
{
filename = g_build_filename (g_get_tmp_dir (), name, NULL);
fd = open (filename, O_RDONLY);
if (fd == -1)
{
perror ("Failed to map shm");
g_free (filename);
return NULL;
}
perror ("Failed to shm_open");
return NULL;
}
ptr = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0);
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
(void) close (fd);
(void) close(fd);
if (filename)
{
unlink (filename);
g_free (filename);
}
else
shm_unlink (name);
shm_unlink (name);
return ptr;
@@ -1401,8 +1387,7 @@ broadway_server_destroy_window (BroadwayServer *server,
g_hash_table_remove (server->id_ht,
GINT_TO_POINTER (id));
if (window->cached_surface_name != NULL)
g_free (window->cached_surface_name);
g_free (window->cached_surface_name);
if (window->cached_surface != NULL)
cairo_surface_destroy (window->cached_surface);
@@ -1762,8 +1747,7 @@ broadway_server_open_surface (BroadwayServer *server,
cairo_surface_set_user_data (surface, &shm_cairo_key,
data, shm_data_unmap);
if (window->cached_surface_name != NULL)
g_free (window->cached_surface_name);
g_free (window->cached_surface_name);
window->cached_surface_name = g_strdup (name);
if (window->cached_surface != NULL)

View File

@@ -452,11 +452,10 @@ main (int argc, char *argv[])
if (display == NULL)
{
#ifdef G_OS_UNIX
if (g_unix_socket_address_abstract_names_supported ())
display = ":0";
else
display = ":0";
#else
display = ":tcp";
#endif
display = ":tcp";
}
if (g_str_has_prefix (display, ":tcp"))

View File

@@ -110,11 +110,10 @@ _gdk_broadway_server_new (const char *display, GError **error)
if (display == NULL)
{
#ifdef G_OS_UNIX
if (g_unix_socket_address_abstract_names_supported ())
display = ":0";
else
display = ":0";
#else
display = ":tcp";
#endif
display = ":tcp";
}
if (g_str_has_prefix (display, ":tcp"))
@@ -141,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;
}
@@ -524,11 +523,10 @@ _gdk_broadway_server_window_set_transient_for (GdkBroadwayServer *server,
}
static void *
map_named_shm (char *name, gsize size, gboolean *is_shm)
map_named_shm (char *name, gsize size)
{
#ifdef G_OS_UNIX
char *filename = NULL;
int fd;
void *ptr;
int res;
@@ -536,40 +534,23 @@ map_named_shm (char *name, gsize size, gboolean *is_shm)
fd = shm_open(name, O_RDWR|O_CREAT|O_EXCL, 0600);
if (fd == -1)
{
if (errno == EEXIST)
return NULL;
filename = g_build_filename (g_get_tmp_dir (), name, NULL);
fd = open (filename, O_RDWR | O_CREAT | O_EXCL, 0600);
g_free (filename);
if (fd == -1)
{
if (errno != EEXIST)
g_error ("Unable to allocate shared mem for window");
return NULL;
}
else
*is_shm = FALSE;
if (errno != EEXIST)
g_error ("Unable to allocate shared mem for window");
return NULL;
}
else
*is_shm = TRUE;
res = ftruncate (fd, size);
g_assert (res != -1);
#ifdef HAVE_POSIX_FALLOCATE
res = posix_fallocate (fd, 0, size);
if (res != 0 && errno == ENOSPC)
if (res != 0)
{
if (filename)
unlink (filename);
else
shm_unlink (name);
shm_unlink (name);
g_error ("Not enough shared memory for window surface");
}
#endif
ptr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
(void) close(fd);
@@ -597,7 +578,6 @@ map_named_shm (char *name, gsize size, gboolean *is_shm)
return NULL;
}
*is_shm = TRUE;
res = ftruncate (fd, size);
g_assert (res != -1);
@@ -633,7 +613,7 @@ make_valid_fs_char (char c)
/* name must have at least space for 34 bytes */
static gpointer
create_random_shm (char *name, gsize size, gboolean *is_shm)
create_random_shm (char *name, gsize size)
{
guint32 r;
int i, o;
@@ -657,7 +637,7 @@ create_random_shm (char *name, gsize size, gboolean *is_shm)
}
name[o++] = 0;
ptr = map_named_shm (name, size, is_shm);
ptr = map_named_shm (name, size);
if (ptr)
return ptr;
}
@@ -669,7 +649,6 @@ typedef struct {
char name[36];
void *data;
gsize data_size;
gboolean is_shm;
} BroadwayShmSurfaceData;
static void
@@ -680,14 +659,7 @@ shm_data_destroy (void *_data)
#ifdef G_OS_UNIX
munmap (data->data, data->data_size);
if (data->is_shm)
shm_unlink (data->name);
else
{
char *filename = g_build_filename (g_get_tmp_dir (), data->name, NULL);
unlink (filename);
g_free (filename);
}
shm_unlink (data->name);
#elif defined(G_OS_WIN32)
@@ -716,7 +688,7 @@ _gdk_broadway_server_create_surface (int width,
data = g_new (BroadwayShmSurfaceData, 1);
data->data_size = width * height * sizeof (guint32);
data->data = create_random_shm (data->name, data->data_size, &data->is_shm);
data->data = create_random_shm (data->name, data->data_size);
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
CAIRO_FORMAT_ARGB32, width, height, width * sizeof (guint32));

View File

@@ -344,7 +344,7 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
GdkWindow *root_window;
GdkWindow *window;
screen = gdk_screen_get_default ();
screen = gdk_display_get_default_screen (gdk_device_get_display (device));
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);

View File

@@ -330,19 +330,6 @@ 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)
{
@@ -398,8 +385,6 @@ 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;

View File

@@ -92,14 +92,31 @@ gdk_event_source_check (GSource *source)
void
_gdk_broadway_events_got_input (BroadwayInputMsg *message)
{
GdkDisplay *display = gdk_display_get_default ();
GdkBroadwayDisplay *display_broadway = GDK_BROADWAY_DISPLAY (display);
GdkDisplay *display;
GdkBroadwayDisplay *display_broadway;
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) {

View File

@@ -15,8 +15,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_BROADWAY_EVENT_SOURCE_H__
#define __GDK_BROADWAY_EVENT_SOURCE_H__
#ifndef __GDK_EVENT_SOURCE_H__
#define __GDK_EVENT_SOURCE_H__
#include "gdkprivate-broadway.h"
@@ -29,4 +29,4 @@ GSource * _gdk_broadway_event_source_new (GdkDisplay *display);
G_END_DECLS
#endif /* __GDK_BROADWAY_EVENT_SOURCE_H__ */
#endif /* __GDK_EVENT_SOURCE_H__ */

View File

@@ -28,6 +28,8 @@
#include "gdkwindow-broadway.h"
#include "gdkscreen-broadway.h"
#include "gdkbroadwaydisplay.h"
#include "gdkdisplay.h"
#include "gdkwindow.h"
#include "gdkwindowimpl.h"
#include "gdkdisplay-broadway.h"
@@ -81,6 +83,28 @@ 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)
{
@@ -88,7 +112,8 @@ update_dirty_windows_and_sync (void)
GdkBroadwayDisplay *display;
gboolean updated_surface;
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
display = GDK_BROADWAY_DISPLAY (find_broadway_display ());
g_assert (display != NULL);
updated_surface = FALSE;
for (l = display->toplevels; l != NULL; l = l->next)
@@ -120,7 +145,7 @@ flush_idle (gpointer data)
{
flush_id = 0;
gdk_display_flush (gdk_display_get_default ());
gdk_display_flush (find_broadway_display ());
return FALSE;
}
@@ -987,13 +1012,6 @@ 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
@@ -1129,12 +1147,7 @@ finish_drag (MoveResizeData *mv_resize)
mv_resize->moveresize_emulation_window = NULL;
g_object_unref (mv_resize->moveresize_window);
mv_resize->moveresize_window = NULL;
if (mv_resize->moveresize_pending_event)
{
g_free (mv_resize->moveresize_pending_event);
mv_resize->moveresize_pending_event = NULL;
}
g_clear_pointer (&mv_resize->moveresize_pending_event, g_free);
}
static gboolean
@@ -1514,7 +1527,6 @@ 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;

View File

@@ -61,24 +61,24 @@ struct _GdkColor
#define GDK_TYPE_COLOR (gdk_color_get_type ())
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_get_type)
GDK_DEPRECATED_IN_3_14
GType gdk_color_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_copy)
GDK_DEPRECATED_IN_3_14
GdkColor *gdk_color_copy (const GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_free)
GDK_DEPRECATED_IN_3_14
void gdk_color_free (GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_hash)
GDK_DEPRECATED_IN_3_14
guint gdk_color_hash (const GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_equal)
GDK_DEPRECATED_IN_3_14
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_parse)
GDK_DEPRECATED_IN_3_14
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_to_string)
GDK_DEPRECATED_IN_3_14
gchar * gdk_color_to_string (const GdkColor *color);

23
gdk/gdk-private.c Normal file
View File

@@ -0,0 +1,23 @@
#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;
}

64
gdk/gdk-private.h Normal file
View File

@@ -0,0 +1,64 @@
#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__ */

View File

@@ -30,6 +30,8 @@
#include "gdkinternals.h"
#include "gdkintl.h"
#include "gdk-private.h"
#ifndef HAVE_XCONVERTCASE
#include "gdkkeysyms.h"
#endif
@@ -134,6 +136,15 @@ 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},
@@ -148,7 +159,8 @@ static const GDebugKey gdk_debug_keys[] = {
{"draw", GDK_DEBUG_DRAW},
{"eventloop", GDK_DEBUG_EVENTLOOP},
{"frames", GDK_DEBUG_FRAMES},
{"settings", GDK_DEBUG_SETTINGS}
{"settings", GDK_DEBUG_SETTINGS},
{"opengl", GDK_DEBUG_OPENGL},
};
static gboolean
@@ -229,23 +241,33 @@ 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)
{
g_option_group_add_entries (group, gdk_args);
gdk_add_option_entries (group);
}
void
gdk_pre_parse_libgtk_only (void)
gdk_pre_parse (void)
{
const char *rendering_mode;
const gchar *gl_string;
gdk_initialized = TRUE;
@@ -266,6 +288,12 @@ gdk_pre_parse_libgtk_only (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"
@@ -285,6 +313,20 @@ gdk_pre_parse_libgtk_only (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:
@@ -313,7 +355,7 @@ gdk_parse_args (int *argc,
if (gdk_initialized)
return;
gdk_pre_parse_libgtk_only ();
gdk_pre_parse ();
option_context = g_option_context_new (NULL);
g_option_context_set_ignore_unknown_options (option_context, TRUE);
@@ -372,8 +414,8 @@ gdk_get_display_arg_name (void)
return _gdk_display_arg_name;
}
/**
* gdk_display_open_default_libgtk_only:
/*< private >
* gdk_display_open_default:
*
* Opens the default display specified by command line arguments or
* environment variables, sets it as the default display, and returns
@@ -383,9 +425,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_libgtk_only (void)
gdk_display_open_default (void)
{
GdkDisplay *display;
@@ -400,6 +442,27 @@ gdk_display_open_default_libgtk_only (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.
@@ -422,7 +485,7 @@ gdk_init_check (int *argc,
{
gdk_parse_args (argc, argv);
return gdk_display_open_default_libgtk_only () != NULL;
return gdk_display_open_default () != NULL;
}

View File

@@ -41,6 +41,7 @@
#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>

View File

@@ -185,9 +185,6 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
int n_channels;
int j;
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
return;
/* This function can't just copy any pixbuf to any surface, be
* sure to read the invariants here before calling it */
@@ -528,3 +525,38 @@ 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;
}

View File

@@ -70,6 +70,17 @@ 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

View File

@@ -192,11 +192,13 @@ 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);
}
/**
@@ -448,9 +450,7 @@ 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);

View File

@@ -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_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
GDK_AVAILABLE_IN_ALL
GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display,

View File

@@ -313,8 +313,7 @@ gdk_device_set_property (GObject *object,
device->manager = g_value_get_object (value);
break;
case PROP_NAME:
if (device->name)
g_free (device->name);
g_free (device->name);
device->name = g_value_dup_string (value);
break;
@@ -689,6 +688,7 @@ 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,7 +698,6 @@ 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;
}
@@ -1261,6 +1260,8 @@ 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.
@@ -1292,8 +1293,9 @@ gdk_device_grab (GdkDevice *device,
GdkGrabStatus res;
GdkWindow *native;
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_SUCCESS);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_SUCCESS);
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);
native = gdk_window_get_toplevel (window);
@@ -1477,8 +1479,7 @@ void
_gdk_device_set_keys (GdkDevice *device,
guint num_keys)
{
if (device->keys)
g_free (device->keys);
g_free (device->keys);
device->num_keys = num_keys;
device->keys = g_new0 (GdkDeviceKey, num_keys);

View File

@@ -265,7 +265,7 @@ void gdk_device_warp (GdkDevice *device,
gint x,
gint y);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,

View File

@@ -24,6 +24,8 @@
#include "gdkdisplay.h"
#include "gdkdisplayprivate.h"
#include "gdk-private.h"
#include "gdkdeviceprivate.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkevents.h"
@@ -110,6 +112,19 @@ 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)
{
@@ -123,6 +138,8 @@ 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:
@@ -206,6 +223,8 @@ 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
@@ -1278,8 +1297,8 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
}
}
/**
* gdk_device_grab_info_libgtk_only:
/*< private >
* gdk_device_grab_info:
* @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
@@ -1292,12 +1311,12 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
*
* Returns: %TRUE if this application currently has the
* keyboard grabbed.
**/
*/
gboolean
gdk_device_grab_info_libgtk_only (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,
gboolean *owner_events)
gdk_device_grab_info (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,
gboolean *owner_events)
{
GdkDeviceGrabInfo *info;
@@ -1319,6 +1338,33 @@ gdk_device_grab_info_libgtk_only (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
@@ -1714,6 +1760,9 @@ 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)
@@ -2225,3 +2274,48 @@ 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;
}

View File

@@ -123,7 +123,7 @@ void gdk_display_warp_pointer (GdkDisplay *disp
gint y);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
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_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
gboolean gdk_display_supports_composite (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL
void gdk_display_notify_startup_complete (GdkDisplay *display,

View File

@@ -60,6 +60,10 @@
#include "wayland/gdkprivate-wayland.h"
#endif
#ifdef GDK_WINDOWING_MIR
#include "mir/gdkmir-private.h"
#endif
/**
* SECTION:gdkdisplaymanager
* @Short_description: Maintains a list of all open GdkDisplays
@@ -272,6 +276,9 @@ static GdkBackend gdk_backends[] = {
#ifdef GDK_WINDOWING_WAYLAND
{ "wayland", _gdk_wayland_display_open },
#endif
#ifdef GDK_WINDOWING_MIR
{ "mir", _gdk_mir_display_open },
#endif
#ifdef GDK_WINDOWING_BROADWAY
{ "broadway", _gdk_broadway_display_open },
#endif

View File

@@ -21,6 +21,7 @@
#include "gdkdisplay.h"
#include "gdkwindow.h"
#include "gdkcursor.h"
#include "gdkinternals.h"
G_BEGIN_DECLS
@@ -116,6 +117,14 @@ 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
@@ -225,6 +234,9 @@ 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,
@@ -303,6 +315,9 @@ 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__ */

View File

@@ -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>

View File

@@ -461,6 +461,15 @@ 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.
@@ -476,10 +485,7 @@ gdk_event_put (const GdkEvent *event)
g_return_if_fail (event != NULL);
if (event->any.window)
display = gdk_window_get_display (event->any.window);
else
display = gdk_display_get_default ();
display = event_get_display (event);
gdk_display_put_event (display, event);
}
@@ -713,7 +719,7 @@ gdk_event_copy (const GdkEvent *event)
}
if (gdk_event_is_allocated (event))
_gdk_display_event_data_copy (gdk_display_get_default (), event, new_event);
_gdk_display_event_data_copy (event_get_display (event), event, new_event);
return new_event;
}
@@ -734,9 +740,6 @@ 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:
@@ -804,10 +807,13 @@ gdk_event_free (GdkEvent *event)
break;
}
display = gdk_display_get_default ();
display = event_get_display (event);
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);
}

View File

@@ -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

View File

@@ -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 Normal file
View File

@@ -0,0 +1,746 @@
/* 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 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);
window_height = gdk_window_get_height (impl_window);
glDrawBuffer (GL_BACK);
#define FLIP_Y(_y) (window_height*window_scale - (_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 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);
window_height = gdk_window_get_height (impl_window);
#define FLIP_Y(_y) (window_height*window_scale - (_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 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);
window_height = gdk_window_get_height (window);
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, (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) (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) * window_scale,
(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);
}

575
gdk/gdkglcontext.c Normal file
View File

@@ -0,0 +1,575 @@
/* 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;
}

61
gdk/gdkglcontext.h Normal file
View File

@@ -0,0 +1,61 @@
/* 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__ */

78
gdk/gdkglcontextprivate.h Normal file
View File

@@ -0,0 +1,78 @@
/* 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 (* update) (GdkGLContext *context);
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__ */

View File

@@ -34,4 +34,5 @@ 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;

View File

@@ -84,7 +84,8 @@ typedef enum {
GDK_DEBUG_DRAW = 1 << 9,
GDK_DEBUG_EVENTLOOP = 1 << 10,
GDK_DEBUG_FRAMES = 1 << 11,
GDK_DEBUG_SETTINGS = 1 << 12
GDK_DEBUG_SETTINGS = 1 << 12,
GDK_DEBUG_OPENGL = 1 << 13,
} GdkDebugFlag;
typedef enum {
@@ -93,11 +94,21 @@ 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
@@ -208,18 +219,33 @@ 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;
@@ -240,7 +266,6 @@ struct _GdkWindow
guint in_update : 1;
guint geometry_dirty : 1;
guint event_compression : 1;
guint frame_clock_events_paused : 1;
/* The GdkWindow that has the impl, ref:ed if another window.
* This ref is required to keep the wrapper of the impl window alive
@@ -321,8 +346,20 @@ 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);
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);
/*************************************
* Interfaces used by windowing code *
@@ -336,6 +373,9 @@ 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_process_updates_recurse (GdkWindow *window,
cairo_region_t *expose_region);

View File

@@ -49,9 +49,9 @@ void gdk_init (gint *argc,
GDK_AVAILABLE_IN_ALL
gboolean gdk_init_check (gint *argc,
gchar ***argv);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
void gdk_pre_parse_libgtk_only (void);
GDK_AVAILABLE_IN_ALL

View File

@@ -515,13 +515,6 @@ 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,
@@ -676,12 +669,6 @@ gdk_offscreen_window_set_opacity (GdkWindow *window, gdouble opacity)
{
}
static gboolean
gdk_offscreen_window_beep (GdkWindow *window)
{
return FALSE;
}
static void
gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
{
@@ -709,13 +696,12 @@ 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;
impl_class->get_shape = NULL;
impl_class->get_input_shape = NULL;
impl_class->beep = gdk_offscreen_window_beep;
impl_class->beep = NULL;
impl_class->focus = NULL;
impl_class->set_type_hint = NULL;

View File

@@ -128,6 +128,8 @@ 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
@@ -308,6 +310,7 @@ 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.
@@ -318,7 +321,8 @@ typedef enum
GDK_GRAB_ALREADY_GRABBED = 1,
GDK_GRAB_INVALID_TIME = 2,
GDK_GRAB_NOT_VIEWABLE = 3,
GDK_GRAB_FROZEN = 4
GDK_GRAB_FROZEN = 4,
GDK_GRAB_FAILED = 5
} GdkGrabStatus;
/**
@@ -429,8 +433,26 @@ 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__ */

View File

@@ -132,6 +132,16 @@
*/
#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
*/
@@ -316,5 +326,19 @@
# 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__ */

View File

@@ -39,9 +39,13 @@
#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"
@@ -185,6 +189,11 @@ 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;
@@ -1024,9 +1033,35 @@ 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);
}
@@ -1335,8 +1370,7 @@ gdk_window_new (GdkWindow *parent,
window->input_only = TRUE;
}
if (window->parent)
window->parent->children = g_list_prepend (window->parent->children, window);
window->parent->children = g_list_prepend (window->parent->children, window);
if (window->parent->window_type == GDK_WINDOW_ROOT)
{
@@ -1362,8 +1396,7 @@ gdk_window_new (GdkWindow *parent,
_gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes, attributes_mask);
window->impl_window = window;
if (parent)
parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
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 */
@@ -1386,6 +1419,18 @@ 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;
}
@@ -1712,9 +1757,8 @@ gdk_window_ensure_native (GdkWindow *window)
NULL, 0);
new_impl = window->impl;
if (parent)
parent->impl_window->native_children =
g_list_prepend (parent->impl_window->native_children, window);
parent->impl_window->native_children =
g_list_prepend (parent->impl_window->native_children, window);
window->impl = old_impl;
change_impl (window, window, new_impl);
@@ -1838,6 +1882,12 @@ 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;
}
@@ -1939,6 +1989,14 @@ _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));
@@ -2665,6 +2723,80 @@ 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
@@ -2741,6 +2873,7 @@ 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));
@@ -2762,21 +2895,59 @@ 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,
gdk_window_get_content (window),
surface_content,
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;
}
@@ -2790,18 +2961,88 @@ 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() first.
* 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)
@@ -2809,7 +3050,6 @@ 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));
@@ -2829,43 +3069,55 @@ gdk_window_end_paint (GdkWindow *window)
if (impl_class->end_paint)
impl_class->end_paint (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);
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)
if (window->current_paint.use_gl)
{
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
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
{
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint_with_alpha (cr, window->alpha / 255.0);
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);
}
cairo_destroy (cr);
cairo_region_destroy (full_clip);
cairo_surface_flush (surface);
}
gdk_window_free_current_paint (window);
@@ -3044,7 +3296,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
*rproduce undefined results, so avoid it at all costs.
* produce undefined results, so avoid it at all costs.
*
* Returns: A newly created Cairo context. Free with
* cairo_destroy() when you are done drawing.
@@ -3086,7 +3338,7 @@ gdk_cairo_create (GdkWindow *window)
/* Code for dirty-region queueing
*/
static GSList *update_windows = NULL;
static gboolean debug_updates = FALSE;
gboolean _gdk_debug_updates = FALSE;
static inline gboolean
gdk_window_is_ancestor (GdkWindow *window,
@@ -3361,7 +3613,9 @@ 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)
{
@@ -3380,18 +3634,34 @@ gdk_window_process_updates_internal (GdkWindow *window)
*/
if (window->update_area)
{
cairo_region_t *update_area = window->update_area;
g_assert (window->active_update_area == NULL); /* No reentrancy */
window->active_update_area = window->update_area;
window->update_area = NULL;
if (gdk_window_is_viewable (window))
{
cairo_region_t *expose_region;
/* Clip to part visible in impl window */
cairo_region_intersect (update_area, window->clip_region);
expose_region = cairo_region_copy (window->active_update_area);
if (debug_updates)
/* 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);
if (gdk_display_get_debug_updates (display))
{
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);
@@ -3400,14 +3670,17 @@ 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, update_area);
impl_class->queue_antiexpose (window, expose_region);
expose_region = cairo_region_copy (update_area);
impl_class->process_updates_recurse (window, expose_region);
cairo_region_destroy (expose_region);
}
cairo_region_destroy (update_area);
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;
}
window->in_update = FALSE;
@@ -3629,10 +3902,10 @@ gdk_window_process_updates (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
gdk_window_process_updates_with_mode (window,
update_children ?
PROCESS_UPDATES_WITH_ALL_CHILDREN :
PROCESS_UPDATES_NO_RECURSE);
return gdk_window_process_updates_with_mode (window,
update_children ?
PROCESS_UPDATES_WITH_ALL_CHILDREN :
PROCESS_UPDATES_NO_RECURSE);
}
static void
@@ -3710,13 +3983,17 @@ gdk_window_set_invalidate_handler (GdkWindow *window,
static void
draw_ugly_color (GdkWindow *window,
const cairo_region_t *region)
const cairo_region_t *region,
int color)
{
cairo_t *cr;
cr = gdk_cairo_create (window);
/* Draw ugly color all over the newly-invalid region */
cairo_set_source_rgb (cr, 50000/65535., 10000/65535., 10000/65535.);
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.);
gdk_cairo_region (cr, region);
cairo_fill (cr);
@@ -3792,6 +4069,7 @@ 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));
@@ -3811,8 +4089,9 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
invalidate_impl_subwindows (window, region, child_func, user_data, 0, 0);
if (debug_updates)
draw_ugly_color (window, visible_region);
display = gdk_window_get_display (window);
if (gdk_display_get_debug_updates (display))
draw_ugly_color (window, visible_region, 0);
while (window != NULL &&
!cairo_region_is_empty (visible_region))
@@ -4105,9 +4384,17 @@ 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);
@@ -4125,9 +4412,17 @@ gdk_window_freeze_toplevel_updates_libgtk_only (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);
@@ -4167,7 +4462,7 @@ gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window)
void
gdk_window_set_debug_updates (gboolean setting)
{
debug_updates = setting;
_gdk_debug_updates = setting;
}
/**
@@ -4367,8 +4662,6 @@ gdk_window_get_device_position_double (GdkWindow *window,
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
tmp_x = tmp_y = 0;
tmp_mask = 0;
normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window,
device,
&tmp_x, &tmp_y,
@@ -5053,6 +5346,7 @@ 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 */
@@ -5112,6 +5406,7 @@ gdk_window_withdraw (GdkWindow *window)
}
recompute_visible_regions (window, FALSE);
gdk_window_clear_old_updated_area (window);
}
}
@@ -5749,6 +6044,9 @@ 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);
@@ -5794,11 +6092,15 @@ gdk_window_get_cursor (GdkWindow *window)
* @window: a #GdkWindow
* @cursor: (allow-none): a cursor
*
* 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.
* 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.
*/
void
gdk_window_set_cursor (GdkWindow *window,
@@ -6499,27 +6801,22 @@ gdk_window_merge_child_input_shapes (GdkWindow *window)
* @window: a #GdkWindow
* @use_static: %TRUE to turn on static gravity
*
* 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. Dont worry about it unless you have to.
* 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. Dont worry about it.
*
* Returns: %TRUE if the server supports static gravity
* Returns: %FALSE
*
* Deprecated: 3.16: static gravities haven't worked on anything but X11
* for a long time.
*/
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;
}
@@ -6534,6 +6831,9 @@ 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)
@@ -6572,6 +6872,9 @@ 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,
@@ -6594,12 +6897,14 @@ 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);
@@ -7724,9 +8029,9 @@ gdk_pointer_grab (GdkWindow * window,
gulong serial;
GList *devices, *dev;
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);
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);
/* We need a native window for confine to to work, ensure we have one */
if (confine_to)
@@ -7836,7 +8141,7 @@ gdk_keyboard_grab (GdkWindow *window,
gulong serial;
GList *devices, *dev;
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
/* Non-viewable client side window => fail */
if (!_gdk_window_has_impl (window) &&
@@ -9147,6 +9452,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
int width,
int height)
{
GdkDisplay *display;
cairo_surface_t *window_surface, *surface;
double sx, sy;
@@ -9154,28 +9460,23 @@ 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
switch (_gdk_rendering_mode)
display = gdk_window_get_display (window);
switch (display->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:
@@ -9253,12 +9554,10 @@ 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;
}
@@ -10255,7 +10554,12 @@ 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.
* 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.
*
* For child windows this function only works for non-native windows.
*
@@ -10607,8 +10911,6 @@ gdk_window_flush_events (GdkFrameClock *clock,
_gdk_display_pause_events (display);
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS);
window->frame_clock_events_paused = TRUE;
}
static void
@@ -10635,8 +10937,6 @@ gdk_window_resume_events (GdkFrameClock *clock,
display = gdk_window_get_display (window);
_gdk_display_unpause_events (display);
window->frame_clock_events_paused = FALSE;
}
static void
@@ -10669,9 +10969,6 @@ gdk_window_set_frame_clock (GdkWindow *window,
if (window->frame_clock)
{
if (window->frame_clock_events_paused)
gdk_window_resume_events (window->frame_clock, G_OBJECT (window));
g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock),
G_CALLBACK (gdk_window_flush_events),
window);
@@ -10781,7 +11078,7 @@ gdk_window_set_opaque_region (GdkWindow *window,
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
if (impl_class->set_opaque_region)
impl_class->set_opaque_region (window, region);
return impl_class->set_opaque_region (window, region);
}
/**

View File

@@ -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_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
gboolean gdk_window_get_composited (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
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_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
gboolean gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
@@ -739,6 +739,9 @@ 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);
@@ -1034,9 +1037,9 @@ void gdk_window_freeze_updates (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
void gdk_window_thaw_updates (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_16
void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
@@ -1108,6 +1111,12 @@ 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__ */

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