Added AtkHyperlinkImpl interface. See RFE #344284.
authorBill Haneman <billh@src.gnome.org>
Thu, 29 Jun 2006 17:18:49 +0000 (17:18 +0000)
committerBill Haneman <billh@src.gnome.org>
Thu, 29 Jun 2006 17:18:49 +0000 (17:18 +0000)
ChangeLog
atk/Makefile.am
atk/atk.h
atk/atkhyperlinkimpl.c [new file with mode: 0644]
atk/atkhyperlinkimpl.h [new file with mode: 0644]
configure.in
docs/atk-sections.txt
docs/tmpl/atkhyperlink.sgml
docs/tmpl/atkhyperlinkimpl.sgml [new file with mode: 0644]

index 5f07135..7512768 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-29 Bill Haneman <bill.haneman@sun.com>
+
+       * atk/atkhyperlinkimpl.h:
+       * atk/atkhyperlinkimpl.c:
+       (atk_hyperlink_impl_get_hyperlink): New method and 
+       interface, allows a client to obtain the 
+       AtkHyperlink instance associated with an AtkObject.
+       See RFE #344284.
+
 2006-06-23 Bill Haneman <bill.haneman@sun.com>
 
        * docs/atk-docs.sgml: Add index sections.
index f5f5d55..648f3e6 100644 (file)
@@ -27,6 +27,7 @@ libatk_1_0_la_SOURCES =       \
        atkeditabletext.c       \
        atkgobjectaccessible.c  \
        atkhyperlink.c          \
+       atkhyperlinkimpl.c      \
        atkhypertext.c          \
        atkimage.c              \
        atknoopobject.c         \
@@ -56,6 +57,7 @@ atk_headers = \
         atkeditabletext.h      \
         atkgobjectaccessible.h \
         atkhyperlink.h         \
+        atkhyperlinkimpl.h     \
         atkhypertext.h         \
         atknoopobject.h                \
         atknoopobjectfactory.h \
index 1f39824..d0bfb90 100755 (executable)
--- a/atk/atk.h
+++ b/atk/atk.h
@@ -27,6 +27,7 @@
 #include <atk/atkeditabletext.h>
 #include <atk/atkgobjectaccessible.h>
 #include <atk/atkhyperlink.h>
+#include <atk/atkhyperlinkimpl.h>
 #include <atk/atkhypertext.h>
 #include <atk/atkimage.h>
 #include <atk/atknoopobject.h>
diff --git a/atk/atkhyperlinkimpl.c b/atk/atkhyperlinkimpl.c
new file mode 100644 (file)
index 0000000..b875f5e
--- /dev/null
@@ -0,0 +1,66 @@
+/* ATK -  Accessibility Toolkit
+ * Copyright 2006 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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 <string.h>
+#include "atkhyperlinkimpl.h"
+
+GType
+atk_hyperlink_impl_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    GTypeInfo tinfo =
+    {
+      sizeof (AtkHyperlinkImplIface),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+
+    };
+
+    type = g_type_register_static (G_TYPE_INTERFACE, "AtkHyperlinkImpl", &tinfo, 0);
+  }
+
+  return type;
+}
+
+/**
+ * atk_hyperlink_impl_get_hyperlink:
+ * @obj: a GObject instance that implements AtkHyperlinkImplIface
+ *
+ * Gets the hyperlink associated with this object.
+ *
+ * Returns an AtkHyperlink object which points to this implementing AtkObject.
+ **/
+AtkHyperlink *
+atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *obj)
+{
+  AtkHyperlinkImplIface *iface;
+
+  g_return_if_fail (obj != NULL);
+  g_return_if_fail (ATK_IS_HYPERLINK_IMPL (obj));
+
+  iface = ATK_HYPERLINK_IMPL_GET_IFACE (obj);
+
+  if (iface->get_hyperlink)
+    {
+      (iface->get_hyperlink) (obj);
+    }
+}
+
diff --git a/atk/atkhyperlinkimpl.h b/atk/atkhyperlinkimpl.h
new file mode 100644 (file)
index 0000000..a91d1ed
--- /dev/null
@@ -0,0 +1,76 @@
+/* ATK -  Accessibility Toolkit
+ * Copyright 2001 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 __ATK_HYPERLINK_IMPL_H__
+#define __ATK_HYPERLINK_IMPL_H__
+
+#include <atk/atkobject.h>
+#include <atk/atkhyperlink.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * The AtkHyperlinkImpl interface should be supported by objects
+ * exposed within the hierarchy as children of an AtkHypertext container
+ * which correspond to "links" or embedded content within the text.
+ * HTML anchors are not, for instance, normally exposed this way,
+ * but embedded images and components which appear inline in the
+ * content of a text object are. The AtkHyperlinkIface interface
+ * allows a means of determining which children are hyperlinks in this
+ * sense of the word, and for obtaining their corresponding AtkHyperlink 
+ * object, from which the embedding range, URI, etc. can be obtained.
+ *
+ * To some extent this interface exists because, for historical 
+ * reasons, AtkHyperlink was defined as an object type, not an interface.
+ * Thus, in order to interact with AtkObjects via AtkHyperlink semantics,
+ * a new interface was required.
+ */
+
+#define ATK_TYPE_HYPERLINK_IMPL          (atk_hyperlink_impl_get_type ())
+#define ATK_IS_HYPERLINK_IMPL(obj)       G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_HYPERLINK_IMPL)
+#define ATK_HYPERLINK_IMPL(obj)             G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_HYPERLINK_IMPL, AtkHyperlinkImpl)
+#define ATK_HYPERLINK_IMPL_GET_IFACE(obj)   G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_HYPERLINK_IMPL, AtkHyperlinkImplIface)
+
+#ifndef _TYPEDEF_ATK_HYPERLINK_IMPL_
+#define _TYPEDEF_ATK_HYPERLINK_IMPL__
+typedef struct _AtkHyperlinkImpl AtkHyperlinkImpl;
+#endif
+typedef struct _AtkHyperlinkImplIface AtkHyperlinkImplIface;
+
+struct _AtkHyperlinkImplIface
+{
+  GTypeInterface parent;
+    
+  AtkHyperlink  (* get_hyperlink) (AtkHyperlinkImpl *impl);
+
+  AtkFunction pad1;
+};
+
+GType            atk_hyperlink_impl_get_type (void);
+
+AtkHyperlink    *atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *obj);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __ATK_HYPERLINK_IMPL_H__ */
index 78fde38..e838352 100644 (file)
@@ -17,7 +17,7 @@ dnl set ATK_BINARY_AGE _and_ ATK_INTERFACE_AGE to 0.
 dnl The triplet 
 m4_define([atk_major_version], [1])
 m4_define([atk_minor_version], [12])
-m4_define([atk_micro_version], [0])
+m4_define([atk_micro_version], [1])
 m4_define([atk_version],
           [atk_major_version.atk_minor_version.atk_micro_version])
 
index cb538b2..61cb8e3 100644 (file)
@@ -480,6 +480,19 @@ AtkHyperlinkClass
 </SECTION>
 
 <SECTION>
+<FILE>atkhyperlinkimpl</FILE>
+<TITLE>AtkHyperlinkImpl</TITLE>
+AtkHyperlinkImpl
+atk_hyperlink_impl_get_hyperlink
+<SUBSECTION Standard>
+ATK_HYPERLINK_IMPL
+ATK_IS_HYPERLINK_IMPL
+ATK_TYPE_HYPERLINK_IMPL
+atk_hyperlink_impl_get_type
+ATK_HYPERLINK_IMPL_GET_IFACE
+</SECTION>
+
+<SECTION>
 <FILE>atkstate</FILE>
 <TITLE>AtkState</TITLE>
 AtkStateType
index b0bcc62..12ed025 100644 (file)
@@ -6,8 +6,11 @@ An ATK object which encapsulates a link or set of links in a hypertext document.
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-An ATK object which encapsulates a link or set of links in a hypertext document.
-It implements the AtkAction interface.
+An ATK object which encapsulates a link or set of links 
+(for instance in the case of client-side image maps) in a hypertext document.
+It may implement the AtkAction interface.  AtkHyperlink may also be used
+to refer to inline embedded content, since it allows specification of a start
+and end offset within the host AtkHypertext object.
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
diff --git a/docs/tmpl/atkhyperlinkimpl.sgml b/docs/tmpl/atkhyperlinkimpl.sgml
new file mode 100644 (file)
index 0000000..fd97906
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- ##### SECTION Title ##### -->
+AtkHyperlinkImpl
+
+<!-- ##### SECTION Short_Description ##### -->
+An interface from which the AtkHyperlink associated with an
+AtkObject may be obtained. 
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+AtkHyperlinkImpl allows AtkObjects to
+refer to their associated AtkHyperlink instance, if one
+exists.  AtkHyperlinkImpl differs from AtkHyperlink in that 
+AtkHyperlinkImpl is an interface, whereas AtkHyperlink is
+a object type.  The AtkHyperlinkImpl interface allows
+a client to query an AtkObject for the availability of
+an associated AtkHyperlink instance, and obtain that
+instance.  It is thus particularly useful in cases where
+embedded content or inline content within a text object
+is present, since the embedding text object implements
+AtkHypertext and the inline/embedded objects are 
+exposed as children which implement AtkHyperlinkImpl,
+in addition to their being obtainable via AtkHypertext:getLink
+followed by AtkHyperlink:getObject.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT AtkHyperlinkImpl ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION atk_hyperlink_impl_get_hyperlink ##### -->
+<para>
+
+</para>
+
+@obj: 
+@Returns: 
+
+