class Fl_Text_Buffer


Class Hierarchy

Include Files

Description

The Fl_Text_Buffer class is used by the Fl_Text_Display and Fl_Text_Editor to manage complex text data and is based upon the excellent NEdit text editor engine - see http://www.nedit.org/.

Methods

Fl_Text_Buffer

~Fl_Text_Buffer

add_modify_callback

append

appendfile

call_modify_callbacks

character

character_width

clear_rectangular

copy

count_displayed_characters

count_lines

expand_character

findchar_backward

findchar_forward

findchars_backward

findchars_forward

highlight

highlight_position

highlight_rectangular

highlight_selection

highlight_text

insert_column

insertfile

insert

length

line_end

line_start

line_text

loadfile

null_substitution_character

outputfile

overlay_rectangular

primary_selection

remove_modify_callback

remove_rectangular

remove

remove_secondary_selection

remove_selection

replace_rectangular

replace

replace_secondary_selection

replace_selection

rewind_lines

savefile

search_backward

search_forward

secondary_selection_position

secondary_selection

secondary_selection_text

secondary_select_rectangular

secondary_select

secondary_unselect

selected

selection_position

selection_text

select_rectangular

select

skip_displayed_characters

skip_lines

substitute_null_characters

tab_distance

tab_distance

text_in_rectangle

text_range

text

unhighlight

unselect

unsubstitute_null_characters

word_end

word_start

Fl_Text_Buffer(int requestedSize = 0); ~Fl_Text_Buffer(); int length() { return mLength; } const char* text(); void text(const char* text); const char* text_range(int start, int end); char character(int pos); const char* text_in_rectangle(int start, int end, int rectStart, int rectEnd); void insert(int pos, const char* text); void append(const char* text) { insert(length(), text); } void remove(int start, int end); void replace(int start, int end, const char *text); void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos); int insertfile(const char *file, int pos, int buflen = 128*1024); int appendfile(const char *file, int buflen = 128*1024) { return insertfile(file, length(), buflen); } int loadfile(const char *file, int buflen = 128*1024) { select(0, length()); remove_selection(); return appendfile(file, buflen); } int outputfile(const char *file, int start, int end, int buflen = 128*1024); int savefile(const char *file, int buflen = 128*1024) { return outputfile(file, 0, length(), buflen); } void insert_column(int column, int startPos, const char* text, int* charsInserted, int* charsDeleted); void replace_rectangular(int start, int end, int rectStart, int rectEnd, const char* text); void overlay_rectangular(int startPos, int rectStart, int rectEnd, const char* text, int* charsInserted, int* charsDeleted); void remove_rectangular(int start, int end, int rectStart, int rectEnd); void clear_rectangular(int start, int end, int rectStart, int rectEnd); int tab_distance() { return mTabDist; } void tab_distance(int tabDist); void select(int start, int end); int selected() { return mPrimary.selected(); } void unselect(); void select_rectangular(int start, int end, int rectStart, int rectEnd); int selection_position(int* start, int* end); int selection_position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd); const char* selection_text(); void remove_selection(); void replace_selection(const char* text); void secondary_select(int start, int end); void secondary_unselect(); void secondary_select_rectangular(int start, int end, int rectStart, int rectEnd); int secondary_selection_position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd); const char* secondary_selection_text(); void remove_secondary_selection(); void replace_secondary_selection(const char* text); void highlight(int start, int end); void unhighlight(); void highlight_rectangular(int start, int end, int rectStart, int rectEnd); int highlight_position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd); const char* highlight_text(); void add_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg); void remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg); void call_modify_callbacks() { call_modify_callbacks(0, 0, 0, 0, 0); } const char* line_text(int pos); int line_start(int pos); int line_end(int pos); int word_start(int pos); int word_end(int pos); int expand_character(int pos, int indent, char *outStr); static int expand_character(char c, int indent, char* outStr, int tabDist, char nullSubsChar); static int character_width(char c, int indent, int tabDist, char nullSubsChar); int count_displayed_characters(int lineStartPos, int targetPos); int skip_displayed_characters(int lineStartPos, int nChars); int count_lines(int startPos, int endPos); int skip_lines(int startPos, int nLines); int rewind_lines(int startPos, int nLines); int findchar_forward(int startPos, char searchChar, int* foundPos); int findchar_backward(int startPos, char searchChar, int* foundPos); int findchars_forward(int startPos, const char* searchChars, int* foundPos); int findchars_backward(int startPos, const char* searchChars, int* foundPos); int search_forward(int startPos, const char* searchString, int* foundPos, int matchCase = 0); int search_backward(int startPos, const char* searchString, int* foundPos, int matchCase = 0); int substitute_null_characters(char* string, int length); void unsubstitute_null_characters(char* string); char null_substitution_character() { return mNullSubsChar; } Fl_Text_Selection* primary_selection() { return &mPrimary; } Fl_Text_Selection* secondary_selection() { return &mSecondary; } Fl_Text_Selection* highlight_selection() { return &mHighlight; }