[atk: 1/2] atksocket: make get_extents return parent extents by default
- From: Samuel Thibault <sthibaul src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atk: 1/2] atksocket: make get_extents return parent extents by default
- Date: Tue, 20 Aug 2019 11:28:59 +0000 (UTC)
commit 4b5ed8630c5ae9ef37884c4199da8463b7e5a127
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date: Thu Aug 15 02:18:42 2019 +0200
atksocket: make get_extents return parent extents by default
The socket itself will usually just inherit the parent's extents, so this
makes a convenient good default.
As discussed on
https://mail.gnome.org/archives/gnome-accessibility-devel/2019-August/msg00001.html
atk/atksocket.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
---
diff --git a/atk/atksocket.c b/atk/atksocket.c
index c8e03f7..b6ca43d 100644
--- a/atk/atksocket.c
+++ b/atk/atksocket.c
@@ -56,6 +56,13 @@ static void atk_socket_finalize (GObject *obj);
static void atk_component_interface_init (AtkComponentIface *iface);
+static void atk_socket_component_real_get_extents (AtkComponent *component,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type);
+
G_DEFINE_TYPE_WITH_CODE (AtkSocket, atk_socket, ATK_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
@@ -94,6 +101,7 @@ atk_socket_finalize (GObject *_obj)
static void
atk_component_interface_init (AtkComponentIface *iface)
{
+ iface->get_extents = atk_socket_component_real_get_extents;
}
/**
@@ -162,3 +170,30 @@ atk_socket_is_occupied (AtkSocket* obj)
return (obj->embedded_plug_id != NULL);
}
+
+static void
+atk_socket_component_real_get_extents (AtkComponent *component,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type)
+{
+ AtkObject *parent = atk_object_get_parent (ATK_OBJECT (component));
+
+ if (parent == NULL || !ATK_IS_COMPONENT (parent))
+ {
+ if (x)
+ *x = -1;
+ if (y)
+ *y = -1;
+ if (width)
+ *width = -1;
+ if (height)
+ *height = -1;
+
+ return;
+ }
+
+ atk_component_get_extents (ATK_COMPONENT (parent), x, y, width, height, coord_type);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]