1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +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

@@ -323,9 +323,10 @@ wTextDestroy( WTextInput *wtext )
\********************************************************************/
static void
textRefresh( WTextInput *wtext )
{
{
int x1,x2,y1,y2;
char *ptr = wtext->text.txt;
WMColor *black, *white;
/* x1,y1 is the upper left corner of the text box */
x1 = wtext->xOffset;
@@ -339,9 +340,11 @@ textRefresh( WTextInput *wtext )
XFillRectangle( dpy, wtext->core->window, wtext->invGC,
x1, y1, x2-x1, y2-y1 );
black = WMBlackColor(wtext->core->screen_ptr->wmscreen);
white = WMWhiteColor(wtext->core->screen_ptr->wmscreen);
/* Draw the text normally */
WMDrawString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
wtext->regGC, wtext->font, x1, y1, ptr, wtext->text.length);
WMDrawImageString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
black, white, wtext->font, x1, y1, ptr, wtext->text.length);
/* Draw the selected text */
if( wtext->text.startPos != wtext->text.endPos )
@@ -372,10 +375,13 @@ textRefresh( WTextInput *wtext )
/* Draw the selected text... use invGC so it will be the
* opposite color as the filled rectangle */
WMDrawString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
wtext->invGC, wtext->font, x1, y1, ptr, (ep - sp));
WMDrawImageString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
white, black, wtext->font, x1, y1, ptr, (ep - sp));
}
WMReleaseColor(white);
WMReleaseColor(black);
/* And draw a quick little line for the cursor position */
x1 = WMWidthOfString( wtext->font, wtext->text.txt, wtext->text.endPos )
+ wtext->xOffset;