Compare commits

..

898 Commits

Author SHA1 Message Date
Carlos Garnacho a35c581710 treeview: Make the multipress gesture listen only to bin_window
This gesture is meant to handle row-activated signaling, so make the
gesture ignore events from any other window.
2014-05-27 17:37:07 +02:00
Carlos Garnacho ba6b7633aa button: Claim the sequence on multipress::pressed
In order to avoid the event from bubbling, as it used to (not) do.
2014-05-27 17:35:36 +02:00
Carlos Garnacho a2fe2ab4e6 gesture: Fix wrong assert in gtk_gesture_set_window
The window must be part of the event controller widget, so
fix the inverted logic.
2014-05-27 17:33:31 +02:00
Carlos Garnacho f4ed7e23da eventcontroller: Hide more details
Signals are left hidden, so the only entry point to handle_event/reset
is API.
2014-05-27 12:41:30 +02:00
Carlos Garnacho d46ed462ca gtk: Update GtkGesture users to the GtkPropagationPhase semantics change
Mainly doing s/TARGET/BUBBLE/ on the fully ported widgets, but GtkTreeView
where the double click handler has moved to GTK_PHASE_TARGET so it runs
parallelly to the still existing event handlers.
2014-05-27 12:38:49 +02:00
Carlos Garnacho ff88366dd2 widget: Change GtkCapturePhase behavior in event controllers' handling
Previously, there would be globally just a capture and a bubble phase,
with the event just going down the hierarchy once, and the up once.
GTK_PHASE_TARGET actually meaning "run within event handlers", so in
a hierarchy of 3 widgets, emission would be:

  Capture(C)
  Capture(B)
  Capture(A)
  Target(A) (if event handlers allow)
  Bubble(A)
  Target(B) (if event handlers allow)
  Bubble(B)
  Target(C) (if event handlers allow)
  Bubble(C)

This commit changes this behavior and uses GTK_PHASE_TARGET in a less
misleading way, running only on the widget that was meant to receive
the event. And GTK_PHASE_BUBBLE has taken over the execution place of
GTK_PHASE_TARGET, so the emission remains:

  Capture(C)
  Capture(B)
  Capture(A)
  Target(A)
  Bubble(A) (if event handlers allow)
  Bubble(B) (...)
  Bubble(C) (...)

As it was, GTK_PHASE_BUBBLE was useful for running event controllers
paralelly to event handlers, without modifying a single line in those.
For those mixed scenarios, Any of the other phases will have to be
used at discretion, or the event handlers eventually changed to chain
up and let the default event handlers in GtkWidget to be run.
2014-05-27 12:14:52 +02:00
Carlos Garnacho 3a86218983 window: Avoid double event processing in the multipress event controller
The events to those are fed outside the regular event propagation scheme,
through _gtk_window_check_handle_wm_event(), so set the controller to
GTK_PHASE_NONE so events aren't processed first manually, and then
automatically.
2014-05-27 12:14:17 +02:00
Carlos Garnacho 361812066a gesturezoom: Just return a double in get_scale_delta()
Checking whether the gesture is active is a responsibility of the caller.
2014-05-26 14:38:56 +02:00
Carlos Garnacho 83bb9d10a3 gesturerotate: Just return a double in get_angle_delta()
Whether the gesture is active or recognized should be checked before in
callers, or just not used naively.
2014-05-26 14:38:56 +02:00
Carlos Garnacho f563a64460 gesture: Replace gtk_gesture_attach/detach with event controller API
Event controllers now auto-attach, and the GtkCapturePhase only determines
when are events dispatched, but all controllers are managed by the widget wrt
grabs.

All callers have been updated.
2014-05-26 14:38:56 +02:00
Carlos Garnacho 68dd8e817b gtk: Update callers of GtkGesturePan orientation 2014-05-26 14:34:24 +02:00
Carlos Garnacho fb34e6ad36 eventcontroller: Make the event-mask property and methods private.
This will rarely have any use if no subclassing is allowed, so just make it
private for our own.
2014-05-26 14:34:24 +02:00
Carlos Garnacho c0d74d3ea7 gtk: Replace GtkPanOrientation with GtkOrientation
And document GtkOrientation to be more generic. There's little added
value in a separate enum for this.
2014-05-26 14:34:24 +02:00
Kalev Lember 750f6b9913 GtkApplication: Fix two muxer-related memory leaks
Drop the ref on the action muxer in finalize, and also make sure
shutdown() tears down the muxer setup done in startup().

When GtkApplication adds itself to a muxer, it causes the muxer to take
a ref on the GtkApplication. This has to be undone in shutdown() to make
sure the GtkApplication doesn't end up holding a ref on itself.

https://bugzilla.gnome.org/show_bug.cgi?id=730383
2014-05-25 10:49:27 +02:00
Matthias Clasen 8230299748 inspector: Allow changing attribute mappings 2014-05-24 23:31:54 -04:00
Matthias Clasen 83f9649c9c docs: Move GdkColor off into a deprecated section 2014-05-24 23:31:54 -04:00
Kalev Lember edb4c65c5b Bump ATK dependency to 2.12
... for the new AtkValue interface that we implement.
2014-05-25 00:17:55 +02:00
Matthias Clasen df0f14fe2a Some more updates 2014-05-24 18:41:16 -04:00
Matthias Clasen 8a6aca31a8 Typo fixes 2014-05-24 18:20:31 -04:00
Matthias Clasen 44d76fbcdc Organize the icons
Sort the icon list in check-icon-theme.c, and add
comments so we have a chance of keeping the order.
2014-05-24 18:20:31 -04:00
Matthias Clasen e916391e6c Drop an unused object
A downside of using templates is that we can have 'parasitic'
objects in there that don't get used for anything.
2014-05-24 18:20:31 -04:00
Matthias Clasen 72c79deb3b GtkIconTheme: Add more debug spew
Still trying to track down test problems in gnome-continuous.
2014-05-24 18:20:31 -04:00
Jasper St. Pierre 0d402601b2 wayland: Add support for show_window_menu 2014-05-24 15:55:55 -04:00
Benjamin Otte 0430ae0ca5 image: Draw the image again
An important line of code was removed in
54d5b426fc that lead to an undefined
variable. Add that line back.
2014-05-24 19:38:56 +02:00
Benjamin Otte 1cbace5f68 combobox: Implement clip 2014-05-24 16:21:02 +02:00
Benjamin Otte 750178e1ed entry: Implement clip 2014-05-24 16:20:48 +02:00
Benjamin Otte 4bbca44512 gestureswipe: Fix return value 2014-05-24 16:16:41 +02:00
Benjamin Otte b03d54b75f image: Remove unused variable 2014-05-24 16:16:32 +02:00
Benjamin Otte a9bcea5118 button: Implement clip 2014-05-24 16:12:21 +02:00
Benjamin Otte f5b1e75d93 widget: Include box-shadow in the clip
This allows all widgets that implement clip to use box shadows.
2014-05-24 16:12:21 +02:00
Benjamin Otte 0cd63faee2 widget: Add _gtk_widget_set_css_clip()
... and use it in GtkBox and GtkGrid.
2014-05-24 16:12:21 +02:00
Benjamin Otte 434f91feff spinner: Implement clip
We now allow you to gtk-icon-transform() the spinner outside of the
spinners allocation.
2014-05-24 16:12:20 +02:00
Benjamin Otte 4f89eb05cf API: widget: Add gtk_widget_set_clip() API
And handle the fact that drawing bounds are now handled by this API and
the corresponding gtk_widget_get_clip().

Also add _gtk_widget_supports_clip() function to check if a widget has
been ported to the new world.
2014-05-24 16:12:20 +02:00
Matthias Clasen 1d897a9bf2 docs: Flesh out the inspector section a bit 2014-05-24 10:07:46 -04:00
Matthias Clasen a13d12a445 inspector: Make picking widgets work again
This broke when I accidentally removed the line that adds
each object to the hash table. Bring it back.
2014-05-24 09:55:41 -04:00
Rico Tzschichholz 3f140d5391 docs: Fix make dist 2014-05-24 12:16:56 +02:00
Rico Tzschichholz 0b586e52c2 build: Fix typo 2014-05-24 09:52:41 +02:00
Rico Tzschichholz 86d4c26420 gtk: Fix make dist 2014-05-24 09:24:46 +02:00
Rico Tzschichholz eab39253ec build/win32: Drop a11y library references
In addition to 	4a4b23bfad
2014-05-24 09:23:52 +02:00
Rico Tzschichholz 7eaea2a849 Updated POTFILES.in 2014-05-24 09:22:53 +02:00
Matthias Clasen 9037f7b64e docs: more input handling docs 2014-05-24 01:56:44 -04:00
Matthias Clasen f52dd9fc04 Fix a start/end mixup
The headerbar example in gtk3-demo was showing two start buttons
after the arrow removal.
2014-05-24 00:48:12 -04:00
Matthias Clasen aabc356b80 GtkMisc: Keep gtk_misc_set_alignment working
Now that labels and images no longer use x/yalign in their code,
we need to make gtk_misc_set_alignment set the h/valign for these
widgets, to keep it stumbling along until its final demise.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:48:12 -04:00
Matthias Clasen 1008e15414 GtkToolButton: Drop use of GtkMisc
Use h/valign instead of x/yalign.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:48:02 -04:00
Matthias Clasen 687eae4b51 GtkAssistant: Drop use of GtkMisc
Use halign instead of xalign.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:04:41 -04:00
Matthias Clasen 4d002d5e6a GtkAccelLabel: Drop use of GtkMisc
Just use 0 instead of xpad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:04:41 -04:00
Matthias Clasen 54d5b426fc GtkImage: Drop use of GtkMisc::x/yalign
Instead, use GtkWidget::h/valign to position the image inside
the allocation. And just stop using GtkMisc::x/ypad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:04:41 -04:00
Matthias Clasen b320c198b6 GtkLabel: Drop use of GtkMisc::x/yalign
Instead, use GtkWidget::h/valign to position the text inside
the allocation. And just stop using GtkMisc::x/ypad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:04:41 -04:00
Matthias Clasen 0011c9dae4 Fix filechooser actionbar visibility
The actionbar was always visible, even when there is no filter
and no extra widget to show. Now we only show it when there is
something to show.
2014-05-24 00:00:00 -04:00
Matthias Clasen 51a09af076 inspector: Treat resources the same as in gtk/ 2014-05-23 23:00:43 -04:00
Matthias Clasen ef38d6e397 Add two more icon names to check
These were found in the trash monitor.
2014-05-23 22:59:22 -04:00
Matthias Clasen 00d02491d8 Drop no-longer-used gtkrc files
These were replaced by css files long ago.
2014-05-23 22:00:51 -04:00
Matthias Clasen 45e1128472 Drop a pointless function
No need to have a finalize function if it just chains
up to the parent class.
2014-05-23 21:56:44 -04:00
Matthias Clasen 716ecff28d Trivial: slight code rearrangement 2014-05-23 21:41:58 -04:00
Matthias Clasen 38cbd87cac tests: Stop using GtkAlignment
Fix up all other tests to not use GtkAlignment anymore.
2014-05-23 21:32:51 -04:00
Matthias Clasen 1af417a82d testadjustsize: Keep using an alignment
We are explicitly comparing GtkAlignment with its replacements
here.
2014-05-23 20:42:01 -04:00
Matthias Clasen e74bb3db2a gtk-demo: Drop use of GtkAlignment 2014-05-23 20:31:38 -04:00
Matthias Clasen 04703689b8 Deprecate GtkAligment
This has been dangling ever since 3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=645781
2014-05-23 20:31:25 -04:00
Matthias Clasen 4928d5e401 Drop an unneeded include
There's no GtkGesture in gtkwidget.h anymore. We do need an include
in gtkwidgetprivate.h though.
2014-05-23 20:09:50 -04:00
Evan Nemerson 4a4b23bfad a11y: build directly into libgtk instead of an internal library
https://bugzilla.gnome.org/show_bug.cgi?id=730615
2014-05-23 19:20:59 -04:00
Matthias Clasen d4771d4a95 More updates 2014-05-23 17:32:14 -04:00
Matthias Clasen cd1cd40e9a Some updates 2014-05-23 16:11:48 -04:00
Piotr Drąg 83c1869250 Updated POTFILES.in 2014-05-23 20:48:12 +02:00
Carlos Garnacho bd35df05a5 Merge branch 'gestures' 2014-05-23 19:58:46 +02:00
Carlos Garnacho 60e15deb83 spinbutton: Avoid touch text handles to pop up
Those get in the middle more than help on these widgets, the widget
is already packed with clickable areas and having handles (and their
invisible clickable area around) hovering above don't help, plus the
purpose in most likely numeric values is a bit doubtful.

All touch events are either consumed by the up/down panels, or
the swipe gesture, all GtkEntry handling of touch events on the text
window is avoided, so handles to not appear anymore.
2014-05-23 19:54:33 +02:00
Carlos Garnacho a4a122c8e8 colorswatch: Set gestures in GTK_PHASE_TARGET
That's the right phase for gestures replacing entirely event handlers.
2014-05-23 19:54:33 +02:00
Carlos Garnacho d59c909663 spinbutton: Use GTK_PHASE_CAPTURE for touch swipes
The gesture must be able to catch first events for it to be seen
as recognized in event handlers.
2014-05-23 19:54:33 +02:00
Carlos Garnacho 01d74f86a0 widget: Flip execution order of GTK_PHASE_TARGET/BUBBLE
the "bubble" phase used to run before event handlers before GTK_PHASE_TARGET
was added, in order to keep phases in the expected order, move GTK_PHASE_BUBBLE
to be run (still invariably) after event handlers.

The only behavioral change should be wrt widgets wanting mixed event handler/
gesture handling, they could previously attach the gesture to the bubble phase
and check for gtk_gesture_is_active() in the event handler to bail out, they'll
have to use GTK_PHASE_CAPTURE for that purpose from now on.
2014-05-23 19:54:33 +02:00
Carlos Garnacho ca1510177c texthandle: Mind the invisible area when moving the handle
The handle is still centered horizontally, but the extra vertical
space wasn't taken into account, leading to misplacing the dragging
point (and the handle) during motion events.
2014-05-23 19:54:33 +02:00
Carlos Garnacho c9f54aef69 textview: Check first whether the sequence is handled, fetch later the event
And always unset/hide the selection popover if unhandled, that means the
sequence went grabbed/claimed somewhere else and cancelled here.
2014-05-23 19:54:33 +02:00
Carlos Garnacho f54277204f entry: Check first whether the sequence is handled, fetch later the event
And always unset/hide the selection popover if unhandled, that means the
sequence went grabbed/claimed somewhere else and cancelled here.
2014-05-23 19:54:33 +02:00
Carlos Garnacho 485da90a2e gesture: Use GdkEventSequence GType in signals 2014-05-23 19:54:33 +02:00
Carlos Garnacho 7e61216105 gesture: Introspection fixes
Set annotations on return values for gtk_gesture_get_device() and
gtk_gesture_get_window().
2014-05-23 19:54:33 +02:00
Carlos Garnacho 03a3b2ccab eventcontroller: introspection fix
Set transfer annotation on gtk_event_controller_get_widget()
2014-05-23 19:54:33 +02:00
Carlos Garnacho 0d4e75f078 gdk: Make GdkEventSequence a boxed type
Not much to copy nor free, but this'll make bindings happy
2014-05-23 19:54:33 +02:00
Carlos Garnacho 5fdf07547f paned: Handle pointer events from touchscreen devices
GtkPaned may just capture pointer events because the child widget
doesn't happen to have GDK_TOUCH_MASK set, resort to checking the
device in that case.
2014-05-23 19:54:33 +02:00
Matthias Clasen 0442431943 Docs: Cosmetic fixes 2014-05-23 19:54:33 +02:00
Matthias Clasen 9f3f634c16 docs: Correct a reference 2014-05-23 19:54:33 +02:00
Matthias Clasen 70bccb38c3 Revert "docs: GtkEventController was dropped from public api"
This reverts commit eefac03b395a6b885fd61c100b48652200beb996.
2014-05-23 19:54:32 +02:00
Matthias Clasen c83d3f054b Revert "docs: More GtkEventController removal"
This reverts commit 75f503fb1fc9068c9e1a0d02126c55addbe8eb3e.
2014-05-23 19:54:32 +02:00
Matthias Clasen ae5f930d1b Docs: Add information about event propagation 2014-05-23 19:54:32 +02:00
Matthias Clasen aead8a360b Docs: Minor changes 2014-05-23 19:54:32 +02:00
Matthias Clasen 729a3a98d9 Document gtk_gesture_set_state 2014-05-23 19:54:32 +02:00
Matthias Clasen 9917b15bd3 docs: gtk_gesture_cancel_sequence was made private 2014-05-23 19:54:32 +02:00
Matthias Clasen 01cd5cf382 docs: More GtkEventController removal 2014-05-23 19:54:32 +02:00
Matthias Clasen 6cc9744558 docs: GtkEventController was dropped from public api 2014-05-23 19:54:32 +02:00
Carlos Garnacho 681164564e paned: Use GtkGesture to handle handle dragging
Dragging is all handled by a GtkGesturePan now, matching the
paned orientation.

On touch events, a wider area is listened for, so touch events
don't need to be as accurate to initiate dragging, if no dragging
is truly initiated in this case, events are just forwarded for
child widgets to handle.
2014-05-23 19:54:32 +02:00
Carlos Garnacho 8f20780fb9 switch: Use GtkGesture to handle input events
A pan gesture is used to handle switch dragging, which is only triggered
by horizontal panning movements. A multipress gesture handles the cases
where clicking without dragging happens, just toggling the switch.
2014-05-23 19:54:32 +02:00
Matthias Clasen a47d0406a7 inspector: Add more complete gesture support
Add a dedicated tab that shows how gestures are grouped,
and allows changing the propagation phase.
2014-05-23 19:54:32 +02:00
Matthias Clasen 1c5f14a9e4 inspector: Minimal support for gestures
We're just showing them as objects in the tree, for now.
2014-05-23 19:54:32 +02:00
Matthias Clasen a727c41e4a Add back a private api to list controllers
This will let us show them in the inspector.
2014-05-23 19:54:32 +02:00
Carlos Garnacho 2ba89256f4 texthandle: Make a bigger hit area around texthandles
The hit area now extends to all sides around the handle, instead
of just towards where the text is. This makes it easier to grab
handles once shown.
2014-05-23 19:54:32 +02:00
Carlos Garnacho f322e55e19 gesture: Declare GtkGesture:window as an object property 2014-05-23 19:54:32 +02:00
Carlos Garnacho f81f00ed6b widget: 3-way merge ate my g_object_ref()
Move it to the right place.
2014-05-23 19:54:32 +02:00
Carlos Garnacho d351c52114 scrolledwindow: Handle directional cancellation if there is a single scroll direction
A pan gesture is optionally attached if there is only one scrolling direction, the pan
gesture orientation is changed so movements tangential to the scroll direction get
scrolling cancelled (The pan gesture is automatically denied when that happens, and
that state change spreads to the others gestures in the group). If the pan direction
happens in the expected directions, no cancellation happens, and scrolling eventually
takes place.
2014-05-23 19:54:32 +02:00
Carlos Garnacho 57eca4f445 widget: remove check on whether the controller was already added
Multiple calls are supposedly allowed to change the phase (although
unlikely to happen), so remove the g_return_if_fail() checking whether
the controller was already added.
2014-05-23 19:54:31 +02:00
Carlos Garnacho bd68db4b25 pan: Remove wrong check
From the very early days where there were a NONE=0 GtkPanOrientation
value. This makes vertical pan operations work as expected.
2014-05-23 19:54:31 +02:00
Carlos Garnacho e70e3963dd entry: Ensure the cursor text handle is shown after touching to reposition cursor. 2014-05-23 19:54:31 +02:00
Carlos Garnacho cf7bb9a3bf popover: Hide widget first when disposing
In order to ensure invariants are kept.
2014-05-23 19:54:31 +02:00
Carlos Garnacho 15f7170358 entry: Obey implementations' frame when placing handles/popovers around
Y=0 was assumed in a few places, not necessarily right on eg. vertical
spinbuttons.
2014-05-23 19:54:31 +02:00
Carlos Garnacho 10c47fa6d6 entry: Improve touch popover interaction
Presses alternatively show and dismiss the popover, the popover is still
always shown invariably after any dragging happens (either text selection,
or dragging a text handle)
2014-05-23 19:54:31 +02:00
Carlos Garnacho bd5fb3a09f textview: Show the magnifier popover a bit farther from the touch position
Somewhat arbitrary at the moment, would be nice to have minimal units
support for this, or at least hidpi support.
2014-05-23 19:54:31 +02:00
Carlos Garnacho b2d56c588a textview: Improve touch popover interaction
Presses alternatively show and dismiss the popover, the popover is still
always shown invariably after any dragging happens (either text selection,
or dragging a text handle)
2014-05-23 19:54:31 +02:00
Carlos Garnacho e580c29f07 entry: Use gestures to handle pointer/touch events
Similarly to GtkTextView, a GtkGestureMultiPress gesture handles
button/touch presses to initiate one selection mode or other, and
a GtkGestureDrag is used to handle text selection and DnD checks.

The code from button press/release, motion, and grab_notify handlers
has been shuffled into the actions triggered by those gestures.
2014-05-23 19:54:31 +02:00
Carlos Garnacho d559cade42 spinbutton: Attach "swipe to spin" controllers to the bubble phase
It is unnecessary to have those process events manually, just attach
those to the bubble phase.
2014-05-23 19:54:31 +02:00
Carlos Garnacho 70ea24b9e8 colorplane: Fully port to GtkGesture
A GtkGestureDrag is used for color selection, removing also the
need to track the pointer state in widget data. The GDK grab performed
just to set the crosshair cursor has been replaced by a call
to gdk_window_set_device_cursor(), which will be unset if the
drag operation is finished, or cancelled due to the implicit grab
being broken.
2014-05-23 19:54:31 +02:00
Carlos Garnacho a6526eb820 gdk: Lookup both device and global cursor when checking up the hierarchy
When the pointer cursor is updated on CSW, lookup for either a device
cursor, or a global one. It would previously lookup for windows with
a global cursor, and then check if it had a device cursor, which would
skip windows with only device cursors set, and unexpectedly set the
global cursor.
2014-05-23 19:54:31 +02:00
Carlos Garnacho ced7e7c08d button: Make multipress gesture exclusive
We only want actions to be triggered by a single sequence there,
so buttons trigger no actions on further simultaneous touches
happening.
2014-05-23 19:54:31 +02:00
Carlos Garnacho 0b3f4d5555 gesturesingle: Add an "exclusive" boolean property
All "exclusive" gestures listen for either pointer events, or
"pointer emulating" touch events, so only a single sequence at
a time can make these run.
2014-05-23 19:54:31 +02:00
Carlos Garnacho fd9925141b button: Use GtkGestureMultiPress for signal emission
It is now useful for that purpose with a ::release signal, so replace
the custom GtkGestureSingle with one of these.
2014-05-23 19:54:31 +02:00
Carlos Garnacho e638ff7974 drag: Allow gtk_gesture_get_start_point/offset() to be called on ::drag-end 2014-05-23 19:54:30 +02:00
Carlos Garnacho d2db31ee5e multipress: Add matching ::released signal
This signal will always be paired with a ::pressed signal, unless
the sequence is cancelled, or the controller is reset. the n_press
argument in the signal always matches the ::press signal one, even
if GtkGestureMultiPress::stopped was emitted in between.
2014-05-23 19:54:30 +02:00
Carlos Garnacho 04c8b4c705 multipress: Protect against fleeting touches mistriggering events
The current sequence (as per gtk_gesture_single_get_current_sequence)
is used to find out the coordinates. And only emit ::pressed if the
gesture began through a GDK_BUTTON_PRESS/TOUCH_BEGIN (eg. not due to
an extra touch being lifted)
2014-05-23 19:54:30 +02:00
Carlos Garnacho 24f20864b4 textview: Set up controllers on the GTK_PHASE_TARGET propagation phase
This way events are managed by gestures in the event handlers themselves,
respecting the execution order already assumed by subclasses around.
2014-05-23 19:54:30 +02:00
Carlos Garnacho dd164502f7 widget: Hook GTK_PHASE_TARGET controllers to the default event handlers
Just call the controllers on that phase if the default widget handlers
are run.

For compatibility reasons, in the touch event handler, let the pointer
emulating touch be transformed to a pointer event as usual, in order to
have widget handlers a chance to run at all. If they have to be managed
by a controller in that phase, it'll have to be through the default pointer
event handlers.
2014-05-23 19:54:30 +02:00
Carlos Garnacho 1c48cc253d gesture: Add GTK_PHASE_TARGET
This phase is meant to run in the default widget handlers, as opposed
to externally as in the bubble/capture phase. This will be most usually
the expected phase for every controller replacing code in event handlers
in GTK+, just so invocation and triggering order is kept unaltered.
2014-05-23 19:54:30 +02:00
Carlos Garnacho 3d34f26a6a gesture: Handle GdkEventGrabBroken
That may happen separately from grab-notify, and also due to external
reasons, so ensure all sequences are cancelled if a grab is taken
in some GdkWindows that would obscure events on the controller.
2014-05-23 19:54:30 +02:00
Matthias Clasen 6a290bdecb GtkColorSwatch: Use gesture for button events too 2014-05-23 19:54:30 +02:00
Matthias Clasen 6896c979a9 GtkWindow: Only use a multipress gesture for toplevels
There is no point in creating and attaching this gesture
for override-redirect windows, so don't do it.
2014-05-23 19:54:30 +02:00
Matthias Clasen bad1dd4ac7 Be careful about the list of event controllers
We can end up with _gtk_widget_remove_controller getting called
while we are iterating over the list in _gtk_widget_run_controllers.
To avoid trouble, only mark the event controller as dead by
setting data->controller to NULL, and defer the actual freeing
and list manipulation to the loop in _gtk_widget_run_controllers.
Update other places that operate on controllers to handle
data->controller being NULL.
2014-05-23 19:54:30 +02:00
Carlos Garnacho d97e4bf6b7 textview: Convert gestures' coordinates to text window ones
And make some code shared between multipress/drag gesture.
2014-05-23 19:54:30 +02:00
Carlos Garnacho f47138b653 textview: Use GtkGestureDrag for text selection/DnD
remaining code in button press/release, motion notify, and grab
notify handlers has been shuffled to be managed by this gesture.
2014-05-23 19:54:30 +02:00
Carlos Garnacho a4da4f8dfa textview: Use GtkGestureMultiPress for click handling
The button press handler is no longer necessary, and most of its
code has been shuffled into the GtkGestureMultiPress::pressed
handler.
2014-05-23 19:54:30 +02:00
Carlos Garnacho fe9685bca1 widget: tighten the conditions at which a press event is emulated
Make it really sure that the event is only emitted after every gesture
that consumed the button press is done with the sequence.
The event must only be emulated if a gesture in the capture phase happened
to consume the event, be cancelled, and
2014-05-23 19:54:30 +02:00
Carlos Garnacho 6e9b054543 widget: Fix gesture event handler retval for bubbled events
Do not clobber the return value if the regular event handler happens
to return FALSE, even if the gesture meant to consume the event.
2014-05-23 19:54:30 +02:00
Carlos Garnacho 2a0bf33bc9 gesture: Prevent against sequence cancellation within gtk_gesture_set_state()
Sequences may be cancelled within the ::sequence-state-changed handler, which
would change the points hashtable as it's being iterated in this function. So
iterate over a list of sequences and let the hashtable change freely.
2014-05-23 19:54:29 +02:00
Carlos Garnacho 44a960199b gesture: Make gtk_gesture_get_last_update_time() private 2014-05-23 19:54:29 +02:00
Carlos Garnacho 83d5795154 gesture: Remove gtk_gesture_get_last_event_type 2014-05-23 19:54:29 +02:00
Carlos Garnacho 8ab35016a6 gesture: make gtk_gesture_cancel_sequence() private 2014-05-23 19:54:29 +02:00
Carlos Garnacho 0288fd0a88 gesture: Make gtk_gesture_check() private 2014-05-23 19:54:29 +02:00
Carlos Garnacho 994c94c25b dnd: Check on the right gesture sequence when starting the drag op 2014-05-23 19:54:29 +02:00
Carlos Garnacho 5369c77029 gesture: Simplify gesture/widget interaction public API
The propagation phase property/methods in GtkEventController are gone,
This is now set directly on the GtkWidget add/remove controller API,
which has been made private.

The only public bit now are the new functions gtk_gesture_attach() and
gtk_gesture_detach() that will use the private API underneath.

All callers have been updated.
2014-05-23 19:54:29 +02:00
Carlos Garnacho f0940c962f widget: Keep a widget reference around _gtk_widget_run_controllers()
The widget may be destroyed within the loop, in reaction to the signals
sent by the controllers. Protect against that.
2014-05-23 19:54:29 +02:00
Carlos Garnacho db55f8a4e5 gesture: Add explanatory note in GtkGesture::end
Explain that this signal may be triggered by an extra touch that causes
the gesture to surpass GtkGesture:n-points.
2014-05-23 19:54:29 +02:00
Carlos Garnacho 5c9f4bd078 gesture: Cancel sequences that make a gesture exceed the number of touches as they happen
This makes it possible to track those through gtk_gesture_handles_sequence(),
without guessing from last event type or sequence state.
2014-05-23 19:54:29 +02:00
Carlos Garnacho 134acf3fda widget: Change slightly the gesture cancellation policy in a same widget
Within a widget, if a gesture accepts a sequence, it would previously
cancel every other gesture that not in the same group. Change this to
only cancelling gestures that previously claimed the gesture, and let
gestures with state=NONE for that sequence remain like that.

This enables late recognition of gestures, even on the presence of
another gesture group that was more eager at claiming the gesture.

One usecase is user-defined panning gestures on scrolledwindows,
if ::capture-button-press is TRUE (eg. the default), the gesture is
claimed early in order to consume the button press, but that would
tipically make every other gesture group deny the sequence. With
this change, the pan gesture can keep state=NONE, and later claim
the sequence for itself if the panning gesture is recognized.

Also, do not propagate state=DENIED to every gesture in the widget,
that was unintended.
2014-05-23 19:54:29 +02:00
Carlos Garnacho 4589f0e0c8 rotate: Ensure delta is between [0..2π] 2014-05-23 19:54:29 +02:00
Carlos Garnacho c34280d97b pan: make the direction factor less narrow in v/h directions 2014-05-23 19:54:29 +02:00
Carlos Garnacho e080eafef8 gesture: Handle GDK_TOUCH_CANCEL events
The wayland windowing backend emits such events for instance, so
have gestures cancel the sequence as those events get through.
2014-05-23 19:54:29 +02:00
Carlos Garnacho d9e6395ee9 gesture: Protect against odd window hierarchies
If no match is found with the gesture widget when poking the event
window parents, bail out safely instead of falling in an infinite
loop. This was seen on Mutter.
2014-05-23 19:54:29 +02:00
Carlos Garnacho cbe47c02a1 swipe: Don't emit ::swipe if there are still active touches
Avoids sending spurious signals when an extra touch happens.
2014-05-23 19:54:28 +02:00
Matthias Clasen 42df9eda2d Prevent subclassing of gestures
For now, at least. We do this by hiding the instance and
class structures in private headers.
2014-05-23 19:54:28 +02:00
Matthias Clasen 93b7883372 GtkSpinButton: Don't leak the gestures 2014-05-23 19:54:28 +02:00
Matthias Clasen c6c41262b6 GtkWindow: Don't leak the gesture 2014-05-23 19:54:28 +02:00
Matthias Clasen 17088e4add GtkTreeView: Remove unused field 2014-05-23 19:54:28 +02:00
Matthias Clasen c63c1caac0 gtk3-demo: Don't leak the color chooser 2014-05-23 19:54:28 +02:00
Matthias Clasen 3a752658ab GtkColorPlane: Actually add the long press gesture
This was missed because gtk_widget_remove_controller silently
does nothing on unowned controllers.
2014-05-23 19:54:28 +02:00
Matthias Clasen 487ac50e93 GtkButton: Don't leak the gesture 2014-05-23 19:54:28 +02:00
Matthias Clasen 616aac8d82 Forgotten file 2014-05-23 19:54:28 +02:00
Matthias Clasen 0106099f5b GtkButton: Port to GtkGesture
Quick-and-dirty patch to use a GtkGestureSingle for both
button press/release and touch event handling.
2014-05-23 19:54:28 +02:00
Carlos Garnacho f73f4d82e0 widget: remove GtkGesture-related signals
The utility of those signals is somewhat dubious now that there is
gtk_gesture_group(), so make that the only way to coordinate gestures.
The cooperation model offered by gtk_gesture_group() is flexible
enough,
2014-05-23 19:54:28 +02:00
Carlos Garnacho bf6181a382 docs: Add missing GtkEventController functions 2014-05-23 19:54:28 +02:00
Carlos Garnacho 35bed1ac14 widget: Add docs for GtkGesture-related API 2014-05-23 19:54:28 +02:00
Carlos Garnacho 63dd7a568e gesturesingle: doc fixes 2014-05-23 19:54:28 +02:00
Carlos Garnacho 556eb398e5 zoom: doc fixes 2014-05-23 19:54:28 +02:00
Carlos Garnacho ad2346f762 swipe: doc fixes 2014-05-23 19:54:28 +02:00
Carlos Garnacho 1f8cf3c322 rotate: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho 135a653ee2 pan: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho 24dc172b46 multipress: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho fa168e202e longpress: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho 3cbd2b97b8 drag: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho ec50d776ce gesture: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho dbc7f011b3 eventcontroller: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho 958efad71d docs: Add missing controller/gesture docs 2014-05-23 19:54:27 +02:00
Carlos Garnacho a0e9de671b pan: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho c10998edb5 zoom: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho dc1e8454a7 rotate: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho 2df48ba886 swipe: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho 28237f80f5 drag: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho 90b2f386e7 longpress: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho 4602f34111 multipress: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho 862f9d876e gesturesingle: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho ac8dcccb32 gesture: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho c60c0fe4c5 eventcontroller: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho 48367b1432 enums: Add missing docs to controller/gesture enums 2014-05-23 19:54:27 +02:00
Carlos Garnacho d768c2cb84 Remove GtkPressAndHold
This is replaced by GtkGestureLongPress, and all its callers have
been updated to use the replacement.
2014-05-23 19:54:26 +02:00
Carlos Garnacho 4401be22ad enums: Document GtkPropagationPhase 2014-05-23 19:54:26 +02:00
Carlos Garnacho 6296aa84b2 spinbutton: increase/decrease value on upwards/downwards touch swipes
This is somewhat analogous to scroll events on pointer devices, the
greater the velocity, the faster the spinbutton spins.
2014-05-23 19:54:26 +02:00
Carlos Garnacho c7da5b54f5 Add GtkGesturePan
This gesture reports events on horizontal/vertical panning gestures.
2014-05-23 19:54:26 +02:00
Carlos Garnacho 75b6f4aa52 range: Replace GtkPressAndHold with GtkGestureLongPress 2014-05-23 19:54:26 +02:00
Carlos Garnacho 2166be96d2 swipe: Add function to retrieve the current velocity
This can be used to fetch the current velocity on update(), as opposed
to swipe() which happens after the sequence is finished.
2014-05-23 19:54:26 +02:00
Carlos Garnacho bd722499dc colorswatch: Replace GtkPressAndHold
GtkGestureLongPress and GtkGestureMultiPress are both used
to replace it.
2014-05-23 19:54:26 +02:00
Carlos Garnacho d5cb4841c8 colorscale: Replace GtkPressAndHold with GtkLongPressGesture 2014-05-23 19:54:26 +02:00
Carlos Garnacho 8c139c1fca colorplane: Replace GtkPressAndHold with GtkLongPressGesture 2014-05-23 19:54:26 +02:00
Carlos Garnacho e3d25b3c3c entry: Don't show text handles too eagerly on button press
Instead do so on button release, or after text selection dragging
starts.
2014-05-23 19:54:26 +02:00
Carlos Garnacho c3075f1d56 longpress: Ensure check() happens after cancel()
And delegate on GtkGesture::check(), it does deal better with
extra fleeting touches.
2014-05-23 19:54:26 +02:00
Carlos Garnacho c506dfe600 longpress: fix reentrancy on ::reset() 2014-05-23 19:54:26 +02:00
Carlos Garnacho 3cc9543e64 gesturemultipress: fix reentrancy on ::reset() 2014-05-23 19:54:26 +02:00
Carlos Garnacho cdb5ba9426 gesturesingle: check the current sequence before resetting the pressed button 2014-05-23 19:54:26 +02:00
Carlos Garnacho 490c356954 scrolledwindow: update to gesture widget-level API changes 2014-05-23 19:54:26 +02:00
Carlos Garnacho ff627511b7 window: update to gesture widget-level API changes 2014-05-23 19:54:26 +02:00
Carlos Garnacho 6350f58c1c treeview: update to gesture widget-level API changes 2014-05-23 19:54:25 +02:00
Carlos Garnacho c4a39f5abf drag: remove unused #define 2014-05-23 19:54:25 +02:00
Carlos Garnacho 3221d53010 eventcontroller: Add documentation blurb 2014-05-23 19:54:25 +02:00
Carlos Garnacho 040c82f0e8 dnd: Update to gesture widget-level API changes 2014-05-23 19:54:25 +02:00
Carlos Garnacho 51b5fa3bf0 demo: Update to gesture widget-level API changes 2014-05-23 19:54:25 +02:00
Carlos Garnacho 7a71c16317 widget: refactor gesture integration
Listen for notify::sequence-state-changed on the controller, so the
only way to manipulate a sequence state are gtk_gesture_set_sequence_state()
and gtk_gesture_set_state().

Also, make use of gesture groups, so the sequence state is set at once
on all gestures pertaining to a single group. Within a widget, if a sequence
is claimed on one group, it is made to be denied on every other group.
2014-05-23 19:54:25 +02:00
Carlos Garnacho b0a23dbfbd gesture: Add grouping API
This API eliminates the need for overriding
GtkWidget::sequence-state-changed virtually everywhere. Grouped
gestures share common states for a same GdkEventSequence, so the
state of sequences stay in sync across those.
2014-05-23 19:54:25 +02:00
Carlos Garnacho 6433a5452e gesture: Add gtk_gesture_set_state() helper.
This function sets the state on all sequences where it actually
can, just a helper function to avoid iterating over sequences
yourself.
2014-05-23 19:54:25 +02:00
Carlos Garnacho 72f8c673da gesture: emit the current state on ::sequence-state-changed 2014-05-23 19:54:25 +02:00
Carlos Garnacho ae241714c4 gesture: group continue conditions together 2014-05-23 19:54:25 +02:00
Carlos Garnacho 8ebcca2ef6 gesture: return TRUE if the sequence state was already set 2014-05-23 19:54:25 +02:00
Carlos Garnacho f3257e1a54 gesture: fix compiler warning 2014-05-23 19:54:25 +02:00
Carlos Garnacho 4570837e48 gesture: ignore events if now widget window was found 2014-05-23 19:54:25 +02:00
Carlos Garnacho 759705d3e6 eventcontroller: Add propagation-phase property
This is so we don't have to specify the capture phase for
every controller. The default "bubble" value will be sane
on most situations.
2014-05-23 19:54:25 +02:00
Carlos Garnacho 2ed086748f treeview: remove superfluous GTK+ grabs 2014-05-23 19:54:25 +02:00
Carlos Garnacho 2ef4f1bc61 textview: remove superfluous GTK+ grabs 2014-05-23 19:54:25 +02:00
Carlos Garnacho bae68b5511 iconview: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Carlos Garnacho 46b4e5d388 combobox: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Carlos Garnacho db14e22f06 cellrendereraccel: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Carlos Garnacho f766109b5b Revert "gtk: Remove propagation limit of captured events on the grab widget"
This reverts commit 6511f411955adba4f960b8b07d39b93785afe33e.
2014-05-23 19:54:24 +02:00
Carlos Garnacho cdcc536ddc longpress: Use xsettings to determine long press duration
GtkSettings::gtk-long-press-time is used to this effect.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 1403ebb097 settings: Add gtk-long-press-time setting
This setting determines the duration of a button/touch press to
be considered a long press.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 61e88c251e window: Use gestures for window moving/resizing
A multipress gesture is used to control all this, replacing
single/double click custom code, and triggering window dragging
when the multipress is stopped, yet active (ie. the sequence remains
pressed).
2014-05-23 19:54:24 +02:00
Carlos Garnacho 185da29b68 treeview: Use multipress gesture for row activation
Replace custom double click detection with multipress gesture
2014-05-23 19:54:24 +02:00
Carlos Garnacho b0eef458d1 dnd: Use GtkGestureDrag to initiate DnD
This gesture is used by gtk_drag_source_set() to determine
whether dragging moved past the threshold. The gesture events
are handled via the usual ::event callbacks, so we don't mess
up with callers expecting that to happen in a signal handler.

If the sequence gets claimed somewhere else in the event widget
stack, the DnD gesture will be cancelled.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 6c78716531 scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
This allows children to receive an emulated press, and handle it together with
the new touch that made the scrolledwindow sequence denied.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 564789777a scrolledwindow: Fix overshoot coordinates
With gtk_gesture_get_point() returning events in
gtk_event_controller_get_widget() coordinates, we no longer need
to compensate for the overshoot here.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 38e40a55f4 widget: Add gtk_widget_set_gesture_state()
This helper function ensures the state is propagated for
all the active sequences in the given gesture.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 8e1d5f98de widget: Improve button press emulation on sequence denied
Ensure that state being set on pointer emulating touches actually
gets propagated properly on widgets with gestures that only handle
pointer events.
2014-05-23 19:54:24 +02:00
Carlos Garnacho c49ac32393 swipe: Dont emit swipe() if the gesture was denied rather than finished 2014-05-23 19:54:24 +02:00
Carlos Garnacho 55683c075c drag: Make API offsets based
It is generally more useful to get offsets right away,
than having to calculate those from the start point.
2014-05-23 19:54:24 +02:00
Carlos Garnacho 6cd0e733f5 scrolledwindow: Use GtkGestureSingle API 2014-05-23 19:54:24 +02:00
Carlos Garnacho cece9cac07 scrolledwindow: Update gesture API change. 2014-05-23 19:54:23 +02:00
Carlos Garnacho 84885c6e26 demo: Update to gesture API change 2014-05-23 19:54:23 +02:00
Carlos Garnacho a56a9e4a62 widget: Reset gestures on grab-notify
If it is determined that the gesture will stop receiving
events, reset the gesture altogether.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 997f05d99b widget: Make helper gesture API take GtkGestures
GtkEventController may be certainly useful to keep event
handling self-contained in other places than gestures, but
the current widget API is highly related to gestures, so
just using GtkGesture as the argument there will be quite
more convenient. The other places where GtkEventController
make sense as a base object will better provide their own
hooks.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 026b5014e8 Add: GTK_PHASE_NONE value to GtkCapturePhase.
Gestures attached with this phase will expect callers to have it
receive events through gtk_event_controller_handle_event(), but
the gesture will still be notified of sequence state changes,
grabs, etc...
2014-05-23 19:54:23 +02:00
Carlos Garnacho ed5d73b49a gesture: check the gesture after denying a sequence.
So the gesture emits end() timely.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 03381beacc gesture: Offer always coordinates in the gesture widget coordinate space
Translate events meant for other widgets/windows, so gtk_gesture_get_point()
always returns coordinates based on the gtk_event_controller_get_widget()
allocation.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 4c34d4566c multipress: Remove unused signal argument 2014-05-23 19:54:23 +02:00
Carlos Garnacho dca169d9f1 swipe: Make a subclass of GtkGestureSingle 2014-05-23 19:54:23 +02:00
Carlos Garnacho 315aedf5c8 drag: Make a subclass of GtkGestureSingle 2014-05-23 19:54:23 +02:00
Carlos Garnacho 000f38ed97 multipress: Make a subclass of GtkGestureSingle
The redundant API has been removed here.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 3db87cb0b7 longpress: Make a subclass of GtkGestureSingle
the redundant API here has been removed.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 5f24d1a519 gesture: Only recognize gestures with as many interacting touches as those handled
If a gesture has denied sequences (so those are presumably handled above/below
the widget), it shouldn't attempt to handle extra touches, even if those end
up matching the expected number of touches.
2014-05-23 19:54:23 +02:00
Carlos Garnacho b5c319b56f gesture: Limit API calls to non-denied sequences
Gestures do track those internally, but information about those
shouldn't be leaked on calls.
2014-05-23 19:54:23 +02:00
Carlos Garnacho 2285157c7d gesture: Require BUTTON_PRESS/TOUCH_BEGIN for sequences to be initiated.
Gestures should always receive one of such events in order to be activated,
and the propagation mechanism will ensure they do so if the original event
was caught up the widget hierarchy by another gesture that is now declining
the sequence.
2014-05-23 19:54:23 +02:00
Carlos Garnacho d89e810bd9 gesture: Only track non denied sequences in get_last_updated_sequence() 2014-05-23 19:54:23 +02:00
Carlos Garnacho b7435a0290 gesture: cancel all ongoing sequences on reset() 2014-05-23 19:54:23 +02:00
Carlos Garnacho d2c9b9c2aa gesture: Skip non-device events early. 2014-05-23 19:54:23 +02:00
Carlos Garnacho 25ece22013 gesture: Add gtk_gesture_[sg]et_window()
This can be used to restrict a gesture to an specific GdkWindow,
all events will be checked to happen on/within that window.
2014-05-23 19:54:22 +02:00
Carlos Garnacho 7f787e1d3b docs: Add GtkGestureSingle to docs 2014-05-23 19:54:22 +02:00
Carlos Garnacho c4944b0376 gesture: Remove the touch-only property
This is handled in GtkGestureSingle.
2014-05-23 19:54:22 +02:00
Carlos Garnacho d4d0f13c3a Add GtkGestureSingle
This is a GtkGesture subclass, specific to single-touch (or
mouse operated) gestures.
2014-05-23 19:54:22 +02:00
Matthias Clasen 49e9ba122a ...and add the right include instead 2014-05-23 19:54:22 +02:00
Matthias Clasen a1aeaa6b07 Remove a doubled line 2014-05-23 19:54:22 +02:00
Carlos Garnacho 8d2f81cca4 scrolledwindow: Use gesture button/touch press synthesization
This makes scrolled window fully compatible again wrt the
GtkScrolledWindow::capture-button-press property.
2014-05-23 19:54:22 +02:00
Carlos Garnacho 36106c19d4 widget: Propagate touch/button press events when a sequence is denied
If the captured touch begin or button press event have been consumed
for the given sequence, propagate it upwards if the sequence goes from
claimed to denied, so the widgets on the way to the event widget receive
a coherent event stream now that they're going to receive events.
2014-05-23 19:54:22 +02:00
Carlos Garnacho 83dd050ab2 gesture: Add private getter to know whether a touch begin was handled
If GDK_TOUCH_BEGIN was handled/consumed for a sequence, or GDK_BUTTON_PRESS was
handled for the mouse gesture, this function will return TRUE.
2014-05-23 19:54:22 +02:00
Carlos Garnacho a9fa0151f1 widget: Implement hierarchy-level mechanism to claim/deny sequences
The policy of sequence states has been made tighter on GtkGesture,
so gestures can never return to a "none" state, nor get out of a
"denied" state, a "claimed" sequence can go "denied" though.

The helper API at the widget level will first emit
GtkWidget::sequence-state-changed on the called widget, and then
notify through the same signal to every other widget in the captured
event chain. So the effect of that signal is twofold, on one hand
it lets the original widget set the state on its attached controllers,
and on the other hand it lets the other widgets freely adapt to the
sequence state changing elsewhere in the event widget chain.

By default, that signal updates every controller on the first usecase,
and propagates the default gesture policy to every other widget in the
chain on the second. This means that, by default:

1) Sequences start out on the "none" state, and get propagated through
   all the event widget chain.
2) If a widget in the chain denies the sequence, all other widgets are
   unaffected.
3) If a widget in the chain claims the sequence, then:
  3.1) Every widget below the claiming widget (ie. towards the event widget)
       will get the sequence cancelled.
  3.2) Every widget above the claiming widget that had the sequence as "none"
       will remain as such, if it was claimed it will go denied, but that should
       rarely happen.

This behavior can be tweaked through the GtkWidget::sequence-state-changed and
GtkGesture::event-handled vmethods, although this should be very rarely done.
2014-05-23 19:54:22 +02:00
Carlos Garnacho 4ec1fafe2f docs: Add GtkWidget gesture functions 2014-05-23 19:54:22 +02:00
Carlos Garnacho 83ef067ae1 scrolledwindow: port to GtkGesture
The kinetic scrolling feature is now implemented using a
GtkGestureDrag and a GtkGestureSwipe, plus a GtkGestureLongPress
in order to denying the sequence, so it is possibly handled
underneath.
2014-05-23 19:54:22 +02:00
Carlos Garnacho 76213ab209 widget: Add widget-level handling of touch sequence state.
These functions ATM do nothing but proxying the controller(s) state
with the given sequence.
2014-05-23 19:54:22 +02:00
Carlos Garnacho f1bb0283dd widget: Hook GtkEventController to widget event processing.
A controller can be optionally hooked on the capture or the bubble
phase, so the controller will automatically receive and handle events
as they arrive without further interaction.
2014-05-23 19:54:22 +02:00
Carlos Garnacho d0da82fed6 gtk: Remove propagation limit of captured events on the grab widget
Now, all captured events run from the toplevel to the deepmost widget,
regardless of GTK+ grabs. This makes captured events more useful to
event controllers if used together in the hierarchy with widgets doing
old fashioned event handling and GTK+ grabs.
2014-05-23 19:54:22 +02:00
Carlos Garnacho 71e382cf42 gtk-demo: Add simple gestures demo 2014-05-23 19:54:22 +02:00
Carlos Garnacho 73c2964e85 hook GtkGesture* into docs generation 2014-05-23 19:54:21 +02:00
Carlos Garnacho 450c754c7c Add GtkGestureMultiPress
This gesture handles any number of clicks, ensuring multiple presses
stay within thresholds and timeouts. When anything of that happens,
the gesture is reset and press count starts from 1 again.

Optionally, the gesture can be given a rectangle, used in in presses > 1
to ensure the consecutive presses happen on user imposed areas.
2014-05-23 19:54:21 +02:00
Carlos Garnacho 8026bc3651 Add GtkGestureDrag
This gesture interprets and reports drags as an offset to the drag
start point.
2014-05-23 19:54:21 +02:00
Carlos Garnacho 9db3c2d893 Add GtkGestureZoom
This gesture interprets and reports relative scale differences when fed
with events from two different GdkEventSequences.
2014-05-23 19:54:21 +02:00
Carlos Garnacho 2495b518c1 Add GtkGestureRotate
This gesture implementation recognizes rotations when fed with
events from two different GdkEventSequences
2014-05-23 19:54:21 +02:00
Carlos Garnacho 8733e2a918 Add GtkGestureSwipe
This gesture implementation recognices swipes on any direction.
The "swipe" signal has the X/Y velocity vector components, so
those can be used for direction guessing and velocity thresholds.
2014-05-23 19:54:21 +02:00
Carlos Garnacho 88d554d3ba Add GtkGestureLongPress
This gesture interprets long presses with variable delays
and thresholds
2014-05-23 19:54:21 +02:00
Carlos Garnacho 8f113e07fd Add GtkGesture
This a more specific abstract type that handles one or multiple
streams of pointer/touch events.
2014-05-23 19:54:21 +02:00
Carlos Garnacho e2b8ef8c66 Add GtkEventController
This is a basic abstract type that handles GdkEvents.
2014-05-23 19:54:21 +02:00
Benjamin Otte 6c49ffe916 themingbackground: Outset shadows require border box
They are drawn relative to the border box, not relative to the padding
box.
2014-05-23 19:29:27 +02:00
Benjamin Otte fa22218973 css: Make getter function a real getter
Initialize the passed-in value, don't treat it as an in-out parameter.
2014-05-23 19:29:27 +02:00
Matthias Clasen 486c82ae8f testsuite: Add more icon names
These were found by looking over the GTK+ sources and ui files.
2014-05-23 12:17:56 -04:00
Matthias Clasen 7caecf3979 Add more icons to check-icon-names
These are icons which are used as GtkArrow replacement, and
icons used for the volume button.
2014-05-23 11:52:12 -04:00
Matthias Clasen 28c04f4be3 testsuite: Run reftests with GTK_DEBUG=icontheme
This will hopefully help to track down some hard-to-squash
failures that only happen in gnome-continuous.
2014-05-23 11:38:24 -04:00
Benjamin Otte 74b6f5fba8 testsuite: Add a test for icon names
This test just checks that all the icon names that GTK uses are present
in the default icon theme.

As icon names are not checked programmatically and we do not want to run
into missing-icon icons in the code, this test seems necessary.

For now, it's just a stub that tests stock icons.
2014-05-23 17:12:32 +02:00
Matthias Clasen d769f338f2 GtkButton: tighten code a bit
Make it so we only use GtkMisc in one place.
2014-05-22 23:15:08 -04:00
Matthias Clasen 2df80d7a4d inspector: Repeat the keybinding warning
Show the confirmation dialog every time the keybinding is used,
until the user clicks OK.
2014-05-22 18:37:43 -04:00
Matthias Clasen 372e551a66 inspector: avoid a warning on destroy
We are only hiding the window now, so a memory management
error has crept into the destroy path.
2014-05-22 18:37:43 -04:00
Benjamin Otte e012dfab2c Revert "Fix crash"
This reverts commit 024c11dd66.

It's not a crash fix to cause a return_val_if_fail() to happen.
2014-05-22 22:35:39 +02:00
Benjamin Otte 0eb62c1629 reftests: Fix icon-vfuncs reftest
The reftest broke when font size lead to labels > 16px.
2014-05-22 22:35:08 +02:00
Behdad Esfahbod 024c11dd66 Fix crash 2014-05-22 15:52:01 -04:00
Matthias Clasen b26da6ed4f docs: Include input handling overview
Now that it is not entirely empty anymore, lets include it.
2014-05-22 15:46:42 -04:00
Matthias Clasen e491da532a Some more input handling docs 2014-05-22 15:45:31 -04:00
Matthias Clasen 3d981069ab Fill in some content in the input handling overview 2014-05-22 15:16:37 -04:00
Jasper St. Pierre 65022c4078 gdkwindow-x11: Rearrange a tiny bit 2014-05-22 15:01:36 -04:00
Jasper St. Pierre 0d3f162d6b gdkwindow-x11: Fix build 2014-05-22 15:01:23 -04:00
Jasper St. Pierre 084576f214 gdkwindow-x11: Ungrab the implicit grab before showing the window menu
Otherwise, the WM cannot take a grab on the pointer device, since we'll
still have the implicit grab.
2014-05-22 14:47:55 -04:00
Jasper St. Pierre 76e18de811 reftests: Remove the css-match-style-property-order test
It was testing -GtkWidget-focus-line-width, which is a dead property
we don't use anymore.
2014-05-22 14:47:55 -04:00
Matthias Clasen 7e562897e8 Drop an unused spec file template
Last touched in 2008...probably not relevant.
2014-05-22 14:45:54 -04:00
Jasper St. Pierre 845f29ccf5 reftests: Fix some more easy GtkButton shadow cases 2014-05-22 11:46:07 -04:00
Benjamin Otte b1a7aa49b3 reftests: Fix background-area test
The test should include reset-to-defaults.css but apparently it is older
than that file. So it broke when buttons started using shadows.
2014-05-22 17:38:50 +02:00
Jasper St. Pierre 6c3712599c gdkwindow-x11: Pass through the x/y coordinates to _GTK_SHOW_WINDOW_MENU
We accept these now.
2014-05-22 11:17:33 -04:00
Jasper St. Pierre 695ee3fc19 tests: Remove unused args 2014-05-22 11:17:32 -04:00
Piotr Drąg 27d0d5c0d0 Updated POTFILES.in 2014-05-22 16:12:06 +02:00
Matthias Clasen 3b1196fc68 Forgotten file 2014-05-22 09:31:15 -04:00
Matthias Clasen 49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
Matthias Clasen c3a9a20839 examples: Don't use gtk_application_add_accelerator
It has been deprecated.
2014-05-22 08:51:58 -04:00
Matthias Clasen 69cef3c9b4 tests: Adapt to gtk_widget_reparent deprecations 2014-05-22 08:50:18 -04:00
Matthias Clasen cbb5e27b3e tests: Update for GtkMisc deprecations 2014-05-22 08:49:18 -04:00
Matthias Clasen 39ccbe6549 tests: Drop manual property editor
No need for this anymore, now that we have the inspector everywhere.
2014-05-22 08:32:48 -04:00
Matthias Clasen bd5414addb gtk-demo: Don't use GtkArrow
It is deprecated now.
2014-05-22 08:32:48 -04:00
Matthias Clasen 2036c150ea Avoid a compiler warning 2014-05-22 08:32:48 -04:00
Marc-André Lureau a3d0b8d7f4 tests: add clipboard set_with_data test
https://bugzilla.gnome.org/show_bug.cgi?id=730183
2014-05-22 12:44:10 +02:00
Matthias Clasen 8f7dceda3c Update treeview tests for focus changes
The treeview is not using focus-pad here anymore, so update
the tests to not expect it.
2014-05-22 06:15:12 -04:00
Matthias Clasen d01a291dbc GtkScrolledWindow: Avoid a test failure
The change to take out unneeded NULL checks requires some care
at startup: we check both adjustments when any of them changes;
we need to do those checks in the same order in which we create
the scrollbars, otherwise we'll try to get the adjustment of
the vscrollbar when we just set the up the hscrollbars' adjustment.
2014-05-22 06:00:09 -04:00
Björn Lindqvist a61a11a4ea Remove redundant not-NULL checks from GtkScrolledWindow
The scrollbars are created at construction time and there is no
way to set them to NULL so remove the unnecessary NULL checks.

https://bugzilla.gnome.org/show_bug.cgi?id=525206
2014-05-21 23:04:42 -04:00
Matthias Clasen 898f0fa0b9 Avoid a critical in the file chooser
Hiding the location entry was causing criticals, because
the completion was updated after the widget has already
been disposed.
https://bugzilla.gnome.org/show_bug.cgi?id=720330
2014-05-21 22:50:48 -04:00
Benjamin Otte b90802f7e4 css: Actually break at end of the string
Introduced in 65c4c1555d.

Found by gnome-continuous running the testsuite.

Includes fixing a broken test in the testsuite.
2014-05-22 02:13:49 +02:00
Matthias Clasen 9ae12b15e9 GtkAppChooserDialog: Make the search entry wider
It was too narrow, and looked a bit odd.

https://bugzilla.gnome.org/show_bug.cgi?id=727147
2014-05-21 20:11:16 -04:00
Matthias Clasen e6c050c06f searchbar: Add some spacing
When showing the close button, and placing a wide entry in the
middle, there was no separation at all. Fix this by setting
some spacing.
2014-05-21 20:09:46 -04:00
Matthias Clasen 8591f452f0 ColorChooser: Emit notification for editor changes
When the color editor is visible, there is no way for the
application to know about the changes that are happening.
Fix this by emitting property notification for the "rgba"
property.

http://bugzilla.gnome.org/show_bug.cgi?id=708037
2014-05-21 19:23:56 -04:00
Matthias Clasen 33207f4597 Add a 3.14 index for the GDK docs 2014-05-21 19:02:52 -04:00
Matthias Clasen 3d2dcc2bfe Small typo fixes
We generally talk about the 'windowing system' in the GDK frontend
docs, not the 'window manager'.
2014-05-21 19:01:37 -04:00
Jasper St. Pierre 0ea1a526f9 gtkwindow: Use window-manager-side window menus
This avoids a bunch of policy problems with deciding how to lay
out the window menu under different WMs.

For now, we use the special event _GTK_SHOW_WINDOW_MENU, but we
hope to have this standardized in wm-spec quite soon, as KDE wants
it as well.
2014-05-21 18:41:07 -04:00
Yosef Or Boczko 02d92ff831 inspector: Use the new support for RTL icons in GtkIconTheme
https://bugzilla.gnome.org/show_bug.cgi?id=730526
2014-05-21 21:07:05 +03:00
Matthias Clasen f750f70c7d tests: Make icontheme test installable
To make the icontheme test run successfully when installed,
we need to use the correct test-framework-provided location,
and we need to install the test theme without stripping its
subdirectory structure.
2014-05-21 13:46:49 -04:00
Yosef Or Boczko c543a14c5b Use the new support for RTL icons in GtkIconTheme
https://bugzilla.gnome.org/show_bug.cgi?id=730526
2014-05-21 17:45:38 +03:00
Matthias Clasen 6b26410d38 GtkLabel: Make context menus on links work
We see an active link when creating the menu, but by the time
the menuitem is activated, we've received a leave notify that
makes the label clear its active link. Instead, give the
menuitems a direct reference to the link that is active when
the menu is created.

Problem pointed out by Tim Baedert
2014-05-21 10:29:17 -04:00
Matthias Clasen 11abc517f5 inspector: Avoid weak ref problems
We know the objects in a size group are always widgets, so we
can avoid hard-to-track down problems with weak references by
just cleaning up when the object gets destroyed. There is still
a chance that we show a widget as part of the group after it
has been removed, but size groups simply have no signals that
would let us avoid that.
2014-05-21 06:44:44 -04:00
Matthias Clasen d39ee6c81c inspector: Simplify object life-cycle handling
The prop-list doesn't use the object column in its model,
so don't put the object there. And don't leak stuff on
finalize.
2014-05-21 06:44:44 -04:00
Matthias Clasen 3d8b0514bb inspector: Use an emission hook instead of signal handlers
This is slightly easier to manage, and there's only two emission
hooks overall, instead of two signal handlers per object.
2014-05-21 06:44:44 -04:00
Yosef Or Boczko 0a0c95f39b Updated Hebrew translation 2014-05-21 12:40:41 +03:00
Yosef Or Boczko 9cbaf71e14 Updated POTFILES.in 2014-05-21 12:40:32 +03:00
Matthias Clasen af8fdac001 inspector: Show size groups
Add a tab that shows size groups of a widget. The properties
of the size group are available here, as well as the widgets
that are part of the size group. We highlight the widgets in
the application when their row in the inspector is hovered.
2014-05-20 21:44:48 -04:00
Matthias Clasen 538b987bc5 inspector: Add a way to highlight widgets
In contrast to the flashing, where we blink the widget a
few times, this is explicitly turned on and off.

It will be used for indicating widgets that are part of
a size group, in the next commit.
2014-05-20 21:43:00 -04:00
Yosef Or Boczko 65c9e2a651 inspector: Use symbolic icon everywhere
https://bugzilla.gnome.org/show_bug.cgi?id=730465
2014-05-20 16:21:28 -04:00
Yosef Or Boczko 83d43d0cfe inspector: Expand tabs in the objects section
https://bugzilla.gnome.org/show_bug.cgi?id=730465
2014-05-20 16:21:28 -04:00
Yosef Or Boczko c6a9c1231b inspector: Expand the general tabs
https://bugzilla.gnome.org/show_bug.cgi?id=730465
2014-05-20 16:21:28 -04:00
Matthias Clasen 3263b963e6 Add a skeleton for an input handling overview document
Not integrated in the docs yet, since there's no content.
2014-05-20 10:10:31 -04:00
Matthias Clasen 70cb91a827 docs: syntax fix
It is just 'Deprecated:' in doc comments, not '@Deprecated:'.
2014-05-20 09:55:29 -04:00
Matthias Clasen edd6c4d487 docs: enum cleanup
Move GtkExpanderStyle over to the deprecated GtkStyle.
2014-05-20 09:54:01 -04:00
Matthias Clasen d606021c34 inspector: Avoid a compiler warning
...and a pointless cast, too.
2014-05-20 09:54:01 -04:00
Matthias Clasen 575d0eabfb docs: enum cleanup
Move GtkResizeMode to the only place it is used.
2014-05-20 09:54:01 -04:00
Matthias Clasen 1c271365ab docs: Minor fix 2014-05-20 09:54:01 -04:00
Matthias Clasen d5251141ce docs: enum cleanup
Move GtkWindowPosition and GtkWindowType to the only place
they are used.
2014-05-20 09:54:01 -04:00
Matthias Clasen 59e4be9752 docs: enum cleanup
Move GtkJunctionSides, GtkRegionFlags and GtkBorderStyle
to the GtkStyleContext docs.
2014-05-20 09:54:01 -04:00
Matthias Clasen 73d0bcb874 docs: enum cleanup
Move GtkDragResult to the DND section
2014-05-20 09:54:01 -04:00
Matthias Clasen 04192d04a2 docs: enum cleanup
Move types that are only used in binding parsing to
gtkrc, together with the deprecated api.
2014-05-20 09:54:01 -04:00
Matthias Clasen e5a1734ce9 docs: enum cleanup
scrolledwindow part 2
2014-05-20 09:54:01 -04:00
Matthias Clasen a846e7f818 docs: enum cleanup
Move GtkCornerType to the GtkScrolledWindow docs.
2014-05-20 09:54:01 -04:00
Matthias Clasen 2430762f9b docs: enum cleanup
Move GtkButtonBoxStyle to the one place it is used, GtkButtonBox.
2014-05-20 09:54:01 -04:00
Matthias Clasen cf1c8c8c69 docs: enum cleanup
Move GtkAttachOptions to the only place its used: GtkTable
2014-05-20 09:54:01 -04:00
Matthias Clasen ee244473d6 doc: enum cleanup
Move GtkArrowType to where it is used in undeprecated api:
GtkMenuButton.
2014-05-20 09:54:01 -04:00
Matthias Clasen edde7aca60 docs: enum cleanup
Move GtkArrowPlacement to the GtkMenu docs. This type is
only used for a style property there.
2014-05-20 09:54:01 -04:00
Matthias Clasen b72f932b9a docs: enum cleanup
Move GtkAccelFlags to the GtkAccelGroup docs.
2014-05-20 09:54:01 -04:00
Yosef Or Boczko 54b0acde40 Updated Hebrew translation 2014-05-20 10:21:44 +03:00
Rico Tzschichholz 0c4dc3c157 docs: Fix make dist 2014-05-20 08:11:44 +02:00
Matthias Clasen 9af2710d84 Add man pages for gtk3-demo and gtk3-widget-factory
We install the applications, so they should also have some docs.
2014-05-19 23:20:56 -04:00
Matthias Clasen fd65b68927 docs: Trivial typo fix 2014-05-19 22:47:59 -04:00
Piotr Drąg 35af983b96 Updated POTFILES.in 2014-05-20 02:08:24 +02:00
Evan Nemerson 701adf81b6 gdk: assorted introspection and documentation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=729983
2014-05-19 11:47:59 -07:00
Matthias Clasen ca79019586 GtkSettings: load modules from settings.ini
The initialization is really suboptimal here. This fix at least
makes it so that we don't forget to load modules.

https://bugzilla.gnome.org/show_bug.cgi?id=730306
2014-05-19 14:09:16 -04:00
Yuri Myasoedov 6b2ee7c23a Updated Russian translation 2014-05-19 21:40:44 +04:00
Carlos Garnacho cacccf7a3a popover: Check for uncaught button events from children
And deal correctly with those as a click within the popover.

https://bugzilla.gnome.org/show_bug.cgi?id=727994
2014-05-19 14:00:07 +02:00
Carlos Garnacho e2cd59b731 popover: Do not hide the popover if the focus widget is just unset
The focus widget might be unset, just to be set again on a widget inside
the popover. Have the popover wait till the focus is actually moved outside
before dismissing.
2014-05-19 13:49:03 +02:00
Matthias Clasen c665564374 inspector: Build out the resource information
Show type and size for each resource.
2014-05-19 07:10:33 -04:00
Matthias Clasen 7bf3d9d0ab Fix doc syntax
End-of-comment tags don't take an @ - thats only for parameters.
2014-05-19 06:58:18 -04:00
Matthias Clasen 8c0b1697e6 inspector: string fixes
Mark user-visible strings for translation in the new property editor.
2014-05-19 00:17:23 -04:00
Matthias Clasen 9a23fd3313 inspector: Link to model for attributes 2014-05-19 00:13:30 -04:00
Benjamin Otte d260694a37 widget: Untagle if statements
Reduces the number of nested ifs and makes the code clearer.
2014-05-19 04:25:10 +02:00
Matthias Clasen 34a87ee2f3 inspector: redo property editing
Move away from cell editing, and use a popover instead. This makes
it easier to e.g. use a color chooser - there's just not enough room
in a cell for many things.

Much of this code is adapted from tests/prop-editor.c.
2014-05-18 11:43:13 -04:00
Matthias Clasen 386f1d14f0 GtkAssistant: Avoid a crash
The child properties in GtkAssistant are somewhat broken, since
they are not on direct children - but that is no reason to crash
if somebody does ask for child properties of direct children.
2014-05-18 11:43:13 -04:00
Benjamin Otte f191c13a27 API: Deprecate gtk_container_set_reallocate_redraws() 2014-05-18 16:09:21 +02:00
Michael Catanzaro 0c55b841fc Fix a typo 2014-05-17 22:21:14 -05:00
Benjamin Otte 3cb5e58b1a API: Deprecate gtk_widget_region_intersect()
It's unused and would become disambiguous once we split between
allocation and draw region.
2014-05-18 02:29:56 +02:00
Benjamin Otte 2a99584c68 API: Deprecate gtk_widget_reparent() 2014-05-17 23:36:57 +02:00
Yosef Or Boczko 2b03234466 Updated Hebrew translation 2014-05-18 00:17:57 +03:00
Matthias Clasen 70bec41f6c inspector: Allow sorting signals 2014-05-17 15:39:46 -04:00
Matthias Clasen 3d0b149e3b inspector: Allow sorting properties by origin 2014-05-17 15:35:10 -04:00
Matthias Clasen 4f830fb117 treeview: Don't show missing images
When a model is sortable, but the the column is not currently used
for sorting, we want to reserve the space for showing the sort
indicator. But we currently set the icon to 'missing-image', which
is not great to show all over the place. So, just set the opacity
to 0.
2014-05-17 15:32:54 -04:00
Piotr Drąg df61db6dbc Improve punctuation in a new translatable string 2014-05-17 20:20:45 +02:00
Matthias Clasen b4a57a0f0c inspector: Add a first-time warning
With the keybinding, it is possible that users may trigger the
inspector unintentionally. Show a dialog that informs them about
whats going on and gives them a chance to back out.

The warning dialog can be bypassed with the
org.gtk.Settings.Debug inspector-warning setting.
2014-05-16 21:51:42 -04:00
Matthias Clasen 2bf654b352 inspector: Drop an unused widget 2014-05-16 20:49:06 -04:00
Jasper St. Pierre 8c15389d76 wayland: Clean up init code a tiny bit 2014-05-16 15:35:47 -04:00
Jasper St. Pierre ffebedae40 wayland: Simplify roundtrip initialization
All the globals we care about should appear before doing anything
else, up-front, so a single round-trip after adding the registry
should be more than enough.
2014-05-16 15:35:29 -04:00
Jasper St. Pierre 72e9937e00 wayland: Remove unused stuff 2014-05-16 15:24:37 -04:00
Matthias Clasen 12f5cfac19 Trivial syntax fix 2014-05-16 14:30:34 -04:00
Chun-wei Fan 7ea0e2756a GtkInspector: Fix Build on Windows
Update visual.c to use Windows themes rather than the stock Raleigh theme,
and avoid hardcoding data paths for Windows (and Mac).  As the dlfcn.h
functions are only used when Python is enabled, move its inclusion there[*].

Also ensure that variables are declared on the top of the block.

[*] Python support Windows needs to be investigated, as POSIX signal
    handling is used there.

https://bugzilla.gnome.org/show_bug.cgi?id=730236
2014-05-16 23:50:20 +08:00
Piotr Drąg 146adf077e Updated POTFILES.skip 2014-05-16 17:30:25 +02:00
Matthias Clasen 298f76e6a3 Docs: Update an example to use current API 2014-05-16 08:25:20 -04:00
Chun-wei Fan 8d7c93ba47 Visual Studio Builds: Build GtkInspector
Add project files to build the GtkInspector sources, as gtk-inspector is a
required portion for GTK+.  "Install" the
org.gtk.Settings.Debug.gschema.xml gsettings schema file as well, so that
people can trigger GtkInspector as they develop and test their GTK+-based
programs.
2014-05-16 17:32:29 +08:00
Matthias Clasen 63e7fe3d60 inspector: Show tree model contents 2014-05-16 00:28:17 -04:00
Chun-wei Fan 58b48fa209 gdkselection-win32.c: Declare Variables At Top Of Block
...so that builds on Visual C++ can be fixed.
2014-05-16 12:25:36 +08:00
Matthias Clasen ee06b932d3 inspector: Set a window icon 2014-05-15 22:53:23 -04:00
Matthias Clasen fa80bb2324 inspector: Improve actions tab
React to action group changes, and allow changing action states.
2014-05-15 22:37:30 -04:00
Matthias Clasen 906e4adb5a inspector: ellipsize long paths 2014-05-15 22:37:30 -04:00
Benjamin Otte 271ef198bf cssimage: Implement symbolic coloring for -gtk-icontheme() 2014-05-16 04:13:39 +02:00
Yosef Or Boczko 96c476b6a0 Updated Hebrew properties translation 2014-05-16 05:11:56 +03:00
Yosef Or Boczko 20f2c84e9c Updated Hebrew translation 2014-05-16 03:09:51 +03:00
Yosef Or Boczko 7f3788e2f0 Updated POTFILES.in 2014-05-16 03:09:44 +03:00
Matthias Clasen e84a523750 inspector: Show resources
Show a list of all registered resources. If a resource looks
like text or an image, we show its content.
2014-05-15 19:36:12 -04:00
Matthias Clasen d52a01631e inspector: Redraw when visual debugging tools are toggled
This doesn't address the pixel cache yet.
2014-05-15 19:36:12 -04:00
Matthias Clasen e170f31e2a inspector: Don't show internal build ids
These ___object_x___ ids just clutter up the tree.
2014-05-15 19:36:12 -04:00
Jasper St. Pierre 75ecdf50a3 wayland: Fix GtkMenuButton popups in a terrible, hacky way
Since you can't take grabs on unmapped windows, GtkMenu takes a grab on
the menu in a convoluted way: it first grabs another window, shows the
menu window, and then transfers the grab over to the GtkMenu widget.

For normal menubars, this is perfectly fine, as the first window it grabs
is our toplevel, and that gets picked up in our transient path.  For
GtkMenuButton or other spurious uses of gtk_menu_popup, it creates a new
temporary input-only window which it takes the grab on, known as the "grab
transfer window". Since this window isn't a transient-for of our new menu
widget window, the grab isn't noticed when we go to show it, and thus the
menu ends up as a new toplevel.

Add a special hack to GtkMenu and the Wayland backend which lets us notice
this "grab transfer window", and include it in our grab finding path.

It's sort of terrible to have to hack up the widgets instead of just the
backend, but the alternative would be an entirely new window type which is
managed correctly by GDK. I don't want to write that.
2014-05-15 18:02:45 -04:00
Jasper St. Pierre f6b3f0bfc7 wayland: Clean up function to find the input seat 2014-05-15 18:02:45 -04:00
Jasper St. Pierre 7052795a80 wayland: Clean up code to find the correct seat for a window 2014-05-15 18:02:45 -04:00
Piotr Drąg eb3f2c0068 Updated POTFILES.in and POTFILES.skip 2014-05-15 20:53:48 +02:00
Yosef Or Boczko 23bfcd8e84 Updated Hebrew translation 2014-05-15 21:16:58 +03:00
Stefano Facchini ac68d1f0a1 inspector: make the classes-list toolbar sensitive 2014-05-15 18:23:48 +02:00
Stefano Facchini 78a6906d4a inspector: Fix a typo 2014-05-15 18:15:31 +02:00
Jasper St. Pierre d252282e75 inspector: git ignore template headers 2014-05-15 11:06:08 -04:00
Matthias Clasen 2e07865f67 Drop debug spew 2014-05-15 08:47:44 -04:00
Matthias Clasen 93204d3ba8 Don't lie about baselines so much
Let g_object_get (w, "valign",...) report the truth, so that the
inspector can show it without special cases.
2014-05-15 08:43:43 -04:00
Matthias Clasen e80df0aed0 Minor doc fix 2014-05-15 08:43:43 -04:00
Yosef Or Boczko e0d5d76639 Updated Hebrew translation 2014-05-15 13:09:14 +03:00
Yosef Or Boczko e24e621fff inspector: Added general.ui to Makefile 2014-05-15 12:52:47 +03:00
Matthias Clasen 42dc501133 inspector: Drop unused functions
The entire UI is constructed with templates, so the wrapper
constructors are never called, except for gtk_inspector_window_new,
which gets called from the GTK+ code.
2014-05-15 00:14:37 -04:00
Matthias Clasen 75d49675f3 inspector: Add a general information tab
It is useful to see the GTK+ version, and the various paths
that affect GTK+ operation at runtime.
2014-05-15 00:06:43 -04:00
Matthias Clasen b36c8250a9 inspector: Merge Visual and Themes tabs 2014-05-14 22:53:32 -04:00
Matthias Clasen 2d2f9861a6 inspector: Show GAction information
Show the actions that are added to GtkApplication and
GtkApplicationWindows, as well as action groups that are
inserted elsewhere with gtk_widget_insert_action_group.

https://bugzilla.gnome.org/show_bug.cgi?id=730095
2014-05-14 21:40:01 -04:00
Matthias Clasen 3f224a7165 Add private GtkWidget api for action groups
Similar to the just-added action muxer api for enumerating
action prefixes and for getting the action group for a
prefix.

https://bugzilla.gnome.org/show_bug.cgi?id=730095
2014-05-14 21:28:53 -04:00
Matthias Clasen 4396bbdb3c GtkActionMuxer: Add getters
Add a way to enumerate all prefixes, and to get the
action group for a prefix.

https://bugzilla.gnome.org/show_bug.cgi?id=730095
2014-05-14 21:27:56 -04:00
Matthias Clasen 384393e9de Revert "Add private api to load a single module"
This reverts commit 7f9a0dbe16.
2014-05-14 21:25:28 -04:00
Matthias Clasen 59c9d24bbf inspector: stop being a module
Moving the inspector into libgtk lets use reuse internals without
having to add public API for everything or inventing awkward private
call conventions.

https://bugzilla.gnome.org/show_bug.cgi?id=730095
2014-05-14 21:23:44 -04:00
Matthias Clasen 53b37b8f71 Fix GtkCalendar drawing
A gtk_widget_get_allocation call was unintentionally
dropped in 5cb43c70f7.
2014-05-14 20:38:55 -04:00
Cosimo Cecchi 6ecc431c23 placessidebar: use proper canonicalization when checking if home
Instead of just checking the string. This catches things like double
slashes, relative paths and so on.

https://bugzilla.gnome.org/show_bug.cgi?id=730142
2014-05-14 16:05:44 -07:00
Matthias Clasen 99f36ffbb4 docs: Add an index for 3.14 additions 2014-05-14 15:56:01 -04:00
Ryan Lortie 6525130740 GtkMenuShell: (model binding) show() new items
We weren't calling show() on newly-added items -- make sure we do that.

This makes the Time menu in bloatpad work properly again.
2014-05-14 15:49:30 -04:00
Piotr Drąg 583b46c9c8 Updated POTFILES.skip 2014-05-14 19:34:55 +02:00
Yosef Or Boczko 6c737b8bf0 Updated POTFILES.in 2014-05-14 14:51:10 +03:00
Matthias Clasen 8b0b024385 More deprecation docs for GtkArrow 2014-05-13 23:52:47 -04:00
Matthias Clasen a600718846 Deprecate GtkArrow
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:13 -04:00
Matthias Clasen 219f96b8a3 Drop GtkArrow use in GtkTreeView
This was just an unneeded include anyway.
2014-05-13 23:50:13 -04:00
Matthias Clasen c242437535 Drop GtkArrow use in GtkPathBar
This was just an unneeded include anyway.
2014-05-13 23:50:13 -04:00
Matthias Clasen 7269168e89 Drop GtkArrow use in GtkMenuToolButton
This was just an unneeded include anyway.
2014-05-13 23:50:13 -04:00
Matthias Clasen 57feff4e14 Drop GtkArrow use in GtkTreeViewColumn
This is in preparation for GtkArrow getting deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:12 -04:00
Matthias Clasen 26e1b7c7d7 Drop GtkArrow use in GtkToolbar
This is in preparation for GtkArrow getting deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:12 -04:00
Matthias Clasen 69314ce9e5 Drop GtkArrow use in GtkMenuButton
This is in preparation for GtkArrow getting deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:12 -04:00
Matthias Clasen 9a127d364f Drop GtkArrow use in GtkComboBox
This is in preparation for GtkArrow getting deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:12 -04:00
Benjamin Otte 0f788ab1be testsuite: Add rtl icontheme tests 2014-05-14 04:55:11 +02:00
Matthias Clasen 0f5814aa33 icontheme: Add a test for lookup order
Add tests that verify the expected lookup order between -symbolic,
-rtl/-ltr and generic fallback.
2014-05-14 04:28:36 +02:00
Matthias Clasen b0b205040c GtkIconTheme: Support looking up directional variants
Add two new icon lookup flags, GTK_ICON_LOOKUP_DIR_LTR and _RTL,
which tell GtkIconTheme to look for icon variants which have a
-ltr or -rtl suffix. GtkIconHelper adds these lookup flags when
looking up icons.

Note that due to the way this overlaps with symbolic icon lookup,
directional variants of symbolic icons must be called -symbolic-rtl, not
-rtl-symbolic.

https://bugzilla.gnome.org/show_bug.cgi?id=729980
2014-05-14 04:28:36 +02:00
Benjamin Otte 89d6598d5b icontheme: Split out symbolicness tests into own function 2014-05-14 04:28:36 +02:00
Matthias Clasen 26c2975007 testsuite: Add icontheme tests for generic fallback 2014-05-14 04:28:36 +02:00
Benjamin Otte 77a9539e07 icontheme: Do a failed lookup at the beginning
Do this to catch the g_warning() that the icontheme code emits the first
time a lookup fails.
2014-05-14 04:28:36 +02:00
Benjamin Otte 5f794773aa testsuite: Add more icontheme tests
Check that the lookup order works properly when forcing either symbolic
or regular icons.
2014-05-14 04:28:36 +02:00
Benjamin Otte 5ba4a085e2 testsuite: Add a basic icontheme test
Most of the work here is creating the infrastructure to have a custom
icon theme to add icons to and run tests against.
2014-05-14 04:28:35 +02:00
Benjamin Otte 5e07b80854 reftests: Add a test for recent commits
Check that icon-shadow is not affected by -gtk-icon-transform.
2014-05-14 04:28:35 +02:00
Benjamin Otte 783e5f7b3e themingengine: Don't transform icon shadows
.. by -gtk-icon-transform. We want a rotating spinner's shadow to still
be directed towards bottom right.
2014-05-14 04:28:35 +02:00
Benjamin Otte cb0b4b5410 css: Change CssTransformValue API
Provide API to query the matrix instead of API that applies the matrix
directly. This makes the API more flexible.

See the commits implementing shadows.
2014-05-14 04:28:35 +02:00
Benjamin Otte ce0835e539 themingengine: Draw "icon-shadow" on icons 2014-05-14 04:28:35 +02:00
Benjamin Otte 59b6dee480 reftest: Add tests for the new vfuncs
This test is a bit brittle because it doesn't properly rely on CSS
properties but needs to use widget style properties to turn of extra
sizing from widgets.

It might break in the future when porting widgets to draw properly.
2014-05-14 04:28:35 +02:00
Benjamin Otte b9f11cb636 themingengine: Draw icons for arrows 2014-05-14 04:28:35 +02:00
Benjamin Otte b0ea9e4dea themingengine: Use icons for expanders 2014-05-14 04:28:35 +02:00
Benjamin Otte bb7a5691a9 themingengine: Implement icon drawing for checks and options 2014-05-14 04:28:34 +02:00
Benjamin Otte 5d1b5c13fb icontheme: Don't force missing icon
When forcing regular or symbolic icons, fall back to the default
specified icons. This ensures that when no symbolic icon is present, an
icon will still appear - the regular one.
2014-05-14 04:28:34 +02:00
Benjamin Otte f0a5cebe23 reftests: Add a reftest for -gtk-icon-style 2014-05-14 04:28:34 +02:00
Benjamin Otte f8cccbad0e iconhelper: Respect -gtk-icon-style
This allows styling of entry icons, treeview pixbufs and images. They
can now be forced to be symbolic or regular.
2014-05-14 04:28:34 +02:00
Benjamin Otte 9619b8cff4 API: icontheme: Add 2 new GtkIconLookupFlags
GTK_ICON_LOOKUP_FORCE_REGULAR and GTK_ICON_LOOKUP_FORCE_SYMBOLIC can be
used to force a regular or symbolic icon to be loaded, even if the icon
names specify a different version.

This is intended to support the CSS property -gtk-icon-style.
2014-05-14 04:28:34 +02:00
Benjamin Otte 109fcb987b css: Add a -gtk-icon-style property
The values can be:
  "requested" - the style as requested
  "regular"   - use a regular full-color icon
  "symbolic"  - use a symbolic icon

The property defaults to "requested", so no changes should be seen
unless CSS overrides it.
It is also inherited, so that using this CSS
  .toolbar { -gtk-icon-style: symbolic; }
is enough to force the whole toolbar to use symbolic icons.
2014-05-14 04:28:34 +02:00
Benjamin Otte 55f473f4e6 spinner: Don't arbitrarily limit sizes anymore
This essentially reverts b33877e173

Now that we can theme the spinner as a real icon using -gtk-icontheme()
this limit is no longer necessary.
2014-05-14 04:28:34 +02:00
Benjamin Otte f56ba8378b css: Add -gtk-icon-transform property
This property allows transforming icons and is mainly intended to be
used for spinner animations.
2014-05-14 04:28:33 +02:00
Benjamin Otte 965cd4a9c0 css: Add GtkCssTransformValue
The value implements the 2D parts of CSS transforms. See
  http://www.w3.org/TR/css3-transforms/
For the specification.

All it does is give us an expressive way to define Cairo matrices (and
their transforms)
2014-05-14 04:28:33 +02:00
Benjamin Otte a56637b330 themingengine: Draw icons for spinners
If the -gtk-icon-source property is not set to "none" (the default),
draw it as the spinner icon. Otherwise fall back to previous methods.
2014-05-14 04:28:33 +02:00
Benjamin Otte 226e1cd2b2 css: Add -gtk-icon-source property
This is to be used for rendering icon content via CSS, such as spinners
or checkboxes.
2014-05-14 04:28:33 +02:00
Benjamin Otte 633ec8184d css: Add support for -gtk-icontheme("icon-name")
This allows using icons from the icontheme as images in CSS. The
reasoning is that this allows to give the image control about how it's
scaled (by using the icon theme's scaling method. So we can get crisp
images at different resolutions.
2014-05-14 04:28:33 +02:00
Matthias Clasen f6af96723c GtkButton: Deprecated setters and getters as well
gtk_button_set/get_alignment should be deprecated together
with the properties they are setters/getters for.
2014-05-13 22:19:30 -04:00
Jasper St. Pierre 38445e6326 wayland: Ack the configure immediately 2014-05-13 16:21:57 -04:00
Matthias Clasen 758734a8c5 gtk3-demo: Don't leak in the sizegroup example
Nobody was cleaning up the size group.
Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=645966
2014-05-13 15:50:23 -04:00
Matthias Clasen 0ee35aa27b inspector: Show text view subobjects in the tree 2014-05-13 15:20:37 -04:00
Matthias Clasen 069a2603ef inspector: Add a setting to disable the keybinding
This will be needed for lockdown, e.g. on the login screen.
https://bugzilla.gnome.org/show_bug.cgi?id=730007
2014-05-13 15:20:36 -04:00
Matthias Clasen b8531087bd inspector: All to turn it on programmatically
Export gtk_window_set_interactive_debugging.
https://bugzilla.gnome.org/show_bug.cgi?id=730008
2014-05-13 15:20:36 -04:00
Matthias Clasen 514efb51b0 Add some documentation to the filechooser schema 2014-05-13 15:20:36 -04:00
Matthias Clasen 128748c5cd Add some documentation to the colorchooser schema 2014-05-13 15:20:36 -04:00
Piotr Drąg 88c9692b2f Updated POTFILES.in 2014-05-13 19:33:15 +02:00
Matthias Clasen 123715d878 Minor documentation fix
Two stray references, pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=730035
2014-05-13 11:56:29 -04:00
Matthias Clasen b8309cdf2f Fix a leftover deprecation warning 2014-05-13 11:56:29 -04:00
Matthias Clasen ce0325207e Add a test for the previous fix 2014-05-13 11:56:29 -04:00
Olivier Brunel 0d2d1904b1 treestore: Fix segfault when reordering non-existing children
Calling gtk_tree_store_reorder() on a node without children would cause a
segfault; Fixes https://bugzilla.gnome.org/show_bug.cgi?id=698396

Signed-off-by: Olivier Brunel <jjk@jjacky.com>
2014-05-13 11:56:28 -04:00
Matthias Clasen 75c22332d0 Minor doc fixup 2014-05-13 11:56:23 -04:00
Matthias Clasen 0d8c1c9c09 Improve the GTK_STYLE_PROVIDER_PRIORITY_FALLBACK docs
Explain possible gotcha with catch-all rules.
2014-05-13 11:20:06 -04:00
Matthias Clasen 63288829b0 Add an alternative keybinding for the inspector
Control-Shift-I is already used for similar things in many
applications, so provide Control-Shift-D as an alternative.
https://bugzilla.gnome.org/show_bug.cgi?id=730043
2014-05-13 11:04:43 -04:00
Matthias Clasen f9a0a96eb4 Avoid deprecation warnings
This is testing deprecated API, after all...
2014-05-13 08:45:35 -04:00
Matthias Clasen ec0a60a248 Deprecate GtkMisc
This has been dangling ever since 3.0.
2014-05-13 08:45:00 -04:00
Matthias Clasen 7840bad5d7 Drop most uses of GtkMisc in tests
Replace them by GtkWidget h/valign. The only remaining uses
are those where a size group is involved; they can't be replaced
until GtkLabel stops looking at GtkMisc alignment for size
allocation.
2014-05-13 07:43:21 -04:00
Matthias Clasen 49188aeeda GtkLabel: Drop references to GtkMisc
GtkMisc is heading for retirement. Point to the GtkWidget h/valign
properties instead.
2014-05-13 07:14:38 -04:00
Matthias Clasen 8a8ce85ea0 GtkMenuItem: Stop using gtk_misc_set_alignment
GtkMisc is heading for deprecation. Just use GtkWidget h/valign.
https://bugzilla.gnome.org/show_bug.cgi?id=650762
2014-05-13 07:06:06 -04:00
Rico Tzschichholz 22eaffba59 Inspector: Fix make dist 2014-05-13 12:27:02 +02:00
Matthias Clasen 42f8b4b48b GtkButton: Deprecate xalign and yalign properties
These are directly passed through to GtkMisc/GtkAlignment, which
are both on the way to deprecation.
2014-05-13 06:26:19 -04:00
Matthias Clasen d292245659 gtk3-demo: Fix up toolpalette demo
The demo appears pretty broken, because some icons are not fitting
well in the grid. Just skip the problematic icons.
2014-05-13 06:26:11 -04:00
Jasper St. Pierre 9b4668c82c wayland: Update to latest xdg-shell protocol 2014-05-13 02:39:59 -04:00
Jasper St. Pierre c1efc4ad7b gdk: Add new _gdk_set_window_state
Wayland's mechanism tells us all of our new states, rather than
telling us which ones were added and removed. Add a new private
interface so that we can simply specify the new states as a
bitfield directly rather than having to compute which ones were
added and removed.
2014-05-13 02:39:59 -04:00
Matthias Clasen 807f0aa747 Minor documentation edit 2014-05-12 22:58:47 -04:00
Matthias Clasen d67751d0cc gtk3-demo: Drop unneeded gtk_init() call
GtkApplication is doing this for us.
2014-05-12 22:38:37 -04:00
Matthias Clasen 1d099fbfae gtk-demo: Don't use margin-left/right
Instead, use margin-start/end, which are the non-deprecated
replacements.
2014-05-12 22:32:51 -04:00
Owen W. Taylor 8f9e50de80 GtkPopover: inherit actions from the relative_to widget
Make the relative_to widget the parent for a GtkPopover's
GtkActionGroup. This, for example, makes the menu model of a
GtkMenuButton find action groups attached to the button.

https://bugzilla.gnome.org/show_bug.cgi?id=729915
2014-05-12 16:39:44 -04:00
Sébastien Wilmet 1e3af04dd9 gtk_text_buffer_create_tag(): returns NULL on failure
Returns NULL in case of a duplicated tag name in the tag table. It is
still a programmer error to duplicate a name, but if it happens the
behavior is a little nicer (and hopefully doesn't crash).

https://bugzilla.gnome.org/show_bug.cgi?id=614717
2014-05-12 19:10:30 +02:00
Sébastien Wilmet 68ad33cb89 Add boolean return value for gtk_text_tag_table_add()
The user doesn't need to check the return value, because if FALSE is
returned it is a programmer error. But it permits a nicer behavior for
gtk_text_buffer_create_tag() in case of failure.

https://bugzilla.gnome.org/show_bug.cgi?id=614717
2014-05-12 19:10:30 +02:00
Piotr Drąg a06fc473ec Updated POTFILES.in and POTFILES.skip
We still need .ui.h files for the inspector.
2014-05-12 16:35:46 +02:00
Matthias Clasen ea33d7a1e1 Move GtkIconFactory to deprecated section in the docs
Just catching up with reality.
2014-05-11 22:03:27 -04:00
Matthias Clasen 7b17060654 GtkIconFactory: Remove outdated information from the docs
The stock browser was removed from gtk3-demo.
2014-05-11 22:02:45 -04:00
Matthias Clasen 49733154a6 Deprecate GtkNumerableIcon
It was a failed experiment, it is basically unused, and it complicates
code in GtkIconTheme that we want to rework.
2014-05-11 22:02:32 -04:00
Matthias Clasen 5cd5db1f57 Remove a redundant check
gtk_widget_show/_hide already check the widget's visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=728135
2014-05-11 11:56:22 -04:00
Evan Nemerson 38d2458f53 gdk: add many missing (nullable) return value annotations
https://bugzilla.gnome.org/show_bug.cgi?id=729834
2014-05-11 11:48:32 -04:00
Nikita Churaev 9187b6bae7 Populate page 2 of the Widget Factory
https://bugzilla.gnome.org/show_bug.cgi?id=729598
2014-05-11 10:48:37 -04:00
Nikita Churaev 73b04b5434 Don't stretch switches in Widget Factory
https://bugzilla.gnome.org/show_bug.cgi?id=729594
2014-05-11 10:48:22 -04:00
Matthias Clasen 53a67d20a2 extract-strings: Support more GtkBuilder markup
The inspector templates are using the <item> tag with an
id attribute, which was causing extract-strings to fail.
Fix this.
2014-05-10 22:04:38 -04:00
Matthias Clasen f3227688b4 inspector: Fix button path placement 2014-05-10 22:04:37 -04:00
Matthias Clasen 8475540103 inspector: Add a visual tab
Move the show updates and flip text direction controls here,
and add controls for baseline and pixel cache debugging.
2014-05-10 22:04:37 -04:00
Matthias Clasen a145dd7097 Add data-list.ui to list of templates 2014-05-10 22:04:36 -04:00
Matthias Clasen 7a56404e7b Make the inspector available via GTK_DEBUG
Change things around so GTK_DEBUG=interactive also brings
up the inspector window.
2014-05-10 22:04:36 -04:00
Matthias Clasen 975677872f inspector: Add minimal signal tracing
Add rudimentary signal tracing. The signals tab can now count signal
emissions for all signals of the current object.
2014-05-10 22:04:35 -04:00
Matthias Clasen a0cae6957e inspector: clean up better when objects go away
Instead of manually doing it everywhere, just call set_object (NULL)
from the selection_changed handler. Fix all the set_object() functions
to deal with NULL.
2014-05-10 22:04:35 -04:00
Matthias Clasen cb85a1fa3a inspector: Improve the Inspect tooltip 2014-05-10 22:04:34 -04:00
Matthias Clasen be532bc196 inspector: Add a button for rtl flipping
Nice to have a quick way of testing this everywhere.

The implementation is not quite perfect: due to the way text
direction works in GTK+, widgets that appear in the inspector
window while we are flipped will inherit the flipped direction
instead of the fixed direction of the inspector window.
2014-05-10 22:04:34 -04:00
Matthias Clasen a089ccf5f0 inspector: Add a minimal Data tab
This will eventually show useful information about the content
of tree models.
2014-05-10 22:04:33 -04:00
Matthias Clasen 9655337407 inspector: Hide tabs instead of making them insensitive 2014-05-10 22:04:33 -04:00
Matthias Clasen 6303e62440 inspector: Make button path non-homogeneous 2014-05-10 22:04:32 -04:00
Matthias Clasen e7d3323ba7 inspector: Avoid size changes of button path 2014-05-10 22:04:32 -04:00
Matthias Clasen 46b6a32ef0 inspector: Reorder tabs 2014-05-10 22:04:31 -04:00
Matthias Clasen bf46950a09 inspector: Move scrolledwindow into prop list template 2014-05-10 22:04:31 -04:00
Matthias Clasen c744699201 inspector: Avoid a double scrolled window 2014-05-10 22:04:30 -04:00
Matthias Clasen d4522f54e7 inspector: Make notebook scrollable 2014-05-10 22:04:30 -04:00
Matthias Clasen 6824527cc4 inspector: Add models to the tree
It makes sense to add the models of tree views, icon views
and combo boxes to the tree.
2014-05-10 22:04:29 -04:00
Matthias Clasen d64a9615bc inspector: Make value ellipsized
The values can get long, so ellipsize them.
2014-05-10 22:04:29 -04:00
Matthias Clasen 2af94dff1c inspector: Add cell areas into the tree 2014-05-10 22:04:28 -04:00
Matthias Clasen 9467c56b94 inspector: Rename Widget Tree to Objects 2014-05-10 22:04:28 -04:00
Matthias Clasen 700657ad19 inspector: Deal with dying objects
The widget-tree was not safe against object just going away.
Fix this by using row references instead of iters where
necessary, and by using weak refs to clean up when objects
die.
2014-05-10 22:04:28 -04:00
Matthias Clasen 0dbfef5696 Trivial: shorten some variable names 2014-05-10 22:04:27 -04:00
Matthias Clasen e9cc859051 inspector: Add a Label column
Move the UI strings over to that column, and use the buildable
ID for the name column, where available.
2014-05-10 22:04:27 -04:00
Matthias Clasen 1a6dd9fcd2 GtkApplication: implement the active-window property
This was apparently just forgotten.
First bug found by GtkInspector.
2014-05-10 22:04:26 -04:00
Matthias Clasen 8a6421ac30 inspector: Show the default GApplication in the tree
This is a handy object to have quickly available.
2014-05-10 22:04:26 -04:00
Matthias Clasen 83503cbf20 inspector: Don't flash the window initially
This is flickery, and not really necessary.
2014-05-10 22:04:26 -04:00
Matthias Clasen 768a437c02 Work around a GtkBuilder deficiency
It turns out that an <object> with just a <signal> in it does
not work right in GtkBuilder. Work around by adding a property.
2014-05-10 22:04:25 -04:00
Matthias Clasen cda706b522 inspector: Don't show mapped/realized/visible in the tree
It does not really add much over the sensitive/insensitive rendering
that is already indicating which widget is mapped. At the same time,
set up signal handlers so we can update that when the widget changes.
2014-05-10 22:04:25 -04:00
Matthias Clasen e249c6d6ee inspector: Don't leak signal handlers
Not only was the property list connecting to notify::bla for
each property individually, it was also leaking the signal
handlers when the selected object changed. Fix both.
2014-05-10 22:04:25 -04:00
Matthias Clasen 86adead803 inspector: Minimal support for attributes
Show mapping information for cell renderer properties; no editing
yet.
2014-05-10 22:04:24 -04:00
Matthias Clasen e87addd9ae inspector: Show interfaces in the object hierarchy
This gives a more complete picture.
2014-05-10 22:04:24 -04:00
Matthias Clasen bf9d22f10f inspector: Add columns and cell renderers to the tree
These are interesting objects that are worth displaying in the tree.
2014-05-10 22:04:23 -04:00
Matthias Clasen 4a68eb6250 inspector: Improve handling of object-valued properties
When showing the objects in the tree, use the property name
as the name thats shown in the list. This makes it easier
to differentiate e.g. hadjustment and vadjustment in a
GtkScrolledWindow.
2014-05-10 22:04:23 -04:00
Matthias Clasen 9b65955961 inspector: Fix object-valued properties
The code for dealing with object-valued properties had several
bugs that lead to crashes. This change makes it work.
2014-05-10 22:04:23 -04:00
Matthias Clasen 08f2456d5f inspector: Change label of widget tree
The tree contains other objects besides widgets, so label it
'Objects'.
2014-05-10 22:04:22 -04:00
Matthias Clasen c9dba4b8e0 inspector: Show signals
Add a tab that shows available signals for each object. For now,
we only show if each signal has handlers connected or now. More
functionality will be added later.
2014-05-10 22:04:22 -04:00
Matthias Clasen 5fa71c69d8 inspector: Select a window initially
The list of toplevels also includes hidden combobox popups
and the like, so we have to be a little careful. To ensure
the right choice, we now pick the first visible window
that is not a GtkInspectorWindow.
2014-05-10 22:04:21 -04:00
Matthias Clasen a3713b51ff inspector: Drop an unused function 2014-05-10 22:04:21 -04:00
Matthias Clasen e586af3cf4 inspector: Make translatable
Mark strings in the source and in the templates as translatable.
We use the same extract-strings utility as for libgtk itself.
2014-05-10 22:04:20 -04:00
Matthias Clasen 643b6f147b Move modules/other/parasite to modules/inspector
No need for the extra subdirectory, and the name should
match the module name.
2014-05-10 22:04:20 -04:00
Matthias Clasen ccff3e952d Rename parasite to gtkinspector
This avoids namespace collisions with the original
gtkparasite project, and adds the gtk prefix to
all symbols and type names.
2014-05-10 22:04:20 -04:00
Matthias Clasen 19bf88acfa Add a 'toggle-debugging' keybinding
This is bound to Ctrl-Shift-I (for inspector) by default.
It loads the gtkparasite module and opens a parasite window.
2014-05-10 22:04:19 -04:00
Matthias Clasen 7f9a0dbe16 Add private api to load a single module
In the following commits, this function will be used to load the
gtkparasite module.
2014-05-10 22:04:19 -04:00
Matthias Clasen 87e3484aa7 parasite: Don't open a window upon load
Instead, we want to let GTK+ open a window whose life-cycle
it can control. We just ensure that all our types are registered
when the module is loaded, so GTK+ can find them.
2014-05-10 22:04:18 -04:00
Matthias Clasen 38bbde200e parasite: Two fixes for the property cell renderer 2014-05-10 22:04:18 -04:00
Matthias Clasen d7c5b55846 parasite: Some formatting cleanup 2014-05-10 22:04:18 -04:00
Matthias Clasen 36494dc8f4 parasite: Include file cleanup 2014-05-10 22:04:17 -04:00
Matthias Clasen 5b249be1f9 parasite: Use a template for window 2014-05-10 22:04:17 -04:00
Matthias Clasen 33ccb00221 parasite: some formatting tweaks 2014-05-10 22:04:17 -04:00
Matthias Clasen 33d2044406 parasite: Use a template for themes 2014-05-10 22:04:16 -04:00
Matthias Clasen ee7cc6d189 parasite: Use a template for prop list 2014-05-10 22:04:16 -04:00
Matthias Clasen ead05d0954 parasite: Use template for widget tree 2014-05-10 22:04:15 -04:00
Matthias Clasen 6f1a786413 parasite: Use template for classes list 2014-05-10 22:04:15 -04:00
Matthias Clasen 0eb330613b parasite: Use template for css editor 2014-05-10 22:04:15 -04:00
Matthias Clasen 3c22fc4ef6 parasite: Use template for object hierarchy 2014-05-10 22:04:14 -04:00
Matthias Clasen 3f5d21abec parasite: Use template for button path 2014-05-10 22:04:14 -04:00
Matthias Clasen e43aeb9a1f parasite: Allow panes to shrink
The notebook is too wide.
2014-05-10 22:04:14 -04:00
Matthias Clasen 5fcd6ba21b parasite: Use the right icon name for inspect 2014-05-10 22:04:14 -04:00
Matthias Clasen 828acee981 parasite: Don't show hicolor as an icon theme
It really isn't.
2014-05-10 22:04:13 -04:00
Matthias Clasen 9bc7cfa6ba parasite: Don't show key themes
But show the builtin theme, even if it doesn't show up in the
filesystem.
2014-05-10 22:04:13 -04:00
Matthias Clasen 9fbb704418 parasite: Turn the inspect button back into an image button 2014-05-10 22:04:12 -04:00
Matthias Clasen 8f96238194 parasite: Make flashing work better
The positioning of the highlight window was not reliable; instead
just use a after-handler for the draw signal, in the same way that
drag highlights are drawn by GTK+ itself.

And copy the code for grabbing a widget via pointer from testgtk;
that code is known to work.
2014-05-10 22:04:12 -04:00
Matthias Clasen 01cb166819 parasite: Drop an unused field 2014-05-10 22:04:11 -04:00
Matthias Clasen f78d91e5fc parasite: Make child properties insensitive when empty
When the selected object is not a widget, make the child property
list insensitive.
2014-05-10 22:04:11 -04:00
Matthias Clasen 413faa55a0 parasite: Display child properties too 2014-05-10 22:04:10 -04:00
Matthias Clasen 2166a9b163 parasite: Use a window group
By putting the parasite window in a separate group, we can interact
with it even when there is a modal dialog blocking the application
window
2014-05-10 22:04:10 -04:00
Matthias Clasen 81af602dda Initial import
This is a copy of https://github.com/chipx86/gtkparasite.git
with minimal edits to make it build.
2014-05-10 22:04:09 -04:00
Benjamin Otte 2dc100fa76 css: Add forgotten files
Forgot to add those files in 3a72e2fb24
2014-05-11 04:00:55 +02:00
Benjamin Otte 0e462f0d2d css: Implement "all" shorthand
Here's the spec:
  http://dev.w3.org/csswg/css-cascade/#all-shorthand

Also use it in the reset-to-defaults CSS where a bunch of properties had
been missing.
2014-05-11 03:23:55 +02:00
Benjamin Otte 3a72e2fb24 css: Implement "unset"
Quoting the spec:
  If the cascaded value of a property is the unset keyword,
  then if it is an inherited property, this is treated as
  inherit, and if it is not, this is treated as initial.

Spec in question:
  http://dev.w3.org/csswg/css-cascade/

Also use unset in the reset-to-defaults.css we use to reset css in
reftests.
2014-05-11 03:23:55 +02:00
Benjamin Otte f2258cb05c reftests: Create the surface after running the main loop
Running the main loop may cause resizes, so creating the surface based
on the size before running it seems wrong.
2014-05-11 03:23:55 +02:00
Benjamin Otte fa8ca5fd13 iconhelper: Simplify code
In the GTK_IMAGE_ICON_NAME case, instead of keeping around the icon_name,
create a GThemedIcon and use that. This way, we can reuse the code paths
for the GTK_IMAGE_GICON case.
2014-05-11 03:23:54 +02:00
Emmanuele Bassi 61ed31a473 win32embed: Set the visible flag and avoid recursion
We have to use the internal accessor to the visible flag, instead of
calling gtk_widget_set_visible(), from within the show() and hide()
implementations - otherwise we'll recurse.

https://bugzilla.gnome.org/show_bug.cgi?id=721069
2014-05-10 19:42:35 +01:00
Daniel Mustieles c0200b9a68 Updated Spanish translation 2014-05-10 19:53:22 +02:00
Daniel Mustieles 207f2984d2 Updated Spanish translation 2014-05-10 19:53:04 +02:00
Matthias Clasen f5e64936da GtkWindow: small cleanup
The window type is a construct-only property, so we should
pass it to g_object_new, not set it after the fact in the
constructor.
2014-05-09 17:13:53 -04:00
Cosimo Cecchi b0ace67712 widget: deprecate focus-line-width style property
Nothing in GTK uses it anymore.
2014-05-09 11:02:46 -07:00
Cosimo Cecchi 57f4d3d78a flowbox: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi 9eb1e1b15e listbox: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi 13649a3fbc colorscale: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi caa73b2128 modelbutton: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi e2f2571dee range: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi 69f2fecb1c expander: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi 853dcc615d notebook: don't use focus-line-width 2014-05-09 11:02:45 -07:00
Cosimo Cecchi 1627c903d8 spinbutton: remove unused code 2014-05-09 11:02:45 -07:00
Cosimo Cecchi 9f7bab0aca entry: remove unused code 2014-05-09 11:02:45 -07:00
Cosimo Cecchi 92d23be47d switch: don't use focus-line-width 2014-05-09 11:02:45 -07:00
Cosimo Cecchi 8fff30090b radiobutton: don't use focus-line-width 2014-05-09 11:02:45 -07:00
Cosimo Cecchi a32260660b checkbutton: don't use focus-line-width 2014-05-09 11:02:45 -07:00
Cosimo Cecchi a2a1c6da95 cellarea: don't use focus-line-width
Use CSS padding instead.
2014-05-09 11:02:45 -07:00
Cosimo Cecchi 2cbf3c66ef treeview: use the CELL style class while doing cell size request
Since we use the same style class later when we draw them. Otherwise
we'll get inconsistent results for CSS borders/paddings between the two
cycles.
2014-05-09 11:02:45 -07:00
Cosimo Cecchi 0ff3f16da1 calendar: don't use focus-line-width 2014-05-09 11:02:44 -07:00
Cosimo Cecchi 694b209094 button: don't use focus-line-width 2014-05-09 11:02:44 -07:00
Cosimo Cecchi bbadfbcd2a button: remove unused code 2014-05-09 11:02:44 -07:00
Cosimo Cecchi e8c906966e widget: deprecate focus-line-pattern style property
Nothing in GTK uses it.
2014-05-09 11:02:44 -07:00
Cosimo Cecchi a2decd1f2f widget: deprecate focus-padding style property
There's no use left inside GTK.
2014-05-09 11:02:44 -07:00
Cosimo Cecchi 5cb43c70f7 calendar: simplify code
Always use the newly introduced get_component_paddings() instead of
doing the work manually every time.
2014-05-09 11:02:44 -07:00
Cosimo Cecchi 1e66a7ccdb calendar: use CSS paddings instead of focus pad for day/week areas
focus-padding is going away.
2014-05-09 11:02:44 -07:00
Cosimo Cecchi 83b4e67307 range: remove unused code 2014-05-09 11:02:44 -07:00
Cosimo Cecchi c62d6fea70 colorscale: don't use focus padding 2014-05-09 11:02:44 -07:00
Cosimo Cecchi 365ab7f73b range: don't use focus padding 2014-05-09 11:02:43 -07:00
Cosimo Cecchi d0b8ef3a6f scale: remove unused code 2014-05-09 11:02:43 -07:00
Cosimo Cecchi 24a422631d expander: don't use focus padding 2014-05-09 11:02:43 -07:00
Cosimo Cecchi d2f77984dc expander: add support for CSS padding and borders
We need to do this since we're about to remove focus-pad.
2014-05-09 11:02:43 -07:00
Cosimo Cecchi 9a811e2c94 notebook: don't use focus padding 2014-05-09 11:02:43 -07:00
Cosimo Cecchi 80981f5c95 modelbutton: don't use focus padding 2014-05-09 11:02:43 -07:00
Cosimo Cecchi 053b21cc1f flowbox: don't use focus padding 2014-05-09 11:02:43 -07:00
Cosimo Cecchi 241b4c0c75 listbox: don't use focus padding 2014-05-09 11:02:43 -07:00
Cosimo Cecchi ceab6ee15d switch: don't use focus padding 2014-05-09 11:02:42 -07:00
Cosimo Cecchi 52e40a1725 treeview: don't use focus padding 2014-05-09 11:02:42 -07:00
Cosimo Cecchi c20e8b0b49 checkbutton: support CSS paddings and borders
We need this since we just removed focus-padding.
2014-05-09 11:02:42 -07:00
Cosimo Cecchi 99f0776f19 checkbutton: don't use focus padding 2014-05-09 11:02:42 -07:00
Cosimo Cecchi 8b068e996f button: don't read focus padding property
We're going to deprecate it.
2014-05-09 11:02:42 -07:00
Cosimo Cecchi b03c22e0c9 widget: deprecate interior-focus style property
Nothing uses it anymore inside GTK.
2014-05-09 11:02:42 -07:00
Cosimo Cecchi ce8846521e reftests: never set interior-focus 2014-05-09 11:02:42 -07:00
Cosimo Cecchi 521475da4d win32: don't set interior-focus in the theme 2014-05-09 11:02:42 -07:00
Cosimo Cecchi a3cbcc6451 textview: always use interior focus 2014-05-09 11:02:42 -07:00
Cosimo Cecchi 5a16ec366d spinbutton: remove unused code 2014-05-09 11:02:41 -07:00
Cosimo Cecchi 0c6cc487d6 radiobutton: always use interior focus 2014-05-09 11:02:41 -07:00
Cosimo Cecchi b77a8bcb95 expander: always use interior focus 2014-05-09 11:02:41 -07:00
Cosimo Cecchi 21e32f1989 checkbutton: always use interior focus 2014-05-09 11:02:41 -07:00
Cosimo Cecchi 779707fabb entry: always use interior focus 2014-05-09 11:02:41 -07:00
Cosimo Cecchi 4c06925ec2 button: always use interior focus
We're going to deprecate the property, and this is what everyone has
been using.
2014-05-09 11:02:41 -07:00
Cosimo Cecchi f656fc5997 widget-factory: use same spacing for buttons column
So that they nicely align with entries. Useful when tweaking the theme.
2014-05-09 11:02:41 -07:00
Matthias Clasen f4d02bd9c1 GtkCellArea: allow finding attributes at runtime
This will allow e.g. GtkInspector to display attribute mappings.

http://bugzilla.gnome.org/show_bug.cgi?id=729817
2014-05-08 14:09:04 -04:00
Matthias Clasen c813765430 GtkListBox: improve the docs
The documentation was not really clear about ::row-selected
not working for multi-selection.
2014-05-08 07:33:01 -04:00
David Mansfield 00275dfc9f GdkCursor: Don't leak a cairo surface
The function gdk_cursor_new_from_pixbuf creates a cairo surface
to pass to its backend implementation, but doesn't destroy it
afterwards.
https://bugzilla.gnome.org/show_bug.cgi?id=729670
2014-05-07 19:29:56 -04:00
William Jon McCann 74405cc964 Update the design for progress bars
We now use a narrower trough and paint the optional text
beside the trough instead of inside it. This makes for a much
cleaner appearance and more readable text.
2014-05-07 09:56:35 -04:00
Matthias Clasen 644f08a771 Remove debug spew 2014-05-07 06:51:51 -04:00
William Jon McCann 1c30470558 widget-factory: add linked entry and button example 2014-05-07 05:03:45 -04:00
Carlos Garnacho ac5993a7e7 wayland: Fix c&p typo in touch capabilities handling. 2014-05-06 18:37:57 +02:00
Matthias Clasen cdfcd5fc85 Bloatpad: port to new accel api 2014-05-06 10:58:52 -04:00
Benjamin Otte 352e28a138 viewport: Don't subtract borders and padding from -1
-1 is a special value for "undefined" and needs to stay that way

https://bugzilla.gnome.org/show_bug.cgi?id=729607
2014-05-06 04:02:40 +02:00
Marcus Karlsson c39b6be22b docs: Fix name of GtkFileChooser's Create Folder button
The documentation for GtkFileChooser references the button which allows
the user to create new folders as the New Folder button, although the
label actually says Create Folder.

Update the documentation to say Create Folder instead of New Folder.

https://bugzilla.gnome.org/show_bug.cgi?id=729475
2014-05-05 20:54:47 -04:00
Marcus Karlsson 7850fb62ea docs: fix typos in gtk_file_chooser_set_local_only
Change "file are files" to "file or files." Also remove an excessive
"file" in "file system."

https://bugzilla.gnome.org/show_bug.cgi?id=729473
2014-05-05 20:47:04 -04:00
Matthias Clasen 22ab2ca2a5 a11y: Avoid a warning
The listbox row accessible code was giving warnings when
parent is NULL, at destruction time.
2014-05-05 19:46:04 -04:00
Juan Pablo Ugarte b9f91bcd8c GtkColorButton: Fix recursion loop in "use-alpha" set_property() 2014-05-05 15:31:50 -03:00
Benjamin Otte 748b2bf5ae a11y: Disable deprecation warnings in AtkMisc implementation 2014-05-05 16:10:16 +02:00
Benjamin Otte a89c598617 combobox: Add workaround so evolution doesn't crash
Removing the NULL checks in 7f60cab47d
caused evolution to crash. It chains up with NULL and that used to work.

This patch should be reverted for GTK 4.0.

https://bugzilla.gnome.org/show_bug.cgi?id=729496
2014-05-05 15:53:03 +02:00
Benjamin Otte 18a594c392 applicationwindow: Properly unmap the menubar widget 2014-05-05 15:48:02 +02:00
Benjamin Otte 3aa357bcab tests: Add test for latest patch
This tesst infloops without it.
2014-05-05 15:48:02 +02:00
Benjamin Otte 65c4c1555d css: Fix printing code for CSS strings and idents
It used to infloop on special characters.
2014-05-05 15:48:02 +02:00
Benjamin Otte b356d81410 css: Split out a common function
It's used in two places already, and Iwant to use it in a third one.
2014-05-05 15:48:02 +02:00
Matthias Clasen d495ab1ca0 Small documentation update
Don't show an example that doesn't work anymore.
2014-05-05 09:41:06 -04:00
Matthias Clasen 7e8703918b Small documentation fixes
Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=729461
2014-05-05 07:25:27 -04:00
Matthias Clasen 3e80ce39e1 GtkApplication: Clarify docs a bit
Explicitly mention how gtk_application_set_accels_for_action can
be used to remove all accelerators for an action.

https://bugzilla.gnome.org/show_bug.cgi?id=729451
2014-05-05 07:25:27 -04:00
Ihar Hrachyshka 349ed52b7b Updated Belarusian translation 2014-05-04 22:09:19 +00:00
Paolo Borelli abf10a74b7 listbox: check gsequence end iter in get_row_at_index 2014-05-04 19:45:28 +02:00
Matthias Clasen d1d2763d00 GtkHeaderBar: Allow overdrawing
The draw function of GtkHeaderBar was returning TRUE, causing
after-signal handlers to not run. This breaks e.g. drawing of
dnd hightlights. Fix that.
2014-05-03 13:16:46 -04:00
Matthias Clasen a41e2b901d Fix a thinko in the last color button change
Using the interface method in the set_property implementation
leads to an infinite recursion, if the interface method is in
turn using g_object_set.
2014-05-02 21:09:05 -04:00
Matthias Clasen 70a5e66d2f a11y tests: Avoid deprecation warnings
We can't drop the index-based AtkTable methods unless we change
the output format, so just ignore the deprecations for now.
2014-05-02 20:59:00 -04:00
Matthias Clasen 1bf6ad314d a11y tests: Update expected output
The new AtkValue interface aways returns doubles, which causes
the range to be printed out with decimals.
2014-05-02 20:53:02 -04:00
Matthias Clasen 4fc256de8a a11y tests: Use the new AtkValue interface
The old interface is deprecated, and we just implemented the
new one, so lets test it.
2014-05-02 20:52:56 -04:00
Matthias Clasen 47094a2a8a GtkDialog: Reduce a g_warning to a g_message
Otherwise, this breaks our testsuite.
2014-05-02 20:47:56 -04:00
Matthias Clasen 9d7f7ddadf GtkSpinButton: Implement new AtkValue interface
The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
2014-05-02 20:47:16 -04:00
Matthias Clasen fc7e7495a6 GtkScaleButton: Implement new AtkValue interface
The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
2014-05-02 20:47:00 -04:00
Matthias Clasen 516cd70780 GtkRange: Implement new AtkValue interface
The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
2014-05-02 20:46:45 -04:00
Matthias Clasen 1d50657740 GtkProgressBar: Implement new AtkValue interface
The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
2014-05-02 20:46:30 -04:00
Matthias Clasen 98affc6829 GtkPaned: Implement new AtkValue interface
The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
2014-05-02 20:46:17 -04:00
Matthias Clasen 987cce9e65 GtkLevelBar: Implement new AtkValue interface
The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
2014-05-02 20:46:03 -04:00
Matthias Clasen 456dffcbfd GtkWidget: Mark deprecated properties as such
The ::style, ::margin-left and ::margin-right properties are all
deprecated.
2014-05-02 19:25:27 -04:00
Matthias Clasen f66e239fe4 Drop unneeded deprecation suppression
Removing this did not produce any deprecation warnings.
2014-05-02 18:50:52 -04:00
Matthias Clasen 4cdc32974a queryimmodules: Localize suppressed deprecation
Drop the blanket GDK_DISABLE_DEPRECATION_WARNINGS and avoid
deprecated API as much as possible.
2014-05-02 18:48:36 -04:00
Matthias Clasen 67b10e649e GtkColorButton: Reduce internal use of deprecated API
Drop the blanket GDK_DISABLE_DEPRECATION_WARNINGS and avoid
deprecated API as much as possible.
2014-05-02 18:42:18 -04:00
Matthias Clasen 69234cfecc GtkColorButton: Update deprecation warnings
It is not great to have deprecation warnings point to another
deprecated function. Update them to point to the eventual
replacement.
2014-05-02 18:41:29 -04:00
Matthias Clasen c4ec89cf9d GtkDialog: Warn about lack of transient parents
We want make it mandatory for dialogs to have transient parents,
eventually. This is a first step in that direction.
2014-05-02 18:23:58 -04:00
Matthias Clasen 3db60baf2d teststack: don't enumerate transitions manually
Thats what introspection is for.
2014-05-02 17:43:18 -04:00
Matthias Clasen 3957ce4898 GtkStack: Avoid compiler warnings
gcc warns about unhandled enum values in these switch statements,
so add an empty default: case to placate the compiler.
2014-05-02 17:15:49 -04:00
Philip Chimento 5b5813fcdc stack: Add counterparts of OVER_UP_DOWN transition
The GtkStackTransitionType enum now has OVER_DOWN_UP, OVER_LEFT_RIGHT,
and OVER_RIGHT_LEFT values to complement OVER_UP_DOWN.

https://bugzilla.gnome.org/show_bug.cgi?id=726676
2014-05-02 16:54:41 -04:00
Philip Chimento a27b0bad86 stack: More readability when adding transitions
This small refactor makes the code more readable when adding more
transition types that have left, right, up, and down variations.

It adds inline boolean functions to tell information about transition
types (avoiding long if clauses) and changes long chains of "else if
(transition_type == ...)" into switch statements. Both are only likely
to get longer as more transition types are added.

https://bugzilla.gnome.org/show_bug.cgi?id=726676
2014-05-02 16:54:41 -04:00
Cosimo Cecchi c05525127b overlay: don't have a custom draw implementation
We can't think with Benjamin of a reason this should be needed, so let's
just remove it.
2014-05-02 20:42:54 +02:00
Cosimo Cecchi a303547489 themingengine: only round outline corners after shrinking
Ensures the correctness of the applied radius.
2014-05-02 20:42:54 +02:00
Juan Pablo Ugarte b059098c71 GtkBuilder: added template parent type check. 2014-05-02 14:38:05 -03:00
Juan Pablo Ugarte 35df3bc182 GtkFlowBox: fixed NULL dereferencing segfaults 2014-05-01 20:31:59 -03:00
Juan Pablo Ugarte a05b55872b GtkMenu: fixed more NULL dereferencing segfault 2014-05-01 20:31:31 -03:00
Juan Pablo Ugarte 018c394c52 GtkGrid: gtk_grid_get_size_for_size() do not dereference a NULL pointer. 2014-05-01 19:54:43 -03:00
Juan Pablo Ugarte 49fa04212b GtkBuilder: improved parsing error report for invalid properties and signals.
Added GTK_BUILDER_ERROR_INVALID_PROPERTY and GTK_BUILDER_ERROR_INVALID_SIGNAL
error codes

ObjectInfo: Use a GType instead of a char * for the class name.
PropertyInfo: Use a GParamSpec instead of a char * for the property name.
SignalInfo: Use signal id and detail quark instead of a detailed signal name string.

This not only save us a few malloc in each case but lets us simplify the code
and report unknown properties and signals as a parsing error instead of just
printing a warning.
2014-05-01 17:59:53 -03:00
Juan Pablo Ugarte c4afca906c GtkBuilder: fixed a few minor memory leaks.
Fixed memory leaks in parse_object(), parse_template() and parse_signal() functions.
Parameters value where strduped before the last posible return and not freed.
2014-05-01 17:59:53 -03:00
Руслан Ижбулатов 0dd810ee22 W32: override selected button style to remove colored background
https://bugzilla.gnome.org/show_bug.cgi?id=729353
2014-05-01 18:20:20 +00:00
Руслан Ижбулатов b83880b981 W32: Add a theme for .app-notification
This is copied from Adwaita. Looks sufficiently ok.

https://bugzilla.gnome.org/show_bug.cgi?id=729346
2014-05-01 17:54:46 +00:00
Cosimo Cecchi 24fd96d837 listbox: fix a segfault
Don't dereference a NULL pointer.
2014-05-01 19:48:41 +02:00
Cosimo Cecchi 7f60cab47d combobox: fix a segfault
Don't dereference a NULL pointer.
2014-05-01 19:44:12 +02:00
Cosimo Cecchi 489970bcdc themingengine: use outlines to render focus rings
Instead of the old non-CSS implementation. This allows us to get rid of
the very last piece of custom theming in Adwaita.
2014-05-01 18:14:49 +02:00
Cosimo Cecchi e8cbbedbb2 css: add properties for outline-radius
Both a shorthand and individual properties. This is not officially part
of the CSS standard, but there's precedence for it at least in Mozilla:
https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius
2014-05-01 18:14:49 +02:00
Cosimo Cecchi a60ba815d9 treeview: respect focus-padding when rendering focus
Adwaita had a hack to work this around, but now that we're moving focus
ring rendering into GTK, we can just fix the treeview instead.
2014-05-01 18:14:49 +02:00
Benjamin Otte b4282e5ef1 treeview: Always call size request funcs with valid out pointers
Not doing so causes crashes since
a158a2aa48c8023f99963642cc2657bff207b82NULLd
2014-05-01 15:16:17 +02:00
Benjamin Otte c0f556ab71 revealer: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 17e0f9fb0a popover: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte b4ee8a9daf menuitem: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 34cfd5cd78 menu: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte fd527691a8 levelbar: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 6be0603215 eventbox: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte d7a3e67025 listbox: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 562147c267 frame: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 209781ae3c headerbar: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 68ceab6872 infobar: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte f72b496a45 grid: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 9ee00c3522 scrolledwindow: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte ddbd71e22a switch: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte c3dd043765 toolbar: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte a158a2aa48 treeview: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +02:00
Benjamin Otte 9652b8cf82 viewport: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte 29a4f0131e viewport: Implement hfw properly
Previously, the code would fall back on GtkBin's hfw implementation
which didn't account for padding and borders.
2014-05-01 14:51:27 +02:00
Benjamin Otte b261fc64e2 viewport: Use a convenience function
That function looks longer than not using it, but we'll need it in the
next commit.
2014-05-01 14:51:27 +02:00
Benjamin Otte 2e2e3a5e24 viewport: Request 2x border-width
It's nice that bugs get pointed out in code comments. Fixing them would
probably have been preferrable though.
2014-05-01 14:51:27 +02:00
Benjamin Otte db791ba3f5 widget: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte 43e470dad1 flowbox: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte 7455ab72f8 combobox: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte 3914bc9ce6 button: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte 71fe1a5fe3 alignment: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte e6b15c88ca arrow: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Benjamin Otte a1bba344f2 spinner: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:27 +02:00
Cosimo Cecchi 67981b1831 modules: remove the pixbuf engine directory
This is not used anywhere, and is commented out of the build because it
doesn't compile. Time for some spring cleaning...
2014-05-01 11:22:11 +02:00
Piotr Drąg 4101adb7ac Updated POTFILES.skip 2014-04-30 22:15:01 +02:00
Matthias Clasen ff87672780 GtkSearchBar: fix the template
There was a mismatch between GtkSearchBar being derived from GtkBin
and the template claiming the parent to be GtkBox.
2014-04-29 21:46:38 -04:00
Matthias Clasen 4d36fab72a widget-factory: populate the second page more
Add back a menubar example that was lost a while ago, and also
include a searchbar and an infobar.
2014-04-29 21:43:11 -04:00
Matthias Clasen bc057d849a widget-factory: rearrange page 2 a bit 2014-04-29 16:51:44 -04:00
Benjamin Otte f0ebb15dab reftests: Add test for latest commit
Check that the label gets linebroken properly.
2014-04-29 19:36:26 +02:00
Benjamin Otte 8b15cd33ee window: Subtract shadow from passed in width for height
... and height for width in size requests. Fixes mislayout in
control-center universal access panel.
2014-04-29 19:36:26 +02:00
Benjamin Otte 73aa7bd2f5 widgets: Remove (GtkTickCallback) casts
Instead, make the functions conform to the prototype, so that casting
isn't needed.
2014-04-29 19:35:29 +02:00
Matthias Clasen 6061f234a9 GtkMenuSectionBox: Don't show separators for nested subsections
...unless they are labeled.

To implement this, keep track of the nesting depth of section boxes,
starting from 0 for the toplevel and the submenu ones, and only
insert unlabeled separators if the depth is at most 1.
2014-04-29 12:19:53 -04:00
Matthias Clasen f3ba001a1d GtkMenuSectionBox: Always show separators for labeled sections
...unless they are empty.
2014-04-29 12:19:53 -04:00
Matthias Clasen 4f293c427c Add a comment with rules for separators 2014-04-29 12:19:53 -04:00
Juan Pablo Ugarte 9753f9f55f Added template test case to builder test. 2014-04-29 12:29:18 -03:00
Matthias Clasen effc7514e7 GtkMenuSectionBox: don't leak
This wasn't fully fleshed out yet.
2014-04-29 10:18:22 -04:00
Matthias Clasen f248b21b1b widget-factory: Add a horizontal-buttons example
Sadly, we don't have good icons for payment methods...
2014-04-29 06:22:28 -04:00
Alexander Larsson c0a87a85f4 treeview: Fix prelight redraw when adjustment changes
When the adjustment changes (due to e.g. a mouse wheel scroll) we update
the prelight. The part that un-prelights the previous prelight was
broken by the the pixel cache, as it called update_prelight in the
middle of the scrolling operation, where the windows were moved
but the tree_view->priv->dy was not changed to the new value. This
caused the updates to the pixel cache to go to the wrong place.

We fix this by fully doing the scroll before we update_prelight().

https://bugzilla.gnome.org/show_bug.cgi?id=728284
2014-04-29 09:12:02 +02:00
Matthias Clasen 6fb69a3e09 3.13.1 2014-04-28 23:02:36 -04:00
Matthias Clasen a2fb74c375 Update output of a11y tests
These are all affected by the addition of the action_box in
GtkDialog or by the switch to popovers in GtkMenuButton.
2014-04-28 22:55:44 -04:00
Matthias Clasen a6fb006ab5 GtkMenuShell: We want separators in submenus
This was probably an oversight when adding the merge_separators
parameter. Without this change, the testsuite/gtk/gtkmenu test
fails.
2014-04-28 22:46:25 -04:00
Matthias Clasen 723dc0667e GtkMenuShell: Don't use a non-existing property
GtkMenuTrackerItem::visible was removed a few commits ago.
It is not necessary to bind visible anyway, since the menu
tracker will insert and remove items as their visibility
changes.
2014-04-28 21:55:41 -04:00
Matthias Clasen c8e15e43e9 testmenubutton: Add a toggle for use-popover 2014-04-28 21:55:41 -04:00
Carlos Garnacho 8e5982ca9d gdkwindow: ignore shape on client-side windows when recomputing visible regions
Rendering doesn't do much about clipping drawing operations to the window shape,
although invalidation applies the shape to every window, leaving possibly trails
of "overrendered" content. So ensure the shape portions get invalidated too when
the window is moved/resized.

https://bugzilla.gnome.org/show_bug.cgi?id=729095
2014-04-28 22:44:59 +02:00
Carlos Garnacho 5b72e0f8cf popover: Always make room for the tail on all sides on size request
Now that popovers may snap to any side with enough space, make enough
room on every side when requesting size, so that there's no w/h differences
at the time of setting the child allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=729097
2014-04-28 22:35:32 +02:00
Juan Pablo Ugarte d1467c191d GtkRecentChooserMenu: Set current uri before activating an item.
When activating an item using mnemonics GtkRecentChooserMenu does not select a
item before calling the item-activated signal thus
gtk_recent_chooser_get_current_uri() always return the last selected item
instead of the activated one.

Fixes Bug 495105 "Open recent file keyboard shortcuts do not work correctly"
2014-04-28 17:08:12 -03:00
Matthias Clasen 2dcf6c6b71 Raleigh: fix a typo 2014-04-28 15:39:21 -04:00
Matthias Clasen 0af4b71cd1 GtkDialog: protect against show_all
The real reason for the problem that the just reverted change
was supposed to address is that testfilechooser uses show_all
to tease out places where composite dialogs don't properly
protect their internals against unintended showing. Well,
lets do that, then.
2014-04-28 15:39:21 -04:00
Matthias Clasen 26d6eadab7 Revert "GtkFileChooserDialog: Avoid a bottom border in the dialog"
This reverts commit d871105fa8.
2014-04-28 15:39:21 -04:00
Matej Urbančič ca4a917562 Updated Slovenian translation 2014-04-28 21:09:16 +02:00
Matej Urbančič 1c04d7db8f Updated Slovenian translation 2014-04-28 21:07:38 +02:00
Matthias Clasen 6c3936fb9a Document iconic section support
https://bugzilla.gnome.org/show_bug.cgi?id=727477
2014-04-28 14:21:07 -04:00
Matthias Clasen 7fa1133912 Add an example of iconic rendering
testpopover now shows several examples of icon buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=727477
2014-04-28 14:20:27 -04:00
Matthias Clasen 28a567f5a9 GtkMenuSectionBox: add support for iconic sections
Sections that have the display-hint attribute set to
"horizontal-boxes" will be rendered as a row of icon
buttons, instead of menuitem-like.
2014-04-28 14:20:26 -04:00
Matthias Clasen 8fff8acbac GtkMenuTrackerItem: Add support for display-hint
This commit adds a getter for the display-hint attribute.
2014-04-28 14:20:26 -04:00
Matthias Clasen 6429b33f44 GtkModelButton: Add an iconic mode
In iconic mode, model buttons will be styled like regular icon
buttons, preferring to show only the icon if one is set, falling
back to showing the label.

https://bugzilla.gnome.org/show_bug.cgi?id=727477
2014-04-28 14:20:15 -04:00
Matthias Clasen 038de02574 GtkMenuTrackerItem: Add support for verb-icons
When rendering iconic sections, we want to use icons for verbs,
and we want to differentiate these in the menu model, to keep
the icon attribute reserved for nouns.

https://bugzilla.gnome.org/show_bug.cgi?id=727477
2014-04-28 14:14:43 -04:00
Ryan Lortie 5137e491dc GtkPopover: new approach to menu model binding
Instead of using GtkMenuTracker to flatten the sections into a single
linear menu, handle the sections ourselves by nesting boxes.

Each section gets an inner and outer box.  The inner box numbers its
children in the way that the tracker instructs.  The outer box
containes the inner box and the separator, if appropriate.

Having the two separate boxes will allow us to change the orientation of
the inner box if we want to pack widgets horizontally within a section.
2014-04-28 14:14:42 -04:00
Ryan Lortie d930716daf GtkMenuTracker: add 'merge_sections' flag
Add the possibility of a GtkMenuTracker that performs no section
merging.  Instead, it will report an item in the form of a separator for
subsections.  It is then possible to get a separate tracker for the
subsection contents by using gtk_menu_tracker_new_for_item_link().
2014-04-28 14:14:42 -04:00
Ryan Lortie f6ee00769a GtkMenuTracker: don't specialise "submenu" link
We have some API in GtkMenuTracker and GtkMenuTrackerItem that is
specifically designed to deal with submenus.

Generalise these APIs to take a 'link_name' parameter that we always
give as G_MENU_SUBMENU for now.  In the future, this will allow creating
trackers for other types of links, such as sections.
2014-04-28 14:14:41 -04:00
Ryan Lortie 48db841822 GtkMenuTracker: make "is-visible" a property
Make this a property just like all of the other things and make the APIs
for accessing it non-private (but add a note that they are not intended
to be used).
2014-04-28 14:14:41 -04:00
Ryan Lortie 06ab1d9203 GtkMenuTracker: remove "visible" property
This is in conflict with the "is-visible" pseudo-property which is about
to be promoted to being an actual property.
2014-04-28 14:14:40 -04:00
Руслан Ижбулатов 5432c37d5a W32: Update the css to match the .modelbutton->.button.menuitem transition 2014-04-28 15:51:51 +00:00
Matthias Clasen baaf201f2a Rename the modelbutton style class
This is not a great name to use in themes; instead, add the
menuitem class, so themes can use .button.menuitem for styles
that are specific to menuitem-like buttons.
2014-04-27 18:49:27 -04:00
Matthias Clasen f1b423e60f Add a popover menu example to gtk3-widget-factory 2014-04-27 12:13:35 -04:00
Matthias Clasen 6cd3c73f21 Add a paned example to gtk3-widget-factory 2014-04-27 10:30:10 -04:00
Matthias Clasen 37c9a9aafe Fix testmenubutton
The menu model examples was messing up the order of its items.
2014-04-26 17:49:52 -04:00
Matthias Clasen 987b56973c GtkModelButton: improve size allocation
Only reserve size for an indicator if at least one sibling
actually has an indicator.
2014-04-26 17:48:57 -04:00
Matthias Clasen a5d2778737 Actually set the default for GtkMenuButton::use-popover
The previous commit changed the property declaration, but
omitted the actual change of the default.
2014-04-26 14:40:52 -04:00
Adel Gadllah b395929a16 gdkscreen-wayland: Emit monitors-changed when the output scale changes
https://bugzilla.gnome.org/show_bug.cgi?id=729013
2014-04-26 17:32:57 +02:00
Matthias Clasen b6e724e76f Add Adwaita to the list of default icon themes
Hardcode the fallback to Adwaita. I'm leaving gnome in here for
now, since we're in the middle of the transition. It will be
removed before 3.14.
2014-04-26 10:14:38 -04:00
Juan Pablo Ugarte f2d488dea1 Fixed crash in GtkLockButton if a button with permission set to NULL is clicked.
https://bugzilla.gnome.org/show_bug.cgi?id=728992
2014-04-25 22:13:56 -04:00
Matthias Clasen 063bd57873 GtkWindow: Avoid a critical in F10 handling
The focus widget might be NULL, and we were forgetting to take
that possibility into account in one place.
2014-04-25 22:12:05 -04:00
Matthias Clasen 45735c5b3c tests: add missing files to EXTRA_DIST
https://bugzilla.gnome.org/show_bug.cgi?id=728846
2014-04-25 22:12:04 -04:00
Matthias Clasen 516f1e1808 Add missing templates to testdialog
This makes the template test cases not crash. The templates also
serve to test the new action widget support.

https://bugzilla.gnome.org/show_bug.cgi?id=728846
2014-04-25 22:11:54 -04:00
Matthias Clasen 66b6078ae2 GtkDialog: Update suggested-action more carefully
We were not really handling all cases correctly here. We want
the suggested-action style class to only be set on headerbar
buttons, and it should be set on the default widget. Ensure
this by syncing the suggested-action style class with the
default style class. As a side-effect, setting has-default
on an action widget in ui files will now have the expected
effect.

https://bugzilla.gnome.org/show_bug.cgi?id=728846
2014-04-25 22:11:53 -04:00
Matthias Clasen 90559a3fc5 GtkDialog: Support adding action widgets in ui files
GtkDialog has convenience API for adding action widgets that are
either placed in the action area or the headerbar. This commit
makes the same functionality available from GtkBuilder ui files
by specifying "action" as the child type.

https://bugzilla.gnome.org/show_bug.cgi?id=728846
2014-04-25 22:11:38 -04:00
Antoine Jacoutot 8935d2f123 openbsd: properly set len for gtkmountoperation-x11
sysctl(3) is the correct way to get the lenght for len in this case.
Also drop unused headers and change style to match the rest of the file.
2014-04-25 14:37:59 +02:00
Matthias Clasen fab2173b31 GtkMenuButton: use popovers by default
When constructing from a menu model, use popovers by default.
This change has the potential to cause some size problems for
applications with big gear menus, so we're doing it early in
the cycle to uncover and fix those.
2014-04-24 23:35:18 -04:00
Marc-André Lureau 4480bf382a gdk/win32: VK_SNAPSHOT maps to GDK_Print
Also, I am not sure the above VK_PRINT -> GDK_Print mapping is
correct, but it doesn't hurt yet.

https://bugzilla.gnome.org/show_bug.cgi?id=686170
2014-04-24 16:31:09 +02:00
Marc-André Lureau 2230fea0b6 win32: add more clipboard data checks to avoid crash
It may happen that the received clipboard data is empty, but
if it's of type image/bmp, gtk+ will crash:

gdk_property_change: 00030AD4 GDK_SELECTION image/bmp REPLACE 8*0 bits:
... delayed rendering
gdk_selection_send_notify_for_display: 00030AD4 CLIPBOARD image/bmp
GDK_SELECTION (no-op)
_gdk_win32_selection_convert_to_dib: 1252003C image/bmp

Program received signal SIGSEGV, Segmentation fault.
0x749a9f40 in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll

Thread 1 (Thread 2248.0x1b34):
target=0xc07b) at gdkselection-win32.c:1292
at gdkevents-win32.c:3498
wparam=8, lparam=0) at gdkevents-win32.c:232
message=773, wparam=8, lparam=0)
    at gdkevents-win32.c:263
C:\Windows\syswow64\user32.dll
C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll
wparam=0, lparam=-1687549457)
    at gdkevents-win32.c:248
C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll

https://bugzilla.gnome.org/show_bug.cgi?id=728745
2014-04-24 16:12:07 +02:00
Руслан Ижбулатов 37aa840e89 W32: Add modelbutton styles
According to what i've been told, modelbuttons are supposed to look
flat, like menu items.

This is basically an improved copy of the menuitem styles.

https://bugzilla.gnome.org/show_bug.cgi?id=728810
2014-04-24 03:35:50 +00:00
Руслан Ижбулатов 1bcd7c40bd W32: Add a set of "focused" styles to checkmarks
This prevents checkmarks in modelbuttons from being styled as buttons
(apparently, modelbuttons apply "focused" to their children, unlike
normal buttons).

https://bugzilla.gnome.org/show_bug.cgi?id=728808
2014-04-24 03:35:50 +00:00
Руслан Ижбулатов 5309149f75 W32: Fix dummy prelight style for check/radio buttons
Use a dummy transparent gradient instead of actual color (which screws up
focus rectangle on prelight), and apply to non-prelight state as well.

https://bugzilla.gnome.org/show_bug.cgi?id=728807
2014-04-24 03:35:49 +00:00
Руслан Ижбулатов f4b61e92f6 W32: remove the blue "selected" rectangle when activating a checkbutton
https://bugzilla.gnome.org/show_bug.cgi?id=728806
2014-04-24 03:35:49 +00:00
Matthias Clasen 93177f7bf0 Add all version macros to the docs 2014-04-23 23:25:30 -04:00
Matthias Clasen ea61bdf1a0 Add GDK_VERSION_3_14
https://bugzilla.gnome.org/show_bug.cgi?id=728814
2014-04-23 23:25:07 -04:00
Yosef Or Boczko 60f49c097a Updated Hebrew translation 2014-04-23 12:50:51 +03:00
Matthias Clasen 6e5191f6b6 dialog: keep action area stretched out
Adding an extra box in between had the side effect of
making the action area no longer go all across the dialog.
Setting hexpand compensates for this.
2014-04-23 00:05:15 -04:00
Carlos Garnacho 1a2a5a44bd wayland: handle the wl_touch interface
The events are routed through a new slave device with type
GDK_SOURCE_TOUCHSCREEN, minimal tracking of touches is done
to keep the state for each of those.

https://bugzilla.gnome.org/show_bug.cgi?id=728426
2014-04-22 23:54:43 -04:00
Carlos Garnacho af8d6e6549 wayland: Separate master devices from seat capabilities
The master pointer/keyboard pair should never disappear or be
inconsistent. The seat capabilities are now reflected through
slave devices, those may come and go freely as the seat
capabilities change. This also enables adding further capabilities
to handle eg. touch.

https://bugzilla.gnome.org/show_bug.cgi?id=728426
2014-04-22 23:50:55 -04:00
Matthias Clasen aab1610d40 DND: go back to a timeout for cancel animation
Using a tick callback does not really make sense here, since we
are not drawing in a window, but moving a toplevel around.
https://bugzilla.gnome.org/show_bug.cgi?id=728183
2014-04-22 23:45:59 -04:00
Matthias Clasen d871105fa8 GtkFileChooserDialog: Avoid a bottom border in the dialog
We recently started to respect border-width on the action_area
again, so set its border-width to 0 so it doesn't get in the way.

https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 23:10:01 -04:00
William Jon McCann 7e479aa9ee dialog: add a box around the action area to use for styling
If we want to set style properties that include the area
of the border-width part of action_area we need to use a
parent box.

https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:02 -04:00
William Jon McCann 384b227e7b file-chooser: make enter location an operation mode
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:02 -04:00
William Jon McCann 20dfe1dd7f file-chooser: merge path bar mode and location mode
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:01 -04:00
William Jon McCann d8ca588e17 file-chooser: remove select a folder info message
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:01 -04:00
William Jon McCann d46ed4ec00 file-chooser: don't use an special label for recent
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:00 -04:00
William Jon McCann a644b34154 file-chooser: add a search bar instead of using a path bar mode
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:00 -04:00
William Jon McCann cf9b29705f file-chooser: add sidebar class to sidebar
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:35:00 -04:00
William Jon McCann b5e13cd68f file-chooser: style location bar as a search bar
So we get a nice bottom border etc.

https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:59 -04:00
William Jon McCann b05b91c692 file-chooser: style save mode name box as a search bar
So we get a bottom border etc.

https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:59 -04:00
William Jon McCann 22e3552a9d file-chooser: don't show a "save folder:" label
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:58 -04:00
William Jon McCann 5c42068bb3 file-chooser: move location entry into same place as pathbar
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:58 -04:00
William Jon McCann 1e925a85ca places-sidebar: add optional enter location place
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:58 -04:00
William Jon McCann e2b2339b89 file-chooser: no shadow on scrolled window
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:57 -04:00
William Jon McCann c253bc3165 file-chooser: use an action bar for extra widgets area
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:57 -04:00
William Jon McCann df9522d8a8 file-chooser: allow views to extend to the sides of the dialog
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:56 -04:00
William Jon McCann 458cd04c13 file-chooser: move filter combo into extra area
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:56 -04:00
William Jon McCann 256a3a51da file-chooser: move pathbar into preview pane
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:56 -04:00
William Jon McCann 5a73757cdb places-sidebar: use separators instead of heading labels
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:55 -04:00
Jason Ekstrand f02663532d Get rid of a stray character 2014-04-22 22:28:34 -04:00
Matthias Clasen 6193b9b640 csd: Fix drag hightlight drawing
When making the entire window a drop target, as file-roller does,
we don't want to draw the drag highlight around the CSD window
decorations.
https://bugzilla.gnome.org/show_bug.cgi?id=728526
 Please enter the commit message for your changes. Lines starting
2014-04-22 21:19:21 -04:00
Victor Martinez 75f90ee424 Allow defining an invisible resize area for GtkPaned's handle.
This should allow theme developers to use a very small width for
the resize handle, but still let users easily move the handle by
defining a wider resize area.

The additional resize area follows the "margin" style property.

https://bugzilla.gnome.org/show_bug.cgi?id=728073
2014-04-22 19:38:26 -04:00
Jasper St. Pierre ee3d00c391 wayland: Map the window immediately on show 2014-04-22 19:19:14 -04:00
Jasper St. Pierre 4e72674bf3 wayland: Remove useless hint set 2014-04-22 19:19:14 -04:00
Jasper St. Pierre 938725fff0 wayland: Remove VISIBILITY_NOTIFY event
VISIBILITY_NOTIFY is already known to be unreliable.
2014-04-22 19:19:14 -04:00
Jasper St. Pierre bd60c7b95d gtk-demo: Make sure to clear the timeout when we stop it 2014-04-22 18:55:06 -04:00
Matthias Clasen cfd7788c0b GtkScaleButton: Don't specify a icon size of zero
This only works for scalable icons, but breaks if we fall
back to pngs.
2014-04-22 18:37:25 -04:00
Matthias Clasen 2d9722e92b Fix the build 2014-04-22 11:08:17 -04:00
Matthias Clasen 2b85d6c225 Add a style class to model buttons
This will let us stop using the class name in Adwaita, and will
help with some future additions.
2014-04-22 11:04:40 -04:00
Volker Sobek 0940cbbeb9 docs: Fix parameter names for two functions
Don't use two different parameter names.
2014-04-21 22:57:35 +02:00
Yuri Myasoedov c8fa10cace Fixed Russian translation 2014-04-20 15:18:10 +04:00
Christian Kirbach 6668d8697a Updated German translation 2014-04-19 11:58:38 +00:00
Juan Pablo Ugarte 887fc60cce Added bindings support to GtkBuilder by introducing 3 new <property> attributes "bind-source" to specify the source object of the binding "bind-property" to specify the source property and "bind-flags" to specify the binding flags (optional)
Binding an object sensitive property with a check button active property will look like this:

<object class="GtkButton" id="button">
  <property name="sensitive" bind-source="checkbutton" bind-property="active"/>
</object>

This is based on the original work done by Denis Washington for his GSoC project

This closes Bug 654417 "[GSoC] Add <binding> element to GtkBuilder syntax"
2014-04-18 18:59:14 -03:00
Antoine Jacoutot be9d1e0b3b broadway backend: allow building on OpenBSD
On OpenBSD shm_open(3) is part of libc and there is not librt, so add an
according check.
Check if we have posix_fallocate before using it.

https://bugzilla.gnome.org/show_bug.cgi?id=728272
2014-04-18 18:20:34 +02:00
Matthias Clasen 2e1d0df1ed example: Update screenshots 2014-04-17 22:55:41 -04:00
Matthias Clasen c923ea9bc4 example: Use popover for gears menu 2014-04-17 22:55:40 -04:00
Matthias Clasen 763250e04d example: Make gears button square
Another application of image-button.
2014-04-17 22:55:40 -04:00
Matthias Clasen 35f4243315 example: Make search button square
The image-button style class takes care of it.
2014-04-17 22:55:39 -04:00
Matthias Clasen fcba75c2ba example: Modernize the prefs dialog
We should show the current best practice for this kind of
dialog, and use a headerbar with a window close button.
2014-04-17 22:55:39 -04:00
Matthias Clasen b718b95aab example: Port to gtk_application_set_accels_for_action
Instead of hardcoding an accelerator in the ui file, use
gtk_application_set_accels_for_action.
2014-04-17 22:55:38 -04:00
Matthias Clasen 25ce82d5b3 example: Fix indentation 2014-04-17 22:55:37 -04:00
Matthias Clasen c502ff73fe example: Fix up margins
This makes the code match what we show in the screenshots. This
broke when headerbars were changed to allow titles to extend into
the margin.
2014-04-17 22:55:37 -04:00
Matthias Clasen f521dddaed example: Don't set a nonexisting property
The GtkHeaderBar::show-fallback-app-menu property does not exist,
and isn't needed anyway.
2014-04-17 22:55:36 -04:00
Jasper St. Pierre e4e75a94f5 wayland: The xdg_surface.delete event was renamed to close 2014-04-17 13:14:44 -04:00
Руслан Ижбулатов 42ee237691 W32: correctly guess max window size from the size of the workarea of the screen it's on
Get monitor on which the most of the window is located (nearest monitor if
window is not on screen), get its work area (area not occupied by taskbar or
any other bars) and use that for maxsize.

Previous default of 30000 meant that windows maximized onto full screen,
even covering the area where taskbar is.

https://bugzilla.gnome.org/show_bug.cgi?id=726592
2014-04-16 22:39:56 +00:00
Evan Nemerson 0ebc4decbb selection: mark targets param to gtk_target_list_new as allow-none
https://bugzilla.gnome.org/show_bug.cgi?id=728165
2014-04-14 23:27:41 -07:00
Bastien Nocera 80993ea47a gtkapplication: Fix incorrect value passed to g_variant_new()
The code expected to format @u, not u.

https://bugzilla.gnome.org/show_bug.cgi?id=728140
2014-04-14 20:27:45 +02:00
Cosimo Cecchi b0a0b7ebe7 iconhelper: always ensure a stated pixbuf
Even when we are set a pixbuf itself.

https://bugzilla.gnome.org/show_bug.cgi?id=726271
2014-04-13 22:26:18 -07:00
Marcus Karlsson 19510cdec7 GtkColorChooserWidget: Redraw swatches when selection changes
When selecting a swatch in a GtkColorChooserWidget the previously
selected swatch and the currently selected swatch are not redrawn. This
can leave the old swatch still marked with a checkbox even though a new
swatch has been selected.

Redraw the swatches after changing the selection.

https://bugzilla.gnome.org/show_bug.cgi?id=727487
2014-04-13 22:10:35 -07:00
Marcus Karlsson 3d956db500 docs: fix GtkWidget::size-allocate description
The documentation for the GtkWidget::size-allocate signal is missing the
description of the "allocation" parameter. Add the missing description
to the parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=726179
2014-04-13 14:43:47 -07:00
Sébastien Wilmet 983a03d5f8 GtkTextView: use GSlice to allocate GtkTextLineSegment's
Use GSlice to allocate all types of segments:
- char
- toggle
- mark
- pixbuf
- child widget

Char segments are a bit more complicated because the length of the text
is determined at run time and stored in the 'byte_count' field. If the
text is long, GSlice will call the system malloc() anyway, so it's
better to always use GSlice for GtkTextLineSegment.

Toggle segments are also freed in gtktextbtree.c, hence the function
_gtk_toggle_segment_free() (for a later commit it would be nice to
rename those functions with the _gtk_text prefix).

https://bugzilla.gnome.org/show_bug.cgi?id=727908
2014-04-13 14:04:12 -07:00
Sébastien Wilmet d69d57afa7 textview: inline a function
gtk_text_view_move_cursor_internal() was exactly the same as
gtk_text_view_move_cursor(), and was called only in the latter function.

https://bugzilla.gnome.org/show_bug.cgi?id=727908
2014-04-13 14:04:11 -07:00
Sébastien Wilmet 22ce03fd94 doc: improve documentation of gtk_text_iter_inside_word()
There is a possible confusion with the sentence:
"@iter is inside a natural-language word"

The iter should be viewed here as the pointed character (i.e. on the
right of the iter), not as a position between two characters.

Instead of improving the documentation, another solution would have been
to change the implementation so it is interpreted as an iter position
inside a word, i.e. between two characters that are part of a
natural-language word. But maybe some applications rely on the current
implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=727908
2014-04-13 14:04:10 -07:00
Sébastien Wilmet 704a178abb tests textiter: test word boundaries
- As the tests show, some of the functions have a strange and
inconsistent behavior for corner cases.

- Rename test_full_buffer() -> test_search_full_buffer() because
textiter.c is used for other GtkTextIter unit tests.

https://bugzilla.gnome.org/show_bug.cgi?id=727908
2014-04-13 14:04:10 -07:00
Matthias Clasen 14ce8025ca listbox: Add tests for multi-selection
This was forgotten when the multi-selection API was added,
and it was promptly broken in some places.
2014-04-13 14:04:09 -07:00
Matthias Clasen 0d55346fbb list-box: Fix copy-paste error
The new function gtk_list_box_get_selected_rows was implemented
as gtk_list_box_get_selected_children.
2014-04-13 14:04:08 -07:00
Matthias Clasen dbf3a0681a listbox: Emit ::row-selected as we used to
The listbox selection test was failing because we were not
emitting these signals anymore.
2014-04-13 14:04:08 -07:00
Marcus Karlsson ac5fbb5ef3 docs: Add missing transfer annotation to GtkBox
The gtk_box_get_center_widget function is missing a transfer annotation
for the returned widget. No transfer is done, so set transfer to none.

https://bugzilla.gnome.org/show_bug.cgi?id=728093
2014-04-13 13:22:36 -07:00
Matthias Clasen 71fdf845a7 gtk-demo: Avoid a compiler warning 2014-04-12 22:13:40 -07:00
Matthias Clasen e8da5ec916 widget-factory: Clean up on shutdown 2014-04-12 22:13:14 -07:00
Matthias Clasen e087f434a3 widget-factory: Remove unnecessary signal handlers
quitting the mainloop when none is running gives a critical
warning on shutdown.
2014-04-12 22:12:38 -07:00
Matthias Clasen b86f54b54a widget-factory: Add a listbox example 2014-04-12 21:45:30 -07:00
Matthias Clasen 4e64708b3d widget-factory: Improve actionbar appearance
We are using the actionbar in the middle of the window, which
is not really what it is designed for. To avoid the unfinished
appearance on the sides, move it into the frame that we have
around the stack below. This fixes the sides, but gives the top
a double stroke. Too bad.
2014-04-12 21:09:03 -07:00
Matthias Clasen 2fab389930 widget-factory: Avoid ugly resizing on map
The text view is resizing several times after the window is mapped.
Not setting a hscrollbar-policy of never avoids that, and a
scrollbar still doesn't appear. Magic
2014-04-12 20:46:17 -07:00
Matthias Clasen 8ccdd5b7cf gtk-demo: Fix images demo
The incremental loading was broken by GtkIconHelper - queuing a
redraw is no longer sufficient to cause GtkImage to redraw with
the new pixbuf contents.
Pointed out by Jasper St. Pierre.
2014-04-12 20:40:27 -07:00
Matthias Clasen 9268ef36ab gtk-demo: Fix the links example
The keynav dialog is transient to the example window; since the
example window is now modal, we need to make the keynav dialog
modal as well, so it can receive input.
Problem pointed out by Jasper St. Pierre.
2014-04-12 18:44:40 -07:00
Jasper St. Pierre 5ac2346862 Remove gdk_synthesize_window_state from gdkinternals.h
It's already in gdkprivate.h
2014-04-12 08:20:33 -07:00
Jasper St. Pierre eb5cc3da9b wayland: set_transient_for was renamed to set_parent 2014-04-12 08:20:33 -07:00
Jasper St. Pierre e91e447db7 wayland: Don't pass dx/dy when we're resizing
They're ignored by the server.
2014-04-12 08:20:33 -07:00
Jasper St. Pierre 8201e2bfab wayland: Merge buffer implementations 2014-04-12 08:20:33 -07:00
Matthias Clasen 2d7b9273cf window: Be more careful when propagating key events
We are keeping references on the widget we are handling as we
are iterating up, but that doesn't protect us against the entire
tree being axed from inside gtk_widget_handle_event.
https://bugzilla.gnome.org/show_bug.cgi?id=727644
2014-04-11 22:00:01 -07:00
Cosimo Cecchi a5bd1474d5 entry: consider ascent and descent when requesting height
Commit d05191a010 change the height
requisition to be completely dependent on the PangoLayout, but that
breaks when the font has special characters with different metrics.
Use the maximum between the two instead.

https://bugzilla.gnome.org/show_bug.cgi?id=728054
2014-04-11 18:58:16 -07:00
Bastien Nocera 1409d7c4bd gtkapplication: Fix passing NULL as the window to inhibit
gtk_application_inhibit() supports passing NULL, so don't
blindly pass the NULL window to
gtk_application_impl_dbus_get_window_system_id().

https://bugzilla.gnome.org/show_bug.cgi?id=728023
2014-04-11 18:51:53 -07:00
Matthias Clasen 85855da946 Update expected output for assistant a11y test
The headerbar and its content now shows up, as it should.
2014-04-10 15:50:51 -07:00
Matthias Clasen 256d52152c GtkAssistant: don't hide headerbar from a11y
GtkAssistant has its own accessible implementation, and we forgot
to update it when we added a headerbar.
2014-04-10 14:23:39 -07:00
Matthias Clasen 19e1a8feb4 GtkMessageDialog: Allow action-area-border theming again
This border does not interfere with headerbar-vs-content placement,
and we can allow themes to change it without breaking dialogs.
2014-04-10 13:54:38 -07:00
Matthias Clasen 28327ee9aa GtkDialog: fix up handling of style properties
The use of border-width-set here was an attempt to differentiate
between explicitly set (from code / ui files) border width from
theme changes. But when we are calling gtk_window_set_border_width
to apply the theme value, the -set property gets set, and all
further theme changes are ignored. This has the effect of only
letting the default value of these properties get applied.

Fix this by unsetting border-width-set after applying theme values.
2014-04-10 13:54:37 -07:00
Руслан Ижбулатов b1012256f2 Revert "W32: RGBA GDK backend (broken)"
This reverts commit f89d38bc2d.

Pushed by accident.
2014-04-10 17:59:48 +00:00
Руслан Ижбулатов dd8612227f Revert "W32: Add a basic set of CSD styles"
This reverts commit 6e3e0dcd73.

Pushed by accident.
2014-04-10 17:59:21 +00:00
Руслан Ижбулатов fee41fb616 Revert "W32: Implement composition check for GDK"
This reverts commit 7ae5a56948.

Pushed by accident.
2014-04-10 17:58:58 +00:00
Руслан Ижбулатов 5c6e967b1f W32: remove border on default buttons
https://bugzilla.gnome.org/show_bug.cgi?id=727973
2014-04-10 17:49:20 +00:00
Руслан Ижбулатов 7ae5a56948 W32: Implement composition check for GDK
Also move DWM function grabbing and make those functions available to all of GDK-Win32.

https://bugzilla.gnome.org/show_bug.cgi?id=727316
2014-04-10 17:49:20 +00:00
Руслан Ижбулатов 6e3e0dcd73 W32: Add a basic set of CSD styles
https://bugzilla.gnome.org/show_bug.cgi?id=727316
2014-04-10 17:49:19 +00:00
Руслан Ижбулатов f89d38bc2d W32: RGBA GDK backend (broken)
https://bugzilla.gnome.org/show_bug.cgi?id=727316
2014-04-10 17:49:19 +00:00
Benjamin Otte 3f23f20ca8 tests: Don't use deprecated functions in testselection 2014-04-10 17:06:27 +02:00
Benjamin Otte 6d62f84dae tests: Make testlockbutton not use deprecated API 2014-04-10 17:00:44 +02:00
Benjamin Otte 949aa98a8f testgtk: Don't use deprecated functions in selection test 2014-04-10 16:53:42 +02:00
Benjamin Otte 5600499c2f testgtk: Remove rc file test
The test didn't work anymore since RC files stopped being used in 3.0.
2014-04-10 16:50:32 +02:00
Benjamin Otte 27ada645ca testgtk: Don't use deprecated functions in progress bar test 2014-04-10 16:48:13 +02:00
Benjamin Otte 78ae3690fa testgtk: Don't use deprecated functions in event watcher test 2014-04-10 16:46:07 +02:00
Benjamin Otte 6d56ef2d52 testgtk: Don't use deprecated functions in scrolled windows test 2014-04-10 16:42:59 +02:00
Benjamin Otte 2a0d046df3 testgtk: Don't use deprecated functions in dialogs test 2014-04-10 16:36:16 +02:00
Benjamin Otte 4f7a972aac testgtk: Make dialogs example work without static variable
Makes it a bit more complicated, but meh.
2014-04-10 16:16:41 +02:00
Benjamin Otte 38149c472e testgtk: Clean up dialog example
Don't pass a static variable to a callback, when the static variable
could just be deinfed in the callback.
2014-04-10 16:07:05 +02:00
Benjamin Otte 27770485f8 testgtk: Don't use deprecated functions in flipping test 2014-04-10 14:29:51 +02:00
Benjamin Otte 11e17262b7 testgtk: Don't use deprecated functions in scrolling test 2014-04-10 02:40:49 +02:00
Benjamin Otte 9cbd681174 testgtk: Don't call deprecated function in mainloop test 2014-04-10 02:36:38 +02:00
Benjamin Otte e109894f37 tests: Add deprecation guards 2014-04-10 02:29:54 +02:00
Benjamin Otte 9b29a7a700 pixelcache: Add a warning for an invariant that shouldn't happen
Pixel caches should be unmapped before being freed and unmapping clears
those variables.
2014-04-10 01:53:57 +02:00
Benjamin Otte 6e1fc27528 textview: Call map/unmap functions on pixel cache
https://bugzilla.gnome.org/show_bug.cgi?id=726475
2014-04-10 00:16:54 +02:00
Benjamin Otte e758b0a144 treeview: Call map/unmap functions on pixel cache
https://bugzilla.gnome.org/show_bug.cgi?id=726475
2014-04-10 00:16:54 +02:00
Benjamin Otte 461f1900f2 viewport: Call map/unmap functions on pixel cache
https://bugzilla.gnome.org/show_bug.cgi?id=726475
2014-04-10 00:16:53 +02:00
Benjamin Otte 2587d4b8e6 pixelcache: Add map/unmap functions
Because GTK does not invalidate windows that aren't mapped, we cannot
update the pixel cache when the window it handles isn't mapped. So we
add API to call when GDK windows get mapped/unmapped.

https://bugzilla.gnome.org/show_bug.cgi?id=726475
2014-04-10 00:16:53 +02:00
Benjamin Otte 2a9d2a966a pixelcache: Split out a function
https://bugzilla.gnome.org/show_bug.cgi?id=726475
2014-04-10 00:16:53 +02:00
Chun-wei Fan 3036a53667 Visual C++ Builds: Fix Header Installation
Make sure that gtk/a11y/gtkpopoveraccessible.h is copied, so that programs
using GTK+'s a11y will compile correctly.
2014-04-09 14:03:01 +08:00
Yuri Myasoedov aeb8b921e0 Fixed Russian translation 2014-04-09 00:23:20 +04:00
Matthias Clasen 69ef54bcd9 listbox: keep emitting ::row-selected
This was accidentally lost when multi-selection was added, causing
sidebars like the one in gnome-contacts or polari to not work any
more.
2014-04-07 23:17:56 -04:00
Piotr Drąg 2a9d22c895 doap: update URLs 2014-04-06 13:10:52 +02:00
Yosef Or Boczko 900adae5d9 headerbar: Use popover for the fallback app menu
https://bugzilla.gnome.org/show_bug.cgi?id=723963
2014-04-06 02:23:19 -04:00
Matthias Clasen 7d5bb09b88 Deprecate gtk_application_add_accelerator
The new gtk_application_set_accels_for_action api is more flexible
and better.
2014-04-06 02:13:06 -04:00
Matthias Clasen 4c03903045 Add new switch api to the docs 2014-04-06 01:52:49 -04:00
Matthias Clasen ac22ff3bda Add a delayed state test case
This adds a switch with delayed state change to testswitch,
demonstrating the functionality that was added in the previous
commit.
2014-04-06 01:52:48 -04:00
Matthias Clasen 7b11f761b3 switch: Add a delayed state capability
This commit makes it possible for GtkSwitch to indicate when
the underlying state changes with a delay, causing the switch
to temporarily go 'out of sync' with the underlying change.

https://bugzilla.gnome.org/show_bug.cgi?id=725648
2014-04-06 01:52:47 -04:00
Matthias Clasen 4ebd2d3f7e Add new listbox api to docs 2014-04-06 01:52:47 -04:00
Matthias Clasen 125c9f207f list box: Avoid excessive signals
We were emitting the a11y ::selection-changed signal much more
often than ::selected-rows-changed. Thats not necessary.
2014-04-06 01:44:38 -04:00
Matthias Clasen ccc4fb8512 Improve list selection example
Print out signals, so we see how often they are emitted.
2014-04-06 01:44:38 -04:00
Matthias Clasen 3fe243d346 list box: Cosmetic changes
Shorten variable names from list_box to box, throughout,
and use the BOX_PRIV macro everywhere.
2014-04-06 01:44:37 -04:00
Matthias Clasen 92eab67a49 Add a list box selection testcase 2014-04-06 01:44:37 -04:00
Matthias Clasen efcaaa524e list box: Update accessible implementation
Now that multi selection is supported, we can provide a more
complete AtkSelection implementation.
2014-04-06 01:44:36 -04:00
Matthias Clasen f652120347 list box: Implement multiple selection
This largely copies the flox box implementation, including the
same key bindings.
2014-04-06 01:44:36 -04:00
Matthias Clasen 463c89e540 listbox: Add multi-selection API
This commit adds API for dealing with multi-selection. It is identical
to the flow box API for this purpose. The implementation is still limited
to single-selection, and will be updated in subsequent commits.
2014-04-06 01:44:35 -04:00
Matthias Clasen d6cc9bd7cb Add version macros for 3.14 2014-04-06 01:27:01 -04:00
Matthias Clasen 3b00a79eac Bump version to 3.13 2014-04-06 01:26:27 -04:00
488 changed files with 38768 additions and 19910 deletions
+170 -33
View File
@@ -1,50 +1,164 @@
Overview of Changes in GTK+ 3.12.1 to 3.12.2
Overview of Changes in GTK+ 3.13.1 to 3.13.2
============================================
* Bug fixes:
495105 Open recent file keyboard shortcuts do not work correctly
686170 gdk/win32: VK_SNAPSHOT maps to GDK_Print
726592 W32: problems with CSDed windows
727487 Color picker check marks not cleared properly
728093 Add missing transfer annotation to gtk_box_get_center_widget
728140 Illegal parameter passed to g_variant_new in gtk_application...
728183 Drag and drop (GdkFrameClock) does not work for hidden widgets
728272 make broadway backend build on OpenBSD
728284 Graphics artifact when scrolling with hover-selection
728526 weird black border appear when dragging file
728745 win32: add more clipboard data checks to avoid crash
728806 W32: Check- and radio-buttons have a selection rectangle on ac...
728807 W32: Checkbutton focus rectangle becomes almost white on prelight
728808 W32: Checkboxes on modelbuttons are drawn like buttons themselves
728810 W32: Modelbuttons look like buttons
728992 GtkLockButton crash if clicked and permission is NULL
* Interactive debugging support. The GtkInspector
window can be triggered with the Ctrl-Shift-I
or Ctrl-Shift-D keyboard shortcuts, or via the
GTK_DEBUG environment variable.
* Gesture support has landed. New classes include
GtkGestureLongPress, GtkGestureMultiPress, GtkGestureSwipe,
GtkGesturePan, GtkGestureRotate, GtkGestureZoom. Many GTK+
widgets already use gestures internally. Gestures also
show up in GtkInspector.
The gesture-related APIs are still subject to change.
* GTK+ widgets can now draw outside their allocation,
by setting a clip with gtk_widget_set_clip().
The clip-related APIs are still subject to change.
* GtkStack has added a few more transition types
* GtkProgressBar is now narrower
* CSS
- Support outline-radius in CSS
- Implement 'unset' and 'all'
- Support -gtk-icontheme
- Support -gtk-icon-source
- Add -gtk-icon-transform, supporting the 2D
parts of CSS transforms
- Support -gtk-icon-style
* Theme
- Use outlines to render focus rings
- Use icons to render spinners, expanders and arrows
- GtkIconTheme can force symbolic or regular
icon variants
- GtkIconTheme will automatically load rtl
icon variants
* Win32:
- Theme improvements
* Wayland:
- Update to the latest xdg-shell protocol
* Deprecations:
GdkColor
GtkMisc
GtkArrow
focus-line-width style property
GtkNumerableIcon
GtkButton::x/yalign
gtk_widget_reparent
gtk_widget_region_intersect
gtk_container_set_reallocate_redraws
* Bugs fixed:
525206 Remove superfluous non-NULL tests for the GtkScrolledWindow scrollbars
614717 gtk_text_buffer_create_tag fails to return error on duplicate tag
636695 GdkColor should be deprecated
645966 gtk-demo leaks a GtkSizeGroup
698396 GtkTreeStore crashes when reordering 0 elements
708037 Allow live updates on widgets implementing GtkColorChooser
720330 Gtk-CRITICAL **: gtk_entry_completion_set_model: assertion 'GTK_IS_E...
721069 gtk_win32_embed_widget_show infinite recursion
726676 More GtkStack transition counterparts of OVER_UP_DOWN
727147 Search bar is too narrow
727994 Gtk Popover closes on click
728135 gtk_widget_set_visible's nothing-changed-check
728284 [treeview] Graphics artifact when scrolling with hover-selection
729346 W32: App-notification has no theme, shows up transparent
729353 W32: horizontal-buttons get "selected" background when focused
729451 Removing accels with application_set_accels_for_action
729670 cairo surface leaked for each cursor created from pixmap
729461 Introspection issue with GtkApplication
729473 FileChooser: typos in gtk_file_chooser_set_local_only ()
729475 FileChooser: typo in gtk_set_create_folders()
729496 Crash with latest gtk+ from master in gtk_combo_box_get_preferred_width
729564 Deprecate GtkArrow
729594 Don't stretch switches in Widget Factory
729598 Populate page 2 of the Widget Factory
729607 GtkAboutDialog: gtk aborts when trying to show an about dialog
729670 cairo surface leaked for each cursor created from pixmap
729817 GtkCellLayout: allow finding attributes at runtime
729834 gdk: missing (nullable) annotations on return values
729915 Popopver does not follow relative widget to find action groups
729983 gdk: assorted introspection and documentation syntax fixes
730007 GtkInspector: add a setting to disable C-S-i
730008 make gtk_set_interactive_debugging available for apps
730035 GtkFileFilter contains refs to GtkRecentFilter which are probably typos
730043 Add an alternative to Ctrl-Shift-I
730095 Add a private call API to export internals to modules
730142 placessidebar: use proper canonicalization when checking if home
730183 RFC: silence harmless critical
730306 Gtk+ >= 3.0 fails to load modules from settings.ini files
730526 Fix the edit-clear icons in RTL
730353 Horizontal and vertical scrolling
700030 GdkEventSequence not accessible from introspected bindings
641836 Capture/bubble event handling
119906 Add event when Double Click timeout expires
* Translation updates:
Belarusian
German
Indonesian
Japanese
Hebrew
Russian
Slovenian
Spanish
Spanish
Overview of Changes in GTK+ 3.12.0 to 3.12.1
Overview of Changes in GTK+ 3.12.0 to 3.13.1
============================================
* Bug fixes:
* GtkListBox can now do multi-selection
* GtkSwitch has a way to delay state changes
* GtkMenuButton is using a popover for menu models by default
* GtkPopover can have horizontal sections
* GtkFileChooser received some design improvements
* GtkBuilder
- Supports property binding
- Supports dialog actions
* Client-side decorations
- The requirement for _GTK_FRAME_EXTENTS has been dropped
to avoid 'double headers' with most window managers
- Drawing of DND highlights around the entire window works
* Windows backend:
- *Many* theme improvements
- Add popover theming
- Enable introspection
* Wayland backend
- Updates for xdg_shell protocol changes
- Touch support
* Broadway backend
- Now builds on OpenBSD
* Bugs fixed:
495105 Open recent file keyboard shortcuts do not work correctly
654417 Add <binding> element to GtkBuilder syntax
686170 gdk/win32: VK_SNAPSHOT maps to GDK_Print
712752 GtkClipboard: add _get_default and _get_primary
722058 GtkTreeModelFilter bug
722211 improve the file chooser design
722817 Add gobject-introspection for GdkWin32
723963 Use popover for the fallback app menu in the headerbar
725648 Switches should always indicate the current state
726179 Trivial Fix: size-allocate signal has missing documentation
726271 Items not highlighted while mouse-hovered
726298 gtk-font-name isn't correctly handled on Windows
726475 After looking at Asielriot solitare, I get rendering glitches...
726475 After looking at Aisleriot solitare, I get rendering glitches...
726592 W32: problems with CSDed windows
726859 Assertion/crash if gtk_radio_menu_item_set_group() is called twice
726870 all: Name more idles and timeouts
726871 treeview: Lower the duration of validation iterations
726996 Label-for/Labelled-by AtkRelations missing for containers in ...
726996 Label-for/Labelled-by AtkRelations missing for containers in t...
727009 redefinition of GtkPrinterCloudprint: cloudprint fails to build
727022 W32: Both inc- and dec-buttons on GtkSpinbutton are "inc"
727035 W32: Combobox button is drawn with two arrows
@@ -56,24 +170,47 @@ Overview of Changes in GTK+ 3.12.0 to 3.12.1
727210 W32: Prelight doesn't apply to check/radio marks
727211 W32: Selection background color applies to check/radio marks
727213 W32: Notebook widget is not styled correctly
727244 W32: Items selected in listbox have correct background color,...
727244 W32: Items selected in listbox have correct background color, ...
727245 W32: No .dim-label style
727313 a11y: do not use deprecated a11y functions.
727322 docs: Remove '\' escape character from literals
727391 W32: scrollbar sliders have no "active" and "insensitive" styles
727410 W32: tooltips are not themed
727414 Redundant text in titlebar
727487 Color picker check marks not cleared properly
727643 Segfault in gtk-3.12.0
727662 [PATCH] GtkVolumeButton displays "missing image" icons
727973 W32: focused button is visibly smaller
728023 Warning when passing NULL window to inhibit
727644 SEGV in gtk_window_propagate_key_event()
727662 GtkVolumeButton displays "missing image" icons
727908 Various GtkTextView improvements (doc, unit tests)
727973 W32: focused button is visibly smaller
728023 Warning when passing NULL window to inhibit
728054 entry: consider ascent and descent when requesting height
728073 Allow defining an invisible resize area for GtkPaned's handle
728140 Illegal parameter passed to g_variant_new in gtk_application_im...
728165 gtk_target_list_new argument should be (allow-none)
728183 Drag and drop (GdkFrameClock) does not work for hidden widgets
728272 make broadway backend build on OpenBSD
728426 Implement the wl_touch interface
728745 win32: add more clipboard data checks to avoid crash
728806 W32: Check- and radio-buttons have a selection rectangle on act...
728807 W32: Checkbutton focus rectangle becomes almost white on prelight
728808 W32: Checkboxes on modelbuttons are drawn like buttons themselves
728810 W32: Modelbuttons look like buttons
728846 GtkDialog: Support adding action widgets in ui files
728992 GtkLockButton crash if clicked and permission is NULL
729013 Use OUTPUT_SCALE instead of xft-dpi on wayland
729095 redraw problems when resizing popovers
729097 size allocation problem in popovers
* Translation updates:
Basque
Catalan
German
Greek
Hebrew
Russian
Slovenian
Overview of Changes in GTK+ 3.11.9 to 3.12.0
============================================
+2 -4
View File
@@ -18,10 +18,8 @@ EXTRA_DIST += \
gtk3-demo.vcxproj.filters \
gtk3-demo-application.vcxproj \
gtk3-demo-application.vcxproj.filters \
gtka11y.vcxproj \
gtka11y.vcxproj.filters \
gtka11y.vcxprojin \
gtka11y.vcxproj.filtersin \
gtk-inspector.vcxproj \
gtk-inspector.vcxproj.filters \
gailutil.vcxproj \
gailutil.vcxproj.filters \
install.vcxproj \
+18
View File
@@ -12,6 +12,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdk", "gdk.vcxproj", "{FC5A
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtka11y", "gtka11y.vcxproj", "{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-inspector", "gtk-inspector.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk", "gtk.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk3-demo", "gtk3-demo.vcxproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}"
@@ -122,6 +124,22 @@ Global
{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}.Release_Broadway|Win32.Build.0 = Release|Win32
{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}.Release_Broadway|x64.ActiveCfg = Release|x64
{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Debug|x64.ActiveCfg = Debug|x64
@@ -19,8 +19,8 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}</ProjectGuid>
<RootNamespace>gtka11y</RootNamespace>
<ProjectGuid>{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}</ProjectGuid>
<RootNamespace>gtkinspector</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -69,8 +69,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -80,11 +80,22 @@
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -94,24 +105,10 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -120,7 +117,25 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
#include "gtka11y.vs10.sourcefiles"
<ClCompile Include="..\..\..\gtk\inspector\actions.c" />
<ClCompile Include="..\..\..\gtk\inspector\button-path.c" />
<ClCompile Include="..\..\..\gtk\inspector\classes-list.c" />
<ClCompile Include="..\..\..\gtk\inspector\css-editor.c" />
<ClCompile Include="..\..\..\gtk\inspector\data-list.c" />
<ClCompile Include="..\..\..\gtk\inspector\general.c" />
<ClCompile Include="..\..\..\gtk\inspector\init.c" />
<ClCompile Include="..\..\..\gtk\inspector\inspect-button.c" />
<ClCompile Include="..\..\..\gtk\inspector\object-hierarchy.c" />
<ClCompile Include="..\..\..\gtk\inspector\prop-list.c" />
<ClCompile Include="..\..\..\gtk\inspector\property-cell-renderer.c" />
<ClCompile Include="..\..\..\gtk\inspector\python-hooks.c" />
<ClCompile Include="..\..\..\gtk\inspector\python-shell.c" />
<ClCompile Include="..\..\..\gtk\inspector\resource-list.c" />
<ClCompile Include="..\..\..\gtk\inspector\resources.c" />
<ClCompile Include="..\..\..\gtk\inspector\signals-list.c" />
<ClCompile Include="..\..\..\gtk\inspector\visual.c" />
<ClCompile Include="..\..\..\gtk\inspector\widget-tree.c" />
<ClCompile Include="..\..\..\gtk\inspector\window.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="gtk-prebuild.vcxproj">
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\gtk\inspector\actions.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\button-path.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\classes-list.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\css-editor.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\data-list.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\general.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\init.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\inspect-button.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\object-hierarchy.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\prop-list.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\property-cell-renderer.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\python-hooks.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\python-shell.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\resource-list.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\resources.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\signals-list.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\visual.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\widget-tree.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\gtk\inspector\window.c"><Filter>Source Files</Filter></ClCompile>
</ItemGroup>
</Project>
+2
View File
@@ -772,6 +772,8 @@ copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib
copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas
+4
View File
@@ -204,6 +204,10 @@
<Project>{f756b0db-40a1-4e9f-be1f-8f02cb86ea46}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="gtk-inspector.vcxproj">
<Project>{fc5aadb5-95cd-4bf0-ba8b-0c16fe7073fd}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Sources">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Headers">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
#include "gtka11y.vs10.sourcefiles.filters"
</ItemGroup>
</Project>
+1 -2
View File
@@ -11,8 +11,7 @@ EXTRA_DIST += \
gtk.vcprojin \
gtk3-demo.vcproj \
gtk3-demo-application.vcproj \
gtka11y.vcproj \
gtka11y.vcprojin \
gtk-inspector.vcproj \
gailutil.vcproj \
install.vcproj \
broadwayd.vcproj \
+22
View File
@@ -28,10 +28,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtka11y", "gtka11y.vcproj",
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FF} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk-inspector", "gtk-inspector.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}"
ProjectSection(ProjectDependencies) = postProject
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FF} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk", "gtk.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}"
ProjectSection(ProjectDependencies) = postProject
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}
{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46} = {F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD} = {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtk3-demo", "gtk3-demo.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FC}"
@@ -138,6 +144,22 @@ Global
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}.Release_Broadway|Win32.Build.0 = Release_Broadway|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}.Release_Broadway|x64.ActiveCfg = Release_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F7}.Release_Broadway|x64.Build.0 = Release_Broadway|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|x64.ActiveCfg = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Debug_Broadway|x64.Build.0 = Debug|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|Win32.ActiveCfg = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|Win32.Build.0 = Release|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|x64.ActiveCfg = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}.Release_Broadway|x64.Build.0 = Release|x64
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Debug|Win32.ActiveCfg = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Debug|Win32.Build.0 = Debug|Win32
{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073F5}.Debug|x64.ActiveCfg = Debug|x64
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="big5"?>
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="gtka11y"
ProjectGUID="{F756B0DB-40A1-4E9F-BE1F-8F02CB86EA46}"
RootNamespace="gtka11y"
Name="gtk-inspector"
ProjectGUID="{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FD}"
RootNamespace="gtkinspector"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
@@ -31,8 +31,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefines)"
AdditionalIncludeDirectories="..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -41,28 +41,6 @@
DebugInformationFormat="4"
/>
</Configuration>
<Configuration
Name="Debug|x64"
InheritedPropertySheets=".\gtk-build-defines.vsprops"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefines)"
AdditionalIncludeDirectories="..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
</Configuration>
<Configuration
Name="Release|Win32"
InheritedPropertySheets=".\gtk-build-defines.vsprops"
@@ -75,12 +53,31 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="$(GtkDefines)"
AdditionalIncludeDirectories="..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
</Configuration>
<Configuration
Name="Debug|x64"
InheritedPropertySheets=".\gtk-build-defines.vsprops"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefines)"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
@@ -98,8 +95,8 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
PreprocessorDefinitions="$(GtkDefines)"
AdditionalIncludeDirectories="..\..\..\gtk;..\..\..\gdk;..\..\..\gdk\win32"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -111,25 +108,41 @@
</References>
<Files>
<Filter
Name="Sources"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
#include "gtka11y.sourcefiles"
</Filter>
<Filter
Name="Headers"
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File RelativePath="..\..\..\gtk\inspector\actions.c" />
<File RelativePath="..\..\..\gtk\inspector\button-path.c" />
<File RelativePath="..\..\..\gtk\inspector\classes-list.c" />
<File RelativePath="..\..\..\gtk\inspector\css-editor.c" />
<File RelativePath="..\..\..\gtk\inspector\data-list.c" />
<File RelativePath="..\..\..\gtk\inspector\general.c" />
<File RelativePath="..\..\..\gtk\inspector\init.c" />
<File RelativePath="..\..\..\gtk\inspector\inspect-button.c" />
<File RelativePath="..\..\..\gtk\inspector\object-hierarchy.c" />
<File RelativePath="..\..\..\gtk\inspector\prop-list.c" />
<File RelativePath="..\..\..\gtk\inspector\property-cell-renderer.c" />
<File RelativePath="..\..\..\gtk\inspector\python-hooks.c" />
<File RelativePath="..\..\..\gtk\inspector\python-shell.c" />
<File RelativePath="..\..\..\gtk\inspector\resource-list.c" />
<File RelativePath="..\..\..\gtk\inspector\resources.c" />
<File RelativePath="..\..\..\gtk\inspector\signals-list.c" />
<File RelativePath="..\..\..\gtk\inspector\visual.c" />
<File RelativePath="..\..\..\gtk\inspector\widget-tree.c" />
<File RelativePath="..\..\..\gtk\inspector\window.c" />
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+1
View File
@@ -404,6 +404,7 @@ copy ..\..\..\demos\gtk-demo\data\256x256\gtk3-demo.png $(CopyDir)\share\icons\h
mkdir $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
echo &quot;Compiling gsettings XML Files...&quot;&#x0D;&#x0A;
+5 -7
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], [12])
m4_define([gtk_micro_version], [2])
m4_define([gtk_interface_age], [2])
m4_define([gtk_minor_version], [13])
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],
@@ -43,7 +43,7 @@ m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages
m4_define([glib_required_version], [2.39.5])
m4_define([pango_required_version], [1.32.4])
m4_define([atk_required_version], [2.7.5])
m4_define([atk_required_version], [2.12.0])
m4_define([cairo_required_version], [1.12.0])
m4_define([gdk_pixbuf_required_version], [2.27.1])
m4_define([introspection_required_version], [1.39.0])
@@ -1886,12 +1886,10 @@ gtk/Makefile
gtk/makefile.msc
gtk/gtkversion.h
gtk/gtk-win32.rc
gtk/a11y/Makefile
gtk/inspector/Makefile
gtk/native/Makefile
libgail-util/Makefile
modules/Makefile
modules/engines/Makefile
modules/engines/pixbuf/Makefile
modules/input/Makefile
modules/printbackends/Makefile
modules/printbackends/cups/Makefile
+1
View File
@@ -24,6 +24,7 @@ demos = \
entry_completion.c \
event_axes.c \
expander.c \
gestures.c \
headerbar.c \
hypertext.c \
iconview.c \
+1 -1
View File
@@ -42,7 +42,7 @@ response_cb (GtkDialog *dialog,
gtk_widget_override_background_color (da, 0, &color);
}
gtk_widget_hide (GTK_WIDGET (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
+1
View File
@@ -94,6 +94,7 @@
<file>event_axes.c</file>
<file>expander.c</file>
<file>flowbox.c</file>
<file>gestures.c</file>
<file>headerbar.c</file>
<file>hypertext.c</file>
<file>iconview.c</file>
+199
View File
@@ -0,0 +1,199 @@
/* Gestures
*
* Perform gestures on touchscreens and other input devices. This
* demo reacts to long presses and swipes from all devices, plus
* multi-touch rotate and zoom gestures.
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
static GtkGesture *rotate = NULL;
static GtkGesture *zoom = NULL;
static gdouble swipe_x = 0;
static gdouble swipe_y = 0;
static gboolean long_pressed = FALSE;
static void
swipe_gesture_swept (GtkGestureSwipe *gesture,
gdouble velocity_x,
gdouble velocity_y,
GtkWidget *widget)
{
swipe_x = velocity_x / 10;
swipe_y = velocity_y / 10;
gtk_widget_queue_draw (widget);
}
static void
long_press_gesture_pressed (GtkGestureLongPress *gesture,
gdouble x,
gdouble y,
GtkWidget *widget)
{
long_pressed = TRUE;
gtk_widget_queue_draw (widget);
}
static void
long_press_gesture_end (GtkGesture *gesture,
GdkEventSequence *sequence,
GtkWidget *widget)
{
long_pressed = FALSE;
gtk_widget_queue_draw (widget);
}
static void
rotation_angle_changed (GtkGestureRotate *gesture,
gdouble angle,
gdouble delta,
GtkWidget *widget)
{
gtk_widget_queue_draw (widget);
}
static void
zoom_scale_changed (GtkGestureZoom *gesture,
gdouble scale,
GtkWidget *widget)
{
gtk_widget_queue_draw (widget);
}
static gboolean
drawing_area_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
if (swipe_x != 0 || swipe_y != 0)
{
cairo_save (cr);
cairo_set_line_width (cr, 6);
cairo_move_to (cr, allocation.width / 2,
allocation.height / 2);
cairo_rel_line_to (cr, swipe_x, swipe_y);
cairo_set_source_rgba (cr, 1, 0, 0, 0.5);
cairo_stroke (cr);
cairo_restore (cr);
}
if (gtk_gesture_is_recognized (rotate) || gtk_gesture_is_recognized (zoom))
{
cairo_pattern_t *pat;
cairo_matrix_t matrix;
gdouble angle, scale;
cairo_matrix_init_translate (&matrix,
allocation.width / 2,
allocation.height / 2);
cairo_save (cr);
angle = gtk_gesture_rotate_get_angle_delta (GTK_GESTURE_ROTATE (rotate));
cairo_matrix_rotate (&matrix, angle);
scale = gtk_gesture_zoom_get_scale_delta (GTK_GESTURE_ZOOM (zoom));
cairo_matrix_scale (&matrix, scale, scale);
cairo_set_matrix (cr, &matrix);
cairo_rectangle (cr, -100, -100, 200, 200);
pat = cairo_pattern_create_linear (-100, 0, 200, 0);
cairo_pattern_add_color_stop_rgb (pat, 0, 0, 0, 1);
cairo_pattern_add_color_stop_rgb (pat, 1, 1, 0, 0);
cairo_set_source (cr, pat);
cairo_fill (cr);
cairo_restore (cr);
cairo_pattern_destroy (pat);
}
if (long_pressed)
{
cairo_save (cr);
cairo_arc (cr, allocation.width / 2,
allocation.height / 2,
50, 0, 2 * G_PI);
cairo_set_source_rgba (cr, 0, 1, 0, 0.5);
cairo_stroke (cr);
cairo_restore (cr);
}
return TRUE;
}
GtkWidget *
do_gestures (GtkWidget *do_widget)
{
GtkWidget *drawing_area;
GtkGesture *gesture;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
gtk_window_set_title (GTK_WINDOW (window), "Gestures demo");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
drawing_area = gtk_drawing_area_new ();
gtk_container_add (GTK_CONTAINER (window), drawing_area);
gtk_widget_add_events (drawing_area,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_TOUCH_MASK);
g_signal_connect (drawing_area, "draw",
G_CALLBACK (drawing_area_draw), NULL);
/* Swipe */
gesture = gtk_gesture_swipe_new (drawing_area);
g_signal_connect (gesture, "swipe",
G_CALLBACK (swipe_gesture_swept), drawing_area);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE);
g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture);
/* Long press */
gesture = gtk_gesture_long_press_new (drawing_area);
g_signal_connect (gesture, "pressed",
G_CALLBACK (long_press_gesture_pressed), drawing_area);
g_signal_connect (gesture, "end",
G_CALLBACK (long_press_gesture_end), drawing_area);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE);
g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture);
/* Rotate */
rotate = gesture = gtk_gesture_rotate_new (drawing_area);
g_signal_connect (gesture, "angle-changed",
G_CALLBACK (rotation_angle_changed), drawing_area);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE);
g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture);
/* Zoom */
zoom = gesture = gtk_gesture_zoom_new (drawing_area);
g_signal_connect (gesture, "scale-changed",
G_CALLBACK (zoom_scale_changed), drawing_area);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE);
g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
{
gtk_widget_destroy (window);
window = NULL;
}
return window;
}
+2 -2
View File
@@ -44,10 +44,10 @@ do_headerbar (GtkWidget *do_widget)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_style_context_add_class (gtk_widget_get_style_context (box), "linked");
button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE));
gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-start-symbolic", GTK_ICON_SIZE_BUTTON));
gtk_container_add (GTK_CONTAINER (box), button);
button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE));
gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-end-symbolic", GTK_ICON_SIZE_BUTTON));
gtk_container_add (GTK_CONTAINER (box), button);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), box);
+10 -6
View File
@@ -52,20 +52,24 @@ set_cell_color (GtkCellLayout *cell_layout,
gpointer data)
{
gchar *text;
GdkColor color;
GdkRGBA color;
guint32 pixel = 0;
GdkPixbuf *pixbuf;
gtk_tree_model_get (tree_model, iter, COL_TEXT, &text, -1);
if (gdk_color_parse (text, &color))
if (!text)
return;
if (gdk_rgba_parse (&color, text))
pixel =
(color.red >> 8) << 24 |
(color.green >> 8) << 16 |
(color.blue >> 8) << 8;
((gint)(color.red * 255)) << 24 |
((gint)(color.green * 255)) << 16 |
((gint)(color.blue * 255)) << 8 |
((gint)(color.alpha * 255));
g_free (text);
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 24, 24);
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 24, 24);
gdk_pixbuf_fill (pixbuf, pixel);
g_object_set (cell, "pixbuf", pixbuf, NULL);
-2
View File
@@ -1015,8 +1015,6 @@ main (int argc, char **argv)
}
/* -- End of hack -- */
gtk_init (&argc, &argv);
app = gtk_application_new ("org.gtk.Demo", 0);
g_action_map_add_action_entries (G_ACTION_MAP (app),
+3 -4
View File
@@ -128,8 +128,8 @@
<object class="GtkTextView" id="info-textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">20</property>
<property name="margin_right">20</property>
<property name="margin_start">20</property>
<property name="margin_end">20</property>
<property name="margin_top">20</property>
<property name="margin_bottom">20</property>
<property name="pixels_above_lines">2</property>
@@ -165,9 +165,8 @@
<object class="GtkTextView" id="source-textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">20</property>
<property name="margin_start">20</property>
<property name="margin_end">20</property>
<property name="margin_right">20</property>
<property name="margin_top">20</property>
<property name="margin_bottom">20</property>
<property name="editable">False</property>
+1
View File
@@ -120,6 +120,7 @@ do_sizegroup (GtkWidget *do_widget)
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
g_object_set_data_full (G_OBJECT (window), "size-group", size_group, g_object_unref);
/* Create one frame holding color options */
frame = gtk_frame_new ("Color Options");
+6
View File
@@ -656,6 +656,9 @@ load_icon_items (GtkToolPalette *palette)
GtkWidget *group = gtk_tool_item_group_new (context);
gtk_container_add (GTK_CONTAINER (palette), group);
if (g_strcmp0 (context, "Animations") == 0)
continue;
g_message ("Got context '%s'", context);
icon_names = gtk_icon_theme_list_icons (icon_theme, context);
icon_names = g_list_sort (icon_names, (GCompareFunc) strcmp);
@@ -665,6 +668,9 @@ load_icon_items (GtkToolPalette *palette)
GtkToolItem *item;
gchar *id = ll->data;
if (g_strcmp0 (id, "emblem-desktop") == 0)
continue;
g_message ("Got id '%s'", id);
item = gtk_tool_button_new (NULL, NULL);
+14 -10
View File
@@ -189,9 +189,10 @@ do_transparent (GtkWidget *do_widget)
GtkWidget *view;
GtkWidget *sw;
GtkWidget *overlay;
GtkWidget *align;
GtkWidget *entry;
GdkRGBA transparent = {0, 0, 0, 0};
GtkCssProvider *provider;
gchar *css;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
@@ -219,17 +220,20 @@ do_transparent (GtkWidget *do_widget)
gtk_widget_override_background_color (overlay, 0, &transparent);
align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (align),
0, SHADOW_OFFSET_Y, 0, SHADOW_OFFSET_X);
g_signal_connect (align, "draw", G_CALLBACK (draw_callback), NULL);
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (align), entry);
provider = gtk_css_provider_new ();
css = g_strdup_printf ("* { border-width: 0px %dpx %dpx 0px; }",
SHADOW_OFFSET_X, SHADOW_OFFSET_Y);
gtk_css_provider_load_from_data (provider, css, -1, NULL);
g_free (css);
gtk_style_context_add_provider (gtk_widget_get_style_context (entry),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_signal_connect (entry, "draw", G_CALLBACK (draw_callback), NULL);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
gtk_widget_set_halign (entry, GTK_ALIGN_CENTER);
gtk_widget_set_valign (entry, GTK_ALIGN_START);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), align);
gtk_widget_set_halign (align, GTK_ALIGN_CENTER);
gtk_widget_set_valign (align, GTK_ALIGN_START);
gtk_widget_show_all (overlay);
}
+90 -17
View File
@@ -23,18 +23,6 @@
#include "config.h"
#include <gtk/gtk.h>
static void
activate_toggle (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GVariant *state;
state = g_action_get_state (G_ACTION (action));
g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state)));
g_variant_unref (state);
}
static void
change_theme_state (GSimpleAction *action,
GVariant *state,
@@ -50,6 +38,44 @@ change_theme_state (GSimpleAction *action,
g_simple_action_set_state (action, state);
}
static void
change_toolbar_state (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
GtkWidget *window = user_data;
GtkWidget *toolbar;
toolbar = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "toolbar"));
gtk_widget_set_visible (toolbar, g_variant_get_boolean (state));
g_simple_action_set_state (action, state);
}
static void
activate_search (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWidget *window = user_data;
GtkWidget *searchbar;
searchbar = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "searchbar"));
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (searchbar), TRUE);
}
static void
activate_delete (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GtkWidget *window = user_data;
GtkWidget *infobar;
infobar = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "infobar"));
gtk_widget_show (infobar);
}
static void
activate_about (GSimpleAction *action,
GVariant *parameter,
@@ -220,6 +246,29 @@ startup (GApplication *app)
g_object_unref (builder);
}
static void
update_header (GtkListBoxRow *row,
GtkListBoxRow *before,
gpointer data)
{
if (before != NULL &&
gtk_list_box_row_get_header (row) == NULL)
{
GtkWidget *separator;
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show (separator);
gtk_list_box_row_set_header (row, separator);
}
}
static void
info_bar_response (GtkWidget *infobar, gint response_id)
{
if (response_id == GTK_RESPONSE_CLOSE)
gtk_widget_hide (infobar);
}
static void
activate (GApplication *app)
{
@@ -228,7 +277,10 @@ activate (GApplication *app)
GtkWidget *widget;
GtkAdjustment *adj;
static GActionEntry win_entries[] = {
{ "dark", activate_toggle, NULL, "false", change_theme_state }
{ "dark", NULL, NULL, "false", change_theme_state },
{ "toolbar", NULL, NULL, "true", change_toolbar_state },
{ "search", activate_search, NULL, NULL, NULL },
{ "delete", activate_delete, NULL, NULL, NULL }
};
builder = gtk_builder_new ();
@@ -255,6 +307,19 @@ activate (GApplication *app)
adj = (GtkAdjustment *) gtk_builder_get_object (builder, "adjustment2");
g_signal_connect (adj, "value-changed", G_CALLBACK (spin_value_changed), widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "listbox");
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_header, NULL, NULL);
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbar");
g_object_set_data (G_OBJECT (window), "toolbar", widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "searchbar");
g_object_set_data (G_OBJECT (window), "searchbar", widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "infobar");
g_signal_connect (widget, "response", G_CALLBACK (info_bar_response), NULL);
g_object_set_data (G_OBJECT (window), "infobar", widget);
gtk_widget_show_all (GTK_WIDGET (window));
g_object_unref (builder);
@@ -267,9 +332,16 @@ main (int argc, char *argv[])
static GActionEntry app_entries[] = {
{ "about", activate_about, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL },
};
gtk_init (&argc, &argv);
{ "main", NULL, "s", "'steak'", NULL },
{ "wine", NULL, NULL, "false", NULL },
{ "beer", NULL, NULL, "false", NULL },
{ "water", NULL, NULL, "true", NULL },
{ "dessert", NULL, "s", "'bars'", NULL },
{ "pay", NULL, "s", NULL, NULL }
};
gint status;
app = gtk_application_new ("org.gtk.WidgetFactory", 0);
@@ -280,7 +352,8 @@ main (int argc, char *argv[])
g_signal_connect (app, "startup", G_CALLBACK (startup), NULL);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
g_application_run (G_APPLICATION (app), argc, argv);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return 0;
return status;
}
File diff suppressed because it is too large Load Diff
+9 -1
View File
@@ -26,7 +26,6 @@
<xi:include href="xml/gdkdevice.xml" />
<xi:include href="xml/regions.xml" />
<xi:include href="xml/pixbufs.xml" />
<xi:include href="xml/colors.xml" />
<xi:include href="xml/rgba_colors.xml" />
<xi:include href="xml/visuals.xml" />
<xi:include href="xml/cursors.xml" />
@@ -48,6 +47,11 @@
<xi:include href="xml/gdktestutils.xml" />
</reference>
<reference>
<title>Deprecated</title>
<xi:include href="xml/colors.xml" />
</reference>
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
@@ -84,6 +88,10 @@
<title>Index of new symbols in 3.12</title>
<xi:include href="xml/api-index-3.12.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-14" role="3.14">
<title>Index of new symbols in 3.14</title>
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+5
View File
@@ -58,6 +58,11 @@ GDK_WINDOWING_WAYLAND
GDK_VERSION_3_0
GDK_VERSION_3_2
GDK_VERSION_3_4
GDK_VERSION_3_6
GDK_VERSION_3_8
GDK_VERSION_3_10
GDK_VERSION_3_12
GDK_VERSION_3_14
GDK_VERSION_MIN_REQUIRED
GDK_VERSION_MAX_ALLOWED
GDK_DISABLE_DEPRECATION_WARNINGS
+7 -1
View File
@@ -151,10 +151,13 @@ content_files = \
tree_widget.sgml \
windows.sgml \
x11.sgml \
gtk3-demo.xml \
gtk3-widget-factory.xml \
gtk-query-immodules-3.0.xml \
gtk-update-icon-cache.xml \
gtk-launch.xml \
broadwayd.xml \
input-handling.xml \
visual_index.xml \
getting_started.xml \
overview.xml
@@ -424,7 +427,8 @@ HTML_IMAGES = \
$(srcdir)/images/getting-started-app9.png \
$(srcdir)/images/getting-started-app10.png \
$(srcdir)/images/exampleapp.png \
$(srcdir)/images/flow-box.png
$(srcdir)/images/flow-box.png \
$(srcdir)/images/inspector.png
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=--extra-dir=../gdk/html \
@@ -446,6 +450,8 @@ man_MANS = \
gtk-query-immodules-3.0.1 \
gtk-update-icon-cache.1 \
gtk-launch.1 \
gtk3-demo.1 \
gtk3-widget-factory.1 \
broadwayd.1
if ENABLE_MAN
+25 -4
View File
@@ -25,6 +25,7 @@
<xi:include href="resources.sgml" />
<xi:include href="xml/question_index.sgml" />
<xi:include href="drawing-model.xml" />
<xi:include href="input-handling.xml" />
</part>
@@ -240,7 +241,6 @@
<chapter id="MiscObjects">
<title>Miscellaneous</title>
<xi:include href="xml/gtkadjustment.xml" />
<xi:include href="xml/gtkarrow.xml" />
<xi:include href="xml/gtkcalendar.xml" />
<xi:include href="xml/gtkdrawingarea.xml" />
<xi:include href="xml/gtkeventbox.xml" />
@@ -259,7 +259,6 @@
<xi:include href="xml/gtkcontainer.xml" />
<xi:include href="xml/gtkbin.xml" />
<xi:include href="xml/gtkmenushell.xml" />
<xi:include href="xml/gtkmisc.xml" />
<xi:include href="xml/gtkrange.xml" />
<xi:include href="xml/gtkimcontext.xml" />
</chapter>
@@ -288,6 +287,20 @@
<xi:include href="xml/gtkappchooserwidget.xml" />
</chapter>
<chapter id="Gestures">
<title>Gestures</title>
<xi:include href="xml/gtkeventcontroller.xml" />
<xi:include href="xml/gtkgesture.xml" />
<xi:include href="xml/gtkgesturesingle.xml" />
<xi:include href="xml/gtkgesturedrag.xml" />
<xi:include href="xml/gtkgesturelongpress.xml" />
<xi:include href="xml/gtkgesturemultipress.xml" />
<xi:include href="xml/gtkgesturepan.xml" />
<xi:include href="xml/gtkgestureswipe.xml" />
<xi:include href="xml/gtkgesturerotate.xml" />
<xi:include href="xml/gtkgesturezoom.xml" />
</chapter>
<chapter id="DeprecatedObjects">
<title>Deprecated</title>
<xi:include href="xml/gtksymboliccolor.xml" />
@@ -321,7 +334,11 @@
<xi:include href="xml/gtkrecentaction.xml" />
<xi:include href="xml/gtkactivatable.xml" />
<xi:include href="xml/gtkimagemenuitem.xml" />
<xi:include href="xml/gtkmisc.xml" />
<xi:include href="xml/gtkstock.xml" />
<xi:include href="xml/gtkiconfactory.xml" />
<xi:include href="xml/gtknumerableicon.xml" />
<xi:include href="xml/gtkarrow.xml" />
</chapter>
</part>
@@ -351,8 +368,6 @@
<xi:include href="xml/gtkthemingengine.xml" />
<xi:include href="xml/gtkwidgetpath.xml" />
<xi:include href="xml/gtkicontheme.xml" />
<xi:include href="xml/gtkiconfactory.xml" />
<xi:include href="xml/gtknumerableicon.xml" />
</part>
<part id="migrating">
@@ -378,6 +393,8 @@
<part>
<title>GTK+ Tools</title>
<xi:include href="gtk3-demo.xml" />
<xi:include href="gtk3-widget-factory.xml" />
<xi:include href="gtk-query-immodules-3.0.xml" />
<xi:include href="gtk-update-icon-cache.xml" />
<xi:include href="gtk-launch.xml" />
@@ -434,6 +451,10 @@
<title>Index of new symbols in 3.12</title>
<xi:include href="xml/api-index-3.12.xml"><xi:fallback /></xi:include>
</index>
<index id="api-index-3-14" role="3.14">
<title>Index of new symbols in 3.14</title>
<xi:include href="xml/api-index-3.14.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk3-demo">
<refentryinfo>
<title>gtk3-demo</title>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Matthias</firstname>
<surname>Clasen</surname>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>gtk3-demo</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gtk3-demo</refname>
<refpurpose>Demonstrate GTK+ widgets</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>gtk3-demo</command>
<arg choice="opt">--help</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
<para>
<command>gtk3-demo</command> is a collection of examples.
Its purpose is to demonstrate many GTK+ widgets in a form
that is useful to application developers.
</para>
<para>
The application shows the source code for each example, as well as
other used resources, such as ui files and icons.
</para>
</refsect1>
<refsect1><title>Options</title>
<para>The following options are understood:</para>
<variablelist>
<varlistentry>
<term><option>-h</option>, <option>--help</option></term>
<listitem><para>Show help options</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
+256 -19
View File
@@ -57,6 +57,7 @@ gtk_about_dialog_get_type
GtkAccelGroup
GtkAccelGroupClass
gtk_accel_group_new
GtkAccelFlags
gtk_accel_group_connect
gtk_accel_group_connect_by_path
GtkAccelGroupActivate
@@ -444,6 +445,7 @@ gtk_button_box_new
gtk_button_box_get_layout
gtk_button_box_get_child_secondary
gtk_button_box_get_child_non_homogeneous
GtkButtonBoxStyle
gtk_button_box_set_layout
gtk_button_box_set_child_secondary
gtk_button_box_set_child_non_homogeneous
@@ -523,7 +525,13 @@ gtk_list_box_new
gtk_list_box_prepend
gtk_list_box_insert
gtk_list_box_select_row
gtk_list_box_unselect_row
gtk_list_box_select_all
gtk_list_box_unselect_all
gtk_list_box_get_selected_row
GtkListBoxForeachFunc
gtk_list_box_selected_foreach
gtk_list_box_get_selected_rows
gtk_list_box_set_selection_mode
gtk_list_box_get_selection_mode
@@ -545,6 +553,7 @@ gtk_list_box_drag_unhighlight_row
gtk_list_box_row_new
gtk_list_box_row_changed
gtk_list_box_row_is_selected
gtk_list_box_row_get_header
gtk_list_box_row_get_type
gtk_list_box_row_set_header
@@ -974,6 +983,7 @@ GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID
gtk_container_add
gtk_container_remove
gtk_container_add_with_properties
GtkResizeMode
gtk_container_get_resize_mode
gtk_container_set_resize_mode
gtk_container_check_resize
@@ -2175,6 +2185,7 @@ gtk_link_button_get_type
<FILE>gtkmenu</FILE>
<TITLE>GtkMenu</TITLE>
GtkMenu
GtkArrowPlacement
gtk_menu_new
gtk_menu_new_from_model
gtk_menu_set_screen
@@ -2252,6 +2263,7 @@ gtk_menu_button_set_menu_model
gtk_menu_button_get_menu_model
gtk_menu_button_set_use_popover
gtk_menu_button_get_use_popover
GtkArrowType
gtk_menu_button_set_direction
gtk_menu_button_get_direction
gtk_menu_button_set_align_widget
@@ -3108,8 +3120,10 @@ gtk_scrolled_window_get_hadjustment
gtk_scrolled_window_get_vadjustment
gtk_scrolled_window_get_hscrollbar
gtk_scrolled_window_get_vscrollbar
GtkPolicyType
gtk_scrolled_window_set_policy
gtk_scrolled_window_add_with_viewport
GtkCornerType
gtk_scrolled_window_set_placement
gtk_scrolled_window_unset_placement
gtk_scrolled_window_set_shadow_type
@@ -3466,6 +3480,7 @@ GtkTable
gtk_table_new
gtk_table_resize
gtk_table_get_size
GtkAttachOptions
gtk_table_attach
gtk_table_attach_defaults
gtk_table_set_row_spacing
@@ -5460,6 +5475,8 @@ gtk_widget_get_allocated_height
gtk_widget_get_allocation
gtk_widget_set_allocation
gtk_widget_get_allocated_baseline
gtk_widget_get_clip
gtk_widget_set_clip
gtk_widget_get_app_paintable
gtk_widget_get_can_default
gtk_widget_set_can_default
@@ -5587,6 +5604,7 @@ gtk_requisition_get_type
<TITLE>GtkWindow</TITLE>
GtkWindow
GtkWindowClass
GtkWindowType
gtk_window_new
gtk_window_set_title
gtk_window_set_wmclass
@@ -5602,6 +5620,7 @@ gtk_window_set_default_geometry
gtk_window_set_geometry_hints
gtk_window_set_gravity
gtk_window_get_gravity
GtkWindowPosition
gtk_window_set_position
gtk_window_set_transient_for
gtk_window_set_attached_to
@@ -5703,6 +5722,7 @@ gtk_window_get_application
gtk_window_set_application
gtk_window_set_has_user_ref_count
gtk_window_set_titlebar
gtk_window_set_interactive_debugging
<SUBSECTION Standard>
GTK_WINDOW
@@ -5930,6 +5950,7 @@ GTK_STYLE_PROPERTY_BORDER_RADIUS
GTK_STYLE_PROPERTY_BORDER_STYLE
GTK_STYLE_PROPERTY_BORDER_COLOR
GTK_STYLE_PROPERTY_BACKGROUND_IMAGE
GtkBorderStyle
<SUBSECTION>
GTK_STYLE_CLASS_BACKGROUND
GTK_STYLE_CLASS_BUTTON
@@ -6001,6 +6022,7 @@ gtk_style_context_add_provider
gtk_style_context_add_provider_for_screen
gtk_style_context_get
gtk_style_context_get_direction
GtkJunctionSides
gtk_style_context_get_junction_sides
gtk_style_context_get_parent
gtk_style_context_get_path
@@ -6043,6 +6065,7 @@ gtk_style_context_add_class
gtk_style_context_remove_class
gtk_style_context_has_class
gtk_style_context_list_classes
GtkRegionFlags
gtk_style_context_add_region
gtk_style_context_remove_region
gtk_style_context_has_region
@@ -6219,6 +6242,7 @@ gtk_gradient_get_type
GTK_STYLE_ATTACHED
GtkStyle
GtkStyleClass
GtkExpanderStyle
gtk_style_new
gtk_style_copy
gtk_style_attach
@@ -6277,6 +6301,8 @@ GtkRcStyle
GtkRcStyleClass
GtkRcFlags
GtkRcTokenType
GtkPathPriorityType
GtkPathType
gtk_rc_scanner_new
gtk_rc_get_style
gtk_rc_get_style_by_paths
@@ -6311,6 +6337,7 @@ GTK_RC_STYLE_GET_CLASS
<SUBSECTION Private>
gtk_rc_style_get_type
GtkRcContext
GTK_PATH_PRIO_MASK
</SECTION>
<SECTION>
@@ -6431,6 +6458,7 @@ gtk_clipboard_get_type
<TITLE>Drag and Drop</TITLE>
GtkDestDefaults
GtkTargetFlags
GtkDragResult
<SUBSECTION Destination Side>
gtk_drag_dest_set
gtk_drag_dest_set_proxy
@@ -6496,28 +6524,17 @@ gtk_binding_set_add_path
<SECTION>
<FILE>gtkenums</FILE>
<TITLE>Standard Enumerations</TITLE>
GtkAccelFlags
GtkArrowPlacement
GtkArrowType
GtkAttachOptions
GtkBaselinePosition
GtkButtonBoxStyle
GtkCornerType
GtkDeleteType
GtkDirectionType
GtkExpanderStyle
GtkIMPreeditStyle
GtkIMStatusStyle
GtkJustification
GtkMovementStep
GtkOrientation
GtkPackType
GtkPathPriorityType
GtkPathType
GtkPolicyType
GtkPositionType
GtkReliefStyle
GtkResizeMode
GtkScrollStep
GtkScrollType
GtkSelectionMode
@@ -6525,16 +6542,8 @@ GtkShadowType
GtkStateType
GtkStateFlags
GtkToolbarStyle
GtkWindowPosition
GtkWindowType
GtkSortType
GtkDragResult
GtkJunctionSides
GtkBorderStyle
GtkRegionFlags
<SUBSECTION Private>
GTK_PATH_PRIO_MASK
</SECTION>
<SECTION>
@@ -7487,6 +7496,8 @@ GtkSwitchClass
gtk_switch_new
gtk_switch_set_active
gtk_switch_get_active
gtk_switch_set_state
gtk_switch_get_state
<SUBSECTION Standard>
GTK_TYPE_SWITCH
@@ -7882,3 +7893,229 @@ gtk_popover_get_position
gtk_popover_set_modal
gtk_popover_get_modal
</SECTION>
<SECTION>
<FILE>gtkeventcontroller</FILE>
<TITLE>GtkEventController</TITLE>
GtkEventController
GtkPropagationPhase
gtk_event_controller_get_propagation_phase
gtk_event_controller_set_propagation_phase
gtk_event_controller_handle_event
gtk_event_controller_get_widget
gtk_event_controller_reset
<SUBSECTION Standard>
GTK_TYPE_EVENT_CONTROLLER
GTK_EVENT_CONTROLLER
GTK_EVENT_CONTROLLER_CLASS
GTK_IS_EVENT_CONTROLLER
GTK_EVENT_CONTROLLER_GET_CLASS
<SUBSECTION Private>
GtkEventControllerPriv
gtk_event_controller_get_type
</SECTION>
<SECTION>
<FILE>gtkgesture</FILE>
<TITLE>GtkGesture</TITLE>
GtkGesture
gtk_gesture_get_device
gtk_gesture_get_window
gtk_gesture_set_window
gtk_gesture_is_active
gtk_gesture_is_recognized
GtkEventSequenceState
gtk_gesture_get_sequence_state
gtk_gesture_set_sequence_state
gtk_gesture_set_state
gtk_gesture_get_sequences
gtk_gesture_handles_sequence
<SUBSECTION>
gtk_gesture_get_last_updated_sequence
gtk_gesture_get_last_event
gtk_gesture_get_point
gtk_gesture_get_bounding_box
gtk_gesture_get_bounding_box_center
<SUBSECTION>
gtk_gesture_group
gtk_gesture_ungroup
gtk_gesture_get_group
gtk_gesture_is_grouped_with
<SUBSECTION Standard>
GTK_TYPE_GESTURE
GTK_GESTURE
GTK_GESTURE_CLASS
GTK_IS_GESTURE
GTK_IS_GESTURE_CLASS
GTK_GESTURE_GET_CLASS
<SUBSECTION Private>
gtk_gesture_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturesingle</FILE>
<TITLE>GtkGestureSingle</TITLE>
GtkGestureSingle
gtk_gesture_single_get_exclusive
gtk_gesture_single_set_exclusive
gtk_gesture_single_get_touch_only
gtk_gesture_single_set_touch_only
gtk_gesture_single_get_button
gtk_gesture_single_set_button
gtk_gesture_single_get_current_button
gtk_gesture_single_get_current_sequence
<SUBSECTION Standard>
GTK_TYPE_GESTURE_SINGLE
GTK_GESTURE_SINGLE
GTK_GESTURE_SINGLE_CLASS
GTK_IS_GESTURE_SINGLE
GTK_IS_GESTURE_SINGLE_CLASS
GTK_GESTURE_SINGLE_GET_CLASS
<SUBSECTION Private>
gtk_gesture_single_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturedrag</FILE>
<TITLE>GtkGestureDrag</TITLE>
GtkGestureDrag
gtk_gesture_drag_new
gtk_gesture_drag_get_start_point
gtk_gesture_drag_get_offset
<SUBSECTION Standard>
GTK_TYPE_GESTURE_DRAG
GTK_GESTURE_DRAG
GTK_GESTURE_DRAG_CLASS
GTK_IS_GESTURE_DRAG
GTK_IS_GESTURE_DRAG_CLASS
GTK_GESTURE_DRAG_GET_CLASS
<SUBSECTION Private>
gtk_gesture_drag_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturelongpress</FILE>
<TITLE>GtkGestureLongPress</TITLE>
GtkGestureLongPress
gtk_gesture_long_press_new
<SUBSECTION Standard>
GTK_TYPE_GESTURE_LONG_PRESS
GTK_GESTURE_LONG_PRESS
GTK_GESTURE_LONG_PRESS_CLASS
GTK_IS_GESTURE_LONG_PRESS
GTK_IS_GESTURE_LONG_PRESS_CLASS
GTK_GESTURE_LONG_PRESS_GET_CLASS
<SUBSECTION Private>
gtk_gesture_long_press_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturemultipress</FILE>
<TITLE>GtkGestureMultiPress</TITLE>
GtkGestureMultiPress
gtk_gesture_multi_press_new
gtk_gesture_multi_press_set_area
gtk_gesture_multi_press_get_area
<SUBSECTION Standard>
GTK_TYPE_GESTURE_MULTI_PRESS
GTK_GESTURE_MULTI_PRESS
GTK_GESTURE_MULTI_PRESS_CLASS
GTK_IS_GESTURE_MULTI_PRESS
GTK_IS_GESTURE_MULTI_PRESS_CLASS
GTK_GESTURE_MULTI_PRESS_GET_CLASS
<SUBSECTION Private>
gtk_gesture_multi_press_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturepan</FILE>
<TITLE>GtkGesturePan</TITLE>
GtkGesturePan
GtkPanDirection
GtkPanOrientation
gtk_gesture_pan_new
gtk_gesture_pan_get_orientation
gtk_gesture_pan_set_orientation
<SUBSECTION Standard>
GTK_TYPE_GESTURE_PAN
GTK_GESTURE_PAN
GTK_GESTURE_PAN_CLASS
GTK_IS_GESTURE_PAN
GTK_IS_GESTURE_PAN_CLASS
GTK_GESTURE_PAN_GET_CLASS
<SUBSECTION Private>
gtk_gesture_pan_get_type
</SECTION>
<SECTION>
<FILE>gtkgestureswipe</FILE>
<TITLE>GtkGestureSwipe</TITLE>
GtkGestureSwipe
gtk_gesture_swipe_new
gtk_gesture_swipe_get_velocity
<SUBSECTION Standard>
GTK_TYPE_GESTURE_SWIPE
GTK_GESTURE_SWIPE
GTK_GESTURE_SWIPE_CLASS
GTK_IS_GESTURE_SWIPE
GTK_IS_GESTURE_SWIPE_CLASS
GTK_GESTURE_SWIPE_GET_CLASS
<SUBSECTION Private>
gtk_gesture_swipe_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturerotate</FILE>
<TITLE>GtkGestureRotate</TITLE>
GtkGestureRotate
gtk_gesture_rotate_new
gtk_gesture_rotate_get_angle_delta
<SUBSECTION Standard>
GTK_TYPE_GESTURE_ROTATE
GTK_GESTURE_ROTATE
GTK_GESTURE_ROTATE_CLASS
GTK_IS_GESTURE_ROTATE
GTK_IS_GESTURE_ROTATE_CLASS
GTK_GESTURE_ROTATE_GET_CLASS
<SUBSECTION Private>
gtk_gesture_rotate_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturezoom</FILE>
<TITLE>GtkGestureZoom</TITLE>
GtkGestureZoom
gtk_gesture_zoom_new
gtk_gesture_zoom_get_scale_delta
<SUBSECTION Standard>
GTK_TYPE_GESTURE_ZOOM
GTK_GESTURE_ZOOM
GTK_GESTURE_ZOOM_CLASS
GTK_IS_GESTURE_ZOOM
GTK_IS_GESTURE_ZOOM_CLASS
GTK_GESTURE_ZOOM_GET_CLASS
<SUBSECTION Private>
gtk_gesture_zoom_get_type
</SECTION>
@@ -0,0 +1,59 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="gtk3-widget-factory">
<refentryinfo>
<title>gtk3-widget-factory</title>
<productname>GTK+</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Matthias</firstname>
<surname>Clasen</surname>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>gtk3-widget-factory</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gtk3-widget-factory</refname>
<refpurpose>Demonstrate GTK+ widgets</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>gtk3-widget-factory</command>
<arg choice="opt">--help</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
<para>
<command>gtk3-widget-factory</command> is a collection of examples.
Its purpose is to demonstrate many GTK+ widgets in a form
that is useful to GTK+ theme developers.
</para>
<para>
The application shows widgets in different, typical combinations
and states.
</para>
</refsect1>
<refsect1><title>Options</title>
<para>The following options are understood:</para>
<variablelist>
<varlistentry>
<term><option>-h</option>, <option>--help</option></term>
<listitem><para>Show help options</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
+10
View File
@@ -63,6 +63,7 @@ gtk_entry_buffer_get_type
gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_box_get_type
gtk_event_controller_get_type
gtk_expander_get_type
gtk_file_chooser_button_get_type
gtk_file_chooser_dialog_get_type
@@ -79,6 +80,15 @@ gtk_font_chooser_widget_get_type
gtk_font_selection_dialog_get_type
gtk_font_selection_get_type
gtk_frame_get_type
gtk_gesture_get_type
gtk_gesture_drag_get_type
gtk_gesture_long_press_get_type
gtk_gesture_multi_press_get_type
gtk_gesture_pan_get_type
gtk_gesture_rotate_get_type
gtk_gesture_single_get_type
gtk_gesture_swipe_get_type
gtk_gesture_zoom_get_type
gtk_grid_get_type
gtk_handle_box_get_type
gtk_hbox_get_type
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

+138
View File
@@ -0,0 +1,138 @@
<?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="chap-input-handling">
<refmeta>
<refentrytitle>The GTK+ Input Handling Model</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>The GTK+ Input Handling Model</refname>
<refpurpose>
GTK+ input handling in detail
</refpurpose>
</refnamediv>
<refsect1 id="input-overview">
<title>Overview of GTK+ input handling</title>
<para>
This chapter describes in detail how GTK+ handles input. If you are interested
in what happens to translate a key press or mouse motion of the users into a
change of a GTK+ widget, you should read this chapter. This knowledge will also
be useful if you decide to implement your own widgets.
</para>
<refsect2>
<title>Devices and events</title>
<!-- input devices: master/slave, keyboard/pointer/touch -->
<para>
The most basic input devices that every computer user has interacted with are
keyboards and mice; beyond these, GTK+ supports touchpads, touchscreens and
more exotic input devices such as graphics tablets. Inside GTK+, every such
input device is represented by a #GdkDevice object.
</para>
<para>
To simplify dealing with the variability between these input devices, GTK+
has a concept of master and slave devices. The concrete physical devices that
have many different characteristics (mice may have 2 or 3 or 8 buttons,
keyboards have different layouts and may or may not have a separate number
block, etc) are represented as slave devices. Each slave device is
associated with a virtual master device. Master devices always come in
pointer/keyboard pairs - you can think of such a pair as a 'seat'.
</para>
<para>
GTK+ widgets generally deal with the master devices, and thus can be used
with any pointing device or keyboard.
</para>
<!-- input events: button, touch, key, motion, etc -->
<para>
When a user interacts with an input device (e.g. moves a mouse or presses
a key on the keyboard), GTK+ receives events from the windowing system.
These are typically directed at a specific window - for pointer events,
the window under the pointer (grabs complicate this), for keyboard events,
the window with the keyboard focus.
</para>
<para>
GDK translates these raw windowing system events into #GdkEvents.
Typical input events are:
<simplelist>
<member>GdkEventButton</member>
<member>GdkEventMotion</member>
<member>GdkEventCrossing</member>
<member>GdkEventKey</member>
<member>GdkEventFocus</member>
<member>GdkEventTouch</member>
</simplelist>
</para>
<para>
When GTK+ is initialized, it sets up an event handler function with
gdk_event_handler_set(), which receives all of these input events
(as well as others, for instance window management related events).
</para>
</refsect2>
<refsect2>
<title>Event propagation</title>
<para>
When GTK+ receives an event, it determines the target widget that
it is directed to. Unless grabs are involved, this is done by finding
the widget to which the window of the event belongs.
</para>
<para>
The event is then propagated from the toplevel window down to the
target widget. In this phase, which is known as the “capture” phase,
gestures that are attached with %GTK_PHASE_CAPTURE get a chance
to react to the event.
</para>
<para>
Next, the appropriate event signal is emitted for the event in question,
e.g. “motion-notify-event”. Handling these signals was the primary
way to handle input in GTK+ widgets before gestures were introduced.
The signals are emitted from the target widget up to the toplevel,
until a signal handler indicates that it has handled the event, by
returning %GDK_EVENT_STOP.
</para>
<para>
The default handlers for the event signals send the event
to gestures that are attached with %GTK_PHASE_TARGET. Therefore,
gestures in the ”target” phase are only used if the widget does
not have its own event handlers, or takes care to chain up to the
default handlers.
</para>
<para>
After calling the event handlers, in the so-called ”bubble” phase,
gestures that are attached with %GTK_PHASE_BUBBLE get a chance
to react to the event.
</para>
<!-- grabs -->
</refsect2>
<refsect2>
<title>Keyboard input</title>
<!-- focus, tab, directional navigation -->
<!-- mnemonics, accelerators, bindings -->
</refsect2>
<refsect2>
<title>Gestures</title>
<!-- touch sequences, states, anything else -->
</refsect2>
</refsect1>
</refentry>
+50 -1
View File
@@ -194,10 +194,27 @@ additional environment variables.
<term>no-css-cache</term>
<listitem><para>Bypass caching for CSS style properties.</para></listitem>
</varlistentry>
<varlistentry>
<term>baselines</term>
<listitem><para>Baselines.</para></listitem>
</varlistentry>
<varlistentry>
<term>pixel-cache</term>
<listitem><para>Pixel cache.</para></listitem>
</varlistentry>
<varlistentry>
<term>no-pixel-cache</term>
<listitem><para>Disable the pixel cache.</para></listitem>
</varlistentry>
<varlistentry>
<term>interactive</term>
<listitem><para>Open the <link linkend="interactive-debugging">interactive debugger</link>.</para></listitem>
</varlistentry>
</variablelist>
The special value <literal>all</literal> can be used to turn on all
debug options.
debug options. The special value <literal>help</literal> can be used
to obtain a list of all supported debug options.
</para>
</formalpara>
@@ -509,6 +526,38 @@ nevertheless.
</refsect2>
<refsect2 id="interactive-debugging">
<title>Interactive debugging</title>
<inlinegraphic fileref="inspector.png" format="PNG"></inlinegraphic>
<para>
GTK+ includes an interactive debugger, called the GTK+ Inspector, which
lets you explore the widget tree of any GTK+ application at runtime, as
well as tweak the theme and trigger visual debugging aids. You can
easily try out changes at runtime before putting them into the code.
</para>
<para>
Note that the GTK+ inspector can only show GTK+ internals. It can not
understand the application-specific logic of a GTK+ application. Also,
the fact that the GTK+ inspector is running in the application process
limits what it can do. It is meant as a complement to full-blown debuggers
and system tracing facilities such as DTrace, not as a replacement.
</para>
<para>
To enable the GTK+ inspector, you can use the Control-Shift-I or
Control-Shift-D keyboard shortcuts, or set the
<envar>GTK_DEBUG=interactive</envar> environment variable.
</para>
<para>
In some situations, it may be inappropriate to give users access to the
GTK+ inspector. The keyboard shortcuts can be disabled with the
`enable-inspector-keybinding` key in the `org.gtk.Settings.Debug`
GSettings schema.
</para>
</refsect2>
</refsect1>
</refentry>
+3 -2
View File
@@ -476,10 +476,11 @@ main (int argc, char **argv)
{
PlugMan *plug_man;
int status;
const gchar *accels[] = { "F11", NULL };
plug_man = plug_man_new ();
gtk_application_add_accelerator (GTK_APPLICATION (plug_man),
"F11", "win.fullscreen", NULL);
gtk_application_set_accels_for_action (GTK_APPLICATION (plug_man),
"win.fullscreen", accels);
status = g_application_run (G_APPLICATION (plug_man), argc, argv);
g_object_unref (plug_man);
+20 -7
View File
@@ -62,11 +62,11 @@ LDADD = \
#
# GDK header files for public installation (non-generated)
#
#
gdk_public_h_sources = \
gdk.h \
gdkapplaunchcontext.h \
gdkcairo.h \
gdkcolor.h \
gdkcursor.h \
gdkdevice.h \
gdkdevicemanager.h \
@@ -94,6 +94,13 @@ gdk_public_h_sources = \
gdkvisual.h \
gdkwindow.h
deprecated_h_sources = \
deprecated/gdkcolor.h
gdk_h_sources = \
$(gdk_public_h_sources) \
$(deprecated_h_sources)
gdk_private_headers = \
gdkapplaunchcontextprivate.h \
gdkcursorprivate.h \
@@ -111,11 +118,14 @@ gdk_private_headers = \
gdkvisualprivate.h \
gdkx.h
deprecated_c_sources = \
deprecated/gdkcolor.c
gdk_c_sources = \
$(deprecated_c_sources) \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
gdkcolor.c \
gdkcursor.c \
gdkdeprecated.c \
gdkdevice.c \
@@ -157,6 +167,9 @@ gdkincludedir = $(includedir)/gtk-3.0/gdk
gdkinclude_HEADERS = $(gdk_public_h_sources) gdkenumtypes.h gdkversionmacros.h
nodist_gdkinclude_HEADERS = gdkconfig.h
deprecatedincludedir = $(includedir)/gtk-3.0/gdk/deprecated
deprecatedinclude_HEADERS = $(deprecated_h_sources)
common_sources = \
$(gdk_private_headers) \
$(gdk_c_sources) \
@@ -196,7 +209,7 @@ endif
if HAVE_INTROSPECTION
introspection_files = \
$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources)) \
$(filter-out gdkkeysyms-compat.h, $(gdk_h_sources)) \
$(gdk_c_sources) \
gdkenumtypes.c \
gdkenumtypes.h
@@ -378,15 +391,15 @@ BUILT_SOURCES = \
gdkenumtypes.h: stamp-gdkenumtypes.h
@true
stamp-gdkenumtypes.h: $(gdk_public_h_sources) gdkenumtypes.h.template
stamp-gdkenumtypes.h: $(gdk_h_sources) gdkenumtypes.h.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.h.template \
$(gdk_public_h_sources) ) >> xgen-geth \
$(gdk_h_sources) ) >> xgen-geth \
&& (cmp -s xgen-geth gdkenumtypes.h || cp xgen-geth gdkenumtypes.h ) \
&& rm -f xgen-geth \
&& echo timestamp > $(@F)
gdkenumtypes.c: $(gdk_public_h_sources) gdkenumtypes.c.template
gdkenumtypes.c: $(gdk_h_sources) gdkenumtypes.c.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gdkenumtypes.c.template \
$(gdk_public_h_sources) ) > xgen-getc \
$(gdk_h_sources) ) > xgen-getc \
&& cp xgen-getc gdkenumtypes.c \
&& rm -f xgen-getc
+16 -1
View File
@@ -31,6 +31,8 @@
#include <time.h>
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* SECTION:colors
* @Short_description: Manipulation of colors
@@ -39,7 +41,8 @@
* A #GdkColor represents a color.
*
* When working with cairo, it is often more convenient
* to use a #GdkRGBA instead.
* to use a #GdkRGBA instead, and #GdkColor has been
* deprecated in favor of #GdkRGBA.
*/
@@ -52,6 +55,8 @@
* The result must be freed using gdk_color_free().
*
* Returns: a copy of @color
*
* Deprecated: 3.14: Use #GdkRGBA
*/
GdkColor*
gdk_color_copy (const GdkColor *color)
@@ -70,6 +75,8 @@ gdk_color_copy (const GdkColor *color)
* @color: a #GdkColor
*
* Frees a #GdkColor created with gdk_color_copy().
*
* Deprecated: 3.14: Use #GdkRGBA
*/
void
gdk_color_free (GdkColor *color)
@@ -87,6 +94,8 @@ gdk_color_free (GdkColor *color)
* table that stores #GdkColors.
*
* Returns: The hash function applied to @color
*
* Deprecated: 3.14: Use #GdkRGBA
*/
guint
gdk_color_hash (const GdkColor *color)
@@ -105,6 +114,8 @@ gdk_color_hash (const GdkColor *color)
* Compares two colors.
*
* Returns: %TRUE if the two colors compare equal
*
* Deprecated: 3.14: Use #GdkRGBA
*/
gboolean
gdk_color_equal (const GdkColor *colora,
@@ -139,6 +150,8 @@ G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
* and \#ffffffffffff).
*
* Returns: %TRUE if the parsing succeeded
*
* Deprecated: 3.14: Use #GdkRGBA
*/
gboolean
gdk_color_parse (const gchar *spec,
@@ -171,6 +184,8 @@ gdk_color_parse (const gchar *spec,
* Returns: a newly-allocated text string
*
* Since: 2.12
*
* Deprecated: 3.14: Use #GdkRGBA
*/
gchar *
gdk_color_to_string (const GdkColor *color)
+7 -7
View File
@@ -59,24 +59,24 @@ struct _GdkColor
#define GDK_TYPE_COLOR (gdk_color_get_type ())
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GType gdk_color_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GdkColor *gdk_color_copy (const GdkColor *color);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gdk_color_free (GdkColor *color);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
guint gdk_color_hash (const GdkColor *color);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
gchar * gdk_color_to_string (const GdkColor *color);
+5 -6
View File
@@ -24,8 +24,6 @@
#include "config.h"
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#include "gdkversionmacros.h"
#include "gdkmain.h"
@@ -359,8 +357,9 @@ gdk_get_display (void)
* Gets the display name specified in the command line arguments passed
* to gdk_init() or gdk_parse_args(), if any.
*
* Returns: the display name, if specified explicitly, otherwise %NULL
* this string is owned by GTK+ and must not be modified or freed.
* Returns: (nullable): the display name, if specified explicitly,
* otherwise %NULL this string is owned by GTK+ and must not be
* modified or freed.
*
* Since: 2.2
*/
@@ -382,8 +381,8 @@ gdk_get_display_arg_name (void)
* display has previously been set, simply returns that. An internal
* function that should not be used by applications.
*
* Returns: (transfer none): the default display, if it could be
* opened, otherwise %NULL.
* Returns: (nullable) (transfer none): the default display, if it
* could be opened, otherwise %NULL.
**/
GdkDisplay *
gdk_display_open_default_libgtk_only (void)
+4 -1
View File
@@ -31,7 +31,6 @@
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkapplaunchcontext.h>
#include <gdk/gdkcairo.h>
#include <gdk/gdkcolor.h>
#include <gdk/gdkcursor.h>
#include <gdk/gdkdevice.h>
#include <gdk/gdkdevicemanager.h>
@@ -58,6 +57,10 @@
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
#ifndef GDK_DISABLE_DEPRECATED
#include <gdk/deprecated/gdkcolor.h>
#endif
#undef __GDK_H_INSIDE__
#endif /* __GDK_H__ */
+1 -1
View File
@@ -23,7 +23,7 @@
#endif
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkcolor.h>
#include <gdk/deprecated/gdkcolor.h>
#include <gdk/gdkrgba.h>
#include <gdk/gdkpixbuf.h>
#include <pango/pangocairo.h>
+10 -6
View File
@@ -264,8 +264,8 @@ gdk_cursor_new_for_display (GdkDisplay *display,
* Creates a new cursor by looking up @name in the current cursor
* theme.
*
* Returns: a new #GdkCursor, or %NULL if there is no cursor with
* the given name
* Returns: (nullable): a new #GdkCursor, or %NULL if there is no
* cursor with the given name
*
* Since: 2.8
*/
@@ -423,7 +423,8 @@ gdk_cursor_get_display (GdkCursor *cursor)
* on the cursor, GDK may not be able to obtain the image data. In this
* case, %NULL is returned.
*
* Returns: (transfer full): a #GdkPixbuf representing @cursor, or %NULL
* Returns: (nullable) (transfer full): a #GdkPixbuf representing
* @cursor, or %NULL
*
* Since: 2.8
*/
@@ -478,8 +479,10 @@ gdk_cursor_get_image (GdkCursor *cursor)
/**
* gdk_cursor_get_surface:
* @cursor: a #GdkCursor
* @x_hot: Location to store the hotspot x position, or %NULL
* @y_hot: Location to store the hotspot y position, or %NULL
* @x_hot: (optional) (out): Location to store the hotspot x position,
* or %NULL
* @y_hot: (optional) (out): Location to store the hotspot y position,
* or %NULL
*
* Returns a cairo image surface with the image used to display the cursor.
*
@@ -487,7 +490,8 @@ gdk_cursor_get_image (GdkCursor *cursor)
* on the cursor, GDK may not be able to obtain the image data. In this
* case, %NULL is returned.
*
* Returns: (transfer full): a #cairo_surface_t representing @cursor, or %NULL
* Returns: (nullable) (transfer full): a #cairo_surface_t
* representing @cursor, or %NULL
*
* Since: 3.10
*/
+20 -14
View File
@@ -383,9 +383,9 @@ gdk_device_get_property (GObject *object,
* gdk_device_get_state: (skip)
* @device: a #GdkDevice.
* @window: a #GdkWindow.
* @axes: an array of doubles to store the values of the axes of @device in,
* or %NULL.
* @mask: location to store the modifiers, or %NULL.
* @axes: (nullable) (array): an array of doubles to store the values of
* the axes of @device in, or %NULL.
* @mask: (optional) (out): location to store the modifiers, or %NULL.
*
* Gets the current state of a pointer device relative to @window. As a slave
* devices coordinates are those of its master pointer, this
@@ -505,7 +505,8 @@ gdk_device_get_position (GdkDevice *device,
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab().
*
* Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
* Returns: (nullable) (transfer none): the #GdkWindow under the
* device position, or %NULL.
*
* Since: 3.0
**/
@@ -554,7 +555,8 @@ gdk_device_get_window_at_position_double (GdkDevice *device,
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab().
*
* Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
* Returns: (nullable) (transfer none): the #GdkWindow under the
* device position, or %NULL.
*
* Since: 3.0
**/
@@ -583,8 +585,11 @@ gdk_device_get_window_at_position (GdkDevice *device,
* @window: the window with respect to which which the event coordinates will be reported
* @start: starting timestamp for range of events to return
* @stop: ending timestamp for the range of events to return
* @events: (array length=n_events) (out) (transfer full): location to store a newly-allocated array of #GdkTimeCoord, or %NULL
* @n_events: location to store the length of @events, or %NULL
* @events: (array length=n_events) (out) (transfer full) (optional):
* location to store a newly-allocated array of #GdkTimeCoord, or
* %NULL
* @n_events: (out) (optional): location to store the length of
* @events, or %NULL
*
* Obtains the motion history for a pointer device; given a starting and
* ending timestamp, return all events in the motion history for
@@ -644,7 +649,7 @@ _gdk_device_allocate_history (GdkDevice *device,
/**
* gdk_device_free_history: (skip)
* @events: an array of #GdkTimeCoord.
* @events: (array length=n_events): an array of #GdkTimeCoord.
* @n_events: the length of the array.
*
* Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history().
@@ -941,7 +946,8 @@ gdk_device_get_display (GdkDevice *device)
* If @device is of type %GDK_DEVICE_TYPE_FLOATING, %NULL will be
* returned, as there is no associated device.
*
* Returns: (transfer none): The associated device, or %NULL
* Returns: (nullable) (transfer none): The associated device, or
* %NULL
*
* Since: 3.0
**/
@@ -1001,10 +1007,10 @@ _gdk_device_set_associated_device (GdkDevice *device,
* the list of slave devices attached to it, otherwise it will return
* %NULL
*
* Returns: (transfer container) (element-type GdkDevice): the list of
* slave devices, or %NULL. The list must be freed with
* g_list_free(), the contents of the list are owned by GTK+
* and should not be freed.
* Returns: (nullable) (transfer container) (element-type GdkDevice):
* the list of slave devices, or %NULL. The list must be
* freed with g_list_free(), the contents of the list are
* owned by GTK+ and should not be freed.
**/
GList *
gdk_device_list_slave_devices (GdkDevice *device)
@@ -1117,7 +1123,7 @@ gdk_device_list_axes (GdkDevice *device)
* @device: a pointer #GdkDevice.
* @axes: (array): pointer to an array of axes
* @axis_label: #GdkAtom with the axis label.
* @value: location to store the found value.
* @value: (out): location to store the found value.
*
* Interprets an array of double as axis values for a given device,
* and locates the value in the array for a given axis label, as returned
+3 -3
View File
@@ -284,9 +284,9 @@ gdk_device_manager_get_property (GObject *object,
*
* Gets the #GdkDisplay associated to @device_manager.
*
* Returns: (transfer none): the #GdkDisplay to which @device_manager is
* associated to, or #NULL. This memory is owned by GDK and
* must not be freed or unreferenced.
* Returns: (nullable) (transfer none): the #GdkDisplay to which
* @device_manager is associated to, or #NULL. This memory is
* owned by GDK and must not be freed or unreferenced.
*
* Since: 3.0
**/
+13 -10
View File
@@ -306,8 +306,9 @@ gdk_display_is_closed (GdkDisplay *display)
* Gets the next #GdkEvent to be processed for @display, fetching events from the
* windowing system if necessary.
*
* Returns: the next #GdkEvent to be processed, or %NULL if no events
* are pending. The returned #GdkEvent should be freed with gdk_event_free().
* Returns: (nullable): the next #GdkEvent to be processed, or %NULL
* if no events are pending. The returned #GdkEvent should be freed
* with gdk_event_free().
*
* Since: 2.2
**/
@@ -331,9 +332,9 @@ gdk_display_get_event (GdkDisplay *display)
* not get more events from the windowing system. It only checks the events
* that have already been moved to the GDK event queue.)
*
* Returns: a copy of the first #GdkEvent on the event queue, or %NULL
* if no events are in the queue. The returned #GdkEvent should be freed with
* gdk_event_free().
* Returns: (nullable): a copy of the first #GdkEvent on the event
* queue, or %NULL if no events are in the queue. The returned
* #GdkEvent should be freed with gdk_event_free().
*
* Since: 2.2
**/
@@ -585,7 +586,8 @@ gdk_display_get_pointer (GdkDisplay *display,
* if the window under the mouse pointer is not known to GDK (for example,
* belongs to another application).
*
* Returns: (transfer none): the window under the mouse pointer, or %NULL
* Returns: (nullable) (transfer none): the window under the mouse
* pointer, or %NULL
*
* Since: 2.2
*
@@ -1390,8 +1392,9 @@ gdk_display_device_is_grabbed (GdkDisplay *display,
*
* Returns the #GdkDeviceManager associated to @display.
*
* Returns: (transfer none): A #GdkDeviceManager, or %NULL. This memory is
* owned by GDK and must not be freed or unreferenced.
* Returns: (nullable) (transfer none): A #GdkDeviceManager, or
* %NULL. This memory is owned by GDK and must not be freed
* or unreferenced.
*
* Since: 3.0
**/
@@ -1780,8 +1783,8 @@ gdk_display_get_app_launch_context (GdkDisplay *display)
*
* Opens a display.
*
* Returns: (transfer none): a #GdkDisplay, or %NULL
* if the display could not be opened
* Returns: (nullable) (transfer none): a #GdkDisplay, or %NULL if the
* display could not be opened
*
* Since: 2.2
*/
+11 -10
View File
@@ -69,13 +69,13 @@
* notification when displays appear or disappear or the default display
* changes.
*
* You can use gdk_display_manager_get() to obtain the GdkDisplayManager
* You can use gdk_display_manager_get() to obtain the #GdkDisplayManager
* singleton, but that should be rarely necessary. Typically, initializing
* GTK+ opens a display that you can work with without ever accessing the
* GdkDisplayManager.
* #GdkDisplayManager.
*
* The GDK library can be built with support for multiple backends.
* The GdkDisplayManager object determines which backend is used
* The #GdkDisplayManager object determines which backend is used
* at runtime.
*
* When writing backend-specific code that is supposed to work with
@@ -313,8 +313,8 @@ gdk_display_manager_get (void)
*
* Gets the default #GdkDisplay.
*
* Returns: (transfer none): a #GdkDisplay, or %NULL
* if there is no default display.
* Returns: (nullable) (transfer none): a #GdkDisplay, or %NULL if
* there is no default display.
*
* Since: 2.2
*/
@@ -331,8 +331,8 @@ gdk_display_manager_get_default_display (GdkDisplayManager *manager)
* function for:
* `gdk_display_manager_get_default_display (gdk_display_manager_get ())`.
*
* Returns: (transfer none): a #GdkDisplay, or %NULL if there is no default
* display.
* Returns: (nullable) (transfer none): a #GdkDisplay, or %NULL if
* there is no default display.
*
* Since: 2.2
*/
@@ -348,7 +348,8 @@ gdk_display_get_default (void)
* Gets the default screen for the default display. (See
* gdk_display_get_default ()).
*
* Returns: (transfer none): a #GdkScreen, or %NULL if there is no default display.
* Returns: (nullable) (transfer none): a #GdkScreen, or %NULL if
* there is no default display.
*
* Since: 2.2
*/
@@ -411,8 +412,8 @@ gdk_display_manager_list_displays (GdkDisplayManager *manager)
*
* Opens a display.
*
* Returns: (transfer none): a #GdkDisplay, or %NULL
* if the display could not be opened
* Returns: (nullable) (transfer none): a #GdkDisplay, or %NULL if the
* display could not be opened
*
* Since: 3.0
*/
+1 -1
View File
@@ -68,7 +68,7 @@ gdk_drag_context_list_targets (GdkDragContext *context)
* @context: a #GdkDragContext
*
* Determines the bitmask of actions proposed by the source if
* gdk_drag_context_get_suggested_action() returns GDK_ACTION_ASK.
* gdk_drag_context_get_suggested_action() returns %GDK_ACTION_ASK.
*
* Returns: the #GdkDragAction flags
*
+50 -26
View File
@@ -80,7 +80,8 @@ _gdk_event_emit (GdkEvent *event)
* Find the first event on the queue that is not still
* being filled in.
*
* Returns: Pointer to the list node for that event, or NULL.
* Returns: (nullable): Pointer to the list node for that event, or
* %NULL.
**/
GList*
_gdk_event_queue_find_first (GdkDisplay *display)
@@ -241,7 +242,7 @@ _gdk_event_queue_remove_link (GdkDisplay *display,
* Removes and returns the first event from the event
* queue that is not still being filled in.
*
* Returns: the event, or %NULL. Ownership is transferred
* Returns: (nullable): the event, or %NULL. Ownership is transferred
* to the caller.
**/
GdkEvent*
@@ -406,8 +407,9 @@ gdk_events_pending (void)
* on, fetching events from the windowing system if necessary.
* See gdk_display_get_event().
*
* Returns: the next #GdkEvent to be processed, or %NULL if no events
* are pending. The returned #GdkEvent should be freed with gdk_event_free().
* Returns: (nullable): the next #GdkEvent to be processed, or %NULL
* if no events are pending. The returned #GdkEvent should be freed
* with gdk_event_free().
**/
GdkEvent*
gdk_event_get (void)
@@ -435,9 +437,9 @@ gdk_event_get (void)
* If there is an event waiting in the event queue of some open
* display, returns a copy of it. See gdk_display_peek_event().
*
* Returns: a copy of the first #GdkEvent on some event queue, or %NULL if no
* events are in any queues. The returned #GdkEvent should be freed with
* gdk_event_free().
* Returns: (nullable): a copy of the first #GdkEvent on some event
* queue, or %NULL if no events are in any queues. The returned
* #GdkEvent should be freed with gdk_event_free().
**/
GdkEvent*
gdk_event_peek (void)
@@ -908,7 +910,7 @@ gdk_event_get_time (const GdkEvent *event)
/**
* gdk_event_get_state:
* @event: a #GdkEvent or NULL
* @event: (allow-none): a #GdkEvent or %NULL
* @state: (out): return location for state
*
* If the event contains a “state” field, puts that field in @state. Otherwise
@@ -1509,7 +1511,7 @@ gdk_event_set_device (GdkEvent *event,
* If the event contains a “device” field, this function will return
* it, else it will return %NULL.
*
* Returns: (transfer none): a #GdkDevice, or %NULL.
* Returns: (nullable) (transfer none): a #GdkDevice, or %NULL.
*
* Since: 3.0
**/
@@ -1641,7 +1643,7 @@ gdk_event_set_source_device (GdkEvent *event,
* If the event does not contain a device field, this function will
* return %NULL.
*
* Returns: (transfer none): a #GdkDevice, or %NULL.
* Returns: (nullable) (transfer none): a #GdkDevice, or %NULL.
*
* Since: 3.0
**/
@@ -1950,7 +1952,7 @@ gdk_event_get_screen (const GdkEvent *event)
* %GDK_TOUCH_END or %GDK_TOUCH_CANCEL, returns the #GdkEventSequence
* to which the event belongs. Otherwise, return %NULL.
*
* Returns: the event sequence that the event belongs to
* Returns: (transfer none): the event sequence that the event belongs to
*
* Since: 3.4
*/
@@ -2090,35 +2092,32 @@ _gdk_event_button_generate (GdkDisplay *display,
}
void
gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags)
_gdk_set_window_state (GdkWindow *window,
GdkWindowState new_state)
{
GdkEvent temp_event;
GdkWindowState old;
g_return_if_fail (window != NULL);
temp_event.window_state.window = window;
temp_event.window_state.type = GDK_WINDOW_STATE;
temp_event.window_state.send_event = FALSE;
old = temp_event.window_state.window->state;
temp_event.window_state.new_window_state = old;
temp_event.window_state.new_window_state |= set_flags;
temp_event.window_state.new_window_state &= ~unset_flags;
temp_event.window_state.changed_mask = temp_event.window_state.new_window_state ^ old;
temp_event.window_state.new_window_state = new_state;
old = window->state;
if (temp_event.window_state.new_window_state == old)
return; /* No actual work to do, nothing changed. */
temp_event.window_state.changed_mask = new_state ^ old;
/* Actually update the field in GdkWindow, this is sort of an odd
* place to do it, but seems like the safest since it ensures we expose no
* inconsistent state to the user.
*/
window->state = temp_event.window_state.new_window_state;
window->state = new_state;
if (temp_event.window_state.changed_mask & GDK_WINDOW_STATE_WITHDRAWN)
_gdk_window_update_viewable (window);
@@ -2134,7 +2133,6 @@ gdk_synthesize_window_state (GdkWindow *window,
case GDK_WINDOW_TEMP: /* ? */
gdk_display_put_event (gdk_window_get_display (window), &temp_event);
break;
case GDK_WINDOW_FOREIGN:
case GDK_WINDOW_ROOT:
case GDK_WINDOW_CHILD:
@@ -2142,6 +2140,16 @@ gdk_synthesize_window_state (GdkWindow *window,
}
}
void
gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags)
{
g_return_if_fail (window != NULL);
_gdk_set_window_state (window, (window->state | set_flags) & ~unset_flags);
}
/**
* gdk_display_set_double_click_time:
* @display: a #GdkDisplay
@@ -2201,6 +2209,22 @@ G_DEFINE_BOXED_TYPE (GdkEvent, gdk_event,
gdk_event_copy,
gdk_event_free)
static GdkEventSequence *
gdk_event_sequence_copy (GdkEventSequence *sequence)
{
return sequence;
}
static void
gdk_event_sequence_free (GdkEventSequence *sequence)
{
/* Nothing to free here */
}
G_DEFINE_BOXED_TYPE (GdkEventSequence, gdk_event_sequence,
gdk_event_sequence_copy,
gdk_event_sequence_free)
/**
* gdk_setting_get:
* @name: the name of the setting.
+5 -2
View File
@@ -30,7 +30,6 @@
#endif
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkdevice.h>
@@ -51,6 +50,7 @@ G_BEGIN_DECLS
#define GDK_TYPE_EVENT (gdk_event_get_type ())
#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
/**
* GDK_PRIORITY_EVENTS:
@@ -189,7 +189,7 @@ typedef enum {
* GdkFilterFunc:
* @xevent: the native event to filter.
* @event: the GDK event to which the X event will be translated.
* @data: user data set when the filter was installed.
* @data: (closure): user data set when the filter was installed.
*
* Specifies the type of function used to filter native events before they are
* converted to GDK events.
@@ -1194,6 +1194,9 @@ union _GdkEvent
GDK_AVAILABLE_IN_ALL
GType gdk_event_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_14
GType gdk_event_sequence_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
gboolean gdk_events_pending (void);
GDK_AVAILABLE_IN_ALL
+5 -5
View File
@@ -436,7 +436,7 @@ _gdk_frame_clock_begin_frame (GdkFrameClock *frame_clock)
* for the current frame or a recent frame. The #GdkFrameTimings
* object may not yet be complete: see gdk_frame_timings_get_complete().
*
* Returns: the #GdkFrameTimings object for the specified
* Returns: (nullable): the #GdkFrameTimings object for the specified
* frame, or %NULL if it is not available. See
* gdk_frame_clock_get_history_start().
* Since: 3.8
@@ -469,10 +469,10 @@ gdk_frame_clock_get_timings (GdkFrameClock *frame_clock,
*
* Gets the frame timings for the current frame.
*
* Returns: the #GdkFrameTimings for the frame currently being
* processed, or even no frame is being processed, for the
* previous frame. Before any frames have been procesed,
* returns %NULL.
* Returns: (nullable): the #GdkFrameTimings for the frame currently
* being processed, or even no frame is being processed, for the
* previous frame. Before any frames have been procesed, returns
* %NULL.
* Since: 3.8
*/
GdkFrameTimings *
+2 -3
View File
@@ -321,9 +321,8 @@ void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst);
void _gdk_windowing_event_data_free (GdkEvent *event);
void gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags);
void _gdk_set_window_state (GdkWindow *window,
GdkWindowState new_state);
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
GdkRectangle *extents);
+3 -3
View File
@@ -680,9 +680,9 @@ gdk_keymap_get_modifier_mask (GdkKeymap *keymap,
* `gdk/gdkkeysyms.h` header file
* but without the leading “GDK_KEY_”.
*
* Returns: (transfer none): a string containing the name of the key,
* or %NULL if @keyval is not a valid key. The string should not be
* modified.
* Returns: (nullable) (transfer none): a string containing the name
* of the key, or %NULL if @keyval is not a valid key. The string
* should not be modified.
*/
gchar *
gdk_keyval_name (guint keyval)
+4 -3
View File
@@ -321,7 +321,8 @@ gdk_offscreen_window_get_device_state (GdkWindow *window,
* If you need to keep this around over window resizes, you need to
* add a reference to it.
*
* Returns: (transfer none): The offscreen surface, or %NULL if not offscreen
* Returns: (nullable) (transfer none): The offscreen surface, or
* %NULL if not offscreen
*/
cairo_surface_t *
gdk_offscreen_window_get_surface (GdkWindow *window)
@@ -608,8 +609,8 @@ gdk_offscreen_window_set_embedder (GdkWindow *window,
*
* Gets the window that @window is embedded in.
*
* Returns: (transfer none): the embedding #GdkWindow, or %NULL
* if @window is not an mbedded offscreen window
* Returns: (nullable) (transfer none): the embedding #GdkWindow, or
* %NULL if @window is not an mbedded offscreen window
*
* Since: 2.18
*/
+4 -5
View File
@@ -24,7 +24,6 @@
#include "gdkpixbuf.h"
#include "gdkcolor.h"
#include "gdkwindow.h"
#include "gdkinternals.h"
@@ -77,8 +76,8 @@
* (In short, there are several ways this function can fail, and if it fails
* it returns %NULL; so check the return value.)
*
* Returns: (transfer full): A newly-created pixbuf with a reference
* count of 1, or %NULL on error
* Returns: (nullable) (transfer full): A newly-created pixbuf with a
* reference count of 1, or %NULL on error
*/
GdkPixbuf *
gdk_pixbuf_get_from_window (GdkWindow *src,
@@ -225,8 +224,8 @@ convert_no_alpha (guchar *dest_data,
* This function will create an RGB pixbuf with 8 bits per channel.
* The pixbuf will contain an alpha channel if the @surface contains one.
*
* Returns: (transfer full): A newly-created pixbuf with a reference
* count of 1, or %NULL on error
* Returns: (nullable) (transfer full): A newly-created pixbuf with a
* reference count of 1, or %NULL on error
*/
GdkPixbuf *
gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
+11 -10
View File
@@ -427,8 +427,8 @@ gdk_screen_set_font_options (GdkScreen *screen,
*
* Gets any options previously set with gdk_screen_set_font_options().
*
* Returns: the current font options, or %NULL if no default
* font options have been set.
* Returns: (nullable): the current font options, or %NULL if no
* default font options have been set.
*
* Since: 2.10
**/
@@ -760,8 +760,8 @@ gdk_screen_get_monitor_height_mm (GdkScreen *screen,
* Usually something like VGA, DVI, or TV, not the actual
* product name of the display device.
*
* Returns: a newly-allocated string containing the name of the monitor,
* or %NULL if the name cannot be determined
* Returns: (nullable): a newly-allocated string containing the name
* of the monitor, or %NULL if the name cannot be determined
*
* Since: 2.14
*/
@@ -899,8 +899,9 @@ gdk_screen_get_system_visual (GdkScreen * screen)
* For setting an overall opacity for a top-level window, see
* gdk_window_set_opacity().
*
* Returns: (transfer none): a visual to use for windows with an
* alpha channel or %NULL if the capability is not available.
* Returns: (nullable) (transfer none): a visual to use for windows
* with an alpha channel or %NULL if the capability is not
* available.
*
* Since: 2.8
**/
@@ -974,7 +975,8 @@ gdk_screen_make_display_name (GdkScreen *screen)
* The returned window should be unrefed using g_object_unref() when
* no longer needed.
*
* Returns: (transfer full): the currently active window, or %NULL.
* Returns: (nullable) (transfer full): the currently active window,
* or %NULL.
*
* Since: 2.10
**/
@@ -1006,9 +1008,8 @@ gdk_screen_get_active_window (GdkScreen *screen)
* windows it contains, so it should be freed using g_list_free() and
* its windows unrefed using g_object_unref() when no longer needed.
*
* Returns: (transfer full) (element-type GdkWindow):
* a list of #GdkWindows for the current window stack,
* or %NULL.
* Returns: (nullable) (transfer full) (element-type GdkWindow): a
* list of #GdkWindows for the current window stack, or %NULL.
*
* Since: 2.10
**/
+16 -17
View File
@@ -62,7 +62,7 @@
/**
* gdk_selection_owner_set:
* @owner: a #GdkWindow or %NULL to indicate that the
* @owner: (allow-none): a #GdkWindow or %NULL to indicate that the
* the owner for the given should be unset.
* @selection: an atom identifying a selection.
* @time_: timestamp to use when setting the selection.
@@ -95,14 +95,12 @@ gdk_selection_owner_set (GdkWindow *owner,
*
* Determines the owner of the given selection.
*
* Returns: (transfer none): if there is a selection owner for
* this window, and it is a window known to the current
* process, the #GdkWindow that owns the selection, otherwise
* %NULL. Note that the return value may be owned
* by a different process if a foreign window
* was previously created for that window, but
* a new foreign window will never be created by
* this call.
* Returns: (nullable) (transfer none): if there is a selection owner
* for this window, and it is a window known to the current process,
* the #GdkWindow that owns the selection, otherwise %NULL. Note
* that the return value may be owned by a different process if a
* foreign window was previously created for that window, but a new
* foreign window will never be created by this call.
*/
GdkWindow*
gdk_selection_owner_get (GdkAtom selection)
@@ -138,7 +136,7 @@ gdk_selection_send_notify (GdkWindow *requestor,
/**
* gdk_selection_owner_set_for_display:
* @display: the #GdkDisplay
* @owner: a #GdkWindow or %NULL to indicate that the owner for
* @owner: (nullable): a #GdkWindow or %NULL to indicate that the owner for
* the given should be unset
* @selection: an atom identifying a selection
* @time_: timestamp to use when setting the selection
@@ -179,9 +177,10 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
* process if a foreign window was previously created for that
* window, but a new foreign window will never be created by this call.
*
* Returns: (transfer none): if there is a selection owner for this window,
* and it is a window known to the current process, the #GdkWindow that
* owns the selection, otherwise %NULL.
* Returns: (nullable) (transfer none): if there is a selection owner
* for this window, and it is a window known to the current
* process, the #GdkWindow that owns the selection, otherwise
* %NULL.
*
* Since: 2.2
*/
@@ -318,10 +317,10 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
* is not specified; it may be as pseudo-escape sequences
* \x{ABCD}, or it may be in some other form of approximation.
*
* Returns: the newly-allocated string, or %NULL if the
* conversion failed. (It should not fail for
* any properly formed UTF-8 string unless system
* limits like memory or file descriptors are exceeded.)
* Returns: (nullable): the newly-allocated string, or %NULL if the
* conversion failed. (It should not fail for any properly
* formed UTF-8 string unless system limits like memory or
* file descriptors are exceeded.)
**/
gchar *
gdk_utf8_to_string_target (const gchar *str)
+24
View File
@@ -122,6 +122,15 @@
*/
#define GDK_VERSION_3_12 (G_ENCODE_VERSION (3, 12))
/**
* GDK_VERSION_3_14:
*
* A macro that evaluates to the 3.14 version of GDK, in a format
* that can be used by the C pre-processor.
*
* Since: 3.14
*/
#define GDK_VERSION_3_14 (G_ENCODE_VERSION (3, 14))
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
@@ -293,4 +302,19 @@
# define GDK_AVAILABLE_IN_3_12 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_14
# define GDK_DEPRECATED_IN_3_14 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_14_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_14 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_14_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_14
# define GDK_AVAILABLE_IN_3_14 GDK_UNAVAILABLE(3, 14)
#else
# define GDK_AVAILABLE_IN_3_14 _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */
+2 -2
View File
@@ -203,8 +203,8 @@ gdk_visual_get_best_with_type (GdkVisualType visual_type)
* Combines gdk_visual_get_best_with_depth() and
* gdk_visual_get_best_with_type().
*
* Returns: (transfer none): best visual with both @depth and
* @visual_type, or %NULL if none
* Returns: (nullable) (transfer none): best visual with both @depth
* and @visual_type, or %NULL if none
*/
GdkVisual*
gdk_visual_get_best_with_both (gint depth,
+63 -27
View File
@@ -329,8 +329,8 @@ gdk_window_class_init (GdkWindowClass *klass)
* The ::pick-embedded-child signal is emitted to find an embedded
* child at the given position.
*
* Returns: (transfer none): the #GdkWindow of the embedded child at
* @x, @y, or %NULL
* Returns: (nullable) (transfer none): the #GdkWindow of the
* embedded child at @x, @y, or %NULL
*
* Since: 2.18
*/
@@ -935,7 +935,7 @@ recompute_visible_regions_internal (GdkWindow *private,
/* Convert from parent coords to window coords */
cairo_region_translate (new_clip, -private->x, -private->y);
if (private->shape)
if (should_apply_clip_as_shape (private) && private->shape)
cairo_region_intersect (new_clip, private->shape);
}
else
@@ -1853,14 +1853,14 @@ window_remove_from_pointer_info (GdkWindow *window,
/**
* _gdk_window_destroy_hierarchy:
* @window: a #GdkWindow
* @recursing: If TRUE, then this is being called because a parent
* @recursing: If %TRUE, then this is being called because a parent
* was destroyed.
* @recursing_native: If TRUE, then this is being called because a native parent
* @recursing_native: If %TRUE, then this is being called because a native parent
* was destroyed. This generally means that the call to the
* windowing system to destroy the window can be omitted, since
* it will be destroyed as a result of the parent being destroyed.
* Unless @foreign_destroy.
* @foreign_destroy: If TRUE, the window or a parent was destroyed by some
* @foreign_destroy: If %TRUE, the window or a parent was destroyed by some
* external agency. The window has already been destroyed and no
* windowing system calls should be made. (This may never happen
* for some windowing systems.)
@@ -2024,7 +2024,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
/**
* _gdk_window_destroy:
* @window: a #GdkWindow
* @foreign_destroy: If TRUE, the window or a parent was destroyed by some
* @foreign_destroy: If %TRUE, the window or a parent was destroyed by some
* external agency. The window has already been destroyed and no
* windowing system calls should be made. (This may never happen
* for some windowing systems.)
@@ -3779,7 +3779,7 @@ gdk_window_invalidate_rect (GdkWindow *window,
}
/**
* gdk_window_set_invalidate_handler:
* gdk_window_set_invalidate_handler: (skip)
* @window: a #GdkWindow
* @handler: a #GdkWindowInvalidateHandlerFunc callback function
*
@@ -3961,7 +3961,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
*
* The @child_func parameter controls whether the region of
* each child window that intersects @region will also be invalidated.
* Only children for which @child_func returns TRUE will have the area
* Only children for which @child_func returns #TRUE will have the area
* invalidated.
**/
void
@@ -4412,9 +4412,9 @@ gdk_window_constrain_size (GdkGeometry *geometry,
* The position is given in coordinates relative to the upper left
* corner of @window.
*
* Returns: (transfer none): the window containing the pointer (as with
* gdk_window_at_pointer()), or %NULL if the window containing the
* pointer isnt known to GDK
* Returns: (nullable) (transfer none): the window containing the
* pointer (as with gdk_window_at_pointer()), or %NULL if the window
* containing the pointer isnt known to GDK
*
* Deprecated: 3.0: Use gdk_window_get_device_position() instead.
**/
@@ -4445,8 +4445,9 @@ gdk_window_get_pointer (GdkWindow *window,
* The position is given in coordinates relative to the upper left
* corner of @window.
*
* Returns: (transfer none): The window underneath @device (as with
* gdk_device_get_window_at_position()), or %NULL if the window is not known to GDK.
* Returns: (nullable) (transfer none): The window underneath @device
* (as with gdk_device_get_window_at_position()), or %NULL if the
* window is not known to GDK.
*
* Since: 3.10
**/
@@ -4501,8 +4502,9 @@ gdk_window_get_device_position_double (GdkWindow *window,
*
* Use gdk_window_get_device_position_double() if you need subpixel precision.
*
* Returns: (transfer none): The window underneath @device (as with
* gdk_device_get_window_at_position()), or %NULL if the window is not known to GDK.
* Returns: (nullable) (transfer none): The window underneath @device
* (as with gdk_device_get_window_at_position()), or %NULL if the
* window is not known to GDK.
*
* Since: 3.0
**/
@@ -5814,8 +5816,8 @@ gdk_window_set_background_pattern (GdkWindow *window,
* does not have its own background and reuses the parent's, %NULL is
* returned and youll have to query it yourself.
*
* Returns: (transfer none): The pattern to use for the background or
* %NULL to use the parents background.
* Returns: (nullable) (transfer none): The pattern to use for the
* background or %NULL to use the parents background.
*
* Since: 2.22
**/
@@ -5860,10 +5862,10 @@ gdk_window_set_cursor_internal (GdkWindow *window,
* there is no custom cursor set on the specified window, and it is
* using the cursor for its parent window.
*
* Returns: (transfer none): a #GdkCursor, or %NULL. The returned
* object is owned by the #GdkWindow and should not be unreferenced
* directly. Use gdk_window_set_cursor() to unset the cursor of the
* window
* Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
* returned object is owned by the #GdkWindow and should not be
* unreferenced directly. Use gdk_window_set_cursor() to unset the
* cursor of the window
*
* Since: 2.18
*/
@@ -5940,10 +5942,10 @@ gdk_window_set_cursor (GdkWindow *window,
* there is no custom cursor set on the specified window, and it is
* using the cursor for its parent window.
*
* Returns: (transfer none): a #GdkCursor, or %NULL. The returned
* object is owned by the #GdkWindow and should not be unreferenced
* directly. Use gdk_window_set_cursor() to unset the cursor of the
* window
* Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The
* returned object is owned by the #GdkWindow and should not be
* unreferenced directly. Use gdk_window_set_cursor() to unset the
* cursor of the window
*
* Since: 3.0
**/
@@ -6889,6 +6891,7 @@ update_cursor (GdkDisplay *display,
/* Find the first window with the cursor actually set, as
the cursor is inherited from the parent */
while (cursor_window->cursor == NULL &&
!g_hash_table_contains (cursor_window->device_cursor, device) &&
(parent = get_event_parent (cursor_window)) != NULL &&
parent->window_type != GDK_WINDOW_ROOT)
cursor_window = parent;
@@ -9298,7 +9301,8 @@ gdk_window_create_similar_surface (GdkWindow * window,
/**
* gdk_window_create_similar_image_surface:
* @window: window to make new surface similar to, or %NULL if none
* @window: (nullable): window to make new surface similar to, or
* %NULL if none
* @format: (type int): the format for the new surface
* @width: width of the new surface
* @height: height of the new surface
@@ -10918,3 +10922,35 @@ gdk_window_set_shadow_width (GdkWindow *window,
if (impl_class->set_shadow_width)
impl_class->set_shadow_width (window, left, right, top, bottom);
}
/**
* gdk_window_show_window_menu:
* @window: a #GdkWindow
* @event: a #GdkEvent to show the menu for
*
* Asks the windowing system to show the window menu. The window menu
* is the menu shown when right-clicking the titlebar on traditional
* windows managed by the window manager. This is useful for windows
* using client-side decorations, activating it with a right-click
* on the window decorations.
*
* Returns: %TRUE if the window menu was shown and %FALSE otherwise.
*
* Since: 3.14
*/
gboolean
gdk_window_show_window_menu (GdkWindow *window,
GdkEvent *event)
{
GdkWindowImplClass *impl_class;
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), FALSE);
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
if (impl_class->show_window_menu)
return impl_class->show_window_menu (window, event);
else
return FALSE;
}
+3
View File
@@ -1100,6 +1100,9 @@ void gdk_window_set_shadow_width (GdkWindow *window,
gint right,
gint top,
gint bottom);
GDK_AVAILABLE_IN_3_14
gboolean gdk_window_show_window_menu (GdkWindow *window,
GdkEvent *event);
G_END_DECLS
+2
View File
@@ -301,6 +301,8 @@ struct _GdkWindowImplClass
gint right,
gint top,
gint bottom);
gboolean (* show_window_menu) (GdkWindow *window,
GdkEvent *event);
};
/* Interface Functions */
+12 -38
View File
@@ -50,13 +50,12 @@ struct _GdkWaylandCursor
{
GdkCursor cursor;
gchar *name;
guint serial;
struct
{
int hotspot_x, hotspot_y;
int width, height, scale;
struct wl_buffer *buffer;
cairo_surface_t *cairo_surface;
} surface;
struct wl_cursor *wl_cursor;
@@ -69,8 +68,6 @@ struct _GdkWaylandCursorClass
G_DEFINE_TYPE (GdkWaylandCursor, _gdk_wayland_cursor, GDK_TYPE_CURSOR)
static guint theme_serial = 0;
struct cursor_cache_key
{
GdkCursorType type;
@@ -168,8 +165,8 @@ gdk_wayland_cursor_finalize (GObject *object)
GdkWaylandCursor *cursor = GDK_WAYLAND_CURSOR (object);
g_free (cursor->name);
if (cursor->surface.buffer)
wl_buffer_destroy (cursor->surface.buffer);
if (cursor->surface.cairo_surface)
cairo_surface_destroy (cursor->surface.cairo_surface);
G_OBJECT_CLASS (_gdk_wayland_cursor_parent_class)->finalize (object);
}
@@ -225,7 +222,10 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
*h = wayland_cursor->surface.height / wayland_cursor->surface.scale;
*scale = wayland_cursor->surface.scale;
return wayland_cursor->surface.buffer;
if (wayland_cursor->surface.cairo_surface)
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
else
return NULL;
}
}
@@ -316,7 +316,6 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
"display", display,
NULL);
private->name = g_strdup (name);
private->serial = theme_serial;
private->surface.scale = 1;
/* Blank cursor case */
@@ -339,11 +338,6 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
{
GdkWaylandCursor *cursor;
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
int stride;
size_t size;
gpointer data;
struct wl_shm_pool *pool;
cairo_surface_t *buffer_surface;
cairo_t *cr;
cursor = g_object_new (GDK_TYPE_WAYLAND_CURSOR,
@@ -351,7 +345,6 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
"display", wayland_display,
NULL);
cursor->name = NULL;
cursor->serial = theme_serial;
cursor->surface.hotspot_x = x;
cursor->surface.hotspot_y = y;
@@ -375,36 +368,17 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
cursor->surface.height = 1;
}
pool = _create_shm_pool (wayland_display->shm,
cursor->surface.width,
cursor->surface.height,
&size,
&data);
cursor->surface.cairo_surface = _gdk_wayland_display_create_shm_surface (wayland_display,
cursor->surface.width,
cursor->surface.height,
cursor->surface.scale);
if (surface)
{
buffer_surface = cairo_image_surface_create_for_data (data,
CAIRO_FORMAT_ARGB32,
cursor->surface.width,
cursor->surface.height,
cursor->surface.width * 4);
cr = cairo_create (buffer_surface);
cr = cairo_create (cursor->surface.cairo_surface);
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_destroy (buffer_surface);
}
else
memset (data, 0, 4);
stride = cursor->surface.width * 4;
cursor->surface.buffer = wl_shm_pool_create_buffer (pool, 0,
cursor->surface.width,
cursor->surface.height,
stride,
WL_SHM_FORMAT_ARGB8888);
wl_shm_pool_destroy (pool);
return GDK_CURSOR (cursor);
}
+304 -20
View File
@@ -40,21 +40,38 @@ typedef struct _DataOffer DataOffer;
typedef struct _GdkWaylandSelectionOffer GdkWaylandSelectionOffer;
typedef struct _GdkWaylandTouchData GdkWaylandTouchData;
struct _GdkWaylandTouchData
{
uint32_t id;
gdouble x;
gdouble y;
GdkWindow *window;
guint initial_touch : 1;
};
struct _GdkWaylandDeviceData
{
guint32 id;
struct wl_seat *wl_seat;
struct wl_pointer *wl_pointer;
struct wl_keyboard *wl_keyboard;
struct wl_touch *wl_touch;
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *master_pointer;
GdkDevice *master_keyboard;
GdkDevice *pointer;
GdkDevice *keyboard;
GdkDevice *touch;
GdkCursor *cursor;
GdkKeymap *keymap;
GHashTable *touches;
GdkModifierType modifiers;
GdkWindow *pointer_focus;
GdkWindow *keyboard_focus;
@@ -667,7 +684,8 @@ pointer_handle_enter (void *data,
event = gdk_event_new (GDK_ENTER_NOTIFY);
event->crossing.window = g_object_ref (device->pointer_focus);
gdk_event_set_device (event, device->pointer);
gdk_event_set_device (event, device->master_pointer);
gdk_event_set_source_device (event, device->pointer);
event->crossing.subwindow = NULL;
event->crossing.time = (guint32)(g_get_monotonic_time () / 1000);
event->crossing.mode = GDK_CROSSING_NORMAL;
@@ -710,7 +728,8 @@ pointer_handle_leave (void *data,
event = gdk_event_new (GDK_LEAVE_NOTIFY);
event->crossing.window = g_object_ref (device->pointer_focus);
gdk_event_set_device (event, device->pointer);
gdk_event_set_device (event, device->master_pointer);
gdk_event_set_source_device (event, device->pointer);
event->crossing.subwindow = NULL;
event->crossing.time = (guint32)(g_get_monotonic_time () / 1000);
event->crossing.mode = GDK_CROSSING_NORMAL;
@@ -763,7 +782,8 @@ pointer_handle_motion (void *data,
event->motion.type = GDK_MOTION_NOTIFY;
event->motion.window = g_object_ref (device->pointer_focus);
gdk_event_set_device (event, device->pointer);
gdk_event_set_device (event, device->master_pointer);
gdk_event_set_source_device (event, device->pointer);
event->motion.time = time;
event->motion.axes = NULL;
event->motion.state = device->modifiers;
@@ -822,7 +842,8 @@ pointer_handle_button (void *data,
event = gdk_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
event->button.window = g_object_ref (device->pointer_focus);
gdk_event_set_device (event, device->pointer);
gdk_event_set_device (event, device->master_pointer);
gdk_event_set_source_device (event, device->pointer);
event->button.time = time;
event->button.axes = NULL;
event->button.state = device->modifiers;
@@ -881,7 +902,8 @@ pointer_handle_axis (void *data,
device->time = time;
event = gdk_event_new (GDK_SCROLL);
event->scroll.window = g_object_ref (device->pointer_focus);
gdk_event_set_device (event, device->pointer);
gdk_event_set_device (event, device->master_pointer);
gdk_event_set_source_device (event, device->pointer);
event->scroll.time = time;
event->scroll.direction = GDK_SCROLL_SMOOTH;
event->scroll.delta_x = delta_x;
@@ -944,7 +966,8 @@ keyboard_handle_enter (void *data,
event->focus_change.window = g_object_ref (device->keyboard_focus);
event->focus_change.send_event = FALSE;
event->focus_change.in = TRUE;
gdk_event_set_device (event, device->keyboard);
gdk_event_set_device (event, device->master_keyboard);
gdk_event_set_source_device (event, device->keyboard);
GDK_NOTE (EVENTS,
g_message ("focus int, device %p surface %p",
@@ -977,7 +1000,8 @@ keyboard_handle_leave (void *data,
event->focus_change.window = g_object_ref (device->keyboard_focus);
event->focus_change.send_event = FALSE;
event->focus_change.in = FALSE;
gdk_event_set_device (event, device->keyboard);
gdk_event_set_device (event, device->master_keyboard);
gdk_event_set_source_device (event, device->keyboard);
g_object_unref(device->keyboard_focus);
device->keyboard_focus = NULL;
@@ -1103,7 +1127,8 @@ deliver_key_event (GdkWaylandDeviceData *device,
event = gdk_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
event->key.window = device->keyboard_focus ? g_object_ref (device->keyboard_focus) : NULL;
gdk_event_set_device (event, device->keyboard);
gdk_event_set_device (event, device->master_keyboard);
gdk_event_set_source_device (event, device->keyboard);
event->button.time = time_;
event->key.state = device->modifiers;
event->key.group = 0;
@@ -1216,6 +1241,174 @@ keyboard_handle_modifiers (void *data,
g_signal_emit_by_name (keymap, "direction-changed");
}
static GdkWaylandTouchData *
_device_manager_add_touch (GdkWaylandDeviceData *device,
uint32_t id,
struct wl_surface *surface)
{
GdkWaylandTouchData *touch;
touch = g_new0 (GdkWaylandTouchData, 1);
touch->id = id;
touch->window = wl_surface_get_user_data (surface);
touch->initial_touch = (g_hash_table_size (device->touches) == 0);
g_hash_table_insert (device->touches, GUINT_TO_POINTER (id), touch);
return touch;
}
static GdkWaylandTouchData *
_device_manager_get_touch (GdkWaylandDeviceData *device,
uint32_t id)
{
return g_hash_table_lookup (device->touches, GUINT_TO_POINTER (id));
}
static void
_device_manager_remove_touch (GdkWaylandDeviceData *device,
uint32_t id)
{
g_hash_table_remove (device->touches, GUINT_TO_POINTER (id));
}
static GdkEvent *
_create_touch_event (GdkWaylandDeviceData *device,
GdkWaylandTouchData *touch,
GdkEventType evtype,
uint32_t time)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
gint x_root, y_root;
GdkEvent *event;
event = gdk_event_new (evtype);
event->touch.window = g_object_ref (touch->window);
gdk_event_set_device (event, device->master_pointer);
gdk_event_set_source_device (event, device->touch);
event->touch.time = time;
event->touch.state = device->modifiers;
gdk_event_set_screen (event, display->screen);
event->touch.sequence = GUINT_TO_POINTER (touch->id);
if (touch->initial_touch)
{
_gdk_event_set_pointer_emulated (event, TRUE);
event->touch.emulating_pointer = TRUE;
}
gdk_window_get_root_coords (touch->window,
touch->x, touch->y,
&x_root, &y_root);
event->touch.x = touch->x;
event->touch.y = touch->y;
event->touch.x_root = x_root;
event->touch.y_root = y_root;
return event;
}
static void
touch_handle_down (void *data,
struct wl_touch *wl_touch,
uint32_t serial,
uint32_t time,
struct wl_surface *wl_surface,
int32_t id,
wl_fixed_t x,
wl_fixed_t y)
{
GdkWaylandDeviceData *device = data;
GdkWaylandTouchData *touch;
GdkEvent *event;
touch = _device_manager_add_touch (device, id, wl_surface);
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
event = _create_touch_event (device, touch, GDK_TOUCH_BEGIN, time);
GDK_NOTE (EVENTS,
g_message ("touch begin %f %f", event->touch.x, event->touch.y));
_gdk_wayland_display_deliver_event (device->display, event);
}
static void
touch_handle_up (void *data,
struct wl_touch *wl_touch,
uint32_t serial,
uint32_t time,
int32_t id)
{
GdkWaylandDeviceData *device = data;
GdkWaylandTouchData *touch;
GdkEvent *event;
touch = _device_manager_get_touch (device, id);
event = _create_touch_event (device, touch, GDK_TOUCH_END, time);
GDK_NOTE (EVENTS,
g_message ("touch end %f %f", event->touch.x, event->touch.y));
_gdk_wayland_display_deliver_event (device->display, event);
_device_manager_remove_touch (device, id);
}
static void
touch_handle_motion (void *data,
struct wl_touch *wl_touch,
uint32_t time,
int32_t id,
wl_fixed_t x,
wl_fixed_t y)
{
GdkWaylandDeviceData *device = data;
GdkWaylandTouchData *touch;
GdkEvent *event;
touch = _device_manager_get_touch (device, id);
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
event = _create_touch_event (device, touch, GDK_TOUCH_UPDATE, time);
GDK_NOTE (EVENTS,
g_message ("touch update %f %f", event->touch.x, event->touch.y));
_gdk_wayland_display_deliver_event (device->display, event);
}
static void
touch_handle_frame (void *data,
struct wl_touch *wl_touch)
{
}
static void
touch_handle_cancel (void *data,
struct wl_touch *wl_touch)
{
GdkWaylandDeviceData *device = data;
GdkWaylandTouchData *touch;
GHashTableIter iter;
GdkEvent *event;
g_hash_table_iter_init (&iter, device->touches);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
{
event = _create_touch_event (device, touch, GDK_TOUCH_CANCEL,
GDK_CURRENT_TIME);
_gdk_wayland_display_deliver_event (device->display, event);
g_hash_table_iter_remove (&iter);
}
GDK_NOTE (EVENTS, g_message ("touch cancel"));
}
static const struct wl_pointer_listener pointer_listener = {
pointer_handle_enter,
pointer_handle_leave,
@@ -1232,6 +1425,14 @@ static const struct wl_keyboard_listener keyboard_listener = {
keyboard_handle_modifiers,
};
static const struct wl_touch_listener touch_listener = {
touch_handle_down,
touch_handle_up,
touch_handle_motion,
touch_handle_frame,
touch_handle_cancel
};
static void
seat_handle_capabilities (void *data,
struct wl_seat *seat,
@@ -1248,14 +1449,15 @@ seat_handle_capabilities (void *data,
wl_pointer_add_listener (device->wl_pointer, &pointer_listener, device);
device->pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"name", "Wayland Pointer",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", device->display,
"device-manager", device->device_manager,
NULL);
_gdk_device_set_associated_device (device->pointer, device->master_pointer);
GDK_WAYLAND_DEVICE (device->pointer)->device = device;
device_manager->devices =
@@ -1267,6 +1469,7 @@ seat_handle_capabilities (void *data,
{
wl_pointer_destroy (device->wl_pointer);
device->wl_pointer = NULL;
_gdk_device_set_associated_device (device->pointer, NULL);
device_manager->devices =
g_list_remove (device_manager->devices, device->pointer);
@@ -1283,14 +1486,15 @@ seat_handle_capabilities (void *data,
wl_keyboard_add_listener (device->wl_keyboard, &keyboard_listener, device);
device->keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"name", "Wayland Keyboard",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", device->display,
"device-manager", device->device_manager,
NULL);
_gdk_device_set_associated_device (device->keyboard, device->master_keyboard);
GDK_WAYLAND_DEVICE (device->keyboard)->device = device;
device_manager->devices =
@@ -1302,6 +1506,7 @@ seat_handle_capabilities (void *data,
{
wl_keyboard_destroy (device->wl_keyboard);
device->wl_keyboard = NULL;
_gdk_device_set_associated_device (device->keyboard, NULL);
device_manager->devices =
g_list_remove (device_manager->devices, device->keyboard);
@@ -1311,10 +1516,41 @@ seat_handle_capabilities (void *data,
device->keyboard = NULL;
}
if (device->keyboard && device->pointer)
if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !device->wl_touch)
{
_gdk_device_set_associated_device (device->pointer, device->keyboard);
_gdk_device_set_associated_device (device->keyboard, device->pointer);
device->wl_touch = wl_seat_get_touch (seat);
wl_touch_set_user_data (device->wl_touch, device);
wl_touch_add_listener (device->wl_touch, &touch_listener, device);
device->touch = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Touch",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TOUCHSCREEN,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", device->display,
"device-manager", device->device_manager,
NULL);
_gdk_device_set_associated_device (device->touch, device->master_pointer);
GDK_WAYLAND_DEVICE (device->touch)->device = device;
device_manager->devices =
g_list_prepend (device_manager->devices, device->touch);
g_signal_emit_by_name (device_manager, "device-added", device->touch);
}
else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && device->wl_touch)
{
wl_touch_destroy (device->wl_touch);
device->wl_touch = NULL;
_gdk_device_set_associated_device (device->touch, NULL);
device_manager->devices =
g_list_remove (device_manager->devices, device->touch);
g_signal_emit_by_name (device_manager, "device-removed", device->touch);
g_object_unref (device->touch);
device->touch = NULL;
}
}
@@ -1337,6 +1573,49 @@ init_settings (GdkWaylandDeviceData *device)
}
}
static void
init_devices (GdkWaylandDeviceData *device)
{
GdkWaylandDeviceManager *device_manager =
GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
/* pointer */
device->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", device->display,
"device-manager", device_manager,
NULL);
GDK_WAYLAND_DEVICE (device->master_pointer)->device = device;
device_manager->devices =
g_list_prepend (device_manager->devices, device->master_pointer);
g_signal_emit_by_name (device_manager, "device-added", device->master_pointer);
/* keyboard */
device->master_keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", device->display,
"device-manager", device_manager,
NULL);
GDK_WAYLAND_DEVICE (device->master_keyboard)->device = device;
device_manager->devices =
g_list_prepend (device_manager->devices, device->master_keyboard);
g_signal_emit_by_name (device_manager, "device-added", device->master_keyboard);
/* link both */
_gdk_device_set_associated_device (device->master_pointer, device->master_keyboard);
_gdk_device_set_associated_device (device->master_keyboard, device->master_pointer);
}
void
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
guint32 id,
@@ -1354,7 +1633,8 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
device->keymap = _gdk_wayland_keymap_new ();
device->display = display;
device->device_manager = device_manager;
device->touches = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_free);
device->wl_seat = wl_seat;
wl_seat_add_listener (device->wl_seat, &seat_listener, device);
@@ -1369,6 +1649,7 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
device->pointer_surface =
wl_compositor_create_surface (display_wayland->compositor);
init_devices (device);
init_settings (device);
}
@@ -1391,6 +1672,7 @@ _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager,
wl_surface_destroy (device->pointer_surface);
/* FIXME: destroy data_device */
g_clear_object (&device->keyboard_settings);
g_hash_table_destroy (device->touches);
g_free (device);
break;
@@ -1421,12 +1703,14 @@ gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
GdkDeviceType type)
{
GdkWaylandDeviceManager *wayland_device_manager;
GList *devices = NULL;
GList *devices = NULL, *l;
if (type == GDK_DEVICE_TYPE_MASTER)
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
for (l = wayland_device_manager->devices; l; l = l->next)
{
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
devices = g_list_copy (wayland_device_manager->devices);
if (gdk_device_get_device_type (l->data) == type)
devices = g_list_prepend (devices, l->data);
}
return devices;
+175 -48
View File
@@ -22,6 +22,7 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <glib.h>
#include "gdkwayland.h"
@@ -121,29 +122,6 @@ gdk_input_init (GdkDisplay *display)
g_list_free (list);
}
static void
init_sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
{
GdkWaylandDisplay *display = data;
display->init_ref_count--;
wl_callback_destroy(callback);
}
static const struct wl_callback_listener init_sync_listener = {
init_sync_callback
};
static void
wait_for_roundtrip(GdkWaylandDisplay *display)
{
struct wl_callback *callback;
display->init_ref_count++;
callback = wl_display_sync(display->wl_display);
wl_callback_add_listener(callback, &init_sync_listener, display);
}
static void
xdg_shell_ping (void *data,
struct xdg_shell *xdg_shell,
@@ -188,23 +166,13 @@ gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id
display_wayland->gtk_shell =
wl_registry_bind(display_wayland->wl_registry, id, &gtk_shell_interface, 1);
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
/* We need another roundtrip to receive the shell capabilities */
wait_for_roundtrip(display_wayland);
} else if (strcmp(interface, "wl_output") == 0) {
output =
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
_gdk_wayland_screen_add_output(display_wayland->screen, id, output, MIN (version, 2));
/* We need another roundtrip to receive the modes and geometry
* events for the output, which gives us the physical properties
* and available modes on the output. */
wait_for_roundtrip(display_wayland);
} else if (strcmp(interface, "wl_seat") == 0) {
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 1);
_gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
/* We need another roundtrip to receive the wl_seat capabilities
* event which informs us of available input devices on this
* seat. */
wait_for_roundtrip(display_wayland);
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
display_wayland->data_device_manager =
wl_registry_bind(display_wayland->wl_registry, id,
@@ -251,26 +219,18 @@ _gdk_wayland_display_open (const gchar *display_name)
return NULL;
display = g_object_new (GDK_TYPE_WAYLAND_DISPLAY, NULL);
display_wayland = GDK_WAYLAND_DISPLAY (display);
display_wayland->wl_display = wl_display;
display_wayland->screen = _gdk_wayland_screen_new (display);
display->device_manager = _gdk_wayland_device_manager_new (display);
/* Set up listener so we'll catch all events. */
display_wayland = GDK_WAYLAND_DISPLAY (display);
display_wayland->wl_display = wl_display;
display_wayland->screen = _gdk_wayland_screen_new (display);
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
wl_registry_add_listener(display_wayland->wl_registry, &registry_listener, display_wayland);
/* We use init_ref_count to track whether some part of our
* initialization still needs a roundtrip to complete. */
wait_for_roundtrip(display_wayland);
while (display_wayland->init_ref_count > 0)
wl_display_roundtrip(display_wayland->wl_display);
display_wayland->event_source =
_gdk_wayland_display_event_source_new (display);
/* Wait until the dust has settled during init... */
wl_display_roundtrip (display_wayland->wl_display);
gdk_input_init (display);
@@ -762,3 +722,170 @@ gdk_wayland_display_get_xdg_shell (GdkDisplay *display)
return wayland_display->xdg_shell;
}
static const cairo_user_data_key_t gdk_wayland_cairo_key;
typedef struct _GdkWaylandCairoSurfaceData {
gpointer buf;
size_t buf_length;
struct wl_shm_pool *pool;
struct wl_buffer *buffer;
GdkWaylandDisplay *display;
uint32_t scale;
gboolean busy;
} GdkWaylandCairoSurfaceData;
static void
buffer_release_callback (void *_data,
struct wl_buffer *wl_buffer)
{
cairo_surface_t *surface = _data;
GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
data->busy = FALSE;
cairo_surface_destroy (surface);
}
static const struct wl_buffer_listener buffer_listener = {
buffer_release_callback
};
struct wl_shm_pool *
create_shm_pool (struct wl_shm *shm,
int width,
int height,
size_t *buf_length,
void **data_out)
{
char filename[] = "/tmp/wayland-shm-XXXXXX";
struct wl_shm_pool *pool;
int fd, size, stride;
void *data;
fd = mkstemp (filename);
if (fd < 0)
{
g_critical (G_STRLOC ": Unable to create temporary file (%s): %s",
filename, g_strerror (errno));
return NULL;
}
stride = width * 4;
size = stride * height;
if (ftruncate (fd, size) < 0)
{
g_critical (G_STRLOC ": Truncating temporary file failed: %s",
g_strerror (errno));
close (fd);
return NULL;
}
data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
unlink (filename);
if (data == MAP_FAILED)
{
g_critical (G_STRLOC ": mmap'ping temporary file failed: %s",
g_strerror (errno));
close (fd);
return NULL;
}
pool = wl_shm_create_pool(shm, fd, size);
close (fd);
*data_out = data;
*buf_length = size;
return pool;
}
static void
gdk_wayland_cairo_surface_destroy (void *p)
{
GdkWaylandCairoSurfaceData *data = p;
if (data->buffer)
wl_buffer_destroy (data->buffer);
if (data->pool)
wl_shm_pool_destroy (data->pool);
munmap (data->buf, data->buf_length);
g_free (data);
}
cairo_surface_t *
_gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
int width,
int height,
guint scale)
{
GdkWaylandCairoSurfaceData *data;
cairo_surface_t *surface = NULL;
cairo_status_t status;
int stride;
data = g_new (GdkWaylandCairoSurfaceData, 1);
data->display = display;
data->buffer = NULL;
data->scale = scale;
data->busy = FALSE;
stride = width * 4;
data->pool = create_shm_pool (display->shm,
width*scale, height*scale,
&data->buf_length,
&data->buf);
surface = cairo_image_surface_create_for_data (data->buf,
CAIRO_FORMAT_ARGB32,
width*scale,
height*scale,
stride*scale);
data->buffer = wl_shm_pool_create_buffer (data->pool, 0,
width*scale, height*scale,
stride*scale, WL_SHM_FORMAT_ARGB8888);
wl_buffer_add_listener (data->buffer, &buffer_listener, surface);
cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key,
data, gdk_wayland_cairo_surface_destroy);
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
cairo_surface_set_device_scale (surface, scale, scale);
#endif
status = cairo_surface_status (surface);
if (status != CAIRO_STATUS_SUCCESS)
{
g_critical (G_STRLOC ": Unable to create Cairo image surface: %s",
cairo_status_to_string (status));
}
return surface;
}
struct wl_buffer *
_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface)
{
GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
return data->buffer;
}
void
_gdk_wayland_shm_surface_set_busy (cairo_surface_t *surface)
{
GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
data->busy = TRUE;
cairo_surface_reference (surface);
}
gboolean
_gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface)
{
GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
return data->busy;
}
+1 -3
View File
@@ -50,8 +50,7 @@ struct _GdkWaylandDisplay
/* Startup notification */
gchar *startup_notification_id;
/* Time of most recent user interaction and most recent serial */
gulong user_time;
/* Most recent serial */
guint32 serial;
/* Wayland fields below */
@@ -69,7 +68,6 @@ struct _GdkWaylandDisplay
GSource *event_source;
int init_ref_count;
int compositor_version;
struct xkb_context *xkb_context;
+7 -5
View File
@@ -178,10 +178,12 @@ void _gdk_wayland_window_set_device_grabbed (GdkWindow *window,
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *wayland_display);
void _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display, guint32 serial);
struct wl_shm_pool * _create_shm_pool (struct wl_shm *shm,
int width,
int height,
size_t *buf_length,
void **data_out);
cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
int width,
int height,
guint scale);
struct wl_buffer *_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface);
void _gdk_wayland_shm_surface_set_busy (cairo_surface_t *surface);
gboolean _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface);
#endif /* __GDK_PRIVATE_WAYLAND_H__ */
+1
View File
@@ -986,6 +986,7 @@ output_handle_scale(void *data,
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
monitor->scale = factor;
g_signal_emit_by_name (monitor->screen, "monitors-changed");
}
static void
+142 -373
View File
@@ -34,7 +34,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <errno.h>
#define WL_SURFACE_HAS_BUFFER_SCALE 3
@@ -95,8 +94,6 @@ struct _GdkWindowImplWayland
GdkWindow *wrapper;
GdkCursor *cursor;
/* The wl_outputs that this window currently touches */
GSList *outputs;
@@ -112,24 +109,10 @@ struct _GdkWindowImplWayland
GdkWindowTypeHint hint;
GdkWindow *transient_for;
/* The surface which is being "drawn to" to */
cairo_surface_t *cairo_surface;
/* The surface that was the last surface the Wayland buffer from which was attached
* to the Wayland surface. It will be the same as cairo_surface after a call
* to gdk_wayland_window_attach_image. But after a call to
* gdk_wayland_window_update_size and then
* gdk_wayland_window_ref_cairo_surface the above pointer will be different.
*/
cairo_surface_t *server_surface;
gchar *title;
uint32_t resize_edges;
/* Time of most recent user interaction. */
gulong user_time;
GdkGeometry geometry_hints;
GdkWindowHints geometry_mask;
@@ -386,25 +369,11 @@ on_frame_clock_before_paint (GdkFrameClock *clock,
}
}
static const cairo_user_data_key_t gdk_wayland_cairo_key;
typedef struct _GdkWaylandCairoSurfaceData {
gpointer buf;
size_t buf_length;
struct wl_shm_pool *pool;
struct wl_buffer *buffer;
GdkWaylandDisplay *display;
int32_t width, height;
uint32_t scale;
gboolean busy;
} GdkWaylandCairoSurfaceData;
static void
on_frame_clock_after_paint (GdkFrameClock *clock,
GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandCairoSurfaceData *data;
struct wl_callback *callback;
if (!impl->pending_commit)
@@ -418,14 +387,7 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
_gdk_frame_clock_freeze (clock);
wl_surface_commit (impl->surface);
data = cairo_surface_get_user_data (impl->cairo_surface,
&gdk_wayland_cairo_key);
if (!data->busy)
{
data->busy = TRUE;
cairo_surface_reference (impl->cairo_surface);
}
_gdk_wayland_shm_surface_set_busy (impl->cairo_surface);
}
static void
@@ -549,210 +511,35 @@ gdk_wayland_window_attach_image (GdkWindow *window)
{
GdkWaylandDisplay *display;
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandCairoSurfaceData *data;
int32_t server_width, server_height, dx, dy;
if (GDK_WINDOW_DESTROYED (window))
return;
/* The wayland surface is attached to a buffer that is from the old "drawn
* to" surface. Unref the surface and restore the state.
*/
if (impl->server_surface)
{
data = cairo_surface_get_user_data (impl->server_surface,
&gdk_wayland_cairo_key);
/* Save the old dimensions used for the surface */
server_width = data->width;
server_height = data->height;
cairo_surface_destroy (impl->server_surface);
}
else
{
server_width = 0;
server_height = 0;
}
/* Save the current "drawn to" surface for future calls into here */
impl->server_surface = cairo_surface_reference (impl->cairo_surface);
/* Get a Wayland buffer from this new surface */
data = cairo_surface_get_user_data (impl->cairo_surface,
&gdk_wayland_cairo_key);
if (impl->resize_edges & XDG_SURFACE_RESIZE_EDGE_LEFT)
dx = server_width - data->width;
else
dx = 0;
if (impl->resize_edges & XDG_SURFACE_RESIZE_EDGE_TOP)
dy = server_height - data->height;
else
dy = 0;
/* Attach this new buffer to the surface */
wl_surface_attach (impl->surface, data->buffer, dx, dy);
wl_surface_attach (impl->surface,
_gdk_wayland_shm_surface_get_wl_buffer (impl->cairo_surface),
0, 0);
/* Only set the buffer scale if supported by the compositor */
display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
if (display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
wl_surface_set_buffer_scale (impl->surface, data->scale);
wl_surface_set_buffer_scale (impl->surface, impl->scale);
impl->pending_commit = TRUE;
}
static void
gdk_wayland_cairo_surface_destroy (void *p)
{
GdkWaylandCairoSurfaceData *data = p;
if (data->buffer)
wl_buffer_destroy (data->buffer);
if (data->pool)
wl_shm_pool_destroy (data->pool);
munmap (data->buf, data->buf_length);
g_free (data);
}
struct wl_shm_pool *
_create_shm_pool (struct wl_shm *shm,
int width,
int height,
size_t *buf_length,
void **data_out)
{
char filename[] = "/tmp/wayland-shm-XXXXXX";
struct wl_shm_pool *pool;
int fd, size, stride;
void *data;
fd = mkstemp (filename);
if (fd < 0)
{
g_critical (G_STRLOC ": Unable to create temporary file (%s): %s",
filename, g_strerror (errno));
return NULL;
}
stride = width * 4;
size = stride * height;
if (ftruncate (fd, size) < 0)
{
g_critical (G_STRLOC ": Truncating temporary file failed: %s",
g_strerror (errno));
close (fd);
return NULL;
}
data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
unlink (filename);
if (data == MAP_FAILED)
{
g_critical (G_STRLOC ": mmap'ping temporary file failed: %s",
g_strerror (errno));
close (fd);
return NULL;
}
pool = wl_shm_create_pool(shm, fd, size);
close (fd);
*data_out = data;
*buf_length = size;
return pool;
}
static void
buffer_release_callback (void *_data,
struct wl_buffer *wl_buffer)
{
cairo_surface_t *surface = _data;
GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
data->busy = FALSE;
cairo_surface_destroy (surface);
}
static const struct wl_buffer_listener buffer_listener = {
buffer_release_callback
};
static cairo_surface_t *
gdk_wayland_create_cairo_surface (GdkWaylandDisplay *display,
int width,
int height,
guint scale)
{
GdkWaylandCairoSurfaceData *data;
cairo_surface_t *surface = NULL;
cairo_status_t status;
int stride;
data = g_new (GdkWaylandCairoSurfaceData, 1);
data->display = display;
data->buffer = NULL;
data->width = width;
data->height = height;
data->scale = scale;
data->busy = FALSE;
stride = width * 4;
data->pool = _create_shm_pool (display->shm,
width*scale, height*scale,
&data->buf_length,
&data->buf);
surface = cairo_image_surface_create_for_data (data->buf,
CAIRO_FORMAT_ARGB32,
width*scale,
height*scale,
stride*scale);
data->buffer = wl_shm_pool_create_buffer (data->pool, 0,
width*scale, height*scale,
stride*scale, WL_SHM_FORMAT_ARGB8888);
wl_buffer_add_listener (data->buffer, &buffer_listener, surface);
cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key,
data, gdk_wayland_cairo_surface_destroy);
#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
cairo_surface_set_device_scale (surface, scale, scale);
#endif
status = cairo_surface_status (surface);
if (status != CAIRO_STATUS_SUCCESS)
{
g_critical (G_STRLOC ": Unable to create Cairo image surface: %s",
cairo_status_to_string (status));
}
return surface;
}
static void
gdk_wayland_window_ensure_cairo_surface (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (!impl->cairo_surface)
{
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper));
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper));
impl->cairo_surface =
gdk_wayland_create_cairo_surface (display_wayland,
impl->wrapper->width,
impl->wrapper->height,
impl->scale);
impl->cairo_surface = _gdk_wayland_display_create_shm_surface (display_wayland,
impl->wrapper->width,
impl->wrapper->height,
impl->scale);
}
}
@@ -788,13 +575,8 @@ gdk_window_impl_wayland_begin_paint_region (GdkWindow *window,
const cairo_region_t *region)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandCairoSurfaceData *data;
gdk_wayland_window_ensure_cairo_surface (window);
data = cairo_surface_get_user_data (impl->cairo_surface,
&gdk_wayland_cairo_key);
return data->busy;
return _gdk_wayland_shm_surface_get_busy (impl->cairo_surface);
}
static void
@@ -806,9 +588,6 @@ gdk_window_impl_wayland_finalize (GObject *object)
impl = GDK_WINDOW_IMPL_WAYLAND (object);
if (impl->cursor)
g_object_unref (impl->cursor);
g_free (impl->title);
g_clear_pointer (&impl->opaque_region, cairo_region_destroy);
@@ -845,16 +624,10 @@ gdk_wayland_window_configure (GdkWindow *window,
}
static void
gdk_wayland_window_set_user_time (GdkWindow *window,
guint32 user_time)
{
}
static void
gdk_wayland_window_sync_transient_for (GdkWindow *window)
gdk_wayland_window_sync_parent (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
struct wl_surface *transient_for_surface;
struct wl_surface *parent_surface;
if (!impl->xdg_surface)
return;
@@ -867,12 +640,12 @@ gdk_wayland_window_sync_transient_for (GdkWindow *window)
if (!impl_parent->surface)
return;
transient_for_surface = impl_parent->surface;
parent_surface = impl_parent->surface;
}
else
transient_for_surface = NULL;
parent_surface = NULL;
xdg_surface_set_transient_for (impl->xdg_surface, transient_for_surface);
xdg_surface_set_parent (impl->xdg_surface, parent_surface);
}
static void
@@ -1013,68 +786,56 @@ static void
xdg_surface_configure (void *data,
struct xdg_surface *xdg_surface,
int32_t width,
int32_t height)
int32_t height,
struct wl_array *states,
uint32_t serial)
{
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowState new_state = 0;
uint32_t *p;
gdk_window_constrain_size (&impl->geometry_hints,
impl->geometry_mask,
width,
height,
&width,
&height);
gdk_wayland_window_configure (window, width, height);
}
static void
xdg_surface_change_state (void *data,
struct xdg_surface *xdg_surface,
uint32_t state_type,
uint32_t value,
uint32_t serial)
{
GdkWindow *window = GDK_WINDOW (data);
switch (state_type)
if (width > 0 && height > 0)
{
case XDG_SURFACE_STATE_MAXIMIZED:
if (value)
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED);
else
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0);
break;
case XDG_SURFACE_STATE_FULLSCREEN:
if (value)
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
else
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
break;
gdk_window_constrain_size (&impl->geometry_hints,
impl->geometry_mask,
width,
height,
&width,
&height);
gdk_wayland_window_configure (window, width, height);
}
xdg_surface_ack_change_state (xdg_surface, state_type, value, serial);
wl_array_for_each(p, states)
{
uint32_t state = *p;
switch (state)
{
case XDG_SURFACE_STATE_FULLSCREEN:
new_state |= GDK_WINDOW_STATE_FULLSCREEN;
break;
case XDG_SURFACE_STATE_MAXIMIZED:
new_state |= GDK_WINDOW_STATE_MAXIMIZED;
break;
case XDG_SURFACE_STATE_ACTIVATED:
new_state |= GDK_WINDOW_STATE_FOCUSED;
break;
case XDG_SURFACE_STATE_RESIZING:
break;
default:
/* Unknown state */
break;
}
}
_gdk_set_window_state (window, new_state);
xdg_surface_ack_configure (xdg_surface, serial);
}
static void
xdg_surface_activated (void *data,
struct xdg_surface *xdg_surface)
{
GdkWindow *window = GDK_WINDOW (data);
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED);
}
static void
xdg_surface_deactivated (void *data,
struct xdg_surface *xdg_surface)
{
GdkWindow *window = GDK_WINDOW (data);
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
}
static void
xdg_surface_delete (void *data,
struct xdg_surface *xdg_surface)
xdg_surface_close (void *data,
struct xdg_surface *xdg_surface)
{
GdkWindow *window = GDK_WINDOW (data);
GdkDisplay *display;
@@ -1092,10 +853,7 @@ xdg_surface_delete (void *data,
static const struct xdg_surface_listener xdg_surface_listener = {
xdg_surface_configure,
xdg_surface_change_state,
xdg_surface_activated,
xdg_surface_deactivated,
xdg_surface_delete,
xdg_surface_close,
};
static void
@@ -1107,7 +865,7 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
impl->xdg_surface = xdg_shell_get_xdg_surface (display_wayland->xdg_shell, impl->surface);
xdg_surface_add_listener (impl->xdg_surface, &xdg_surface_listener, window);
gdk_wayland_window_sync_transient_for (window);
gdk_wayland_window_sync_parent (window);
gdk_wayland_window_sync_title (window);
gdk_wayland_window_sync_margin (window);
xdg_surface_set_app_id (impl->xdg_surface, gdk_get_program_class ());
@@ -1218,6 +976,47 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window,
xdg_popup_add_listener (impl->xdg_popup, &xdg_popup_listener, window);
}
static struct wl_seat *
find_grab_input_seat (GdkWindow *window, GdkWindow *transient_for)
{
GdkWindow *attached_grab_window;
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowImplWayland *tmp_impl;
/* Use the device that was used for the grab as the device for
* the popup window setup - so this relies on GTK+ taking the
* grab before showing the popup window.
*/
if (impl->grab_input_seat)
return impl->grab_input_seat;
/* HACK: GtkMenu grabs a special window known as the "grab transfer window"
* and then transfers the grab over to the correct window later. Look for
* this window when taking the grab to know it's correct.
*
* See: associate_menu_grab_transfer_window in gtkmenu.c
*/
attached_grab_window = g_object_get_data (G_OBJECT (window), "gdk-attached-grab-window");
if (attached_grab_window)
{
tmp_impl = GDK_WINDOW_IMPL_WAYLAND (attached_grab_window->impl);
if (tmp_impl->grab_input_seat)
return tmp_impl->grab_input_seat;
}
while (transient_for)
{
tmp_impl = GDK_WINDOW_IMPL_WAYLAND (transient_for->impl);
if (tmp_impl->grab_input_seat)
return tmp_impl->grab_input_seat;
transient_for = tmp_impl->transient_for;
}
return NULL;
}
static void
gdk_wayland_window_map (GdkWindow *window)
{
@@ -1246,26 +1045,7 @@ gdk_wayland_window_map (GdkWindow *window)
if (transient_for)
{
struct wl_seat *grab_input_seat = NULL;
GdkWindowImplWayland *tmp_impl;
/* Use the device that was used for the grab as the device for
* the popup window setup - so this relies on GTK+ taking the
* grab before showing the popup window.
*/
grab_input_seat = impl->grab_input_seat;
tmp_impl = GDK_WINDOW_IMPL_WAYLAND (transient_for->impl);
while (!grab_input_seat)
{
grab_input_seat = tmp_impl->grab_input_seat;
if (tmp_impl->transient_for)
tmp_impl = GDK_WINDOW_IMPL_WAYLAND (tmp_impl->transient_for->impl);
else
break;
}
struct wl_seat *grab_input_seat = find_grab_input_seat (window, transient_for);
if (grab_input_seat &&
(impl->hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU ||
impl->hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU ||
@@ -1287,27 +1067,14 @@ static void
gdk_wayland_window_show (GdkWindow *window,
gboolean already_mapped)
{
GdkDisplay *display;
GdkWaylandDisplay *display_wayland;
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkEvent *event;
display = gdk_window_get_display (window);
display_wayland = GDK_WAYLAND_DISPLAY (display);
if (impl->user_time != 0 &&
display_wayland->user_time != 0 &&
XSERVER_TIME_IS_LATER (display_wayland->user_time, impl->user_time))
gdk_wayland_window_set_user_time (window, impl->user_time);
if (!impl->surface)
gdk_wayland_window_create_surface (window);
gdk_window_set_type_hint (window, impl->hint);
gdk_wayland_window_map (window);
_gdk_make_event (window, GDK_MAP, NULL, FALSE);
event = _gdk_make_event (window, GDK_VISIBILITY_NOTIFY, NULL, FALSE);
event->visibility.state = GDK_VISIBILITY_UNOBSCURED;
if (impl->cairo_surface)
gdk_wayland_window_attach_image (window);
@@ -1345,9 +1112,6 @@ gdk_wayland_window_hide_surface (GdkWindow *window,
xdg_popup_destroy (impl->xdg_popup);
impl->xdg_popup = NULL;
}
cairo_surface_destroy (impl->server_surface);
impl->server_surface = NULL;
}
impl->mapped = FALSE;
@@ -1584,11 +1348,7 @@ gdk_wayland_window_destroy (GdkWindow *window,
gdk_wayland_window_hide_surface (window, TRUE);
if (impl->cairo_surface)
{
cairo_surface_finish (impl->cairo_surface);
cairo_surface_set_user_data (impl->cairo_surface, &gdk_wayland_cairo_key,
NULL, NULL);
}
cairo_surface_finish (impl->cairo_surface);
}
static void
@@ -1736,7 +1496,7 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->transient_for = parent;
gdk_wayland_window_sync_transient_for (window);
gdk_wayland_window_sync_parent (window);
}
static void
@@ -1764,17 +1524,6 @@ static void
gdk_wayland_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map)
{
focus_on_map = focus_on_map != FALSE;
if (window->focus_on_map != focus_on_map)
{
window->focus_on_map = focus_on_map;
if ((!GDK_WINDOW_DESTROYED (window)) &&
(!window->focus_on_map) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
gdk_wayland_window_set_user_time (window, 0);
}
}
static void
@@ -1835,10 +1584,7 @@ gdk_wayland_window_maximize (GdkWindow *window)
if (!impl->xdg_surface)
return;
xdg_surface_request_change_state (impl->xdg_surface,
XDG_SURFACE_STATE_MAXIMIZED,
TRUE,
0 /* serial, unused */);
xdg_surface_set_maximized (impl->xdg_surface);
}
static void
@@ -1852,10 +1598,7 @@ gdk_wayland_window_unmaximize (GdkWindow *window)
if (!impl->xdg_surface)
return;
xdg_surface_request_change_state (impl->xdg_surface,
XDG_SURFACE_STATE_MAXIMIZED,
FALSE,
0 /* serial, unused */);
xdg_surface_unset_maximized (impl->xdg_surface);
}
static void
@@ -1869,10 +1612,7 @@ gdk_wayland_window_fullscreen (GdkWindow *window)
if (!impl->xdg_surface)
return;
xdg_surface_request_change_state (impl->xdg_surface,
XDG_SURFACE_STATE_FULLSCREEN,
TRUE,
0 /* serial, unused */);
xdg_surface_set_fullscreen (impl->xdg_surface, NULL);
}
static void
@@ -1886,10 +1626,7 @@ gdk_wayland_window_unfullscreen (GdkWindow *window)
if (!impl->xdg_surface)
return;
xdg_surface_request_change_state (impl->xdg_surface,
XDG_SURFACE_STATE_FULLSCREEN,
FALSE,
0 /* serial, unused */);
xdg_surface_unset_fullscreen (impl->xdg_surface);
}
static void
@@ -2003,7 +1740,6 @@ gdk_wayland_window_begin_resize_drag (GdkWindow *window,
if (!impl->xdg_surface)
return;
impl->resize_edges = resize_edges;
xdg_surface_resize (impl->xdg_surface,
gdk_wayland_device_get_wl_seat (device),
_gdk_wayland_display_get_serial (wayland_display),
@@ -2080,8 +1816,6 @@ gdk_wayland_window_process_updates_recurse (GdkWindow *window,
cairo_rectangle_int_t rect;
int i, n;
gdk_wayland_window_map (window);
gdk_wayland_window_ensure_cairo_surface (window);
gdk_wayland_window_attach_image (window);
@@ -2200,6 +1934,40 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window,
gdk_wayland_window_sync_margin (window);
}
static gboolean
gdk_wayland_window_show_window_menu (GdkWindow *window,
GdkEvent *event)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkEventButton *event_button = (GdkEventButton *) event;
struct wl_seat *seat;
double x, y;
GdkWaylandDeviceData *device;
switch (event->type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
break;
default:
return FALSE;
}
if (!impl->xdg_surface)
return FALSE;
seat = gdk_wayland_device_get_wl_seat (event_button->device);
device = wl_seat_get_user_data (seat);
gdk_event_get_coords (event, &x, &y);
xdg_surface_show_window_menu (impl->xdg_surface,
seat,
_gdk_wayland_device_get_button_press_serial (device),
x, y);
return TRUE;
}
static void
_gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
{
@@ -2289,6 +2057,7 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->get_scale_factor = gdk_wayland_window_get_scale_factor;
impl_class->set_opaque_region = gdk_wayland_window_set_opaque_region;
impl_class->set_shadow_width = gdk_wayland_window_set_shadow_width;
impl_class->show_window_menu = gdk_wayland_window_show_window_menu;
}
void
+75 -103
View File
@@ -137,11 +137,8 @@
</description>
</request>
<request name="set_transient_for">
<request name="set_parent">
<description summary="surface is a child of another surface">
Setting a surface as transient of another means that it is child
of another surface.
Child surfaces are stacked above their parents, and will be
unmapped if the parent is unmapped too. They should not appear
on task bars and alt+tab.
@@ -201,6 +198,26 @@
<arg name="app_id" type="string"/>
</request>
<request name="show_window_menu">
<description summary="show the window menu">
Clients implementing client-side decorations might want to show
a context menu when right-clicking on the decorations, giving the
user a menu that they can use to maximize or minimize the window.
This request asks the compositor to pop up such a window menu at
the given position, relative to the parent surface. There are
no guarantees as to what the window menu contains.
Your surface must have focus on the seat passed in to pop up the
window menu.
</description>
<arg name="seat" type="object" interface="wl_seat" summary="the seat to pop the window up on"/>
<arg name="serial" type="uint" summary="serial of the event to pop up the window for"/>
<arg name="x" type="int" summary="the x position to pop up the window menu at"/>
<arg name="y" type="int" summary="the y position to pop up the window menu at"/>
</request>
<request name="move">
<description summary="start an interactive move">
Start a pointer-driven move of the surface.
@@ -244,40 +261,6 @@
<arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
</request>
<event name="configure">
<description summary="suggest resize">
The configure event asks the client to resize its surface.
The size is a hint, in the sense that the client is free to
ignore it if it doesn't resize, pick a smaller size (to
satisfy aspect ratio or resize in steps of NxM pixels).
The client is free to dismiss all but the last configure
event it received.
The width and height arguments specify the size of the window
in surface local coordinates.
</description>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
</event>
<request name="set_output">
<description summary="set the default output used by this surface">
Set the default output used by this surface when it is first mapped.
If this value is NULL (default), it's up to the compositor to choose
which display will be used to map this surface.
When fullscreen or maximized state are set on this surface, and it
wasn't mapped yet, the output set with this method will be used.
Otherwise, the output where the surface is currently mapped will be
used.
</description>
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
</request>
<enum name="state">
<description summary="types of state on the surface">
The different state values used on the surface. This is designed for
@@ -300,93 +283,82 @@
0x1000 - 0x1FFF: GNOME
</description>
<entry name="maximized" value="1" summary="the surface is maximized">
A non-zero value indicates the surface is maximized. Otherwise,
the surface is unmaximized.
The surface is maximized. The window geometry specified in the configure
event must be obeyed by the client.
</entry>
<entry name="fullscreen" value="2" summary="the surface is fullscreen">
A non-zero value indicates the surface is fullscreen. Otherwise,
the surface is not fullscreen.
The surface is fullscreen. The window geometry specified in the configure
event must be obeyed by the client.
</entry>
<entry name="resizing" value="3">
The surface is being resized. The window geometry specified in the
configure event is a maximum; the client cannot resize beyond it.
Clients that have aspect ratio or cell sizing configuration can use
a smaller size, however.
</entry>
<entry name="activated" value="4">
Client window decorations should be painted as if the window is
active. Do not assume this means that the window actually has
keyboard or pointer focus.
</entry>
</enum>
<request name="request_change_state">
<description summary="client requests to change a surface's state">
This asks the compositor to change the state. If the compositor wants
to change the state, it will send a change_state event with the same
state_type, value, and serial, and the event flow continues as if it
it was initiated by the compositor.
<event name="configure">
<description summary="suggest a surface chnage">
The configure event asks the client to resize its surface.
If the compositor does not want to change the state, it will send a
change_state to the client with the old value of the state.
</description>
<arg name="state_type" type="uint" summary="the state to set"/>
<arg name="value" type="uint" summary="the value to change the state to"/>
<arg name="serial" type="uint" summary="an event serial">
This serial is so the client can know which change_state event corresponds
to which request_change_state request it sent out.
</arg>
</request>
The width and height arguments specify a hint to the window
about how its surface should be resized in surface local
coordinates. The states listed in the event specify how the
width/height arguments should be interpreted.
<event name="change_state">
<description summary="compositor wants to change a surface's state">
This event tells the client to change a surface's state. The client
should respond with an ack_change_state request to the compositor to
guarantee that the compositor knows that the client has seen it.
A client should arrange a new surface, and then send a
ack_configure request with the serial sent in this configure
event before attaching a new surface.
If the client receives multiple configure events before it
can respond to one, it is free to discard all but the last
event it received.
</description>
<arg name="state_type" type="uint" summary="the state to set"/>
<arg name="value" type="uint" summary="the value to change the state to"/>
<arg name="serial" type="uint" summary="a serial for the compositor's own tracking"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="states" type="array"/>
<arg name="serial" type="uint"/>
</event>
<request name="ack_change_state">
<description summary="ack a change_state event">
When a change_state event is received, a client should then ack it
using the ack_change_state request to ensure that the compositor
<request name="ack_configure">
<description summary="ack a configure event">
When a configure event is received, a client should then ack it
using the ack_configure request to ensure that the compositor
knows the client has seen the event.
By this point, the state is confirmed, and the next attach should
contain the buffer drawn for the new state value.
The values here need to be the same as the values in the cooresponding
change_state event.
contain the buffer drawn for the configure event you are acking.
</description>
<arg name="state_type" type="uint" summary="the state to set"/>
<arg name="value" type="uint" summary="the value to change the state to"/>
<arg name="serial" type="uint" summary="a serial to pass to change_state"/>
<arg name="serial" type="uint" summary="a serial to configure for"/>
</request>
<request name="set_minimized">
<description summary="minimize the surface">
Minimize the surface.
<request name="set_maximized" />
<request name="unset_maximized" />
<request name="set_fullscreen">
<description summary="set the window as fullscreen on a monitor">
Make the surface fullscreen.
You can specify an output that you would prefer to be fullscreen.
If this value is NULL, it's up to the compositor to choose which
display will be used to map this surface.
</description>
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
</request>
<request name="unset_fullscreen" />
<event name="activated">
<description summary="surface was activated">
The activated_set event is sent when this surface has been
activated, which means that the surface has user attention.
Window decorations should be updated accordingly. You should
not use this event for anything but the style of decorations
you display, use wl_keyboard.enter and wl_keyboard.leave for
determining keyboard focus.
</description>
</event>
<request name="set_minimized" />
<event name="deactivated">
<description summary="surface was deactivated">
The deactivate event is sent when this surface has been
deactivated, which means that the surface lost user attention.
Window decorations should be updated accordingly. You should
not use this event for anything but the style of decorations
you display, use wl_keyboard.enter and wl_keyboard.leave for
determining keyboard focus.
</description>
</event>
<event name="delete">
<event name="close">
<description summary="surface wants to be closed">
The delete event is sent by the compositor when the user
The close event is sent by the compositor when the user
wants the surface to be closed. This should be equivalent to
the user clicking the close button in client-side decorations,
if your application has any...
+6 -3
View File
@@ -1285,12 +1285,15 @@ _gdk_win32_selection_convert_to_dib (HGLOBAL hdata,
if (target == _image_bmp)
{
HGLOBAL hdatanew;
SIZE_T size;
guchar *ptr;
g_return_val_if_fail (GlobalSize (hdata) >= sizeof (BITMAPFILEHEADER), NULL);
/* No conversion is needed, just strip the BITMAPFILEHEADER */
HGLOBAL hdatanew;
SIZE_T size = GlobalSize (hdata) - sizeof (BITMAPFILEHEADER);
guchar *ptr = GlobalLock (hdata);
size = GlobalSize (hdata) - sizeof (BITMAPFILEHEADER);
ptr = GlobalLock (hdata);
memmove (ptr, ptr + sizeof (BITMAPFILEHEADER), size);
GlobalUnlock (hdata);
+48
View File
@@ -5702,6 +5702,53 @@ gdk_x11_window_set_opaque_region (GdkWindow *window,
g_free (data);
}
static gboolean
gdk_x11_window_show_window_menu (GdkWindow *window,
GdkEvent *event)
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
GdkDevice *device;
int device_id;
double x_root, y_root;
XClientMessageEvent xclient = { 0 };
switch (event->type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
break;
default:
return FALSE;
}
if (!gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern_static_string ("_GTK_SHOW_WINDOW_MENU")))
return FALSE;
gdk_event_get_root_coords (event, &x_root, &y_root);
device = gdk_event_get_device (event);
g_object_get (G_OBJECT (device),
"device-id", &device_id,
NULL);
/* Ungrab the implicit grab */
gdk_device_ungrab (device, gdk_event_get_time (event));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_GTK_SHOW_WINDOW_MENU");
xclient.data.l[0] = device_id;
xclient.data.l[1] = x_root;
xclient.data.l[2] = y_root;
xclient.format = 32;
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
return TRUE;
}
static void
gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
{
@@ -5791,4 +5838,5 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
impl_class->get_scale_factor = gdk_x11_window_get_scale_factor;
impl_class->set_opaque_region = gdk_x11_window_set_opaque_region;
impl_class->set_shadow_width = gdk_x11_window_set_shadow_width;
impl_class->show_window_menu = gdk_x11_window_show_window_menu;
}
+1 -1
View File
@@ -22,7 +22,7 @@ GTK+ is free software and part of the GNU Project. However, the
licensing terms for GTK+, the GNU LGPL, allow it to be used by all
developers, including those developing proprietary software, without
any license fees or royalties.</description>
<homepage rdf:resource="http://www.gtk+.org/" />
<homepage rdf:resource="http://www.gtk.org/" />
<license rdf:resource="http://usefulinc.com/doap/licenses/lgpl" />
<bug-database rdf:resource="http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B" />
<download-page rdf:resource="http://download.gnome.org/sources/gtk+/" />
-134
View File
@@ -1,134 +0,0 @@
%define binary_version @GTK_BINARY_VERSION@
Name: gtk2
Summary: The Gimp Toolkit
Version: @VERSION@
Release: 1
License: LGPL
Group: X11/Libraries
Source: ftp://ftp.gimp.org/pub/gtk/v2.3/gtk+-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-root
URL: http://www.gtk.org
Requires: glib2 >= %{version}
Requires: pango
Requires: atk
BuildRequires: glib2-devel
BuildRequires: pango-devel
BuildRequires: atk-devel
%description
The X libraries originally written for the GIMP, which are now used by
several other programs as well.
%package devel
Summary: GIMP Toolkit and GIMP Drawing Kit
Group: X11/Libraries
Requires: %{name} = %{version}
%description devel
Static libraries and header files for the GIMP's X libraries, which are
available as public libraries. GLIB includes generally useful data
structures, GDK is a drawing toolkit which provides a thin layer over
Xlib to help automate things like dealing with different color depths,
and GTK is a widget set for creating user interfaces.
%prep
%setup -q -n gtk+-%{version}
%build
%ifarch alpha
MYARCH_FLAGS="--host=alpha-redhat-linux"
%endif
# Needed for snapshot releases.
MYCFLAGS="$RPM_OPT_FLAGS"
if [ ! -f configure ]; then
CFLAGS="$MYCFLAGS" ./autogen.sh $MYARCH_FLAGS \
--prefix=%{_prefix} \
--localstatedir=%{_localstatedir} --sysconfdir=%{_sysconfdir} \
--mandir=%{_mandir} --libdir=%{_libdir} \
--includedir=%{_includedir}
else
CFLAGS="$MYCFLAGS" ./configure $MYARCH_FLAGS \
--prefix=%{_prefix} --localstatedir=%{_localstatedir} \
--sysconfdir=%{_sysconfdir} --mandir=%{_mandir} \
--libdir=%{_libdir} --includedir=%{_includedir} --disable-gtk-doc
fi
if [ "$SMP" != "" ]; then
(make "MAKE=make -k -j $SMP"; exit 0)
make
else
make
fi
%install
rm -rf $RPM_BUILD_ROOT
make -k sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} \
prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} \
localstatedir=$RPM_BUILD_ROOT%{_localstatedir} \
libdir=$RPM_BUILD_ROOT%{_libdir} \
includedir=$RPM_BUILD_ROOT%{_includedir} install
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/*
%{_libdir}/libgtk*.so.*
%{_libdir}/libgdk*.so.*
%{_libdir}/gtk-2.0/%{binary_version}/*/*.so
#%{_datadir}/locale/*/*/*
%{_sysconfdir}/gtk-2.0/gtk.immodules
%files devel
%defattr(-, root, root)
%{_libdir}/lib*.so
%{_libdir}/*a
%{_libdir}/gtk-2.0/%{binary_version}/*/*a
%{_libdir}/gtk-2.0/include
%{_libdir}/pkgconfig/*.pc
%{_includedir}/gtk-2.0
%{_datadir}/gtk-2.0
%{_datadir}/aclocal/*
%{_datadir}/gtk-doc/html/*
%changelog
* Wed Sep 11 2002 Dennis Dementiev <denm@asplinux.ru>
- modules and loaders should be installed in under binary version
dir instead version
* Mon Aug 27 2001 Jens Finke <jens@gnome.org>
- Renamed package to gtk2.
- Updated source url.
- glib2 package required.
* Mon Aug 27 2001 Jens Finke <jens@gnome.org>
- Updated spec file to match gpp standard and
1.3.x files.
- Removed all hardcoded paths, use rpm macros instead.
- Added pango and atk Requires: and BuildRequires: statements.
- Removed Docdir: statement.
- Moved ChangeLog to the end of the file.
- Truncated ChangeLog (Mar 12 1998 - Jun 1 1999)
Previous Authors:
Jose Mercado <jmercado@mit.edu>
Michael Fulbright <drmike@redhat.com>
Shawn T. Amundson <amundson@gtk.org>
Dick Porter <dick@cymru.net>
Marc Ewing <marc@redhat.com>
Owen Taylor <otaylor@gtk.org>
Trond Eivind Glomsrod <teg@pvv.ntnu.no>
Michael K. Johnson <johnsonm@redhat.com>
Otto Hammersmith <otto@redhat.com>
+194 -29
View File
@@ -18,7 +18,7 @@ else
GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
endif
SUBDIRS = a11y native .
SUBDIRS = inspector native .
if HAVE_CLOUDPRINT
if HAVE_PAPI_CUPS
@@ -116,12 +116,12 @@ endif
libgtkincludedir = $(includedir)/gtk-3.0/gtk
libadd = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/a11y/libgtka11y.la \
$(top_builddir)/gtk/inspector/libgtkinspector.la \
$(GMODULE_LIBS) \
$(GTK_DEP_LIBS)
deps = \
$(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/a11y/libgtka11y.la
$(top_builddir)/gtk/inspector/libgtkinspector.la
# libtool stuff: set version and export symbols for resolving
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
@@ -153,10 +153,64 @@ endif
# GTK+ header files for public installation (non-generated, or generated
# by configure)
a11y_h_sources = \
a11y/gtkarrowaccessible.h \
a11y/gtkbooleancellaccessible.h \
a11y/gtkbuttonaccessible.h \
a11y/gtkcellaccessible.h \
a11y/gtkcellaccessibleparent.h \
a11y/gtkcheckmenuitemaccessible.h \
a11y/gtkcomboboxaccessible.h \
a11y/gtkcontaineraccessible.h \
a11y/gtkcontainercellaccessible.h \
a11y/gtkentryaccessible.h \
a11y/gtkexpanderaccessible.h \
a11y/gtkflowboxaccessible.h \
a11y/gtkflowboxchildaccessible.h \
a11y/gtkframeaccessible.h \
a11y/gtkiconviewaccessible.h \
a11y/gtkimageaccessible.h \
a11y/gtkimagecellaccessible.h \
a11y/gtklabelaccessible.h \
a11y/gtklevelbaraccessible.h \
a11y/gtklinkbuttonaccessible.h \
a11y/gtklistboxaccessible.h \
a11y/gtklistboxrowaccessible.h \
a11y/gtklockbuttonaccessible.h \
a11y/gtkmenuaccessible.h \
a11y/gtkmenubuttonaccessible.h \
a11y/gtkmenuitemaccessible.h \
a11y/gtkmenushellaccessible.h \
a11y/gtknotebookaccessible.h \
a11y/gtknotebookpageaccessible.h \
a11y/gtkpanedaccessible.h \
a11y/gtkpopoveraccessible.h \
a11y/gtkprogressbaraccessible.h \
a11y/gtkradiobuttonaccessible.h \
a11y/gtkradiomenuitemaccessible.h \
a11y/gtkrangeaccessible.h \
a11y/gtkrenderercellaccessible.h \
a11y/gtkscaleaccessible.h \
a11y/gtkscalebuttonaccessible.h \
a11y/gtkscrolledwindowaccessible.h \
a11y/gtkspinbuttonaccessible.h \
a11y/gtkspinneraccessible.h \
a11y/gtkstatusbaraccessible.h \
a11y/gtkswitchaccessible.h \
a11y/gtktextcellaccessible.h \
a11y/gtktextviewaccessible.h \
a11y/gtktogglebuttonaccessible.h \
a11y/gtktoplevelaccessible.h \
a11y/gtktreeviewaccessible.h \
a11y/gtkwidgetaccessible.h \
a11y/gtkwindowaccessible.h
deprecated_h_sources = \
deprecated/gtkactivatable.h \
deprecated/gtkaction.h \
deprecated/gtkactiongroup.h \
deprecated/gtkalignment.h \
deprecated/gtkarrow.h \
deprecated/gtkcolorsel.h \
deprecated/gtkcolorseldialog.h \
deprecated/gtkfontsel.h \
@@ -171,6 +225,8 @@ deprecated_h_sources = \
deprecated/gtkhsv.h \
deprecated/gtkiconfactory.h \
deprecated/gtkimagemenuitem.h \
deprecated/gtkmisc.h \
deprecated/gtknumerableicon.h \
deprecated/gtkradioaction.h \
deprecated/gtkrc.h \
deprecated/gtkrecentaction.h \
@@ -188,8 +244,25 @@ deprecated_h_sources = \
deprecated/gtkvseparator.h \
deprecated/gtkvpaned.h
a11y_private_h_sources = \
a11y/gtkaccessibility.h \
a11y/gtkaccessibilitymisc.h \
a11y/gtkaccessibilityutil.h \
a11y/gtkcellaccessibleprivate.h \
a11y/gtkcolorswatchaccessibleprivate.h \
a11y/gtkcontaineraccessibleprivate.h \
a11y/gtkiconviewaccessibleprivate.h \
a11y/gtklabelaccessibleprivate.h \
a11y/gtkflowboxaccessibleprivate.h \
a11y/gtklistboxaccessibleprivate.h \
a11y/gtklockbuttonaccessibleprivate.h \
a11y/gtktextviewaccessibleprivate.h \
a11y/gtktreeviewaccessibleprivate.h \
a11y/gtkwidgetaccessibleprivate.h
deprecated_private_h_sources = \
deprecated/gtkgradientprivate.h \
deprecated/gtknumerableiconprivate.h \
deprecated/gtksymboliccolorprivate.h
gtk_public_h_sources = \
@@ -204,14 +277,12 @@ gtk_public_h_sources = \
gtkactionable.h \
gtkactionbar.h \
gtkadjustment.h \
gtkalignment.h \
gtkappchooser.h \
gtkappchooserbutton.h \
gtkappchooserdialog.h \
gtkappchooserwidget.h \
gtkapplication.h \
gtkapplicationwindow.h \
gtkarrow.h \
gtkaspectframe.h \
gtkassistant.h \
gtkbbox.h \
@@ -261,6 +332,7 @@ gtk_public_h_sources = \
gtkentrycompletion.h \
gtkenums.h \
gtkeventbox.h \
gtkeventcontroller.h \
gtkexpander.h \
gtkfilechooser.h \
gtkfilechooserbutton.h \
@@ -274,6 +346,15 @@ gtk_public_h_sources = \
gtkfontchooserdialog.h \
gtkfontchooserwidget.h \
gtkframe.h \
gtkgesture.h \
gtkgesturedrag.h \
gtkgesturelongpress.h \
gtkgesturemultipress.h \
gtkgesturepan.h \
gtkgesturerotate.h \
gtkgesturesingle.h \
gtkgestureswipe.h \
gtkgesturezoom.h \
gtkgrid.h \
gtkheaderbar.h \
gtkicontheme.h \
@@ -301,11 +382,9 @@ gtk_public_h_sources = \
gtkmenushell.h \
gtkmenutoolbutton.h \
gtkmessagedialog.h \
gtkmisc.h \
gtkmodules.h \
gtkmountoperation.h \
gtknotebook.h \
gtknumerableicon.h \
gtkoffscreenwindow.h \
gtkorientable.h \
gtkoverlay.h \
@@ -455,6 +534,7 @@ gtk_private_h_sources = \
gtkcssenumvalueprivate.h \
gtkcssimagecrossfadeprivate.h \
gtkcssimagegradientprivate.h \
gtkcssimageiconthemeprivate.h \
gtkcssimagelinearprivate.h \
gtkcssimageprivate.h \
gtkcssimagesurfaceprivate.h \
@@ -481,12 +561,15 @@ gtk_private_h_sources = \
gtkcssstringvalueprivate.h \
gtkcssstylefuncsprivate.h \
gtkcssstylepropertyprivate.h \
gtkcsstransformvalueprivate.h \
gtkcsstransitionprivate.h \
gtkcsstypedvalueprivate.h \
gtkcssunsetvalueprivate.h \
gtkcssvalueprivate.h \
gtkcustompaperunixdialog.h \
gtkdialogprivate.h \
gtkentryprivate.h \
gtkeventcontrollerprivate.h \
gtkfilechooserembed.h \
gtkfilechooserentry.h \
gtkfilechooserprivate.h \
@@ -495,6 +578,15 @@ gtk_private_h_sources = \
gtkfilesystemmodel.h \
gtkfontchooserprivate.h \
gtkfontchooserutils.h \
gtkgestureprivate.h \
gtkgesturedragprivate.h \
gtkgesturelongpressprivate.h \
gtkgesturemultipressprivate.h \
gtkgesturepanprivate.h \
gtkgesturerotateprivate.h \
gtkgesturesingleprivate.h \
gtkgestureswipeprivate.h \
gtkgesturezoomprivate.h \
gtkheaderbarprivate.h \
gtkhslaprivate.h \
gtkiconcache.h \
@@ -511,6 +603,7 @@ gtk_private_h_sources = \
gtkmenubuttonprivate.h \
gtkmenuprivate.h \
gtkmenuitemprivate.h \
gtkmenusectionbox.h \
gtkmenushellprivate.h \
gtkmenutracker.h \
gtkmenutrackeritem.h \
@@ -520,11 +613,9 @@ gtk_private_h_sources = \
gtkmodifierstyle.h \
gtkmodulesprivate.h \
gtkmountoperationprivate.h \
gtknumerableiconprivate.h \
gtkorientableprivate.h \
gtkpango.h \
gtkpathbar.h \
gtkpressandholdprivate.h \
gtkprintoperation-private.h \
gtkprintutils.h \
gtkprivate.h \
@@ -575,11 +666,69 @@ gtk_private_h_sources = \
$(gtk_private_type_h_sources) \
$(gtk_clipboard_dnd_h_sources)
a11y_c_sources = \
a11y/gtkaccessibility.c \
a11y/gtkaccessibilitymisc.c \
a11y/gtkaccessibilityutil.c \
a11y/gtkarrowaccessible.c \
a11y/gtkbooleancellaccessible.c \
a11y/gtkbuttonaccessible.c \
a11y/gtkcellaccessible.c \
a11y/gtkcellaccessibleparent.c \
a11y/gtkcheckmenuitemaccessible.c \
a11y/gtkcolorswatchaccessible.c \
a11y/gtkcomboboxaccessible.c \
a11y/gtkcontaineraccessible.c \
a11y/gtkcontainercellaccessible.c \
a11y/gtkentryaccessible.c \
a11y/gtkexpanderaccessible.c \
a11y/gtkflowboxaccessible.c \
a11y/gtkflowboxchildaccessible.c \
a11y/gtkframeaccessible.c \
a11y/gtkiconviewaccessible.c \
a11y/gtkimageaccessible.c \
a11y/gtkimagecellaccessible.c \
a11y/gtklabelaccessible.c \
a11y/gtklevelbaraccessible.c \
a11y/gtklinkbuttonaccessible.c \
a11y/gtklistboxaccessible.c \
a11y/gtklistboxrowaccessible.c \
a11y/gtklockbuttonaccessible.c \
a11y/gtkmenuaccessible.c \
a11y/gtkmenubuttonaccessible.c \
a11y/gtkmenushellaccessible.c \
a11y/gtkmenuitemaccessible.c \
a11y/gtknotebookaccessible.c \
a11y/gtknotebookpageaccessible.c \
a11y/gtkpanedaccessible.c \
a11y/gtkpopoveraccessible.c \
a11y/gtkprogressbaraccessible.c \
a11y/gtkradiobuttonaccessible.c \
a11y/gtkradiomenuitemaccessible.c \
a11y/gtkrangeaccessible.c \
a11y/gtkrenderercellaccessible.c \
a11y/gtkscaleaccessible.c \
a11y/gtkscalebuttonaccessible.c \
a11y/gtkscrolledwindowaccessible.c \
a11y/gtkspinbuttonaccessible.c \
a11y/gtkspinneraccessible.c \
a11y/gtkstatusbaraccessible.c \
a11y/gtkswitchaccessible.c \
a11y/gtktextcellaccessible.c \
a11y/gtktextviewaccessible.c \
a11y/gtktogglebuttonaccessible.c \
a11y/gtktoplevelaccessible.c \
a11y/gtktreeviewaccessible.c \
a11y/gtkwidgetaccessible.c \
a11y/gtkwindowaccessible.c
# GTK+ C sources to build the library from
deprecated_c_sources = \
deprecated/gtkactivatable.c \
deprecated/gtkaction.c \
deprecated/gtkactiongroup.c \
deprecated/gtkalignment.c \
deprecated/gtkarrow.c \
deprecated/gtkcolorsel.c \
deprecated/gtkcolorseldialog.c \
deprecated/gtkfontsel.c \
@@ -594,6 +743,8 @@ deprecated_c_sources = \
deprecated/gtkhsv.c \
deprecated/gtkiconfactory.c \
deprecated/gtkimagemenuitem.c \
deprecated/gtkmisc.c \
deprecated/gtknumerableicon.c \
deprecated/gtkradioaction.c \
deprecated/gtkrc.c \
deprecated/gtkrecentaction.c \
@@ -612,6 +763,7 @@ deprecated_c_sources = \
deprecated/gtkvpaned.c
gtk_base_c_sources = \
$(a11y_c_sources) \
$(deprecated_c_sources) \
gtkactionmuxer.c \
gtkactionobserver.c \
@@ -631,7 +783,6 @@ gtk_base_c_sources = \
gtkactionbar.c \
gtkactionhelper.c \
gtkadjustment.c \
gtkalignment.c \
gtkallocatedbitmask.c \
gtkappchooser.c \
gtkappchooserwidget.c \
@@ -640,7 +791,6 @@ gtk_base_c_sources = \
gtkapplication.c \
gtkapplicationimpl.c \
gtkapplicationwindow.c \
gtkarrow.c \
gtkaspectframe.c \
gtkassistant.c \
gtkbbox.c \
@@ -701,6 +851,7 @@ gtk_base_c_sources = \
gtkcssimage.c \
gtkcssimagecrossfade.c \
gtkcssimagegradient.c \
gtkcssimageicontheme.c \
gtkcssimagelinear.c \
gtkcssimagesurface.c \
gtkcssimageurl.c \
@@ -728,8 +879,10 @@ gtk_base_c_sources = \
gtkcssstylefuncs.c \
gtkcssstyleproperty.c \
gtkcssstylepropertyimpl.c \
gtkcsstransformvalue.c \
gtkcsstransition.c \
gtkcsstypedvalue.c \
gtkcssunsetvalue.c \
gtkcssvalue.c \
gtkcsstypes.c \
gtkdialog.c \
@@ -739,6 +892,7 @@ gtk_base_c_sources = \
gtkentrybuffer.c \
gtkentrycompletion.c \
gtkeventbox.c \
gtkeventcontroller.c \
gtkexpander.c \
gtkfilechooser.c \
gtkfilechooserbutton.c \
@@ -759,6 +913,15 @@ gtk_base_c_sources = \
gtkfontchooserwidget.c \
gtkframe.c \
gtkgladecatalog.c \
gtkgesture.c \
gtkgesturedrag.c \
gtkgesturelongpress.c \
gtkgesturemultipress.c \
gtkgesturepan.c \
gtkgesturerotate.c \
gtkgesturesingle.c \
gtkgestureswipe.c \
gtkgesturezoom.c \
gtkgrid.c \
gtkheaderbar.c \
gtkhsla.c \
@@ -789,12 +952,12 @@ gtk_base_c_sources = \
gtkmenubar.c \
gtkmenubutton.c \
gtkmenuitem.c \
gtkmenusectionbox.c \
gtkmenushell.c \
gtkmenutracker.c \
gtkmenutrackeritem.c \
gtkmenutoolbutton.c \
gtkmessagedialog.c \
gtkmisc.c \
gtkmnemonichash.c \
gtkmodelmenuitem.c \
gtkmodelbutton.c \
@@ -802,7 +965,6 @@ gtk_base_c_sources = \
gtkmodules.c \
gtkmountoperation.c \
gtknotebook.c \
gtknumerableicon.c \
gtkoffscreenwindow.c \
gtkorientable.c \
gtkoverlay.c \
@@ -812,7 +974,6 @@ gtk_base_c_sources = \
gtkpapersize.c \
gtkpathbar.c \
gtkplacessidebar.c \
gtkpressandhold.c \
gtkprintcontext.c \
gtkprintoperation.c \
gtkprintoperationpreview.c \
@@ -1036,6 +1197,7 @@ gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
endif
gtk_all_private_h_sources = \
$(a11y_private_h_sources) \
$(deprecated_private_h_sources) \
$(gtk_private_h_sources) \
$(gtk_use_x11_private_h_sources) \
@@ -1195,15 +1357,15 @@ gtkmarshalers.c: gtkmarshalers.list
gtktypebuiltins.h: stamp-gtktypebuiltins.h
@true
stamp-gtktypebuiltins.h: $(gtk_public_h_sources) $(deprecated_h_sources) gtktypebuiltins.h.template
stamp-gtktypebuiltins.h: $(gtk_public_h_sources) $(a11y_h_sources) $(deprecated_h_sources) gtktypebuiltins.h.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gtktypebuiltins.h.template \
$(gtk_public_h_sources) $(deprecated_h_sources) ) > xgen-gtbh \
$(gtk_public_h_sources) $(a11y_h_sources) $(deprecated_h_sources) ) > xgen-gtbh \
&& (cmp -s xgen-gtbh gtktypebuiltins.h || cp xgen-gtbh gtktypebuiltins.h ) \
&& rm -f xgen-gtbh \
&& echo timestamp > $(@F)
gtktypebuiltins.c: $(gtk_public_h_sources) $(deprecated_h_sources) gtktypebuiltins.c.template
gtktypebuiltins.c: $(gtk_public_h_sources) $(a11y_h_sources) $(deprecated_h_sources) gtktypebuiltins.c.template
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) --template gtktypebuiltins.c.template \
$(gtk_public_h_sources) $(deprecated_h_sources) ) > xgen-gtbc \
$(gtk_public_h_sources) $(a11y_h_sources) $(deprecated_h_sources) ) > xgen-gtbc \
&& cp xgen-gtbc gtktypebuiltins.c \
&& rm -f xgen-gtbc
@@ -1230,7 +1392,7 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins.
&& rm -f xgen-gptbc
gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile
gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile
$(AM_V_GEN) echo '#include <gtk/gtkx.h>' > xgen-gtfsrc.c && \
echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \
${CPP} $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \
@@ -1246,6 +1408,9 @@ lib_LTLIBRARIES = libgtk-3.la
gtkincludedir = $(includedir)/gtk-3.0/gtk
gtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semi_private_h_sources) $(gtk_built_public_sources) gtkversion.h
a11yincludedir = $(includedir)/gtk-3.0/gtk/a11y
a11yinclude_HEADERS= $(a11y_h_sources)
deprecatedincludedir = $(includedir)/gtk-3.0/gtk/deprecated
deprecatedinclude_HEADERS= $(deprecated_h_sources)
@@ -1349,7 +1514,7 @@ if HAVE_INTROSPECTION
# introspection. Rather than copy the annotations over from the
# regular files, exclude the quartz ones:
introspection_files = \
$(filter-out %private.h gtktextdisplay.h gtktextlayout.h, $(gtkinclude_HEADERS) $(deprecatedinclude_HEADERS)) \
$(filter-out %private.h gtktextdisplay.h gtktextlayout.h, $(gtkinclude_HEADERS) $(a11yinclude_HEADERS) $(deprecatedinclude_HEADERS)) \
$(filter-out gtkclipboard-quartz.c gtkdnd-quartz.c, \
$(gtk_base_c_sources)) \
gtkprintoperation-unix.c \
@@ -1783,10 +1948,18 @@ endif
--source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
mv gtkbuiltincache.h.tmp gtkbuiltincache.h
gsettings_SCHEMAS = \
org.gtk.Settings.FileChooser.gschema.xml \
org.gtk.Settings.ColorChooser.gschema.xml \
org.gtk.Settings.Debug.gschema.xml
@GSETTINGS_RULES@
EXTRA_DIST += \
$(resource_files) \
$(STOCK_ICONS) \
$(GENERATED_ICONS) \
$(gsettings_SCHEMAS) \
gtk-win32.rc \
gtk-win32.rc.in \
gtkwin32embed.h \
@@ -1805,15 +1978,7 @@ EXTRA_DIST += \
gtktypebuiltins.c.template \
gtktypebuiltins.h.template \
gtkprivatetypebuiltins.c.template \
gtkprivatetypebuiltins.h.template \
org.gtk.Settings.FileChooser.gschema.xml \
org.gtk.Settings.ColorChooser.gschema.xml
gsettings_SCHEMAS = \
org.gtk.Settings.FileChooser.gschema.xml \
org.gtk.Settings.ColorChooser.gschema.xml
@GSETTINGS_RULES@
gtkprivatetypebuiltins.h.template
install-data-local:
-190
View File
@@ -1,190 +0,0 @@
include $(top_srcdir)/Makefile.decl
noinst_LTLIBRARIES = libgtka11y.la
gtka11y_c_sources = \
gtkaccessibility.c \
gtkaccessibilitymisc.c \
gtkaccessibilityutil.c \
gtkarrowaccessible.c \
gtkbooleancellaccessible.c \
gtkbuttonaccessible.c \
gtkcellaccessible.c \
gtkcellaccessibleparent.c \
gtkcheckmenuitemaccessible.c \
gtkcolorswatchaccessible.c \
gtkcomboboxaccessible.c \
gtkcontaineraccessible.c \
gtkcontainercellaccessible.c \
gtkentryaccessible.c \
gtkexpanderaccessible.c \
gtkflowboxaccessible.c \
gtkflowboxchildaccessible.c \
gtkframeaccessible.c \
gtkiconviewaccessible.c \
gtkimageaccessible.c \
gtkimagecellaccessible.c \
gtklabelaccessible.c \
gtklevelbaraccessible.c \
gtklinkbuttonaccessible.c \
gtklistboxaccessible.c \
gtklistboxrowaccessible.c \
gtklockbuttonaccessible.c \
gtkmenuaccessible.c \
gtkmenubuttonaccessible.c \
gtkmenushellaccessible.c \
gtkmenuitemaccessible.c \
gtknotebookaccessible.c \
gtknotebookpageaccessible.c \
gtkpanedaccessible.c \
gtkpopoveraccessible.c \
gtkprogressbaraccessible.c \
gtkradiobuttonaccessible.c \
gtkradiomenuitemaccessible.c \
gtkrangeaccessible.c \
gtkrenderercellaccessible.c \
gtkscaleaccessible.c \
gtkscalebuttonaccessible.c \
gtkscrolledwindowaccessible.c \
gtkspinbuttonaccessible.c \
gtkspinneraccessible.c \
gtkstatusbaraccessible.c \
gtkswitchaccessible.c \
gtktextcellaccessible.c \
gtktextviewaccessible.c \
gtktogglebuttonaccessible.c \
gtktoplevelaccessible.c \
gtktreeviewaccessible.c \
gtkwidgetaccessible.c \
gtkwindowaccessible.c
gtka11yincludedir = $(includedir)/gtk-3.0/gtk/a11y
gtka11yinclude_HEADERS = \
gtkarrowaccessible.h \
gtkbooleancellaccessible.h \
gtkbuttonaccessible.h \
gtkcellaccessible.h \
gtkcellaccessibleparent.h \
gtkcheckmenuitemaccessible.h \
gtkcomboboxaccessible.h \
gtkcontaineraccessible.h \
gtkcontainercellaccessible.h \
gtkentryaccessible.h \
gtkexpanderaccessible.h \
gtkflowboxaccessible.h \
gtkflowboxchildaccessible.h \
gtkframeaccessible.h \
gtkiconviewaccessible.h \
gtkimageaccessible.h \
gtkimagecellaccessible.h \
gtklabelaccessible.h \
gtklevelbaraccessible.h \
gtklinkbuttonaccessible.h \
gtklistboxaccessible.h \
gtklistboxrowaccessible.h \
gtklockbuttonaccessible.h \
gtkmenuaccessible.h \
gtkmenubuttonaccessible.h \
gtkmenuitemaccessible.h \
gtkmenushellaccessible.h \
gtknotebookaccessible.h \
gtknotebookpageaccessible.h \
gtkpanedaccessible.h \
gtkpopoveraccessible.h \
gtkprogressbaraccessible.h \
gtkradiobuttonaccessible.h \
gtkradiomenuitemaccessible.h \
gtkrangeaccessible.h \
gtkrenderercellaccessible.h \
gtkscaleaccessible.h \
gtkscalebuttonaccessible.h \
gtkscrolledwindowaccessible.h \
gtkspinbuttonaccessible.h \
gtkspinneraccessible.h \
gtkstatusbaraccessible.h \
gtkswitchaccessible.h \
gtktextcellaccessible.h \
gtktextviewaccessible.h \
gtktogglebuttonaccessible.h \
gtktoplevelaccessible.h \
gtktreeviewaccessible.h \
gtkwidgetaccessible.h \
gtkwindowaccessible.h
gtka11y_private_h_sources = \
gtkaccessibility.h \
gtkaccessibilitymisc.h \
gtkaccessibilityutil.h \
gtkcellaccessibleprivate.h \
gtkcolorswatchaccessibleprivate.h \
gtkcontaineraccessibleprivate.h \
gtkiconviewaccessibleprivate.h \
gtklabelaccessibleprivate.h \
gtkflowboxaccessibleprivate.h \
gtklistboxaccessibleprivate.h \
gtklockbuttonaccessibleprivate.h \
gtktextviewaccessibleprivate.h \
gtktreeviewaccessibleprivate.h \
gtkwidgetaccessibleprivate.h
libgtka11y_la_SOURCES = \
$(gtka11y_c_sources) \
$(gtka11y_private_h_sources)
libgtka11y_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
-I$(top_srcdir)/gtk \
-I$(top_builddir)/gtk \
-DGTK_VERSION=\"$(GTK_VERSION)\"\
-DGTK_COMPILATION \
$(AM_CPPFLAGS)
libgtka11y_la_CFLAGS = \
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
$(GTK_DEP_CFLAGS) \
$(GTK_DEBUG_FLAGS) \
$(AM_CFLAGS)
libgtka11y_la_LIBADD = \
$(GTK_DEP_LIBS) \
$(INTLLIBS)
libgtka11y_la_LDFLAGS = \
$(LDFLAGS)
dist-hook: $(top_builddir)/build/win32/vs9/gtka11y.vcproj $(top_builddir)/build/win32/vs10/gtka11y.vcxproj $(top_builddir)/build/win32/vs10/gtka11y.vcxproj.filters
$(top_builddir)/build/win32/vs9/gtka11y.vcproj: $(top_srcdir)/build/win32/vs9/gtka11y.vcprojin
for F in $(gtka11y_c_sources); do \
case $$F in \
*.c) echo ' <File RelativePath="..\..\..\gtk\a11y\'$$F'" />' \
;; \
esac; \
done >gtka11y.sourcefiles
$(CPP) -P - <$(top_srcdir)/build/win32/vs9/gtka11y.vcprojin >$@
rm gtka11y.sourcefiles
$(top_builddir)/build/win32/vs10/gtka11y.vcxproj: $(top_srcdir)/build/win32/vs10/gtka11y.vcxprojin
for F in $(gtka11y_c_sources); do \
case $$F in \
*.c) echo ' <ClCompile Include="..\..\..\gtk\a11y\'$$F'" />' \
;; \
esac; \
done >gtka11y.vs10.sourcefiles
$(CPP) -P - <$(top_srcdir)/build/win32/vs10/gtka11y.vcxprojin >$@
rm gtka11y.vs10.sourcefiles
$(top_builddir)/build/win32/vs10/gtka11y.vcxproj.filters: $(top_srcdir)/build/win32/vs10/gtka11y.vcxproj.filtersin
for F in $(gtka11y_c_sources); do \
case $$F in \
*.c) echo ' <ClCompile Include="..\..\..\gtk\a11y\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
;; \
esac; \
done >gtka11y.vs10.sourcefiles.filters
$(CPP) -P - <$(top_srcdir)/build/win32/vs10/gtka11y.vcxproj.filtersin >$@
rm gtka11y.vs10.sourcefiles.filters
-include $(top_srcdir)/git.mk
+3
View File
@@ -20,6 +20,7 @@
#include <gtk/gtk.h>
#include "gtkaccessibilitymisc.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_DEFINE_TYPE (GtkMiscImpl, _gtk_misc_impl, ATK_TYPE_MISC)
@@ -48,3 +49,5 @@ static void
_gtk_misc_impl_init (GtkMiscImpl *misc)
{
}
G_GNUC_END_IGNORE_DEPRECATIONS
+2
View File
@@ -122,8 +122,10 @@ get_label_from_button (GtkWidget *button)
GtkWidget *child;
child = gtk_bin_get_child (GTK_BIN (button));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (GTK_IS_ALIGNMENT (child))
child = gtk_bin_get_child (GTK_BIN (child));
G_GNUC_END_IGNORE_DEPRECATIONS
if (GTK_IS_CONTAINER (child))
child = find_label_child (GTK_CONTAINER (child));
+50 -4
View File
@@ -72,7 +72,7 @@ gtk_level_bar_accessible_init (GtkLevelBarAccessible *button)
static void
gtk_level_bar_accessible_get_current_value (AtkValue *obj,
GValue *value)
GValue *value)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
@@ -87,7 +87,7 @@ gtk_level_bar_accessible_get_current_value (AtkValue *obj,
static void
gtk_level_bar_accessible_get_maximum_value (AtkValue *obj,
GValue *value)
GValue *value)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
@@ -102,7 +102,7 @@ gtk_level_bar_accessible_get_maximum_value (AtkValue *obj,
static void
gtk_level_bar_accessible_get_minimum_value (AtkValue *obj,
GValue *value)
GValue *value)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
@@ -117,7 +117,7 @@ gtk_level_bar_accessible_get_minimum_value (AtkValue *obj,
static gboolean
gtk_level_bar_accessible_set_current_value (AtkValue *obj,
const GValue *value)
const GValue *value)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
@@ -130,6 +130,48 @@ gtk_level_bar_accessible_set_current_value (AtkValue *obj,
return TRUE;
}
static void
gtk_level_bar_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
level_bar = GTK_LEVEL_BAR (widget);
*value = gtk_level_bar_get_value (level_bar);
*text = NULL;
}
static AtkRange *
gtk_level_bar_accessible_get_range (AtkValue *obj)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
level_bar = GTK_LEVEL_BAR (widget);
return atk_range_new (gtk_level_bar_get_min_value (level_bar),
gtk_level_bar_get_max_value (level_bar),
NULL);
}
static void
gtk_level_bar_accessible_set_value (AtkValue *obj,
const gdouble value)
{
GtkWidget *widget;
GtkLevelBar *level_bar;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
level_bar = GTK_LEVEL_BAR (widget);
gtk_level_bar_set_value (level_bar, value);
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
@@ -137,4 +179,8 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_maximum_value = gtk_level_bar_accessible_get_maximum_value;
iface->get_minimum_value = gtk_level_bar_accessible_get_minimum_value;
iface->set_current_value = gtk_level_bar_accessible_set_current_value;
iface->get_value_and_text = gtk_level_bar_accessible_get_value_and_text;
iface->get_range = gtk_level_bar_accessible_get_range;
iface->set_value = gtk_level_bar_accessible_set_value;
}
+80 -17
View File
@@ -84,6 +84,26 @@ gtk_list_box_accessible_add_selection (AtkSelection *selection,
return FALSE;
}
static gboolean
gtk_list_box_accessible_remove_selection (AtkSelection *selection,
gint idx)
{
GtkWidget *box;
GtkListBoxRow *row;
box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (box == NULL)
return FALSE;
row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (box), idx);
if (row)
{
gtk_list_box_unselect_row (GTK_LIST_BOX (box), row);
return TRUE;
}
return FALSE;
}
static gboolean
gtk_list_box_accessible_clear_selection (AtkSelection *selection)
{
@@ -93,49 +113,92 @@ gtk_list_box_accessible_clear_selection (AtkSelection *selection)
if (box == NULL)
return FALSE;
gtk_list_box_select_row (GTK_LIST_BOX (box), NULL);
gtk_list_box_unselect_all (GTK_LIST_BOX (box));
return TRUE;
}
static gboolean
gtk_list_box_accessible_select_all (AtkSelection *selection)
{
GtkWidget *box;
box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (box == NULL)
return FALSE;
gtk_list_box_select_all (GTK_LIST_BOX (box));
return TRUE;
}
typedef struct
{
gint idx;
GtkWidget *row;
} FindSelectedData;
static void
find_selected_row (GtkListBox *box,
GtkListBoxRow *row,
gpointer data)
{
FindSelectedData *d = data;
if (d->idx == 0)
{
if (d->row == NULL)
d->row = GTK_WIDGET (row);
}
else
d->idx -= 1;
}
static AtkObject *
gtk_list_box_accessible_ref_selection (AtkSelection *selection,
gint idx)
{
GtkWidget *box;
GtkListBoxRow *row;
AtkObject *accessible;
if (idx != 0)
return NULL;
FindSelectedData data;
box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (box == NULL)
return NULL;
row = gtk_list_box_get_selected_row (GTK_LIST_BOX (box));
if (row == NULL)
data.idx = idx;
data.row = NULL;
gtk_list_box_selected_foreach (GTK_LIST_BOX (box), find_selected_row, &data);
if (data.row == NULL)
return NULL;
accessible = gtk_widget_get_accessible (GTK_WIDGET (row));
accessible = gtk_widget_get_accessible (data.row);
g_object_ref (accessible);
return accessible;
}
static void
count_selected (GtkListBox *box,
GtkListBoxRow *row,
gpointer data)
{
gint *count = data;
*count += 1;
}
static gint
gtk_list_box_accessible_get_selection_count (AtkSelection *selection)
{
GtkWidget *box;
GtkListBoxRow *row;
gint count;
box = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
if (box == NULL)
return 0;
row = gtk_list_box_get_selected_row (GTK_LIST_BOX (box));
if (row == NULL)
return 0;
count = 0;
gtk_list_box_selected_foreach (GTK_LIST_BOX (box), count_selected, &count);
return 1;
return count;
}
static gboolean
@@ -149,20 +212,20 @@ gtk_list_box_accessible_is_child_selected (AtkSelection *selection,
if (box == NULL)
return FALSE;
row = gtk_list_box_get_selected_row (GTK_LIST_BOX (box));
if (row == NULL)
return FALSE;
row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (box), idx);
return row == gtk_list_box_get_row_at_index (GTK_LIST_BOX (box), idx);
return gtk_list_box_row_is_selected (row);
}
static void atk_selection_interface_init (AtkSelectionIface *iface)
{
iface->add_selection = gtk_list_box_accessible_add_selection;
iface->remove_selection = gtk_list_box_accessible_remove_selection;
iface->clear_selection = gtk_list_box_accessible_clear_selection;
iface->ref_selection = gtk_list_box_accessible_ref_selection;
iface->get_selection_count = gtk_list_box_accessible_get_selection_count;
iface->is_child_selected = gtk_list_box_accessible_is_child_selected;
iface->select_all_selection = gtk_list_box_accessible_select_all;
}
void
+3 -2
View File
@@ -22,8 +22,9 @@
G_BEGIN_DECLS
void _gtk_list_box_accessible_update_cursor (GtkListBox *box, GtkListBoxRow *child);
void _gtk_list_box_accessible_selection_changed (GtkListBox *box);
void _gtk_list_box_accessible_update_cursor (GtkListBox *box,
GtkListBoxRow *row);
void _gtk_list_box_accessible_selection_changed (GtkListBox *box);
G_END_DECLS
+1 -1
View File
@@ -54,7 +54,7 @@ gtk_list_box_row_accessible_ref_state_set (AtkObject *obj)
gtk_list_box_get_selection_mode (GTK_LIST_BOX (parent)) != GTK_SELECTION_NONE)
atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
if (widget == (GtkWidget*)gtk_list_box_get_selected_row (GTK_LIST_BOX (parent)))
if (gtk_list_box_row_is_selected (GTK_LIST_BOX_ROW (widget)))
atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
}
+49
View File
@@ -142,6 +142,51 @@ gtk_paned_accessible_set_current_value (AtkValue *obj,
return FALSE;
}
static void
gtk_paned_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
GtkPaned *paned;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
paned = GTK_PANED (widget);
*value = gtk_paned_get_position (paned);
*text = NULL;
}
static AtkRange *
gtk_paned_accessible_get_range (AtkValue *obj)
{
GtkWidget *widget;
gint minimum_value;
gint maximum_value;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
g_object_get (widget,
"min-position", &minimum_value,
"max-position", &maximum_value,
NULL);
return atk_range_new (minimum_value, maximum_value, NULL);
}
static void
gtk_paned_accessible_set_value (AtkValue *obj,
const gdouble value)
{
GtkWidget *widget;
GtkPaned *paned;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
paned = GTK_PANED (widget);
gtk_paned_set_position (paned, (gint)(value + 0.5));
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
@@ -149,4 +194,8 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_maximum_value = gtk_paned_accessible_get_maximum_value;
iface->get_minimum_value = gtk_paned_accessible_get_minimum_value;
iface->set_current_value = gtk_paned_accessible_set_current_value;
iface->get_value_and_text = gtk_paned_accessible_get_value_and_text;
iface->get_range = gtk_paned_accessible_get_range;
iface->set_value = gtk_paned_accessible_set_value;
}
+22
View File
@@ -100,10 +100,32 @@ gtk_progress_bar_accessible_get_minimum_value (AtkValue *obj,
g_value_set_double (value, 0.0);
}
static void
gtk_progress_bar_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
*value = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (widget));
*text = NULL;
}
static AtkRange *
gtk_progress_bar_accessible_get_range (AtkValue *obj)
{
return atk_range_new (0.0, 1.0, NULL);
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
iface->get_current_value = gtk_progress_bar_accessible_get_current_value;
iface->get_maximum_value = gtk_progress_bar_accessible_get_maximum_value;
iface->get_minimum_value = gtk_progress_bar_accessible_get_minimum_value;
iface->get_value_and_text = gtk_progress_bar_accessible_get_value_and_text;
iface->get_range = gtk_progress_bar_accessible_get_range;
}
+73
View File
@@ -212,6 +212,74 @@ gtk_range_accessible_set_current_value (AtkValue *obj,
return TRUE;
}
static void
gtk_range_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
if (adjustment == NULL)
return;
*value = gtk_adjustment_get_value (adjustment);
*text = NULL;
}
static AtkRange *
gtk_range_accessible_get_range (AtkValue *obj)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
gdouble min, max;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
if (adjustment == NULL)
return NULL;
min = gtk_adjustment_get_lower (adjustment);
max = gtk_adjustment_get_upper (adjustment)
- gtk_adjustment_get_page_size (adjustment);
if (gtk_range_get_restrict_to_fill_level (GTK_RANGE (widget)))
max = MIN (max, gtk_range_get_fill_level (GTK_RANGE (widget)));
return atk_range_new (min, max, NULL);
}
static void
gtk_range_accessible_set_value (AtkValue *obj,
const gdouble value)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
if (adjustment == NULL)
return;
gtk_adjustment_set_value (adjustment, value);
}
static gdouble
gtk_range_accessible_get_increment (AtkValue *obj)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
if (adjustment == NULL)
return 0;
return gtk_adjustment_get_minimum_increment (adjustment);
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
@@ -220,4 +288,9 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_minimum_value = gtk_range_accessible_get_minimum_value;
iface->get_minimum_increment = gtk_range_accessible_get_minimum_increment;
iface->set_current_value = gtk_range_accessible_set_current_value;
iface->get_value_and_text = gtk_range_accessible_get_value_and_text;
iface->get_range = gtk_range_accessible_get_range;
iface->set_value = gtk_range_accessible_set_value;
iface->get_increment = gtk_range_accessible_get_increment;
}
+67
View File
@@ -270,6 +270,68 @@ gtk_scale_button_accessible_set_current_value (AtkValue *obj,
return TRUE;
}
static void
gtk_scale_button_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
if (adjustment == NULL)
return;
*value = gtk_adjustment_get_value (adjustment);
*text = NULL;
}
static AtkRange *
gtk_scale_button_accessible_get_range (AtkValue *obj)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
if (adjustment == NULL)
return NULL;
return atk_range_new (gtk_adjustment_get_lower (adjustment),
gtk_adjustment_get_upper (adjustment),
NULL);
}
static void
gtk_scale_button_accessible_set_value (AtkValue *obj,
const gdouble value)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
if (adjustment == NULL)
return;
gtk_adjustment_set_value (adjustment, value);
}
static gdouble
gtk_scale_button_accessible_get_increment (AtkValue *obj)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (widget));
if (adjustment == NULL)
return 0;
return gtk_adjustment_get_minimum_increment (adjustment);
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
@@ -278,4 +340,9 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_minimum_value = gtk_scale_button_accessible_get_minimum_value;
iface->get_minimum_increment = gtk_scale_button_accessible_get_minimum_increment;
iface->set_current_value = gtk_scale_button_accessible_set_current_value;
iface->get_value_and_text = gtk_scale_button_accessible_get_value_and_text;
iface->get_range = gtk_scale_button_accessible_get_range;
iface->set_value = gtk_scale_button_accessible_set_value;
iface->get_increment = gtk_scale_button_accessible_get_increment;
}
+67
View File
@@ -205,6 +205,68 @@ gtk_spin_button_accessible_set_current_value (AtkValue *obj,
return TRUE;
}
static void
gtk_spin_button_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
if (adjustment == NULL)
return;
*value = gtk_adjustment_get_value (adjustment);
*text = NULL;
}
static AtkRange *
gtk_spin_button_accessible_get_range (AtkValue *obj)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
if (adjustment == NULL)
return NULL;
return atk_range_new (gtk_adjustment_get_lower (adjustment),
gtk_adjustment_get_upper (adjustment),
NULL);
}
static void
gtk_spin_button_accessible_set_value (AtkValue *obj,
const gdouble value)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
if (adjustment == NULL)
return;
gtk_adjustment_set_value (adjustment, value);
}
static gdouble
gtk_spin_button_accessible_get_increment (AtkValue *obj)
{
GtkWidget *widget;
GtkAdjustment *adjustment;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
if (adjustment == NULL)
return 0;
return gtk_adjustment_get_minimum_increment (adjustment);
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
@@ -213,4 +275,9 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_minimum_value = gtk_spin_button_accessible_get_minimum_value;
iface->get_minimum_increment = gtk_spin_button_accessible_get_minimum_increment;
iface->set_current_value = gtk_spin_button_accessible_set_current_value;
iface->get_value_and_text = gtk_spin_button_accessible_get_value_and_text;
iface->get_range = gtk_spin_button_accessible_get_range;
iface->set_value = gtk_spin_button_accessible_set_value;
iface->get_increment = gtk_spin_button_accessible_get_increment;
}
-7
View File
@@ -1027,7 +1027,6 @@ gtk_tree_view_accessible_get_cell_area (GtkCellAccessibleParent *parent,
if (path)
{
GtkTreeViewColumn *expander_column;
gint focus_line_width;
gtk_tree_view_get_cell_area (tree_view, path, tv_col, cell_rect);
expander_column = gtk_tree_view_get_expander_column (tree_view);
@@ -1040,12 +1039,6 @@ gtk_tree_view_accessible_get_cell_area (GtkCellAccessibleParent *parent,
cell_rect->x += expander_size + EXTRA_EXPANDER_PADDING;
cell_rect->width -= expander_size + EXTRA_EXPANDER_PADDING;
}
gtk_widget_style_get (widget,
"focus-line-width", &focus_line_width,
NULL);
cell_rect->x += focus_line_width;
cell_rect->width -= 2 * focus_line_width;
gtk_tree_path_free (path);
+2 -1
View File
@@ -281,7 +281,7 @@ gtk_widget_accessible_ref_relation_set (AtkObject *obj)
GtkWidget *temp_widget;
temp_widget = gtk_widget_get_parent (widget);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (GTK_IS_ALIGNMENT (temp_widget))
{
temp_widget = gtk_widget_get_parent (temp_widget);
@@ -292,6 +292,7 @@ gtk_widget_accessible_ref_relation_set (AtkObject *obj)
label = find_label (gtk_widget_get_parent (temp_widget));
}
}
G_GNUC_END_IGNORE_DEPRECATIONS
}
else if (GTK_IS_COMBO_BOX (widget))
/*
@@ -52,6 +52,9 @@
#include "gtkintl.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struct _GtkAlignmentPrivate
{
gfloat xalign;
@@ -150,7 +153,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0.0,
1.0,
0.5,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class,
PROP_XSCALE,
g_param_spec_float("xscale",
@@ -159,7 +162,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0.0,
1.0,
1.0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class,
PROP_YSCALE,
g_param_spec_float("yscale",
@@ -168,7 +171,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0.0,
1.0,
1.0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
/**
@@ -186,7 +189,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
/**
* GtkAlignment:bottom-padding:
@@ -203,7 +206,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
/**
* GtkAlignment:left-padding:
@@ -220,7 +223,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
/**
* GtkAlignment:right-padding:
@@ -237,7 +240,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
}
static void
@@ -279,7 +282,9 @@ gtk_alignment_init (GtkAlignment *alignment)
*
* Creates a new #GtkAlignment.
*
* Returns: the new #GtkAlignment.
* Returns: the new #GtkAlignment
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties
*/
GtkWidget*
gtk_alignment_new (gfloat xalign,
@@ -438,6 +443,8 @@ gtk_alignment_get_property (GObject *object,
* unused space, from 0 to 1. The values are similar to @xscale.
*
* Sets the #GtkAlignment values.
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties
*/
void
gtk_alignment_set (GtkAlignment *alignment,
@@ -679,11 +686,8 @@ gtk_alignment_get_preferred_size (GtkWidget *widget,
natural += child_nat;
}
if (minimum_size)
*minimum_size = minimum;
if (natural_size)
*natural_size = natural;
*minimum_size = minimum;
*natural_size = natural;
}
static void
@@ -747,6 +751,8 @@ gtk_alignment_get_preferred_height_and_baseline_for_width (GtkWidget *
* padding on the left.
*
* Since: 2.4
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties
*/
void
gtk_alignment_set_padding (GtkAlignment *alignment,
@@ -811,6 +817,8 @@ gtk_alignment_set_padding (GtkAlignment *alignment,
* See gtk_alignment_set_padding ().
*
* Since: 2.4
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties
*/
void
gtk_alignment_get_padding (GtkAlignment *alignment,
@@ -73,28 +73,28 @@ struct _GtkAlignmentClass
};
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GType gtk_alignment_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GtkWidget* gtk_alignment_new (gfloat xalign,
gfloat yalign,
gfloat xscale,
gfloat yscale);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_alignment_set (GtkAlignment *alignment,
gfloat xalign,
gfloat yalign,
gfloat xscale,
gfloat yscale);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_alignment_set_padding (GtkAlignment *alignment,
guint padding_top,
guint padding_bottom,
guint padding_left,
guint padding_right);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_alignment_get_padding (GtkAlignment *alignment,
guint *padding_top,
guint *padding_bottom,
+27 -10
View File
@@ -40,6 +40,15 @@
*
* Arrows are created with a call to gtk_arrow_new(). The direction or
* style of an arrow can be changed after creation by using gtk_arrow_set().
*
* GtkArrow has been deprecated; you can simply use a #GtkImage with a
* suitable icon name, such as pan-down-symbolic. When replacing
* GtkArrow by an image, pay attention to the fact that GtkArrow is
* doing automatic flipping between #GTK_ARROW_LEFT and #GTK_ARROW_RIGHT,
* depending on the text direction. To get the same effect with an image,
* use the icon names pan-start-symbolic and pan-end-symbolic, which
* react to the text direction instead of pan-left-symbolic and
* pan-right-symbolic which don't.
*/
#include "config.h"
@@ -52,6 +61,8 @@
#include "a11y/gtkarrowaccessible.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
#define MIN_ARROW_SIZE 15
struct _GtkArrowPrivate
@@ -85,7 +96,9 @@ static void gtk_arrow_get_preferred_height (GtkWidget *widg
gint *minimum_size,
gint *natural_size);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_DEFINE_TYPE_WITH_PRIVATE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
G_GNUC_END_IGNORE_DEPRECATIONS
static void
gtk_arrow_class_init (GtkArrowClass *class)
@@ -199,13 +212,12 @@ gtk_arrow_get_preferred_width (GtkWidget *widget,
{
GtkBorder border;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
G_GNUC_END_IGNORE_DEPRECATIONS
if (minimum_size)
*minimum_size = MIN_ARROW_SIZE + border.left + border.right;
if (natural_size)
*natural_size = MIN_ARROW_SIZE + border.left + border.right;
*minimum_size = MIN_ARROW_SIZE + border.left + border.right;
*natural_size = MIN_ARROW_SIZE + border.left + border.right;
}
static void
@@ -215,13 +227,12 @@ gtk_arrow_get_preferred_height (GtkWidget *widget,
{
GtkBorder border;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
G_GNUC_END_IGNORE_DEPRECATIONS
if (minimum_size)
*minimum_size = MIN_ARROW_SIZE + border.top + border.bottom;
if (natural_size)
*natural_size = MIN_ARROW_SIZE + border.top + border.bottom;
*minimum_size = MIN_ARROW_SIZE + border.top + border.bottom;
*natural_size = MIN_ARROW_SIZE + border.top + border.bottom;
}
/**
@@ -232,6 +243,8 @@ gtk_arrow_get_preferred_height (GtkWidget *widget,
* Creates a new #GtkArrow widget.
*
* Returns: the new #GtkArrow widget.
*
* Deprecated: 3.14: Use a #GtkImage with a suitable icon.
*/
GtkWidget*
gtk_arrow_new (GtkArrowType arrow_type,
@@ -257,6 +270,8 @@ gtk_arrow_new (GtkArrowType arrow_type,
* @shadow_type: a valid #GtkShadowType.
*
* Sets the direction and style of the #GtkArrow, @arrow.
*
* Deprecated: 3.14: Use a #GtkImage with a suitable icon.
*/
void
gtk_arrow_set (GtkArrow *arrow,
@@ -317,8 +332,10 @@ gtk_arrow_draw (GtkWidget *widget,
context = gtk_widget_get_style_context (widget);
gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign);
G_GNUC_END_IGNORE_DEPRECATIONS
width = gtk_widget_get_allocated_width (widget) - border.left - border.right;
height = gtk_widget_get_allocated_height (widget) - border.top - border.bottom;
+4 -4
View File
@@ -30,7 +30,7 @@
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gtk/gtkmisc.h>
#include <gtk/deprecated/gtkmisc.h>
G_BEGIN_DECLS
@@ -67,12 +67,12 @@ struct _GtkArrowClass
};
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GType gtk_arrow_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GtkWidget* gtk_arrow_new (GtkArrowType arrow_type,
GtkShadowType shadow_type);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_arrow_set (GtkArrow *arrow,
GtkArrowType arrow_type,
GtkShadowType shadow_type);
+40 -6
View File
@@ -27,8 +27,12 @@
#include "gtkmisc.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkimage.h"
#include "gtklabel.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* SECTION:gtkmisc
* @Short_description: Base class for widgets with alignments and padding
@@ -47,10 +51,10 @@
*
* Note that the desired effect can in most cases be achieved by using the
* #GtkWidget:halign, #GtkWidget:valign and #GtkWidget:margin properties
* on the child widget, so GtkMisc should not be used in new code.
* on the child widget, so GtkMisc should not be used in new code. To reflect
* this fact, all #GtkMisc API has been deprecated.
*/
struct _GtkMiscPrivate
{
gfloat xalign;
@@ -103,7 +107,7 @@ gtk_misc_class_init (GtkMiscClass *class)
0.0,
1.0,
0.5,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class,
PROP_YALIGN,
@@ -113,7 +117,7 @@ gtk_misc_class_init (GtkMiscClass *class)
0.0,
1.0,
0.5,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class,
PROP_XPAD,
@@ -123,7 +127,7 @@ gtk_misc_class_init (GtkMiscClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class,
PROP_YPAD,
@@ -133,7 +137,7 @@ gtk_misc_class_init (GtkMiscClass *class)
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
}
static void
@@ -215,6 +219,8 @@ gtk_misc_get_property (GObject *object,
* @yalign: the vertical alignment, from 0 (top) to 1 (bottom).
*
* Sets the alignment of the widget.
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
*/
void
gtk_misc_set_alignment (GtkMisc *misc,
@@ -228,6 +234,28 @@ gtk_misc_set_alignment (GtkMisc *misc,
priv = misc->priv;
if (GTK_IS_LABEL (misc) || GTK_IS_IMAGE (misc))
{
GtkAlign halign, valign;
if (xalign < 0.4)
halign = GTK_ALIGN_START;
else if (xalign > 0.6)
halign = GTK_ALIGN_END;
else
halign = GTK_ALIGN_CENTER;
if (yalign < 0.4)
valign = GTK_ALIGN_START;
else if (yalign > 0.6)
valign = GTK_ALIGN_END;
else
valign = GTK_ALIGN_CENTER;
gtk_widget_set_halign (GTK_WIDGET (misc), halign);
gtk_widget_set_valign (GTK_WIDGET (misc), valign);
}
if (xalign < 0.0)
xalign = 0.0;
else if (xalign > 1.0)
@@ -268,6 +296,8 @@ gtk_misc_set_alignment (GtkMisc *misc,
*
* Gets the X and Y alignment of the widget within its allocation.
* See gtk_misc_set_alignment().
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
**/
void
gtk_misc_get_alignment (GtkMisc *misc,
@@ -295,6 +325,8 @@ gtk_misc_get_alignment (GtkMisc *misc,
* in pixels.
*
* Sets the amount of space to add around the widget.
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
*/
void
gtk_misc_set_padding (GtkMisc *misc,
@@ -341,6 +373,8 @@ gtk_misc_set_padding (GtkMisc *misc,
*
* Gets the padding in the X and Y directions of the widget.
* See gtk_misc_set_padding().
*
* Deprecated: 3.14: Use #GtkWidget alignment and margin properties.
**/
void
gtk_misc_get_padding (GtkMisc *misc,
+5 -5
View File
@@ -66,21 +66,21 @@ struct _GtkMiscClass
void (*_gtk_reserved4) (void);
};
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GType gtk_misc_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_misc_set_alignment (GtkMisc *misc,
gfloat xalign,
gfloat yalign);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_misc_get_alignment (GtkMisc *misc,
gfloat *xalign,
gfloat *yalign);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_misc_set_padding (GtkMisc *misc,
gint xpad,
gint ypad);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_misc_get_padding (GtkMisc *misc,
gint *xpad,
gint *ypad);
@@ -56,43 +56,43 @@ struct _GtkNumerableIconClass {
gpointer padding[16];
};
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GType gtk_numerable_icon_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GIcon * gtk_numerable_icon_new (GIcon *base_icon);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GIcon * gtk_numerable_icon_new_with_style_context (GIcon *base_icon,
GtkStyleContext *context);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GtkStyleContext * gtk_numerable_icon_get_style_context (GtkNumerableIcon *self);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_numerable_icon_set_style_context (GtkNumerableIcon *self,
GtkStyleContext *style);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
gint gtk_numerable_icon_get_count (GtkNumerableIcon *self);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_numerable_icon_set_count (GtkNumerableIcon *self,
gint count);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
const gchar * gtk_numerable_icon_get_label (GtkNumerableIcon *self);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_numerable_icon_set_label (GtkNumerableIcon *self,
const gchar *label);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_numerable_icon_set_background_gicon (GtkNumerableIcon *self,
GIcon *icon);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
GIcon * gtk_numerable_icon_get_background_gicon (GtkNumerableIcon *self);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_numerable_icon_set_background_icon_name (GtkNumerableIcon *self,
const gchar *icon_name);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
const gchar * gtk_numerable_icon_get_background_icon_name (GtkNumerableIcon *self);
G_END_DECLS

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