[at-spi2-core] Hypertext and hyperlink fixes
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Hypertext and hyperlink fixes
- Date: Sat, 4 Dec 2010 10:13:30 +0000 (UTC)
commit eb6e918b2bfc11686e2a53bb7a99042d32f89180
Author: Mike Gorse <mgorse novell com>
Date: Thu Dec 2 14:33:20 2010 -0500
Hypertext and hyperlink fixes
atspi/atspi-accessible.c | 23 +++++++++++++++++++++++
atspi/atspi-accessible.h | 2 ++
atspi/atspi-hyperlink.h | 1 -
atspi/atspi-types.h | 1 +
4 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index c6f0ebc..759152b 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -44,6 +44,11 @@ atspi_editable_text_interface_init (AtspiEditableText *editable_text)
}
static void
+atspi_hypertext_interface_init (AtspiHypertext *hypertext)
+{
+}
+
+static void
atspi_image_interface_init (AtspiImage *image)
{
}
@@ -73,6 +78,7 @@ G_DEFINE_TYPE_WITH_CODE (AtspiAccessible, atspi_accessible, ATSPI_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_COLLECTION, atspi_collection_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_COMPONENT, atspi_component_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_EDITABLE_TEXT, atspi_editable_text_interface_init)
+ G_IMPLEMENT_INTERFACE (ATSPI_TYPE_HYPERTEXT, atspi_hypertext_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_IMAGE, atspi_image_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_SELECTION, atspi_selection_interface_init)
G_IMPLEMENT_INTERFACE (ATSPI_TYPE_TABLE, atspi_table_interface_init)
@@ -949,6 +955,23 @@ atspi_accessible_get_editable_text (AtspiAccessible *accessible)
}
/**
+ * atspi_accessible_get_hyperlink:
+ * @accessible: a pointer to the #AtspiAccessible object on which to operate.
+ *
+ * Get the #AtspiHyperlink associated with the given #AtspiAccessible, if
+ * supported.
+ *
+ * Returns: (transfer full): the #AtspiHyperlink object associated with
+ * the given #AtspiAccessible, or NULL if not supported.
+ **/
+AtspiHyperlink *
+atspi_accessible_get_hyperlink (AtspiAccessible *accessible)
+{
+ return (_atspi_accessible_is_a (accessible, atspi_interface_hyperlink) ?
+ atspi_hyperlink_new (accessible->parent.app, accessible->parent.path) : NULL);
+}
+
+/**
* atspi_accessible_get_hypertext:
* @obj: a pointer to the #AtspiAccessible instance to query.
*
diff --git a/atspi/atspi-accessible.h b/atspi/atspi-accessible.h
index 1f4d577..4e7658e 100644
--- a/atspi/atspi-accessible.h
+++ b/atspi/atspi-accessible.h
@@ -108,6 +108,8 @@ AtspiDocument * atspi_accessible_get_document (AtspiAccessible *obj);
AtspiEditableText * atspi_accessible_get_editable_text (AtspiAccessible *obj);
+AtspiHyperlink * atspi_accessible_get_hyperlink (AtspiAccessible *obj);
+
AtspiHypertext * atspi_accessible_get_hypertext (AtspiAccessible *obj);
AtspiImage * atspi_accessible_get_image (AtspiAccessible *obj);
diff --git a/atspi/atspi-hyperlink.h b/atspi/atspi-hyperlink.h
index 0af3f59..09c5aa6 100644
--- a/atspi/atspi-hyperlink.h
+++ b/atspi/atspi-hyperlink.h
@@ -39,7 +39,6 @@
#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;
diff --git a/atspi/atspi-types.h b/atspi/atspi-types.h
index 0f84d23..e56f93f 100644
--- a/atspi/atspi-types.h
+++ b/atspi/atspi-types.h
@@ -35,6 +35,7 @@ typedef struct _AtspiCollection AtspiCollection;
typedef struct _AtspiComponent AtspiComponent;
typedef struct _AtspiDocument AtspiDocument;
typedef struct _AtspiEditableText AtspiEditableText;
+typedef struct _AtspiHyperlink AtspiHyperlink;
typedef struct _AtspiHypertext AtspiHypertext;
typedef struct _AtspiImage AtspiImage;
typedef struct _AtspiSelection AtspiSelection;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]