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;
};

AtkAttributeSet

typedef GSList AtkAttributeSet;

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
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
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
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
length : 
width : width of character


atk_text_ref_run_attributes ()

AtkAttributeSet* atk_text_ref_run_attributes
                                            (AtkText *text,
                                             gint offset,
                                             gint *start_offset,
                                             gint *end_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
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);

ATK_ATTRIBUTE_LEFT_MARGIN

#define ATK_ATTRIBUTE_LEFT_MARGIN        "left_margin"

ATK_ATTRIBUTE_RIGHT_MARGIN

#define ATK_ATTRIBUTE_RIGHT_MARGIN        "right_margin"

ATK_ATTRIBUTE_INDENT

#define ATK_ATTRIBUTE_INDENT              "indent"

ATK_ATTRIBUTE_INVISIBLE

#define ATK_ATTRIBUTE_INVISIBLE          "invisible"

ATK_ATTRIBUTE_EDITABLE

#define ATK_ATTRIBUTE_EDITABLE           "editable"

ATK_ATTRIBUTE_PIXELS_ABOVE_LINES

#define ATK_ATTRIBUTE_PIXELS_ABOVE_LINES "pixels_above_lines"

ATK_ATTRIBUTE_PIXELS_BELOW_LINES

#define ATK_ATTRIBUTE_PIXELS_BELOW_LINES "pixels_below_lines"

ATK_ATTRIBUTE_PIXELS_INSIDE_WRAP

#define ATK_ATTRIBUTE_PIXELS_INSIDE_WRAP "pixels_inside_wrap"

ATK_ATTRIBUTE_BG_FULL_HEIGHT

#define ATK_ATTRIBUTE_BG_FULL_HEIGHT     "bg_full_height"

ATK_ATTRIBUTE_RISE

#define ATK_ATTRIBUTE_RISE               "rise"

ATK_ATTRIBUTE_UNDERLINE

#define ATK_ATTRIBUTE_UNDERLINE          "underline"

ATK_ATTRIBUTE_STRIKETHROUGH

#define ATK_ATTRIBUTE_STRIKETHROUGH      "strikethrough"

ATK_ATTRIBUTE_SIZE

#define ATK_ATTRIBUTE_SIZE		 "size"

ATK_ATTRIBUTE_SCALE

#define ATK_ATTRIBUTE_SCALE		 "scale"

ATK_ATTRIBUTE_WEIGHT

#define ATK_ATTRIBUTE_WEIGHT		 "weight"

ATK_ATTRIBUTE_LANGUAGE

#define ATK_ATTRIBUTE_LANGUAGE		 "language"

ATK_ATTRIBUTE_FAMILY_NAME

#define ATK_ATTRIBUTE_FAMILY_NAME	 "family_name"

ATK_ATTRIBUTE_BG_COLOR

#define ATK_ATTRIBUTE_BG_COLOR   	 "bg_color"

ATK_ATTRIBUTE_FG_COLOR

#define ATK_ATTRIBUTE_FG_COLOR   	 "fg_color"

ATK_ATTRIBUTE_BG_STIPPLE

#define ATK_ATTRIBUTE_BG_STIPPLE   	 "bg_stipple"

ATK_ATTRIBUTE_FG_STIPPLE

#define ATK_ATTRIBUTE_FG_STIPPLE   	 "fg_stipple"

ATK_ATTRIBUTE_WRAP_MODE

#define ATK_ATTRIBUTE_WRAP_MODE   	 "wrap_mode"

ATK_ATTRIBUTE_DIRECTION

#define ATK_ATTRIBUTE_DIRECTION   	 "direction"

ATK_ATTRIBUTE_JUSTIFICATION

#define ATK_ATTRIBUTE_JUSTIFICATION   	 "justification"

ATK_ATTRIBUTE_STRETCH

#define ATK_ATTRIBUTE_STRETCH   	 "stretch"

ATK_ATTRIBUTE_VARIANT

#define ATK_ATTRIBUTE_VARIANT   	 "variant"

ATK_ATTRIBUTE_STYLE

#define ATK_ATTRIBUTE_STYLE      	 "slant_style"