Here is a patch for
authorBrian Cameron <bcameron@src.gnome.org>
Thu, 21 Jun 2001 15:59:44 +0000 (15:59 +0000)
committerBrian Cameron <bcameron@src.gnome.org>
Thu, 21 Jun 2001 15:59:44 +0000 (15:59 +0000)
 atkeditabletext.h
 atkobject.h
 atktext.c
 atktext.h

in atk/atk. There is a new convenience function in atktext.[ch] called
AtkAttributeSet_free() which frees an AtkAttributeSet. I have also removed the
definitions of AtkAttribute and AtkAttributeSet from atkobject.h and moved them
to atktext.h. atkeditabletext.h now #includes atktext.h so it has access to
these definitions. I have discussed these changes with Bill.

ChangeLog
atk/atkeditabletext.h
atk/atkobject.h
atk/atktext.c
atk/atktext.h

index 3abd4a1fa77abcb334b08983aea8333a4697b866..628a949e3d0ad92906e056ea91ecb47427f7bb2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-21  Brian Cameron <brian.cameron@sun.com>
+       * atk/atkeditabletext.h, atk/atkobject.h,
+       atktext.[ch]
+       Added AtkAttributeSet_free() convenience
+       function.
+
 2001-06-20  Peter Williams  <peterw@ximian.com>
        * atk/atknoopobject.h: Correct prototype name: agtk_widget_get_type ->
        atk_no_op_object_get_type. Change #ifdef __cplusplus mess to nicer
index 1341876a7af64b92c7ca14bcd458db97c492a4d4..3f919f7f933cb0aaee995c873d2f6a581a4d5566 100755 (executable)
@@ -22,6 +22,7 @@
 
 #include <pango/pango.h>
 #include <atk/atkobject.h>
+#include <atk/atktext.h>
 
 #ifdef __cplusplus
 extern "C" {
index dce53889678af49beb0cb02178e2dc37fe9a5a4b..ef61292e8456e496840222074fdafb67b1110474 100755 (executable)
@@ -35,15 +35,6 @@ extern "C" {
  * of the following interfaces:
  */
 
-/* AtkAttributeSet & AtkAttribute are needed by atktext and atkeditable text */
-/* so I am putting them here until a better place for them to be defined is  */
-/* decided */
-typedef GSList AtkAttributeSet;
-
-typedef struct _AtkAttribute {
-  gchar* name;
-  gchar* value;
-}AtkAttribute;
 
 /**
  *AtkRole:
index 95b18b8a9f3f76c1e9d6b82db82b4223199975b3..c06870396bf25690cd125161df2e3f6306df6705 100755 (executable)
@@ -600,3 +600,27 @@ atk_text_set_caret_offset (AtkText *text,
       return FALSE;
     }
 }
+
+/**
+ * AtkAttributeSet_free:
+ * @attrib_set: The #AtkAttributeSet to free
+ *
+ * Frees the memory used by an #AtkAttributeSet, including all its
+ * #AtkAttributes
+ *
+ **/
+void
+AtkAttributeSet_free(AtkAttributeSet *attrib_set)
+{
+  gint index;
+
+  if (attrib_set == NULL)
+    return;
+
+  for (index = 0; index < g_slist_length(attrib_set); index++)
+  {
+    g_free(((AtkAttribute*) (g_slist_nth(attrib_set,index)->data))->name);
+    g_free(((AtkAttribute*) (g_slist_nth(attrib_set,index)->data))->value);
+  }
+  g_slist_free(attrib_set);
+}
index 507d69c73647b62a60afe0c704d4d7286a420865..56c8f21a5664a75e56ea193f81c2feb006f7fe60 100755 (executable)
 extern "C" {
 #endif /* __cplusplus */
 
+typedef GSList AtkAttributeSet;
+
+typedef struct _AtkAttribute {
+  gchar* name;
+  gchar* value;
+}AtkAttribute;
+
 #define ATK_TYPE_TEXT                    (atk_text_get_type ())
 #define ATK_IS_TEXT(obj)                 G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TEXT)
 #define ATK_TEXT(obj)                    G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TEXT, AtkText)
@@ -202,6 +209,7 @@ gboolean      atk_text_set_selection                      (AtkText          *tex
                                                           gint             end_offset);
 gboolean      atk_text_set_caret_offset                   (AtkText          *text,
                                                            gint             offset);
+void         AtkAttributeSet_free                        (AtkAttributeSet  *attrib_set);
 
 #ifdef __cplusplus
 }