+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
#include <pango/pango.h>
#include <atk/atkobject.h>
+#include <atk/atktext.h>
#ifdef __cplusplus
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:
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);
+}
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)
gint end_offset);
gboolean atk_text_set_caret_offset (AtkText *text,
gint offset);
+void AtkAttributeSet_free (AtkAttributeSet *attrib_set);
#ifdef __cplusplus
}