Change atk_relation_type_from_string to atk_relation_type_for_name Add
authorPadraig O'Briain <padraigo@src.gnome.org>
Thu, 22 Nov 2001 15:58:58 +0000 (15:58 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Thu, 22 Nov 2001 15:58:58 +0000 (15:58 +0000)
* atk/atk.def, atk/atkrelationtype.h, docs/atk-sections.txt,
docs/tmpl/atkrelation.sgml:
Change atk_relation_type_from_string to atk_relation_type_for_name
Add atk_relation_type_get_name

* atk/atkrelationtype.c:
Change atk_relation_type_from_string to atk_relation_type_for_name
Add atk_relation_type_get_name
Update atk_relation_type_register() to correctly register new
relation types

* atk/atkstate.c:
Changed name of static variable type to last_type
Changed name of paremeter if atk_state_type_get_name to type to match
comments

* docs/tmpl/*sgml
Updated files

* tests/README, tests/Makefile.am
Add new test file testrelation.c

30 files changed:
ChangeLog
atk/atk.def
atk/atkrelation.c
atk/atkrelation.h
atk/atkstate.c
docs/atk-sections.txt
docs/tmpl/atk-unused.sgml
docs/tmpl/atkaction.sgml
docs/tmpl/atkcomponent.sgml
docs/tmpl/atkeditabletext.sgml
docs/tmpl/atkhypertext.sgml
docs/tmpl/atkimage.sgml
docs/tmpl/atknoopobject.sgml
docs/tmpl/atknoopobjectfactory.sgml
docs/tmpl/atkobject.sgml
docs/tmpl/atkobjectfactory.sgml
docs/tmpl/atkregistry.sgml
docs/tmpl/atkrelation.sgml
docs/tmpl/atkrelationset.sgml
docs/tmpl/atkselection.sgml
docs/tmpl/atkstate.sgml
docs/tmpl/atkstateset.sgml
docs/tmpl/atkstreamablecontent.sgml
docs/tmpl/atktable.sgml
docs/tmpl/atktext.sgml
docs/tmpl/atkutil.sgml
docs/tmpl/atkvalue.sgml
tests/Makefile.am
tests/README
tests/testrelation.c [new file with mode: 0644]

index 3dd92a6..1901f1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2001-11-22  Padraig O'Briain  <padraig.obriain@sun.com>
+
+       * atk/atk.def, atk/atkrelationtype.h, docs/atk-sections.txt,
+       docs/tmpl/atkrelation.sgml:
+       Change atk_relation_type_from_string to atk_relation_type_for_name
+       Add atk_relation_type_get_name
+
+       * atk/atkrelationtype.c:
+       Change atk_relation_type_from_string to atk_relation_type_for_name
+       Add atk_relation_type_get_name
+       Update atk_relation_type_register() to correctly register new
+       relation types
+
+       * atk/atkstate.c:
+       Changed name of static variable type to last_type
+       Changed name of paremeter if atk_state_type_get_name to type to match
+       comments
+
+       * docs/tmpl/*sgml
+       Updated files
+
+       * tests/README, tests/Makefile.am       
+       Add new test file testrelation.c
+
 2001-11-22  Bill Haneman <bill.haneman@sun.com>
 
        * atk/atkutil.c (atk_add_key_event_listener):
index cb87a4f..81eebc2 100644 (file)
@@ -99,7 +99,8 @@ EXPORTS
        atk_relation_set_get_type
        atk_relation_set_new
        atk_relation_set_remove
-       atk_relation_type_from_string
+       atk_relation_type_get_name
+       atk_relation_type_for_name
        atk_relation_type_register
        atk_remove_focus_tracker
        atk_remove_global_event_listener
index e1d8944..9737fb1 100755 (executable)
 #include "atkobject.h"
 #include "atkrelation.h"
 
+static gchar *relation_names[ATK_RELATION_LAST_DEFINED] = {
+  "null",
+  "controlled_by",
+  "controller_for",
+  "label_for",
+  "labelled_by",
+  "member_of",
+  "node_child_of"
+};
+
+GPtrArray *extra_names = NULL;
+  
 static void            atk_relation_class_init       (AtkRelationClass  *klass);
 static void            atk_relation_finalize         (GObject           *object);
 
@@ -68,14 +80,48 @@ atk_relation_class_init (AtkRelationClass *klass)
 AtkRelationType
 atk_relation_type_register (const gchar *name)
 {
-  /* TODO: associate name with new type */
-  static guint type = ATK_RELATION_LAST_DEFINED;
-  return (++type);
+  g_return_val_if_fail (name, ATK_RELATION_NULL);
+
+  if (!extra_names)
+    extra_names = g_ptr_array_new ();
+
+  g_ptr_array_add (extra_names, g_strdup (name));
+  return extra_names->len + ATK_RELATION_LAST_DEFINED - 1;
 }
 
+/**
+ * atk_relation_type_get_name:
+ * @type: The #AtkRelationType whose name is required
+ *
+ * Gets the description string describing the #AtkRelationType @type.
+ *
+ * Returns: the string describing the AtkRelationType
+ */
+G_CONST_RETURN gchar*
+atk_relation_type_get_name (AtkRelationType type)
+{
+  gint n;
+
+  n = type;
+
+  if (n >= 0)
+    {
+      if (n < ATK_RELATION_LAST_DEFINED)
+        return relation_names[n];
+      else if (extra_names)
+        {
+          n -= ATK_RELATION_LAST_DEFINED;
+
+          if (n < extra_names->len)
+            return g_ptr_array_index (extra_names, n);
+        }
+    }
+  return ATK_RELATION_NULL;
+
+}
 
 /**
- * atk_relation_type_from_string:
+ * atk_relation_type_for_name:
  * @name: a string which is the (non-localized) name of an ATK relation type.
  *
  * Get the #AtkRelationType type corresponding to a relation name.
@@ -84,18 +130,31 @@ atk_relation_type_register (const gchar *name)
  *          or #ATK_RELATION_NULL if no matching relation type is found.
  **/
 AtkRelationType
-atk_relation_type_from_string (const gchar *name)
+atk_relation_type_for_name (const gchar *name)
 {
-  /*
-   * TODO: implement properly,
-   *  checking type namelist in conjunction with above function.
-   */
-       if ( !strcmp (name, "controlled_by") ) return ATK_RELATION_CONTROLLED_BY;
-       else if (!strcmp (name, "controller_for")) return ATK_RELATION_CONTROLLER_FOR;
-       else if (!strcmp (name, "label_for")) return ATK_RELATION_LABEL_FOR;
-       else if (!strcmp (name, "labelled_by")) return ATK_RELATION_LABELLED_BY;
-       else if (!strcmp (name, "member_of")) return ATK_RELATION_MEMBER_OF;
-       else return ATK_RELATION_NULL;
+  gint i;
+
+  g_return_val_if_fail (name, ATK_RELATION_NULL);
+
+  for (i = 0; i < ATK_RELATION_LAST_DEFINED; i++)
+    {
+      if (strcmp (name, relation_names[i]) == 0)
+        return i;
+    }
+
+  if (extra_names)
+    {
+      for (i = 0; i < extra_names->len; i++)
+        {
+          gchar *extra_name = (gchar *)g_ptr_array_index (extra_names, i);
+
+          g_return_val_if_fail (extra_name, ATK_RELATION_NULL);
+         
+          if (strcmp (name, extra_name) == 0)
+            return i + ATK_RELATION_LAST_DEFINED;
+        }
+    }
+  return ATK_RELATION_NULL;
 }
 
 
index ba39ec2..ae02889 100755 (executable)
@@ -83,25 +83,25 @@ struct _AtkRelationClass
 
 GType atk_relation_get_type (void);
 
-AtkRelationType atk_relation_type_register            (const gchar *name);
-
-AtkRelationType atk_relation_type_from_string         (const gchar *name);
+AtkRelationType       atk_relation_type_register      (const gchar     *name);
+G_CONST_RETURN gchar* atk_relation_type_get_name      (AtkRelationType type);
+AtkRelationType       atk_relation_type_for_name      (const gchar     *name);
 
 /*
  * Create a new relation for the specified key and the specified list
  * of targets.
  */
-AtkRelation*    atk_relation_new                      (AtkObject       **targets,
+AtkRelation*          atk_relation_new                (AtkObject       **targets,
                                                        gint            n_targets,
                                                        AtkRelationType relationship);
 /*
  * Returns the type of a relation.
  */
-AtkRelationType atk_relation_get_relation_type        (AtkRelation     *relation);
+AtkRelationType       atk_relation_get_relation_type  (AtkRelation     *relation);
 /*
  * Returns the target list of a relation.
  */
-GPtrArray*      atk_relation_get_target               (AtkRelation     *relation);
+GPtrArray*            atk_relation_get_target         (AtkRelation     *relation);
 
 #ifdef __cplusplus
 }
index 673319f..d56b14e 100755 (executable)
@@ -21,7 +21,7 @@
 
 #include <string.h>
 
-static guint type = ATK_STATE_LAST_DEFINED;
+static guint last_type = ATK_STATE_LAST_DEFINED;
 
 #define NUM_POSSIBLE_STATES               (sizeof(AtkState)*8)
 
@@ -68,12 +68,13 @@ static gchar* state_names[NUM_POSSIBLE_STATES] = {
 AtkStateType
 atk_state_type_register (const gchar *name)
 {
+  g_return_val_if_fail (name, ATK_STATE_INVALID);
 
-  if (type < NUM_POSSIBLE_STATES -1)
-  {
-    state_names[++type] = g_strdup (name); 
-    return (type);
-  }
+  if (last_type < NUM_POSSIBLE_STATES -1)
+    {
+      state_names[++last_type] = g_strdup (name); 
+      return (last_type);
+    }
   return ATK_STATE_INVALID; /* caller needs to check */
 }
 
@@ -83,17 +84,18 @@ atk_state_type_register (const gchar *name)
  *
  * Gets the description string describing the #AtkStateType @type.
  *
- * Returns: the string describing the state
+ * Returns: the string describing the AtkStateType
  */
 G_CONST_RETURN gchar*
-atk_state_type_get_name (AtkStateType state)
+atk_state_type_get_name (AtkStateType type)
 {
   gint n;
 
-  if (state < type)
+  if (type < last_type)
     {
-      n = state; 
-      return state_names[n];
+      n = type; 
+      if (n >= 0)
+        return state_names[n];
     }
 
   return NULL;
@@ -115,12 +117,12 @@ atk_state_type_for_name (const gchar *name)
   g_return_val_if_fail (name != NULL, 0);
   g_return_val_if_fail (strlen (name) > 0, 0);
 
-  for (i = 0; i < type; i++)
-  {
-    if (state_names[i] == NULL)
-      continue; 
-    if (!strcmp(name, state_names[i])) 
-      return i;
-  }
+  for (i = 0; i < last_type; i++)
+    {
+      if (state_names[i] == NULL)
+        continue; 
+      if (!strcmp(name, state_names[i])) 
+        return i;
+    }
   return 0;
 }
index c65deff..c2f5474 100644 (file)
@@ -227,7 +227,8 @@ ATK_REGISTRY_GET_CLASS
 AtkRelation
 AtkRelationType
 atk_relation_type_register
-atk_relation_type_from_string
+atk_relation_type_get_name
+atk_relation_type_for_name
 atk_relation_new
 atk_relation_get_relation_type
 atk_relation_get_target
index 4ca20da..e69de29 100644 (file)
@@ -1,182 +0,0 @@
-<!-- ##### SECTION ./tmpl/atk.sgml:Long_Description ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### SECTION ./tmpl/atk.sgml:See_Also ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### SECTION ./tmpl/atk.sgml:Short_Description ##### -->
-
-
-
-<!-- ##### SECTION ./tmpl/atk.sgml:Title ##### -->
-atk
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_BG_COLOR ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_BG_FULL_HEIGHT ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_BG_STIPPLE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_DIRECTION ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_EDITABLE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_FAMILY_NAME ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_FG_COLOR ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_FG_STIPPLE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_INDENT ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_INVISIBLE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_JUSTIFICATION ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_LANGUAGE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_LEFT_MARGIN ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_PIXELS_ABOVE_LINES ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_PIXELS_BELOW_LINES ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_PIXELS_INSIDE_WRAP ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_RIGHT_MARGIN ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_RISE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_SCALE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_SIZE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_STRETCH ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_STRIKETHROUGH ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_STYLE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_UNDERLINE ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_VARIANT ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_WEIGHT ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ATK_ATTRIBUTE_WRAP_MODE ##### -->
-<para>
-
-</para>
-
-
index f744c7d..668cdb9 100644 (file)
@@ -2,15 +2,11 @@
 AtkAction
 
 <!-- ##### SECTION Short_Description ##### -->
-accessibility interface for objects that can perform actions
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The interface AtkAction should be supported by any object that can 
-perform one or more actions. The interface provides the standard 
-mechanism for an assistive technology to determine what those actions 
-are as well as tell the object to perform them. Any object that can 
-be manipulated should support this interface.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index bde93a5..046d8d4 100644 (file)
@@ -2,14 +2,11 @@
 AtkComponent
 
 <!-- ##### SECTION Short_Description ##### -->
-accessibility interface for objects that are rendered on the screen
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkComponent interface should be supported by any object that is 
-rendered on the screen. The interface provides the standard mechanism 
-for an assistive technology to determine and set the graphical
-representation of an object.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 1f9d147..c577880 100644 (file)
@@ -2,12 +2,11 @@
 AtkEditableText
 
 <!-- ##### SECTION Short_Description ##### -->
-accessibility interface for editable text widgets
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-AtkEditableText is used to support access in an "accessibility" context
-to editing features of editable text widgets.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index f410f78..f96dbbf 100644 (file)
@@ -2,16 +2,11 @@
 AtkHypertext
 
 <!-- ##### SECTION Short_Description ##### -->
-the base class for all classes that present hypertext information
-on the display
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkHypertext class is the base class for all classes that present 
-hypertext information on the display. This class provides the standard 
-mechanism for an assistive technology to access that text via its 
-content, attributes, and spatial location. It also provides standard 
-mechanisms for manipulating hyperlinks.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 8d0a6bc..e6558cc 100644 (file)
@@ -2,13 +2,11 @@
 AtkImage
 
 <!-- ##### SECTION Short_Description ##### -->
-accessibility interface for objects that have an associated image
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkImage interface should be supported by any object that has an 
-associated image. This interface provides the standard mechanism for 
-an assistive technology to get descriptive information about images.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 2a6a21e..05f545e 100644 (file)
@@ -2,11 +2,11 @@
 AtkNoOpObject
 
 <!-- ##### SECTION Short_Description ##### -->
-provides non-functioning stub #AtkObjects
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-Provides non-functioning stub #AtkObjects. 
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 38c2c3e..ccac1bb 100644 (file)
@@ -2,11 +2,11 @@
 AtkNoOpObjectFactory
 
 <!-- ##### SECTION Short_Description ##### -->
-an #AtkObjectFactory which creates non-functioning stub #AtkObjects
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-An #AtkObjectFactory which creates non-functioning stub #AtkObjects.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 5c895d7..164a459 100644 (file)
@@ -2,16 +2,11 @@
 AtkObject
 
 <!-- ##### SECTION Short_Description ##### -->
-represents the minimum information all accessible objects return
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-AtkObject represents the minimum information all accessible objects
-return. This information includes accessible name, accessible
-description, role and state of the object, as well information about
-its parent and children. It is also possible to obtain more specific
-accessibility information about a component if it supports one or more
-of the other ATK interfaces:
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
@@ -250,8 +245,6 @@ of the other ATK interfaces:
 
 @accessible: 
 @Returns: 
-<!-- # Unused Parameters # -->
-@acessible: 
 
 
 <!-- ##### FUNCTION atk_object_get_role ##### -->
index 77b6827..740c1a9 100644 (file)
@@ -2,11 +2,10 @@
 AtkObjectFactory
 
 <!-- ##### SECTION Short_Description ##### -->
-factory for creating #AtkObjects
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-A factory for creating #AtkObjects.
 
 </para>
 
index 61d2dfb..b561a11 100644 (file)
@@ -2,11 +2,10 @@
 AtkRegistry
 
 <!-- ##### SECTION Short_Description ##### -->
-registry for registering new #AtkObject factories
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-A registry for registering new #AtkObject factories.
 
 </para>
 
index 04d11da..f0041ae 100644 (file)
@@ -2,11 +2,11 @@
 AtkRelation
 
 <!-- ##### SECTION Short_Description ##### -->
-defines the functional relationship between two #AtkObjects
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-Defines the functional relationship between two #AtkObjects.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
@@ -46,7 +46,16 @@ Defines the functional relationship between two #AtkObjects.
 @Returns: 
 
 
-<!-- ##### FUNCTION atk_relation_type_from_string ##### -->
+<!-- ##### FUNCTION atk_relation_type_get_name ##### -->
+<para>
+
+</para>
+
+@type: 
+@Returns: 
+
+
+<!-- ##### FUNCTION atk_relation_type_for_name ##### -->
 <para>
 
 </para>
index 6a12432..b04560d 100644 (file)
@@ -2,13 +2,10 @@
 AtkRelationSet
 
 <!-- ##### SECTION Short_Description ##### -->
-a set of #AtkRelations, which define the functional relationships
-between #AtkObjects
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-A set of #AtkRelations, which define the functional relationships
-between #AtkObjects.
 
 </para>
 
index 609b356..fdeb7b7 100644 (file)
@@ -2,15 +2,11 @@
 AtkSelection
 
 <!-- ##### SECTION Short_Description ##### -->
-accessibility interface for determining what the current selected 
-children are, as well as modify the selection set
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkSelection interface provides the standard mechanism for an 
-assistive technology to determine what the current selected children are, 
-as well as modify the selection set. Any object that has children that 
-can be selected should support the AtkSelection interface.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 28087e9..e29a4da 100644 (file)
@@ -2,13 +2,11 @@
 AtkState
 
 <!-- ##### SECTION Short_Description ##### -->
-describes an objects particular state
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-AtkState describes an objects particular state. The actual state of the 
-object is defined as an #AtkStateSet, which is a composed set of 
-AtkStates.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 972f435..08afaa7 100644 (file)
@@ -2,13 +2,11 @@
 AtkStateSet
 
 <!-- ##### SECTION Short_Description ##### -->
-determines an object's state set
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-AtkStateSet determines an object's state set. The state set of an object 
-is a set of AtkState objects and describes the current 
-overall state of the object, such as whether it is active, has focus, etc. 
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 8eab311..5cef56f 100644 (file)
@@ -2,12 +2,11 @@
 AtkStreamableContent
 
 <!-- ##### SECTION Short_Description ##### -->
-accessibility interface for objects that contain streamable content
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkStreamableContent interface should be supported by any object
-that contains streamable content.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 25dc585..0ed4e6d 100644 (file)
@@ -172,8 +172,6 @@ AtkTable
 @table: 
 @row: 
 @Returns: 
-<!-- # Unused Parameters # -->
-@r: 
 
 
 <!-- ##### FUNCTION atk_table_get_column_header ##### -->
@@ -212,8 +210,6 @@ AtkTable
 
 @table: 
 @caption: 
-<!-- # Unused Parameters # -->
-@accessible: 
 
 
 <!-- ##### FUNCTION atk_table_set_row_description ##### -->
@@ -224,8 +220,6 @@ AtkTable
 @table: 
 @row: 
 @description: 
-<!-- # Unused Parameters # -->
-@accessible: 
 
 
 <!-- ##### FUNCTION atk_table_set_column_description ##### -->
@@ -236,8 +230,6 @@ AtkTable
 @table: 
 @column: 
 @description: 
-<!-- # Unused Parameters # -->
-@accessible: 
 
 
 <!-- ##### FUNCTION atk_table_set_row_header ##### -->
index 5e157ba..1922edb 100644 (file)
@@ -139,9 +139,6 @@ AtkText
 @start_offset: 
 @end_offset: 
 @Returns: 
-<!-- # Unused Parameters # -->
-@startOffset: 
-@endOffset: 
 
 
 <!-- ##### FUNCTION atk_text_get_text_at_offset ##### -->
@@ -155,9 +152,6 @@ AtkText
 @start_offset: 
 @end_offset: 
 @Returns: 
-<!-- # Unused Parameters # -->
-@startOffset: 
-@endOffset: 
 
 
 <!-- ##### FUNCTION atk_text_get_text_before_offset ##### -->
@@ -171,9 +165,6 @@ AtkText
 @start_offset: 
 @end_offset: 
 @Returns: 
-<!-- # Unused Parameters # -->
-@startOffset: 
-@endOffset: 
 
 
 <!-- ##### FUNCTION atk_text_get_caret_offset ##### -->
@@ -197,8 +188,6 @@ AtkText
 @width: 
 @height: 
 @coords: 
-<!-- # Unused Parameters # -->
-@length: 
 
 
 <!-- ##### FUNCTION atk_text_get_run_attributes ##### -->
index bd03dde..fd370eb 100644 (file)
@@ -2,11 +2,11 @@
 AtkUtil
 
 <!-- ##### SECTION Short_Description ##### -->
-general purpose utility class
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkUtility interface provides general purpose utility functions.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 611271c..0dc4e18 100644 (file)
@@ -2,17 +2,11 @@
 AtkValue
 
 <!-- ##### SECTION Short_Description ##### -->
-the  standard mechanism for an assistive technology to 
-determine and set numerical values as well as get minimum 
-and maximum values
+
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The AtkValue interface should be supported by any object that 
-supports a numerical value (e.g., a scroll bar). This interface 
-provides the standard mechanism for an assistive technology to 
-determine and set the numerical value as well as get the minimum 
-and maximum values.
+
 </para>
 
 <!-- ##### SECTION See_Also ##### -->
index 6e6767d..33d4bb8 100644 (file)
@@ -1,5 +1,7 @@
 
-lib_LTLIBRARIES = libteststateset.la
+lib_LTLIBRARIES = \
+       libteststateset.la      \
+       libtestrelation.la
 
 libatk = $(top_builddir)/atk/libatk.la
 
@@ -11,3 +13,7 @@ DEPS = \
 libteststateset_la_SOURCES = teststateset.c
 libteststateset_la_LDFLAGS = -avoid-version    \
        -module
+
+libtestrelation_la_SOURCES = testrelation.c
+libtestrelation_la_LDFLAGS = -avoid-version    \
+       -module
index b3973c0..91ed76b 100644 (file)
@@ -4,4 +4,8 @@ GTK program by specifying the GTK_MODULES environment variable.
 
 teststateset
 ============
-This module tests the interfaces in atk/atkstatset.h
+This module tests the interfaces in atk/atkstateset.h
+
+testrelation
+============
+This module tests the interfaces in atk/atkrelation.h
diff --git a/tests/testrelation.c b/tests/testrelation.c
new file mode 100644 (file)
index 0000000..9ffaec2
--- /dev/null
@@ -0,0 +1,101 @@
+/* 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.
+ */
+
+#include <atk/atk.h>
+
+#include <string.h>
+
+static gboolean  test_relation (void);
+
+static gboolean
+test_relation (void)
+{
+  AtkRelationType type1, type2;
+  G_CONST_RETURN gchar *name;
+
+  name = atk_relation_type_get_name (ATK_RELATION_LABEL_FOR);
+  g_return_val_if_fail (name, FALSE);
+  if (strcmp (name, "label_for") != 0)
+    {
+      g_print ("Unexpected name for ATK_RELATION_LABEL_FOR %s\n", name);
+      return FALSE;
+    }
+
+  name = atk_relation_type_get_name (ATK_RELATION_NODE_CHILD_OF);
+  g_return_val_if_fail (name, FALSE);
+  if (strcmp (name, "node_child_of") != 0)
+    {
+      g_print ("Unexpected name for ATK_STATE_MODAL %s\n", name);
+      return FALSE;
+    }
+
+  type1 = atk_relation_type_for_name ("controlled_by");
+  if (type1 != ATK_RELATION_CONTROLLED_BY)
+    {
+      g_print ("Unexpected type for focused\n");
+      return FALSE;
+    }
+
+  type1 = atk_relation_type_register ("test_state");
+  name = atk_relation_type_get_name (type1);
+  g_return_val_if_fail (name, FALSE);
+  if (strcmp (name, "test_state") != 0)
+    {
+      g_print ("Unexpected name for test_state %s\n", name);
+      return FALSE;
+    }
+  type2 = atk_relation_type_for_name ("test_state");
+  if (type1 != type2)
+  {
+    g_print ("Unexpected type for test_state\n");
+    return FALSE;
+  }
+  type2 = atk_relation_type_for_name ("TEST-STATE");
+  if (type2 != 0)
+    {
+      g_print ("Unexpected type for TEST-STATE\n");
+      return FALSE;
+    }
+  /*
+   * Check that a non-existent type returns NULL
+   */
+  name = atk_relation_type_get_name (ATK_RELATION_LAST_DEFINED + 2);
+  if (name)
+    {
+      g_print ("Unexpected name for undefined type\n");
+      return FALSE;
+    }
+  return TRUE;
+}
+
+int
+gtk_module_init (gint  argc, 
+                 char* argv[])
+{
+  gboolean b_ret;
+
+  g_print("Relation test module loaded\n");
+
+  b_ret = test_relation ();
+  if (b_ret)
+    g_print ("Relation tests succeeded\n");
+  else
+    g_print ("Relation tests failed\n");
+  return 0;
+}