diff options
author | Brian Cameron <bcameron@src.gnome.org> | 2001-06-12 12:13:20 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2001-06-12 12:13:20 +0000 |
commit | b686b7f2f0e8cb753d5e51edcf084969aff6341c (patch) | |
tree | f52902391d554d9dafec76575d95c97b1f8f0e50 /atk/atktext.c | |
parent | 5f8117526e078cdcf985be2985a572713a9e0c9a (diff) | |
download | atk-b686b7f2f0e8cb753d5e51edcf084969aff6341c.tar.gz |
The changes include:
- moved function atk_text_set_run_attributes() to
atk_editable_text_set_run_attributes()
- defined an enum AtkXYCoords in Atktext.h
- moved definitions of AtkAttribute and AtkAttributeSet from atktext.h to
atkobject.h (temporary solution until we decide a better place to define them).
- Added extra param to atk_text_get_character_extents() and
atk_text_get_offset_at_point() of type AtkXYCoords.
I decided to make AtkAttributeSet a singly-linked list (a GSList) instead of a
doubley-linked list (a GList). There is no need for it to be doubley-linked
which is less efficient.
Diffstat (limited to 'atk/atktext.c')
-rwxr-xr-x | atk/atktext.c | 57 |
1 files changed, 14 insertions, 43 deletions
diff --git a/atk/atktext.c b/atk/atktext.c index ef762bd..21bf70d 100755 --- a/atk/atktext.c +++ b/atk/atktext.c @@ -280,16 +280,17 @@ atk_text_get_caret_offset (AtkText *text) } /** - * atk_text_get_character_extents + * atk_text_get_character_extents: * @text: an #AtkText * @offset: position * @x: x-position of character * @y: y-position of character * @length: length of character * @width: width of character + * @coords: specify whether coordinates are relative to the screen or widget window * * Given an @offset, the @x, @y, @length, and @width values are filled - * appropriately. + * appropriately. **/ void atk_text_get_character_extents (AtkText *text, @@ -297,7 +298,8 @@ atk_text_get_character_extents (AtkText *text, gint *x, gint *y, gint *length, - gint *width) + gint *width, + AtkXYCoords coords) { AtkTextIface *iface; @@ -307,7 +309,7 @@ atk_text_get_character_extents (AtkText *text, iface = ATK_TEXT_GET_IFACE (text); if (iface->get_character_extents) - (*(iface->get_character_extents)) (text, offset, x, y, length, width); + (*(iface->get_character_extents)) (text, offset, x, y, length, width, coords); else { *x = 0; @@ -375,12 +377,15 @@ atk_text_get_character_count (AtkText *text) } /** - * atk_text_get_offset_at_point + * atk_text_get_offset_at_point: * @text: an #AtkText * @x: screen x-position of character * @y: screen y-position of character + * @coords: specify whether coordinates are relative to the screen or widget window * - * Gets the x,y screen coordinates of the specified character. + * Gets the offset of the character located at coordinates @x and @y. @x and @y 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. @@ -388,7 +393,8 @@ atk_text_get_character_count (AtkText *text) gint atk_text_get_offset_at_point (AtkText *text, gint x, - gint y) + gint y, + AtkXYCoords coords) { AtkTextIface *iface; @@ -398,7 +404,7 @@ atk_text_get_offset_at_point (AtkText *text, iface = ATK_TEXT_GET_IFACE (text); if (iface->get_offset_at_point) - return (*(iface->get_offset_at_point)) (text, x, y); + return (*(iface->get_offset_at_point)) (text, x, y, coords); else return -1; } @@ -555,41 +561,6 @@ atk_text_set_selection (AtkText *text, gint selection_num, } /** - *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 * @offset: position |