X11workbench Toolkit
1.0
|
'vtable' structure for TEXT_OBJECT More...
#include <text_object.h>
Data Fields | |
void(* | destroy )(struct _text_object_ *pThis) |
Call this prior to de-allocating memory to free up any internal objects or storage. More... | |
void(* | init )(struct _text_object_ *pThis) |
Call this to initialize or re-initialize an object. Must call 'destroy' first for an existing object. More... | |
void(* | highlight_colors )(struct _text_object_ *pThis, XColor clrHFG, XColor clrHBG) |
Call this to assign the highlight colors. Default colors are WBGC's BG and FG. More... | |
char *(* | get_text )(struct _text_object_ *pThis) |
Call this function to get all text, formatted so that it can be saved to a file. More... | |
void(* | set_text )(struct _text_object_ *pThis, const char *szText, unsigned long cbLen) |
Call this function to re-assign all text in the control. More... | |
int(* | get_rows )(const struct _text_object_ *pThis) |
Call this function to obtain the total number of rows for display purposes. More... | |
int(* | get_cols )(struct _text_object_ *pThis) |
Call this function to obtain the estimated column extent of the document. More... | |
int(* | get_filetype )(const struct _text_object_ *pThis) |
Get the current linefeed type for the object. More... | |
void(* | set_filetype )(struct _text_object_ *pThis, int iLineFeed) |
Set the current file type for the object. More... | |
int(* | get_linefeed )(const struct _text_object_ *pThis) |
Get the current linefeed type for the object. More... | |
void(* | set_linefeed )(struct _text_object_ *pThis, int iLineFeed) |
Set the current linefeed type for the object. More... | |
int(* | get_insmode )(const struct _text_object_ *pThis) |
Get the current insert mode for the object. More... | |
void(* | set_insmode )(struct _text_object_ *pThis, int iInsMode) |
Set the current insert mode for the object. More... | |
int(* | get_selmode )(const struct _text_object_ *pThis) |
Get the current selection mode for the object. More... | |
void(* | set_selmode )(struct _text_object_ *pThis, int iSelMode) |
Set the current selection mode for the object. More... | |
int(* | get_tab )(const struct _text_object_ *pThis) |
Get the current tab type for the object. More... | |
void(* | set_tab )(struct _text_object_ *pThis, int iTab) |
Set the current tab type for the object. More... | |
int(* | get_scrollmode )(const struct _text_object_ *pThis) |
Get the current scroll mode for the object. More... | |
void(* | set_scrollmode )(struct _text_object_ *pThis, int iScrollMode) |
Set the current scroll mode for the object. More... | |
void(* | get_select )(const struct _text_object_ *pThis, WB_RECT *pRct) |
Get the current selection rectangle as WB_RECT. More... | |
void(* | set_select )(struct _text_object_ *pThis, const WB_RECT *pRct) |
Set the current selection rectangle as WB_RECT. More... | |
int(* | has_select )(const struct _text_object_ *pThis) |
Returns a non-zero value if there is currently a 'selection'. More... | |
char *(* | get_sel_text )(const struct _text_object_ *pThis, const WB_RECT *pRct) |
get the current selection rectangle as WB_RECT More... | |
int(* | get_row )(const struct _text_object_ *pThis) |
Get the current row cursor for the object. More... | |
void(* | set_row )(struct _text_object_ *pThis, int iRow) |
Set the current row cursor for the object. More... | |
int(* | get_col )(const struct _text_object_ *pThis) |
Get the current column cursor for the object. More... | |
void(* | set_col )(struct _text_object_ *pThis, int iCol) |
Set the current column cursor for the object. More... | |
void(* | del_select )(struct _text_object_ *pThis) |
Delete the current selection assigned via 'set_select'. More... | |
void(* | replace_select )(struct _text_object_ *pThis, const char *szText, unsigned long cbLen) |
Replace the current selection assigned via 'set_select' with new text. More... | |
void(* | del_chars )(struct _text_object_ *pThis, int nChar) |
Delete 'n' characters from the current cursor. Negative deletes BEFORE the cursor. 'newline' counts as 1 character. More... | |
void(* | ins_chars )(struct _text_object_ *pThis, const char *pChar, int nChar) |
Insert 'n' characters (including new lines) from the current cursor. More... | |
void(* | indent )(struct _text_object_ *pThis, int nCol) |
Indent selected text by 'n' columns. More... | |
int(* | can_undo )(struct _text_object_ *pThis) |
Indicate whether an 'undo' operation is possible (mostly for menu UI) More... | |
void(* | undo )(struct _text_object_ *pThis) |
Perform a single 'undo' operation. More... | |
int(* | can_redo )(struct _text_object_ *pThis) |
Indicate whether a 'redo' operation is possible (mostly for menu UI) More... | |
void(* | redo )(struct _text_object_ *pThis) |
Perform a single 'redo' operation. More... | |
void(* | get_view )(const struct _text_object_ *pThis, WB_RECT *pRct) |
Get the current viewport (in characters). The return value is not relevant if the expose method has not (yet) been called. More... | |
void(* | set_view_orig )(struct _text_object_ *pThis, const WB_POINT *pOrig) |
Set the current viewport (in characters). Only 'left' and 'top' are relevant if the expose method has not (yet) been called. More... | |
void(* | begin_highlight )(struct _text_object_ *pThis) |
Begin a highlight block. More... | |
void(* | end_highlight )(struct _text_object_ *pThis) |
End a highlight block. More... | |
void(* | mouse_click )(struct _text_object_ *pThis, int iMouseXDelta, int iMouseYDelta, int iType, int iACS) |
Translate mouse cursor position into actual row/column. This function is irrelevant if the expose method has not (yet) been called. More... | |
void(* | begin_mouse_drag )(struct _text_object_ *pThis) |
Begin a mouse 'drag' operation. More... | |
void(* | end_mouse_drag )(struct _text_object_ *pThis) |
End a mouse 'drag' operation. More... | |
void(* | cursor_up )(struct _text_object_ *pThis) |
Move the current cursor position up one line. More... | |
void(* | cursor_down )(struct _text_object_ *pThis) |
Move the current cursor position down one line. More... | |
void(* | cursor_left )(struct _text_object_ *pThis) |
Move the current cursor position left one column. More... | |
void(* | cursor_right )(struct _text_object_ *pThis) |
Move the current cursor position right one column. More... | |
void(* | page_up )(struct _text_object_ *pThis) |
Move the current cursor position up one page. More... | |
void(* | page_down )(struct _text_object_ *pThis) |
Move the current cursor position down one page. More... | |
void(* | page_left )(struct _text_object_ *pThis) |
Move the current cursor position left one page. More... | |
void(* | page_right )(struct _text_object_ *pThis) |
Move the current cursor position right one page. More... | |
void(* | cursor_home )(struct _text_object_ *pThis) |
Move the cursor 'home' (left or BOL) More... | |
void(* | cursor_end )(struct _text_object_ *pThis) |
Move the cursor to 'end' (full doc width or EOL) More... | |
void(* | cursor_top )(struct _text_object_ *pThis) |
Move the cursor to the top line. More... | |
void(* | cursor_bottom )(struct _text_object_ *pThis) |
Move the cursor to the last line. More... | |
void(* | scroll_vertical )(struct _text_object_ *pThis, int nRows) |
Scroll the viewport up/down by the specified number of rows. More... | |
void(* | scroll_horizontal )(struct _text_object_ *pThis, int nCols) |
Scroll the cursor to the right/left a specified number of columns. More... | |
void(* | do_expose )(struct _text_object_ *pThis, Display *pDisplay, Window wID, WBGC gc, const WB_GEOM *pPaintGeom, const WB_GEOM *pViewGeom, WB_FONTC pFont) |
Member function to properly render the text in a window (Expose event) More... | |
void(* | cursor_blink )(struct _text_object_ *pThis, int bHasFocus) |
Periodic callback to 'blink' the cursor. More... | |
void(* | set_save_point )(struct _text_object_ *pThis) |
Set the 'save point' with respect to the undo/redo buffer. More... | |
int(* | get_modified )(struct _text_object_ *pThis) |
Set the 'save point' with respect to the undo/redo buffer. More... | |
'vtable' structure for TEXT_OBJECT
Definition at line 317 of file text_object.h.
void(* begin_highlight) (struct _text_object_ *pThis) |
Begin a highlight block.
pThis | A pointer to the TEXT_OBJECT structure |
pRct | A const pointer to a WB_RECT structure that contains the new highlight block (in characters), or NULL to remove the highlight block |
This function is essentially a UI helper for cursor select. When a cursor keystroke should cause a highlight to occur, call this function to start a highlight block. The current cursor will become the anchor, and subsequent cursor motion will extend the highlight block. A begin_highlight() will effectively do an end_mouse_drag() but will not clear the current selection. It is safe to call this function multiple times while selecting with cursor keys from the keyboard; hence, a 'shift' cursor should call this every time to avoid state flag checks.
Definition at line 655 of file text_object.h.
void(* begin_mouse_drag) (struct _text_object_ *pThis) |
Begin a mouse 'drag' operation.
pThis | A pointer to the TEXT_OBJECT structure |
This function is essentially a UI helper for mouse drag-select. Call this function in response to a WB_POINTER_DRAG notification, then call mouse_click() with the WB_POINTER_MOVE notifications. When the WB_POINTER_DROP notification arrives, call end_mouse_drag() to complete the operation.
Definition at line 693 of file text_object.h.
int(* can_redo) (struct _text_object_ *pThis) |
Indicate whether a 'redo' operation is possible (mostly for menu UI)
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 614 of file text_object.h.
int(* can_undo) (struct _text_object_ *pThis) |
Indicate whether an 'undo' operation is possible (mostly for menu UI)
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 602 of file text_object.h.
void(* cursor_blink) (struct _text_object_ *pThis, int bHasFocus) |
Periodic callback to 'blink' the cursor.
pThis | A pointer to the TEXT_OBJECT structure |
bHasFocus | A non-zero value if the window has focus (cursor blinks), else zero (no cursor) |
This function will alter the 'blink' state of the cursor, generating Expose events as needed to re-paint it within the window. An owning window should call this function using the time period specified by the system settings, but ONLY AFTER at least one 'do_expose' call.
Definition at line 825 of file text_object.h.
void(* cursor_bottom) (struct _text_object_ *pThis) |
Move the cursor to the last line.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 763 of file text_object.h.
void(* cursor_down) (struct _text_object_ *pThis) |
Move the current cursor position down one line.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 713 of file text_object.h.
void(* cursor_end) (struct _text_object_ *pThis) |
Move the cursor to 'end' (full doc width or EOL)
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 753 of file text_object.h.
void(* cursor_home) (struct _text_object_ *pThis) |
Move the cursor 'home' (left or BOL)
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 748 of file text_object.h.
void(* cursor_left) (struct _text_object_ *pThis) |
Move the current cursor position left one column.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 718 of file text_object.h.
void(* cursor_right) (struct _text_object_ *pThis) |
Move the current cursor position right one column.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 723 of file text_object.h.
void(* cursor_top) (struct _text_object_ *pThis) |
Move the cursor to the top line.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 758 of file text_object.h.
void(* cursor_up) (struct _text_object_ *pThis) |
Move the current cursor position up one line.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 708 of file text_object.h.
void(* del_chars) (struct _text_object_ *pThis, int nChar) |
Delete 'n' characters from the current cursor. Negative deletes BEFORE the cursor. 'newline' counts as 1 character.
pThis | A pointer to the TEXT_OBJECT structure |
nChar | The number of characters to delete. Negative values delete BEFORE the cursor. Zero does nothing. |
Definition at line 570 of file text_object.h.
void(* del_select) (struct _text_object_ *pThis) |
Delete the current selection assigned via 'set_select'.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 555 of file text_object.h.
void(* destroy) (struct _text_object_ *pThis) |
Call this prior to de-allocating memory to free up any internal objects or storage.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 323 of file text_object.h.
void(* do_expose) (struct _text_object_ *pThis, Display *pDisplay, Window wID, WBGC gc, const WB_GEOM *pPaintGeom, const WB_GEOM *pViewGeom, WB_FONTC pFont) |
Member function to properly render the text in a window (Expose event)
pThis | A pointer to the TEXT_OBJECT structure |
pDisplay | A pointer to the Display for the window (NULL to use Default) |
wID | The Window ID for the window to be painted |
gc | The graphics context to use when painting |
pPaintGeom | A const pointer to a WB_GEOM structure bounding the invalid area (NULL implies ALL) |
pViewGeom | A const pointer to a WB_GEOM structure bounding the paintable area within the window (NULL implies entire window) |
pFont | A WB_FONTC to use in lieu of the font assigned to the Window (NULL if the Window's default font is used) |
Use this function in the Expose event callback for the window in order to properly render the edit text. Prior to calling this function you will need to assign the correct foreground color, and background color to the WBGC. If 'pFont' is NULL, then the font must also be already assigned to the WBGC or to the Window; otherwise, the specified font will be used to render the text. Note that all fonts will be treate as if they are 'fixed pitch' and so a variable pitch font will be rendered "centered" within the character's position.
The 'pViewGeom' member represents the bounding rectangle of the window 'wID' within which to render the text, excluding any scroll bars. Changes to this value may require re-calculating the current 'view' area, which will attempt to preserve the relevant area with respect to the current cursor position and/or visible text.
This function will cache the Window ID as 'wIDOwner' for subsequent use by a number of internal operations. This ensures the most efficient expose handling. Callers should only invalidate areas handled by the TEXT_OBJECT when absolutely necessary.
NOTE: text color may be adjusted based on the type of buffer data being stored. Some buffered text data might have color information associated with it and as such the text will be rendered using the appropriate color. Color information is object-specific.
See Also: WBTextObjectSetColorContextCallback()
Definition at line 813 of file text_object.h.
void(* end_highlight) (struct _text_object_ *pThis) |
End a highlight block.
pThis | A pointer to the TEXT_OBJECT structure |
pRct | A const pointer to a WB_RECT structure that contains the new highlight block (in characters), or NULL to remove the highlight block |
This function is essentially a UI helper for cursor select. Normally a keystroke that is NOT a cursor motion will automatically end the highlighting. Calling this function does not affect the highlighted area. It is safe to call this function at any time, whether highlighting is taking place or not.
Definition at line 665 of file text_object.h.
void(* end_mouse_drag) (struct _text_object_ *pThis) |
End a mouse 'drag' operation.
pThis | A pointer to the TEXT_OBJECT structure |
This function is essentially a UI helper for mouse drag-select. It is safe to call this function at any time, whether highlighting is taking place or not.
Definition at line 701 of file text_object.h.
int(* get_col) (const struct _text_object_ *pThis) |
Get the current column cursor for the object.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 538 of file text_object.h.
int(* get_cols) (struct _text_object_ *pThis) |
Call this function to obtain the estimated column extent of the document.
pThis | A pointer to the TEXT_OBJECT structure |
This function returns the estimated column count, the maximum extent of any line within the text object. While editing, if the column count of a single line exceeds the current 'maximum', a new maximum will be calculated in "tab widths". Periodically this value will be re-estimated as needed to accomodate changes to the text.
NOTE: the pointer to the TEXT_OBJECT cannot be a 'const' in this case, since cached values may need to be re-evaluated as part of the process of obtaining the desired information.
Definition at line 385 of file text_object.h.
int(* get_filetype) (const struct _text_object_ *pThis) |
Get the current linefeed type for the object.
pThis | A pointer to the TEXT_OBJECT structure |
A file type of 0 is 'plain text'. A file type of '-1' is 'Makefile' and by default, preserves hard tabs. Other file types are defined as one of the 'file type' constants
Definition at line 394 of file text_object.h.
int(* get_insmode) (const struct _text_object_ *pThis) |
Get the current insert mode for the object.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 427 of file text_object.h.
int(* get_linefeed) (const struct _text_object_ *pThis) |
Get the current linefeed type for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iLineFeed values: 0 (single line) 1 (newline) 2 (return) 3 (crlf) 4 (lfcr)
Definition at line 412 of file text_object.h.
int(* get_modified) (struct _text_object_ *pThis) |
Set the 'save point' with respect to the undo/redo buffer.
pThis | A pointer to the TEXT_OBJECT structure |
Use this function to obtain the 'changed' status of the text object. A text object that has been saved (or was just created) is considered to be 'unmodified'. Otherwise, anything that writes to the undo buffer/redo buffer that has not directly reverted back to the 'as saved' content is considered "modified".
use set_save_point() to mark a file as 'saved' and set it to 'unmodified'
Definition at line 854 of file text_object.h.
int(* get_row) (const struct _text_object_ *pThis) |
Get the current row cursor for the object.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 525 of file text_object.h.
int(* get_rows) (const struct _text_object_ *pThis) |
Call this function to obtain the total number of rows for display purposes.
pThis | A const pointer to the TEXT_OBJECT structure |
This function returns the row count. If the final line is blank, the row count will still include it. The return value is intended to assist scrolling the viewable area, so a final blank line must still be counted. Single-line text always returns a 1 unless the text is empty. A zero is always returned whenever there is no text in the object. This allows you to detect an 'empty' text object.
Definition at line 371 of file text_object.h.
int(* get_scrollmode) (const struct _text_object_ *pThis) |
Get the current scroll mode for the object.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 478 of file text_object.h.
char*(* get_sel_text) (const struct _text_object_ *pThis, const WB_RECT *pRct) |
get the current selection rectangle as WB_RECT
pThis | A pointer to the TEXT_OBJECT structure |
pRct | A const pointer to the source WB_RECT containing the selection rectangle. NULL uses the current selection. |
This function returns a 'WBAlloc'd pointer, or NULL on error. If the returned pointer is not NULL, the caller must free it.
If the select mode is 'block', individual lines will always end in <LF>, and tabs will expand to <space> characters except for the 'special case' noted below
In the special case of *pRct == {0,0,0,0}, all of the text will be copied, regardless of the select mode, in a format consistent with saving the text as a file, using the assigned line ending.
Definition at line 519 of file text_object.h.
void(* get_select) (const struct _text_object_ *pThis, WB_RECT *pRct) |
Get the current selection rectangle as WB_RECT.
pThis | A pointer to the TEXT_OBJECT structure |
pRct | A pointer to the destination WB_RECT, receives the return value. 'No select' returns {0,0,0,0} |
Definition at line 492 of file text_object.h.
int(* get_selmode) (const struct _text_object_ *pThis) |
Get the current selection mode for the object.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 440 of file text_object.h.
int(* get_tab) (const struct _text_object_ *pThis) |
Get the current tab type for the object.
pThis | A pointer to the TEXT_OBJECT structure |
A positive tab type is the column width for a 'hard tab' character. A negative tab type indicates the tab column width but substitutes spaces for hard tabs.
NOTE: Existing hard tabs within the text will be preserved even if a negative tab type is selected, so long as the white space covered by the tab is not modified.
A tab type of zero uses the 'default' behavior for the application and file type.
Definition at line 459 of file text_object.h.
char*(* get_text) (struct _text_object_ *pThis) |
Call this function to get all text, formatted so that it can be saved to a file.
pThis | A pointer to the TEXT_OBJECT structure |
This function allocates a buffer, then copies all of the text to the buffer using the specified line endings and other information.
Definition at line 346 of file text_object.h.
void(* get_view) (const struct _text_object_ *pThis, WB_RECT *pRct) |
Get the current viewport (in characters). The return value is not relevant if the expose method has not (yet) been called.
pThis | A pointer to the TEXT_OBJECT structure |
pRct | A pointer to a WB_RECT structure that receives the current viewport (in characters) |
The 'viewport' is the currently visible area (in characters). It is independent of the cursor's row and column.
Definition at line 630 of file text_object.h.
int(* has_select) (const struct _text_object_ *pThis) |
Returns a non-zero value if there is currently a 'selection'.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 505 of file text_object.h.
void(* highlight_colors) (struct _text_object_ *pThis, XColor clrHFG, XColor clrHBG) |
Call this to assign the highlight colors. Default colors are WBGC's BG and FG.
pThis | A pointer to the TEXT_OBJECT structure |
clrHFG | The XColor for the highlighted foreground |
clrHBG | The XColor for the highlighted background |
Definition at line 337 of file text_object.h.
void(* indent) (struct _text_object_ *pThis, int nCol) |
Indent selected text by 'n' columns.
pThis | A pointer to the TEXT_OBJECT structure |
nChar | The number of characters to indent by. negative indents left, positive right. Zero does nothing. |
indents the selected text by 'n' columns. Indent starts at the cursor and continues for each line within the selected text.
Definition at line 596 of file text_object.h.
void(* init) (struct _text_object_ *pThis) |
Call this to initialize or re-initialize an object. Must call 'destroy' first for an existing object.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 329 of file text_object.h.
void(* ins_chars) (struct _text_object_ *pThis, const char *pChar, int nChar) |
Insert 'n' characters (including new lines) from the current cursor.
pThis | A pointer to the TEXT_OBJECT structure |
pChar | A pointer to the text to insert. NULL effectively does nothing. |
nChar | The number of characters in the buffer pointed to by 'pChar', or 0 to indicate '0-byte terminated string' |
The behavior of multi-line insert depends upon the selection mode. If 'char' or 'line' mode is selected, a 'newline' inserts a new line following the newline character. "\r\n", "\r", "\n", and "\n\r" are all treated the same. Multiple LF and CR combinations that vary in order/construct may produce unexpected results. if 'box' mode is selected, each subsequent line will be inserted at the next line's 'col' position. Hard tabs will be evaluated during insertion and converted to white space. It is assumed that the length of each line in 'box' select mode will be identical, but if it is not, the results will follow the length of the actual text. If the 'box' select length exceeds the last line of the file, the additional lines will be added as if in 'line' mode.
Definition at line 586 of file text_object.h.
void(* mouse_click) (struct _text_object_ *pThis, int iMouseXDelta, int iMouseYDelta, int iType, int iACS) |
Translate mouse cursor position into actual row/column. This function is irrelevant if the expose method has not (yet) been called.
pThis | A pointer to the TEXT_OBJECT structure |
iMouseXDelta | The delta X position of the mouse cursor from the upper left corner of the viewport window |
iMouseYDelta | The delta Y position of the mouse cursor from the upper left corner of the viewport window |
iType | A bit mask indicating the mouse button (typically WB_POINTER_BUTTON1, or 0 for mouse motion during drag) |
iACS | A bit mask indicating ALT+CONTROL+SHIFT state (typically 0) |
Call this function to process mouse clicks properly. It will cause the cursor to move, or a highlighted area to be extended, depending on the nature of the mouse click. Use begin_mouse_drag() and end_mouse_drag() to indicate if a mouse drag operation (highlight an area) is in progress.
Mouse clicks automatically do an end_highlight() and clear the highlight area if a 'drag' is not in progress.
Definition at line 683 of file text_object.h.
void(* page_down) (struct _text_object_ *pThis) |
Move the current cursor position down one page.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 733 of file text_object.h.
void(* page_left) (struct _text_object_ *pThis) |
Move the current cursor position left one page.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 738 of file text_object.h.
void(* page_right) (struct _text_object_ *pThis) |
Move the current cursor position right one page.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 743 of file text_object.h.
void(* page_up) (struct _text_object_ *pThis) |
Move the current cursor position up one page.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 728 of file text_object.h.
void(* redo) (struct _text_object_ *pThis) |
Perform a single 'redo' operation.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 620 of file text_object.h.
void(* replace_select) (struct _text_object_ *pThis, const char *szText, unsigned long cbLen) |
Replace the current selection assigned via 'set_select' with new text.
pThis | A pointer to the TEXT_OBJECT structure |
szText | A pointer to the text to replace the selection with (NULL or "" effectively performs 'del_select') |
cbLen | The length of the text to replace the selection with (zero implies 'zero-byte terminated string' for szText) |
Definition at line 563 of file text_object.h.
void(* scroll_horizontal) (struct _text_object_ *pThis, int nCols) |
Scroll the cursor to the right/left a specified number of columns.
pThis | A pointer to the TEXT_OBJECT structure |
nCols | The number of columns to scroll by; negative scrolls left, positive right |
Definition at line 775 of file text_object.h.
void(* scroll_vertical) (struct _text_object_ *pThis, int nRows) |
Scroll the viewport up/down by the specified number of rows.
pThis | A pointer to the TEXT_OBJECT structure |
nRows | The number of rows to scroll by; negative scrolls up, positive down |
Definition at line 769 of file text_object.h.
void(* set_col) (struct _text_object_ *pThis, int iCol) |
Set the current column cursor for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iCol | The column position, where 0 is the left-most column (independent of hard tabs or end of line). |
Passing '-1' for the 'iCol' parameter will place the cursor on the first non-white-space character on the line (if any).
Passing '-2' for the 'iCol' parameter will place the cursor at the end of the line, excluding any trailing white space.
Passing any other negative value is the same as passing '0'.
Definition at line 549 of file text_object.h.
void(* set_filetype) (struct _text_object_ *pThis, int iLineFeed) |
Set the current file type for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iInsMode | An integer indicating the new file type, one of the 'file type' definitions |
A file type of 0 is 'plain text'. A file type of '-1' is 'Makefile' and by default, preserves hard tabs. Other file types are defined as one of the 'file type' constants
Definition at line 404 of file text_object.h.
void(* set_insmode) (struct _text_object_ *pThis, int iInsMode) |
Set the current insert mode for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iInsMode | An integer indicating the new insert mode |
Definition at line 434 of file text_object.h.
void(* set_linefeed) (struct _text_object_ *pThis, int iLineFeed) |
Set the current linefeed type for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iInsMode | An integer indicating the new 'linefeed' type for end of line |
iLineFeed values: 0 (single line) 1 (newline) 2 (return) 3 (crlf) 4 (lfcr)
Definition at line 421 of file text_object.h.
void(* set_row) (struct _text_object_ *pThis, int iRow) |
Set the current row cursor for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iRow | The row position, where 0 is the top row |
Definition at line 532 of file text_object.h.
void(* set_save_point) (struct _text_object_ *pThis) |
Set the 'save point' with respect to the undo/redo buffer.
pThis | A pointer to the TEXT_OBJECT structure |
Use this function to inform the text object when you have saved the file, and it is no longer 'modified'. In conjuction with undo/redo, this helps to maintain the 'modified' state for the text object.
use get_modified() to determine whether or not a file has been modified since the last call to set_save_point().
Definition at line 839 of file text_object.h.
void(* set_scrollmode) (struct _text_object_ *pThis, int iScrollMode) |
Set the current scroll mode for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iScrollMode | An integer indicating the new scroll mode |
Definition at line 485 of file text_object.h.
void(* set_select) (struct _text_object_ *pThis, const WB_RECT *pRct) |
Set the current selection rectangle as WB_RECT.
pThis | A pointer to the TEXT_OBJECT structure |
pRct | A const pointer to the source WB_RECT containing the new selection rectangle, or NULL for 'no selection' |
Definition at line 499 of file text_object.h.
void(* set_selmode) (struct _text_object_ *pThis, int iSelMode) |
Set the current selection mode for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iSelMode | An integer indicating the new selection mode |
Definition at line 447 of file text_object.h.
void(* set_tab) (struct _text_object_ *pThis, int iTab) |
Set the current tab type for the object.
pThis | A pointer to the TEXT_OBJECT structure |
iTab | An integer indicating the new tab type |
A positive tab type is the column width for a 'hard tab' character. A negative tab type indicates the tab column width but substitutes spaces for hard tabs.
NOTE: Existing hard tabs within the text will be preserved even if a negative tab type is selected, so long as the white space covered by the tab is not modified.
A tab type of zero uses the 'default' behavior for the application and file type.
Definition at line 472 of file text_object.h.
void(* set_text) (struct _text_object_ *pThis, const char *szText, unsigned long cbLen) |
Call this function to re-assign all text in the control.
pThis | A pointer to the TEXT_OBJECT structure |
szText | A pointer to the text to replace the selection with (NULL or "" effectively empties the buffer) |
cbLen | The length of the text to replace the selection with (zero implies 'zero-byte terminated string' for szText) |
Typically this is called when a file is (re)loaded or when the 'caption' is changed for the control. Calling this function will perform a number of related functions, such as cursor positioning.
You should manually force a re-draw of the control displaying the text. It will not happen automatically.
Definition at line 359 of file text_object.h.
void(* set_view_orig) (struct _text_object_ *pThis, const WB_POINT *pOrig) |
Set the current viewport (in characters). Only 'left' and 'top' are relevant if the expose method has not (yet) been called.
pThis | A pointer to the TEXT_OBJECT structure |
pOrig | A const pointer to a WB_POINT structure that contains the new viewport origin (in characters) |
The 'viewport' is the currently visible area (in characters). It is independent of the cursor's row and column. You cannot assign the viewport size directly using this function. It is derived from things like the font size and the size of the display window. You can assign the origin this way, to force the display window to display an area of the text data beginning with the origin point. This is useful for scrollbar handling.
Definition at line 642 of file text_object.h.
void(* undo) (struct _text_object_ *pThis) |
Perform a single 'undo' operation.
pThis | A pointer to the TEXT_OBJECT structure |
Definition at line 608 of file text_object.h.