static void gail_window_get_size (AtkComponent *component, gint *width, gint *height) { GtkWidget *widget = GTK_ACCESSIBLE (component)->widget; GdkRectangle rect; if (widget == NULL) /* * State is defunct */ return; gail_return_if_fail (GTK_IS_WINDOW (widget)); if (!gtk_widget_is_toplevel (widget)) { AtkComponentIface *parent_iface; parent_iface = (AtkComponentIface *) g_type_interface_peek_parent (ATK_COMPONENT_GET_IFACE (component)); parent_iface->get_size (component, width, height); return; } gdk_window_get_frame_extents (widget->window, &rect); *width = rect.width; *height = rect.height; }
static DBusMessage * impl_Embedded (DBusConnection *bus, DBusMessage *message, void *user_data) { AtkObject *object = (AtkObject *) user_data; char *path; gchar *id; if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) { return droute_invalid_arguments_error (message); } id = g_strconcat (dbus_message_get_sender (message), ":", path, NULL); g_object_set_data_full (G_OBJECT (object), "dbus-plug-parent", id, (GDestroyNotify)g_free); if (ATK_IS_COMPONENT (object)) { AtkComponent *component = ATK_COMPONENT (object); AtkComponentIface *iface = ATK_COMPONENT_GET_IFACE (component); iface->get_extents = atspi_plug_component_get_extents; iface->get_size = atspi_plug_component_get_size; iface->get_position = atspi_plug_component_get_position; } /* Retrieve some info about the children, if they exist, when embedding the plug to ensure the a11y subtree is generated. https://bugzilla.gnome.org/show_bug.cgi?id=663876 */ atk_object_get_n_accessible_children (object); return dbus_message_new_method_return (message); }
JNIEXPORT jint JNICALL ATK_NATIVE(_1ATK_1COMPONENT_1GET_1IFACE) (JNIEnv *env, jclass that, jint arg0) { jint rc = 0; ATK_NATIVE_ENTER(env, that, _1ATK_1COMPONENT_1GET_1IFACE_FUNC); rc = (jint)ATK_COMPONENT_GET_IFACE(arg0); ATK_NATIVE_EXIT(env, that, _1ATK_1COMPONENT_1GET_1IFACE_FUNC); return rc; }
static void gail_window_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type) { GtkWidget *widget = GTK_ACCESSIBLE (component)->widget; GdkRectangle rect; gint x_toplevel, y_toplevel; if (widget == NULL) /* * State is defunct */ return; gail_return_if_fail (GTK_IS_WINDOW (widget)); if (!gtk_widget_is_toplevel (widget)) { AtkComponentIface *parent_iface; parent_iface = (AtkComponentIface *) g_type_interface_peek_parent (ATK_COMPONENT_GET_IFACE (component)); parent_iface->get_extents (component, x, y, width, height, coord_type); return; } gdk_window_get_frame_extents (widget->window, &rect); *width = rect.width; *height = rect.height; if (!gtk_widget_is_drawable (widget)) { *x = G_MININT; *y = G_MININT; return; } *x = rect.x; *y = rect.y; if (coord_type == ATK_XY_WINDOW) { gdk_window_get_origin (widget->window, &x_toplevel, &y_toplevel); *x -= x_toplevel; *y -= y_toplevel; } }