mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-13 04:15:50 +01:00
including parser in wtext.c
This commit is contained in:
@@ -388,12 +388,13 @@ typedef struct WMInputPanel {
|
|||||||
|
|
||||||
/* WMRuler: */
|
/* WMRuler: */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int *tabs; /* a growable array of tabstops */
|
unsigned short *tabs; /* a growable array of tabstops */
|
||||||
unsigned short ntabstops:4; /* how many there are */
|
unsigned short ntabstops; /* how many there are */
|
||||||
unsigned short left:15; /* left margin marker */
|
unsigned short left; /* left margin marker */
|
||||||
unsigned short right:15; /* right margin marker */
|
unsigned short right; /* right margin marker */
|
||||||
unsigned short first:15; /* indentation marker for first line only */
|
unsigned short first; /* indentation marker for first line only */
|
||||||
unsigned short body:15; /* body indentation marker */
|
unsigned short body; /* body indentation marker */
|
||||||
|
unsigned short retainCount;
|
||||||
} WMRulerMargins;
|
} WMRulerMargins;
|
||||||
/* All indentation and tab markers are _relative_ to the left margin marker */
|
/* All indentation and tab markers are _relative_ to the left margin marker */
|
||||||
|
|
||||||
@@ -789,6 +790,8 @@ void WMMapWidget(WMWidget *w);
|
|||||||
|
|
||||||
void WMRaiseWidget(WMWidget *w);
|
void WMRaiseWidget(WMWidget *w);
|
||||||
|
|
||||||
|
void WMLowerWidget(WMWidget *w);
|
||||||
|
|
||||||
void WMMoveWidget(WMWidget *w, int x, int y);
|
void WMMoveWidget(WMWidget *w, int x, int y);
|
||||||
|
|
||||||
void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
|
void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
|
||||||
@@ -832,6 +835,8 @@ extern char *WMViewSizeDidChangeNotification;
|
|||||||
|
|
||||||
extern char *WMViewRealizedNotification;
|
extern char *WMViewRealizedNotification;
|
||||||
|
|
||||||
|
extern char *WMFontPanelDidChangeNotification;
|
||||||
|
|
||||||
|
|
||||||
/* ....................................................................... */
|
/* ....................................................................... */
|
||||||
|
|
||||||
@@ -1386,10 +1391,13 @@ int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
|
|||||||
|
|
||||||
WMRuler *WMCreateRuler (WMWidget *parent);
|
WMRuler *WMCreateRuler (WMWidget *parent);
|
||||||
|
|
||||||
WMRulerMargins WMGetRulerMargins(WMRuler *rPtr);
|
WMRulerMargins *WMGetRulerMargins(WMRuler *rPtr);
|
||||||
|
|
||||||
void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
|
void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
|
||||||
|
|
||||||
|
Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin,
|
||||||
|
WMRulerMargins *anotherMargin);
|
||||||
|
|
||||||
int WMGetGrabbedRulerMargin(WMRuler *rPtr);
|
int WMGetGrabbedRulerMargin(WMRuler *rPtr);
|
||||||
|
|
||||||
int WMGetReleasedRulerMargin(WMRuler *rPtr);
|
int WMGetReleasedRulerMargin(WMRuler *rPtr);
|
||||||
@@ -1464,35 +1472,36 @@ WMBag * WMGetTextStreamIntoBag(WMText *tPtr);
|
|||||||
/* destroy the bag */
|
/* destroy the bag */
|
||||||
WMBag * WMGetTextSelectedIntoBag(WMText *tPtr);
|
WMBag * WMGetTextSelectedIntoBag(WMText *tPtr);
|
||||||
|
|
||||||
void *WMCreateTextBlockWithObject(WMWidget *w, char *description,
|
|
||||||
WMColor *color, unsigned short first, unsigned short reserved);
|
|
||||||
|
|
||||||
void *WMCreateTextBlockWithPixmap(WMPixmap *p, char *description,
|
|
||||||
WMColor *color, unsigned short first, unsigned short reserved);
|
|
||||||
|
|
||||||
void *WMCreateTextBlockWithText(char *text, WMFont *font,
|
|
||||||
WMColor *color, unsigned short first, unsigned short length);
|
|
||||||
|
|
||||||
void WMSetTextBlockProperties(void *vtb, unsigned int first,
|
|
||||||
unsigned int kanji, unsigned int underlined, int script,
|
|
||||||
WMRulerMargins margins);
|
|
||||||
|
|
||||||
void WMGetTextBlockProperties(void *vtb, unsigned int *first,
|
|
||||||
unsigned int *kanji, unsigned int *underlined, int *script,
|
|
||||||
WMRulerMargins *margins);
|
|
||||||
|
|
||||||
void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
|
void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
|
||||||
|
|
||||||
void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
|
void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
|
||||||
|
|
||||||
void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
|
void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
|
||||||
|
|
||||||
/* parser related stuff... see how it can be done in testtext.c */
|
/* parser related stuff... use only if implementing a new parser */
|
||||||
|
|
||||||
void WMSetTextParser(WMText *tPtr, WMAction *parser);
|
void WMSetTextParser(WMText *tPtr, WMAction *parser);
|
||||||
|
|
||||||
void WMSetTextWriter(WMText *tPtr, WMAction *writer);
|
void WMSetTextWriter(WMText *tPtr, WMAction *writer);
|
||||||
|
|
||||||
|
void *WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
|
||||||
|
WMColor *color, unsigned short first, unsigned short reserved);
|
||||||
|
|
||||||
|
void *WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
|
||||||
|
WMColor *color, unsigned short first, unsigned short reserved);
|
||||||
|
|
||||||
|
void *WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
|
||||||
|
WMColor *color, unsigned short first, unsigned short length);
|
||||||
|
|
||||||
|
void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
|
||||||
|
unsigned int kanji, unsigned int underlined, int script,
|
||||||
|
WMRulerMargins *margins);
|
||||||
|
|
||||||
|
/* do NOT free the margins */
|
||||||
|
void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
|
||||||
|
unsigned int *kanji, unsigned int *underlined, int *script,
|
||||||
|
WMRulerMargins *margins);
|
||||||
|
|
||||||
int WMGetTextInsertType(WMText *tPtr);
|
int WMGetTextInsertType(WMText *tPtr);
|
||||||
|
|
||||||
int WMGetTextBlocks(WMText *tPtr);
|
int WMGetTextBlocks(WMText *tPtr);
|
||||||
|
|||||||
@@ -487,28 +487,47 @@ void WMSetRulerMargins(WMRuler * rPtr, WMRulerMargins margins)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WMRulerMargins *
|
||||||
WMRulerMargins
|
|
||||||
WMGetRulerMargins(WMRuler * rPtr)
|
WMGetRulerMargins(WMRuler * rPtr)
|
||||||
{
|
{
|
||||||
WMRulerMargins margins;
|
WMRulerMargins *margins = wmalloc(sizeof(WMRulerMargins));
|
||||||
|
|
||||||
if (!rPtr) {
|
if (!rPtr) {
|
||||||
margins.first = margins.body = margins.left = 0;
|
margins->first = margins->body = margins->left = 0;
|
||||||
margins.right = 100;
|
margins->right = 100;
|
||||||
return margins;
|
return margins;
|
||||||
}
|
}
|
||||||
|
|
||||||
margins.left = rPtr->margins.left - rPtr->offset;
|
margins->left = rPtr->margins.left - rPtr->offset;
|
||||||
margins.right = rPtr->margins.right - rPtr->offset;
|
margins->right = rPtr->margins.right - rPtr->offset;
|
||||||
margins.first = rPtr->margins.first - rPtr->offset;
|
margins->first = rPtr->margins.first - rPtr->offset;
|
||||||
margins.body = rPtr->margins.body - rPtr->offset;
|
margins->body = rPtr->margins.body - rPtr->offset;
|
||||||
/*for */
|
/*for */
|
||||||
margins.tabs = rPtr->margins.tabs;
|
margins->tabs = rPtr->margins.tabs;
|
||||||
|
|
||||||
return rPtr->margins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin)
|
||||||
|
{
|
||||||
|
if(aMargin == anotherMargin)
|
||||||
|
return True;
|
||||||
|
else if(!aMargin || !anotherMargin)
|
||||||
|
return False;
|
||||||
|
if(aMargin->left != anotherMargin->left)
|
||||||
|
return False;
|
||||||
|
if(aMargin->first != anotherMargin->first)
|
||||||
|
return False;
|
||||||
|
if(aMargin->body != anotherMargin->body)
|
||||||
|
return False;
|
||||||
|
if(aMargin->right != anotherMargin->right)
|
||||||
|
return False;
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void WMSetRulerOffset(WMRuler * rPtr, int pixels)
|
void WMSetRulerOffset(WMRuler * rPtr, int pixels)
|
||||||
{
|
{
|
||||||
|
|||||||
847
WINGs/wtext.c
847
WINGs/wtext.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user