*
* Copyright 2001, 2002 Sun Microsystems Inc.,
* Copyright 2001, 2002 Ximian, Inc.
+ * Copyright 2010, 2011 Novell, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
}
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)
+_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);
* 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().
+ * Gets 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;
+ dbus_int32_t retval = -1;
g_return_val_if_fail (obj != NULL, -1);
* @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.
+ * Gets the URI associated with a particular hyperlink anchor.
*
* Returns: a UTF-8 string giving the URI of the @ith hyperlink anchor.
**/
atspi_hyperlink_get_uri (AtspiHyperlink *obj, int i, GError **error)
{
dbus_int32_t d_i = i;
- char *retval;
+ char *retval = NULL;
g_return_val_if_fail (obj != NULL, NULL);
_atspi_dbus_call (obj, atspi_interface_hyperlink, "GetURI", error, "i=>s", d_i, &retval);
+ if (!retval)
+ retval = g_strdup ("");
+
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.
+ * @i: a (zero-index) #gint indicating which hyperlink anchor to query.
*
- * Get the object associated with a particular hyperlink anchor, as an #Accessible.
+ * Gets the object associated with a particular hyperlink anchor, as an
+ * #AtspiAccessible.
*
* Returns: (transfer full): an #AtspiAccessible that represents the object
* associated with the @ith anchor of the specified #AtspiHyperlink.
* @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.
+ * Gets the starting and ending character offsets of the text range
+ * associated with an #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;
+ ret->start_offset = ret->end_offset = -1;
- if (!obj || !ret)
+ if (!obj)
return ret;
_atspi_dbus_call (obj, atspi_interface_hyperlink, "GetIndexRange", error, "=>ii", &d_start_offset, &d_end_offset);
* @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.
+ * Gets the starting character offset of the text range associated with
+ * an #AtspiHyperlink, in its originating #AtspiHypertext.
**/
gint
atspi_hyperlink_get_start_index (AtspiHyperlink *obj, GError **error)
if (!obj)
return -1;
- _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetStartIndex", error, "=>i", &d_start_offset);
+ _atspi_dbus_get_property (obj, atspi_interface_hyperlink, "StartIndex",
+ error, "i", &d_start_offset);
return d_start_offset;
}
* @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.
+ * Gets the ending character offset of the text range associated with
+ * an #AtspiHyperlink, in its originating #AtspiHypertext.
**/
gint
atspi_hyperlink_get_end_index (AtspiHyperlink *obj, GError **error)
if (!obj)
return -1;
- _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetEndIndex", error, "=>i", &d_end_offset);
+ _atspi_dbus_get_property (obj, atspi_interface_hyperlink, "EndIndex", 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
+ * Tells 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
+ * Returns: #TRUE if 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;
+ dbus_bool_t retval = FALSE;
g_return_val_if_fail (obj != NULL, FALSE);