1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-30 18:32:34 +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

@@ -804,8 +804,14 @@ WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue,
Bool exact);
WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue,
unsigned short alpha, Bool exact);
WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
void WMSetColorAlpha(WMColor *color, unsigned short alpha);
unsigned short WMRedComponentOfColor(WMColor *color);
unsigned short WMGreenComponentOfColor(WMColor *color);
@@ -817,11 +823,12 @@ char* WMGetColorRGBDescription(WMColor *color);
/* ....................................................................... */
void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
int y, char *text, int length);
void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
int x, int y, char *text, int length);
void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
int y, char *text, int length);
void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
WMColor *background, WMFont *font, int x, int y,
char *text, int length);
int WMWidthOfString(WMFont *font, char *text, int length);

View File

@@ -75,6 +75,7 @@ typedef struct W_Color {
struct W_Screen *screen;
XColor color;
unsigned short alpha;
short refCount;
GC gc;
struct {
@@ -183,7 +184,9 @@ typedef struct W_Screen {
GC ixorGC; /* IncludeInferiors XOR */
GC textFieldGC;
GC drawStringGC; /* for WMDrawString() */
GC drawImStringGC; /* for WMDrawImageString() */
W_Font *normalFont;
@@ -488,13 +491,13 @@ void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
void W_CallDestroyHandlers(W_View *view);
void W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
WMReliefType relief, char *text,
void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
W_Font *font, WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image,
WMImagePosition position, GC backGC, int ofs);
WMImagePosition position, WMColor *backColor, int ofs);
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
int width, WMAlignment alignment, GC gc,
int width, WMAlignment alignment, WMColor *color,
int wrap, char *text, int length);
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);