1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 05:48:01 +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

@@ -34,6 +34,8 @@
#include <wraster.h>
#include <WINGs/WINGsP.h>
#include "WindowMaker.h"
#include "screen.h"
#include "texture.h"
@@ -170,6 +172,7 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
Pixmap pixmap;
Pixmap mask;
WMFont *font = scr->info_text_font;
WMColor *color;
int side = 0;
int ty;
int bx, by;
@@ -209,12 +212,14 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
}
pixmap = makePixmap(scr, width, height, side, &mask);
XSetForeground(dpy, scr->info_text_gc, scr->black_pixel);
color = WMBlackColor(scr->wmscreen);
WMDrawString(scr->wmscreen, pixmap, scr->info_text_gc, font, 8,
WMDrawString(scr->wmscreen, pixmap, color, font, 8,
ty + (height - WMFontHeight(font))/2,
text, strlen(text));
WMReleaseColor(color);
XSetWindowBackgroundPixmap(dpy, scr->balloon->window, pixmap);
scr->balloon->contents = pixmap;
@@ -224,7 +229,8 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
XFreePixmap(dpy, mask);
XMoveWindow(dpy, scr->balloon->window, bx, by);
XMapRaised(dpy, scr->balloon->window);
scr->balloon->mapped = 1;
}
#else /* !SHAPED_BALLOON */
@@ -235,6 +241,8 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
int height;
Pixmap pixmap;
WMFont *font = scr->info_text_font;
WMColor *color;
WMPixel pixel;
if (scr->balloon->contents)
XFreePixmap(dpy, scr->balloon->contents);
@@ -264,10 +272,13 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
pixmap = XCreatePixmap(dpy, scr->root_win, width, height, scr->w_depth);
XFillRectangle(dpy, pixmap, scr->draw_gc, 0, 0, width, height);
XSetForeground(dpy, scr->info_text_gc, scr->window_title_pixel[0]);
WMDrawString(scr->wmscreen, pixmap, scr->info_text_gc, font,
4, 2, text, strlen(text));
/* ugly hack */
color = WMBlackColor(scr->wmscreen);
pixel = color->color.pixel;
color->color.pixel = scr->window_title_pixel[0];
WMDrawString(scr->wmscreen, pixmap, color, font, 4, 2, text, strlen(text));
color->color.pixel = pixel;
WMReleaseColor(color);
XResizeWindow(dpy, scr->balloon->window, width, height);
XMoveWindow(dpy, scr->balloon->window, x, y);