summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <bcameron@src.gnome.org>2001-06-21 15:59:44 +0000
committerBrian Cameron <bcameron@src.gnome.org>2001-06-21 15:59:44 +0000
commit0dea9a34a2d8906d55d3b961fb821e2c731c4c08 (patch)
tree7e1f41f7d6945b7473e770bdc67ab8364374fa6c
parentd051eba08172fd3fbdff608914ec3c7bab4d8139 (diff)
downloadatk-0dea9a34a2d8906d55d3b961fb821e2c731c4c08.tar.gz
Here is a patch for
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.
-rw-r--r--ChangeLog6
-rwxr-xr-xatk/atkeditabletext.h1
-rwxr-xr-xatk/atkobject.h9
-rwxr-xr-xatk/atktext.c24
-rwxr-xr-xatk/atktext.h8
5 files changed, 39 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 3abd4a1..628a949 100644
--- 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
diff --git a/atk/atkeditabletext.h b/atk/atkeditabletext.h
index 1341876..3f919f7 100755
--- a/atk/atkeditabletext.h
+++ b/atk/atkeditabletext.h
@@ -22,6 +22,7 @@
#include <pango/pango.h>
#include <atk/atkobject.h>
+#include <atk/atktext.h>
#ifdef __cplusplus
extern "C" {
diff --git a/atk/atkobject.h b/atk/atkobject.h
index dce5388..ef61292 100755
--- a/atk/atkobject.h
+++ b/atk/atkobject.h
@@ -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:
diff --git a/atk/atktext.c b/atk/atktext.c
index 95b18b8..c068703 100755
--- a/atk/atktext.c
+++ b/atk/atktext.c
@@ -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);
+}
diff --git a/atk/atktext.h b/atk/atktext.h
index 507d69c..56c8f21 100755
--- a/atk/atktext.h
+++ b/atk/atktext.h
@@ -29,6 +29,13 @@
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
}