X11 Work Bench Toolkit  1.0
text_object.h File Reference

A 'C++'-like object for managing text, can be overridden. More...

#include "window_helper.h"

Go to the source code of this file.

Data Structures

struct  _text_object_vtable_
 'vtable' structure for TEXT_OBJECT More...
 
struct  _text_object_
 'base class' structure for TEXT_OBJECT More...
 
struct  _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 _text_object_vtable_ TEXT_OBJECT_VTABLE
 'vtable' structure for TEXT_OBJECT More...
 
typedef struct _text_object_ TEXT_OBJECT
 'base class' structure for TEXT_OBJECT More...
 
typedef struct _text_buffer_ TEXT_BUFFER
 'base class' structure for TEXT_OBJECT More...
 

Enumerations

enum  _FileType_ {
  FileType_MAKEFILE = -1, FileType_PLAIN_TEXT = 0, FileType_CLANG = 1, FileType_JAVA = 2,
  FileType_PERL = 3, FileType_PHP = 4, FileType_SHELL = 5, FileType_MASK = 0x7fff,
  FileType_HARDTAB = 0x10000, FileType_RESERVED2 = 0x20000, FileType_RESERVED3 = 0x40000, FileType_RESERVED4 = 0x80000
}
 file types for TEXT_OBJECT
 
enum  _LineFeed_ {
  LineFeed_NONE = -1, LineFeed_DEFAULT = 0, LineFeed_NEWLINE = 1, LineFeed_RETURN = 2,
  LineFeed_CRLF = 3, LineFeed_LFCR = 4, LineFeed_ENTRYCOUNT = 5
}
 line feed (line ending) types for TEXT_OBJECT More...
 
enum  _SelectMode_ { SelectMode_DEFAULT = 0, SelectMode_CHAR = 1, SelectMode_LINE = 2, SelectMode_BOX = 3 }
 select mode types for TEXT_OBJECT More...
 
enum  _InsertMode_ { InsertMode_DEFAULT = 0, InsertMode_INSERT = 1, InsertMode_OVERWRITE = 2 }
 Insert/Overwrite mode for TEXT_OBJECT. More...
 
enum  _DragState_ { DragState_NONE = 0, DragState_CURSOR = 1, DragState_MOUSE = 2 }
 State flags for mouse/cursor 'drag' (i.e. selection) More...
 

Functions

static __inline__ const
TEXT_OBJECT_VTABLE
WBGetDefaultTextObjectVTable (void)
 returns the default vtable for a TEXT_OBJECT structure
 
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_BUFFERWBAllocTextBuffer (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...
 
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...
 
TEXT_OBJECTWBTextObjectConstructor (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...
 

Detailed Description

A 'C++'-like object for managing text, can be overridden.

X11 Work Bench Toolkit Toolkit API

Definition in file text_object.h.