summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2011-02-22 11:33:46 -0600
committerMike Gorse <mgorse@novell.com>2011-02-25 10:43:16 -0600
commitc0a9b468cfd2b8a422a49b3d75c852d38e64db12 (patch)
treef5cc31abb2a88c9b72d5f3ea821bab27d416a084
parent8648e41f07633c61ba705782e671c07492e9ad24 (diff)
downloadatk-c0a9b468cfd2b8a422a49b3d75c852d38e64db12.tar.gz
Fix introspection for atk_text_get_bounded_ranges
-rwxr-xr-xatk/atktext.c30
-rwxr-xr-xatk/atktext.h2
2 files changed, 28 insertions, 4 deletions
diff --git a/atk/atktext.c b/atk/atktext.c
index ee3abde..76b36d9 100755
--- a/atk/atktext.c
+++ b/atk/atktext.c
@@ -966,7 +966,7 @@ atk_text_get_range_extents (AtkText *text,
/**
* atk_text_get_bounded_ranges:
* @text: an #AtkText
- * @rect: An AtkTextRectagle giving the dimensions of the bounding box.
+ * @rect: An AtkTextRectangle giving the dimensions of the bounding box.
* @coord_type: Specify whether coordinates are relative to the screen or widget window.
* @x_clip_type: Specify the horizontal clip type.
* @y_clip_type: Specify the vertical clip type.
@@ -975,8 +975,8 @@ atk_text_get_range_extents (AtkText *text,
*
* Since: 1.3
*
- * Returns: Array of AtkTextRange. The last element of the array returned
- * by this function will be NULL.
+ * Returns: (array zero-terminated=1): Array of AtkTextRange. The last
+ * element of the array returned by this function will be NULL.
**/
AtkTextRange**
atk_text_get_bounded_ranges (AtkText *text,
@@ -1365,10 +1365,32 @@ atk_text_free_ranges (AtkTextRange **ranges)
AtkTextRange *range;
range = *ranges;
- *ranges++;
+ ranges++;
g_free (range->content);
g_free (range);
}
g_free (first);
}
}
+
+static AtkTextRange *
+atk_text_range_copy (AtkTextRange *src)
+{
+ AtkTextRange *dst = g_new0 (AtkTextRange, 1);
+ dst->bounds = src->bounds;
+ dst->start_offset = src->start_offset;
+ dst->end_offset = src->end_offset;
+ if (src->content)
+ dst->content = g_strdup (src->content);
+ return dst;
+}
+
+static void
+atk_text_range_free (AtkTextRange *range)
+{
+ g_free (range->content);
+ g_free (range);
+}
+
+G_DEFINE_BOXED_TYPE (AtkTextRange, atk_text_range, atk_text_range_copy,
+ atk_text_range_free)
diff --git a/atk/atktext.h b/atk/atktext.h
index 1b7a038..285f1ac 100755
--- a/atk/atktext.h
+++ b/atk/atktext.h
@@ -174,6 +174,8 @@ struct _AtkTextRange {
gchar* content;
};
+GType atk_text_range_get_type ();
+
/**
*AtkTextClipType
*@ATK_TEXT_CLIP_NONE: No clipping to be done