return -1;
}
-/**
- * atk_text_get_range_attributes
- * @text: an #AtkText
- * @start_offset: start position
- * @end_offset: end position
- *
- * Gets attributes over the specified range.
- *
- * Returns: a #PangoAttrList with the text attributes between the
- * @start_offset and the @end_offset.
- **/
-PangoAttrList*
-atk_text_get_range_attributes (AtkText *text,
- gint start_offset,
- gint end_offset)
-{
- AtkTextIface *iface;
-
- g_return_val_if_fail (text != NULL, NULL);
- g_return_val_if_fail (ATK_IS_TEXT (text), NULL);
-
- iface = ATK_TEXT_GET_IFACE (text);
-
- if (iface->get_range_attributes)
- return (*(iface->get_range_attributes)) (text, start_offset, end_offset);
- else
- return NULL;
-}
-
/**
* atk_text_get_character_extents
* @text: an #AtkText
}
}
+/**
+ *atk_text_ref_run_attributes:
+ *@text: an #AtkText
+ *@offset: the offset at which to get the attributes
+ *@start_offset: the address to put the start offset of the range
+ *@end_offset: the address to put the end offset of the range
+ *
+ *Creates an #AtkAttributeSet which consists of the attributes explicitly
+ *set at the position @offset in the text. @start_offset and @end_offset are
+ *set to the start and end of the range around @offset where the attributes are
+ *invariant.
+ *
+ *Returns: an #AtkAttributeSet which contains the attributes explicitly set
+ *at @offset
+ **/
+AtkAttributeSet* atk_text_ref_run_attributes (AtkText *text,
+ gint offset,
+ gint *start_offset,
+ gint *end_offset)
+{
+ AtkTextIface *iface;
+
+ g_return_val_if_fail (text != NULL, NULL);
+ g_return_val_if_fail (ATK_IS_TEXT (text), NULL);
+
+ iface = ATK_TEXT_GET_IFACE (text);
+
+ if (iface->ref_run_attributes)
+ return (*(iface->ref_run_attributes)) (text, offset, start_offset, end_offset);
+ else
+ return NULL;
+}
+
/**
* atk_text_get_character_count
* @text: an #AtkText
return FALSE;
}
+/**
+ *atk_text_set_run_attributes:
+ *@text: an #AtkText
+ *@attrib: an #AtkAttributeSet
+ *@start_offset: start of range in which to set attributes
+ *@end_offset: end of range in which to set attributes
+ *
+ *Sets the attributes for a specified range
+ *
+ *Returns: %TRUE if attributes successfully set for the specified
+ *range, otherwise %FALSE
+ **/
+gboolean
+atk_text_set_run_attributes (AtkText *text,
+ AtkAttributeSet *attrib,
+ gint start_offset,
+ gint end_offset)
+{
+ AtkTextIface *iface;
+
+ g_return_val_if_fail (text != NULL, FALSE);
+ g_return_val_if_fail (ATK_IS_TEXT (text), FALSE);
+
+ iface = ATK_TEXT_GET_IFACE (text);
+
+ if (iface->set_run_attributes)
+ {
+ return (*(iface->set_run_attributes)) (text, attrib, start_offset, end_offset);
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
/**
* atk_text_set_caret_offset
* @text: an #AtkText
#endif
typedef struct _AtkTextIface AtkTextIface;
+typedef GList AtkAttributeSet;
+
+typedef struct _AtkAttribute {
+ gchar* name;
+ gchar* value;
+}AtkAttribute;
+
/**
*AtkTextBoundary:
*@ATK_TEXT_BOUNDARY_CHAR:
gint offset,
AtkTextBoundary boundary_type);
gint (* get_caret_offset) (AtkText *text);
- PangoAttrList* (* get_range_attributes) (AtkText *text,
- gint start_offset,
- gint end_offset);
+ AtkAttributeSet* (* ref_run_attributes) (AtkText *text,
+ gint offset,
+ gint *start_offset,
+ gint *end_offset);
void (* get_character_extents) (AtkText *text,
gint offset,
gint *x,
gint end_offset);
gboolean (* set_caret_offset) (AtkText *text,
gint offset);
+ gboolean (* set_run_attributes) (AtkText *text,
+ AtkAttributeSet *attrib,
+ gint start_offset,
+ gint end_offset);
void (* text_changed) (AtkText *text);
void (* caret_changed) (AtkText *text,
gint location);
gint offset,
AtkTextBoundary boundary_type);
gint atk_text_get_caret_offset (AtkText *text);
-PangoAttrList* atk_text_get_range_attributes (AtkText *text,
- gint start_offset,
- gint end_offset);
void atk_text_get_character_extents (AtkText *text,
gint offset,
gint *x,
gint *y,
gint *length,
gint *width);
+AtkAttributeSet* atk_text_ref_run_attributes (AtkText *text,
+ gint offset,
+ gint *start_offset,
+ gint *end_offset);
gint atk_text_get_character_count (AtkText *text);
gint atk_text_get_offset_at_point (AtkText *text,
gint x,
gint end_offset);
gboolean atk_text_set_caret_offset (AtkText *text,
gint offset);
+gboolean atk_text_set_run_attributes (AtkText *text,
+ AtkAttributeSet *attrib,
+ gint start_offset,
+ gint end_offset);
#ifdef __cplusplus
}