}
static void
-atspi_accessible_finalize (AtspiAccessible *accessible)
+atspi_accessible_finalize (GObject *obj)
{
+ AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
+
if (accessible->app)
g_object_unref (accessible->app);
atspi_accessible_get_attributes_as_array (AtspiAccessible *obj, GError **error)
{
DBusMessage *message;
- GHashTable *ret;
+ GArray *ret;
g_return_val_if_fail (obj != NULL, NULL);
atspi_accessible_get_component (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_component) ?
- accessible : NULL);
+ ATSPI_COMPONENT (accessible) : NULL);
}
#if 0
AtspiEvent e;
/* TODO: Only fire if object not already marked defunct */
- memset (&e, 0, sizeof(e));
e.type = "object:state-change:defunct";
e.source = accessible;
e.detail1 = 1;
+ e.detail2 = 0;
+ g_value_unset (&e.any);
_atspi_send_event (&e);
g_free (accessible->path);
}
static void
-atspi_application_finalize (AtspiApplication *application)
+atspi_application_finalize (GObject *obj)
{
+ AtspiApplication *application = ATSPI_APPLICATION (obj);
+
if (application->bus_name)
g_free (application->bus_name);
}
#include "atspi-accessible.h"
#define ATSPI_TYPE_APPLICATION (atspi_application_get_type ())
-#define ATSPI_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_APPLICATION, AtspiAccessible))
+#define ATSPI_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_APPLICATION, AtspiApplication))
#define ATSPI_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_APPLICATION, AtspiAccessibleClass))
#define ATSPI_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_APPLICATION))
#define ATSPI_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_APPLICATION))
#include "atspi-private.h"
+static AtspiRect *
+atspi_rect_copy (AtspiRect *src)
+{
+ AtspiRect *dst = g_new (AtspiRect, 1);
+ dst->x = src->x;
+ dst->y = src->y;
+ dst->height = src->height;
+ dst->width = src->width;
+}
+
+G_DEFINE_BOXED_TYPE (AtspiRect, atspi_rect, atspi_rect_copy, g_free)
+
+static AtspiPoint *
+atspi_point_copy (AtspiPoint *src)
+{
+ AtspiPoint *dst = g_new (AtspiPoint, 1);
+ dst->x = src->x;
+ dst->y = src->y;
+}
+
+G_DEFINE_BOXED_TYPE (AtspiPoint, atspi_point, atspi_point_copy, g_free)
+
/**
* atspi_component_contains:
* @obj: a pointer to the #AtspiComponent to query.
}
static void
-atspi_component_base_init (AtspiComponentIface *klass)
+atspi_component_base_init (AtspiComponent *klass)
{
static gboolean initialized = FALSE;
if (!type) {
static const GTypeInfo tinfo =
{
- sizeof (AtspiComponentIface),
+ sizeof (AtspiComponent),
(GBaseInitFunc) atspi_component_base_init,
(GBaseFinalizeFunc) NULL,
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2002 Ximian, Inc.
+ * 2002 Sun Microsystems Inc.
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _ATSPI_COMPONENT_H_
+#define _ATSPI_COMPONENT_H_
+
+#include "glib-object.h"
+
+#include "atspi-accessible.h"
+#include "atspi-constants.h"
+
+typedef struct _AtspiRect AtspiRect;
+struct _AtspiRect
+{
+ gint x;
+ gint y;
+ gint width;
+ gint height;
+};
+
+/**
+ * ATSPI_TYPE_RECT:
+ *
+ * The #GType for a boxed type holding a #AtspiRect.
+ */
+#define ATSPI_TYPE_RECT (atspi_rect_get_type ())
+
+typedef struct _AtspiPoint AtspiPoint;
+struct _AtspiPoint
+{
+ gint x;
+ gint y;
+};
+
+/**
+ * ATSPI_TYPE_POINT:
+ *
+ * The #GType for a boxed type holding a #AtspiPoint.
+ */
+#define ATSPI_TYPE_POINT (atspi_point_get_type ())
+
+#define ATSPI_TYPE_COMPONENT (atspi_component_get_type ())
+#define ATSPI_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_COMPONENT)
+#define ATSPI_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_COMPONENT, AtspiComponent)
+#define ATSPI_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATSPI_TYPE_COMPONENT, AtspiComponent))
+
+GType atspi_component_get_type ();
+
+struct _AtspiComponent
+{
+ GTypeInterface parent;
+ gboolean (*contains) (AtspiComponent *component, gint x, gint y, AtspiCoordType ctype, GError **error);
+ AtspiAccessible *(*ref_accessible_at_point) (AtspiComponent *component, gint x, gint y, AtspiCoordType ctype, GError **error);
+ AtspiRect (*get_extents) (AtspiComponent *component, gint *x, gint *y, gint *width, gint *height, AtspiCoordType ctype, GError **error);
+ AtspiPoint (*get_position) (AtspiComponent *component, AtspiCoordType ctype, GError **error);
+ AtspiPoint (*get_size) (AtspiComponent *component, GError **error);
+ AtspiComponentLayer (*get_layer) (AtspiComponent *component, GError **error);
+
+ gshort (*get_mdi_z_order) (AtspiComponent *component, GError **error);
+ gboolean (*grab_focus) (AtspiComponent *component, GError **error);
+ gdouble (*get_alpha) (AtspiComponent *component, GError **error);
+};
+
+gboolean atspi_component_contains (AtspiComponent *obj, gint x, gint y, AtspiCoordType ctype, GError **error);
+
+AtspiAccessible *atspi_component_ref_accessible_at_point (AtspiComponent *obj, gint x, gint y, AtspiCoordType ctype, GError **error);
+
+AtspiRect atspi_component_get_extents (AtspiComponent *obj, gint *x, gint *y, gint *width, gint *height, AtspiCoordType ctype, GError **error);
+
+AtspiPoint atspi_component_get_position (AtspiComponent *obj, AtspiCoordType ctype, GError **error);
+
+AtspiPoint atspi_component_get_size (AtspiComponent *obj, GError **error);
+
+AtspiComponentLayer atspi_component_get_layer (AtspiComponent *obj, GError **error);
+
+gshort atspi_component_get_mdi_z_order (AtspiComponent *obj, GError **error);
+
+gboolean atspi_component_grab_focus (AtspiComponent *obj, GError **error);
+
+gdouble atspi_component_get_alpha (AtspiComponent *obj, GError **error);
+#endif /* _ATSPI_COMPONENT_H_ */
} AtspiLocaleType;
/**
- * NUM_ATSPI_LOCALE_TYPES:
+ * ATSPI_LOCALE_TYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiLocaleType.
*/
-#define NUM_ATSPI_LOCALE_TYPES (5+1)
+#define ATSPI_LOCALE_TYPE _COUNT(5+1)
/**
*
} AtspiCoordType;
/**
- * NUM_ATSPI_COORD_TYPES:
+ * ATSPI_COORD_TYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiCoordType.
*/
-#define NUM_ATSPI_COORD_TYPES (1+1)
+#define ATSPI_COORD_TYPE_COUNT (1+1)
/**
*
} AtspiCollectionSortOrder;
/**
- * NUM_ATSPI_SORTORDERS:
+ * ATSPI_SORTORDER_COUNT:
*
* 1 higher than the highest valid value of #AtspiCollectionSortOrder.
*/
-#define NUM_ATSPI_SORTORDERS (7+1)
+#define ATSPI_SORTORDER_COUNT (7+1)
/**
*
} AtspiCollectionMatchType;
/**
- * NUM_ATSPI_MATCHTYPES:
+ * ATSPI_MATCHTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiCollection_MatchType.
*/
-#define NUM_ATSPI_MATCHTYPES (5+1)
+#define ATSPI_MATCHTYPES_COUNT (5+1)
/**
*
} AtspiCollectionTreeTraversalType;
/**
- * NUM_ATSPI_TREETRAVERSALTYPES:
+ * ATSPI_TREETRAVERSALTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiCollection_TreeTraversalType.
*/
-#define NUM_ATSPI_TREETRAVERSALTYPES (3+1)
+#define ATSPI_TREETRAVERSALTYPE _COUNT(3+1)
/**
*
} AtspiComponentLayer;
/**
- * NUM_ATSPI_COMPONENTLAYERS:
+ * ATSPI_COMPONENTLAYER:_COUNT
*
* 1 higher than the highest valid value of #AtspiComponentLayer.
*/
-#define NUM_ATSPI_COMPONENTLAYERS (8+1)
+#define ATSPI_COMPONENTLAYER_COUNT (8+1)
/**
*
} AtspiTextBoundaryType;
/**
- * NUM_ATSPI_TEXT_BOUNDARY_TYPES:
+ * ATSPI_TEXT_BOUNDARY_TYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiTextBOundaryType.
*/
-#define NUM_ATSPI_TEXT_BOUNDARY_TYPES (6+1)
+#define ATSPI_TEXT_BOUNDARY_TYPE_COUNT (6+1)
/**
*
} AtspiTextClipType;
/**
- * NUM_ATSPI_TEXT_CLIP_TYPES:
+ * ATSPI_TEXT_CLIP_TYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiTextClipType.
*/
-#define NUM_ATSPI_TEXT_CLIP_TYPES (3+1)
+#define ATSPI_TEXT_CLIP_TYPE_COUNT (3+1)
/**
*
} AtspiStateType;
/**
- * NUM_ATSPI_STATETYPES:
+ * ATSPI_STATETYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiStateType.
*/
-#define NUM_ATSPI_STATETYPES (41+1)
+#define ATSPI_STATETYPE_COUNT (41+1)
/**
*
} AtspiKeyEventType;
/**
- * NUM_ATSPI_KEYEVENTTYPES:
+ * ATSPI_KEYEVENTTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiKeyEventType.
*/
-#define NUM_ATSPI_KEYEVENTTYPES (1+1)
+#define ATSPI_KEYEVENTTYPE_COUNT (1+1)
/**
*
} AtspiEventType;
/**
- * NUM_ATSPI_EVENTTYPES:
+ * ATSPI_EVENTTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiEventType.
*/
-#define NUM_ATSPI_EVENTTYPES (3+1)
+#define ATSPI_EVENTTYPE_COUNT (3+1)
/**
*
} AtspiKeySynthType;
/**
- * NUM_ATSPI_KEYSYNTHTYPES:
+ * ATSPI_KEYSYNTHTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiKeySynthType.
*/
-#define NUM_ATSPI_KEYSYNTHTYPES (4+1)
+#define ATSPI_KEYSYNTHTYPE_COUNT (4+1)
/**
*
} AtspimodifierType;
/**
- * NUM_ATSPI_MODIFIERTYPES:
+ * ATSPI_MODIFIERTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiModifierType.
*/
-#define NUM_ATSPI_MODIFIERTYPES (7+1)
+#define ATSPI_MODIFIERTYPE_COUNT (7+1)
/**
*
} AtspiRelationType;
/**
- * NUM_ATSPI_RELATIONTYPES:
+ * ATSPI_RELATIONTYPE_COUNT:
*
* 1 higher than the highest valid value of #AtspiRelationType.
*/
-#define NUM_ATSPI_RELATIONTYPES (19+1)
+#define ATSPI_RELATIONTYPE_COUNT (19+1)
/**
*
} AtspiRole;
/**
- * NUM_ATSPI_ROLES:
+ * ATSPI_ROLE_COUNT:
*
* 1 higher than the highest valid value of #AtspiRole.
*/
-#define NUM_ATSPI_ROLES (90+1)
+#define ATSPI_ROLE_COUNT (90+1)
#ifdef __cplusplus
{
AtspiEventListenerCB callback;
void *user_data;
+ GDestroyNotify callback_destroyed;
char *category;
char *name;
char *detail;
static void
cache_process_children_changed (AtspiEvent *event)
{
- if (event->v_type != EVENT_DATA_OBJECT ||
+ AtspiAccessible *child;
+
+ if (!G_VALUE_HOLDS (&event->any, ATSPI_TYPE_ACCESSIBLE) ||
!event->source->children ||
atspi_state_set_contains (event->source->states, ATSPI_STATE_MANAGES_DESCENDANTS))
return;
+ child = g_value_get_object (&event->any);
+
if (!strncmp (event->type, "object:children-changed:add", 27))
{
- GList *new_list = g_list_insert (event->source->children, g_object_ref (event->v.accessible), event->detail1);
+ GList *new_list = g_list_insert (event->source->children, g_object_ref (child), event->detail1);
if (new_list)
event->source->children = new_list;
}
- else if (g_list_find (event->source->children, event->v.accessible))
+ else if (g_list_find (event->source->children, child))
{
- event->source->children = g_list_remove (event->source->children, event->v.accessible);
+ event->source->children = g_list_remove (event->source->children, child);
}
}
{
if (event->source->accessible_parent)
g_object_unref (event->source->accessible_parent);
- if (event->v_type == EVENT_DATA_OBJECT)
+ if (G_VALUE_HOLDS (&event->any, ATSPI_TYPE_ACCESSIBLE))
{
- event->source->accessible_parent = g_object_ref (event->v.accessible);
+ event->source->accessible_parent = g_value_dup_object (&event->any);
event->source->cached_properties |= ATSPI_CACHE_PARENT;
}
else
{
if (event->source->name)
g_free (event->source->name);
- if (event->v_type == EVENT_DATA_STRING)
+ if (G_VALUE_HOLDS_STRING (&event->any))
{
- event->source->name = g_strdup (event->v.text);
+ event->source->name = g_value_dup_string (&event->any);
event->source->cached_properties |= ATSPI_CACHE_NAME;
}
else
{
if (event->source->description)
g_free (event->source->description);
- if (event->v_type == EVENT_DATA_STRING)
+ if (G_VALUE_HOLDS_STRING (&event->any))
{
- event->source->description = g_strdup (event->v.text);
+ event->source->description = g_value_dup_string (&event->any);
event->source->cached_properties |= ATSPI_CACHE_DESCRIPTION;
}
else
g_free (e->category);
g_free (e->name);
if (e->detail) g_free (e->detail);
+ if (e->callback_destroyed)
+ (*e->callback_destroyed) (e->callback);
g_free (e);
}
/**
* atspi_event_listener_register:
- * @callback: (scope call): the #AtspiEventListenerCB to be registered against
+ * @callback: (scope notified): the #AtspiEventListenerCB to be registered against
* an event type.
* @user_data: (closure): User data to be passed to the callback.
+ * @callback_freed: A #GDestroyNotify called when the callback is destroyed.
* @event_type: a character string indicating the type of events for which
* notification is requested. Format is
* EventClass:major_type:minor_type:detail
gboolean
atspi_event_listener_register (AtspiEventListenerCB callback,
void *user_data,
+ GDestroyNotify callback_destroyed,
const gchar *event_type)
{
EventListenerEntry *e;
if (!e) return FALSE;
e->callback = callback;
e->user_data = user_data;
+ e->callback_destroyed = callback_destroyed;
if (!convert_event_type_to_dbus (event_type, &e->category, &e->name, &e->detail, &matchrule))
{
g_free (e);
return TRUE;
}
+void
+remove_datum (const AtspiEvent *event, void *user_data)
+{
+ AtspiEventListenerSimpleCB cb = user_data;
+ cb (event);
+}
+
+/**
+ * atspi_event_listener_register_no_data:
+ * @callback: (scope notified): the #AtspiEventListenerSimpleCB to be
+ * registered against an event type.
+ * @callback_freed: A #GDestroyNotify called when the callback is destroyed.
+ * @event_type: a character string indicating the type of events for which
+ * notification is requested. Format is
+ * EventClass:major_type:minor_type:detail
+ * where all subfields other than EventClass are optional.
+ * EventClasses include "object", "window", "mouse",
+ * and toolkit events (e.g. "Gtk", "AWT").
+ * Examples: "focus:", "Gtk:GtkWidget:button_press_event".
+ *
+ * Like atspi_event_listener_register, but callback takes no user_data.
+ **/
+gboolean
+atspi_event_listener_register_no_data (AtspiEventListenerSimpleCB callback,
+ GDestroyNotify callback_destroyed,
+ const gchar *event_type)
+{
+ return atspi_event_listener_register (remove_datum, callback, callback_destroyed, event_type);
+}
+
static gboolean
is_superset (const gchar *super, const gchar *sub)
{
return TRUE;
}
+/**
+ * atspi_event_listener_deregister_no_data:
+ * @callback: (scope call): the #AtspiEventListenerSimpleCB registered against
+ * an event type.
+ * @event_type: a string specifying the event type for which this
+ * listener is to be deregistered.
+ *
+ * deregisters an #AtspiEventListenerSimpleCB from the registry, for a specific
+ * event type.
+ *
+ * Returns: #TRUE if successful, otherwise #FALSE.
+ **/
+gboolean
+atspi_event_listener_deregister_no_data (AtspiEventListenerSimpleCB callback,
+ const gchar *event_type)
+{
+ return atspi_event_listener_deregister (remove_datum, callback, event_type);
+}
+
void
_atspi_send_event (AtspiEvent *e)
{
{
case DBUS_TYPE_STRUCT:
{
- if (demarshal_rect (&iter_variant, &e.v.rect))
+ AtspiRect rect;
+ if (demarshal_rect (&iter_variant, &rect))
{
- e.v_type = EVENT_DATA_RECT;
+ g_value_init (&e.any, ATSPI_TYPE_RECT);
+ g_value_set_instance (&e.any, &rect);
}
else
{
- e.v_type = EVENT_DATA_OBJECT;
- e.v.accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant);
+ AtspiAccessible *accessible;
+ accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant);
+ g_value_init (&e.any, ATSPI_TYPE_ACCESSIBLE);
+ g_value_set_instance (&e.any, accessible);
}
break;
}
case DBUS_TYPE_STRING:
{
dbus_message_iter_get_basic (&iter_variant, &p);
- e.v_type = EVENT_DATA_STRING;
- e.v.text = g_strdup (p);
+ g_value_set_string (&e.any, p);
break;
}
default:
g_free (name);
g_free (detail);
g_object_unref (e.source);
- if (e.v_type == EVENT_DATA_OBJECT)
- g_object_unref (e.v.accessible);
+ g_value_unset (&e.any);
return DBUS_HANDLER_RESULT_HANDLED;
}
+static AtspiEvent *
+atspi_event_copy (AtspiEvent *src)
+{
+ AtspiEvent *dst = g_new0 (AtspiEvent, 1);
+ dst->type = g_strdup (src->type);
+ dst->detail1 = src->detail1;
+ dst->detail2 = src->detail2;
+ g_value_copy (&dst->any, &src->any);
+}
+
+static void
+atspi_event_free (AtspiEvent *event)
+{
+ g_object_unref (event->source);
+ g_free (event->type);
+ g_value_unset (&event->any);
+ g_free (event);
+}
+
+G_DEFINE_BOXED_TYPE (AtspiEvent, atspi_event, atspi_event_copy, atspi_event_free)
typedef void (*AtspiEventListenerCB) (const AtspiEvent *event,
void *user_data);
+/**
+ * AtspiEventListenerSimpleCB:
+ * @event: The event for which notification is sent.
+ *
+ * Like #AtspiEventlistenerCB, but with no user_data.
+ *
+ **/
+typedef void (*AtspiEventListenerSimpleCB) (const AtspiEvent *event);
+
gboolean
atspi_event_listener_register (AtspiEventListenerCB callback,
void *user_data,
+ GDestroyNotify callback_destroyed,
+ const gchar *event_type);
+
+gboolean
+atspi_event_listener_register_no_data (AtspiEventListenerSimpleCB callback,
+ GDestroyNotify callback_destroyed,
const gchar *event_type);
gboolean
atspi_event_listener_deregister (AtspiEventListenerCB callback,
void *user_data,
const gchar *event_type);
+
+gboolean
+atspi_event_listener_deregister_no_data (AtspiEventListenerSimpleCB callback,
+ const gchar *event_type);
#endif /* _ATSPI_EVENT_LISTENER_H_ */
gint unused;
};
-typedef enum
-{
- EVENT_DATA_STRING,
- EVENT_DATA_OBJECT,
- EVENT_DATA_RECT
-} EVENT_DATA_TYPE;
-
typedef struct _AtspiEvent AtspiEvent;
struct _AtspiEvent
{
- const gchar *type;
+ gchar *type;
AtspiAccessible *source;
gint detail1;
gint detail2;
- union
- {
- gchar *text;
- AtspiAccessible *accessible;
- AtspiRect rect;
- } v;
- EVENT_DATA_TYPE v_type;
+ GValue any;
};
+/**
+ * ATSPI_TYPE_RECT:
+ *
+ * The #GType for a boxed type holding a #AtspiEvent.
+ */
+#define ATSPI_TYPE_EVENT (atspi_event_get_type ())
+
typedef void AtspiKeystrokeListener;
/**
AtspiAccessible * _atspi_ref_related_accessible (AtspiAccessible *obj, const AtspiReference *ref);
-dbus_bool_t _atspi_dbus_call (AtspiAccessible *obj, const char *interface, const char *method, GError **error, const char *type, ...);
+dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
-DBusMessage *_atspi_dbus_call_partial (AtspiAccessible *obj, const char *interface, const char *method, GError **error, const char *type, ...);
+DBusMessage *_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
dbus_bool_t _atspi_dbus_get_property (AtspiAccessible *obj, const char *interface, const char *name, GError **error, const char *type, void *data);
{
AtspiEvent e;
- memset (&e, 0, sizeof(e));
e.type = (add? "object:children-changed:add": "object:children-changed:remove");
e.source = parent;
e.detail1 = g_list_index (parent->children, child);
+ e.detail2 = 0;
+ g_value_unset (&e.any);
_atspi_send_event (&e);
}
{
gchar *display_p, *screen_p;
canonical_display_name = g_strdup (display_env);
- display_p = strrchr (canonical_display_name, ':');
- screen_p = strrchr (canonical_display_name, '.');
+ display_p = g_utf8_strrchr (canonical_display_name, -1, ':');
+ screen_p = g_utf8_strrchr (canonical_display_name, -1, '.');
if (screen_p && display_p && (screen_p > display_p))
{
*screen_p = '\0';
}
dbus_bool_t
-_atspi_dbus_call (AtspiAccessible *obj, const char *interface, const char *method, GError **error, const char *type, ...)
+_atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...)
{
va_list args;
dbus_bool_t retval;
DBusError err;
+ AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
dbus_error_init (&err);
va_start (args, type);
- retval = dbind_method_call_reentrant_va (_atspi_bus(), obj->app->bus_name, obj->path, interface, method, &err, type, args);
+ retval = dbind_method_call_reentrant_va (_atspi_bus(), accessible->app->bus_name, accessible->path, interface, method, &err, type, args);
va_end (args);
if (dbus_error_is_set (&err))
{
}
DBusMessage *
-_atspi_dbus_call_partial (AtspiAccessible *obj, const char *interface, const char *method, GError **error, const char *type, ...)
+_atspi_dbus_call_partial (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...)
{
+ AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
va_list args;
dbus_bool_t retval;
DBusError err;
dbus_error_init (&err);
va_start (args, type);
- msg = dbus_message_new_method_call (obj->app->bus_name, obj->path, interface, method);
+ msg = dbus_message_new_method_call (accessible->app->bus_name, accessible->path, interface, method);
if (!msg)
goto out;
DBusError err;
dbus_error_init (&err);
- g_warning ("TODO: Write _atspi_dbus_send_with_reply_and_block");
+ /* TODO: Write this function; allow reentrancy */
reply = dbus_connection_send_with_reply_and_block (_atspi_bus(), message, 1000, &err);
dbus_message_unref (message);
return reply;