AtkText

Name

AtkText -- 

Synopsis



struct      AtkText;
struct      AtkTextIface;
enum        AtkTextBoundary;
struct      AtkAttribute;
typedef     AtkAttributeSet;
gchar*      atk_text_get_text               (AtkText *text,
                                             gint start_offset,
                                             gint end_offset);
gunichar    atk_text_get_character_at_offset
                                            (AtkText *text,
                                             gint offset);
gchar*      atk_text_get_text_after_offset  (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type,
                                             gint *start_offset,
                                             gint *end_offset);
gchar*      atk_text_get_text_at_offset     (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type,
                                             gint *start_offset,
                                             gint *end_offset);
gchar*      atk_text_get_text_before_offset (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type,
                                             gint *start_offset,
                                             gint *end_offset);
gint        atk_text_get_caret_offset       (AtkText *text);
void        atk_text_get_character_extents  (AtkText *text,
                                             gint offset,
                                             gint *x,
                                             gint *y,
                                             gint *width,
                                             gint *height,
                                             AtkCoordType coords);
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 y,
                                             AtkCoordType coords);
gint        atk_text_get_n_selections       (AtkText *text);
gchar*      atk_text_get_selection          (AtkText *text,
                                             gint selection_num,
                                             gint *start_offset,
                                             gint *end_offset);
gboolean    atk_text_add_selection          (AtkText *text,
                                             gint start_offset,
                                             gint end_offset);
gboolean    atk_text_remove_selection       (AtkText *text,
                                             gint selection_num);
gboolean    atk_text_set_selection          (AtkText *text,
                                             gint selection_num,
                                             gint start_offset,
                                             gint end_offset);
gboolean    atk_text_set_caret_offset       (AtkText *text,
                                             gint offset);
void        atk_attribute_set_free          (AtkAttributeSet *attrib_set);
#define     ATK_ATTRIBUTE_LEFT_MARGIN
#define     ATK_ATTRIBUTE_RIGHT_MARGIN
#define     ATK_ATTRIBUTE_INDENT
#define     ATK_ATTRIBUTE_INVISIBLE
#define     ATK_ATTRIBUTE_EDITABLE
#define     ATK_ATTRIBUTE_PIXELS_ABOVE_LINES
#define     ATK_ATTRIBUTE_PIXELS_BELOW_LINES
#define     ATK_ATTRIBUTE_PIXELS_INSIDE_WRAP
#define     ATK_ATTRIBUTE_BG_FULL_HEIGHT
#define     ATK_ATTRIBUTE_RISE
#define     ATK_ATTRIBUTE_UNDERLINE
#define     ATK_ATTRIBUTE_STRIKETHROUGH
#define     ATK_ATTRIBUTE_SIZE
#define     ATK_ATTRIBUTE_SCALE
#define     ATK_ATTRIBUTE_WEIGHT
#define     ATK_ATTRIBUTE_LANGUAGE
#define     ATK_ATTRIBUTE_FAMILY_NAME
#define     ATK_ATTRIBUTE_BG_COLOR
#define     ATK_ATTRIBUTE_FG_COLOR
#define     ATK_ATTRIBUTE_BG_STIPPLE
#define     ATK_ATTRIBUTE_FG_STIPPLE
#define     ATK_ATTRIBUTE_WRAP_MODE
#define     ATK_ATTRIBUTE_DIRECTION
#define     ATK_ATTRIBUTE_JUSTIFICATION
#define     ATK_ATTRIBUTE_STRETCH
#define     ATK_ATTRIBUTE_VARIANT
#define     ATK_ATTRIBUTE_STYLE

Description

Details

struct AtkText

struct AtkText;


struct AtkTextIface

struct AtkTextIface
{
  GTypeInterface parent;

  gchar*         (* get_text)                     (AtkText          *text,
                                                   gint             start_offset,
                                                   gint             end_offset);
  gchar*         (* get_text_after_offset)        (AtkText          *text,
                                                   gint             offset,
                                                   AtkTextBoundary  boundary_type,
						   gint             *start_offset,
						   gint             *end_offset);
  gchar*         (* get_text_at_offset)           (AtkText          *text,
                                                   gint             offset,
                                                   AtkTextBoundary  boundary_type,
						   gint             *start_offset,
						   gint             *end_offset);
  gunichar       (* get_character_at_offset)      (AtkText          *text,
                                                   gint             offset);
  gchar*         (* get_text_before_offset)       (AtkText          *text,
                                                   gint             offset,
                                                   AtkTextBoundary  boundary_type,
 						   gint             *start_offset,
						   gint             *end_offset);
  gint           (* get_caret_offset)             (AtkText          *text);
  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             *y,
                                                   gint             *width,
                                                   gint             *height,
                                                   AtkCoordType	    coords);
  gint           (* get_character_count)          (AtkText          *text);
  gint           (* get_offset_at_point)          (AtkText          *text,
                                                   gint             x,
                                                   gint             y,
                                                   AtkCoordType	    coords);
  gint		 (* get_n_selections)		  (AtkText          *text);
  gchar*         (* get_selection)	          (AtkText          *text,
						   gint		    selection_num,
						   gint		    *start_offset,
						   gint		    *end_offset);
  gboolean       (* add_selection)		  (AtkText          *text,
						   gint		    start_offset,
						   gint		    end_offset);
  gboolean       (* remove_selection)		  (AtkText          *text,
						   gint             selection_num);
  gboolean       (* set_selection)		  (AtkText          *text,
						   gint		    selection_num,
						   gint		    start_offset,
						   gint		    end_offset);
  gboolean       (* set_caret_offset)             (AtkText          *text,
                                                   gint             offset);

  /*
   * signal handlers
   */
  void		 (* text_changed)                 (AtkText          *text);
  void           (* caret_changed)                (AtkText          *text,
                                                   gint             location);
};


enum AtkTextBoundary

typedef enum {
  ATK_TEXT_BOUNDARY_CHAR,
  ATK_TEXT_BOUNDARY_WORD_START,
  ATK_TEXT_BOUNDARY_WORD_END,
  ATK_TEXT_BOUNDARY_SENTENCE_START,
  ATK_TEXT_BOUNDARY_SENTENCE_END,
  ATK_TEXT_BOUNDARY_LINE_START,
  ATK_TEXT_BOUNDARY_LINE_END
} AtkTextBoundary;

Text boundary types used for specifying boundaries for regions of text


struct AtkAttribute

struct AtkAttribute {
  gchar* name;
  gchar* value;
};

A string name/value pair representing a text attribute.

gchar *name The attribute name. See the ATK_ATTRIBUTE macros, eg ATK_ATTRIBUTE_LEFT_MARGIN for examples.
gchar *value the value of the attribute, represented as a string. See the ATK_ATTRIBUTE macros, eg ATK_ATTRIBUTE_LEFT_MARGIN for example.


AtkAttributeSet

typedef GSList AtkAttributeSet;

This is a singly-linked list (a GSList) of AtkAttribute. It is used by atk_text_ref_run_attributes() and atk_editable_text_set_run_attributes()


atk_text_get_text ()

gchar*      atk_text_get_text               (AtkText *text,
                                             gint start_offset,
                                             gint end_offset);

Gets the specified text.

text : an AtkText
start_offset : start position
end_offset : end position
Returns : the text from start_offset up to, but not including end_offset.


atk_text_get_character_at_offset ()

gunichar    atk_text_get_character_at_offset
                                            (AtkText *text,
                                             gint offset);

Gets the specified text.

text : an AtkText
offset : position
Returns : the character at offset.


atk_text_get_text_after_offset ()

gchar*      atk_text_get_text_after_offset  (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type,
                                             gint *start_offset,
                                             gint *end_offset);

Gets the specified text. If the boundary type is ATK_TEXT_BOUNDARY_WORD_START or ATK_TEXT_BOUNDARY_WORD_END part of a word may be returned. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the start point will be the offset and will continue to the start of the next sentence. The first word may not be a complete word. Similarly for ATK_TEXT_BOUNDARY_SENTENCE_END, ATK_TEXT_BOUNDARY_LINE_START and ATK_TEXT_BOUNDARY_LINE_END

text : an AtkText
offset : position
boundary_type : An AtkTextBoundary
start_offset : the start offset of the returned string.
end_offset : the end offset of the returned string.
Returns : the text after offset up to the specified boundary_type.


atk_text_get_text_at_offset ()

gchar*      atk_text_get_text_at_offset     (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type,
                                             gint *start_offset,
                                             gint *end_offset);

Gets the specified text. If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START or ATK_TEXT_BOUNDARY_WORD_END a complete word is returned; if the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START or ATK_TEXT_BOUNDARY_SENTENCE_END a complete sentence is returned; if the boundary type is ATK_TEXT_BOUNDARY_LINE_START or ATK_TEXT_BOUNDARY_LINE_END a complete line is returned.

text : an AtkText
offset : position
boundary_type : An AtkTextBoundary
start_offset : the start offset of the returned string.
end_offset : the end offset of the returned string.
Returns : the text at offset up to the specified boundary_type.


atk_text_get_text_before_offset ()

gchar*      atk_text_get_text_before_offset (AtkText *text,
                                             gint offset,
                                             AtkTextBoundary boundary_type,
                                             gint *start_offset,
                                             gint *end_offset);

Gets the specified text. If the boundary type is ATK_TEXT_BOUNDARY_WORD_START or ATK_TEXT_BOUNDARY_WORD_END part of a word may be returned. If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the start point will be at the start of the sentence, and will continue to the offset. The last word may not be a complete word. Similarly for ATK_TEXT_BOUNDARY_SENTENCE_END, ATK_TEXT_BOUNDARY_LINE_START and ATK_TEXT_BOUNDARY_LINE_END

text : an AtkText
offset : position
boundary_type : An AtkTextBoundary
start_offset : the start offset of the returned string.
end_offset : the end offset of the returned string.
Returns : the text before offset starting from the specified boundary_type.


atk_text_get_caret_offset ()

gint        atk_text_get_caret_offset       (AtkText *text);

Gets the offset position of the caret (cursor).

text : an AtkText
Returns : the offset position of the caret (cursor).


atk_text_get_character_extents ()

void        atk_text_get_character_extents  (AtkText *text,
                                             gint offset,
                                             gint *x,
                                             gint *y,
                                             gint *width,
                                             gint *height,
                                             AtkCoordType coords);

Given an offset, the x, y, width, and height values are filled appropriately.

text : an AtkText
offset : position
x : x-position of character
y : y-position of character
width : width of character
height : height of character
coords : specify whether coordinates are relative to the screen or widget window


atk_text_ref_run_attributes ()

AtkAttributeSet* atk_text_ref_run_attributes
                                            (AtkText *text,
                                             gint offset,
                                             gint *start_offset,
                                             gint *end_offset);

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. See the ATK_ATTRIBUTE macros, such as ATK_ATTRIBUTE_LEFT_MARGIN for types of text attributes that can be returned. Note that other attributes that do not have corresponding macros may also be returned.

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
Returns : an AtkAttributeSet which contains the attributes explicitly set at offset


atk_text_get_character_count ()

gint        atk_text_get_character_count    (AtkText *text);

Gets the character count.

text : an AtkText
Returns : the number of characters.


atk_text_get_offset_at_point ()

gint        atk_text_get_offset_at_point    (AtkText *text,
                                             gint x,
                                             gint y,
                                             AtkCoordType coords);

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.

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
Returns : the offset to the character which is located at the specified x and y coordinates.


atk_text_get_n_selections ()

gint        atk_text_get_n_selections       (AtkText *text);

Gets the number of selected regions.

text : an AtkText
Returns : The number of selected regions, or -1 if a failure occurred.


atk_text_get_selection ()

gchar*      atk_text_get_selection          (AtkText *text,
                                             gint selection_num,
                                             gint *start_offset,
                                             gint *end_offset);

Gets the text from the specified selection.

text : an AtkText
selection_num : The selection number. The selected regions are assigned numbers that correspond to how far the region is from the 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 : passes back the start position of the selected region
end_offset : passes back the end position of the selected region
Returns : the selected text.


atk_text_add_selection ()

gboolean    atk_text_add_selection          (AtkText *text,
                                             gint start_offset,
                                             gint end_offset);

Adds a selection bounded by the specified offsets.

text : an AtkText
start_offset : the start position of the selected region
end_offset : the end position of the selected region
Returns : TRUE if success, FALSE otherwise


atk_text_remove_selection ()

gboolean    atk_text_remove_selection       (AtkText *text,
                                             gint selection_num);

Removes the specified selection.

text : an AtkText
selection_num : The selection number. The selected regions are assigned numbers that correspond to how far the region is from the 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.
Returns : TRUE if success, FALSE otherwise


atk_text_set_selection ()

gboolean    atk_text_set_selection          (AtkText *text,
                                             gint selection_num,
                                             gint start_offset,
                                             gint end_offset);

Changes the start and end offset of the specified selection.

text : an AtkText
selection_num : The selection number. The selected regions are assigned numbers that correspond to how far the region is from the 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
end_offset : the new end position of the selection
Returns : TRUE if success, FALSE otherwise


atk_text_set_caret_offset ()

gboolean    atk_text_set_caret_offset       (AtkText *text,
                                             gint offset);

Sets the caret (cursor) position to the specified offset.

text : an AtkText
offset : position
Returns : TRUE if success, FALSE otherwise.


atk_attribute_set_free ()

void        atk_attribute_set_free          (AtkAttributeSet *attrib_set);

Frees the memory used by an AtkAttributeSet, including all its AtkAttributes.

attrib_set : The AtkAttributeSet to free


ATK_ATTRIBUTE_LEFT_MARGIN

#define ATK_ATTRIBUTE_LEFT_MARGIN        "left_margin"

An AtkAttribute name/value pair. The pixel width of the left margin


ATK_ATTRIBUTE_RIGHT_MARGIN

#define ATK_ATTRIBUTE_RIGHT_MARGIN        "right_margin"

An AtkAttribute name/value pair. The pixel width of the right margin


ATK_ATTRIBUTE_INDENT

#define ATK_ATTRIBUTE_INDENT              "indent"

An AtkAttribute name/value pair. The number of pixels that the text is indented


ATK_ATTRIBUTE_INVISIBLE

#define ATK_ATTRIBUTE_INVISIBLE          "invisible"

An AtkAttribute name/value pair. Either "true" or "false" indicating whether text is visible or not


ATK_ATTRIBUTE_EDITABLE

#define ATK_ATTRIBUTE_EDITABLE           "editable"

An AtkAttribute name/value pair. Either "true" or "false" indicating whether text is editable or not


ATK_ATTRIBUTE_PIXELS_ABOVE_LINES

#define ATK_ATTRIBUTE_PIXELS_ABOVE_LINES "pixels_above_lines"

An AtkAttribute name/value pair. Pixels of blank space to leave above each newline-terminated line.


ATK_ATTRIBUTE_PIXELS_BELOW_LINES

#define ATK_ATTRIBUTE_PIXELS_BELOW_LINES "pixels_below_lines"

An AtkAttribute name/value pair. Pixels of blank space to leave below each newline-terminated line.


ATK_ATTRIBUTE_PIXELS_INSIDE_WRAP

#define ATK_ATTRIBUTE_PIXELS_INSIDE_WRAP "pixels_inside_wrap"

An AtkAttribute name/value pair. Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).


ATK_ATTRIBUTE_BG_FULL_HEIGHT

#define ATK_ATTRIBUTE_BG_FULL_HEIGHT     "bg_full_height"

An AtkAttribute name/value pair. "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.


ATK_ATTRIBUTE_RISE

#define ATK_ATTRIBUTE_RISE               "rise"

An AtkAttribute name/value pair. Number of pixels that the characters are risen above the baseline The value is a string representation of an integer


ATK_ATTRIBUTE_UNDERLINE

#define ATK_ATTRIBUTE_UNDERLINE          "underline"

An AtkAttribute name/value pair. "true" or "false" whether the text is underlined


ATK_ATTRIBUTE_STRIKETHROUGH

#define ATK_ATTRIBUTE_STRIKETHROUGH      "strikethrough"

An AtkAttribute name/value pair. "true" or "false" whether the text is strikethrough


ATK_ATTRIBUTE_SIZE

#define ATK_ATTRIBUTE_SIZE		 "size"

An AtkAttribute name/value pair. The size of the characters. The value is a string representation of an integer


ATK_ATTRIBUTE_SCALE

#define ATK_ATTRIBUTE_SCALE		 "scale"

An AtkAttribute name/value pair. The scale of the characters. The value is a string representation of a double


ATK_ATTRIBUTE_WEIGHT

#define ATK_ATTRIBUTE_WEIGHT		 "weight"

An AtkAttribute name/value pair. The weight of the characters. The value is a string representation of an integer


ATK_ATTRIBUTE_LANGUAGE

#define ATK_ATTRIBUTE_LANGUAGE		 "language"

An AtkAttribute name/value pair. The language used


ATK_ATTRIBUTE_FAMILY_NAME

#define ATK_ATTRIBUTE_FAMILY_NAME	 "family_name"

An AtkAttribute name/value pair. The font family name


ATK_ATTRIBUTE_BG_COLOR

#define ATK_ATTRIBUTE_BG_COLOR   	 "bg_color"

An AtkAttribute name/value pair. The background color. The value is an RGB value of the format "u,u,u"


ATK_ATTRIBUTE_FG_COLOR

#define ATK_ATTRIBUTE_FG_COLOR   	 "fg_color"

An AtkAttribute name/value pair. The foreground color. The value is an RGB value of the format "u,u,u"


ATK_ATTRIBUTE_BG_STIPPLE

#define ATK_ATTRIBUTE_BG_STIPPLE   	 "bg_stipple"

An AtkAttribute name/value pair. "true" if a GdkBitmap is set for stippling the background color.


ATK_ATTRIBUTE_FG_STIPPLE

#define ATK_ATTRIBUTE_FG_STIPPLE   	 "fg_stipple"

An AtkAttribute name/value pair. "true" if a GdkBitmap is set for stippling the foreground color.


ATK_ATTRIBUTE_WRAP_MODE

#define ATK_ATTRIBUTE_WRAP_MODE   	 "wrap_mode"

An AtkAttribute name/value pair. The wrap mode of the text, if any. Values are "none", "char" or "word"


ATK_ATTRIBUTE_DIRECTION

#define ATK_ATTRIBUTE_DIRECTION   	 "direction"

An AtkAttribute name/value pair. The direction of the text, if set. Values are "none", "ltr" or "rtl"


ATK_ATTRIBUTE_JUSTIFICATION

#define ATK_ATTRIBUTE_JUSTIFICATION   	 "justification"

An AtkAttribute name/value pair. The justification of the text, if set. Values are "left", "right", "center" or "fill"


ATK_ATTRIBUTE_STRETCH

#define ATK_ATTRIBUTE_STRETCH   	 "stretch"

An AtkAttribute name/value pair. The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", or "ultra_expanded"


ATK_ATTRIBUTE_VARIANT

#define ATK_ATTRIBUTE_VARIANT   	 "variant"

An AtkAttribute name/value pair. The capitalization variant of the text, if set. Values are "normal" or "small_caps"


ATK_ATTRIBUTE_STYLE

#define ATK_ATTRIBUTE_STYLE      	 "slant_style"

An AtkAttribute name/value pair. The slant style of the text, if set. Values are "normal", "oblique" or "italic"