W Wrapl, The Programming Language

Libraries:Gtk:Atk:Text

Types

T

T should be implemented by AtkObjects on behalf of widgets that have text content which is either attributed or otherwise non-trivial. AtkObjects whose text content is simple, unattributed, and very brief may expose that content via Gtk.Atk.Object.GetName instead; however if the text is editable, multi-line, typically longer than three or four words, attributed, selectable, or if the object already uses the 'name' ATK property for other information, the T interface should be used to expose the text content. In the case of editable text content, Gtk.Atk.EditableText.T (a subtype of the T interface) should be implemented instead.

T provides not only traversal facilities and change notification for text content, but also caret tracking and glyph bounding box calculations. Note that the text strings are exposed as UTF-8, and are therefore potentially multi-byte, and caret-to-byte offset mapping makes no assumptions about the character length; also bounding box glyph-to-offset mapping may be complex for languages which use ligatures.



ParentT

Constants

InterfaceInfo : Std.Object.T

Nil : T

Functions

AttributeForName(name @ Std.String.T) : Gtk.Atk.TextAttribute.T

Get the Gtk.Atk.TextAttribute.T type corresponding to a text attribute name.

name a string which is the (non-localized) name of an ATK text attribute.
Returns the Gtk.Atk.TextAttribute.T enumerated type corresponding to the specified name, or ATK_TEXT_ATTRIBUTE_INVALID if no matching text attribute is found.


AttributeGetName(attr @ Gtk.Atk.TextAttribute.T) : Std.String.T

Gets the name corresponding to the Gtk.Atk.TextAttribute.T

attr The Gtk.Atk.TextAttribute.T whose name is required
Returns a string containing the name; this string should not be freed


AttributeGetValue(attr @ Gtk.Atk.TextAttribute.T, index_ @ Std.Integer.SmallT) : Std.String.T

Gets the value for the index of the Gtk.Atk.TextAttribute.T

attr The Gtk.Atk.TextAttribute.T for which a value is required
index_ The index of the required value
Returns a string containing the value; this string should not be freed; NULL is returned if there are no values maintained for the attr value.


AttributeRegister(name @ Std.String.T) : Gtk.Atk.TextAttribute.T

Associate name with a new Gtk.Atk.TextAttribute.T

name a name string
Returns an Gtk.Atk.TextAttribute.T associated with name


FreeRanges(ranges @ Std.Object.T) : Std.Object.T

Frees the memory associated with an array of AtkTextRange. It is assumed that the array was returned by the function atk_text_get_bounded_ranges and is NULL terminated.

ranges A pointer to an array of Gtk.Atk.TextRange.T which is to be freed.


GetType() : Gtk.GObject.Type.T



Methods

:AddSelection(self @ T, start_offset @ Std.Integer.SmallT, end_offset @ Std.Integer.SmallT) : Std.Symbol.T

Adds a selection bounded by the specified offsets.

text an T
start_offset the start position of the selected region
end_offset the offset of the first character after the selected region.
Returns TRUE if success, FALSE otherwise


:AddSelection(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT)

:GetBoundedRanges(self @ T, rect @ Gtk.Atk.TextRectangle.T, coord_type @ Gtk.Atk.CoordType.T, x_clip_type @ Gtk.Atk.TextClipType.T, y_clip_type @ Gtk.Atk.TextClipType.T) : Std.Object.T

Get the ranges of text in the specified bounding box.

text an T
rect An AtkTextRectangle giving the dimensions of the bounding box.
coord_type Specify whether coordinates are relative to the screen or widget window.
x_clip_type Specify the horizontal clip type.
y_clip_type Specify the vertical clip type.
Returns Array of AtkTextRange. The last element of the array returned by this function will be NULL. [array zero-terminated=1]


:GetBoundedRanges(_ @ ParentT, _ @ Gtk.Atk.TextRectangle.T, _ @ Gtk.Atk.CoordType.T, _ @ Gtk.Atk.TextClipType.T, _ @ Gtk.Atk.TextClipType.T)

:GetCaretOffset(self @ T) : Std.Integer.SmallT

Gets the offset position of the caret (cursor).

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


:GetCaretOffset(_ @ ParentT)

:GetCharacterAtOffset(self @ T, offset @ Std.Integer.SmallT) : Std.Integer.SmallT

Gets the specified text.

text an T
offset position
Returns the character at offset.


:GetCharacterAtOffset(_ @ ParentT, _ @ Std.Integer.SmallT)

:GetCharacterCount(self @ T) : Std.Integer.SmallT

Gets the character count.

text an T
Returns the number of characters.


:GetCharacterCount(_ @ ParentT)

:GetCharacterExtents(self @ T, offset @ Std.Integer.SmallT, x @ Std.Object.T, y @ Std.Object.T, width @ Std.Object.T, height @ Std.Object.T, coords @ Gtk.Atk.CoordType.T) : Std.Object.T

Get the bounding box containing the glyph representing the character at a particular text offset.

text an T
offset The offset of the text character for which bounding information is required.
x Pointer for the x cordinate of the bounding box
y Pointer for the y cordinate of the bounding box
width Pointer for the width of the bounding box
height Pointer for the height of the bounding box
coords specify whether coordinates are relative to the screen or widget window


:GetCharacterExtents(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Object.T, _ @ Std.Object.T, _ @ Std.Object.T, _ @ Std.Object.T, _ @ Gtk.Atk.CoordType.T)

:GetDefaultAttributes(self @ T) : Std.Object.T

Creates an AtkAttributeSet which consists of the default values of attributes for the text. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

text an T
Returns an AtkAttributeSet which contains the default values of attributes. at offset. this atkattributeset should be freed by a call to Gtk.Atk.Attribute.SetFree. [transfer full]


:GetDefaultAttributes(_ @ ParentT)

:GetNSelections(self @ T) : Std.Integer.SmallT

Gets the number of selected regions.

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


:GetNSelections(_ @ ParentT)

:GetOffsetAtPoint(self @ T, x @ Std.Integer.SmallT, y @ Std.Integer.SmallT, coords @ Gtk.Atk.CoordType.T) : Std.Integer.SmallT

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 T
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.


:GetOffsetAtPoint(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Atk.CoordType.T)

:GetRangeExtents(self @ T, start_offset @ Std.Integer.SmallT, end_offset @ Std.Integer.SmallT, coord_type @ Gtk.Atk.CoordType.T, rect @ Gtk.Atk.TextRectangle.T) : Std.Object.T

Get the bounding box for text within the specified range.

text an T
start_offset The offset of the first text character for which boundary information is required.
end_offset The offset of the text character after the last character for which boundary information is required.
coord_type Specify whether coordinates are relative to the screen or widget window.
rect A pointer to a AtkTextRectangle which is filled in by this function.


:GetRangeExtents(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Gtk.Atk.CoordType.T, _ @ Gtk.Atk.TextRectangle.T)

:GetRunAttributes(self @ T, offset @ Std.Integer.SmallT, start_offset @ Std.Object.T, end_offset @ Std.Object.T) : Std.Object.T

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. Note that end_offset is the offset of the first character after the range. See the enum AtkTextAttribute for types of text attributes that can be returned. Note that other attributes may also be returned.

text an T
offset the offset at which to get the attributes, -1 means the offset of the character to be inserted at the caret location.
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. This AtkAttributeSet should be freed by a call to Gtk.Atk.Attribute.SetFree. [transfer full]


:GetRunAttributes(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Object.T, _ @ Std.Object.T)

:GetSelection(self @ T, selection_num @ Std.Integer.SmallT, start_offset @ Std.Object.T, end_offset @ Std.Object.T) : Std.String.T

Gets the text from the specified selection.

text an T
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 (e.g. offset immediately past) the selected region
Returns a newly allocated string containing the selected text. Use g_free() to free the returned string.


:GetSelection(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Object.T, _ @ Std.Object.T)

:GetText(self @ T, start_offset @ Std.Integer.SmallT, end_offset @ Std.Integer.SmallT) : Std.String.T

Gets the specified text.

text an T
start_offset start position
end_offset end position
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.


:GetText(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT)

:GetTextAfterOffset(self @ T, offset @ Std.Integer.SmallT, boundary_type @ Gtk.Atk.TextBoundary.T, start_offset @ Std.Object.T, end_offset @ Std.Object.T) : Std.String.T

Gets the specified text.

If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character after the offset is returned.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start after the offset to the next word start.

The returned string will contain the word after the offset if the offset is inside a word or if the offset is not inside a word.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end at or after the offset to the next work end.

The returned string will contain the word after the offset if the offset is inside a word and will contain the word after the word after the offset if the offset is not inside a word.

If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start after the offset to the next sentence start.

The returned string will contain the sentence after the offset if the offset is inside a sentence or if the offset is not inside a sentence.

If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end at or after the offset to the next sentence end.

The returned string will contain the sentence after the offset if the offset is inside a sentence and will contain the sentence after the sentence after the offset if the offset is not inside a sentence.

If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start after the offset to the next line start.

If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end at or after the offset to the next line end.

text an T
offset position
boundary_type An Gtk.Atk.TextBoundary.T
start_offset the start offset of the returned string
end_offset the offset of the first character after the returned substring
Returns a newly allocated string containing the text after offset bounded by the specified boundary_type. Use g_free() to free the returned string.


:GetTextAfterOffset(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Atk.TextBoundary.T, _ @ Std.Object.T, _ @ Std.Object.T)

:GetTextAtOffset(self @ T, offset @ Std.Integer.SmallT, boundary_type @ Gtk.Atk.TextBoundary.T, start_offset @ Std.Object.T, end_offset @ Std.Object.T) : Std.String.T

Gets the specified text.

If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character at the offset is returned.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start at or before the offset to the word start after the offset.

The returned string will contain the word at the offset if the offset is inside a word and will contain the word before the offset if the offset is not inside a word.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the offset to the word end at or after the offset.

The returned string will contain the word at the offset if the offset is inside a word and will contain the word after to the offset if the offset is not inside a word.

If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start at or before the offset to the sentence start after the offset.

The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence before the offset if the offset is not inside a sentence.

If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end before the offset to the sentence end at or after the offset.

The returned string will contain the sentence at the offset if the offset is inside a sentence and will contain the sentence after the offset if the offset is not inside a sentence.

If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start at or before the offset to the line start after the offset.

If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end before the offset to the line end at or after the offset.

text an T
offset position
boundary_type An Gtk.Atk.TextBoundary.T
start_offset the start offset of the returned string
end_offset the offset of the first character after the returned substring
Returns a newly allocated string containing the text at offset bounded by the specified boundary_type. Use g_free() to free the returned string.


:GetTextAtOffset(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Atk.TextBoundary.T, _ @ Std.Object.T, _ @ Std.Object.T)

:GetTextBeforeOffset(self @ T, offset @ Std.Integer.SmallT, boundary_type @ Gtk.Atk.TextBoundary.T, start_offset @ Std.Object.T, end_offset @ Std.Object.T) : Std.String.T

Gets the specified text.

If the boundary_type if ATK_TEXT_BOUNDARY_CHAR the character before the offset is returned.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start before the word start before or at the offset to the word start before or at the offset.

The returned string will contain the word before the offset if the offset is inside a word and will contain the word before the word before the offset if the offset is not inside a word.

If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the word end before the offset to the word end before the offset.

The returned string will contain the word before the offset if the offset is inside a word or if the offset is not inside a word.

If the boundary type is ATK_TEXT_BOUNDARY_SENTENCE_START the returned string is from the sentence start before the sentence start before the offset to the sentence start before the offset.

The returned string will contain the sentence before the offset if the offset is inside a sentence and will contain the sentence before the sentence before the offset if the offset is not inside a sentence.

If the boundary_type is ATK_TEXT_BOUNDARY_SENTENCE_END the returned string is from the sentence end before the sentence end at or before the offset to the sentence end at or before the offset.

The returned string will contain the sentence before the offset if the offset is inside a sentence or if the offset is not inside a sentence.

If the boundary type is ATK_TEXT_BOUNDARY_LINE_START the returned string is from the line start before the line start ar or before the offset to the line start ar or before the offset.

If the boundary_type is ATK_TEXT_BOUNDARY_LINE_END the returned string is from the line end before the line end before the offset to the line end before the offset.

text an T
offset position
boundary_type An Gtk.Atk.TextBoundary.T
start_offset the start offset of the returned string
end_offset the offset of the first character after the returned substring
Returns a newly allocated string containing the text before offset bounded by the specified boundary_type. Use g_free() to free the returned string.


:GetTextBeforeOffset(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Atk.TextBoundary.T, _ @ Std.Object.T, _ @ Std.Object.T)

:RemoveSelection(self @ T, selection_num @ Std.Integer.SmallT) : Std.Symbol.T

Removes the specified selection.

text an T
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


:RemoveSelection(_ @ ParentT, _ @ Std.Integer.SmallT)

:SetCaretOffset(self @ T, offset @ Std.Integer.SmallT) : Std.Symbol.T

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

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


:SetCaretOffset(_ @ ParentT, _ @ Std.Integer.SmallT)

:SetSelection(self @ T, selection_num @ Std.Integer.SmallT, start_offset @ Std.Integer.SmallT, end_offset @ Std.Integer.SmallT) : Std.Symbol.T

Changes the start and end offset of the specified selection.

text an T
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 (e.g. offset immediately past) the selection
Returns TRUE if success, FALSE otherwise


:SetSelection(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT)

:TextAttributesChanged(_ @ ParentT)

:TextCaretMoved(_ @ ParentT, _ @ Std.Integer.SmallT)

:TextChanged(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Std.Integer.SmallT)

:TextSelectionChanged(_ @ ParentT)