1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-14 04:45:57 +01:00

- API change in WINGs for WMDraw*String().

WMDrawString() and WMDrawImageString() now take WMColor instead of GC as
  arguments. WMDrawImageString() receives 2 colors (text & background).
  This is to allow easy extension for Xft/Xrender and hide X low level details
- Added alpha channel to WMColor. 2 new functions also:
  WMCreateRGBAColor() and WMSetColorAlpha()
- Miscelaneous code cleanups in wtext.c
- Removed obsoleted acconfig.h and implemented its functionality using
  AC_DEFINE and AC_DEFINE_UNQUOTED as autoconf 2.5x recommends.
  This will definitely enforce the need to use autoconf 2.5x
This commit is contained in:
dan
2002-10-08 08:26:06 +00:00
parent e98da5a628
commit a2b404b5b3
58 changed files with 554 additions and 601 deletions

View File

@@ -816,8 +816,9 @@ paintTextField(TextField *tPtr)
int totalWidth;
char *text;
Pixmap drawbuffer;
WMColor *color;
if (!view->flags.realized || !view->flags.mapped)
return;
@@ -877,12 +878,10 @@ paintTextField(TextField *tPtr)
break;
}
if (!tPtr->flags.enabled)
WMSetColorInGC(screen->darkGray, screen->textFieldGC);
color = tPtr->flags.enabled ? screen->black : screen->darkGray;
WMDrawImageString(screen, drawbuffer, screen->textFieldGC,
tPtr->font, tx, ty,
&(text[tPtr->viewPosition]),
WMDrawImageString(screen, drawbuffer, color, screen->white,
tPtr->font, tx, ty, &(text[tPtr->viewPosition]),
tPtr->textLen - tPtr->viewPosition);
if (tPtr->selection.count) {
@@ -897,27 +896,15 @@ paintTextField(TextField *tPtr)
count = tPtr->viewPosition;
}
rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count)
- WMWidthOfString(tPtr->font,text,tPtr->viewPosition);
XSetBackground(screen->display, screen->textFieldGC,
screen->gray->color.pixel);
WMDrawImageString(screen, drawbuffer, screen->textFieldGC,
tPtr->font, rx, ty, &(text[count]),
count2);
XSetBackground(screen->display, screen->textFieldGC,
screen->white->color.pixel);
WMDrawImageString(screen, drawbuffer, color, screen->gray,
tPtr->font, rx, ty, &(text[count]), count2);
}
if (!tPtr->flags.enabled)
WMSetColorInGC(screen->black, screen->textFieldGC);
} else {
XFillRectangle(screen->display, drawbuffer,
WMColorGC(screen->white),
bd,bd, totalWidth,view->size.height-2*bd);
XFillRectangle(screen->display, drawbuffer, WMColorGC(screen->white),
bd, bd, totalWidth,view->size.height-2*bd);
}
/* draw relief */