Re: [g-a-devel]Re: ATK patch to add support for embedded text



On Thu, 2002-11-14 at 12:44, Padraig O'Briain wrote:
> I am going to move the definition of ATK_HYPERLINK_IS_INLINE from atkhyperlink.c 
> to atkhyperlink.h.
Thanks, that's better.  

I attach a revised patch with that change, and additions to
docs/atk-sections.txt; also additions to tests/testrelation.c

-Bill
? atk-patch-nov14.diff
? atk-patch.diff
? stamp-h
? stamp-h.in
? docs/atk.interfaces
? docs/atk.prerequisites
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/atk/ChangeLog,v
retrieving revision 1.219
diff -u -r1.219 ChangeLog
--- ChangeLog	13 Nov 2002 17:09:03 -0000	1.219
+++ ChangeLog	14 Nov 2002 13:41:28 -0000
@@ -1,3 +1,21 @@
+2002-11-14  Bill Haneman <bill haneman sun com>
+
+	* atk/atkrelationtype.h:
+	(ATK_RELATION_EMBEDS, ATK_RELATION_EMBEDDED_BY):
+	New relations to handle content embedding, for instance
+	text that embeds or flows around images.
+	* atk/atkhyperlink.h:
+	(atk_hyperlink_is_inline):
+	New API, returns whether a hyperlink's content is
+	partially displayed inline; useful for small images
+	emedded in text, and for HTML <src> elements.
+	(AtkHyperlinkClass->link_state):
+	New virtualized method, used to implement various
+	state query API such as atk_hyperlink_is_inline().
+	* atk/atkhyperlink.c:
+	(atk_hyperlink_is_inline):
+	New method.
+
 2002-11-13  Padraig O'Briain  <padraig obriain sun com>
 
 	* atk/atkobject.[ch]: Add signal active-descendant-changed
Index: atk/atkhyperlink.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atkhyperlink.c,v
retrieving revision 1.10
diff -u -r1.10 atkhyperlink.c
--- atk/atkhyperlink.c	8 Nov 2002 18:53:55 -0000	1.10
+++ atk/atkhyperlink.c	14 Nov 2002 13:41:29 -0000
@@ -199,6 +199,32 @@
 }
 
 /**
+ * atk_hyperlink_is_inline:
+ * @link_: an #AtkHyperlink
+ *
+ * Indicates whether the link currently displays some or all of its
+ *           content inline.  Ordinary HTML links will usually return
+ *           %FALSE, but an inline &lt;src&gt; HTML element will return
+ *           %TRUE.
+a *
+ * Returns: whether or not this link displays its content inline.
+ *
+ **/
+gboolean
+atk_hyperlink_is_inline (AtkHyperlink *link)
+{
+  AtkHyperlinkClass *klass;
+
+  g_return_val_if_fail (ATK_IS_HYPERLINK (link), FALSE);
+
+  klass = ATK_HYPERLINK_GET_CLASS (link);
+  if (klass->link_state)
+    return (klass->link_state (link) & ATK_HYPERLINK_IS_INLINE);
+  else
+    return FALSE;
+}
+
+/**
  * atk_hyperlink_get_n_anchors:
  * @link_: an #AtkHyperlink
  *
Index: atk/atkhyperlink.h
===================================================================
RCS file: /cvs/gnome/atk/atk/atkhyperlink.h,v
retrieving revision 1.7
diff -u -r1.7 atkhyperlink.h
--- atk/atkhyperlink.h	8 Nov 2002 18:53:55 -0000	1.7
+++ atk/atkhyperlink.h	14 Nov 2002 13:41:29 -0000
@@ -32,6 +32,10 @@
  * It implements the AtkAction interface.
  */
 
+typedef enum {
+  ATK_HYPERLINK_IS_INLINE = 1<<0
+} AtkHyperlinkStateFlags;
+
 #define ATK_TYPE_HYPERLINK                        (atk_hyperlink_get_type ())
 #define ATK_HYPERLINK(obj)                        (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_HYPERLINK, AtkHyperlink))
 #define ATK_HYPERLINK_CLASS(klass)                (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_HYPERLINK, AtkHyperlinkClass))
@@ -85,10 +89,17 @@
    */
   gint	           (* get_n_anchors)	   (AtkHyperlink     *link_);
 
+  /*
+   * Returns a set of bitflags which encode state information.
+   * Used by non-virtualized state query methods, not intended,
+   * for direct client use.  It is virtualized, but clients should use
+   * atk_hyperlink_is_inline (), etc.
+   */
+  guint	           (* link_state)	   (AtkHyperlink     *link_);
+  
   AtkFunction      pad1;
   AtkFunction      pad2;
   AtkFunction      pad3;
-  AtkFunction      pad4;
 };
 
 GType            atk_hyperlink_get_type             (void);
@@ -104,6 +115,8 @@
 gint             atk_hyperlink_get_start_index      (AtkHyperlink     *link_);
 
 gboolean         atk_hyperlink_is_valid             (AtkHyperlink     *link_);
+
+gboolean         atk_hyperlink_is_inline             (AtkHyperlink     *link_);
 
 gint		 atk_hyperlink_get_n_anchors        (AtkHyperlink     *link_);
 
Index: atk/atkobject.c
===================================================================
RCS file: /cvs/gnome/atk/atk/atkobject.c,v
retrieving revision 1.54
diff -u -r1.54 atkobject.c
--- atk/atkobject.c	13 Nov 2002 17:09:03 -0000	1.54
+++ atk/atkobject.c	14 Nov 2002 13:41:29 -0000
@@ -1516,7 +1516,6 @@
       if (atk_relation_get_relation_type (relation) == relationship)
         {
           GPtrArray *array;
-          gint j;
 
           array = atk_relation_get_target (relation);
         
Index: atk/atkrelationtype.h
===================================================================
RCS file: /cvs/gnome/atk/atk/atkrelationtype.h,v
retrieving revision 1.1
diff -u -r1.1 atkrelationtype.h
--- atk/atkrelationtype.h	30 Oct 2002 09:42:27 -0000	1.1
+++ atk/atkrelationtype.h	14 Nov 2002 13:41:29 -0000
@@ -37,7 +37,12 @@
  *  AtkObject in a sequential way, (for instance text-flow).
  * ATK_RELATION_FLOWS_FROM: Indicates that the object has content that flows logically from
  *  another AtkObject in a sequential way, (for instance text-flow).
- * ATK_RELATION_SUBWINDOW_OF: [not sure about this one, ask peter]
+ * ATK_RELATION_SUBWINDOW_OF: [not sure about this one, ask Peter]
+ * ATK_RELATION_EMBEDS: Indicates that the object visually embeds 
+ *  another object's content, i.e. this object's content flows around 
+ *  another's content.
+ * ATK_RELATION_EMBEDDED_BY: Inverse of %ATK_RELATION_EMBEDS, indicates that
+ *  this object's content is visualy embedded in another object.
  * ATK_RELATION_LAST_DEFINED:
  * 
  *Describes the type of the relation
@@ -53,7 +58,9 @@
   ATK_RELATION_NODE_CHILD_OF,
   ATK_RELATION_FLOWS_TO,
   ATK_RELATION_FLOWS_FROM,
-  ATK_RELATION_SUBWINDOW_OF, /* not sure about this one, ask Peter */
+  ATK_RELATION_SUBWINDOW_OF, 
+  ATK_RELATION_EMBEDS, 
+  ATK_RELATION_EMBEDDED_BY, 
   ATK_RELATION_LAST_DEFINED
 } AtkRelationType;
 
Index: docs/atk-sections.txt
===================================================================
RCS file: /cvs/gnome/atk/docs/atk-sections.txt,v
retrieving revision 1.32
diff -u -r1.32 atk-sections.txt
--- docs/atk-sections.txt	30 Oct 2002 09:42:28 -0000	1.32
+++ docs/atk-sections.txt	14 Nov 2002 13:41:29 -0000
@@ -429,11 +429,13 @@
 <FILE>atkhyperlink</FILE>
 <TITLE>AtkHyperlink</TITLE>
 AtkHyperlink
+AtkHyperlinkStateFlags
 atk_hyperlink_get_uri
 atk_hyperlink_get_object
 atk_hyperlink_get_end_index
 atk_hyperlink_get_start_index
 atk_hyperlink_is_valid
+atk_hyperlink_is_inline
 atk_hyperlink_get_n_anchors
 <SUBSECTION Standard>
 ATK_HYPERLINK
Index: docs/tmpl/atkhyperlink.sgml
===================================================================
RCS file: /cvs/gnome/atk/docs/tmpl/atkhyperlink.sgml,v
retrieving revision 1.7
diff -u -r1.7 atkhyperlink.sgml
--- docs/tmpl/atkhyperlink.sgml	8 Nov 2002 18:53:56 -0000	1.7
+++ docs/tmpl/atkhyperlink.sgml	14 Nov 2002 13:41:29 -0000
@@ -69,6 +69,15 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION atk_hyperlink_is_inline ##### -->
+<para>
+
+</para>
+
+ link_: 
+ Returns: 
+
+
 <!-- ##### FUNCTION atk_hyperlink_get_n_anchors ##### -->
 <para>
 
Index: docs/tmpl/atkobject.sgml
===================================================================
RCS file: /cvs/gnome/atk/docs/tmpl/atkobject.sgml,v
retrieving revision 1.26
diff -u -r1.26 atkobject.sgml
--- docs/tmpl/atkobject.sgml	8 Nov 2002 18:53:56 -0000	1.26
+++ docs/tmpl/atkobject.sgml	14 Nov 2002 13:41:29 -0000
@@ -422,6 +422,14 @@
 @Returns: 
 
 
+<!-- ##### SIGNAL AtkObject::active-descendant-changed ##### -->
+<para>
+
+</para>
+
+ atkobject: the object which received the signal.
+ arg1: 
+
 <!-- ##### SIGNAL AtkObject::children-changed ##### -->
 <para>
 The children_changed signal supports two details, "add" and "remove" which
Index: docs/tmpl/atkrelation.sgml
===================================================================
RCS file: /cvs/gnome/atk/docs/tmpl/atkrelation.sgml,v
retrieving revision 1.11
diff -u -r1.11 atkrelation.sgml
--- docs/tmpl/atkrelation.sgml	30 Oct 2002 09:42:29 -0000	1.11
+++ docs/tmpl/atkrelation.sgml	14 Nov 2002 13:41:29 -0000
@@ -41,6 +41,8 @@
 @ATK_RELATION_FLOWS_TO: 
 @ATK_RELATION_FLOWS_FROM: 
 @ATK_RELATION_SUBWINDOW_OF: 
+ ATK_RELATION_EMBEDS: 
+ ATK_RELATION_EMBEDDED_BY: 
 @ATK_RELATION_LAST_DEFINED: 
 
 <!-- ##### FUNCTION atk_relation_type_register ##### -->
Index: tests/testrelation.c
===================================================================
RCS file: /cvs/gnome/atk/tests/testrelation.c,v
retrieving revision 1.6
diff -u -r1.6 testrelation.c
--- tests/testrelation.c	30 Oct 2002 09:42:30 -0000	1.6
+++ tests/testrelation.c	14 Nov 2002 13:41:29 -0000
@@ -52,10 +52,25 @@
       return FALSE;
     }
 
+  name = atk_relation_type_get_name (ATK_RELATION_EMBEDS);
+  g_return_val_if_fail (name, FALSE);
+  if (strcmp (name, "embeds") != 0)
+    {
+      g_print ("Unexpected name for ATK_RELATION_EMBEDS %s\n", name);
+      return FALSE;
+    }
+
+  type1 = atk_relation_type_for_name ("embedded-by");
+  if (type1 != ATK_RELATION_EMBEDDED_BY)
+    {
+      g_print ("Unexpected role for ATK_RELATION_EMBEDDED_BY\n");
+      return FALSE;
+    }
+
   type1 = atk_relation_type_for_name ("controlled-by");
   if (type1 != ATK_RELATION_CONTROLLED_BY)
     {
-      g_print ("Unexpected type for focused\n");
+      g_print ("Unexpected name for ATK_RELATION_CONTROLLED_BY\n");
       return FALSE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]