mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-19 06:43:31 +02:00
Gaaah!
This thing is completely broken! There are functions that take a completely different set of arguments than the ones currently used to call them. There are even functions that are not defined anywhere but called from wtext.c Please fix it before re-enabling it in Makefile.am
This commit is contained in:
@@ -13,7 +13,7 @@ include_HEADERS = WINGs.h WUtil.h WINGsP.h
|
||||
bin_SCRIPTS = get-wings-flags get-wutil-flags
|
||||
|
||||
noinst_PROGRAMS = wtest wmquery wmfile fontl testmywidget testcolorpanel\
|
||||
connect puzzle testtext
|
||||
connect puzzle #testtext
|
||||
|
||||
lib_LIBRARIES = libWINGs.a libWUtil.a
|
||||
|
||||
@@ -65,13 +65,11 @@ libWINGs_a_SOURCES = \
|
||||
wpixmap.c \
|
||||
wpopupbutton.c \
|
||||
wprogressindicator.c \
|
||||
wruler.c \
|
||||
wscroller.c \
|
||||
wscrollview.c \
|
||||
wslider.c \
|
||||
wsplitview.c \
|
||||
wtabview.c \
|
||||
wtext.c \
|
||||
wtextfield.c \
|
||||
wwindow.c \
|
||||
wview.c \
|
||||
|
||||
@@ -14,7 +14,8 @@ wAbort()
|
||||
}
|
||||
|
||||
|
||||
void Close(WMWidget *self, void *client)
|
||||
void
|
||||
Close(WMWidget *self, void *client)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
@@ -24,7 +25,7 @@ void Close(WMWidget *self, void *client)
|
||||
/* =============== a rudimentary HTML parser ======================= */
|
||||
|
||||
/* due to the WMSetTextParser stuff, it should not
|
||||
be too hard to add parsers. like dis :-] */
|
||||
be too hard to add parsers. like dis :-] */
|
||||
|
||||
|
||||
/*
|
||||
@@ -34,24 +35,24 @@ be too hard to add parsers. like dis :-] */
|
||||
*/
|
||||
unsigned char map_table[256] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
|
||||
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
|
||||
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
|
||||
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
|
||||
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92,
|
||||
93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
|
||||
108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
|
||||
122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
|
||||
136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
|
||||
150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
|
||||
164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
|
||||
178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
|
||||
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
|
||||
206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
|
||||
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
|
||||
234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
|
||||
248, 249, 250, 251, 252, 253, 254, 255};
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
|
||||
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
|
||||
49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
|
||||
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
|
||||
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92,
|
||||
93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
|
||||
108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
|
||||
122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
|
||||
136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
|
||||
150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
|
||||
164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
|
||||
178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
|
||||
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
|
||||
206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
|
||||
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
|
||||
234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
|
||||
248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
#define TOLOWER(x) (map_table[(int)x])
|
||||
static int
|
||||
@@ -111,7 +112,8 @@ getArg(char *t, short type, void *arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
void parseToken(WMText *tPtr, char *token, short tk)
|
||||
void
|
||||
parseToken(WMText *tPtr, char *token, short tk)
|
||||
{
|
||||
short mode=0; /* 0 starts, 1 closes */
|
||||
WMScreen *scr = (W_VIEW(tPtr))->screen;
|
||||
@@ -215,7 +217,7 @@ void parseToken(WMText *tPtr, char *token, short tk)
|
||||
#endif
|
||||
}
|
||||
else if(mystrcasecmp(token, "center")) {
|
||||
printf("center\n");
|
||||
printf("center\n");
|
||||
if(mode) cfmt.align = WALeft;
|
||||
else cfmt.align = WACenter;
|
||||
cfmt.para = (cfmt.actions.createParagraph) (cfmt.fmargin, cfmt.bmargin,
|
||||
@@ -231,7 +233,7 @@ printf("center\n");
|
||||
#if 0
|
||||
i=0;
|
||||
//while(*token && !isspace(*(token))) token++;
|
||||
//printf("A:%d a:%d z%d Z%d\n", '1', 'a', 'Z', 'z');
|
||||
//printf("A:%d a:%d z%d Z%d\n", '1', 'a', 'Z', 'z');
|
||||
do {
|
||||
if(!mm) {
|
||||
if(c>=65 && c<=122) { major[i++] = c;
|
||||
@@ -249,7 +251,8 @@ printf("center\n");
|
||||
//printf("parse token (%s)[%s]\n", mode?"close":"open", token);
|
||||
}
|
||||
|
||||
void HTMLParser(WMWidget *w, void *clientData, short type)
|
||||
void
|
||||
HTMLParser(WMWidget *w, void *clientData, short type)
|
||||
{
|
||||
static short init=1; /* have we been here at least once before? */
|
||||
char *stream = (char *) clientData;
|
||||
@@ -257,9 +260,9 @@ void HTMLParser(WMWidget *w, void *clientData, short type)
|
||||
WMScreen *scr;
|
||||
void *chunk;
|
||||
char c;
|
||||
#define MAX_TOKEN_SIZE 255
|
||||
#define MAX_TOKEN_SIZE 255
|
||||
char token[MAX_TOKEN_SIZE+1];
|
||||
#define MAX_TEXT_SIZE 1023
|
||||
#define MAX_TEXT_SIZE 1023
|
||||
char text[MAX_TEXT_SIZE+1];
|
||||
short mode=0;
|
||||
short tk=0, txt=0;
|
||||
@@ -299,11 +302,11 @@ void HTMLParser(WMWidget *w, void *clientData, short type)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
/*
|
||||
*/
|
||||
|
||||
while( (c=*(stream++))) {
|
||||
//printf("%c", c);
|
||||
//printf("%c", c);
|
||||
if(c == '\n' || c =='\t')
|
||||
//c = ' '; //continue;
|
||||
continue;
|
||||
@@ -320,7 +323,7 @@ void HTMLParser(WMWidget *w, void *clientData, short type)
|
||||
chunk = (cfmt.actions.createTChunk)(text, txt, cfmt.cfont,
|
||||
cfmt.ccolor, 0, (cfmt.u?1:0));
|
||||
(cfmt.actions.insertChunk) (tPtr, chunk, cfmt.type);
|
||||
//printf("%s\n", text);
|
||||
//printf("%s\n", text);
|
||||
}
|
||||
txt = 0;
|
||||
} else if(c == '>' && mode) {
|
||||
@@ -356,7 +359,8 @@ void HTMLParser(WMWidget *w, void *clientData, short type)
|
||||
WMWidget *win;
|
||||
WMText *text;
|
||||
|
||||
void NotificationObserver(void *self, WMNotification *notif)
|
||||
void
|
||||
NotificationObserver(void *self, WMNotification *notif)
|
||||
{
|
||||
void *object = WMGetNotificationObject(notif);
|
||||
unsigned short w = WMWidgetWidth(win);
|
||||
@@ -368,15 +372,15 @@ void NotificationObserver(void *self, WMNotification *notif)
|
||||
}
|
||||
}
|
||||
|
||||
{static int i=0;
|
||||
switch(i++) {
|
||||
case 0: WMSetTextHasHorizontalScroller(text, False); break;
|
||||
case 1: WMSetTextHasVerticalScroller(text, False); break;
|
||||
case 2: WMSetTextHasVerticalScroller(text, True); break;
|
||||
case 3: WMSetTextHasHorizontalScroller(text, True); break;
|
||||
default: i=0;
|
||||
}
|
||||
}
|
||||
{static int i=0;
|
||||
switch(i++) {
|
||||
case 0: WMSetTextHasHorizontalScroller(text, False); break;
|
||||
case 1: WMSetTextHasVerticalScroller(text, False); break;
|
||||
case 2: WMSetTextHasVerticalScroller(text, True); break;
|
||||
case 3: WMSetTextHasHorizontalScroller(text, True); break;
|
||||
default: i=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
@@ -421,17 +425,17 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
//WMPrependTextStream(text, "this is prepended\n");
|
||||
//WMAppendTextStream(text, "blueplanet.rtf");
|
||||
//WMPrependTextStream(text, "this is prepended\n");
|
||||
//WMAppendTextStream(text, "blueplanet.rtf");
|
||||
|
||||
|
||||
WMThawText(text);
|
||||
WMRefreshText(text, 0, 0);
|
||||
|
||||
/*
|
||||
/*
|
||||
WMAddNotificationObserver(NotificationObserver, win,
|
||||
WMViewSizeDidChangeNotification, WMWidgetView(win));
|
||||
*/
|
||||
*/
|
||||
WMSetViewNotifySizeChanges(WMWidgetView(win), True);
|
||||
WMMapSubwidgets(win);
|
||||
WMMapWidget(win);
|
||||
|
||||
105
WINGs/wruler.c
105
WINGs/wruler.c
@@ -40,7 +40,9 @@ typedef struct W_Ruler {
|
||||
| \
|
||||
|__\
|
||||
|
|
||||
| */
|
||||
|
|
||||
|
||||
*/
|
||||
static void
|
||||
drawLeftMarker(Ruler *rPtr)
|
||||
{
|
||||
@@ -62,14 +64,16 @@ drawLeftMarker(Ruler *rPtr)
|
||||
rPtr->fg, points, 4, Convex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
|
||||
/* Marker for right margin
|
||||
|
||||
/|
|
||||
/ |
|
||||
/__|
|
||||
|
|
||||
| */
|
||||
|
|
||||
|
||||
*/
|
||||
static void
|
||||
drawRightMarker(Ruler *rPtr)
|
||||
{
|
||||
@@ -95,7 +99,9 @@ drawRightMarker(Ruler *rPtr)
|
||||
/* Marker for first line only
|
||||
_____
|
||||
|___|
|
||||
| */
|
||||
|
|
||||
|
||||
*/
|
||||
static void
|
||||
drawFirstMarker(Ruler *rPtr)
|
||||
{
|
||||
@@ -110,7 +116,8 @@ drawFirstMarker(Ruler *rPtr)
|
||||
/* Marker for rest of body
|
||||
_____
|
||||
\ /
|
||||
\./ */
|
||||
\./
|
||||
*/
|
||||
static void
|
||||
drawBodyMarker(Ruler *rPtr)
|
||||
{
|
||||
@@ -127,6 +134,7 @@ drawBodyMarker(Ruler *rPtr)
|
||||
rPtr->fg, points, 3, Convex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
createDrawBuffer(Ruler *rPtr)
|
||||
{
|
||||
@@ -139,6 +147,7 @@ createDrawBuffer(Ruler *rPtr)
|
||||
rPtr->bg, 0, 0, rPtr->view->size.width, 40);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
drawRulerOnPixmap(Ruler *rPtr)
|
||||
{
|
||||
@@ -146,20 +155,19 @@ drawRulerOnPixmap(Ruler *rPtr)
|
||||
char c[3];
|
||||
int marks[9] = {11, 3, 5, 3, 7, 3, 5, 3};
|
||||
|
||||
if(!rPtr->drawBuffer)
|
||||
if(!rPtr->drawBuffer)
|
||||
createDrawBuffer(rPtr);
|
||||
|
||||
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->bg, 0, 0, rPtr->view->size.width, 40);
|
||||
|
||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
|
||||
rPtr->font, rPtr->margins.left+2, 26, "0 inches", 10);
|
||||
|
||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer,
|
||||
rPtr->fg, rPtr->font, rPtr->margins.left+2, 26, "0 inches", 10);
|
||||
|
||||
/* marker ticks */
|
||||
i=j=m=0;
|
||||
w = rPtr->view->size.width - rPtr->margins.left;
|
||||
while(m < w) {
|
||||
/* marker ticks */
|
||||
i=j=m=0;
|
||||
w = rPtr->view->size.width - rPtr->margins.left;
|
||||
while(m < w) {
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, rPtr->margins.left+m, 23,
|
||||
rPtr->margins.left+m, marks[i%8]+23);
|
||||
@@ -168,30 +176,31 @@ while(m < w) {
|
||||
snprintf(c,3,"%d",++j);
|
||||
else
|
||||
snprintf(c,3,"%2d",++j);
|
||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer,
|
||||
rPtr->fg, rPtr->font, rPtr->margins.left+2+m, 26, c, 2);
|
||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
|
||||
rPtr->font, rPtr->margins.left+2+m, 26, c, 2);
|
||||
}
|
||||
m = (++i)*10;
|
||||
}
|
||||
}
|
||||
|
||||
rPtr->end = rPtr->margins.left+m-10;
|
||||
if(rPtr->margins.right > rPtr->end)
|
||||
rPtr->end = rPtr->margins.left+m-10;
|
||||
if(rPtr->margins.right > rPtr->end)
|
||||
rPtr->margins.right = rPtr->end;
|
||||
/* base line */
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, rPtr->margins.left, 22, rPtr->margins.left+m-10, 22);
|
||||
/* base line */
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fg,
|
||||
rPtr->margins.left, 22, rPtr->margins.left+m-10, 22);
|
||||
|
||||
drawLeftMarker(rPtr);
|
||||
drawRightMarker(rPtr);
|
||||
drawFirstMarker(rPtr);
|
||||
drawBodyMarker(rPtr);
|
||||
drawLeftMarker(rPtr);
|
||||
drawRightMarker(rPtr);
|
||||
drawFirstMarker(rPtr);
|
||||
drawBodyMarker(rPtr);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
paintRuler(Ruler *rPtr)
|
||||
{
|
||||
WMScreen *screen = rPtr->view->screen;
|
||||
if(1||!rPtr->drawBuffer) { //first exposure
|
||||
if(1||!rPtr->drawBuffer) {
|
||||
drawRulerOnPixmap(rPtr);
|
||||
}
|
||||
|
||||
@@ -200,6 +209,7 @@ paintRuler(Ruler *rPtr)
|
||||
0, 0);
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
verifyMarkerMove(Ruler *rPtr, int x)
|
||||
{
|
||||
@@ -208,40 +218,37 @@ verifyMarkerMove(Ruler *rPtr, int x)
|
||||
|
||||
switch(rPtr->flags.whichMarker) {
|
||||
case 1:
|
||||
if( x > rPtr->margins.right - 10
|
||||
|| rPtr->margins.body + x > rPtr->margins.right-MIN_DOC_WIDTH
|
||||
|| rPtr->margins.first + x > rPtr->margins.right-MIN_DOC_WIDTH
|
||||
|| x < rPtr->offset)
|
||||
if(x > rPtr->margins.right - 10 || x < rPtr->offset ||
|
||||
rPtr->margins.body + x > rPtr->margins.right-MIN_DOC_WIDTH ||
|
||||
rPtr->margins.first + x > rPtr->margins.right-MIN_DOC_WIDTH)
|
||||
return False;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if( x < rPtr->margins.first+MIN_DOC_WIDTH
|
||||
|| x < rPtr->margins.body+MIN_DOC_WIDTH
|
||||
|| x < rPtr->margins.left+MIN_DOC_WIDTH
|
||||
|| x > rPtr->end) //rPtr->view->size.width)
|
||||
if(x < rPtr->margins.first+MIN_DOC_WIDTH ||
|
||||
x < rPtr->margins.body+MIN_DOC_WIDTH ||
|
||||
x < rPtr->margins.left+MIN_DOC_WIDTH ||
|
||||
x > rPtr->end) /*rPtr->view->size.width)*/
|
||||
return False;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if( x >= rPtr->margins.right-MIN_DOC_WIDTH
|
||||
|| x < rPtr->margins.left)
|
||||
if(x >= rPtr->margins.right-MIN_DOC_WIDTH || x < rPtr->margins.left)
|
||||
return False;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if( x >= rPtr->margins.right-MIN_DOC_WIDTH
|
||||
|| x < rPtr->margins.left)
|
||||
if(x >= rPtr->margins.right-MIN_DOC_WIDTH || x < rPtr->margins.left)
|
||||
return False;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if( x >= rPtr->margins.right-MIN_DOC_WIDTH
|
||||
|| x < rPtr->margins.left)
|
||||
if(x >= rPtr->margins.right-MIN_DOC_WIDTH || x < rPtr->margins.left)
|
||||
return False;
|
||||
break;
|
||||
|
||||
default: return False;
|
||||
default:
|
||||
return False;
|
||||
}
|
||||
|
||||
rPtr->motion = x;
|
||||
@@ -439,15 +446,17 @@ WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins)
|
||||
rPtr->margins.right = margins.right + rPtr->offset;
|
||||
rPtr->margins.first = margins.first + rPtr->offset;
|
||||
rPtr->margins.body = margins.body + rPtr->offset;
|
||||
rPtr->margins.tabs = margins.tabs; //for loop
|
||||
rPtr->margins.tabs = margins.tabs; /*for loop*/
|
||||
paintRuler(rPtr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
WMRulerMargins
|
||||
WMGetRulerMargins(WMRuler *rPtr)
|
||||
{
|
||||
WMRulerMargins margins;
|
||||
|
||||
if(!rPtr)
|
||||
return margins;
|
||||
|
||||
@@ -455,21 +464,23 @@ WMGetRulerMargins(WMRuler *rPtr)
|
||||
margins.right = rPtr->margins.right - rPtr->offset;
|
||||
margins.first = rPtr->margins.first - rPtr->offset;
|
||||
margins.body = rPtr->margins.body - rPtr->offset;
|
||||
//for
|
||||
/*for*/
|
||||
margins.tabs = rPtr->margins.tabs;
|
||||
|
||||
return rPtr->margins;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetRulerOffset(WMRuler *rPtr, int pixels)
|
||||
{
|
||||
if(!rPtr || pixels<0 || pixels+MIN_DOC_WIDTH>=rPtr->view->size.width)
|
||||
return;
|
||||
rPtr->offset = pixels;
|
||||
//rulerDidResize(rPtr, rPtr->view);
|
||||
/*rulerDidResize(rPtr, rPtr->view);*/
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
WMGetRulerOffset(WMRuler *rPtr)
|
||||
{
|
||||
@@ -478,6 +489,7 @@ WMGetRulerOffset(WMRuler *rPtr)
|
||||
return rPtr->offset;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData)
|
||||
{
|
||||
@@ -488,6 +500,7 @@ WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData)
|
||||
rPtr->clientData = clientData;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData)
|
||||
{
|
||||
@@ -498,6 +511,7 @@ WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData)
|
||||
rPtr->clientData = clientData;
|
||||
}
|
||||
|
||||
|
||||
/* _which_ one was released */
|
||||
int
|
||||
WMGetReleasedRulerMargin(WMRuler *rPtr)
|
||||
@@ -507,6 +521,7 @@ WMGetReleasedRulerMargin(WMRuler *rPtr)
|
||||
return rPtr->flags.whichMarker;
|
||||
}
|
||||
|
||||
|
||||
/* _which_ one is being grabbed */
|
||||
int
|
||||
WMGetGrabbedRulerMargin(WMRuler *rPtr)
|
||||
@@ -515,3 +530,5 @@ WMGetGrabbedRulerMargin(WMRuler *rPtr)
|
||||
return 0;
|
||||
return rPtr->flags.whichMarker;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ chunkSelectionRect(Text *tPtr, Paragraph *para, MyTextItems item,
|
||||
|
||||
|
||||
if(type == 1 && item.chunk->type == ctText) { /* partial coverage */
|
||||
lm = 2+WMGetRulerMargin(tPtr->ruler, WRulerDocLeft);
|
||||
lm = 2+WMGetRulerMargins(tPtr->ruler, WRulerDocLeft);
|
||||
/* even I am still confused, so don't ask please */
|
||||
if( (item.x+j+lm >= tPtr->sRect.pos.x &&
|
||||
item.x+j+lm <= tPtr->sRect.pos.x+tPtr->sRect.size.width)
|
||||
@@ -571,8 +571,8 @@ putParagraphOnPixmap(Text *tPtr, Paragraph *para, Bool draw)
|
||||
if(!tPtr->view->flags.realized || !para) return 0;
|
||||
|
||||
where.x = 0, where.y =0, nitems = 0;
|
||||
m.left = WMGetRulerMargin(tPtr->ruler, WRulerDocLeft);
|
||||
m.right = WMGetRulerMargin(tPtr->ruler, WRulerRight) - m.left;
|
||||
m.left = WMGetRulerMargins(tPtr->ruler, WRulerDocLeft);
|
||||
m.right = WMGetRulerMargins(tPtr->ruler, WRulerRight) - m.left;
|
||||
m.first = para->fmargin, m.body = para->bmargin;
|
||||
|
||||
if(draw) {
|
||||
@@ -669,9 +669,9 @@ calcParaExtents(Text *tPtr, Paragraph *para)
|
||||
para->bmargin = 0;
|
||||
para->rmargin = tPtr->visibleW;
|
||||
} else {
|
||||
para->width = WMGetRulerMargin(tPtr->ruler, WRulerRight) -
|
||||
WMIN(para->fmargin, para->bmargin)
|
||||
- WMGetRulerOffset(tPtr->ruler);
|
||||
para->width = WMGetRulerMargins(tPtr->ruler, WRulerRight) -
|
||||
WMIN(para->fmargin, para->bmargin) -
|
||||
WMGetRulerOffset(tPtr->ruler);
|
||||
}
|
||||
|
||||
if(!para->chunks)
|
||||
@@ -728,8 +728,8 @@ calcDocExtents(Text *tPtr)
|
||||
if(tPtr->monoFont) {
|
||||
tPtr->docWidth = tPtr->visibleW;
|
||||
} else {
|
||||
tPtr->docWidth = WMGetRulerMargin(tPtr->ruler, WRulerRight) -
|
||||
WMGetRulerMargin(tPtr->ruler, WRulerDocLeft);
|
||||
tPtr->docWidth = WMGetRulerMargins(tPtr->ruler, WRulerRight) -
|
||||
WMGetRulerMargins(tPtr->ruler, WRulerDocLeft);
|
||||
}
|
||||
tPtr->docHeight = 0;
|
||||
para = tPtr->paragraphs;
|
||||
@@ -2382,7 +2382,7 @@ WMSetTextRulerMargin(WMText *tPtr, char which, short pixels)
|
||||
{
|
||||
if(!tPtr) return;
|
||||
if(tPtr->monoFont) return;
|
||||
WMSetRulerMargin(tPtr->ruler, which, pixels);
|
||||
WMSetRulerMargins(tPtr->ruler, which, pixels);
|
||||
WMRefreshText(tPtr, tPtr->vpos, tPtr->hpos);
|
||||
}
|
||||
|
||||
@@ -2392,7 +2392,7 @@ WMGetTextRulerMargin(WMText *tPtr, char which)
|
||||
if(!tPtr) return 0;
|
||||
if(tPtr->monoFont)
|
||||
return 0;
|
||||
return WMGetRulerMargin(tPtr->ruler, which);
|
||||
return WMGetRulerMargins(tPtr->ruler, which);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user