atspi-event-listener.c \
atspi-event-listener.h \
atspi-event-listener-private.h \
+ atspi-hyperlink.c \
+ atspi-hyperlink.h \
+ atspi-hypertext.c \
+ atspi-hypertext.h \
atspi-image.c \
atspi-image.h \
atspi-misc.c \
atspi-misc.h \
atspi-misc-private.h \
+ atspi-object.c \
+ atspi-object.h \
atspi-private.h \
atspi-registry.c \
atspi-registry.h \
{
}
-G_DEFINE_TYPE_WITH_CODE (AtspiAccessible, atspi_accessible, G_TYPE_OBJECT,
+G_DEFINE_TYPE_WITH_CODE (AtspiAccessible, atspi_accessible, ATSPI_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_ACTION, atspi_action_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_COMPONENT, atspi_component_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_EDITABLE_TEXT, atspi_editable_text_interface_init)
static void
atspi_accessible_finalize (GObject *obj)
{
- AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
+ /*AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj); */
- if (accessible->app)
- g_object_unref (accessible->app);
-
- g_free (accessible->path);
+ /* TODO: Unref parent/children, etc. */
}
static void
{
DBusMessage *message, *reply;
DBusMessageIter iter, iter_variant;
- message = dbus_message_new_method_call (obj->app->bus_name, obj->path,
+ message = dbus_message_new_method_call (obj->parent.app->bus_name,
+ obj->parent.path,
DBUS_INTERFACE_PROPERTIES, "Get");
if (!message)
return NULL;
g_object_ref (ATSPI_EDITABLE_TEXT (accessible)) : NULL);
}
-#if 0
/**
* atspi_accessible_get_hypertext:
* @obj: a pointer to the #AtspiAccessible instance to query.
atspi_accessible_get_hypertext (AtspiAccessible *accessible)
{
return (_atspi_accessible_is_a (accessible, atspi_interface_hypertext) ?
- accessible : NULL);
+ g_object_ref (ATSPI_HYPERTEXT (accessible)) : NULL);
}
-#endif
/**
* atspi_accessible_get_image:
e.detail2 = 0;
_atspi_send_event (&e);
- g_free (accessible->path);
+ g_free (accessible->parent.path);
if (accessible->states)
g_object_unref (accessible->states);
accessible = g_object_new (ATSPI_TYPE_ACCESSIBLE, NULL);
g_return_val_if_fail (accessible != NULL, NULL);
- accessible->app = g_object_ref (app);
- accessible->path = g_strdup (path);
+ accessible->parent.app = g_object_ref (app);
+ accessible->parent.path = g_strdup (path);
return accessible;
}
#include "atspi-application.h"
#include "atspi-constants.h"
+#include "atspi-object.h"
#include "atspi-stateset.h"
#include "atspi-types.h"
struct _AtspiAccessible
{
- GObject parent;
+ AtspiObject parent;
AtspiAccessible *accessible_parent;
GList *children;
- AtspiApplication *app;
- char *path;
AtspiRole role;
gint interfaces;
char *name;
typedef struct _AtspiAccessibleClass AtspiAccessibleClass;
struct _AtspiAccessibleClass
{
- GObjectClass parent_class;
+ AtspiObjectClass parent_class;
};
GType atspi_accessible_get_type (void);
AtspiEditableText * atspi_accessible_get_editable_text (AtspiAccessible *obj);
+AtspiHypertext * atspi_accessible_get_hypertext (AtspiAccessible *obj);
+
AtspiImage * atspi_accessible_get_image (AtspiAccessible *obj);
AtspiSelection * atspi_accessible_get_selection (AtspiAccessible *obj);
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, 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.
+ */
+
+#include "atspi-private.h"
+
+G_DEFINE_TYPE (AtspiHyperlink, atspi_hyperlink, ATSPI_TYPE_OBJECT)
+
+static void
+atspi_hyperlink_init (AtspiHyperlink *hyperlink)
+{
+}
+
+static void
+atspi_hyperlink_finalize (GObject *obj)
+{
+ /*AtspiHyperlink *hyperlink = ATSPI_HYPERLINK (obj); */
+
+ /* TODO: Unref parent/children, etc. */
+}
+
+static void
+atspi_hyperlink_class_init (AtspiHyperlinkClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = atspi_hyperlink_finalize;
+}
+
+AtspiHyperlink *
+atspi_hyperlink_new (AtspiApplication *app, const gchar *path)
+{
+ AtspiHyperlink *hyperlink;
+
+ hyperlink = g_object_new (ATSPI_TYPE_HYPERLINK, NULL);
+ g_return_val_if_fail (hyperlink != NULL, NULL);
+
+ hyperlink->parent.app = g_object_ref (app);
+ hyperlink->parent.path = g_strdup (path);
+
+ return hyperlink;
+}
+
+/**
+ * atspi_hyperlink_get_n_anchors:
+ * @obj: a pointer to the #AtspiHyperlink object on which to operate.
+ *
+ * Get the total number of anchors which an #AtspiHyperlink implementor has.
+ * Though typical hyperlinks have only one anchor, client-side image maps and
+ * other hypertext objects may potentially activate or refer to multiple
+ * URIs. For each anchor there is a corresponding URI and object.
+ * see atspi_hyperlink_get_uri() and atspi_hyperlink_get_object().
+ *
+ * Returns: a #gint indicating the number of anchors in this hyperlink.
+ **/
+gint
+atspi_hyperlink_get_n_anchors (AtspiHyperlink *obj, GError **error)
+{
+ dbus_int32_t retval;
+
+ g_return_val_if_fail (obj != NULL, -1);
+
+ _atspi_dbus_get_property (obj, atspi_interface_hyperlink, "NAnchors", error, "i", &retval);
+
+ return retval;
+}
+
+/**
+ * atspi_hyperlink_get_uri:
+ * @obj: a pointer to the #AtspiHyperlink implementor on which to operate.
+ * @i: a (zero-index) integer indicating which hyperlink anchor to query.
+ *
+ * Get the URI associated with a particular hyperlink anchor.
+ *
+ * Returns: a UTF-8 string giving the URI of the @ith hyperlink anchor.
+ **/
+gchar *
+atspi_hyperlink_get_uri (AtspiHyperlink *obj, int i, GError **error)
+{
+ dbus_int32_t d_i = i;
+ char *retval;
+
+ g_return_val_if_fail (obj != NULL, NULL);
+
+ _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetURI", error, "i=>s", d_i, &retval);
+
+ return retval;
+}
+
+/**
+ * atspi_hyperlink_get_object:
+ * @obj: a pointer to the #AtspiHyperlink implementor on which to operate.
+ * @i: a (zero-index) long integer indicating which hyperlink anchor to query.
+ *
+ * Get the object associated with a particular hyperlink anchor, as an #Accessible.
+ *
+ * Returns: (transfer full): an #AtspiAccessible that represents the object
+ * associated with the @ith anchor of the specified #AtspiHyperlink.
+ **/
+AtspiAccessible*
+atspi_hyperlink_get_object (AtspiHyperlink *obj, gint i, GError **error)
+{
+ dbus_int32_t d_i = i;
+ DBusMessage *reply;
+
+ g_return_val_if_fail (obj != NULL, NULL);
+
+ reply = _atspi_dbus_call_partial (obj, atspi_interface_hyperlink, "GetObject", error, "i", d_i);
+
+ return _atspi_dbus_return_accessible_from_message (reply);
+}
+
+/**
+ * atspi_hyperlink_get_index_range:
+ * @obj: a pointer to the #AtspiHyperlink implementor on which to operate.
+ *
+ *
+ * Get the starting and ending character offsets of the text range associated with
+ * a #AtspiHyperlink, in its originating #AtspiHypertext.
+ **/
+AtspiRange *
+atspi_hyperlink_get_index_range (AtspiHyperlink *obj, GError **error)
+{
+ dbus_int32_t d_start_offset, d_end_offset;
+ AtspiRange *ret = g_new (AtspiRange, 1);
+
+ if (ret)
+ ret->start_offset = ret->end_offset = -1;
+
+ if (!obj || !ret)
+ return ret;
+
+ _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetIndexRange", error, "=>ii", &d_start_offset, &d_end_offset);
+
+ ret->start_offset = d_start_offset;
+ ret->end_offset = d_end_offset;
+ return ret;
+}
+
+/**
+ * atspi_hyperlink_get_start_index:
+ * @obj: a pointer to the #AtspiHyperlink implementor on which to operate.
+ *
+ *
+ * Get the starting character offset of the text range associated with
+ * a #AtspiHyperlink, in its originating #AtspiHypertext.
+ **/
+gint
+atspi_hyperlink_get_start_index (AtspiHyperlink *obj, GError **error)
+{
+ dbus_int32_t d_start_offset = -1;
+
+ if (!obj)
+ return -1;
+
+ _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetStartIndex", error, "=>i", &d_start_offset);
+
+ return d_start_offset;
+}
+/**
+ * atspi_hyperlink_get_end_index:
+ * @obj: a pointer to the #AtspiHyperlink implementor on which to operate.
+ *
+ *
+ * Get the ending character offset of the text range associated with
+ * a #AtspiHyperlink, in its originating #AtspiHypertext.
+ **/
+gint
+atspi_hyperlink_get_end_index (AtspiHyperlink *obj, GError **error)
+{
+ dbus_int32_t d_end_offset = -1;
+
+ if (!obj)
+ return -1;
+
+ _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetEndIndex", error, "=>i", &d_end_offset);
+
+ return d_end_offset;
+}
+
+
+/**
+ * atspi_hyperlink_is_valid:
+ * @obj: a pointer to the #AtspiHyperlink on which to operate.
+ *
+ * Tell whether an #AtspiHyperlink object is still valid with respect to its
+ * originating hypertext object.
+ *
+ * Returns: #TRUE of the specified #AtspiHyperlink is still valid with respect
+ * to its originating #AtspiHypertext object, #FALSE otherwise.
+ **/
+gboolean
+atspi_hyperlink_is_valid (AtspiHyperlink *obj, GError **error)
+{
+ dbus_bool_t retval;
+
+ g_return_val_if_fail (obj != NULL, FALSE);
+
+ _atspi_dbus_call (obj, atspi_interface_hyperlink, "IsValid", error, "=>b", &retval);
+
+ return retval;
+}
--- /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_HYPERLINK_H_
+#define _ATSPI_HYPERLINK_H_
+
+#include "glib-object.h"
+
+#include "atspi-constants.h"
+
+#include "atspi-text.h" /* for AtspiRange */
+#include "atspi-types.h"
+
+#define ATSPI_TYPE_HYPERLINK (atspi_hyperlink_get_type ())
+#define ATSPI_HYPERLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_HYPERLINK, AtspiHyperlink))
+#define ATSPI_HYPERLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_HYPERLINK, AtspiHyperlinkClass))
+#define ATSPI_IS_HYPERLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_HYPERLINK))
+#define ATSPI_IS_HYPERLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_HYPERLINK))
+#define ATSPI_HYPERLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_HYPERLINK, AtspiHyperlinkClass))
+
+typedef struct _AtspiHyperlink AtspiHyperlink;
+struct _AtspiHyperlink
+{
+ AtspiObject parent;
+};
+
+typedef struct _AtspiHyperlinkClass AtspiHyperlinkClass;
+struct _AtspiHyperlinkClass
+{
+ AtspiObjectClass parent_class;
+};
+
+GType atspi_hyperlink_get_type (void);
+
+AtspiHyperlink *
+atspi_hyperlink_new (AtspiApplication *app, const gchar *path);
+
+gint atspi_hyperlink_get_n_anchors (AtspiHyperlink *obj, GError **error);
+
+gchar * atspi_hyperlink_get_uri (AtspiHyperlink *obj, int i, GError **error);
+
+AtspiAccessible* atspi_hyperlink_get_object (AtspiHyperlink *obj, gint i, GError **error);
+
+AtspiRange * atspi_hyperlink_get_index_range (AtspiHyperlink *obj, GError **error);
+
+gint atspi_hyperlink_get_start_index (AtspiHyperlink *obj, GError **error);
+
+gint atspi_hyperlink_get_end_index (AtspiHyperlink *obj, GError **error);
+
+gboolean atspi_hyperlink_is_valid (AtspiHyperlink *obj, GError **error);
+
+#endif /* _ATSPI_HYPERLINK_H_ */
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, 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.
+ */
+
+#include "atspi-private.h"
+
+/**
+ * atspi_hypertext_get_n_links:
+ * @obj: a pointer to the #AtspiHypertext implementor on which to operate.
+ *
+ * Get the total number of #AtspiHyperlinks which an
+ * #AtspiHypertext implementor has.
+ *
+ * Returns: a #gint indicating the number of #AtspiHyperlinks
+ * of the #AtspiHypertext implementor, or -1 if
+ * the number cannot be determined (for example, if the
+ * #AtspiHypertext object is so large that it is not
+ * all currently in the memory cache).
+ **/
+gint
+atspi_hypertext_get_n_links (AtspiHypertext *obj, GError **error)
+{
+ dbus_int32_t retval = 0;
+
+ g_return_val_if_fail (obj != NULL, FALSE);
+
+ _atspi_dbus_call (obj, atspi_interface_hypertext, "GetNLinks", error, "=>i", &retval);
+
+ return retval;
+}
+
+/**
+ * atspi_hypertext_get_link:
+ * @obj: a pointer to the #AtspiHypertext implementor on which to operate.
+ * @link_index: a (zero-index) integer indicating which hyperlink to query.
+ *
+ * Get the #AtspiHyperlink object at a specified index.
+ *
+ * Returns: (transfer full): the #AtspiHyperlink object specified by
+ * #link_index.
+ **/
+AtspiHyperlink *
+atspi_hypertext_get_link (AtspiHypertext *obj, gint link_index, GError **error)
+{
+ dbus_int32_t d_link_index = link_index;
+ DBusMessage *reply;
+
+ g_return_val_if_fail (obj != NULL, NULL);
+
+ reply = _atspi_dbus_call_partial (obj, atspi_interface_hypertext, "GetLink", error, "i", d_link_index);
+
+ return _atspi_dbus_return_hyperlink_from_message (reply);
+}
+
+/**
+ * atspi_hypertext_get_link_index:
+ * @obj: a pointer to the #AtspiHypertext implementor on which to operate.
+ * @character_offset: an integer specifying the character offset to query.
+ *
+ * Get the index of the #AtspiHyperlink object at a specified
+ * character offset.
+ *
+ * Returns: the linkIndex of the #AtspiHyperlink active at
+ * character offset @character_offset, or -1 if there is
+ * no hyperlink at the specified character offset.
+ **/
+int
+atspi_hypertext_get_link_index (AtspiHypertext *obj,
+ gint character_offset,
+ GError **error)
+{
+ dbus_int32_t d_character_offset = character_offset;
+ dbus_int32_t retval = -1;
+
+ g_return_val_if_fail (obj != NULL, -1);
+
+ _atspi_dbus_call (obj, atspi_interface_hypertext, "GetLinkIndex", error, "i=>i", d_character_offset, &retval);
+
+ return retval;
+}
+
+static void
+atspi_hypertext_base_init (AtspiHypertext *klass)
+{
+}
+
+GType
+atspi_hypertext_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo tinfo =
+ {
+ sizeof (AtspiHypertext),
+ (GBaseInitFunc) atspi_hypertext_base_init,
+ (GBaseFinalizeFunc) NULL,
+ };
+
+ type = g_type_register_static (G_TYPE_INTERFACE, "AtspiHypertext", &tinfo, 0);
+
+ }
+ return type;
+}
--- /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_HYPERTEXT_H_
+#define _ATSPI_HYPERTEXT_H_
+
+#include "glib-object.h"
+
+#include "atspi-constants.h"
+
+#include "atspi-types.h"
+
+#define ATSPI_TYPE_HYPERTEXT (atspi_hypertext_get_type ())
+#define ATSPI_IS_HYPERTEXT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_HYPERTEXT)
+#define ATSPI_HYPERTEXT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_HYPERTEXT, AtspiHypertext)
+#define ATSPI_HYPERTEXT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATSPI_TYPE_HYPERTEXT, AtspiHypertext))
+
+GType atspi_hypertext_get_type ();
+
+struct _AtspiHypertext
+{
+ GTypeInterface parent;
+};
+
+gint atspi_hypertext_get_n_links (AtspiHypertext *obj, GError **error);
+
+AtspiHyperlink * atspi_hypertext_get_link (AtspiHypertext *obj, gint link_index, GError **error);
+
+gint atspi_hypertext_get_link_index (AtspiHypertext *obj, gint character_offset, GError **error);
+
+#endif /* _ATSPI_HYPERTEXT_H_ */
AtspiAccessible *
_atspi_dbus_return_accessible_from_iter (DBusMessageIter *iter);
-AtspiAccessible * _atspi_ref_related_accessible (AtspiAccessible *obj, const AtspiReference *ref);
+AtspiHyperlink *
+_atspi_dbus_return_hyperlink_from_message (DBusMessage *message);
+
+AtspiHyperlink *
+_atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter);
dbus_bool_t _atspi_dbus_call (gpointer obj, const char *interface, const char *method, GError **error, const char *type, ...);
a = atspi_accessible_new (app, path);
if (!a)
return NULL;
- g_hash_table_insert (app->hash, a->path, a);
+ g_hash_table_insert (app->hash, a->parent.path, a);
g_object_ref (a); /* for the hash */
return a;
}
+static AtspiHyperlink *
+ref_hyperlink (const char *app_name, const char *path)
+{
+ AtspiApplication *app = get_application (app_name);
+ AtspiHyperlink *hyperlink;
+
+ if (!strcmp (path, ATSPI_DBUS_PATH_NULL))
+ return NULL;
+
+ hyperlink = g_hash_table_lookup (app->hash, path);
+ if (hyperlink)
+ {
+ return g_object_ref (hyperlink);
+ }
+ hyperlink = atspi_hyperlink_new (app, path);
+ if (!hyperlink)
+ return NULL;
+ g_hash_table_insert (app->hash, hyperlink->parent.path, hyperlink);
+ /* TODO: This should be a weak ref */
+ g_object_ref (hyperlink); /* for the hash */
+ return hyperlink;
+}
+
typedef struct
{
char *path;
for (l = a->children; l; l = l->next)
{
child = l->data;
- if (!strcmp (bus_name, child->app->bus_name)) break;
+ if (!strcmp (bus_name, child->parent.app->bus_name)) break;
}
if (!l)
{
{
return NULL;
}
- g_hash_table_insert (app->hash, desktop->path, desktop);
+ g_hash_table_insert (app->hash, desktop->parent.path, desktop);
g_object_ref (desktop); /* for the hash */
desktop->name = g_strdup ("main");
dbus_error_init (&error);
}
else
{
- g_warning ("Atspi: Called __atspi_dbus_return_accessible_from_message with strange signature %s", signature);
+ g_warning ("Atspi: Called _atspi_dbus_return_accessible_from_message with strange signature %s", signature);
}
dbus_message_unref (message);
return retval;
return ref_accessible (app_name, path);
}
-/* TODO: Remove this function. We should not need it anymore.
- * If we do, it's a bug.
- */
-AtspiAccessible *
-_atspi_ref_related_accessible (AtspiAccessible *obj, const AtspiReference *ref)
+AtspiHyperlink *
+_atspi_dbus_return_hyperlink_from_message (DBusMessage *message)
+{
+ DBusMessageIter iter;
+ AtspiHyperlink *retval = NULL;
+ const char *signature = dbus_message_get_signature (message);
+
+ if (!strcmp (signature, "(so)"))
+ {
+ dbus_message_iter_init (message, &iter);
+ retval = _atspi_dbus_return_hyperlink_from_iter (&iter);
+ }
+ else
+ {
+ g_warning ("Atspi: Called _atspi_dbus_return_hyperlink_from_message with strange signature %s", signature);
+ }
+ dbus_message_unref (message);
+ return retval;
+}
+
+AtspiHyperlink *
+_atspi_dbus_return_hyperlink_from_iter (DBusMessageIter *iter)
{
- const char *app = (ref->name && ref->name[0]? ref->name: obj->app->bus_name);
- return ref_accessible (app, obj->path);
+ const char *app_name, *path;
+
+ get_reference_from_iter (iter, &app_name, &path);
+ return ref_hyperlink (app_name, path);
}
const char *cache_signal_type = "((so)(so)(so)a(so)assusau)";
return leaked;
}
-static AtspiAccessible *
-_atspi_dbus_get_remote_object (gpointer obj,
- const char *interface,
- const char *method,
- GError **error,
- const char *type,
- va_list args)
-{
- DBusMessage *reply;
-
- reply = _atspi_dbus_call_partial_va (obj, interface, method, error, type, args);
- if (!reply)
- return NULL;
-
- return _atspi_dbus_return_accessible_from_message (reply);
-}
-
dbus_bool_t
_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);
+ AtspiObject *aobj = ATSPI_OBJECT (obj);
va_start (args, type);
- if (!strcmp (type + strcspn (type, "="), "=>(so)"))
- return _atspi_dbus_get_remote_object (obj, interface, method, error, type, args);
-
dbus_error_init (&err);
- retval = dbind_method_call_reentrant_va (_atspi_bus(), accessible->app->bus_name, accessible->path, interface, method, &err, type, args);
+ retval = dbind_method_call_reentrant_va (_atspi_bus(), aobj->app->bus_name, aobj->path, interface, method, &err, type, args);
va_end (args);
if (dbus_error_is_set (&err))
{
const char *type,
va_list args)
{
- AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
+ AtspiObject *aobj = ATSPI_OBJECT (obj);
dbus_bool_t retval;
DBusError err;
DBusMessage *msg = NULL, *reply = NULL;
dbus_error_init (&err);
- msg = dbus_message_new_method_call (accessible->app->bus_name, accessible->path, interface, method);
+ msg = dbus_message_new_method_call (aobj->app->bus_name, aobj->path, interface, method);
if (!msg)
goto out;
DBusMessageIter iter, iter_variant;
DBusError err;
dbus_bool_t retval = FALSE;
- AtspiAccessible *accessible = ATSPI_ACCESSIBLE (obj);
+ AtspiObject *aobj = ATSPI_OBJECT (obj);
- if (!accessible)
+ if (!aobj)
return NULL;
- message = dbus_message_new_method_call (accessible->app->bus_name,
- accessible->path,
+ message = dbus_message_new_method_call (aobj->app->bus_name,
+ aobj->path,
"org.freedesktop.DBus.Properties",
"Get");
if (!message)
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, 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.
+ */
+
+#include "atspi-private.h"
+
+G_DEFINE_TYPE (AtspiObject, atspi_object, G_TYPE_OBJECT)
+
+static void
+atspi_object_init (AtspiObject *obj)
+{
+}
+
+static void
+atspi_object_finalize (GObject *obj)
+{
+ AtspiObject *aobj = ATSPI_OBJECT (obj);
+
+ if (aobj->app)
+ g_object_unref (aobj->app);
+
+ g_free (aobj->path);
+}
+
+static void
+atspi_object_class_init (AtspiObjectClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = atspi_object_finalize;
+}
--- /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_OBJECT_H_
+#define _ATSPI_OBJECT_H_
+
+#include "glib-object.h"
+
+#include "atspi-application.h"
+#include "atspi-types.h"
+
+#define ATSPI_TYPE_OBJECT (atspi_object_get_type ())
+#define ATSPI_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_OBJECT, AtspiObject))
+#define ATSPI_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_OBJECT, AtspiObjectClass))
+#define ATSPI_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_OBJECT))
+#define ATSPI_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_OBJECT))
+#define ATSPI_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_OBJECT, AtspiObjectClass))
+
+typedef struct _AtspiObject AtspiObject;
+struct _AtspiObject
+{
+ GObject parent;
+ AtspiApplication *app;
+ char *path;
+};
+
+typedef struct _AtspiObjectClass AtspiObjectClass;
+struct _AtspiObjectClass
+{
+ GObjectClass parent_class;
+};
+
+GType atspi_object_get_type (void);
+#endif /* _ATSPI_OBJECT_H_ */
GError **error)
{
dbus_int32_t d_row = row;
- AtspiAccessible *retval = NULL;
+ DBusMessage *reply;
g_return_val_if_fail (obj != NULL, NULL);
- !_atspi_dbus_call (obj, atspi_interface_table, "GetRowHeader", error, "i=>(so)", d_row, &retval);
+ reply = !_atspi_dbus_call (obj, atspi_interface_table, "GetRowHeader", error, "i", d_row);
- return retval;
+ return _atspi_dbus_return_accessible_from_message (reply);
}
/**
GError **error)
{
dbus_int32_t d_column = column;
- AtspiAccessible *retval = NULL;
+ DBusMessage *reply;
g_return_val_if_fail (obj != NULL, NULL);
- !_atspi_dbus_call (obj, atspi_interface_table, "GetColumnHeader", error, "i=>(so)", d_column, &retval);
+ reply = !_atspi_dbus_call (obj, atspi_interface_table, "GetCoumnHeader", error, "i", d_column);
- return retval;
+ return _atspi_dbus_return_accessible_from_message (reply);
}
/**
#include "atspi-private.h"
-static AtspiRange *
+AtspiRange *
atspi_range_copy (AtspiRange *src)
{
AtspiRange *dst = g_new (AtspiRange, 1);
GType atspi_range_get_type ();
+AtspiRange *
+atspi_range_copy (AtspiRange *src);
+
typedef struct _AtspiRangedAttributeSet AtspiRangedAttributeSet;
struct _AtspiRangedAttributeSet
{
typedef struct _AtspiComponent AtspiComponent;
typedef struct _AtspiDocument AtspiDocument;
typedef struct _AtspiEditableText AtspiEditableText;
-typedef struct _AtspiAccessible AtspiHypertext;
+typedef struct _AtspiHypertext AtspiHypertext;
typedef struct _AtspiImage AtspiImage;
typedef struct _AtspiSelection AtspiSelection;
typedef struct _AtspiTable AtspiTable;
#include "atspi-document.h"
#include "atspi-editabletext.h"
#include "atspi-event-listener.h"
+#include "atspi-hyperlink.h"
+#include "atspi-hypertext.h"
#include "atspi-image.h"
#include "atspi-misc.h"
#include "atspi-registry.h"