summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--atk/atkcomponent.c4
-rw-r--r--atk/atkcomponent.h31
-rw-r--r--atk/atksocket.c2
-rw-r--r--atk/atksocket.h2
-rw-r--r--atk/atktext.c35
-rw-r--r--atk/atktext.h2
6 files changed, 48 insertions, 28 deletions
diff --git a/atk/atkcomponent.c b/atk/atkcomponent.c
index 080d521..3949116 100644
--- a/atk/atkcomponent.c
+++ b/atk/atkcomponent.c
@@ -623,8 +623,8 @@ atk_component_scroll_to (AtkComponent *component,
* @x: x-position where to scroll to
* @y: y-position where to scroll to
*
- * Makes an object visible on the screen at a given position by scrolling all
- * necessary parents.
+ * Move the top-left of @component to a given position of the screen by
+ * scrolling all necessary parents.
*
* Returns: whether scrolling was successful.
*
diff --git a/atk/atkcomponent.h b/atk/atkcomponent.h
index 72e9f7d..ae66772 100644
--- a/atk/atkcomponent.h
+++ b/atk/atkcomponent.h
@@ -31,18 +31,18 @@ G_BEGIN_DECLS
/**
* AtkScrollType:
- * @ATK_SCROLL_TOP_LEFT: Scroll the object vertically and horizontally to the top
- * left corner of the window.
- * @ATK_SCROLL_BOTTOM_RIGHT: Scroll the object vertically and horizontally to the
- * bottom right corner of the window.
- * @ATK_SCROLL_TOP_EDGE: Scroll the object vertically to the top edge of the
- * window.
- * @ATK_SCROLL_BOTTOM_EDGE: Scroll the object vertically to the bottom edge of
- * the window.
- * @ATK_SCROLL_LEFT_EDGE: Scroll the object vertically and horizontally to the
- * left edge of the window.
- * @ATK_SCROLL_RIGHT_EDGE: Scroll the object vertically and horizontally to the
- * right edge of the window.
+ * @ATK_SCROLL_TOP_LEFT: Scroll the object vertically and horizontally to bring
+ * its top left corner to the top left corner of the window.
+ * @ATK_SCROLL_BOTTOM_RIGHT: Scroll the object vertically and horizontally to
+ * bring its bottom right corner to the bottom right corner of the window.
+ * @ATK_SCROLL_TOP_EDGE: Scroll the object vertically to bring its top edge to
+ * the top edge of the window.
+ * @ATK_SCROLL_BOTTOM_EDGE: Scroll the object vertically to bring its bottom
+ * edge to the bottom edge of the window.
+ * @ATK_SCROLL_LEFT_EDGE: Scroll the object vertically and horizontally to bring
+ * its left edge to the left edge of the window.
+ * @ATK_SCROLL_RIGHT_EDGE: Scroll the object vertically and horizontally to
+ * bring its right edge to the right edge of the window.
* @ATK_SCROLL_ANYWHERE: Scroll the object vertically and horizontally so that
* as much as possible of the object becomes visible. The exact placement is
* determined by the application.
@@ -203,6 +203,13 @@ struct _AtkComponentIface
/*
* Scrolls this object so it becomes visible on the screen.
+ *
+ * scroll_to lets the implementation compute an appropriate target
+ * position on the screen, with type used as a positioning hint.
+ *
+ * scroll_to_point lets the client specify a precise target position
+ * on the screen for the top-left of the object.
+ *
* Since ATK 2.30
*/
gboolean (*scroll_to) (AtkComponent *component,
diff --git a/atk/atksocket.c b/atk/atksocket.c
index b6ca43d..887fb5c 100644
--- a/atk/atksocket.c
+++ b/atk/atksocket.c
@@ -136,7 +136,7 @@ atk_socket_new (void)
* Since: 1.30
**/
void
-atk_socket_embed (AtkSocket* obj, gchar* plug_id)
+atk_socket_embed (AtkSocket* obj, const gchar* plug_id)
{
AtkSocketClass *klass;
diff --git a/atk/atksocket.h b/atk/atksocket.h
index 54a98af..09bd0fb 100644
--- a/atk/atksocket.h
+++ b/atk/atksocket.h
@@ -62,7 +62,7 @@ struct _AtkSocketClass
ATK_AVAILABLE_IN_ALL
AtkObject* atk_socket_new (void);
ATK_AVAILABLE_IN_ALL
-void atk_socket_embed (AtkSocket* obj, gchar* plug_id);
+void atk_socket_embed (AtkSocket* obj, const gchar* plug_id);
ATK_AVAILABLE_IN_ALL
gboolean atk_socket_is_occupied (AtkSocket* obj);
diff --git a/atk/atktext.c b/atk/atktext.c
index fec90b0..b85d93f 100644
--- a/atk/atktext.c
+++ b/atk/atktext.c
@@ -1331,6 +1331,23 @@ atk_text_rectangle_union (AtkTextRectangle *src1,
{
gint dest_x, dest_y;
+ /*
+ * Some invocations of e.g. atk_text_get_character_extents
+ * may return "-1" rectangles for character positions without support for
+ * getting an extent. In that case we have to ignore them instead of using -1
+ * values in computations.
+ */
+ if (src1->width == -1)
+ {
+ *dest = *src2;
+ return;
+ }
+ if (src2->width == -1)
+ {
+ *dest = *src1;
+ return;
+ }
+
dest_x = MIN (src1->x, src2->x);
dest_y = MIN (src1->y, src2->y);
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest_x;
@@ -1374,15 +1391,11 @@ atk_text_rectangle_contain (AtkTextRectangle *clip,
/**
* atk_text_scroll_substring_to:
* @text: an #AtkText
- * @start_offset: start position
- * @end_offset: end position, or -1 for the end of the string.
+ * @start_offset: start offset in the @text
+ * @end_offset: end offset in the @text, or -1 for the end of the text.
* @type: specify where the object should be made visible.
*
- * Makes @text visible on the screen by scrolling all necessary parents.
- *
- * Contrary to atk_text_set_position, this does not actually move
- * @text in its parent, this only makes the parents scroll so that the
- * object shows up on the screen, given its current position within the parents.
+ * Makes a substring of @text visible on the screen by scrolling all necessary parents.
*
* Since: 2.32
*
@@ -1408,15 +1421,15 @@ atk_text_scroll_substring_to (AtkText *text,
/**
* atk_text_scroll_substring_to_point:
* @text: an #AtkText
- * @start_offset: start position
- * @end_offset: end position, or -1 for the end of the string.
+ * @start_offset: start offset in the @text
+ * @end_offset: end offset in the @text, or -1 for the end of the text.
* @coords: specify whether coordinates are relative to the screen or to the
* parent object.
* @x: x-position where to scroll to
* @y: y-position where to scroll to
*
- * Makes an object visible on the screen at a given position by scrolling all
- * necessary parents.
+ * Move the top-left of a substring of @text to a given position of the screen
+ * by scrolling all necessary parents.
*
* Since: 2.32
*
diff --git a/atk/atktext.h b/atk/atktext.h
index 32f0bf2..ca66a43 100644
--- a/atk/atktext.h
+++ b/atk/atktext.h
@@ -341,7 +341,7 @@ struct _AtkTextIface
* position on the screen, with type used as a positioning hint.
*
* scroll_substring_to_point lets the client specify a precise target position
- * on the screen.
+ * on the screen for the top-left of the substring.
*
* Since ATK 2.32
*/