diff options
author | Brian Cameron <bcameron@src.gnome.org> | 2001-06-21 15:59:44 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2001-06-21 15:59:44 +0000 |
commit | 0dea9a34a2d8906d55d3b961fb821e2c731c4c08 (patch) | |
tree | 7e1f41f7d6945b7473e770bdc67ab8364374fa6c /atk | |
parent | d051eba08172fd3fbdff608914ec3c7bab4d8139 (diff) | |
download | atk-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.
Diffstat (limited to 'atk')
-rwxr-xr-x | atk/atkeditabletext.h | 1 | ||||
-rwxr-xr-x | atk/atkobject.h | 9 | ||||
-rwxr-xr-x | atk/atktext.c | 24 | ||||
-rwxr-xr-x | atk/atktext.h | 8 |
4 files changed, 33 insertions, 9 deletions
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 } |