2.30.0
[platform/upstream/atk.git] / atk / atktext.c
index 5244015..ca64c96 100644 (file)
@@ -317,13 +317,14 @@ atk_text_base_init (AtkTextIface *class)
 /**
  * atk_text_get_text:
  * @text: an #AtkText
- * @start_offset: start position
- * @end_offset: end position, or -1 for the end of the string.
+ * @start_offset: a starting character offset within @text
+ * @end_offset: an ending character offset within @text, or -1 for the end of the string.
  *
  * Gets the specified text.
  *
  * Returns: a newly allocated string containing the text from @start_offset up
- *   to, but not including @end_offset. Use g_free() to free the returned string.
+ *          to, but not including @end_offset. Use g_free() to free the returned
+ *          string.
  **/
 gchar*
 atk_text_get_text (AtkText      *text,
@@ -349,11 +350,11 @@ atk_text_get_text (AtkText      *text,
 /**
  * atk_text_get_character_at_offset:
  * @text: an #AtkText
- * @offset: position
+ * @offset: a character offset within @text
  *
  * Gets the specified text.
  *
- * Returns: the character at @offset.
+ * Returns: the character at @offset or 0 in the case of failure.
  **/
 gunichar
 atk_text_get_character_at_offset (AtkText      *text,
@@ -376,7 +377,7 @@ atk_text_get_character_at_offset (AtkText      *text,
  * @text: an #AtkText
  * @offset: position
  * @boundary_type: An #AtkTextBoundary
- * @start_offset: (out): the start offset of the returned string
+ * @start_offset: (out): the starting character offset of the returned string
  * @end_offset: (out): the offset of the first character after the
  *              returned substring
  *
@@ -385,7 +386,8 @@ atk_text_get_character_at_offset (AtkText      *text,
  * Deprecated: 2.9.3: Please use atk_text_get_string_at_offset() instead.
  *
  * Returns: a newly allocated string containing the text after @offset bounded
- *   by the specified @boundary_type. Use g_free() to free the returned string.
+ *          by the specified @boundary_type. Use g_free() to free the returned
+ *          string.
  **/
 gchar*
 atk_text_get_text_after_offset (AtkText          *text,
@@ -425,7 +427,7 @@ atk_text_get_text_after_offset (AtkText          *text,
  * @text: an #AtkText
  * @offset: position
  * @boundary_type: An #AtkTextBoundary
- * @start_offset: (out): the start offset of the returned string
+ * @start_offset: (out): the starting character offset of the returned string
  * @end_offset: (out): the offset of the first character after the
  *              returned substring
  *
@@ -457,8 +459,9 @@ atk_text_get_text_after_offset (AtkText          *text,
  * Deprecated: This method is deprecated since ATK version
  * 2.9.4. Please use atk_text_get_string_at_offset() instead.
  *
- * Returns: a newly allocated string containing the text at @offset bounded by
- *   the specified @boundary_type. Use g_free() to free the returned string.
+ * Returns: a newly allocated string containing the text at @offset bounded
+ *          by the specified @boundary_type. Use g_free() to free the returned
+ *          string.
  **/
 gchar*
 atk_text_get_text_at_offset (AtkText          *text,
@@ -495,7 +498,7 @@ atk_text_get_text_at_offset (AtkText          *text,
  * @text: an #AtkText
  * @offset: position
  * @boundary_type: An #AtkTextBoundary
- * @start_offset: (out): the start offset of the returned string
+ * @start_offset: (out): the starting character offset of the returned string
  * @end_offset: (out): the offset of the first character after the
  *              returned substring
  *
@@ -504,7 +507,8 @@ atk_text_get_text_at_offset (AtkText          *text,
  * Deprecated: 2.9.3: Please use atk_text_get_string_at_offset() instead.
  *
  * Returns: a newly allocated string containing the text before @offset bounded
- *   by the specified @boundary_type. Use g_free() to free the returned string.
+ *          by the specified @boundary_type. Use g_free() to free the returned
+ *          string.
  **/
 gchar*
 atk_text_get_text_before_offset (AtkText          *text,
@@ -544,10 +548,10 @@ atk_text_get_text_before_offset (AtkText          *text,
  * @text: an #AtkText
  * @offset: position
  * @granularity: An #AtkTextGranularity
- * @start_offset: (out): the start offset of the returned string, or -1
- *                if an error has occurred (e.g. invalid offset, not implemented)
+ * @start_offset: (out): the starting character offset of the returned string, or -1
+ *                in the case of error (e.g. invalid offset, not implemented)
  * @end_offset: (out): the offset of the first character after the returned string,
- *              or -1 if an error has occurred (e.g. invalid offset, not implemented)
+ *              or -1 in the case of error (e.g. invalid offset, not implemented)
  *
  * Gets a portion of the text exposed through an #AtkText according to a given @offset
  * and a specific @granularity, along with the start and end offsets defining the
@@ -582,10 +586,10 @@ atk_text_get_text_before_offset (AtkText          *text,
  *
  * Since: 2.10
  *
- * Returns: (nullable): a newly allocated string containing the text
- *   at the @offset bounded by the specified @granularity. Use
- *   g_free() to free the returned string.  Returns %NULL if the
- *   offset is invalid or no implementation is available.
+ * Returns: (nullable): a newly allocated string containing the text at
+ *          the @offset bounded by the specified @granularity. Use g_free()
+ *          to free the returned string.  Returns %NULL if the offset is invalid
+ *          or no implementation is available.
  **/
 gchar* atk_text_get_string_at_offset (AtkText *text,
                                       gint offset,
@@ -630,9 +634,11 @@ gchar* atk_text_get_string_at_offset (AtkText *text,
  * atk_text_get_caret_offset:
  * @text: an #AtkText
  *
- * Gets the offset position of the caret (cursor).
+ * Gets the offset of the position of the caret (cursor).
  *
- * Returns: the offset position of the caret (cursor).
+ * Returns: the character offset of the position of the caret or 0  if
+ *          the caret is not located inside the element or in the case of
+ *          any other failure.
  **/
 gint
 atk_text_get_caret_offset (AtkText *text)
@@ -653,8 +659,8 @@ atk_text_get_caret_offset (AtkText *text)
  * atk_text_get_character_extents:
  * @text: an #AtkText
  * @offset: The offset of the text character for which bounding information is required.
- * @x: (out) (optional): Pointer for the x cordinate of the bounding box
- * @y: (out) (optional): Pointer for the y cordinate of the bounding box
+ * @x: (out) (optional): Pointer for the x coordinate of the bounding box
+ * @y: (out) (optional): Pointer for the y coordinate of the bounding box
  * @width: (out) (optional): Pointer for the width of the bounding box
  * @height: (out) (optional): Pointer for the height of the bounding box
  * @coords: specify whether coordinates are relative to the screen or widget window 
@@ -669,7 +675,7 @@ atk_text_get_character_extents (AtkText *text,
                                 gint *y,
                                 gint *width,
                                 gint *height,
-                               AtkCoordType coords)
+                                AtkCoordType coords)
 {
   AtkTextIface *iface;
   gint local_x, local_y, local_width, local_height;
@@ -717,7 +723,7 @@ atk_text_get_character_extents (AtkText *text,
 /**
  * atk_text_get_run_attributes:
  *@text: an #AtkText
- *@offset: the offset at which to get the attributes, -1 means the offset of
+ *@offset: the character offset at which to get the attributes, -1 means the offset of
  *the character to be inserted at the caret location.
  *@start_offset: (out): the address to put the start offset of the range
  *@end_offset: (out): the address to put the end offset of the range
@@ -731,8 +737,8 @@ atk_text_get_character_extents (AtkText *text,
  *returned.
  *
  *Returns: (transfer full): an #AtkAttributeSet which contains the attributes
- * explicitly set at @offset. This #AtkAttributeSet should be freed by a call
- * to atk_attribute_set_free().
+ *         explicitly set at @offset. This #AtkAttributeSet should be freed by
+ *         a call to atk_attribute_set_free().
  **/
 AtkAttributeSet* 
 atk_text_get_run_attributes (AtkText          *text,
@@ -775,9 +781,9 @@ atk_text_get_run_attributes (AtkText          *text,
  *attributes that can be returned. Note that other attributes may also be 
  *returned.
  *
- *Returns: (transfer full): an #AtkAttributeSet which contains the default
- * values of attributes.  at @offset. this #atkattributeset should be freed by
- * a call to atk_attribute_set_free().
+ *Returns: (transfer full): an #AtkAttributeSet which contains the default values
+ *          of attributes.  at @offset. this #atkattributeset should be freed by
+ *          a call to atk_attribute_set_free().
  */
 AtkAttributeSet* 
 atk_text_get_default_attributes (AtkText          *text)
@@ -800,7 +806,7 @@ atk_text_get_default_attributes (AtkText          *text)
  *
  * Gets the character count.
  *
- * Returns: the number of characters.
+ * Returns: the number of characters or -1 in case of failure.
  **/
 gint
 atk_text_get_character_count (AtkText *text)
@@ -829,8 +835,8 @@ atk_text_get_character_count (AtkText *text)
  * are interpreted as being relative to the screen or this widget's window
  * depending on @coords.
  *
- * Returns: the offset to the character which is located at
- * the specified @x and @y coordinates.
+ * Returns: the offset to the character which is located at  the specified
+ *          @x and @y coordinates of -1 in case of failure.
  **/
 gint
 atk_text_get_offset_at_point (AtkText *text,
@@ -856,8 +862,7 @@ atk_text_get_offset_at_point (AtkText *text,
  *
  * Gets the number of selected regions.
  *
- * Returns: The number of selected regions, or -1 if a failure
- *   occurred.
+ * Returns: The number of selected regions, or -1 in the case of failure.
  **/
 gint
 atk_text_get_n_selections (AtkText *text)
@@ -882,14 +887,14 @@ atk_text_get_n_selections (AtkText *text)
  * start of the text.  The selected region closest to the beginning
  * of the text region is assigned the number 0, etc.  Note that adding,
  * moving or deleting a selected region can change the numbering.
- * @start_offset: (out): passes back the start position of the selected region
- * @end_offset: (out): passes back the end position of (e.g. offset immediately past)
- * the selected region
+ * @start_offset: (out): passes back the starting character offset of the selected region
+ * @end_offset: (out): passes back the ending character offset (offset immediately past)
+ * of the selected region
  *
  * Gets the text from the specified selection.
  *
  * Returns: a newly allocated string containing the selected text. Use g_free()
- *   to free the returned string.
+ *          to free the returned string.
  **/
 gchar*
 atk_text_get_selection (AtkText *text, 
@@ -926,12 +931,12 @@ atk_text_get_selection (AtkText *text,
 /**
  * atk_text_add_selection:
  * @text: an #AtkText
- * @start_offset: the start position of the selected region
+ * @start_offset: the starting character offset of the selected region
  * @end_offset: the offset of the first character after the selected region.
  *
  * Adds a selection bounded by the specified offsets.
  *
- * Returns: %TRUE if success, %FALSE otherwise
+ * Returns: %TRUE if successful, %FALSE otherwise
  **/
 gboolean
 atk_text_add_selection (AtkText *text, 
@@ -961,7 +966,7 @@ atk_text_add_selection (AtkText *text,
  *
  * Removes the specified selection.
  *
- * Returns: %TRUE if success, %FALSE otherwise
+ * Returns: %TRUE if successful, %FALSE otherwise
  **/
 gboolean
 atk_text_remove_selection (AtkText *text, 
@@ -987,13 +992,13 @@ atk_text_remove_selection (AtkText *text,
  * start of the text.  The selected region closest to the beginning
  * of the text region is assigned the number 0, etc.  Note that adding,
  * moving or deleting a selected region can change the numbering.
- * @start_offset: the new start position of the selection
+ * @start_offset: the new starting character offset of the selection
  * @end_offset: the new end position of (e.g. offset immediately past) 
  * the selection
  *
  * Changes the start and end offset of the specified selection.
  *
- * Returns: %TRUE if success, %FALSE otherwise
+ * Returns: %TRUE if successful, %FALSE otherwise
  **/
 gboolean
 atk_text_set_selection (AtkText *text, 
@@ -1019,11 +1024,11 @@ atk_text_set_selection (AtkText *text,
 /**
  * atk_text_set_caret_offset:
  * @text: an #AtkText
- * @offset: position
+ * @offset: the character offset of the new caret position
  *
  * Sets the caret (cursor) position to the specified @offset.
  *
- * Returns: %TRUE if success, %FALSE otherwise.
+ * Returns: %TRUE if successful, %FALSE otherwise.
  **/
 gboolean
 atk_text_set_caret_offset (AtkText *text,
@@ -1079,7 +1084,7 @@ atk_text_get_range_extents (AtkText          *text,
 }
 
 /**
- * atk_text_get_bounded_ranges:
+ * atk_text_get_bounded_ranges: (virtual get_bounded_ranges)
  * @text: an #AtkText
  * @rect: An AtkTextRectangle giving the dimensions of the bounding box.
  * @coord_type: Specify whether coordinates are relative to the screen or widget window.
@@ -1209,8 +1214,8 @@ atk_text_attribute_get_name (AtkTextAttribute attr)
  * Get the #AtkTextAttribute type corresponding to a text attribute name.
  *
  * Returns: the #AtkTextAttribute enumerated type corresponding to the specified
-name,
- *          or #ATK_TEXT_ATTRIBUTE_INVALID if no matching text attribute is found.
+ *          name, or #ATK_TEXT_ATTRIBUTE_INVALID if no matching text attribute
+ *          is found.
  **/
 AtkTextAttribute
 atk_text_attribute_for_name (const gchar *name)