Project:DUI

Class List Class Hierarchy
Summary: Ctors Methods Mixins

Module dui.TextBuffer

Class TextBuffer

dui.ObjectG.ObjectG
        dui.TextBuffer.TextBuffer

Implemented interfaces:


public class

TextBuffer



A text buffer to be display and altered in a text view

Constructor Summary
package (GObject* gObject)
          Creates a new text buffer from a gdkTextBuffer
public (GtkTextBuffer* gtkTextBuffer)
          Creates a new text buffer from a gdkTextBuffer
(TextTagTable textTagTable)
          create a new TextBuffer with a TextTagTable
()
          Create a new TextBuffer

Methods Summary
static GType getType()
          Gets this class type
protected alias SignalHandler!(TextBuffer )
          
alias SignalHandler!(TextBuffer , TextIter , String , int )
          
alias SignalHandler!(TextBuffer , TextIter , TextIter )
          
alias voiddelegate(TextIter , String , int )
          
public void addOnChanged(void delegate())
          
public void addOnInsert(void delegate(TextIter, String , int) dlg)
          
public static void onInsertCallback()
          
public void setText(char text)
          Sets the text for this text view
void setText(String text)
          
GtkTextBuffer* gtkO()
          Gets the GtkTextBuffer
gint getLineCount()
          getLineCount
gint getCharCount()
          getCharCount
TextTagTable getTagTable()
          getTagTable
void insert(TextIter iter, char text)
          /* Delete whole buffer, then insert /* Insert into the buffer Insert test at the iter
void insert(TextIter iter, String text)
          
void insertAtCursor(String text)
          Insert test at the cursor position
bit insertInteractive(TextIter iter, String text, bit defaultEditable)
          Insert test at the iter interactively ???
bit insertInteractiveAtCursor(String text, bit defaultEditable)
          insertInteractiveAtCursor
void insertRange(TextIter iter, TextIter start, TextIter end)
          insertRange
bit insertRangeInteractive(TextIter iter, TextIter start, TextIter end, bit defaultEditable)
          insertRangeInteractive
void insertWithTags(TextIter iter, String text, TextTag firstTag)
          insertWithTags
void insertWithTagsByName(TextIter iter, char text, char tagName)
          insertWithTagsByName
void insertWithTagsByName(TextIter iter, String text, String tagName)
          
void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2)
          insertWithTagsByName
void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2)
          
void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2, char tagName3)
          insertWithTagsByName
void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2, String tagName3)
          
void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2, char tagName3, char tagName4)
          insertWithTagsByName
void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2, String tagName3, String tagName4)
          
void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2, char tagName3, char tagName4, char tagName5)
          insertWithTagsByName
void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2, String tagName3, String tagName4, String tagName5)
          
void deleteText(TextIter start, TextIter end)
          /* Delete from the buffer deleteText
bit deleteInteractive(TextIter start, TextIter end, bit defaultEditable)
          deleteInteractive
String getText(TextIter start, TextIter end, bit includeHiddenChars)
          /* Obtain strings from the buffer Obtain strings from the buffer
String getSlice(TextIter start, TextIter end, bit includeHiddenChars)
          Obtain strings from the buffer
String getText()
          Obtain the entire text
void insertPixbuf(TextIter iter, Pixbuf pixbuf)
          Insert a pixbuf
void insertChildAnchor(TextIter iter, TextChildAnchor anchor)
          Insert a child anchor
TextChildAnchor createChildAnchor(TextIter iter)
          Convenience, create and insert a child anchor
TextMark createMark(String mark_name, TextIter where, bit left_gravity)
          /* Mark manipulation Creates a mark at position where If mark_name is NULL (bug: cannot be null), the mark is anonymous; otherwise, the mark can be retrieved by name using gtk_text_buffer_get_mark().
void moveMark(TextMark mark, TextIter where)
          Moves mark to the new location where.
void deleteMark(TextMark mark)
          Deletes mark, so that it's no longer located anywhere in the buffer.
TextMark getMark(char name)
          Returns the mark named name in buffer buffer.
TextMark getMark(String name)
          
void moveMark(String name, TextIter where)
          move the mark by name
void moveMarkByName(String name, TextIter where)
          move the mark by name using gtk function name.
void deleteMark(String name)
          Deletes mark by name.
void deleteMarkByName(String name)
          Deletes mark by name using the GTK functino name.
TextMark getInsert()
          Returns the mark that represents the cursor (insertion point).
TextMark getSelectionBound()
          Returns the mark that represents the selection bound.
void placeCursor(TextIter where)
          /* efficiently move insert and selection_bound to same location placeCursor
void applyTag(TextTag tag, TextIter start, TextIter end)
          /* Tag manipulation applyTag
void removeTag(TextTag tag, TextIter start, TextIter end)
          removeTag
void applyTagByName(char name, TextIter start, TextIter end)
          applyTagByName
void applyTagByName(String name, TextIter start, TextIter end)
          
void removeTag(String name, TextIter start, TextIter end)
          removeTag
void removeAllTags(TextIter start, TextIter end)
          removeAllTags
TextTag createTag(char tagName, char propertyName, char propertyValue, char propertyName1, int propertyValue1)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, String propertyValue, String propertyName1, int propertyValue1)
          
TextTag createTag(char tagName, char propertyName, int propertyValue, char propertyName1, char propertyValue1)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, int propertyValue, String propertyName1, String propertyValue1)
          
TextTag createTag(char tagName, char propertyName, int propertyValue)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, int propertyValue)
          
TextTag createTag(char tagName, char propertyName, double propertyValue)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, double propertyValue)
          
TextTag createTag(char tagName, char propertyName, int propertyValue, char propertyName2, int propertyValue2)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, int propertyValue, String propertyName2, int propertyValue2)
          
TextTag createTag(char tagName, char propertyName, int propertyValue, char propertyName2, int propertyValue2, char propertyName3, int propertyValue3, char propertyName4, int propertyValue4, char propertyName5, int propertyValue5)
          
TextTag createTag(String tagName, String propertyName, int propertyValue, String propertyName2, int propertyValue2, String propertyName3, int propertyValue3, String propertyName4, int propertyValue4, String propertyName5, int propertyValue5)
          
TextTag createTag(char tagName, char propertyName, char propertyValue)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, String propertyValue)
          
TextTag createTag(char tagName, char propertyName, Bitmap propertyValue)
          Create a new tag for this buffer
TextTag createTag(String tagName, String propertyName, Bitmap propertyValue)
          
void getIterAtLineOffset(TextIter iter, gint lineNumber, gint charOffset)
          /* Obtain iterators pointed at various places, then you can move the iterator around using the GtkTextIter operators
void getIterAtLineIndex(TextIter iter, gint line_number, gint byte_index)
          getIterAtLineIndex
void getIterAtOffset(TextIter iter, gint char_offset)
          getIterAtOffset
void getIterAtLine(TextIter iter, gint line_number)
          getIterAtLine
void getStartIter(TextIter iter)
          getStartIter
void getEndIter(TextIter iter)
          getEndIter
void getBounds(TextIter start, TextIter end)
          getBounds
void getIterAtMark(TextIter iter, TextMark mark)
          Sets an iter to the mark
void getIterAtChildAnchor(TextIter iter, TextChildAnchor anchor)
          Set an iter to the child anchor
bit getModified()
          /* There's no get_first_iter because you just get the iter for line or char 0 /* Used to keep track of whether the buffer needs saving; anytime the buffer contents change, the modified flag is turned on.
void setModified(bit setting)
          Used to keep track of whether the buffer has been modified since the last time it was saved.
void addSelectionClipboard(Clipboard clipboard)
          addSelectionClipboard
void removeSelectionClipboard(Clipboard clipboard)
          removeSelectionClipboard
void cutClipboard(Clipboard clipboard, bit default_editable)
          cutClipboard
void copyClipboard(Clipboard clipboard)
          copyClipboard
void pastClipboard(Clipboard clipboard, TextIter override_location, bit default_editable)
          pastClipboard
bit getSelectionBounds(TextIter start, TextIter end)
          getSelectionBounds
bit deleteSelection(bit interactive, bit defaultEditable)
          deleteSelection
void beginUserAction()
          /* Called to specify atomic user actions, used to implement undo beginUserAction
void endUserAction()
          endUserAction


getType

static GType getType()
Gets this class type

Returns:
this class type

SignalHandler!

protected alias SignalHandler!(TextBuffer )

SignalHandler!

alias SignalHandler!(TextBuffer , TextIter , String , int )

SignalHandler!

alias SignalHandler!(TextBuffer , TextIter , TextIter )

voiddelegate

alias voiddelegate(TextIter , String , int )

addOnChanged

public void addOnChanged(void delegate())

addOnInsert

public void addOnInsert(void delegate(TextIter, String , int) dlg)

onInsertCallback

public static void onInsertCallback()



package ctor(TextBuffer)(GObject* gObject)
Creates a new text buffer from a gdkTextBuffer

Parameters:
gObject - the gdkTextBuffer



public ctor(TextBuffer)(GtkTextBuffer* gtkTextBuffer)
Creates a new text buffer from a gdkTextBuffer

Parameters:
gtkTextBuffer - the gdkTextBuffer

setText

public void setText(char text)
Sets the text for this text view

Parameters:
text -

setText

void setText(String text)

gtkO

GtkTextBuffer* gtkO()
Gets the GtkTextBuffer

Returns:
the GtkTextBuffer



ctor(TextBuffer)(TextTagTable textTagTable)
create a new TextBuffer with a TextTagTable

Parameters:
textTagTable -



ctor(TextBuffer)()
Create a new TextBuffer

getLineCount

gint getLineCount()
getLineCount

Returns:

getCharCount

gint getCharCount()
getCharCount

Returns:

getTagTable

TextTagTable getTagTable()
getTagTable

Returns:
a new TestTagTable or a existing one if found

insert

void insert(TextIter iter, char text)
/* Delete whole buffer, then insert /* Insert into the buffer Insert test at the iter

Parameters:
iter - the TextIter
text - the text to insert

insert

void insert(TextIter iter, String text)

insertAtCursor

void insertAtCursor(String text)
Insert test at the cursor position

Parameters:
text - the text to insert

insertInteractive

bit insertInteractive(TextIter iter, String text, bit defaultEditable)
Insert test at the iter interactively ???

Parameters:
iter - the TextIter
text - the text to insert
defaultEditable - ???

Returns:

insertInteractiveAtCursor

bit insertInteractiveAtCursor(String text, bit defaultEditable)
insertInteractiveAtCursor

Parameters:
text -
defaultEditable -

Returns:

insertRange

void insertRange(TextIter iter, TextIter start, TextIter end)
insertRange

Parameters:
iter -
start -
end -

insertRangeInteractive

bit insertRangeInteractive(TextIter iter, TextIter start, TextIter end, bit defaultEditable)
insertRangeInteractive

Parameters:
iter -
start -
end -
defaultEditable -

Returns:

insertWithTags

void insertWithTags(TextIter iter, String text, TextTag firstTag)
insertWithTags

Parameters:
iter -
text -
firstTag -

insertWithTagsByName

void insertWithTagsByName(TextIter iter, char text, char tagName)
insertWithTagsByName

Parameters:
iter -
text -
tagName -

insertWithTagsByName

void insertWithTagsByName(TextIter iter, String text, String tagName)

insertWithTagsByName

void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2)
insertWithTagsByName

Parameters:
iter -
text -
tagName -
tagName2 -

insertWithTagsByName

void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2)

insertWithTagsByName

void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2, char tagName3)
insertWithTagsByName

Parameters:
iter -
text -
tagName -
tagName2 -
tagName3 -

insertWithTagsByName

void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2, String tagName3)

insertWithTagsByName

void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2, char tagName3, char tagName4)
insertWithTagsByName

Parameters:
iter -
text -
tagName -
tagName2 -
tagName3 -
tagName4 -

insertWithTagsByName

void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2, String tagName3, String tagName4)

insertWithTagsByName

void insertWithTagsByName(TextIter iter, char text, char tagName, char tagName2, char tagName3, char tagName4, char tagName5)
insertWithTagsByName

Parameters:
iter -
text -
tagName -
tagName2 -
tagName3 -
tagName4 -
tagName5 -

insertWithTagsByName

void insertWithTagsByName(TextIter iter, String text, String tagName, String tagName2, String tagName3, String tagName4, String tagName5)

deleteText

void deleteText(TextIter start, TextIter end)
/* Delete from the buffer deleteText

Parameters:
start -
end -

deleteInteractive

bit deleteInteractive(TextIter start, TextIter end, bit defaultEditable)
deleteInteractive

Parameters:
start -
end -
defaultEditable -

Returns:

getText

String getText(TextIter start, TextIter end, bit includeHiddenChars)
/* Obtain strings from the buffer Obtain strings from the buffer

Parameters:
start - the start iter
end - the end iter
includeHiddenChars -

Returns:
a string

getSlice

String getSlice(TextIter start, TextIter end, bit includeHiddenChars)
Obtain strings from the buffer

Parameters:
start - the start iter
end - the end iter
includeHiddenChars -

Returns:
a string

getText

String getText()
Obtain the entire text

Returns:
a string

insertPixbuf

void insertPixbuf(TextIter iter, Pixbuf pixbuf)
Insert a pixbuf

Parameters:
iter -
pixbuf -

insertChildAnchor

void insertChildAnchor(TextIter iter, TextChildAnchor anchor)
Insert a child anchor

Parameters:
iter -
anchor -

createChildAnchor

TextChildAnchor createChildAnchor(TextIter iter)
Convenience, create and insert a child anchor

Parameters:
iter -

createMark

TextMark createMark(String mark_name, TextIter where, bit left_gravity)
/* Mark manipulation Creates a mark at position where If mark_name is NULL (bug: cannot be null), the mark is anonymous; otherwise, the mark can be retrieved by name using gtk_text_buffer_get_mark().
If a mark has left gravity, and text is inserted at the mark's current location, the mark will be moved to the left of the newly-inserted text. If the mark has right gravity (left_gravity = FALSE), the mark will end up on the right of newly-inserted text. The standard left-to-right cursor is a mark with right gravity (when you type, the cursor stays on the right side of the text you're typing).

Parameters:
mark_name - name for mark, or null
where -
left_gravity - \bug mark_name CANNOT be null

moveMark

void moveMark(TextMark mark, TextIter where)
Moves mark to the new location where.
Emits the "mark_set" signal as notification of the move.

Parameters:
mark - the mark
where - the new position

deleteMark

void deleteMark(TextMark mark)
Deletes mark, so that it's no longer located anywhere in the buffer.
Removes the reference the buffer holds to the mark, so if you haven't called g_object_ref() on the mark, it will be freed. Even if the mark isn't freed, most operations on mark become invalid. There is no way to undelete a mark. gtk_text_mark_get_deleted() will return TRUE after this function has been called on a mark; gtk_text_mark_get_deleted() indicates that a mark no longer belongs to a buffer. The "mark_deleted" signal will be emitted as notification after the mark is deleted.

getMark

TextMark getMark(char name)
Returns the mark named name in buffer buffer.

Parameters:
name -

Returns:
the mark or null if no such mark exists in the buffer.

getMark

TextMark getMark(String name)

moveMark

void moveMark(String name, TextIter where)
move the mark by name

Parameters:
name - the mark name
where -

moveMarkByName

void moveMarkByName(String name, TextIter where)
move the mark by name using gtk function name.

Parameters:
name - the mark name
where -

deleteMark

void deleteMark(String name)
Deletes mark by name.

Parameters:
name - the mar name

deleteMarkByName

void deleteMarkByName(String name)
Deletes mark by name using the GTK functino name.

Parameters:
name - the mar name

getInsert

TextMark getInsert()
Returns the mark that represents the cursor (insertion point).
Equivalent to calling gtk_text_buffer_get_mark() to get the mark named "insert", but very slightly more efficient, and involves less typing.

Returns:
a new Mark for the current insert point

getSelectionBound

TextMark getSelectionBound()
Returns the mark that represents the selection bound.
Equivalent to calling gtk_text_buffer_get_mark() to get the mark named "selection_bound", but very slightly more efficient, and involves less typing. The currently-selected text in buffer is the region between the "selection_bound" and "insert" marks. If "selection_bound" and "insert" are in the same place, then there is no current selection. gtk_text_buffer_get_selection_bounds() is another convenient function for handling the selection, if you just want to know whether there's a selection and what its bounds are.

Returns:
a new Mark

placeCursor

void placeCursor(TextIter where)
/* efficiently move insert and selection_bound to same location placeCursor

Parameters:
where -

applyTag

void applyTag(TextTag tag, TextIter start, TextIter end)
/* Tag manipulation applyTag

Parameters:
tag -
start -
end -

removeTag

void removeTag(TextTag tag, TextIter start, TextIter end)
removeTag

Parameters:
tag -
start -
end -

applyTagByName

void applyTagByName(char name, TextIter start, TextIter end)
applyTagByName

Parameters:
name -
start -
end -

applyTagByName

void applyTagByName(String name, TextIter start, TextIter end)

removeTag

void removeTag(String name, TextIter start, TextIter end)
removeTag

Parameters:
name -
start -
end -

removeAllTags

void removeAllTags(TextIter start, TextIter end)
removeAllTags

Parameters:
start -
end -

createTag

TextTag createTag(char tagName, char propertyName, char propertyValue, char propertyName1, int propertyValue1)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -

createTag

TextTag createTag(String tagName, String propertyName, String propertyValue, String propertyName1, int propertyValue1)

createTag

TextTag createTag(char tagName, char propertyName, int propertyValue, char propertyName1, char propertyValue1)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -

createTag

TextTag createTag(String tagName, String propertyName, int propertyValue, String propertyName1, String propertyValue1)

createTag

TextTag createTag(char tagName, char propertyName, int propertyValue)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -

createTag

TextTag createTag(String tagName, String propertyName, int propertyValue)

createTag

TextTag createTag(char tagName, char propertyName, double propertyValue)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -

createTag

TextTag createTag(String tagName, String propertyName, double propertyValue)

createTag

TextTag createTag(char tagName, char propertyName, int propertyValue, char propertyName2, int propertyValue2)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -
propertyName2 -
propertyValue2 -

createTag

TextTag createTag(String tagName, String propertyName, int propertyValue, String propertyName2, int propertyValue2)

createTag

TextTag createTag(char tagName, char propertyName, int propertyValue, char propertyName2, int propertyValue2, char propertyName3, int propertyValue3, char propertyName4, int propertyValue4, char propertyName5, int propertyValue5)

createTag

TextTag createTag(String tagName, String propertyName, int propertyValue, String propertyName2, int propertyValue2, String propertyName3, int propertyValue3, String propertyName4, int propertyValue4, String propertyName5, int propertyValue5)

createTag

TextTag createTag(char tagName, char propertyName, char propertyValue)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -

createTag

TextTag createTag(String tagName, String propertyName, String propertyValue)

createTag

TextTag createTag(char tagName, char propertyName, Bitmap propertyValue)
Create a new tag for this buffer

Parameters:
tagName - can be null for no name
propertyName -
propertyValue -

Returns:

createTag

TextTag createTag(String tagName, String propertyName, Bitmap propertyValue)

getIterAtLineOffset

void getIterAtLineOffset(TextIter iter, gint lineNumber, gint charOffset)
/* Obtain iterators pointed at various places, then you can move the iterator around using the GtkTextIter operators

Parameters:

getIterAtLineIndex

void getIterAtLineIndex(TextIter iter, gint line_number, gint byte_index)
getIterAtLineIndex

Parameters:
iter -
line_number -
byte_index -

getIterAtOffset

void getIterAtOffset(TextIter iter, gint char_offset)
getIterAtOffset

Parameters:
iter -
char_offset -

getIterAtLine

void getIterAtLine(TextIter iter, gint line_number)
getIterAtLine

Parameters:
iter -
line_number -

getStartIter

void getStartIter(TextIter iter)
getStartIter

Parameters:
iter -

getEndIter

void getEndIter(TextIter iter)
getEndIter

Parameters:
iter -

getBounds

void getBounds(TextIter start, TextIter end)
getBounds

Parameters:
start -
end -

getIterAtMark

void getIterAtMark(TextIter iter, TextMark mark)
Sets an iter to the mark

Parameters:
iter - the iter to set
mark - the mark

getIterAtChildAnchor

void getIterAtChildAnchor(TextIter iter, TextChildAnchor anchor)
Set an iter to the child anchor

Parameters:
iter - the iter to set
anchor - the child anchor

getModified

bit getModified()
/* There's no get_first_iter because you just get the iter for line or char 0 /* Used to keep track of whether the buffer needs saving; anytime thebuffer contents change, the modified flag is turned on.
Whenever you save, turn it off. Tags and marks do not affect the modified flag, but if you would like them to you can connect a handler to the tag/mark signals and call set_modified in your handler Indicates whether the buffer has been modified since the last call to gtk_text_buffer_set_modified() set the modification flag to false

Returns:

setModified

void setModified(bit setting)
Used to keep track of whether the buffer has been modified since the last time it was saved.

Parameters:
setting -

addSelectionClipboard

void addSelectionClipboard(Clipboard clipboard)
addSelectionClipboard

Parameters:
clipboard -

removeSelectionClipboard

void removeSelectionClipboard(Clipboard clipboard)
removeSelectionClipboard

Parameters:
clipboard -

cutClipboard

void cutClipboard(Clipboard clipboard, bit default_editable)
cutClipboard

Parameters:
clipboard -
default_editable -

copyClipboard

void copyClipboard(Clipboard clipboard)
copyClipboard

Parameters:
clipboard -

pastClipboard

void pastClipboard(Clipboard clipboard, TextIter override_location, bit default_editable)
pastClipboard

Parameters:
clipboard -
override_location -
default_editable -

getSelectionBounds

bit getSelectionBounds(TextIter start, TextIter end)
getSelectionBounds

Parameters:
start -
end -

deleteSelection

bit deleteSelection(bit interactive, bit defaultEditable)
deleteSelection

Parameters:
interactive -
defaultEditable -

beginUserAction

void beginUserAction()
/* Called to specify atomic user actions, used to implement undo beginUserAction

endUserAction

void endUserAction()
endUserAction