58 #ifndef _DRAW_TEXT_H_INCLUDED_ 59 #define _DRAW_TEXT_H_INCLUDED_ 61 #ifndef WINDOW_HELPER_H_INCLUDED 63 #endif // WINDOW_HELPER_H_INCLUDED 91 DTAlignment_VMASK = 0xf0,
242 WBGC gc,
int x,
int y,
const char *pString,
int nLength);
356 int iTabWidth,
int iTabOrigin,
const WB_RECT *prcBounds,
int iAlignment);
379 int iTabWidth,
int iTabOrigin,
const WB_RECT *prcBounds,
int iAlignment);
427 WB_RECT *prcBounds,
int iAlignment,
int iStartLine,
int iEndLine);
449 int iHScrollBy,
int iVScrollBy,
const WB_RECT *prcBounds,
const WB_RECT *prcViewport,
int iAlignment);
453 #endif // __cplusplus 456 #endif // _DRAW_TEXT_H_INCLUDED_ const char * szText
original text pointer
int DTCalcIdealBounds(Display *pDisplay, WB_FONTC pFont, const char *szText, int iTabWidth, unsigned int iTabOrigin, const WB_RECT *prcSource, WB_RECT *prcDest, int iAlignment)
Calculate the ideal bounding rectangle for the specified text and font.
'window helper' main header file for the X11workbench Toolkit API
int iWidth
width of text in pixels (based on font size) (NA for tabs, LF, valid for white space)
center along the font baseline (single line only)
internal flag, indicates that an underscore underlines the next character
int nMax
max number of items in aWords (for memory allocation purposes)
internal flag, 'single line only' (no line breaks). Implies DTAlignment_NO_WORD_WRAP
int nCount
number of items in aWords
top-aligned text (using highest vertical ascent)
WB_FONT DTCalcIdealFont(Display *pDisplay, WB_FONTC pFont, const char *szText, WB_GEOM *geomBounds)
Calculate the ideal font based on the text and rectangle.
horizontally centered text. tabs are treated as white space
internal wrapper struct for X11 'geometry' definition
int iMaxWidth
maximum width of contained text, or -1 if not known
struct tagDT_WORDS DT_WORDS
A collection of DT_WORD structures along with a pointer to the original text.
void DTDrawSingleLineText(WB_FONTC pFontt, const char *szText, Display *pDisplay, WBGC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
draw single-line text
void DTPreRender(Display *pDisplay, WB_FONTC pFont, DT_WORDS *pWords, int iTabWidth, int iTabOrigin, WB_RECT *prcBounds, int iAlignment, int iStartLine, int iEndLine)
Pre-render a 'DT_WORDS' structure for subsequent display.
Structure defining a 'word' for rendering purposes.
internal flag, applies simple anti-aliasing. See WBSimpleAntiAliasImage() and WBSimpleAntiAliasPixmap...
do not increase size horizontally
A collection of DT_WORD structures along with a pointer to the original text.
center using entire text height (ascent + descent for single line)
int DTCalcIdealBounds0(XFontStruct *pFont, const char *szText, int iTabWidth, unsigned int iTabOrigin, const WB_RECT *prcSource, WB_RECT *prcDest, int iAlignment)
Calculate the ideal bounding rectangle for the specified text and font.
center within the top half of the rectangle (single line only)
Do not shrink the bounding rectangle for ideal text dimension.
center within the bottom half of the rectangle (single line only)
DTAlignment
Alignment flags for various 'draw text' API functions.
int iIsTab
indicates that the text consists of tabs (nLength for number of tabs, pText is NULL)
int iIsWhiteSpace
indicates that it is 'white space' (regular or special character) (nLength, width,...
void DTDrawString(Display *pDisplay, Drawable drawable, WB_FONTC pFont, WBGC gc, int x, int y, const char *pString, int nLength)
Draw text in a platform-independent manner for UTF-8 or multi-byte text, equivalent to WBDrawString()...
struct tagDT_WORD DT_WORD
Structure defining a 'word' for rendering purposes.
int iHeight
height of text in pixels (based on font size) (NA for tabs, LF, valid for white space)
DT_WORD aWords[1]
The actual data (self-contained within the memory block)
internal wrapper struct for 'rectangle' definition
horizontal alignment mask
struct tagDT_WORDS * pNext
pointer to next structure in linked list (reserved)
int iY
Relative 'Y' pixel position for the beginning of this element (when pre-rendered, else -1)
do not increase size vertically
struct tagDT_WORDS * pPrev
pointer to previous structure in linked list (reserved)
DT_WORDS * DTGetWordsFromText(Display *pDisplay, WB_FONTC pFont, const char *szText, int iAlignment)
Parse 'DT_WORDS' structure from single-line or multi-line text.
int iIsLineFeed
indicates a line feed (CR, CRLF, LF, or LFCR) (nLength for number of line feeds, pText is NULL)
void DTDrawMultiLineText(WB_FONTC pFont, const char *szText, Display *pDisplay, WBGC gc, Drawable dw, int iTabWidth, int iTabOrigin, const WB_RECT *prcBounds, int iAlignment)
draw multi-line text
center halfway up the 'ascent' portion (single line only)
void DTRender(Display *pDisplay, WB_FONTC pFont, const DT_WORDS *pWords, WBGC gc, Drawable dw, int iHScrollBy, int iVScrollBy, const WB_RECT *prcBounds, const WB_RECT *prcViewport, int iAlignment)
Using pre-rendered 'DT_WORDS' structure, display.
An allocated structure containing XFontStruct, XFontInfo, and XftFont [as applicable] for a specified...
internal wrapper struct for GC with local cache
int nLength
length of text element (in bytes)
bottom-aligned text (using lowest vertical descent)
int iX
Relative 'X' pixel position for the beginning of this element (when pre-rendered, else -1)
int iMaxHeight
maximum height of contained text, or -1 if not known