X11workbench Toolkit
1.0
|
A 'C++'-like object for managing text, that can be overridden for custom behavior. More...
#include "window_helper.h"
Go to the source code of this file.
Data Structures | |
struct | s_text_object_vtable |
'vtable' structure for TEXT_OBJECT More... | |
struct | s_text_object |
'base class' structure for TEXT_OBJECT More... | |
struct | s_text_buffer |
'base class' structure for TEXT_OBJECT More... | |
Macros | |
#define | HARD_TAB_CHAR '\xa0' |
#define | DEFAULT_TAB_WIDTH 8 |
#define | AUTO_HSCROLL_SIZE 8 |
#define | MIN_LINE_SPACING 2 |
#define | MIN_BORDER_SPACING 2 |
#define | TEXT_OBJECT_TAG (*((const unsigned int *)"WBTX")) |
The 'tag' for a TEXT_OBJECT structure. | |
#define | TEXT_BUFFER_LINE_CACHE_SIZE 32 |
Typedefs | |
typedef struct s_text_object | TEXT_OBJECT |
'base class' structure for TEXT_OBJECT More... | |
typedef struct s_text_object_vtable | TEXT_OBJECT_VTABLE |
'vtable' structure for TEXT_OBJECT More... | |
typedef struct s_text_buffer | TEXT_BUFFER |
'base class' structure for TEXT_OBJECT More... | |
Functions | |
static __inline__ const TEXT_OBJECT_VTABLE * | WBGetDefaultTextObjectVTable (void) |
returns the default vtable for a TEXT_OBJECT structure More... | |
static __inline__ int | WBIsValidTextObject (const TEXT_OBJECT *pObj) |
'TEXT_OBJECT' validator More... | |
static __inline__ void | WBInitializeInPlaceTextObject (TEXT_OBJECT *pTextObject, Window wIDOwner) |
initialize an 'in-place' TEXT_OBJECT structure More... | |
static __inline__ void | WBDestroyInPlaceTextObject (TEXT_OBJECT *pTextObject) |
Destroy a previously initialized 'in-place' TEXT_OBJECT structure. More... | |
TEXT_BUFFER * | WBAllocTextBuffer (const char *pBuf, unsigned int cbBufSize) |
Generic constructor for a TEXT_BUFFER using defaults. More... | |
int | WBCheckReAllocTextBuffer (TEXT_BUFFER **ppBuf, int nLinesToAdd) |
Re-allocator for TEXT_BUFFER object. More... | |
void | WBFreeTextBuffer (TEXT_BUFFER *pBuf) |
Re-allocator for TEXT_BUFFER object, returns ZERO on success. Pointer may be modified (or not). More... | |
int | WBTextBufferLineLength (TEXT_BUFFER *pBuf, unsigned long nLine) |
Text buffer 'cached information' query function indicating a line's cached length. More... | |
void | WBTextBufferLineChange (TEXT_BUFFER *pBuf, unsigned long nLine, int nNewLen) |
Text buffer 'cached information' update function indicating a change to a line's length. More... | |
void | WBTextBufferRefreshCache (TEXT_BUFFER *pBuf) |
Text buffer 'cached information' refresh function. More... | |
void | WBTextObjectSetColorContextCallback (TEXT_OBJECT *pThis, unsigned long(*callback)(TEXT_OBJECT *pThis, int nRow, int nCol), void *pColorContextPointer) |
assign callback function for 'color context' for a given character More... | |
TEXT_OBJECT * | WBTextObjectConstructor (unsigned long cbStructSize, const char *szText, unsigned long cbLen, Window wIDOwner) |
Generic constructor for a TEXT_OBJECT using defaults. More... | |
void | WBTextObjectDestructor (TEXT_OBJECT *pObj) |
Generic detructor for a TEXT_OBJECT. More... | |
int | WBTextObjectCalculateLineHeight (int iAscent, int iDescent) |
Calculate the correct per-line height (in pixels) for a specified font ascent and descent. More... | |
char * | WBInsertMBChars (char *pString, int iCol, const char *pszMBString, int cbString, int fTab, int fOverwrite, int *piNewCol, char **ppInserted) |
Insert multi-byte characters into a WBAlloc'd string, at a specified column. More... | |
char * | WBSplitMBLine (char *pString, int iCol) |
Split a multi-byte characters into a WBAlloc'd string, at a specified column, terminating the original string at that column with a zero byte. More... | |
char * | WBJoinMBLine (char *pString, int iCol, const char *pJoin) |
Split a multi-byte characters into a WBAlloc'd string, at a specified column, terminating the original string at that column with a zero byte. More... | |
int | WBDelMBChars (char *pString, int iCol, int nDel, int *piNewCol, char **ppDeleted) |
Delete a specified number of multi-byte characters from a string 'in place', starting at a specified column. More... | |
int | WBGetMBLength (const char *pString) |
Obtain the length of a multi-byte character string in 'characters' (not bytes) More... | |
char * | WBGetMBCharPtr (char *pString, int iCol, int *pcbLen) |
Obtain the pointer to a specific multi-byte character within a multi-byte character string, by specifying it's column. More... | |
int | WBGetMBColIndex (const char *pString, const char *pChar) |
Obtain the column index from a pointer within a multi-byte character string. More... | |
A 'C++'-like object for managing text, that can be overridden for custom behavior.
X11workbench Toolkit API 'text object' for copying and drawing text, determining text extents for rendering, managing edits and undo for a block of text, and so on. In short it encapsulates the core functionality for managing a block of editable and/or viewable text.
Definition in file text_object.h.