Compare commits

..

56 Commits

Author SHA1 Message Date
Chun-wei Fan 728339e1ce gtk/gtkfontchooserwidget.c: Include FreeType Headers properly
Like what was done in the master branch, we ought to include the
FreeType headers via the macros that are defined via including ft2build.h.
2019-01-07 12:13:17 +08:00
John Ralls 70b7b89411 [Quartz]Check mode before setting the monitor scale factor.
CGDisplayModeGetWidth returns 0 if mode is NULL; that happens if the
CGDisplay is offline or mirroring another monitor and it leads to a
divide-by-zero crash.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1565
2019-01-05 20:06:50 -08:00
Ryuta Fujii a8e07254d3 Update Japanese translation 2019-01-05 00:20:54 +00:00
Ryuta Fujii da54692ab7 Update Japanese translation 2019-01-04 23:52:50 +00:00
Emmanuele Bassi 69508b014d Merge branch 'wayland-key-theme-for-3-24' into 'gtk-3-24'
Wayland: Support key theme setting

See merge request GNOME/gtk!487
2019-01-04 16:19:09 +00:00
Matthias Clasen 3a1c5f7232 Wayland: Support key theme setting
GTK+ 3 has supported this all along, so we should support
it for Wayland as well, for feature parity.

Closes: #1553
2019-01-04 10:18:51 -05:00
Matthias Clasen 4eee51b0e5 Check for the session bus before using it
Patch by Chris Allen, #475
2019-01-02 20:38:18 -05:00
Matthias Clasen 06ffbb2a22 Merge branch 'wip/nbenitezl/move-bookmark-placeholder-index-3' into 'gtk-3-24'
gtkplacessidebar.c: move bookmark at the placeholder index

See merge request GNOME/gtk!458
2019-01-03 01:28:34 +00:00
Orivej Desh f6bc2415ab Zero-fill new GtkTextIter
iter_init_common() is used on uninitialized GtkTextIter, and since neither it
nor its callers initiliaze its padding fields, they contain garbage.

This is a problem for Go - which checks that structs passed to C functions do
not contain pointers to Go-allocated memory - when the garbage happens to be
such a pointer.  Although Go zero-fills all GtkTextIter that it allocates, this
does not help when GTK functions such as insert_pixbuf_or_widget_segment called
for gtk_text_buffer_create_child_anchor copy garbage from their stack-allocated
GtkTextIter into a clean iter.  To work around this a GtkTextIter has to be
discraded after use in text buffer anchor inserting functions:
https://github.com/gotk3/gotk3/pull/307
2019-01-02 20:05:10 -05:00
Matthias Clasen 5662f2e34f Fix XChangeProperty calls
They must be long...

Closes: #1556
2019-01-02 19:32:00 -05:00
Timm Bäder dea38f0222 Merge branch 'wip/carlosg/revealer-fix-interrupted-animations' into 'gtk-3-24'
revealer: Fully set the target state if unmapped during animation

See merge request GNOME/gtk!465
2019-01-02 08:50:36 +00:00
Daniel Boles 63e0eb5de5 Fix 'Fix "A11y: Add support for AtkTableCell"'...
...since one of the "fixes" there was wrong, at least cosmetically:
.get_position() is declared as returning a gboolean, which is in fact an
int in practice, but we should say what we mean, like we already did.
2018-12-30 18:11:50 +00:00
Chun-wei Fan c876c74eb7 Fix "A11y: Add support for AtkTableCell"
Make sure that the return types of the vfuncs match the ones that are
specified for post-atk-2.11.x AtkTableCellIface, since we already
require atk-2.15.1 and later.
2018-12-26 12:17:20 +08:00
Christoph Reiter cc329d36e0 Merge branch 'priority' into 'gtk-3-24'
Annotate values of PRIORITY constants

See merge request GNOME/gtk!472
2018-12-22 16:37:07 +00:00
Tomasz Miąsko d3b6d16d85 Annotate values of PRIORITY constants
g-ir-scanner incorrectly evaluates macro definition that include
references to other macro definitions. Provide a correct value as an
annotation.

Differences in generated gir files:

```diff
@@ -19017 +19017 @@
-    <constant name="PRIORITY_REDRAW" value="20" c:type="GDK_PRIORITY_REDRAW">
+    <constant name="PRIORITY_REDRAW" value="120" c:type="GDK_PRIORITY_REDRAW">
@@ -74229,3 +74229,3 @@
     </constant>
-    <constant name="PRIORITY_RESIZE" value="10" c:type="GTK_PRIORITY_RESIZE">
+    <constant name="PRIORITY_RESIZE" value="110" c:type="GTK_PRIORITY_RESIZE">
       <doc xml:space="preserve">Use this priority for functionality related to size allocation.
@@ -106786,3 +106786,3 @@
     <constant name="TEXT_VIEW_PRIORITY_VALIDATE"
-              value="5"
+              value="125"
               c:type="GTK_TEXT_VIEW_PRIORITY_VALIDATE">
```
2018-12-22 13:17:58 +01:00
Timm Bäder b69aae4ab3 Merge branch 'cherry-pick-5b049364' into 'gtk-3-24'
Merge branch 'fix-polygon-svg-recolor' into 'master'

See merge request GNOME/gtk!468
2018-12-22 09:10:49 +00:00
Christoph Reiter ea518ec2f5 Merge branch 'fix-typo-win32-compilation-speedup-macro' into 'gtk-3-24'
Win32: Fix typo on compilation speedup macro define

See merge request GNOME/gtk!470
2018-12-22 07:13:31 +00:00
Luca Bacci a9d7d41b59 Win32: Fix typo on compilation speedup macro define
There is a typo, the correct macro to define is WIN32_LEAN_AND_MEAN.
After this change <shellapi.h> must be included in order to use
ExtractIconExW().
2018-12-22 00:48:10 +01:00
Matthias Clasen b283b0b910 Merge branch 'fix-polygon-svg-recolor' into 'master'
icontheme: Recolor <polygon> elements in SVGs too

See merge request GNOME/gtk!443

(cherry picked from commit 5b049364dc)

284d9093 icontheme: Recolor <polygon> elements in SVGs too
2018-12-20 03:01:36 +00:00
Mike Gorse e9f527b328 A11y: Add support for AtkTableCell 2018-12-19 21:09:59 -05:00
Carlos Garnacho 32ad0ffa0f revealer: Fully set the target state if unmapped during animation
If the revealer is told do animate and then unrealize itself, we do
(correctly) stop the animation, but used to do a shortcut where we
just set the target state as current.

Other things are dependent on the animation properly finishing though,
like the contained widget child visibility. This may lead to inconsistent
state where gtk_revealer_get_child_revealed() returns TRUE but the child
widget is unmapped, or vice-versa.

Fully finish the animation here, so the child state is coherent the next
time the revealer is mapped. We can also skip notifying on the property
since it will be handled by gtk_revealer_set_position().

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/316
2018-12-19 19:37:42 +01:00
Benjamin Otte 55894c48a5 Merge branch 'wip/dboles/revealer-underallocates-gadgets-3' into 'gtk-3-24'
Revealer: Don't (under)allocate child if not shown (+bonus: actually put enough filler text in testrevealer)

See merge request GNOME/gtk!463
2018-12-18 22:21:37 +00:00
Daniel Boles d179b0667d Revealer: Don’t (under)allocate child if not shown
If the child is not (partly) revealed, don’t allocate it, or we spam the
console with warnings about giving negative width to children’s gadgets.
We can check :child-visible, which is FALSE if (current&target)_pos == 0

Close https://gitlab.gnome.org/GNOME/gtk/issues/1057
2018-12-18 21:00:08 +00:00
Daniel Boles ee5873be19 testrevealer: Make filler text actually big enough
…to do what it says it does, i.e. avoid the window expanding/shifting as
e.g. the leftmost entry is revealed.

noticed during https://gitlab.gnome.org/GNOME/gtk/issues/1057
2018-12-18 21:00:08 +00:00
Carlos Garnacho 33faf46516 Merge branch 'wip/wacom-tool-type-from-property-3.24' into 'gtk-3-24'
Wacom tool type fixes

See merge request GNOME/gtk!453
2018-12-18 20:09:40 +00:00
John Ralls 1c1a86d0fc Merge Ignacio Casal Quintero's quartz-scale-factor' into gtk-3-24. 2018-12-18 10:55:35 -08:00
Ignacio Casal Quinteiro 1a9377bab9 quartz/display: add back scaling factor
With the last patches one thing that got lost if the scaling
factor. This is very visible when i.e loading a svg image
in a Retina display.
2018-12-18 18:08:47 +01:00
John Ralls e105fefc49 Fix copy-paste error. 2018-12-18 09:07:15 -08:00
Peter Hutterer 7b33369bfb x11: make the tool lookup dependent on the hw id as well
Tools on the same physical item have the same serial number, so the eraser
and the pen part of a single pen share that serial number. With the current
lookup code, we'll always return whichever tool comes first into proximity.

Change the code to use the hw id in addition to the serial number, this way we
can differ between two tools.
2018-12-18 10:48:03 +10:00
Peter Hutterer c6dd92294d x11: don't add unknown tools to our list
Generic tools (Bamboo, built-in tablets) always have the same serial number
assigned by the wacom driver. This includes the touch tool when the wacom
driver handles the touch evdev node (common where users require the wacom
gestures to work).

When the first device is the touch device, a tool is created with that serial.
All future tools now return the touch tool on lookup since they all share the
same serial number. Worse, this happens *across* devices, so the pen
event node gets assigned the touch tool because they all have the same serial.

Since we don't actually care about the touch as a tool, let's skip any unknown
tool. This captures pads as well.
2018-12-18 10:48:02 +10:00
Peter Hutterer f173d1bc5c x11: get the tool type from the wacom driver properties
Any wacom device currently sets the tool type to UNKNOWN. The wacom driver has
a property that exports the tool type as one of stylus, eraser, cursor, pad or
touch. Only three of those are useful here but that's better than having all
of them as unknown.
2018-12-18 10:47:26 +10:00
Daniel Boles 3986326bbf RGBA: tiny grammar improvements in to_string doc 2018-12-17 20:16:42 +00:00
Daniel Boles be60ddbec9 RGBA: Consistently use “” around inline arg names
instead of being inconsistent and not using them later, which leaves a
bunch of single letters floating among real words, not the prettiest.
2018-12-17 20:16:42 +00:00
Daniel Boles 33a966952a RGBA: Fix example to_string output for reality/CSS
* We don't output spaces anywhere in the code, unlike the doc suggested.
* CSS explicitly forbids whitespace between function names and lparens:
  https://stackoverflow.com/questions/13877198
2018-12-17 20:16:42 +00:00
Nelson Benítez León f7eb7efeb5 gtkplacessidebar.c: move bookmark at the placeholder index
As that index is set in drag_motion_callback() and visually shown
on the widget as a drop target hint.

https://bugzilla.gnome.org/show_bug.cgi?id=787356
https://gitlab.gnome.org/GNOME/gtk/issues/904
2018-12-17 19:17:17 +00:00
LRN eb821cb89b Merge branch 'gtk-3-24.ime-event.fixes' into 'gtk-3-24'
gdkevents-win32.c: Use g_strdup() in gdk_settings_notify()

See merge request GNOME/gtk!447
2018-12-17 05:00:06 +00:00
Chun-wei Fan 013b9cbc1f gdkevents-win32.c: Fix GDK_SETTING event notification on IME change
We need to call g_strdup() on the name that we pass in for notifying the
GDK_SETTING event so that when we do gdk_event_free() later we will not
get a crash (stack corruption) that results from attempting to g_free()
something that is not dynamically allocated.
2018-12-17 12:43:24 +08:00
John Ralls aeec73f53f Refine GdkQuartzNSWindow convertPointToScreen:
and convertPointFromScreen:, making them handle all MacOS versions
so that all of the if-deffing happens in the function definitions.
This happens to fix issue 1518 because it turns out that contrary
to the annotation in the 10.14 nNSWindow.h, convertPointToScreen and
convertPointFromScreen originate in 10.14, not 10.12.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1518
2018-12-15 16:28:44 -08:00
John Ralls baa283b73b Don't make initializing return_val conditional.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1517
2018-12-15 16:28:44 -08:00
Daniel Boles 112645edf2 EventControllerKey: Add missing docs from master
These never got backported, meaning a pretty useless documentation page.

We still need to add other missing bits, but let's sync these up first.
2018-12-14 22:59:56 +00:00
Matthias Clasen 3e6fd50d96 Merge branch 'wip/carlosg/im-wayland-surrounding-limits' into 'gtk-3-24'
imwayland: Respect maximum length of 4000 Bytes on strings being sent.

See merge request GNOME/gtk!438
2018-12-14 20:09:18 +00:00
Matthias Clasen f879741e89 Merge branch 'imwayland_enable' into 'gtk-3-24'
imwayland: Handle enter and leave events

See merge request GNOME/gtk!369
2018-12-14 20:07:18 +00:00
Matthias Clasen 8b0fd8e148 Merge branch '1476-nautilus-does-not-enable-to-connect-to-an-nfs-share' into 'gtk-3-24'
Resolve "Nautilus does not enable to connect to an NFS share"

See merge request GNOME/gtk!427
2018-12-14 17:26:35 +00:00
Benjamin Otte 43aeb52b73 Merge branch 'wip/muktupavels/gtk-status-icon' into 'gtk-3-24'
statusicon: Create pixbuf at correct size

See merge request GNOME/gtk!451
2018-12-13 16:40:43 +00:00
Daniel Boles e3a1593a09 x11: Fix deprecation macro use
G_GNUC_END_IGNORE_DEPRECATIONS terminates the if statement and does not
consider the following block to be part of the if. So that block was
always taken irregardless of the pattern.

Fixes #1280
2018-12-13 17:22:22 +01:00
Timm Bäder 2a3c0ab841 Merge branch 'demo-combobox-typo-gtk3' into 'gtk-3-24'
demos/gtk-demo/combobox: fix typo

See merge request GNOME/gtk!446
2018-12-13 12:07:24 +00:00
Benjamin Otte 6a47e9a8b9 x11: Be a lot more careful about setting ParentRelative
We don't want to set ParentRelative when:

- the parent window is NULL
  In that case we are unsure about the depth, so better err on the side
  of caution and avoid a BadMatch by accepting ugly output.
- the cairo pattern is in an error status
  This should never happen - unless you start up in OOM - but better
  be safe than sorry.

Might help with the spurious crashes in #1280.
2018-12-13 05:28:54 +01:00
Daniel Boles 2905fc861a Revert "Fix deprecation warnings"
This reverts commit 5aedfe048b.

It had a typo that broke the build, only replaced half of the uses, and
replaced them with other functions that are also deprecated anyway.
2018-12-12 19:03:57 +00:00
Alberts Muktupāvels 31d896c5cf statusicon: Create pixbuf at correct size
Surface returned from gtk_icon_helper_load_surface can be smaller
then requested pixel size. This happens when icon is embedded in
panel that has bigger size then loaded pixbuf.
2018-12-12 19:55:20 +02:00
Jeremy Bicha f535443da6 demos/gtk-demo/combobox: fix typo
Fix typo that prevented the P-S submenu from displaying correctly

(cherry picked from commit 462193ae26)
2018-12-09 23:31:59 -05:00
Carlos Garnacho e416aebe5f imwayland: Respect maximum length of 4000 Bytes on strings being sent.
Hitting the limit will raise protocol errors.
2018-12-06 20:10:47 +01:00
António Fernandes bb3653ad7d placesview: List only available protocols as available
We display a list of supported protocols in the server_addresses_popover.

However, this curated list contains protocols which may or may not be
available, depending on the respective gvfs backend being installed.

So, populate the list only with protocols which are available.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-11-26 12:43:39 +00:00
António Fernandes 4bdf968702 placesview: Set .error style if unsupported protocol
When the user types an address with a schema that is not supported,
the Connect button doesn't become sensitive, but there is no visible
feedback at all.

This feels unresponsive and leaves the user clueless.

While it doesn't help explain why the address doesn't work, this will
provide a hint that the input was acknowledged but doesn't work.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-11-26 12:41:55 +00:00
Dorota Czaplejewicz 28ac1a2cba imwayland.c: fix formatting 2018-10-17 12:51:07 +00:00
Dorota Czaplejewicz 3d6510329f imwayland: rearrange functions to remove prototypes 2018-10-16 16:38:24 +00:00
Dorota Czaplejewicz c477201afc imwayland: Handle enter and leave events
Before this patch, imwayland would assume that text-input enter and leave events follow the general (wl_keyboard) focus, and was unable to handle the situation where they would not be provided at the same time.
2018-10-16 16:29:08 +00:00
37 changed files with 3481 additions and 1375 deletions
+2 -2
View File
@@ -144,7 +144,7 @@ create_capital_store (void)
{ NULL, "Jackson" },
{ NULL, "Jefferson City" },
{ NULL, "Juneau" },
{ "K - O" },
{ "K - O", NULL },
{ NULL, "Lansing" },
{ NULL, "Lincoln" },
{ NULL, "Little Rock" },
@@ -154,7 +154,7 @@ create_capital_store (void)
{ NULL, "Nashville" },
{ NULL, "Oklahoma City" },
{ NULL, "Olympia" },
{ NULL, "P - S" },
{ "P - S", NULL },
{ NULL, "Phoenix" },
{ NULL, "Pierre" },
{ NULL, "Providence" },
+2 -2
View File
@@ -170,10 +170,10 @@ take_window_shot (Window child,
y_orig = 0;
}
if (x_orig + width > gdk_screen_get_width (gdk_screen_get_dfeault ()))
if (x_orig + width > gdk_screen_width ())
width = gdk_screen_width () - x_orig;
if (y_orig + height > gdk_screen_get_height (gdk_screen_get_default ()))
if (y_orig + height > gdk_screen_height ())
height = gdk_screen_height () - y_orig;
tmp = gdk_pixbuf_get_from_window (window,
+1 -1
View File
@@ -62,7 +62,7 @@ G_BEGIN_DECLS
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
/**
* GDK_PRIORITY_REDRAW:
* GDK_PRIORITY_REDRAW: (value 120)
*
* This is the priority that the idle handler processing window updates
* is given in the
+8 -8
View File
@@ -149,7 +149,7 @@ parse_rgb_value (const gchar *str,
* - A RGBA color in the form “rgba(r,g,b,a)”
*
* Where “r”, “g”, “b” and “a” are respectively the red, green, blue and
* alpha color values. In the last two cases, r g and b are either integers
* alpha color values. In the last two cases, “r”, “g”, and “b” are either integers
* in the range 0 to 255 or percentage values in the range 0% to 100%, and
* a is a floating point value in the range 0 to 1.
*
@@ -333,18 +333,18 @@ gdk_rgba_equal (gconstpointer p1,
* @rgba: a #GdkRGBA
*
* Returns a textual specification of @rgba in the form
* `rgb (r, g, b)` or
* `rgba (r, g, b, a)`,
* `rgb(r,g,b)` or
* `rgba(r g,b,a)`,
* where “r”, “g”, “b” and “a” represent the red, green,
* blue and alpha values respectively. r, g, and b are
* represented as integers in the range 0 to 255, and a
* is represented as floating point value in the range 0 to 1.
* blue and alpha values respectively. “r”, “g”, and “b” are
* represented as integers in the range 0 to 255, and “a”
* is represented as a floating point value in the range 0 to 1.
*
* These string forms are string forms those supported by
* These string forms are string forms that are supported by
* the CSS3 colors module, and can be parsed by gdk_rgba_parse().
*
* Note that this string representation may lose some
* precision, since r, g and b are represented as 8-bit
* precision, since “r”, “g” and “b” are represented as 8-bit
* integers. If this is a concern, you should use a
* different representation.
*
+3 -2
View File
@@ -449,12 +449,13 @@ gdk_seat_tool_removed (GdkSeat *seat,
GdkDeviceTool *
gdk_seat_get_tool (GdkSeat *seat,
guint64 serial)
guint64 serial,
guint64 hw_id)
{
GdkSeatClass *seat_class;
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_tool (seat, serial);
return seat_class->get_tool (seat, serial, hw_id);
}
+4 -4
View File
@@ -275,7 +275,8 @@ gdk_seat_default_get_slaves (GdkSeat *seat,
static GdkDeviceTool *
gdk_seat_default_get_tool (GdkSeat *seat,
guint64 serial)
guint64 serial,
guint64 hw_id)
{
GdkSeatDefaultPrivate *priv;
GdkDeviceTool *tool;
@@ -290,7 +291,7 @@ gdk_seat_default_get_tool (GdkSeat *seat,
{
tool = g_ptr_array_index (priv->tools, i);
if (tool->serial == serial)
if (tool->serial == serial && tool->hw_id == hw_id)
return tool;
}
@@ -436,8 +437,7 @@ gdk_seat_default_remove_tool (GdkSeatDefault *seat,
priv = gdk_seat_default_get_instance_private (seat);
if (tool != gdk_seat_get_tool (GDK_SEAT (seat),
gdk_device_tool_get_serial (tool)))
if (tool != gdk_seat_get_tool (GDK_SEAT (seat), tool->serial, tool->hw_id))
return;
g_signal_emit_by_name (seat, "tool-removed", tool);
+4 -2
View File
@@ -57,7 +57,8 @@ struct _GdkSeatClass
GdkSeatCapabilities capabilities);
GdkDeviceTool * (* get_tool) (GdkSeat *seat,
guint64 serial);
guint64 serial,
guint64 tool_id);
};
void gdk_seat_device_added (GdkSeat *seat,
@@ -72,6 +73,7 @@ void gdk_seat_tool_removed (GdkSeat *seat,
GdkDeviceTool *
gdk_seat_get_tool (GdkSeat *seat,
guint64 serial);
guint64 serial,
guint64 hw_id);
#endif /* __GDK_SEAT_PRIVATE_H__ */
+35 -40
View File
@@ -379,22 +379,46 @@
initialPositionKnown = NO;
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
- (NSPoint)convertPointToScreen:(NSPoint)point
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectToScreen: inrect];
return (NSPoint)((CGRect)outrect).origin;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
{
return [super convertPointToScreen: point];
}
#endif
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectToScreen: inrect];
return (NSPoint)((CGRect)outrect).origin;
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
return [self convertBaseToScreen:point];
#endif
}
- (NSPoint)convertPointFromScreen:(NSPoint)point
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectFromScreen: inrect];
return (NSPoint)((CGRect)outrect).origin;
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
{
return [super convertPointFromScreen: point];
}
#endif
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
{
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
NSRect outrect = [self convertRectFromScreen: inrect];
return (NSPoint)((CGRect)outrect).origin;
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
return [self convertScreenToBase:point];
#endif
}
- (BOOL)trackManualMove
{
@@ -407,11 +431,8 @@
if (!inManualMove)
return NO;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
currentLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
#else
currentLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
#endif
newOrigin.x = currentLocation.x - initialMoveLocation.x;
newOrigin.y = currentLocation.y - initialMoveLocation.y;
@@ -442,11 +463,7 @@
inManualMove = YES;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
initialMoveLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
#else
initialMoveLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
#endif
initialMoveLocation.x -= frame.origin.x;
initialMoveLocation.y -= frame.origin.y;
}
@@ -462,12 +479,7 @@
return NO;
inTrackManualResize = YES;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
mouse_location = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
#else
mouse_location = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
#endif
mdx = initialResizeLocation.x - mouse_location.x;
mdy = initialResizeLocation.y - mouse_location.y;
@@ -552,12 +564,7 @@
resizeEdge = edge;
initialResizeFrame = [self frame];
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
initialResizeLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
#else
initialResizeLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
#endif
}
@@ -690,13 +697,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
{
NSPoint point = [sender draggingLocation];
NSPoint screen_point;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
screen_point = [self convertBaseToScreen:point];
#else
screen_point = [self convertPointToScreen:point];
#endif
NSPoint screen_point = [self convertPointToScreen:point];
GdkEvent *event;
int gx, gy;
@@ -724,13 +725,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPoint point = [sender draggingLocation];
NSPoint screen_point;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
screen_point = [self convertBaseToScreen:point];
#else
screen_point = [self convertPointToScreen:point];
#endif
NSPoint screen_point = [self convertPointToScreen:point];
GdkEvent *event;
int gy, gx;
-2
View File
@@ -53,10 +53,8 @@
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-(void)setStyleMask:(NSUInteger)styleMask;
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
- (NSPoint)convertPointToScreen:(NSPoint)point;
- (NSPoint)convertPointFromScreen:(NSPoint)point;
#endif
@end
+9 -2
View File
@@ -252,10 +252,17 @@ configure_monitor (GdkMonitor *monitor)
monitor->width_mm = width;
monitor->height_mm = height;
monitor->geometry = disp_geometry;
monitor->scale_factor = 1;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
if (mode && gdk_quartz_osx_version () >= GDK_OSX_MOUNTAIN_LION)
{
monitor->scale_factor = CGDisplayModeGetPixelWidth (mode) / CGDisplayModeGetWidth (mode);
CGDisplayModeRelease (mode);
}
else
#endif
monitor->scale_factor = 1;
monitor->refresh_rate = refresh_rate;
monitor->subpixel_layout = GDK_SUBPIXEL_LAYOUT_UNKNOWN;
CGDisplayModeRelease (mode);
}
static void
+4 -12
View File
@@ -379,12 +379,7 @@ get_window_point_from_screen_point (GdkWindow *window,
GdkQuartzNSWindow *nswindow;
nswindow = (GdkQuartzNSWindow*)(((GdkWindowImplQuartz *)window->impl)->toplevel);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
point = [nswindow convertScreenToBase:screen_point];
#else
point = [nswindow convertPointFromScreen:screen_point];
#endif
*x = point.x;
*y = window->height - point.y;
}
@@ -460,12 +455,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
}
else
{
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
*screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
#if MAC_OS_X_VERSION_MIN_REQUIRED < 10700
else
*screen_point = [[nsevent window] convertBaseToScreen:point];
#endif
*screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
*x = point.x;
*y = toplevel->height - point.y;
}
@@ -1551,8 +1541,10 @@ gdk_event_translate (GdkEvent *event,
grab = _gdk_display_get_last_device_grab (_gdk_display,
gdk_seat_get_pointer (seat));
}
return_val = TRUE;
}
return_val = TRUE;
switch (event_type)
{
case GDK_QUARTZ_LEFT_MOUSE_DOWN:
+1
View File
@@ -491,6 +491,7 @@ update_xft_settings (GdkScreen *screen)
static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.interface", "gtk-theme", "gtk-theme-name" , G_TYPE_STRING, { .s = "Adwaita" } },
{ FALSE, "org.gnome.desktop.interface", "gtk-key-theme", "gtk-key-theme-name" , G_TYPE_STRING, { .s = "Default" } },
{ FALSE, "org.gnome.desktop.interface", "icon-theme", "gtk-icon-theme-name", G_TYPE_STRING, { .s = "gnome" } },
{ FALSE, "org.gnome.desktop.interface", "cursor-theme", "gtk-cursor-theme-name", G_TYPE_STRING, { .s = "Adwaita" } },
{ FALSE, "org.gnome.desktop.interface", "cursor-size", "gtk-cursor-theme-size", G_TYPE_INT, { .i = 32 } },
+1 -1
View File
@@ -2256,7 +2256,7 @@ gdk_settings_notify (GdkWindow *window,
new_event->setting.window = window;
new_event->setting.send_event = FALSE;
new_event->setting.action = action;
new_event->setting.name = (char*) name;
new_event->setting.name = g_strdup (name);
_gdk_win32_append_event (new_event);
}
+86 -4
View File
@@ -38,6 +38,23 @@
#include <string.h>
static const char *wacom_type_atoms[] = {
"STYLUS",
"CURSOR",
"ERASER",
"PAD",
"TOUCH"
};
#define N_WACOM_TYPE_ATOMS G_N_ELEMENTS (wacom_type_atoms)
enum {
WACOM_TYPE_STYLUS,
WACOM_TYPE_CURSOR,
WACOM_TYPE_ERASER,
WACOM_TYPE_PAD,
WACOM_TYPE_TOUCH,
};
struct _GdkX11DeviceManagerXI2
{
GdkX11DeviceManagerCore parent_object;
@@ -1018,6 +1035,66 @@ device_get_tool_serial_and_id (GdkDevice *device,
return TRUE;
}
static GdkDeviceToolType
device_get_tool_type (GdkDevice *device)
{
GdkDisplay *display;
gulong nitems, bytes_after;
guint32 *data;
int rc, format;
Atom type;
Atom device_type;
Atom types[N_WACOM_TYPE_ATOMS];
GdkDeviceToolType tool_type = GDK_DEVICE_TOOL_TYPE_UNKNOWN;
display = gdk_device_get_display (device);
gdk_x11_display_error_trap_push (display);
rc = XIGetProperty (GDK_DISPLAY_XDISPLAY (display),
gdk_x11_device_get_id (device),
gdk_x11_get_xatom_by_name_for_display (display, "Wacom Tool Type"),
0, 1, False, XA_ATOM, &type, &format, &nitems, &bytes_after,
(guchar **) &data);
gdk_x11_display_error_trap_pop_ignored (display);
if (rc != Success)
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
if (type != XA_ATOM || format != 32 || nitems != 1)
{
XFree (data);
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
}
device_type = *data;
XFree (data);
if (device_type == 0)
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
gdk_x11_display_error_trap_push (display);
rc = XInternAtoms (GDK_DISPLAY_XDISPLAY (display),
(char **) wacom_type_atoms,
N_WACOM_TYPE_ATOMS,
False,
types);
gdk_x11_display_error_trap_pop_ignored (display);
if (rc == 0)
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
if (device_type == types[WACOM_TYPE_STYLUS])
tool_type = GDK_DEVICE_TOOL_TYPE_PEN;
else if (device_type == types[WACOM_TYPE_CURSOR])
tool_type = GDK_DEVICE_TOOL_TYPE_MOUSE;
else if (device_type == types[WACOM_TYPE_ERASER])
tool_type = GDK_DEVICE_TOOL_TYPE_ERASER;
else if (device_type == types[WACOM_TYPE_TOUCH])
tool_type = GDK_DEVICE_TOOL_TYPE_UNKNOWN;
return tool_type;
}
static void
handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
XIPropertyEvent *ev)
@@ -1038,13 +1115,18 @@ handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
device_get_tool_serial_and_id (device, &serial_id, &tool_id))
{
seat = gdk_device_get_seat (device);
tool = gdk_seat_get_tool (seat, serial_id);
tool = gdk_seat_get_tool (seat, serial_id, tool_id);
if (!tool && serial_id > 0)
{
tool = gdk_device_tool_new (serial_id, tool_id,
GDK_DEVICE_TOOL_TYPE_UNKNOWN, 0);
gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
GdkDeviceToolType tool_type;
tool_type = device_get_tool_type (device);
if (tool_type != GDK_DEVICE_TOOL_TYPE_UNKNOWN)
{
tool = gdk_device_tool_new (serial_id, tool_id, tool_type, 0);
gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
}
}
}
+1 -1
View File
@@ -1728,7 +1728,7 @@ _gdk_x11_display_open (const gchar *display_name)
if (!gdk_running_in_sandbox ())
{
/* if sandboxed, we're likely in a pid namespace and would only confuse the wm with this */
pid_t pid = getpid ();
long pid = getpid ();
XChangeProperty (display_x11->xdisplay,
display_x11->leader_window,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PID"),
+7 -3
View File
@@ -935,7 +935,7 @@ setup_toplevel_window (GdkWindow *window,
if (!gdk_running_in_sandbox ())
{
/* if sandboxed, we're likely in a pid namespace and would only confuse the wm with this */
pid_t pid = getpid ();
long pid = getpid ();
XChangeProperty (xdisplay, xid,
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_PID"),
XA_CARDINAL, 32,
@@ -2985,6 +2985,7 @@ gdk_window_x11_set_background (GdkWindow *window,
double r, g, b, a;
cairo_surface_t *surface;
cairo_matrix_t matrix;
cairo_pattern_t *parent_relative_pattern;
if (GDK_WINDOW_DESTROYED (window))
return;
@@ -2997,15 +2998,18 @@ gdk_window_x11_set_background (GdkWindow *window,
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (pattern == gdk_x11_get_parent_relative_pattern ())
parent_relative_pattern = gdk_x11_get_parent_relative_pattern ();
G_GNUC_END_IGNORE_DEPRECATIONS
if (pattern == parent_relative_pattern)
{
GdkWindow *parent;
/* X throws BadMatch if the parent has a different depth when
* using ParentRelative */
parent = gdk_window_get_parent (window);
if (parent == NULL || window->depth == parent->depth)
if (parent != NULL && window->depth == parent->depth &&
cairo_pattern_status (pattern) == CAIRO_STATUS_SUCCESS)
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), ParentRelative);
+87 -1
View File
@@ -46,11 +46,13 @@ static const struct {
static GtkCellRendererState gtk_cell_accessible_get_state (GtkCellAccessible *cell);
static void atk_action_interface_init (AtkActionIface *iface);
static void atk_component_interface_init (AtkComponentIface *iface);
static void atk_table_cell_interface_init (AtkTableCellIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkCellAccessible, gtk_cell_accessible, GTK_TYPE_ACCESSIBLE,
G_ADD_PRIVATE (GtkCellAccessible)
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE_CELL, atk_table_cell_interface_init))
static gint
gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
@@ -366,6 +368,90 @@ atk_component_interface_init (AtkComponentIface *iface)
iface->grab_focus = gtk_cell_accessible_grab_focus;
}
static int
gtk_cell_accessible_get_column_span (AtkTableCell *table_cell)
{
return 1;
}
static GPtrArray *
gtk_cell_accessible_get_column_header_cells (AtkTableCell *table_cell)
{
GtkCellAccessible *cell;
AtkObject *parent;
cell = GTK_CELL_ACCESSIBLE (table_cell);
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
return gtk_cell_accessible_parent_get_column_header_cells (GTK_CELL_ACCESSIBLE_PARENT (parent),
cell);
}
static gboolean
gtk_cell_accessible_get_position (AtkTableCell *table_cell,
gint *row,
gint *column)
{
GtkCellAccessible *cell;
AtkObject *parent;
cell = GTK_CELL_ACCESSIBLE (table_cell);
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
gtk_cell_accessible_parent_get_cell_position (GTK_CELL_ACCESSIBLE_PARENT (parent),
cell,
row, column);
return ((row && *row > 0) || (column && *column > 0));
}
static int
gtk_cell_accessible_get_row_span (AtkTableCell *table_cell)
{
return 1;
}
static GPtrArray *
gtk_cell_accessible_get_row_header_cells (AtkTableCell *table_cell)
{
GtkCellAccessible *cell;
AtkObject *parent;
cell = GTK_CELL_ACCESSIBLE (table_cell);
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
return gtk_cell_accessible_parent_get_row_header_cells (GTK_CELL_ACCESSIBLE_PARENT (parent),
cell);
}
static AtkObject *
gtk_cell_accessible_get_table (AtkTableCell *table_cell)
{
AtkObject *obj;
obj = ATK_OBJECT (table_cell);
do
{
AtkRole role;
obj = atk_object_get_parent (obj);
role = atk_object_get_role (obj);
if (role == ATK_ROLE_TABLE || role == ATK_ROLE_TREE_TABLE)
break;
}
while (obj);
return obj;
}
static void
atk_table_cell_interface_init (AtkTableCellIface *iface)
{
iface->get_column_span = gtk_cell_accessible_get_column_span;
iface->get_column_header_cells = gtk_cell_accessible_get_column_header_cells;
iface->get_position = gtk_cell_accessible_get_position;
iface->get_row_span = gtk_cell_accessible_get_row_span;
iface->get_row_header_cells = gtk_cell_accessible_get_row_header_cells;
iface->get_table = gtk_cell_accessible_get_table;
}
static GtkCellRendererState
gtk_cell_accessible_get_state (GtkCellAccessible *cell)
{
+66
View File
@@ -187,3 +187,69 @@ gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
if (iface->update_relationset)
(iface->update_relationset) (parent, cell, relationset);
}
void
gtk_cell_accessible_parent_get_cell_position (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *row,
gint *column)
{
GtkCellAccessibleParentIface *iface;
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_cell_position)
(iface->get_cell_position) (parent, cell, row, column);
else
{
if (row)
*row = -1;
if (column)
*column = -1;
}
}
/**
* gtk_cell_accessible_parent_get_column_header_cells:
* Returns: (transfer full) (element-type AtkObject)
*/
GPtrArray *
gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), NULL);
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), NULL);
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_column_header_cells)
return (iface->get_column_header_cells) (parent, cell);
else
return NULL;
}
/**
* gtk_cell_accessible_parent_get_row_header_cells:
* Returns: (transfer full) (element-type AtkObject)
*/
GPtrArray *
gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkCellAccessibleParentIface *iface;
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), NULL);
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), NULL);
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
if (iface->get_row_header_cells)
return (iface->get_row_header_cells) (parent, cell);
else
return NULL;
}
+19
View File
@@ -75,6 +75,14 @@ struct _GtkCellAccessibleParentIface
void ( *update_relationset) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
AtkRelationSet *relationset);
void ( *get_cell_position) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *row,
gint *column);
GPtrArray * ( *get_column_header_cells) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GPtrArray * ( *get_row_header_cells) (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
};
GDK_AVAILABLE_IN_ALL
@@ -115,6 +123,17 @@ GDK_AVAILABLE_IN_3_12
void gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
AtkRelationSet *relationset);
GDK_AVAILABLE_IN_ALL
void gtk_cell_accessible_parent_get_cell_position(GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *row,
gint *column);
GPtrArray *gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
GPtrArray *gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell);
G_END_DECLS
+52
View File
@@ -1391,6 +1391,56 @@ gtk_tree_view_accessible_update_relationset (GtkCellAccessibleParent *parent,
}
}
static void
gtk_tree_view_accessible_get_cell_position (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell,
gint *row,
gint *column)
{
GtkWidget *widget;
GtkTreeView *tree_view;
GtkTreeViewAccessibleCellInfo *cell_info;
GtkTreeViewAccessible *accessible;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
if (widget == NULL)
return;
tree_view = GTK_TREE_VIEW (widget);
accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
cell_info = find_cell_info (accessible, cell);
if (!cell_info)
return;
if (row)
(*row) = _gtk_rbtree_node_get_index (cell_info->tree, cell_info->node);
if (column)
(*column) = get_column_number (tree_view, cell_info->cell_col_ref);
}
static GPtrArray *
gtk_tree_view_accessible_get_column_header_cells (GtkCellAccessibleParent *parent,
GtkCellAccessible *cell)
{
GtkWidget *widget;
GtkTreeViewAccessibleCellInfo *cell_info;
GtkTreeViewAccessible *accessible;
GPtrArray *array;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
if (widget == NULL)
return NULL;
accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
cell_info = find_cell_info (accessible, cell);
if (!cell_info)
return NULL;
array = g_ptr_array_new_full (1, g_object_unref);
g_ptr_array_add (array, g_object_ref (get_header_from_column ( (cell_info->cell_col_ref))));
return array;
}
static void
gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface)
{
@@ -1403,6 +1453,8 @@ gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface)
iface->activate = gtk_tree_view_accessible_activate;
iface->edit = gtk_tree_view_accessible_edit;
iface->update_relationset = gtk_tree_view_accessible_update_relationset;
iface->get_cell_position = gtk_tree_view_accessible_get_cell_position;
iface->get_column_header_cells = gtk_tree_view_accessible_get_column_header_cells;
}
void
+3 -1
View File
@@ -1420,7 +1420,9 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
surface = gtk_icon_helper_load_surface (icon_helper, 1);
if (surface)
{
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, round_size, round_size);
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0,
cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface));
cairo_surface_destroy (surface);
}
else
+1 -1
View File
@@ -421,7 +421,7 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
"gtk-shell-shows-menubar", FALSE,
NULL);
if (dbus->sm_proxy == NULL)
if (dbus->sm_proxy == NULL && dbus->session)
{
dbus->inhibit_proxy = gtk_application_get_proxy_if_service_present (dbus->session,
G_DBUS_PROXY_FLAGS_NONE,
+37
View File
@@ -17,6 +17,18 @@
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
/**
* SECTION:gtkeventcontrollerkey
* @Short_description: Event controller for key events
* @Title: GtkEventControllerKey
* @See_also: #GtkEventController
*
* #GtkEventControllerKey is an event controller meant for situations
* where you need access to key events.
*
* This object was added in 3.24.
**/
#include "config.h"
#include "gtkintl.h"
@@ -153,12 +165,37 @@ gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
object_class->finalize = gtk_event_controller_finalize;
controller_class->handle_event = gtk_event_controller_key_handle_event;
/**
* GtkEventControllerKey::key-pressed:
* @controller: the object which received the signal.
* @keyval: the pressed key.
* @keycode: the raw code of the pressed key.
* @state: the bitmask, representing the state of modifier keys and pointer buttons. See #GdkModifierType.
*
* This signal is emitted whenever a key is pressed.
*
* Returns: %TRUE if the key press was handled, %FALSE otherwise.
*
* Since: 3.24
*/
signals[KEY_PRESSED] =
g_signal_new (I_("key-pressed"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, _gtk_boolean_handled_accumulator, NULL, NULL,
G_TYPE_BOOLEAN, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
/**
* GtkEventControllerKey::key-released:
* @controller: the object which received the signal.
* @keyval: the released key.
* @keycode: the raw code of the released key.
* @state: the bitmask, representing the state of modifier keys and pointer buttons. See #GdkModifierType.
*
* This signal is emitted whenever a key is released.
*
* Since: 3.24
*/
signals[KEY_RELEASED] =
g_signal_new (I_("key-released"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
+5 -2
View File
@@ -58,8 +58,11 @@
#include <hb.h>
#include <hb-ot.h>
#include <hb-ft.h>
#include <freetype/freetype.h>
#include <freetype/ftmm.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_MULTIPLE_MASTERS_H
#include "language-names.h"
#include "script-names.h"
#endif
+3 -2
View File
@@ -32,8 +32,9 @@
#ifndef S_ISDIR
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
#endif
#define WIN32_MEAN_AND_LEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shellapi.h>
#include "win32/gdkwin32.h"
#endif /* G_OS_WIN32 */
@@ -4568,7 +4569,7 @@ gtk_icon_info_load_symbolic_svg (GtkIconInfo *icon_info,
" width=\"", width, "\"\n"
" height=\"", height, "\">\n"
" <style type=\"text/css\">\n"
" rect,path,ellipse,circle {\n"
" rect,path,ellipse,circle,polygon {\n"
" fill: ", css_fg," !important;\n"
" }\n"
" .warning {\n"
+1 -1
View File
@@ -40,7 +40,7 @@
G_BEGIN_DECLS
/**
* GTK_PRIORITY_RESIZE:
* GTK_PRIORITY_RESIZE: (value 110)
*
* Use this priority for functionality related to size allocation.
*
+3
View File
@@ -2084,6 +2084,9 @@ drag_data_received_callback (GtkWidget *list_box,
source_row = (void*) gtk_selection_data_get_data (selection_data);
if (sidebar->row_placeholder != NULL)
g_object_get (sidebar->row_placeholder, "order-index", &target_order_index, NULL);
reorder_bookmarks (sidebar, GTK_SIDEBAR_ROW (*source_row), target_order_index);
success = TRUE;
}
+59
View File
@@ -72,6 +72,7 @@ struct _GtkPlacesViewPrivate
GtkWidget *recent_servers_stack;
GtkWidget *stack;
GtkWidget *server_adresses_popover;
GtkWidget *available_protocols_grid;
GtkWidget *network_placeholder;
GtkWidget *network_placeholder_label;
@@ -1605,6 +1606,54 @@ unmount_cb (GtkMenuItem *item,
unmount_mount (GTK_PLACES_VIEW (view), mount);
}
static void
attach_protocol_row_to_grid (GtkGrid *grid,
const gchar *protocol_name,
const gchar *protocol_prefix)
{
GtkWidget *name_label;
GtkWidget *prefix_label;
name_label = gtk_label_new (protocol_name);
gtk_widget_set_halign (name_label, GTK_ALIGN_START);
gtk_grid_attach_next_to (grid, name_label, NULL, GTK_POS_BOTTOM, 1, 1);
prefix_label = gtk_label_new (protocol_prefix);
gtk_widget_set_halign (prefix_label, GTK_ALIGN_START);
gtk_grid_attach_next_to (grid, prefix_label, name_label, GTK_POS_RIGHT, 1, 1);
}
static void
populate_available_protocols_grid (GtkGrid *grid)
{
const gchar* const *supported_protocols;
supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
if (g_strv_contains (supported_protocols, "afp"))
attach_protocol_row_to_grid (grid, _("AppleTalk"), "afp://");
if (g_strv_contains (supported_protocols, "ftp"))
/* Translators: do not translate ftp:// and ftps:// */
attach_protocol_row_to_grid (grid, _("File Transfer Protocol"), _("ftp:// or ftps://"));
if (g_strv_contains (supported_protocols, "nfs"))
attach_protocol_row_to_grid (grid, _("Network File System"), "nfs://");
if (g_strv_contains (supported_protocols, "smb"))
attach_protocol_row_to_grid (grid, _("Samba"), "smb://");
if (g_strv_contains (supported_protocols, "ssh"))
/* Translators: do not translate sftp:// and ssh:// */
attach_protocol_row_to_grid (grid, _("SSH File Transfer Protocol"), _("sftp:// or ssh://"));
if (g_strv_contains (supported_protocols, "dav"))
/* Translators: do not translate dav:// and davs:// */
attach_protocol_row_to_grid (grid, _("WebDAV"), _("dav:// or davs://"));
gtk_widget_show_all (GTK_WIDGET (grid));
}
/* Constructs the popup menu if needed */
static void
build_popup_menu (GtkPlacesView *view,
@@ -1855,6 +1904,13 @@ on_address_entry_text_changed (GtkPlacesView *view)
out:
gtk_widget_set_sensitive (priv->connect_button, supported);
if (scheme && !supported)
gtk_style_context_add_class (gtk_widget_get_style_context (priv->address_entry),
GTK_STYLE_CLASS_ERROR);
else
gtk_style_context_remove_class (gtk_widget_get_style_context (priv->address_entry),
GTK_STYLE_CLASS_ERROR);
g_free (address);
g_free (scheme);
}
@@ -2302,6 +2358,7 @@ gtk_places_view_class_init (GtkPlacesViewClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, recent_servers_stack);
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, stack);
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, server_adresses_popover);
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, available_protocols_grid);
gtk_widget_class_bind_template_callback (widget_class, on_address_entry_text_changed);
gtk_widget_class_bind_template_callback (widget_class, on_address_entry_show_help_pressed);
@@ -2326,6 +2383,8 @@ gtk_places_view_init (GtkPlacesView *self)
priv->space_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
gtk_widget_init_template (GTK_WIDGET (self));
populate_available_protocols_grid (GTK_GRID (priv->available_protocols_grid));
}
/**
+5 -6
View File
@@ -449,7 +449,7 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
GtkAllocation child_allocation;
GtkWidget *child;
gboolean window_visible;
gboolean child_visible, window_visible;
int bin_x, bin_y;
GtkRevealerTransitionType transition;
GtkBorder padding;
@@ -460,7 +460,9 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
gtk_revealer_get_child_allocation (revealer, allocation, &child_allocation);
child = gtk_bin_get_child (GTK_BIN (revealer));
if (child != NULL && gtk_widget_get_visible (child))
child_visible = child != NULL && gtk_widget_get_visible (child) &&
gtk_widget_get_child_visible (child);
if (child_visible)
gtk_widget_size_allocate (child, &child_allocation);
if (gtk_widget_get_realized (widget))
@@ -633,10 +635,7 @@ gtk_revealer_stop_animation (GtkRevealer *revealer)
{
GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
if (priv->current_pos != priv->target_pos)
{
priv->current_pos = priv->target_pos;
g_object_notify_by_pspec (G_OBJECT (revealer), props[PROP_CHILD_REVEALED]);
}
gtk_revealer_set_position (revealer, priv->target_pos);
if (priv->tick_id != 0)
{
gtk_widget_remove_tick_callback (GTK_WIDGET (revealer), priv->tick_id);
+2
View File
@@ -246,6 +246,8 @@ iter_init_common (GtkTextIter *_iter,
g_return_val_if_fail (iter != NULL, NULL);
g_return_val_if_fail (tree != NULL, NULL);
memset (iter, 0, sizeof (GtkTextRealIter));
iter->tree = tree;
iter->chars_changed_stamp =
+1 -1
View File
@@ -103,7 +103,7 @@ typedef enum
} GtkTextExtendSelection;
/**
* GTK_TEXT_VIEW_PRIORITY_VALIDATE:
* GTK_TEXT_VIEW_PRIORITY_VALIDATE: (value 125)
*
* The priority at which the text view validates onscreen lines
* in an idle job in the background.
+1 -133
View File
@@ -65,7 +65,7 @@
</packing>
</child>
<child>
<object class="GtkGrid">
<object class="GtkGrid" id="available_protocols_grid">
<property name="visible">1</property>
<property name="margin-top">12</property>
<property name="hexpand">1</property>
@@ -86,72 +86,6 @@
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">AppleTalk</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">File Transfer Protocol</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">Network File System</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">Samba</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">SSH File Transfer Protocol</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">WebDAV</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
@@ -166,72 +100,6 @@
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label">afp://</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes" comments="Translators: do not translate ftp:// and ftps://">ftp:// or ftps://</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label">nfs://</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">smb://</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes" comments="Translators: do not translate sftp:// and ssh://">sftp:// or ssh://</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes" comments="Translators: do not translate dav:// and davs://">dav:// or davs://</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
</object>
<packing>
<property name="position">3</property>
+189 -106
View File
@@ -42,6 +42,10 @@ struct _GtkIMContextWaylandGlobal
GtkIMContext *current;
/* The input-method.enter event may happen before or after GTK focus-in,
* so the context may not exist at the time. Same for leave and focus-out. */
gboolean focused;
guint serial;
};
@@ -128,18 +132,6 @@ notify_external_change (GtkIMContextWayland *context)
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
}
static void
text_input_enter (void *data,
struct zwp_text_input_v3 *text_input,
struct wl_surface *surface)
{}
static void
text_input_leave (void *data,
struct zwp_text_input_v3 *text_input,
struct wl_surface *surface)
{}
static void
text_input_preedit (void *data,
struct zwp_text_input_v3 *text_input,
@@ -274,74 +266,14 @@ text_input_done (void *data,
text_input_preedit_apply(global);
}
static const struct zwp_text_input_v3_listener text_input_listener = {
text_input_enter,
text_input_leave,
text_input_preedit,
text_input_commit,
text_input_delete_surrounding_text,
text_input_done,
};
static void
registry_handle_global (void *data,
struct wl_registry *registry,
uint32_t id,
const char *interface,
uint32_t version)
{
GtkIMContextWaylandGlobal *global = data;
GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
if (strcmp (interface, "zwp_text_input_manager_v3") == 0)
{
global->text_input_manager_wl_id = id;
global->text_input_manager =
wl_registry_bind (global->registry, global->text_input_manager_wl_id,
&zwp_text_input_manager_v3_interface, 1);
global->text_input =
zwp_text_input_manager_v3_get_text_input (global->text_input_manager,
gdk_wayland_seat_get_wl_seat (seat));
global->serial = 0;
zwp_text_input_v3_add_listener (global->text_input,
&text_input_listener, global);
}
}
static void
registry_handle_global_remove (void *data,
struct wl_registry *registry,
uint32_t id)
{
GtkIMContextWaylandGlobal *global = data;
if (id != global->text_input_manager_wl_id)
return;
g_clear_pointer(&global->text_input, zwp_text_input_v3_destroy);
g_clear_pointer(&global->text_input_manager, zwp_text_input_manager_v3_destroy);
}
static const struct wl_registry_listener registry_listener = {
registry_handle_global,
registry_handle_global_remove
};
static void
gtk_im_context_wayland_global_init (GdkDisplay *display)
{
g_return_if_fail (global == NULL);
global = g_new0 (GtkIMContextWaylandGlobal, 1);
global->display = gdk_wayland_display_get_wl_display (display);
global->registry = wl_display_get_registry (global->display);
wl_registry_add_listener (global->registry, &registry_listener, global);
}
static void
notify_surrounding_text (GtkIMContextWayland *context)
{
#define MAX_LEN 4000
const gchar *start, *end;
int len, cursor, anchor;
char *str = NULL;
if (!global || !global->text_input)
return;
if (global->current != GTK_IM_CONTEXT (context))
@@ -349,12 +281,67 @@ notify_surrounding_text (GtkIMContextWayland *context)
if (!context->surrounding.text)
return;
len = strlen (context->surrounding.text);
cursor = context->surrounding.cursor_idx;
anchor = context->surrounding.anchor_idx;
/* The protocol specifies a maximum length of 4KiB on transfers,
* mangle the surrounding text if it's bigger than that, and relocate
* cursor/anchor locations as per the string being sent.
*/
if (len > MAX_LEN)
{
if (context->surrounding.cursor_idx < MAX_LEN &&
context->surrounding.anchor_idx < MAX_LEN)
{
start = context->surrounding.text;
end = &context->surrounding.text[MAX_LEN];
}
else if (context->surrounding.cursor_idx > len - MAX_LEN &&
context->surrounding.cursor_idx > len - MAX_LEN)
{
start = &context->surrounding.text[len - MAX_LEN];
end = &context->surrounding.text[len];
}
else
{
int mid, a, b;
int cursor_len = ABS (context->surrounding.cursor_idx -
context->surrounding.anchor_idx);
if (cursor_len > MAX_LEN)
{
g_warn_if_reached ();
return;
}
mid = MIN (context->surrounding.cursor_idx,
context->surrounding.cursor_idx) + (cursor_len / 2);
a = MAX (0, mid - (MAX_LEN / 2));
b = MIN (MAX_LEN, mid + (MAX_LEN / 2));
start = &context->surrounding.text[a];
end = &context->surrounding.text[b];
}
if (start != context->surrounding.text)
start = g_utf8_next_char (start);
if (end != &context->surrounding.text[len])
end = g_utf8_find_prev_char (context->surrounding.text, end);
cursor -= start - context->surrounding.text;
anchor -= start - context->surrounding.text;
str = g_strndup (start, end - start);
}
zwp_text_input_v3_set_surrounding_text (global->text_input,
context->surrounding.text,
context->surrounding.cursor_idx,
context->surrounding.anchor_idx);
str ? str : context->surrounding.text,
cursor, anchor);
zwp_text_input_v3_set_text_change_cause (global->text_input,
context->surrounding_change);
g_free (str);
#undef MAX_LEN
}
static void
@@ -466,12 +453,6 @@ commit_state (GtkIMContextWayland *context)
context->surrounding_change = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
}
static void
enable_text_input (GtkIMContextWayland *context)
{
zwp_text_input_v3_enable (global->text_input);
}
static void
gtk_im_context_wayland_finalize (GObject *object)
{
@@ -516,14 +497,15 @@ released_cb (GtkGestureMultiPress *gesture,
g_object_get (context, "input-hints", &hints, NULL);
if (n_press == 1 &&
if (global->focused &&
n_press == 1 &&
(hints & GTK_INPUT_HINT_INHIBIT_OSK) == 0 &&
!gtk_drag_check_threshold (context->widget,
context->press_x,
context->press_y,
x, y))
{
enable_text_input (GTK_IM_CONTEXT_WAYLAND (context));
zwp_text_input_v3_enable (global->text_input);
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
commit_state (context);
}
@@ -627,18 +609,10 @@ gtk_im_context_wayland_filter_keypress (GtkIMContext *context,
}
static void
gtk_im_context_wayland_focus_in (GtkIMContext *context)
enable (GtkIMContextWayland *context_wayland)
{
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
gboolean result;
if (global->current == context)
return;
if (!global->text_input)
return;
global->current = context;
enable_text_input (context_wayland);
zwp_text_input_v3_enable (global->text_input);
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
notify_content_type (context_wayland);
notify_cursor_location (context_wayland);
@@ -646,15 +620,8 @@ gtk_im_context_wayland_focus_in (GtkIMContext *context)
}
static void
gtk_im_context_wayland_focus_out (GtkIMContext *context)
disable (GtkIMContextWayland *context_wayland)
{
GtkIMContextWayland *context_wayland;
if (global->current != context)
return;
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
zwp_text_input_v3_disable (global->text_input);
commit_state (context_wayland);
@@ -664,6 +631,122 @@ gtk_im_context_wayland_focus_out (GtkIMContext *context)
text_input_preedit (global, global->text_input, NULL, 0, 0);
text_input_preedit_apply (global);
}
}
static void
text_input_enter (void *data,
struct zwp_text_input_v3 *text_input,
struct wl_surface *surface)
{
global->focused = TRUE;
if (global->current)
enable (GTK_IM_CONTEXT_WAYLAND (global->current));
}
static void
text_input_leave (void *data,
struct zwp_text_input_v3 *text_input,
struct wl_surface *surface)
{
global->focused = FALSE;
if (global->current)
disable (GTK_IM_CONTEXT_WAYLAND (global->current));
}
static const struct zwp_text_input_v3_listener text_input_listener = {
text_input_enter,
text_input_leave,
text_input_preedit,
text_input_commit,
text_input_delete_surrounding_text,
text_input_done,
};
static void
registry_handle_global (void *data,
struct wl_registry *registry,
uint32_t id,
const char *interface,
uint32_t version)
{
GtkIMContextWaylandGlobal *global = data;
GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
if (strcmp (interface, "zwp_text_input_manager_v3") == 0)
{
global->text_input_manager_wl_id = id;
global->text_input_manager =
wl_registry_bind (global->registry, global->text_input_manager_wl_id,
&zwp_text_input_manager_v3_interface, 1);
global->text_input =
zwp_text_input_manager_v3_get_text_input (global->text_input_manager,
gdk_wayland_seat_get_wl_seat (seat));
global->serial = 0;
zwp_text_input_v3_add_listener (global->text_input,
&text_input_listener, global);
}
}
static void
registry_handle_global_remove (void *data,
struct wl_registry *registry,
uint32_t id)
{
GtkIMContextWaylandGlobal *global = data;
if (id != global->text_input_manager_wl_id)
return;
g_clear_pointer (&global->text_input, zwp_text_input_v3_destroy);
g_clear_pointer (&global->text_input_manager, zwp_text_input_manager_v3_destroy);
}
static const struct wl_registry_listener registry_listener = {
registry_handle_global,
registry_handle_global_remove
};
static void
gtk_im_context_wayland_global_init (GdkDisplay *display)
{
g_return_if_fail (global == NULL);
global = g_new0 (GtkIMContextWaylandGlobal, 1);
global->display = gdk_wayland_display_get_wl_display (display);
global->registry = wl_display_get_registry (global->display);
wl_registry_add_listener (global->registry, &registry_listener, global);
}
static void
gtk_im_context_wayland_focus_in (GtkIMContext *context)
{
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
if (global->current == context)
return;
if (!global->text_input)
return;
global->current = context;
if (global->focused)
enable (context_wayland);
}
static void
gtk_im_context_wayland_focus_out (GtkIMContext *context)
{
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
if (global->current != context)
return;
if (global->focused)
disable (context_wayland);
global->current = NULL;
}
+2675 -1033
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -14,14 +14,14 @@ main (gint argc,
box = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (window), box);
widget = gtk_label_new ("Some filler text to avoid\nresizing of the window");
widget = gtk_label_new ("Some filler text just to avoid\nresizing of the window");
gtk_widget_set_margin_top (widget, 10);
gtk_widget_set_margin_bottom (widget, 10);
gtk_widget_set_margin_start (widget, 10);
gtk_widget_set_margin_end (widget, 10);
gtk_grid_attach (GTK_GRID (box), widget, 1, 1, 1, 1);
widget = gtk_label_new ("Some filler text to avoid\nresizing of the window");
widget = gtk_label_new ("Some filler text just to avoid\nresizing of the window");
gtk_widget_set_margin_top (widget, 10);
gtk_widget_set_margin_bottom (widget, 10);
gtk_widget_set_margin_start (widget, 10);
+51
View File
@@ -622,6 +622,54 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
}
static void
dump_atk_table_cell (AtkTableCell *table_cell,
guint depth,
GString *string)
{
gint i;
AtkObject *obj;
GPtrArray *cells;
gint row = -1, column = -1;
g_string_append_printf (string, "%*s<AtkTableCell>\n", depth, "");
obj = atk_table_cell_get_table (table_cell);
if (obj)
g_string_append_printf (string, "%*stable: %s\n", depth, "", get_name (obj));
cells = atk_table_cell_get_column_header_cells (table_cell);
if (cells)
{
for (i = 0; i < cells->len; i++)
{
obj = g_ptr_array_index (cells, i);
if (obj)
g_string_append_printf (string, "%*scolumn-header[%d]: %s\n", depth, "", i, get_name (obj));
}
g_ptr_array_free (cells, TRUE);
}
cells = atk_table_cell_get_row_header_cells (table_cell);
if (cells)
{
for (i = 0; i < cells->len; i++)
{
obj = g_ptr_array_index (cells, i);
if (obj)
g_string_append_printf (string, "%*srow-header[%d]: %s\n", depth, "", i, get_name (obj));
}
g_ptr_array_free (cells, TRUE);
}
g_string_append_printf (string, "%*scolumn-span: %d\n", depth, "", atk_table_cell_get_column_span (table_cell));
g_string_append_printf (string, "%*srow-span: %d\n", depth, "", atk_table_cell_get_row_span (table_cell));
if (atk_table_cell_get_position (table_cell, &row, &column))
{
g_string_append_printf (string, "%*sposition: %d %d\n", depth, "", row, column);
}
}
static void
dump_accessible (AtkObject *accessible,
guint depth,
@@ -675,6 +723,9 @@ dump_accessible (AtkObject *accessible,
if (ATK_IS_TABLE (accessible))
dump_atk_table (ATK_TABLE (accessible), depth, string);
if (ATK_IS_TABLE_CELL (accessible))
dump_atk_table_cell (ATK_TABLE_CELL (accessible), depth, string);
for (i = 0; i < atk_object_get_n_accessible_children (accessible); i++)
{
AtkObject *child = atk_object_ref_accessible_child (accessible, i);
+51
View File
@@ -59,6 +59,11 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
tv
"table cell"
parent: tv
@@ -103,6 +108,11 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
tv
"table cell"
parent: tv
@@ -147,6 +157,11 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
tv
"table cell"
parent: tv
@@ -162,6 +177,12 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
position: 1 0
tv
"table cell"
parent: tv
@@ -206,6 +227,12 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
position: 1 0
tv
"table cell"
parent: tv
@@ -250,6 +277,12 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
position: 1 0
tv
"table cell"
parent: tv
@@ -265,6 +298,12 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
position: 2 0
tv
"table cell"
parent: tv
@@ -309,6 +348,12 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
position: 2 0
tv
"table cell"
parent: tv
@@ -353,3 +398,9 @@ window1
action 1 description: Creates a widget in which the contents of the cell can be edited
action 2 name: activate
action 2 description: Activates the cell
<AtkTableCell>
table: tv
column-header[0]: unnamed-GtkButtonAccessible-0
column-span: 1
row-span: 1
position: 2 0