1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-25 18:11:26 +02: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
+7 -2
View File
@@ -9,8 +9,13 @@ Changes since version 0.80.1:
- Patch to add binary mode on opening files (needed for Windows with Cygwin) - Patch to add binary mode on opening files (needed for Windows with Cygwin)
(sent by luke <luke@posh.optushome.com.au>) (sent by luke <luke@posh.optushome.com.au>)
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>) - Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
- removed Hermes lib dependency in wrlib - Removed Hermes lib dependency in wrlib
- put back asm/MMX code in wrlib - Put back asm/MMX code in wrlib
- Updated Russian locale files ("Andrew W. Nosenko" <awn@bcs.zp.ua>)
- API change in WINGs for WMDraw*String(). Details in WINGs/Changelog
- 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
Changes since version 0.80.0: Changes since version 0.80.0:
+1 -6
View File
@@ -74,7 +74,7 @@ The following is required to build Window Maker:
These tools are NOT needed, but IF you have one or These tools are NOT needed, but IF you have one or
more of them installed, make sure you have ALL of the following more of them installed, make sure you have ALL of the following
with exactly these versions: with exactly these versions:
autoconf 2.52 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.4.2 libtool 1.4.2
If you have a different version, disable them by temporarily If you have a different version, disable them by temporarily
@@ -115,11 +115,6 @@ might work too.
For GIF image support For GIF image support
ftp://prtr-13.ucsc.edu/pub/libungif/ ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 or newer
For faster pixel conversion in the wraster library
(its used only in some conversions - for TrueColor visuals)
http://www.clanlib.org/hermes/
- GNU xgettext - GNU xgettext
If you want to use translated messages, you will need GNU gettext. If you want to use translated messages, you will need GNU gettext.
Other versions of gettext are not compatible and will not work. Other versions of gettext are not compatible and will not work.
+2 -7
View File
@@ -64,9 +64,9 @@ N
Tyto nástroje NEJSOU POTŘEBA, ale když máte jeden nebo dva nebo Tyto nástroje NEJSOU POTŘEBA, ale když máte jeden nebo dva nebo
všechny tři nainstalované, tak se UJISTĚTE, že máte přesně všechny tři nainstalované, tak se UJISTĚTE, že máte přesně
následující VERZE: následující VERZE:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Máte-li odlišnou verzi, tak ji dočasně přejmenujte, nebo ji rovnou Máte-li odlišnou verzi, tak ji dočasně přejmenujte, nebo ji rovnou
odinstalujte z vašeho systému. Pokud nebudete programovat, tak ji odinstalujte z vašeho systému. Pokud nebudete programovat, tak ji
stejně nebudete potřebovat, takže ji můžete bezpečně odinstalovat. stejně nebudete potřebovat, takže ji můžete bezpečně odinstalovat.
@@ -106,11 +106,6 @@ garantuje,
Pro podporu GIF obrázků Pro podporu GIF obrázků
Dostupné na ftp://prtr-13.ucsc.edu/pub/libungif/ Dostupné na ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 nebo novější
Pro rychlejší konverzi obrázků (používá knihovna wraster)
Používá se pouze v některých konverzích - pro TrueColor zobrazení
http://www.clanlib.org/hermes/
-GNU xgettxt -GNU xgettxt
Když chcete používat češtinu nebo jiné jazyky kromě angličtiny, Když chcete používat češtinu nebo jiné jazyky kromě angličtiny,
tak potřebujete GNU xgettext. tak potřebujete GNU xgettext.
+2 -7
View File
@@ -78,9 +78,9 @@ Lo siguiente se necesita para compilar Window Maker:
instaladas, asegúrese de tener TODO lo siguiente con estas versiones instaladas, asegúrese de tener TODO lo siguiente con estas versiones
exactas: exactas:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Si tiene una versión distinta, desactívelas temporalemte renombrándolas Si tiene una versión distinta, desactívelas temporalemte renombrándolas
a otras cosa o desinstalándolas desde su sistema. Si no desarrolla a otras cosa o desinstalándolas desde su sistema. Si no desarrolla
@@ -122,11 +122,6 @@ Estas bibliotecas no son necesarias para hacer que Window Maker funcione,
Para soporte de imagen GIF. Para soporte de imagen GIF.
ftp://prtr-13.ucsc.edu/pub/libungif/ ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 o más actual
Para conversión a pixel más rápida en la biblioteca wraster.
(se usa solo en algunas conversiones - para visuales Color Verdadero)
http://www.clanlib.org/hermes/
- GNU xgettext - GNU xgettext
Si quiere usar mensajes traducidos, necesitará GNU gettext. Si quiere usar mensajes traducidos, necesitará GNU gettext.
Otras versiones de gettext no son compatibles y no funcionarán. Otras versiones de gettext no son compatibles y no funcionarán.
+2 -8
View File
@@ -77,9 +77,9 @@ Les
Ces outils ne sont pas indispensables, mais si au moins l'un d'eux Ces outils ne sont pas indispensables, mais si au moins l'un d'eux
est installé sur votre système, assurez-vous que TOUS le sont, et est installé sur votre système, assurez-vous que TOUS le sont, et
que les versions de ces outils sont exactement : que les versions de ces outils sont exactement :
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Si les versions installées sur votre système différent, désactivez-les Si les versions installées sur votre système différent, désactivez-les
provisoirement, par exemple en les renommant, ou en les désinstallant provisoirement, par exemple en les renommant, ou en les désinstallant
de votre système. Si vous ne développez ni de compilez de logiciels, de votre système. Si vous ne développez ni de compilez de logiciels,
@@ -120,12 +120,6 @@ fonctionner aussi bien.
Pour pouvoir utiliser les images au format GIF. Pour pouvoir utiliser les images au format GIF.
ftp://prtr-13.ucsc.edu/pub/libungif/ ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 ou plus récent
Pour une conversion de pixels plus rapide dans la librairie wraster.
(utilisé uniquement pour des conversions spécifiques dont les modes
vidéo TrueColor)
http://www.clanlib.org/hermes/
- GNU xgettext - GNU xgettext
Si vous voulez disposer des traductions en d'autres langues, GNU gettext Si vous voulez disposer des traductions en d'autres langues, GNU gettext
est nécessaire. Les autres versions de gettext sont incompatibles et ne est nécessaire. Les autres versions de gettext sont incompatibles et ne
+2 -2
View File
@@ -68,9 +68,9 @@ Para compilar o Window Maker voc
- autoconf, automake and libtool - autoconf, automake and libtool
Estes pacotes não são necessários, mas se você tiver um ou mais deles instalados, Estes pacotes não são necessários, mas se você tiver um ou mais deles instalados,
verifique se todos eles são das seguintes versões: verifique se todos eles são das seguintes versões:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Se você possui uma versão diferente, desative-os mudando os nomes dos arquivos Se você possui uma versão diferente, desative-os mudando os nomes dos arquivos
para outra coisa ou removendo-os do seu sistema. Se você não desenvolve para outra coisa ou removendo-os do seu sistema. Se você não desenvolve
software você não precisa deles, logo, você pode desinstalá-los com segurança. software você não precisa deles, logo, você pode desinstalá-los com segurança.
+2 -2
View File
@@ -71,9 +71,9 @@ Nasledovn
- autoconf, automake a libtool - autoconf, automake a libtool
Tieto nástroje NIE sú potrebné, ale ak máte niektoré z nich nain¹talo- Tieto nástroje NIE sú potrebné, ale ak máte niektoré z nich nain¹talo-
vané, uistite sa, ¾e V©ETKY sú presne nasledovné verzie: vané, uistite sa, ¾e V©ETKY sú presne nasledovné verzie:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Ak máte odli¹né verzie, odin¹talujte ich alebo ich doèasne premenujte. Ak máte odli¹né verzie, odin¹talujte ich alebo ich doèasne premenujte.
Ak neprogramujete, nebudete ich potrebova» a teda ich mô¾ete Ak neprogramujete, nebudete ich potrebova» a teda ich mô¾ete
odin¹talova». odin¹talova».
+1 -2
View File
@@ -4,8 +4,7 @@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\
contrib contrib
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \ EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \
Install acconfig.h INSTALL.pt README.pt\ Install INSTALL.pt README.pt FAQ.I18N.cs INSTALL.cs\
FAQ.I18N.cs INSTALL.cs\
mkpatch README.KDE README.GNOME WindowMaker.lsm.in\ mkpatch README.KDE README.GNOME WindowMaker.lsm.in\
README.definable-cursor \ README.definable-cursor \
FAQ.I18N.sk INSTALL.sk INSTALL.es INSTALL.fr FAQ.I18N.sk INSTALL.sk INSTALL.es INSTALL.fr
+7
View File
@@ -4,6 +4,13 @@ Changes since wmaker 0.80.1:
- added WMSetConnectionShutdownOnClose() - added WMSetConnectionShutdownOnClose()
- added an extra member to the ConnectionDelegate: canResumeSending - added an extra member to the ConnectionDelegate: canResumeSending
see NEWS for details. see NEWS for details.
- 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
Changes since wmaker 0.80.0: Changes since wmaker 0.80.0:
............................ ............................
+26 -25
View File
@@ -11,7 +11,7 @@ typedef struct {
WMFont *font; WMFont *font;
GC gc; GC gc;
GC selGC; GC selGC;
GC textGC; WMColor *textColor;
} StringData; } StringData;
@@ -28,7 +28,7 @@ typedef struct {
WMFont *font; WMFont *font;
GC gc; GC gc;
GC selGC; GC selGC;
GC textGC; WMColor *textColor;
} StringEditorData; } StringEditorData;
@@ -40,7 +40,7 @@ typedef struct {
int count; int count;
GC gc; GC gc;
GC selGC; GC selGC;
GC textGC; WMColor *textColor;
} EnumSelectorData; } EnumSelectorData;
@@ -57,8 +57,8 @@ static char *SelectionColor = "#bbbbcc";
static void stringDraw(WMScreen *scr, Drawable d, GC gc, static void stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc,
GC sgc, GC stgc, WMFont *font, void *data, WMColor *textColor, WMFont *font, void *data,
WMRect rect, Bool selected) WMRect rect, Bool selected)
{ {
int x, y; int x, y;
@@ -77,12 +77,12 @@ static void stringDraw(WMScreen *scr, Drawable d, GC gc,
if (!selected) { if (!selected) {
XFillRectangles(dpy, d, gc, rects, 1); XFillRectangles(dpy, d, gc, rects, 1);
WMDrawString(scr, d, stgc, font, x, y, WMDrawString(scr, d, textColor, font, x, y,
data, strlen(data)); data, strlen(data));
} else { } else {
XFillRectangles(dpy, d, sgc, rects, 1); XFillRectangles(dpy, d, sgc, rects, 1);
WMDrawString(scr, d, stgc, font, x, y, WMDrawString(scr, d, textColor, font, x, y,
data, strlen(data)); data, strlen(data));
} }
@@ -142,7 +142,7 @@ static void SECellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
False); False);
@@ -156,7 +156,7 @@ static void selectedSECellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
True); True);
@@ -203,9 +203,9 @@ WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *parent)
0, 0); 0, 0);
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data; delegate->data = data;
delegate->drawCell = SECellPainter; delegate->drawCell = SECellPainter;
@@ -229,7 +229,7 @@ static void ESCellPainter(WMTableColumnDelegate *self,
int i = (int)WMTableViewDataForCell(table, column, row); int i = (int)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
strdata->options[i], strdata->options[i],
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
False); False);
@@ -244,7 +244,7 @@ static void selectedESCellPainter(WMTableColumnDelegate *self,
int i = (int)WMTableViewDataForCell(table, column, row); int i = (int)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
strdata->options[i], strdata->options[i],
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
True); True);
@@ -294,9 +294,9 @@ WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *parent)
0, 0); 0, 0);
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
data->count = 0; data->count = 0;
data->options = NULL; data->options = NULL;
@@ -444,7 +444,7 @@ static void SCellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
False); False);
@@ -458,7 +458,7 @@ static void selectedSCellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
True); True);
@@ -473,9 +473,9 @@ WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *parent)
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data; delegate->data = data;
delegate->drawCell = SCellPainter; delegate->drawCell = SCellPainter;
@@ -525,8 +525,8 @@ WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView *table)
StringData *data = wmalloc(sizeof(StringData)); StringData *data = wmalloc(sizeof(StringData));
data->table = table; data->table = table;
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
delegate->data = data; delegate->data = data;
delegate->drawCell = PCellPainter; delegate->drawCell = PCellPainter;
@@ -574,9 +574,8 @@ static void drawPSCell(WMTableColumnDelegate *self, Drawable d,
rect.size.width = owidth-size.width+1; rect.size.width = owidth-size.width+1;
} }
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d, strdata->gc, strdata->selGC,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->textColor, strdata->font, str, rect, selected);
str, rect, selected);
} }
@@ -602,9 +601,9 @@ WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent)
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data; delegate->data = data;
delegate->drawCell = PSCellPainter; delegate->drawCell = PSCellPainter;
@@ -614,3 +613,5 @@ WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent)
return delegate; return delegate;
} }
+1 -1
View File
@@ -150,7 +150,7 @@ paintMyWidget(_MyWidget *mPtr)
color = WMWhiteColor(scr); color = WMWhiteColor(scr);
W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0, W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0,
mPtr->view->size.width, WACenter, WMColorGC(color), mPtr->view->size.width, WACenter, color,
False, mPtr->text, strlen(mPtr->text)); False, mPtr->text, strlen(mPtr->text));
WMReleaseColor(color); WMReleaseColor(color);
+11 -4
View File
@@ -804,8 +804,14 @@ WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue, unsigned short green, unsigned short blue,
Bool exact); 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); WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
void WMSetColorAlpha(WMColor *color, unsigned short alpha);
unsigned short WMRedComponentOfColor(WMColor *color); unsigned short WMRedComponentOfColor(WMColor *color);
unsigned short WMGreenComponentOfColor(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, void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
int y, char *text, int length); int x, int y, char *text, int length);
void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
int y, char *text, int length); WMColor *background, WMFont *font, int x, int y,
char *text, int length);
int WMWidthOfString(WMFont *font, char *text, int length); int WMWidthOfString(WMFont *font, char *text, int length);
+8 -5
View File
@@ -75,6 +75,7 @@ typedef struct W_Color {
struct W_Screen *screen; struct W_Screen *screen;
XColor color; XColor color;
unsigned short alpha;
short refCount; short refCount;
GC gc; GC gc;
struct { struct {
@@ -183,7 +184,9 @@ typedef struct W_Screen {
GC ixorGC; /* IncludeInferiors XOR */ GC ixorGC; /* IncludeInferiors XOR */
GC textFieldGC; GC drawStringGC; /* for WMDrawString() */
GC drawImStringGC; /* for WMDrawImageString() */
W_Font *normalFont; 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_CallDestroyHandlers(W_View *view);
void W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
WMReliefType relief, char *text, W_Font *font, WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image, 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, 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 wrap, char *text, int length);
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap); int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);
+1 -1
View File
@@ -424,7 +424,7 @@ showText(Balloon *bPtr, int x, int y, int h, int w, char *text)
W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2, W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2,
width, bPtr->flags.alignment, width, bPtr->flags.alignment,
WMColorGC(bPtr->textColor ? bPtr->textColor : scr->black), bPtr->textColor ? bPtr->textColor : scr->black,
False, text, strlen(text)); False, text, strlen(text));
XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap); XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap);
+4 -4
View File
@@ -280,13 +280,13 @@ drawTitleOfColumn(WMBrowser *bPtr, int column)
&titleLen, widthC); &titleLen, widthC);
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x, W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2, (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
bPtr->columnSize.width, WACenter, WMColorGC(scr->white), bPtr->columnSize.width, WACenter, scr->white,
False, titleBuf, titleLen); False, titleBuf, titleLen);
wfree (titleBuf); wfree (titleBuf);
} else { } else {
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x, W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2, (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
bPtr->columnSize.width, WACenter, WMColorGC(scr->white), bPtr->columnSize.width, WACenter, scr->white,
False, bPtr->titles[column], titleLen); False, bPtr->titles[column], titleLen);
} }
} }
@@ -566,11 +566,11 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
if (WMWidthOfString(font, text, textLen) > widthC) { if (WMWidthOfString(font, text, textLen) > widthC) {
char *textBuf = createTruncatedString(font, text, &textLen, widthC); char *textBuf = createTruncatedString(font, text, &textLen, widthC);
W_PaintText(view, d, font, x+4, y, widthC, W_PaintText(view, d, font, x+4, y, widthC,
WALeft, WMColorGC(scr->black), False, textBuf, textLen); WALeft, scr->black, False, textBuf, textLen);
wfree(textBuf); wfree(textBuf);
} else { } else {
W_PaintText(view, d, font, x+4, y, widthC, W_PaintText(view, d, font, x+4, y, widthC,
WALeft, WMColorGC(scr->black), False, text, textLen); WALeft, scr->black, False, text, textLen);
} }
} }
+6 -6
View File
@@ -612,9 +612,9 @@ paintButton(Button *bPtr)
char *caption; char *caption;
WMPixmap *image; WMPixmap *image;
WMColor *textColor; WMColor *textColor;
GC gc; WMColor *backColor;
gc = NULL; backColor = NULL;
caption = bPtr->caption; caption = bPtr->caption;
if (bPtr->flags.enabled) { if (bPtr->flags.enabled) {
@@ -637,7 +637,7 @@ paintButton(Button *bPtr)
if (bPtr->flags.selected) { if (bPtr->flags.selected) {
if (bPtr->flags.stateLight) { if (bPtr->flags.stateLight) {
gc = WMColorGC(scrPtr->white); backColor = scrPtr->white;
textColor = scrPtr->black; textColor = scrPtr->black;
} }
@@ -662,7 +662,7 @@ paintButton(Button *bPtr)
offset = 1; offset = 1;
} }
if (bPtr->flags.pushLight) { if (bPtr->flags.pushLight) {
gc = WMColorGC(scrPtr->white); backColor = scrPtr->white;
textColor = scrPtr->black; textColor = scrPtr->black;
} }
@@ -676,10 +676,10 @@ paintButton(Button *bPtr)
} }
} }
W_PaintTextAndImage(bPtr->view, True, WMColorGC(textColor), W_PaintTextAndImage(bPtr->view, True, textColor,
(bPtr->font!=NULL ? bPtr->font : scrPtr->normalFont), (bPtr->font!=NULL ? bPtr->font : scrPtr->normalFont),
relief, caption, bPtr->flags.alignment, image, relief, caption, bPtr->flags.alignment, image,
bPtr->flags.imagePosition, gc, offset); bPtr->flags.imagePosition, backColor, offset);
} }
+41 -14
View File
@@ -16,8 +16,9 @@ static unsigned char DARK_STIPPLE_BITS[] = {
0x0a, 0x04, 0x0a, 0x01}; 0x0a, 0x04, 0x0a, 0x01};
static WMColor *createRGBColor(WMScreen *scr, unsigned short red, static WMColor *createRGBAColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue); unsigned short green, unsigned short blue,
unsigned short alpha);
/* /*
* TODO: make the color creation code return the same WMColor for the * TODO: make the color creation code return the same WMColor for the
@@ -28,7 +29,7 @@ static WMColor *createRGBColor(WMScreen *scr, unsigned short red,
static WMColor* static WMColor*
findCloseColor(WMScreen *scr, unsigned short red, unsigned short green, findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue) unsigned short blue, unsigned short alpha)
{ {
WMColor *color; WMColor *color;
XColor xcolor; XColor xcolor;
@@ -37,6 +38,7 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
rcolor.red = red>>8; rcolor.red = red>>8;
rcolor.green = green>>8; rcolor.green = green>>8;
rcolor.blue = blue>>8; rcolor.blue = blue>>8;
rcolor.alpha = alpha>>8;
if (!RGetClosestXColor(scr->rcontext, &rcolor, &xcolor)) if (!RGetClosestXColor(scr->rcontext, &rcolor, &xcolor))
return NULL; return NULL;
@@ -49,6 +51,7 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
color->screen = scr; color->screen = scr;
color->refCount = 1; color->refCount = 1;
color->color = xcolor; color->color = xcolor;
color->alpha = alpha;
color->flags.exact = 1; color->flags.exact = 1;
color->gc = NULL; color->gc = NULL;
@@ -58,8 +61,8 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
static WMColor* static WMColor*
createRGBColor(WMScreen *scr, unsigned short red, unsigned short green, createRGBAColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue) unsigned short blue, unsigned short alpha)
{ {
WMColor *color; WMColor *color;
XColor xcolor; XColor xcolor;
@@ -76,6 +79,7 @@ createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
color->screen = scr; color->screen = scr;
color->refCount = 1; color->refCount = 1;
color->color = xcolor; color->color = xcolor;
color->alpha = alpha;
color->flags.exact = 1; color->flags.exact = 1;
color->gc = NULL; color->gc = NULL;
@@ -83,15 +87,30 @@ createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
} }
WMColor* WMColor*
WMCreateRGBColor(WMScreen *scr, unsigned short red, unsigned short green, WMCreateRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue, Bool exact) unsigned short blue, Bool exact)
{ {
WMColor *color = NULL; WMColor *color = NULL;
if (!exact || !(color=createRGBColor(scr, red, green, blue))) { if (!exact || !(color=createRGBAColor(scr, red, green, blue, 0xffff))) {
color = findCloseColor(scr, red, green, blue); color = findCloseColor(scr, red, green, blue, 0xffff);
}
if (!color)
color = WMBlackColor(scr);
return color;
}
WMColor*
WMCreateRGBAColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue, unsigned short alpha, Bool exact)
{
WMColor *color = NULL;
if (!exact || !(color=createRGBAColor(scr, red, green, blue, alpha))) {
color = findCloseColor(scr, red, green, blue, alpha);
} }
if (!color) if (!color)
color = WMBlackColor(scr); color = WMBlackColor(scr);
@@ -112,9 +131,9 @@ WMCreateNamedColor(WMScreen *scr, char *name, Bool exact)
if (scr->visual->class == TrueColor) if (scr->visual->class == TrueColor)
exact = True; exact = True;
if (!exact || !(color=createRGBColor(scr, xcolor.red, xcolor.green, if (!exact || !(color=createRGBAColor(scr, xcolor.red, xcolor.green,
xcolor.blue))) { xcolor.blue, 0xffff))) {
color = findCloseColor(scr, xcolor.red, xcolor.green, xcolor.blue); color = findCloseColor(scr, xcolor.red, xcolor.green, xcolor.blue, 0xffff);
} }
return color; return color;
} }
@@ -147,6 +166,13 @@ WMReleaseColor(WMColor *color)
} }
void
WMSetColorAlpha(WMColor *color, unsigned short alpha)
{
color->alpha = alpha;
}
void void
WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y, WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
unsigned int width, unsigned int height) unsigned int width, unsigned int height)
@@ -201,7 +227,6 @@ WMWhiteColor(WMScreen *scr)
} }
WMColor* WMColor*
WMBlackColor(WMScreen *scr) WMBlackColor(WMScreen *scr)
{ {
@@ -231,7 +256,7 @@ WMGrayColor(WMScreen *scr)
LIGHT_STIPPLE_BITS, LIGHT_STIPPLE_WIDTH, LIGHT_STIPPLE_BITS, LIGHT_STIPPLE_WIDTH,
LIGHT_STIPPLE_HEIGHT); LIGHT_STIPPLE_HEIGHT);
color = createRGBColor(scr, 0xffff, 0xffff, 0xffff); color = createRGBAColor(scr, 0xffff, 0xffff, 0xffff, 0xffff);
gcv.foreground = white->color.pixel; gcv.foreground = white->color.pixel;
gcv.background = black->color.pixel; gcv.background = black->color.pixel;
@@ -272,7 +297,7 @@ WMDarkGrayColor(WMScreen *scr)
DARK_STIPPLE_BITS, DARK_STIPPLE_WIDTH, DARK_STIPPLE_BITS, DARK_STIPPLE_WIDTH,
DARK_STIPPLE_HEIGHT); DARK_STIPPLE_HEIGHT);
color = createRGBColor(scr, 0, 0, 0); color = createRGBAColor(scr, 0, 0, 0, 0xffff);
gcv.foreground = white->color.pixel; gcv.foreground = white->color.pixel;
gcv.background = black->color.pixel; gcv.background = black->color.pixel;
@@ -327,3 +352,5 @@ WMGetColorRGBDescription(WMColor *color)
return str; return str;
} }
+22 -28
View File
@@ -605,7 +605,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap, W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), panel->font12, 2, 0, 100, WALeft, scrPtr->white,
False, _("Brightness"), strlen(_("Brightness"))); False, _("Brightness"), strlen(_("Brightness")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -681,8 +681,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Red"), 2, 0, 100, WALeft, scrPtr->white, False, _("Red"),
strlen(_("Red"))); strlen(_("Red")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -714,8 +714,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Green"), 2, 0, 100, WALeft, scrPtr->white, False, _("Green"),
strlen(_("Green"))); strlen(_("Green")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -748,8 +748,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Blue"), 2, 0, 100, WALeft, scrPtr->white, False, _("Blue"),
strlen(_("Blue"))); strlen(_("Blue")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -808,8 +808,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Cyan"), 2, 0, 100, WALeft, scrPtr->black, False, _("Cyan"),
strlen(_("Cyan"))); strlen(_("Cyan")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -842,8 +842,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Magenta"), 2, 0, 100, WALeft, scrPtr->black, False, _("Magenta"),
strlen(_("Magenta"))); strlen(_("Magenta")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -876,8 +876,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Yellow"), 2, 0, 100, WALeft, scrPtr->black, False, _("Yellow"),
strlen(_("Yellow"))); strlen(_("Yellow")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -911,8 +911,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Black"), 2, 0, 100, WALeft, scrPtr->black, False, _("Black"),
strlen(_("Black"))); strlen(_("Black")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -2824,7 +2824,7 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white), panel->font12, 2, 0, 100, WALeft, scr->white,
False, _("Brightness"), strlen(_("Brightness"))); False, _("Brightness"), strlen(_("Brightness")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -2859,8 +2859,8 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, panel->font12, 2, 0, 100, WALeft,
WMColorGC(from.hsv.value < 128 ? scr->white : scr->black), False, from.hsv.value < 128 ? scr->white : scr->black, False,
_("Saturation"), strlen(_("Saturation"))); _("Saturation"), strlen(_("Saturation")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -2895,8 +2895,8 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, panel->font12, 2, 0, 100, WALeft,
WMColorGC(hsvcolor.value < 128 ? scr->white : scr->black), False, hsvcolor.value < 128 ? scr->white : scr->black, False,
_("Hue"), strlen(_("Hue"))); _("Hue"), strlen(_("Hue")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -3427,8 +3427,6 @@ colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
WMScreen *scr = WMWidgetScreen(lPtr); WMScreen *scr = WMWidgetScreen(lPtr);
Display *dpy = WMScreenDisplay(scr); Display *dpy = WMScreenDisplay(scr);
W_ColorPanel *panel = WMGetHangedData(lPtr); W_ColorPanel *panel = WMGetHangedData(lPtr);
WMColor *white = WMWhiteColor(scr);
WMColor *black = WMBlackColor(scr);
WMColor *fillColor; WMColor *fillColor;
width = rect->size.width; width = rect->size.width;
@@ -3437,7 +3435,7 @@ colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
y = rect->pos.y; y = rect->pos.y;
if (state & WLDSSelected) if (state & WLDSSelected)
WMPaintColorSwatch(white, d, x +15, y, width -15, height); WMPaintColorSwatch(scr->white, d, x +15, y, width -15, height);
else else
XClearArea(dpy, d, x +15, y, width -15, height, False); XClearArea(dpy, d, x +15, y, width -15, height, False);
@@ -3448,11 +3446,7 @@ colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
WMPaintColorSwatch(fillColor, d, x, y, 15, 15); WMPaintColorSwatch(fillColor, d, x, y, 15, 15);
WMReleaseColor(fillColor); WMReleaseColor(fillColor);
WMDrawString(scr, d, WMColorGC(black), panel->font12, x+18, y, text, WMDrawString(scr, d, scr->black, panel->font12, x+18, y, text, strlen(text));
strlen(text));
WMReleaseColor(white);
WMReleaseColor(black);
} }
+17 -12
View File
@@ -387,33 +387,38 @@ WMWidthOfString(WMFont *font, char *text, int length)
void void
WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, int y, WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
char *text, int length) int x, int y, char *text, int length)
{ {
wassertr(font!=NULL); wassertr(font!=NULL);
XSetForeground(scr->display, scr->drawStringGC, W_PIXEL(color));
if (font->notFontSet) { if (font->notFontSet) {
XSetFont(scr->display, gc, font->font.normal->fid); XSetFont(scr->display, scr->drawStringGC, font->font.normal->fid);
XDrawString(scr->display, d, gc, x, y + font->y, text, length); XDrawString(scr->display, d, scr->drawStringGC, x, y + font->y, text,
length);
} else { } else {
XmbDrawString(scr->display, d, font->font.set, gc, x, y + font->y, XmbDrawString(scr->display, d, font->font.set, scr->drawStringGC,
text, length); x, y + font->y, text, length);
} }
} }
void void
WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, int y, WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color, WMColor *background,
char *text, int length) WMFont *font, int x, int y, char *text, int length)
{ {
wassertr(font != NULL); wassertr(font != NULL);
XSetForeground(scr->display, scr->drawImStringGC, W_PIXEL(color));
XSetBackground(scr->display, scr->drawImStringGC, W_PIXEL(background));
if (font->notFontSet) { if (font->notFontSet) {
XSetFont(scr->display, gc, font->font.normal->fid); XSetFont(scr->display, scr->drawImStringGC, font->font.normal->fid);
XDrawImageString(scr->display, d, gc, x, y + font->y, text, length); XDrawImageString(scr->display, d, scr->drawImStringGC, x, y + font->y,
text, length);
} else { } else {
XmbDrawImageString(scr->display, d, font->font.set, gc, x, y + font->y, XmbDrawImageString(scr->display, d, font->font.set, scr->drawImStringGC,
text, length); x, y + font->y, text, length);
} }
} }
+2 -3
View File
@@ -193,9 +193,8 @@ paintFrame(Frame *fPtr)
} }
if (drawTitle) { if (drawTitle) {
WMDrawString(scrPtr, view->window, WMColorGC(scrPtr->black), WMDrawString(scrPtr, view->window, scrPtr->black, scrPtr->normalFont,
scrPtr->normalFont, tx, ty, fPtr->caption, tx, ty, fPtr->caption, strlen(fPtr->caption));
strlen(fPtr->caption));
} }
} }
+4 -5
View File
@@ -727,7 +727,6 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->clipGC = XCreateGC(display, W_DRAWABLE(scrPtr), GCFunction scrPtr->clipGC = XCreateGC(display, W_DRAWABLE(scrPtr), GCFunction
|GCGraphicsExposures, &gcv); |GCGraphicsExposures, &gcv);
stipple = XCreateBitmapFromData(display, W_DRAWABLE(scrPtr), stipple = XCreateBitmapFromData(display, W_DRAWABLE(scrPtr),
STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT); STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT);
gcv.foreground = W_PIXEL(scrPtr->darkGray); gcv.foreground = W_PIXEL(scrPtr->darkGray);
@@ -738,10 +737,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
GCForeground|GCBackground|GCStipple GCForeground|GCBackground|GCStipple
|GCFillStyle|GCGraphicsExposures, &gcv); |GCFillStyle|GCGraphicsExposures, &gcv);
gcv.foreground = W_PIXEL(scrPtr->black); scrPtr->drawStringGC = XCreateGC(display, W_DRAWABLE(scrPtr),
gcv.background = W_PIXEL(scrPtr->white); GCGraphicsExposures, &gcv);
scrPtr->textFieldGC = XCreateGC(display, W_DRAWABLE(scrPtr), scrPtr->drawImStringGC = XCreateGC(display, W_DRAWABLE(scrPtr),
GCForeground|GCBackground, &gcv); GCGraphicsExposures, &gcv);
/* we need a 1bpp drawable for the monoGC, so borrow this one */ /* we need a 1bpp drawable for the monoGC, so borrow this one */
scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL); scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL);
+2 -7
View File
@@ -205,14 +205,9 @@ static void
paintLabel(Label *lPtr) paintLabel(Label *lPtr)
{ {
W_Screen *scrPtr = lPtr->view->screen; W_Screen *scrPtr = lPtr->view->screen;
GC gc;
if (lPtr->textColor) W_PaintTextAndImage(lPtr->view, !lPtr->flags.noWrap,
gc = WMColorGC(lPtr->textColor); lPtr->textColor ? lPtr->textColor : scrPtr->black,
else
gc = WMColorGC(scrPtr->black);
W_PaintTextAndImage(lPtr->view, !lPtr->flags.noWrap, gc,
(lPtr->font!=NULL ? lPtr->font : scrPtr->normalFont), (lPtr->font!=NULL ? lPtr->font : scrPtr->normalFont),
lPtr->flags.relief, lPtr->caption, lPtr->flags.relief, lPtr->caption,
lPtr->flags.alignment, lPtr->image, lPtr->flags.alignment, lPtr->image,
+1 -1
View File
@@ -530,7 +530,7 @@ paintItem(List *lPtr, int index)
} }
W_PaintText(view, view->window, scr->normalFont, x+4, y, width, W_PaintText(view, view->window, scr->normalFont, x+4, y, width,
WALeft, WMColorGC(scr->black), False, WALeft, scr->black, False,
itemPtr->text, strlen(itemPtr->text)); itemPtr->text, strlen(itemPtr->text));
} }
+9 -9
View File
@@ -154,7 +154,7 @@ W_GetTextHeight(WMFont *font, char *text, int width, int wrap)
void void
W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y, 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 wrap, char *text, int length)
{ {
char *ptr = text; char *ptr = text;
@@ -174,7 +174,7 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
else else
line_x = x + (width - line_width) / 2; line_x = x + (width - line_width) / 2;
WMDrawString(view->screen, d, gc, font, line_x, y, ptr, count); WMDrawString(view->screen, d, color, font, line_x, y, ptr, count);
if (wrap && ptr[count]!='\n') if (wrap && ptr[count]!='\n')
y += fheight; y += fheight;
@@ -191,10 +191,10 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
void void
W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor, W_Font *font,
WMReliefType relief, char *text, WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image, WMAlignment alignment, W_Pixmap *image,
WMImagePosition position, GC backGC, int ofs) WMImagePosition position, WMColor *backColor, int ofs)
{ {
W_Screen *screen = view->screen; W_Screen *screen = view->screen;
int ix, iy; int ix, iy;
@@ -209,15 +209,15 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
/* background */ /* background */
#ifndef DOUBLE_BUFFER #ifndef DOUBLE_BUFFER
if (backGC) { if (backColor) {
XFillRectangle(screen->display, d, backGC, XFillRectangle(screen->display, d, WMColorGC(backColor),
0, 0, view->size.width, view->size.height); 0, 0, view->size.width, view->size.height);
} else { } else {
XClearWindow(screen->display, d); XClearWindow(screen->display, d);
} }
#else #else
if (backGC) if (backColor)
XFillRectangle(screen->display, d, backGC, 0, 0, XFillRectangle(screen->display, d, WMColorGC(backColor), 0, 0,
view->size.width, view->size.height); view->size.width, view->size.height);
else { else {
XSetForeground(screen->display, screen->copyGC, XSetForeground(screen->display, screen->copyGC,
@@ -303,7 +303,7 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
textHeight = W_GetTextHeight(font, text, w-8, wrap); textHeight = W_GetTextHeight(font, text, w-8, wrap);
W_PaintText(view, d, font, x+ofs+4, y+ofs + (h-textHeight)/2, w-8, W_PaintText(view, d, font, x+ofs+4, y+ofs + (h-textHeight)/2, w-8,
alignment, textGC, wrap, text, strlen(text)); alignment, textColor, wrap, text, strlen(text));
} }
+6 -6
View File
@@ -333,7 +333,7 @@ paintPopUpButton(PopUpButton *bPtr)
W_PaintText(bPtr->view, pixmap, scr->normalFont, 6, W_PaintText(bPtr->view, pixmap, scr->normalFont, 6,
(bPtr->view->size.height-WMFontHeight(scr->normalFont))/2, (bPtr->view->size.height-WMFontHeight(scr->normalFont))/2,
bPtr->view->size.width, WALeft, bPtr->view->size.width, WALeft,
bPtr->flags.enabled ? WMColorGC(scr->black) : WMColorGC(scr->darkGray), bPtr->flags.enabled ? scr->black : scr->darkGray,
False, caption, strlen(caption)); False, caption, strlen(caption));
} }
@@ -421,7 +421,7 @@ paintMenuEntry(PopUpButton *bPtr, int index, int highlight)
width, itemHeight, WRRaised); width, itemHeight, WRRaised);
W_PaintText(bPtr->menuView, bPtr->menuView->window, scr->normalFont, 6, W_PaintText(bPtr->menuView, bPtr->menuView->window, scr->normalFont, 6,
index*itemHeight + yo, width, WALeft, WMColorGC(scr->black), index*itemHeight + yo, width, WALeft, scr->black,
False, title, strlen(title)); False, title, strlen(title));
if (!bPtr->flags.pullsDown && index == bPtr->selectedItemIndex) { if (!bPtr->flags.pullsDown && index == bPtr->selectedItemIndex) {
@@ -457,7 +457,7 @@ makeMenuPixmap(PopUpButton *bPtr)
i = 0; i = 0;
WM_ITERATE_ARRAY(bPtr->items, item, iter) { WM_ITERATE_ARRAY(bPtr->items, item, iter) {
GC gc; WMColor *color;
char *text; char *text;
text = WMGetMenuItemTitle(item); text = WMGetMenuItemTitle(item);
@@ -466,12 +466,12 @@ makeMenuPixmap(PopUpButton *bPtr)
WRRaised); WRRaised);
if (!WMGetMenuItemEnabled(item)) if (!WMGetMenuItemEnabled(item))
gc = WMColorGC(scr->darkGray); color = scr->darkGray;
else else
gc = WMColorGC(scr->black); color = scr->black;
W_PaintText(bPtr->menuView, pixmap, scr->normalFont, 6, W_PaintText(bPtr->menuView, pixmap, scr->normalFont, 6,
i*itemHeight + yo, width, WALeft, gc, False, i*itemHeight + yo, width, WALeft, color, False,
text, strlen(text)); text, strlen(text));
if (!bPtr->flags.pullsDown && i == bPtr->selectedItemIndex) { if (!bPtr->flags.pullsDown && i == bPtr->selectedItemIndex) {
+40 -41
View File
@@ -33,7 +33,8 @@ typedef struct W_Ruler {
WMAction *releaseAction; /* what to do when released */ WMAction *releaseAction; /* what to do when released */
void *clientData; void *clientData;
GC fg, bg; WMColor *fg;
GC fgGC, bgGC;
WMFont *font; WMFont *font;
WMRulerMargins margins; WMRulerMargins margins;
int offset; int offset;
@@ -68,11 +69,10 @@ static void
drawLeftMarker(Ruler * rPtr) drawLeftMarker(Ruler * rPtr)
{ {
XPoint points[4]; XPoint points[4];
int xpos = (rPtr->flags.whichMarker == 1 ? int xpos = (rPtr->flags.whichMarker==1 ? rPtr->motion : rPtr->margins.left);
rPtr->motion : rPtr->margins.left);
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos, 8, xpos, 22); xpos, 8, xpos, 22);
points[0].x = xpos; points[0].x = xpos;
points[0].y = 1; points[0].y = 1;
points[1].x = points[0].x + 6; points[1].x = points[0].x + 6;
@@ -81,8 +81,8 @@ drawLeftMarker(Ruler * rPtr)
points[2].y = 9; points[2].y = 9;
points[3].x = points[0].x; points[3].x = points[0].x;
points[3].y = 9; points[3].y = 9;
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, points, 4, Convex, CoordModeOrigin); points, 4, Convex, CoordModeOrigin);
} }
@@ -98,11 +98,10 @@ drawLeftMarker(Ruler * rPtr)
static void drawRightMarker(Ruler * rPtr) static void drawRightMarker(Ruler * rPtr)
{ {
XPoint points[4]; XPoint points[4];
int xpos = (rPtr->flags.whichMarker == 2 ? int xpos = (rPtr->flags.whichMarker==2 ? rPtr->motion : rPtr->margins.right);
rPtr->motion : rPtr->margins.right);
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos, 8, xpos, 22); xpos, 8, xpos, 22);
points[0].x = xpos + 1; points[0].x = xpos + 1;
points[0].y = 0; points[0].y = 0;
points[1].x = points[0].x - 6; points[1].x = points[0].x - 6;
@@ -111,8 +110,8 @@ static void drawRightMarker(Ruler * rPtr)
points[2].y = 9; points[2].y = 9;
points[3].x = points[0].x; points[3].x = points[0].x;
points[3].y = 9; points[3].y = 9;
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, points, 4, Convex, CoordModeOrigin); points, 4, Convex, CoordModeOrigin);
} }
@@ -127,10 +126,10 @@ static void drawFirstMarker(Ruler * rPtr)
int xpos = ((rPtr->flags.whichMarker == 3 || rPtr->flags.whichMarker == 6) ? int xpos = ((rPtr->flags.whichMarker == 3 || rPtr->flags.whichMarker == 6) ?
rPtr->motion : rPtr->margins.first); rPtr->motion : rPtr->margins.first);
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos - 5, 10, 11, 5); xpos - 5, 10, 11, 5);
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos, 12, xpos, 22); xpos, 12, xpos, 22);
} }
/* Marker for rest of body /* Marker for rest of body
@@ -150,8 +149,8 @@ static void drawBodyMarker(Ruler * rPtr)
points[1].y = 16; points[1].y = 16;
points[2].x = points[0].x + 5; points[2].x = points[0].x + 5;
points[2].y = 22; points[2].y = 22;
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, points, 3, Convex, CoordModeOrigin); points, 3, Convex, CoordModeOrigin);
} }
@@ -167,7 +166,7 @@ static void createDrawBuffer(Ruler * rPtr)
rPtr->view->window, rPtr->view->size.width, 40, rPtr->view->window, rPtr->view->size.width, 40,
rPtr->view->screen->depth); rPtr->view->screen->depth);
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->bg, 0, 0, rPtr->view->size.width, 40); rPtr->bgGC, 0, 0, rPtr->view->size.width, 40);
} }
@@ -175,15 +174,14 @@ static void drawRulerOnPixmap(Ruler * rPtr)
{ {
int i, j, w, m; int i, j, w, m;
char c[3]; char c[3];
int marks[9] = int marks[9] = {11, 3, 5, 3, 7, 3, 5, 3};
{11, 3, 5, 3, 7, 3, 5, 3};
if (!rPtr->drawBuffer || !rPtr->view->flags.realized) if (!rPtr->drawBuffer || !rPtr->view->flags.realized)
return; return;
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->bg, 0, 0, rPtr->view->size.width, 40); rPtr->bgGC, 0, 0, rPtr->view->size.width, 40);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg, WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2, 26, _("0 inches"), 10); rPtr->font, rPtr->margins.left + 2, 26, _("0 inches"), 10);
@@ -192,26 +190,26 @@ static void drawRulerOnPixmap(Ruler * rPtr)
i = j = m = 0; i = j = m = 0;
w = rPtr->view->size.width - rPtr->margins.left; w = rPtr->view->size.width - rPtr->margins.left;
while (m < w) { while (m < w) {
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->fg, rPtr->margins.left + m, 23, rPtr->fgGC, rPtr->margins.left + m, 23,
rPtr->margins.left + m, marks[i % 8] + 23); rPtr->margins.left + m, marks[i % 8] + 23);
if (i != 0 && i % 8 == 0) { if (i != 0 && i % 8 == 0) {
if (j < 10) if (j < 10)
snprintf(c, 3, "%d", ++j); snprintf(c, 3, "%d", ++j);
else else
snprintf(c, 3, "%2d", ++j); snprintf(c, 3, "%2d", ++j);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg, WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2); rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
} }
m = (++i) * 10; m = (++i) * 10;
} }
rPtr->end = rPtr->margins.left + m - 10; rPtr->end = rPtr->margins.left + m - 10;
if (rPtr->margins.right > rPtr->end) if (rPtr->margins.right > rPtr->end)
rPtr->margins.right = rPtr->end; rPtr->margins.right = rPtr->end;
/* base line */ /* base line */
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fg, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->margins.left, 22, rPtr->margins.left + m - 10, 22); rPtr->margins.left, 22, rPtr->margins.left + m - 10, 22);
drawLeftMarker(rPtr); drawLeftMarker(rPtr);
drawRightMarker(rPtr); drawRightMarker(rPtr);
@@ -230,8 +228,8 @@ static void paintRuler(Ruler * rPtr)
if (rPtr->flags.redraw) if (rPtr->flags.redraw)
drawRulerOnPixmap(rPtr); drawRulerOnPixmap(rPtr);
XCopyArea(rPtr->view->screen->display, rPtr->drawBuffer, XCopyArea(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->view->window, rPtr->bg, 0, 0, rPtr->view->size.width, 40, rPtr->view->window, rPtr->bgGC, 0, 0,
0, 0); rPtr->view->size.width, 40, 0, 0);
} }
@@ -447,8 +445,9 @@ WMCreateRuler(WMWidget * parent)
rPtr->view->delegate = &_RulerViewDelegate; rPtr->view->delegate = &_RulerViewDelegate;
rPtr->bg = WMColorGC(WMGrayColor(rPtr->view->screen)); rPtr->fg = WMBlackColor(rPtr->view->screen);
rPtr->fg = WMColorGC(WMBlackColor(rPtr->view->screen)); rPtr->fgGC = WMColorGC(rPtr->fg);
rPtr->bgGC = WMColorGC(WMGrayColor(rPtr->view->screen));
rPtr->font = WMSystemFontOfSize(rPtr->view->screen, 8); rPtr->font = WMSystemFontOfSize(rPtr->view->screen, 8);
rPtr->offset = 22; rPtr->offset = 22;
+1 -1
View File
@@ -882,7 +882,7 @@ W_DrawLabel(WMTabViewItem *item, Drawable d, WMRect rect, Bool enabled)
if (!item->label) if (!item->label)
return; return;
WMDrawString(scr, d, WMColorGC(enabled ? scr->black : scr->darkGray), WMDrawString(scr, d, enabled ? scr->black : scr->darkGray,
item->tabView->font, rect.pos.x, rect.pos.y, item->tabView->font, rect.pos.x, rect.pos.y,
item->label, strlen(item->label)); item->label, strlen(item->label));
} }
+38 -62
View File
@@ -106,8 +106,9 @@ typedef struct W_Text {
WMColor *dColor; /* the default color */ WMColor *dColor; /* the default color */
WMPixmap *dBulletPix; /* the default pixmap for bullets */ WMPixmap *dBulletPix; /* the default pixmap for bullets */
GC bgGC; /* the background GC to draw with */ WMColor *fgColor; /* The current foreground color */
GC fgGC; /* the foreground GC to draw with */ WMColor *bgColor; /* The background color */
GC stippledGC; /* the GC to overlay selected graphics with */ GC stippledGC; /* the GC to overlay selected graphics with */
Pixmap db; /* the buffer on which to draw */ Pixmap db; /* the buffer on which to draw */
WMPixmap *bgPixmap; /* the background pixmap */ WMPixmap *bgPixmap; /* the background pixmap */
@@ -648,7 +649,6 @@ paintText(Text *tPtr)
{ {
TextBlock *tb; TextBlock *tb;
WMFont *font; WMFont *font;
GC gc, greyGC;
char *text; char *text;
int len, y, c, s, done=False, prev_y=-23, dir /* 1 = down */; int len, y, c, s, done=False, prev_y=-23, dir /* 1 = down */;
WMScreen *scr = tPtr->view->screen; WMScreen *scr = tPtr->view->screen;
@@ -660,8 +660,8 @@ paintText(Text *tPtr)
return; return;
XFillRectangle(dpy, tPtr->db, tPtr->bgGC, XFillRectangle(dpy, tPtr->db, WMColorGC(tPtr->bgColor), 0, 0,
0, 0, tPtr->visible.w, tPtr->visible.h); tPtr->visible.w, tPtr->visible.h);
if (tPtr->bgPixmap) { if (tPtr->bgPixmap) {
WMDrawPixmap(tPtr->bgPixmap, tPtr->db, WMDrawPixmap(tPtr->bgPixmap, tPtr->db,
@@ -675,12 +675,6 @@ paintText(Text *tPtr)
} }
} }
if (tPtr->flags.ownsSelection) {
color = WMGrayColor(scr);
greyGC = WMColorGC(color);
WMReleaseColor(color);
}
done = False; done = False;
@@ -721,8 +715,6 @@ _getSibling:
/* first, place all text that can be viewed */ /* first, place all text that can be viewed */
while (!done && tb) { while (!done && tb) {
if (tb->graphic) { if (tb->graphic) {
tb = tb->next; tb = tb->next;
continue; continue;
@@ -742,10 +734,10 @@ _getSibling:
if (tPtr->flags.monoFont) { if (tPtr->flags.monoFont) {
font = tPtr->dFont; font = tPtr->dFont;
gc = tPtr->fgGC; color = tPtr->fgColor;
} else { } else {
font = tb->d.font; font = tb->d.font;
gc = WMColorGC(tb->color); color = tb->color;
} }
if (tPtr->flags.ownsSelection) { if (tPtr->flags.ownsSelection) {
@@ -753,7 +745,7 @@ _getSibling:
if ( sectionWasSelected(tPtr, tb, &rect, s)) { if ( sectionWasSelected(tPtr, tb, &rect, s)) {
tb->selected = True; tb->selected = True;
XFillRectangle(dpy, tPtr->db, greyGC, XFillRectangle(dpy, tPtr->db, WMColorGC(scr->gray),
rect.x, rect.y, rect.width, rect.height); rect.x, rect.y, rect.width, rect.height);
} }
} }
@@ -763,21 +755,18 @@ _getSibling:
len = tb->sections[s].end - tb->sections[s].begin; len = tb->sections[s].end - tb->sections[s].begin;
text = &(tb->text[tb->sections[s].begin]); text = &(tb->text[tb->sections[s].begin]);
y = tb->sections[s].y - tPtr->vpos; y = tb->sections[s].y - tPtr->vpos;
WMDrawString(scr, tPtr->db, gc, font, WMDrawString(scr, tPtr->db, color, font,
tb->sections[s].x - tPtr->hpos, y, text, len); tb->sections[s].x - tPtr->hpos, y, text, len);
if (!tPtr->flags.monoFont && tb->underlined) { if (!tPtr->flags.monoFont && tb->underlined) {
XDrawLine(dpy, tPtr->db, gc, XDrawLine(dpy, tPtr->db, WMColorGC(color),
tb->sections[s].x - tPtr->hpos, tb->sections[s].x - tPtr->hpos,
y + font->y + 1, y + font->y + 1,
tb->sections[s].x + tb->sections[s].w - tPtr->hpos, tb->sections[s].x + tb->sections[s].w - tPtr->hpos,
y + font->y + 1); y + font->y + 1);
} }
} }
tb = (!done? tb->next : NULL); tb = (!done? tb->next : NULL);
} }
/* now , show all graphic items that can be viewed */ /* now , show all graphic items that can be viewed */
@@ -855,22 +844,22 @@ _copy_area:
if (tPtr->flags.editable && tPtr->flags.cursorShown if (tPtr->flags.editable && tPtr->flags.cursorShown
&& tPtr->cursor.x != -23 && tPtr->flags.focused) { && tPtr->cursor.x != -23 && tPtr->flags.focused) {
int y = tPtr->cursor.y - tPtr->vpos; int y = tPtr->cursor.y - tPtr->vpos;
XDrawLine(dpy, tPtr->db, tPtr->fgGC, XDrawLine(dpy, tPtr->db, WMColorGC(tPtr->fgColor),
tPtr->cursor.x, y, tPtr->cursor.x, y,
tPtr->cursor.x, y + tPtr->cursor.h); tPtr->cursor.x, y + tPtr->cursor.h);
} }
XCopyArea(dpy, tPtr->db, win, tPtr->bgGC, 0, 0, XCopyArea(dpy, tPtr->db, win, WMColorGC(tPtr->bgColor), 0, 0,
tPtr->visible.w, tPtr->visible.h, tPtr->visible.w, tPtr->visible.h,
tPtr->visible.x, tPtr->visible.y); tPtr->visible.x, tPtr->visible.y);
W_DrawRelief(scr, win, 0, 0, W_DrawRelief(scr, win, 0, 0,
tPtr->view->size.width, tPtr->view->size.height, tPtr->view->size.width, tPtr->view->size.height,
tPtr->flags.relief); tPtr->flags.relief);
if (tPtr->ruler && tPtr->flags.rulerShown) if (tPtr->ruler && tPtr->flags.rulerShown)
XDrawLine(dpy, win, tPtr->fgGC, XDrawLine(dpy, win, WMColorGC(tPtr->fgColor),
2, 42, tPtr->view->size.width-4, 42); 2, 42, tPtr->view->size.width-4, 42);
} }
@@ -3138,30 +3127,27 @@ WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser, WMAction *writer
tPtr->view->attribFlags |= CWOverrideRedirect | CWCursor; tPtr->view->attribFlags |= CWOverrideRedirect | CWCursor;
W_ResizeView(tPtr->view, 250, 200); W_ResizeView(tPtr->view, 250, 200);
tPtr->dColor = WMWhiteColor(scr);
tPtr->bgGC = WMColorGC(tPtr->dColor);
W_SetViewBackgroundColor(tPtr->view, tPtr->dColor);
WMReleaseColor(tPtr->dColor);
tPtr->dColor = WMBlackColor(scr); tPtr->dColor = WMBlackColor(scr);
tPtr->fgGC = WMColorGC(tPtr->dColor); tPtr->fgColor = WMBlackColor(scr);
tPtr->bgColor = WMWhiteColor(scr);
W_SetViewBackgroundColor(tPtr->view, tPtr->bgColor);
gcv.graphics_exposures = False; gcv.graphics_exposures = False;
gcv.foreground = W_PIXEL(scr->gray); gcv.foreground = W_PIXEL(scr->gray);
gcv.background = W_PIXEL(scr->darkGray); gcv.background = W_PIXEL(scr->darkGray);
gcv.fill_style = FillStippled; gcv.fill_style = FillStippled;
/* why not use scr->stipple here? */ /* why not use scr->stipple here? */
gcv.stipple = XCreateBitmapFromData(dpy, W_DRAWABLE(scr), gcv.stipple = XCreateBitmapFromData(dpy, W_DRAWABLE(scr), STIPPLE_BITS,
STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT); STIPPLE_WIDTH, STIPPLE_HEIGHT);
tPtr->stippledGC = XCreateGC(dpy, W_DRAWABLE(scr), tPtr->stippledGC = XCreateGC(dpy, W_DRAWABLE(scr),
GCForeground|GCBackground|GCStipple GCForeground|GCBackground|GCStipple
|GCFillStyle|GCGraphicsExposures, &gcv); |GCFillStyle|GCGraphicsExposures, &gcv);
tPtr->ruler = NULL; tPtr->ruler = NULL;
tPtr->vS = NULL; tPtr->vS = NULL;
tPtr->hS = NULL; tPtr->hS = NULL;
tPtr->dFont = WMRetainFont(WMSystemFontOfSize(scr, 12)); tPtr->dFont = WMSystemFontOfSize(scr, 12);
tPtr->view->delegate = &_TextViewDelegate; tPtr->view->delegate = &_TextViewDelegate;
@@ -3668,8 +3654,8 @@ WMDestroyTextBlock(WMText *tPtr, void *vtb)
/* 5 months later... destroy it 10 seconds after now which should /* 5 months later... destroy it 10 seconds after now which should
* be enough time for the widget's action to be completed... :-) */ * be enough time for the widget's action to be completed... :-) */
/* This is a bad assumption. Just destroy the widget here. /* This is a bad assumption. Just destroy the widget here.
// if the caller needs it, it can protect it with W_RetainView() * if the caller needs it, it can protect it with W_RetainView()
//WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);*/ * WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);*/
WMDestroyWidget(tb->d.widget); WMDestroyWidget(tb->d.widget);
} else { } else {
WMReleasePixmap(tb->d.pixmap); WMReleasePixmap(tb->d.pixmap);
@@ -3693,13 +3679,8 @@ WMSetTextForegroundColor(WMText *tPtr, WMColor *color)
if (!tPtr) if (!tPtr)
return; return;
if (color) WMReleaseColor(tPtr->fgColor);
tPtr->fgGC = WMColorGC(color); tPtr->fgColor = WMRetainColor(color ? color : tPtr->view->screen->black);
else {
WMColor *color = WMBlackColor(tPtr->view->screen);
tPtr->fgGC = WMColorGC(color);
WMReleaseColor(color);
}
paintText(tPtr); paintText(tPtr);
} }
@@ -3710,14 +3691,9 @@ WMSetTextBackgroundColor(WMText *tPtr, WMColor *color)
if (!tPtr) if (!tPtr)
return; return;
if (color) { WMReleaseColor(tPtr->bgColor);
tPtr->bgGC = WMColorGC(color); tPtr->bgColor = WMRetainColor(color ? color : tPtr->view->screen->white);
W_SetViewBackgroundColor(tPtr->view, color); W_SetViewBackgroundColor(tPtr->view, tPtr->bgColor);
} else {
tPtr->bgGC = WMColorGC(WMWhiteColor(tPtr->view->screen));
W_SetViewBackgroundColor(tPtr->view,
WMWhiteColor(tPtr->view->screen));
}
paintText(tPtr); paintText(tPtr);
} }
+8 -21
View File
@@ -816,6 +816,7 @@ paintTextField(TextField *tPtr)
int totalWidth; int totalWidth;
char *text; char *text;
Pixmap drawbuffer; Pixmap drawbuffer;
WMColor *color;
if (!view->flags.realized || !view->flags.mapped) if (!view->flags.realized || !view->flags.mapped)
@@ -877,12 +878,10 @@ paintTextField(TextField *tPtr)
break; break;
} }
if (!tPtr->flags.enabled) color = tPtr->flags.enabled ? screen->black : screen->darkGray;
WMSetColorInGC(screen->darkGray, screen->textFieldGC);
WMDrawImageString(screen, drawbuffer, screen->textFieldGC, WMDrawImageString(screen, drawbuffer, color, screen->white,
tPtr->font, tx, ty, tPtr->font, tx, ty, &(text[tPtr->viewPosition]),
&(text[tPtr->viewPosition]),
tPtr->textLen - tPtr->viewPosition); tPtr->textLen - tPtr->viewPosition);
if (tPtr->selection.count) { if (tPtr->selection.count) {
@@ -897,27 +896,15 @@ paintTextField(TextField *tPtr)
count = tPtr->viewPosition; count = tPtr->viewPosition;
} }
rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count) rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count)
- WMWidthOfString(tPtr->font,text,tPtr->viewPosition); - WMWidthOfString(tPtr->font,text,tPtr->viewPosition);
XSetBackground(screen->display, screen->textFieldGC, WMDrawImageString(screen, drawbuffer, color, screen->gray,
screen->gray->color.pixel); tPtr->font, rx, ty, &(text[count]), count2);
WMDrawImageString(screen, drawbuffer, screen->textFieldGC,
tPtr->font, rx, ty, &(text[count]),
count2);
XSetBackground(screen->display, screen->textFieldGC,
screen->white->color.pixel);
} }
if (!tPtr->flags.enabled)
WMSetColorInGC(screen->black, screen->textFieldGC);
} else { } else {
XFillRectangle(screen->display, drawbuffer, XFillRectangle(screen->display, drawbuffer, WMColorGC(screen->white),
WMColorGC(screen->white), bd, bd, totalWidth,view->size.height-2*bd);
bd,bd, totalWidth,view->size.height-2*bd);
} }
/* draw relief */ /* draw relief */
+2 -2
View File
@@ -560,10 +560,10 @@ W_SetViewBackgroundColor(W_View *view, WMColor *color)
view->backColor = WMRetainColor(color); view->backColor = WMRetainColor(color);
view->attribFlags |= CWBackPixel; view->attribFlags |= CWBackPixel;
view->attribs.background_pixel = color->color.pixel; view->attribs.background_pixel = W_PIXEL(color);
if (view->flags.realized) { if (view->flags.realized) {
XSetWindowBackground(view->screen->display, view->window, XSetWindowBackground(view->screen->display, view->window,
color->color.pixel); W_PIXEL(color));
XClearWindow(view->screen->display, view->window); XClearWindow(view->screen->display, view->window);
} }
} }
+4 -4
View File
@@ -667,10 +667,10 @@ handleEvents(XEvent *event, void *clientData)
} }
break; break;
/* /*
// was causing windows to ignore commands like closeWindow * was causing windows to ignore commands like closeWindow
* // after the windows is iconized/restored or a workspace change * after the windows is iconized/restored or a workspace change
* // if this is really needed, put the MapNotify portion too and * if this is really needed, put the MapNotify portion too and
* // fix the restack bug in wmaker * fix the restack bug in wmaker
case UnmapNotify: case UnmapNotify:
WMUnmapWidget(win); WMUnmapWidget(win);
break; break;
+4 -4
View File
@@ -1329,11 +1329,11 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
else if (titem->selectedFor) else if (titem->selectedFor)
WMDrawPixmap(panel->offLed, d, x + TEXPREV_WIDTH + 10, y + 6); WMDrawPixmap(panel->offLed, d, x + TEXPREV_WIDTH + 10, y + 6);
WMDrawString(scr, d, WMColorGC(black), panel->boldFont, WMDrawString(scr, d, black, panel->boldFont,
x + TEXPREV_WIDTH + 22, y + 2, titem->title, x + TEXPREV_WIDTH + 22, y + 2, titem->title,
strlen(titem->title)); strlen(titem->title));
WMDrawString(scr, d, WMColorGC(black), panel->smallFont, WMDrawString(scr, d, black, panel->smallFont,
x + TEXPREV_WIDTH + 14, y + 18, titem->texture, x + TEXPREV_WIDTH + 14, y + 18, titem->texture,
strlen(titem->texture)); strlen(titem->texture));
@@ -1512,8 +1512,8 @@ paintText(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
x += (w - WMWidthOfString(font, text, l))/2; x += (w - WMWidthOfString(font, text, l))/2;
break; break;
} }
WMDrawString(scr, d, WMColorGC(color), font, x, WMDrawString(scr, d, color, font, x, y + (h - WMFontHeight(font))/2,
y + (h - WMFontHeight(font))/2, text, l); text, l);
} }
+21 -21
View File
@@ -85,26 +85,30 @@ static WMPropList *DefaultDisplayFont = NULL;
static void static void
drawMenuItem(WMScreen *scr, Display *dpy, Drawable d, drawMenuItem(Panel *panel, int x, int y, int w, int h, char *text)
int x, int y, int w, int h,
GC light, GC dark, GC black, GC white,
WMFont *font, int fh, char *text)
{ {
XFillRectangle(dpy, d, light, x, y, w, h); WMScreen *scr = WMWidgetScreen(panel->parent);
Display *dpy = WMScreenDisplay(scr);
GC black = WMColorGC(panel->black);
GC white = WMColorGC(panel->white);
GC dark = WMColorGC(panel->dark);
int fh = WMFontHeight(panel->menuItemFont);
XDrawLine(dpy, d, black, x, y, x, y+h); XFillRectangle(dpy, panel->preview, WMColorGC(panel->light), x, y, w, h);
XDrawLine(dpy, d, black, x+w, y, x+w, y+h);
XDrawLine(dpy, d, white, x+1, y, x+1, y+h-1); XDrawLine(dpy, panel->preview, black, x, y, x, y+h);
XDrawLine(dpy, d, white, x+1, y, x+w-1, y); XDrawLine(dpy, panel->preview, black, x+w, y, x+w, y+h);
XDrawLine(dpy, d, dark, x+w-1, y+1, x+w-1, y+h-3); XDrawLine(dpy, panel->preview, white, x+1, y, x+1, y+h-1);
XDrawLine(dpy, d, dark, x+1, y+h-2, x+w-1, y+h-2); XDrawLine(dpy, panel->preview, white, x+1, y, x+w-1, y);
XDrawLine(dpy, d, black, x, y+h-1, x+w, y+h-1); XDrawLine(dpy, panel->preview, dark, x+w-1, y+1, x+w-1, y+h-3);
XDrawLine(dpy, panel->preview, dark, x+1, y+h-2, x+w-1, y+h-2);
WMDrawString(scr, d, black, font, x + 5, y+(h-fh)/2, XDrawLine(dpy, panel->preview, black, x, y+h-1, x+w, y+h-1);
text, strlen(text));
WMDrawString(scr, panel->preview, panel->black, panel->menuItemFont,
x + 5, y+(h-fh)/2, text, strlen(text));
} }
@@ -156,7 +160,7 @@ paintPreviewBox(Panel *panel)
XDrawLine(dpy, panel->preview, dark, XDrawLine(dpy, panel->preview, dark,
220, 20, 220, 20+h); 220, 20, 220, 20+h);
WMDrawString(scr, panel->preview, white, panel->windowTitleFont, WMDrawString(scr, panel->preview, panel->white, panel->windowTitleFont,
20+(200-WMWidthOfString(panel->windowTitleFont, "Window Titlebar", 15))/2, 20+(200-WMWidthOfString(panel->windowTitleFont, "Window Titlebar", 15))/2,
20+(h-fh)/2, "Window Titlebar", 15); 20+(h-fh)/2, "Window Titlebar", 15);
} }
@@ -186,7 +190,7 @@ paintPreviewBox(Panel *panel)
XDrawLine(dpy, panel->preview, dark, XDrawLine(dpy, panel->preview, dark,
mx+mw, my, mx+mw, my+h); mx+mw, my, mx+mw, my+h);
WMDrawString(scr, panel->preview, white, panel->menuTitleFont, WMDrawString(scr, panel->preview, panel->white, panel->menuTitleFont,
mx+5, my+(h-fh)/2, "Menu Title", 10); mx+5, my+(h-fh)/2, "Menu Title", 10);
fh2 = WMFontHeight(panel->menuItemFont); fh2 = WMFontHeight(panel->menuItemFont);
@@ -194,11 +198,7 @@ paintPreviewBox(Panel *panel)
/* menu items */ /* menu items */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
drawMenuItem(scr, dpy, panel->preview, drawMenuItem(panel, mx-1, my+2+h+i*h2, mw+2, h2, "Menu Item");
mx-1, my+2+h+i*h2, mw+2, h2,
light, dark, black, white,
panel->menuItemFont, fh2,
"Menu Item");
} }
} }
+1 -2
View File
@@ -453,8 +453,7 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
WMReleasePixmap(pix); WMReleasePixmap(pix);
} }
WMDrawString(scr, d, WMColorGC(panel->black), panel->font, x+20, y, WMDrawString(scr, d, panel->black, panel->font, x+20, y, text, strlen(text));
text, strlen(text));
} }
+2 -4
View File
@@ -200,11 +200,9 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
XClearArea(dpy, d, x, y, width, height, False); XClearArea(dpy, d, x, y, width, height, False);
if (state & 1) { if (state & 1) {
WMDrawString(scr, d, WMColorGC(panel->red), panel->font, x+4, y, WMDrawString(scr, d, panel->red, panel->font, x+4, y, text, strlen(text));
text, strlen(text));
} else { } else {
WMDrawString(scr, d, WMColorGC(panel->black), panel->font, x+4, y, WMDrawString(scr, d, panel->black, panel->font, x+4, y, text, strlen(text));
text, strlen(text));
} }
} }
+10 -11
View File
@@ -327,13 +327,13 @@ updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
if (hsv->value < 128 || !saturation) { if (hsv->value < 128 || !saturation) {
WMColor *col = WMWhiteColor(scr); WMColor *col = WMWhiteColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), col, font, 2,
(16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer)); (16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer));
WMReleaseColor(col); WMReleaseColor(col);
} else { } else {
WMColor *col = WMBlackColor(scr); WMColor *col = WMBlackColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), col, font, 2,
(16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer)); (16 - WMFontHeight(font))/2 - 1, buffer, strlen(buffer));
WMReleaseColor(col); WMReleaseColor(col);
} }
@@ -368,14 +368,14 @@ updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
if (hsv->value < 128) { if (hsv->value < 128) {
WMColor *col = WMWhiteColor(scr); WMColor *col = WMWhiteColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), col, font, 2,
(16 - WMFontHeight(font))/2 - 1, (16 - WMFontHeight(font))/2 - 1,
_("Hue"), strlen(_("Hue"))); _("Hue"), strlen(_("Hue")));
WMReleaseColor(col); WMReleaseColor(col);
} else { } else {
WMColor *col = WMBlackColor(scr); WMColor *col = WMBlackColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2, WMDrawString(scr, WMGetPixmapXID(pixmap), col, font, 2,
(16 - WMFontHeight(font))/2 - 1, (16 - WMFontHeight(font))/2 - 1,
_("Hue"), strlen(_("Hue"))); _("Hue"), strlen(_("Hue")));
WMReleaseColor(col); WMReleaseColor(col);
@@ -489,8 +489,8 @@ paintGradListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
XCopyArea(WMScreenDisplay(scr), panel->gimage, d, WMColorGC(white), XCopyArea(WMScreenDisplay(scr), panel->gimage, d, WMColorGC(white),
0, height*index, 30, height, x + 5, y); 0, height*index, 30, height, x + 5, y);
} }
WMDrawString(scr, d, WMColorGC(black), panel->listFont, WMDrawString(scr, d, black, panel->listFont, x + 40, y + 1,
x + 40, y + 1, text, strlen(text)); text, strlen(text));
WMReleaseColor(white); WMReleaseColor(white);
WMReleaseColor(black); WMReleaseColor(black);
@@ -1333,7 +1333,7 @@ CreateTexturePanel(WMWindow *keyWindow)
WMColorGC(color), 0, 0, 130, 16); WMColorGC(color), 0, 0, 130, 16);
WMReleaseColor(color); WMReleaseColor(color);
color = WMWhiteColor(color); color = WMWhiteColor(color);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(color), WMDrawString(scr, WMGetPixmapXID(pixmap), color,
panel->listFont, 2, panel->listFont, 2,
(16 - WMFontHeight(panel->listFont))/2 - 1, (16 - WMFontHeight(panel->listFont))/2 - 1,
"Brightness", 10); "Brightness", 10);
@@ -1357,7 +1357,7 @@ CreateTexturePanel(WMWindow *keyWindow)
WMColorGC(color), 0, 0, 130, 16); WMColorGC(color), 0, 0, 130, 16);
WMReleaseColor(color); WMReleaseColor(color);
color = WMWhiteColor(scr); color = WMWhiteColor(scr);
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(color), WMDrawString(scr, WMGetPixmapXID(pixmap), color,
panel->listFont, 2, panel->listFont, 2,
(16 - WMFontHeight(panel->listFont))/2 - 1, (16 - WMFontHeight(panel->listFont))/2 - 1,
"Contrast", 8); "Contrast", 8);
@@ -1463,9 +1463,8 @@ CreateTexturePanel(WMWindow *keyWindow)
WMReleaseColor(color); WMReleaseColor(color);
color = WMWhiteColor(scr); color = WMWhiteColor(scr);
WMDrawString(scr, p, WMColorGC(color), panel->listFont, WMDrawString(scr, p, color, panel->listFont, 2, 1, "0%", 2);
2, 1, "0%", 2); WMDrawString(scr, p, color, panel->listFont,
WMDrawString(scr, p, WMColorGC(color), panel->listFont,
153 - WMWidthOfString(panel->listFont, "100%", 4), 1, 153 - WMWidthOfString(panel->listFont, "100%", 4), 1,
"100%", 4); "100%", 4);
WMReleaseColor(color); WMReleaseColor(color);
+1
View File
@@ -716,6 +716,7 @@ Initialize(WMScreen *scr)
#ifdef akk #ifdef akk
InitFont(scr, WPrefs.banner); InitFont(scr, WPrefs.banner);
#endif #endif
#ifdef not_yet_fully_implemented #ifdef not_yet_fully_implemented
InitThemes(scr, WPrefs.banner); InitThemes(scr, WPrefs.banner);
#endif #endif
+1 -1
View File
@@ -113,7 +113,7 @@ paintDoubleTest(_DoubleTest *dPtr)
y = (dPtr->view->size.height-scr->normalFont->height)/2; y = (dPtr->view->size.height-scr->normalFont->height)/2;
W_PaintText(dPtr->view, dPtr->view->window, scr->normalFont, W_PaintText(dPtr->view, dPtr->view->window, scr->normalFont,
dPtr->on, dPtr->on+y, dPtr->view->size.width, WACenter, dPtr->on, dPtr->on+y, dPtr->view->size.width, WACenter,
WMColorGC(scr->black), False, dPtr->text, strlen(dPtr->text)); scr->black, False, dPtr->text, strlen(dPtr->text));
} }
} }
+1 -2
View File
@@ -219,8 +219,7 @@ paintEditMenuItem(WEditMenuItem *iPtr)
W_DrawRelief(scr, win, 0, 0, w+1, h, WRRaised); W_DrawRelief(scr, win, 0, 0, w+1, h, WRRaised);
WMDrawString(scr, win, WMColorGC(color), font, 5, 3, iPtr->label, WMDrawString(scr, win, color, font, 5, 3, iPtr->label, strlen(iPtr->label));
strlen(iPtr->label));
if (iPtr->pixmap) { if (iPtr->pixmap) {
WMSize size = WMGetPixmapSize(iPtr->pixmap); WMSize size = WMGetPixmapSize(iPtr->pixmap);
-97
View File
@@ -1,97 +0,0 @@
/* define to the path to cpp */
#undef CPP_PATH
/* package name */
#undef PACKAGE
/* package version */
#undef VERSION
/* define if you want GNOME stuff support */
#undef GNOME_STUFF
/* define if you want KDE hint support */
#undef KWM_HINTS
/* define if you want OPEN LOOK(tm) hint support */
#undef OLWM_HINTS
/* define if XPM libraries are available
* set by configure */
#undef USE_XPM
/* define if PNG libraries are available
* set by configure */
#undef USE_PNG
/* define if JPEG libraries are available
* set by configure */
#undef USE_JPEG
/* define if GIF libraries are available
* set by configure */
#undef USE_GIF
/* define if TIFF libraries are available
* set by configure */
#undef USE_TIFF
/* define if X's shared memory extension is available
* set by configure */
#undef XSHM
/* define an extra path for pixmaps
* set by configure */
#undef PIXMAPDIR
/* Internationalization (I18N) support
* set by configure */
#undef I18N
/* define if you want the 'lite' version */
#undef LITE
/* define if you want support for shaped windows
* set by configure */
#undef SHAPE
/* define if you want support for the XINERAMA extension
* set by configure */
#undef XINERAMA
/* define if you want support for X window's X_LOCALE
* set by configure */
#undef X_LOCALE
/* the place where shared data is stored
* defined by configure */
#undef PKGDATADIR
/* the place where the configuration is stored
* defined by configure */
#undef SYSCONFDIR
/* whether XKB language MODELOCK should be enabled */
#undef XKB_MODELOCK
/* define if you want user defined menus for applications */
#undef USER_MENU
/* define if you have then inet_aton function */
#undef HAVE_INET_ATON
/* define if your X server has XInternAtoms() */
#undef HAVE_XINTERNATOMS
/* define if your X server has XConvertCase() */
#undef HAVE_XCONVERTCASE
/* define if processor is x86 */
#undef ASM_X86
/* define if processor is x86 with MMX(tm) support */
#undef ASM_X86_MMX
/* define if you have vsnprintf with C99 semantics */
#undef HAVE_C99_VSNPRINTF
+35 -27
View File
@@ -15,7 +15,7 @@ AC_INIT(src/WindowMaker.h)
AM_INIT_AUTOMAKE(WindowMaker, 0.80.2) AM_INIT_AUTOMAKE(WindowMaker, 0.81.0)
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
@@ -127,7 +127,7 @@ main() { foo("hello"); }
], ],
_cv_HAVE_C99_VSNPRINTF=yes,_cv_HAVE_C99_VSNPRINTF=no,_cv_HAVE_C99_VSNPRINTF=cross)]) _cv_HAVE_C99_VSNPRINTF=yes,_cv_HAVE_C99_VSNPRINTF=no,_cv_HAVE_C99_VSNPRINTF=cross)])
if test x"$_cv_HAVE_C99_VSNPRINTF" = x"yes"; then if test x"$_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
AC_DEFINE(HAVE_C99_VSNPRINTF) AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [define if you have vsnprintf with C99 semantics (set by configure)])
fi fi
dnl Loading of dynamic libraries at runtime dnl Loading of dynamic libraries at runtime
@@ -169,7 +169,7 @@ if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
fi fi
fi fi
fi fi
AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH") AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH", [define to the path to cpp])
@@ -215,7 +215,7 @@ if test "$ac_cv_prog_gcc" = yes; then
fi fi
if test $x86 = 1; then if test $x86 = 1; then
AC_DEFINE(ASM_X86) AC_DEFINE(ASM_X86, 1, [define if processor is x86 (normally detected by configure)])
asm_support=yes asm_support=yes
AC_CACHE_CHECK(whether gcc supports MMX(tm) inline asm, AC_CACHE_CHECK(whether gcc supports MMX(tm) inline asm,
@@ -225,7 +225,7 @@ if test "$ac_cv_prog_gcc" = yes; then
ac_cv_c_inline_mmx=no)]) ac_cv_c_inline_mmx=no)])
if test "x$ac_cv_c_inline_mmx" = xyes; then if test "x$ac_cv_c_inline_mmx" = xyes; then
AC_DEFINE(ASM_X86_MMX) AC_DEFINE(ASM_X86_MMX, 1, [define if processor is x86 with MMX(tm) support (normally autodetected by configure)])
mmx_support=yes mmx_support=yes
fi fi
fi fi
@@ -258,7 +258,7 @@ fi
if test "$LINGUAS" != ""; then if test "$LINGUAS" != ""; then
if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
AC_DEFINE(I18N) AC_DEFINE(I18N, 1, [Internationalization (I18N) support (set by configure)])
PO="" PO=""
# if test "$LINGUAS" = ""; then # if test "$LINGUAS" = ""; then
# ling=` (cd src/po; /bin/ls *.po) ` # ling=` (cd src/po; /bin/ls *.po) `
@@ -371,7 +371,7 @@ dnl ===============================
AC_ARG_ENABLE(gnome, AC_ARG_ENABLE(gnome,
[ --enable-gnome enable stuff needed for GNOME ], [ --enable-gnome enable stuff needed for GNOME ],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(GNOME_STUFF) AC_DEFINE(GNOME_STUFF, 1, [define if you want GNOME stuff support])
gnome_on=yes gnome_on=yes
fi]) fi])
@@ -379,7 +379,7 @@ AC_ARG_ENABLE(gnome,
AC_ARG_ENABLE(kde, AC_ARG_ENABLE(kde,
[ --enable-kde enable support for KDE window manager (kwm) hints ], [ --enable-kde enable support for KDE window manager (kwm) hints ],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(KWM_HINTS) AC_DEFINE(KWM_HINTS, 1, [define if you want KDE hint support])
kde_on=yes kde_on=yes
fi]) fi])
@@ -387,7 +387,7 @@ AC_ARG_ENABLE(kde,
AC_ARG_ENABLE(openlook, AC_ARG_ENABLE(openlook,
[ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ], [ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(OLWM_HINTS) AC_DEFINE(OLWM_HINTS, 1, [define if you want OPEN LOOK(tm) hint support])
openlook_on=yes openlook_on=yes
fi]) fi])
@@ -399,7 +399,7 @@ AC_ARG_ENABLE(lite,
[ --enable-lite disable some stuff (dont use it) ], [ --enable-lite disable some stuff (dont use it) ],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
LITE=yes LITE=yes
AC_DEFINE(LITE) AC_DEFINE(LITE, 1, [define if you want the 'lite' version])
AC_SUBST(LITE) AC_SUBST(LITE)
fi]) fi])
@@ -417,7 +417,7 @@ AC_CHECK_FUNC(connect,,
AC_CHECK_FUNC(gethostbyname,, AC_CHECK_FUNC(gethostbyname,,
AC_CHECK_LIB(nsl, gethostbyname, NETLIBS="$NETLIBS -lnsl")) AC_CHECK_LIB(nsl, gethostbyname, NETLIBS="$NETLIBS -lnsl"))
AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON, 1, [define if you have then inet_aton function (set by configure)]),
for lib in resolv socket inet bsd; do for lib in resolv socket inet bsd; do
AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON) AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON)
NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS) NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS)
@@ -464,24 +464,30 @@ AC_ARG_ENABLE(locale,
use_locale=no) use_locale=no)
if test "$use_locale" = yes; then if test "$use_locale" = yes; then
AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS) AC_CHECK_LIB(X11, _Xsetlocale,
AC_DEFINE(X_LOCALE, 1, [define if you want support for X window's X_LOCALE (set by configure)]),,
$XLFLAGS $XLIBS)
fi fi
dnl Check whether XInternAtoms() exist dnl Check whether XInternAtoms() exist
dnl ================================== dnl ==================================
AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS) AC_CHECK_LIB(X11, XInternAtoms,
AC_DEFINE(HAVE_XINTERNATOMS, 1, [define if your X server has XInternAtoms() (set by configure)]),,
$XLFLAGS $XLIBS)
dnl Check whether XConvertCase() exist dnl Check whether XConvertCase() exist
dnl ================================== dnl ==================================
AC_CHECK_LIB(X11, XConvertCase, AC_DEFINE(HAVE_XCONVERTCASE),,$XLFLAGS $XLIBS) AC_CHECK_LIB(X11, XConvertCase,
AC_DEFINE(HAVE_XCONVERTCASE, 1, [define if your X server has XConvertCase() (set by configure)]),,
$XLFLAGS $XLIBS)
dnl XKB keyboard language status dnl XKB keyboard language status
dnl ============================ dnl ============================
AC_ARG_ENABLE(modelock, AC_ARG_ENABLE(modelock,
[ --enable-modelock XKB keyboard language status support], [ --enable-modelock XKB keyboard language status support],
AC_DEFINE(XKB_MODELOCK)) AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK should be enabled]))
@@ -497,7 +503,8 @@ added_xext=no
if test "$shape" = yes; then if test "$shape" = yes; then
AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS" AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
added_xext=yes added_xext=yes
AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS) AC_DEFINE(SHAPE, 1, [define if you want support for shaped windows (set by configure)])],
shape=no, $XLFLAGS $XLIBS)
fi fi
@@ -510,7 +517,8 @@ xinerama=no
if test "$xinerama" = yes; then if test "$xinerama" = yes; then
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS" AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS"
AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS) AC_DEFINE(XINERAMA, 1, [define if you want support for the XINERAMA extension (set by configure)])],
xinerama=no, $XLFLAGS $XLIBS)
fi fi
@@ -533,7 +541,7 @@ if test "$shm" = yes; then
if test "$added_xext" = no; then if test "$added_xext" = no; then
XLIBS="-lXext $XLIBS" XLIBS="-lXext $XLIBS"
fi fi
AC_DEFINE(XSHM) AC_DEFINE(XSHM, 1, [define if X's shared memory extension is available (set by configure)])
fi fi
fi fi
@@ -571,7 +579,7 @@ if test "$xpm" = yes; then
if test "x$ac_cv_header_X11_xpm_h" = xyes; then if test "x$ac_cv_header_X11_xpm_h" = xyes; then
GFXLIBS="$GFXLIBS -lXpm" GFXLIBS="$GFXLIBS -lXpm"
supported_gfx="XPM" supported_gfx="XPM"
AC_DEFINE(USE_XPM) AC_DEFINE(USE_XPM, 1, [define if XPM libraries are available (set by configure)])
else else
supported_gfx="builtin-XPM" supported_gfx="builtin-XPM"
fi fi
@@ -608,7 +616,7 @@ if test "$png" = yes ; then
if test "x$ac_cv_header_png_h" = xyes; then if test "x$ac_cv_header_png_h" = xyes; then
GFXLIBS="$GFXLIBS -lpng -lz" GFXLIBS="$GFXLIBS -lpng -lz"
supported_gfx="$supported_gfx PNG" supported_gfx="$supported_gfx PNG"
AC_DEFINE(USE_PNG) AC_DEFINE(USE_PNG, 1, [define if PNG libraries are available (set by configure)])
fi fi
fi fi
fi fi
@@ -633,7 +641,7 @@ if test "$jpeg" = yes; then
if test "x$ac_cv_header_jpeglib_h" = xyes; then if test "x$ac_cv_header_jpeglib_h" = xyes; then
GFXLIBS="$GFXLIBS -ljpeg" GFXLIBS="$GFXLIBS -ljpeg"
supported_gfx="$supported_gfx JPEG" supported_gfx="$supported_gfx JPEG"
AC_DEFINE(USE_JPEG) AC_DEFINE(USE_JPEG, 1, [define if JPEG libraries are available (set by configure)])
fi fi
fi fi
fi fi
@@ -667,7 +675,7 @@ dnl
if test "x$ac_cv_header_gif_lib_h" = xyes; then if test "x$ac_cv_header_gif_lib_h" = xyes; then
GFXLIBS="$GFXLIBS $my_libname" GFXLIBS="$GFXLIBS $my_libname"
supported_gfx="$supported_gfx GIF" supported_gfx="$supported_gfx GIF"
AC_DEFINE(USE_GIF) AC_DEFINE(USE_GIF, 1, [define if GIF libraries are available (set by configure)])
fi fi
fi fi
fi fi
@@ -721,7 +729,7 @@ dnl
GFXLIBS="$my_libname $GFXLIBS" GFXLIBS="$my_libname $GFXLIBS"
ICONEXT="tiff" ICONEXT="tiff"
supported_gfx="$supported_gfx TIFF" supported_gfx="$supported_gfx TIFF"
AC_DEFINE(USE_TIFF) AC_DEFINE(USE_TIFF, 1, [define if TIFF libraries are available (set by configure)])
fi fi
fi fi
fi fi
@@ -759,13 +767,13 @@ else
pixmapdir=`eval echo ${datadir}/pixmaps` pixmapdir=`eval echo ${datadir}/pixmaps`
fi fi
AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir") AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir", [define an extra path for pixmaps (set by configure)])
pkgdatadir=`eval echo $datadir` pkgdatadir=`eval echo $datadir`
AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker") AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker", [where shared data is stored (defined by configure)])
_sysconfdir=`eval echo $sysconfdir` _sysconfdir=`eval echo $sysconfdir`
AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir") AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir", [where the configuration is stored (defined by configure)])
dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
@@ -798,7 +806,7 @@ AC_ARG_ENABLE(usermenu,
[ --enable-usermenu user defined menus for applications [ --enable-usermenu user defined menus for applications
], ],
if test "$enableval" = yes; then if test "$enableval" = yes; then
AC_DEFINE(USER_MENU) AC_DEFINE(USER_MENU, 1, [define if you want user defined menus for applications])
fi fi
) )
+7 -11
View File
@@ -289,14 +289,11 @@ updateDockNumbers(WScreen *scr)
{ {
int length; int length;
char *ws_numbers; char *ws_numbers;
GC numbers_gc;
XGCValues my_gc_values;
unsigned long my_v_mask = (GCForeground);
WAppIcon *dicon = scr->dock->icon_array[0]; WAppIcon *dicon = scr->dock->icon_array[0];
WMColor *black, *white;
my_gc_values.foreground = scr->white_pixel; black = WMBlackColor(scr->wmscreen);
numbers_gc = XCreateGC(dpy, dicon->icon->core->window, white = WMWhiteColor(scr->wmscreen);
my_v_mask, &my_gc_values);
ws_numbers = wmalloc(20); ws_numbers = wmalloc(20);
snprintf(ws_numbers, 20, "%i [ %i ]", scr->current_workspace+1, snprintf(ws_numbers, 20, "%i [ %i ]", scr->current_workspace+1,
@@ -306,15 +303,14 @@ updateDockNumbers(WScreen *scr)
XClearArea(dpy, dicon->icon->core->window, 2, 2, 50, XClearArea(dpy, dicon->icon->core->window, 2, 2, 50,
WMFontHeight(scr->icon_title_font)+1, False); WMFontHeight(scr->icon_title_font)+1, False);
XSetForeground(dpy, numbers_gc, scr->black_pixel); WMDrawString(scr->wmscreen, dicon->icon->core->window, black,
WMDrawString(scr->wmscreen, dicon->icon->core->window, numbers_gc,
scr->icon_title_font, 4, 3, ws_numbers, length); scr->icon_title_font, 4, 3, ws_numbers, length);
XSetForeground(dpy, numbers_gc, scr->white_pixel); WMDrawString(scr->wmscreen, dicon->icon->core->window, white,
WMDrawString(scr->wmscreen, dicon->icon->core->window, numbers_gc,
scr->icon_title_font, 3, 2, ws_numbers, length); scr->icon_title_font, 3, 2, ws_numbers, length);
XFreeGC(dpy, numbers_gc); WMReleaseColor(black);
WMReleaseColor(white);
wfree(ws_numbers); wfree(ws_numbers);
} }
#endif /* WS_INDICATOR */ #endif /* WS_INDICATOR */
+17 -6
View File
@@ -34,6 +34,8 @@
#include <wraster.h> #include <wraster.h>
#include <WINGs/WINGsP.h>
#include "WindowMaker.h" #include "WindowMaker.h"
#include "screen.h" #include "screen.h"
#include "texture.h" #include "texture.h"
@@ -170,6 +172,7 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
Pixmap pixmap; Pixmap pixmap;
Pixmap mask; Pixmap mask;
WMFont *font = scr->info_text_font; WMFont *font = scr->info_text_font;
WMColor *color;
int side = 0; int side = 0;
int ty; int ty;
int bx, by; 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); 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, ty + (height - WMFontHeight(font))/2,
text, strlen(text)); text, strlen(text));
WMReleaseColor(color);
XSetWindowBackgroundPixmap(dpy, scr->balloon->window, pixmap); XSetWindowBackgroundPixmap(dpy, scr->balloon->window, pixmap);
scr->balloon->contents = pixmap; scr->balloon->contents = pixmap;
@@ -225,6 +230,7 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
XMoveWindow(dpy, scr->balloon->window, bx, by); XMoveWindow(dpy, scr->balloon->window, bx, by);
XMapRaised(dpy, scr->balloon->window); XMapRaised(dpy, scr->balloon->window);
scr->balloon->mapped = 1; scr->balloon->mapped = 1;
} }
#else /* !SHAPED_BALLOON */ #else /* !SHAPED_BALLOON */
@@ -235,6 +241,8 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
int height; int height;
Pixmap pixmap; Pixmap pixmap;
WMFont *font = scr->info_text_font; WMFont *font = scr->info_text_font;
WMColor *color;
WMPixel pixel;
if (scr->balloon->contents) if (scr->balloon->contents)
XFreePixmap(dpy, 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); pixmap = XCreatePixmap(dpy, scr->root_win, width, height, scr->w_depth);
XFillRectangle(dpy, pixmap, scr->draw_gc, 0, 0, width, height); XFillRectangle(dpy, pixmap, scr->draw_gc, 0, 0, width, height);
XSetForeground(dpy, scr->info_text_gc, scr->window_title_pixel[0]); /* ugly hack */
color = WMBlackColor(scr->wmscreen);
WMDrawString(scr->wmscreen, pixmap, scr->info_text_gc, font, pixel = color->color.pixel;
4, 2, text, strlen(text)); 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); XResizeWindow(dpy, scr->balloon->window, width, height);
XMoveWindow(dpy, scr->balloon->window, x, y); XMoveWindow(dpy, scr->balloon->window, x, y);
+11 -6
View File
@@ -51,6 +51,7 @@
#include <wraster.h> #include <wraster.h>
#include <WINGs/WINGsP.h>
#include "WindowMaker.h" #include "WindowMaker.h"
#include "wcore.h" #include "wcore.h"
@@ -2989,11 +2990,11 @@ setHightlightText(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
static int static int
setClipTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index) setClipTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index)
{ {
if (scr->clip_title_pixel[index]!=scr->white_pixel && if (scr->clip_title_color[index])
scr->clip_title_pixel[index]!=scr->black_pixel) { WMReleaseColor(scr->clip_title_color[index]);
wFreeColor(scr, scr->clip_title_pixel[index]); scr->clip_title_color[index] = WMCreateRGBColor(scr->wmscreen, color->red,
} color->green, color->blue,
scr->clip_title_pixel[index] = color->pixel; True);
#ifdef GRADIENT_CLIP_ARROW #ifdef GRADIENT_CLIP_ARROW
if (index == CLIP_NORMAL) { if (index == CLIP_NORMAL) {
@@ -3115,7 +3116,11 @@ setMenuDisabledColor(WScreen *scr, WDefaultEntry *entry, XColor *color, void *fo
static int static int
setIconTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo) setIconTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
{ {
XSetForeground(dpy, scr->icon_title_gc, color->pixel); if (scr->icon_title_color)
WMReleaseColor(scr->icon_title_color);
scr->icon_title_color = WMCreateRGBColor(scr->wmscreen, color->red,
color->green, color->blue,
True);
return REFRESH_ICON_TITLE_COLOR; return REFRESH_ICON_TITLE_COLOR;
} }
+4 -5
View File
@@ -521,12 +521,11 @@ drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
for(i=-1;i<2;i++) for(i=-1;i<2;i++)
for(j=-1;j<2;j++) for(j=-1;j<2;j++)
WMDrawString(wmscr, d, WMColorGC(whitecolor), WMDrawString(wmscr, d, whitecolor, panel->normalfont,
panel->normalfont, ofx+i, ofy+j, ofx+i, ofy+j, text, tlen);
text, tlen);
WMDrawString(wmscr, d, WMColorGC(blackcolor), panel->normalfont, WMDrawString(wmscr, d, blackcolor, panel->normalfont, ofx, ofy,
ofx, ofy, text, tlen); text, tlen);
} }
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
+18 -13
View File
@@ -56,7 +56,7 @@
#include "wsound.h" #include "wsound.h"
#include <WINGs/WUtil.h> #include <WINGs/WINGsP.h>
@@ -353,10 +353,18 @@ paintClipButtons(WAppIcon *clipIcon, Bool lpushed, Bool rpushed)
int tp = ICON_SIZE - pt; int tp = ICON_SIZE - pt;
int as = pt - 15; /* 15 = 5+5+5 */ int as = pt - 15; /* 15 = 5+5+5 */
GC gc = scr->clip_title_gc; GC gc = scr->clip_title_gc;
WMColor *color;
#ifdef GRADIENT_CLIP_ARROW #ifdef GRADIENT_CLIP_ARROW
Bool collapsed = clipIcon->dock->collapsed; Bool collapsed = clipIcon->dock->collapsed;
#endif #endif
if (!clipIcon->dock->collapsed)
color = scr->clip_title_color[CLIP_NORMAL];
else
color = scr->clip_title_color[CLIP_COLLAPSED];
XSetForeground(dpy, gc, WMColorPixel(color));
if (rpushed) { if (rpushed) {
p[0].x = tp+1; p[0].x = tp+1;
p[0].y = 1; p[0].y = 1;
@@ -1279,7 +1287,7 @@ wClipIconPaint(WAppIcon *aicon)
{ {
WScreen *scr = aicon->icon->core->screen_ptr; WScreen *scr = aicon->icon->core->screen_ptr;
WWorkspace *workspace = scr->workspaces[scr->current_workspace]; WWorkspace *workspace = scr->workspaces[scr->current_workspace];
GC gc; WMColor *color;
Window win = aicon->icon->core->window; Window win = aicon->icon->core->window;
int length, nlength; int length, nlength;
char *ws_name, ws_number[10]; char *ws_name, ws_number[10];
@@ -1293,26 +1301,24 @@ wClipIconPaint(WAppIcon *aicon)
snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1); snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1);
nlength = strlen(ws_number); nlength = strlen(ws_number);
gc = scr->clip_title_gc;
if (!workspace->clip->collapsed) if (!workspace->clip->collapsed)
XSetForeground(dpy, gc, scr->clip_title_pixel[CLIP_NORMAL]); color = scr->clip_title_color[CLIP_NORMAL];
else else
XSetForeground(dpy, gc, scr->clip_title_pixel[CLIP_COLLAPSED]); color = scr->clip_title_color[CLIP_COLLAPSED];
ty = ICON_SIZE - WMFontHeight(scr->clip_title_font) - 3; ty = ICON_SIZE - WMFontHeight(scr->clip_title_font) - 3;
tx = CLIP_BUTTON_SIZE*ICON_SIZE/64; tx = CLIP_BUTTON_SIZE*ICON_SIZE/64;
WMDrawString(scr->wmscreen, win, gc, scr->clip_title_font, tx, WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, tx,
ty, ws_name, length); ty, ws_name, length);
/*WMDrawString(scr->wmscreen, win, gc, scr->clip_title_font, 4, /*WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, 4,
2, ws_name, length);*/ 2, ws_name, length);*/
tx = (ICON_SIZE/2 - WMWidthOfString(scr->clip_title_font, ws_number, tx = (ICON_SIZE/2 - WMWidthOfString(scr->clip_title_font, ws_number,
nlength))/2; nlength))/2;
WMDrawString(scr->wmscreen, win, gc, scr->clip_title_font, tx, WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, tx,
2, ws_number, nlength); 2, ws_number, nlength);
wfree(ws_name); wfree(ws_name);
@@ -4213,11 +4219,10 @@ showClipBalloon(WDock *dock, int workspace)
XRestackWindows(dpy, stack, 2); XRestackWindows(dpy, stack, 2);
} }
XMoveWindow(dpy, scr->clip_balloon, x, y); XMoveWindow(dpy, scr->clip_balloon, x, y);
XSetForeground(dpy, scr->clip_title_gc,
scr->clip_title_pixel[CLIP_NORMAL]);
XClearWindow(dpy, scr->clip_balloon); XClearWindow(dpy, scr->clip_balloon);
WMDrawString(scr->wmscreen, scr->clip_balloon, scr->clip_title_gc, WMDrawString(scr->wmscreen, scr->clip_balloon,
scr->clip_title_font, 0, 0, text, strlen(text)); scr->clip_title_color[CLIP_NORMAL], scr->clip_title_font,
0, 0, text, strlen(text));
} }
+15 -10
View File
@@ -32,6 +32,8 @@
#include <wraster.h> #include <wraster.h>
#include <WINGs/WINGsP.h>
#include "WindowMaker.h" #include "WindowMaker.h"
#include "GNUstep.h" #include "GNUstep.h"
#include "texture.h" #include "texture.h"
@@ -65,8 +67,7 @@ WFrameWindow*
wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
int width, int height, int *clearance, int flags, int width, int height, int *clearance, int flags,
WTexture **title_texture, WTexture **resize_texture, WTexture **title_texture, WTexture **resize_texture,
unsigned long *color, unsigned long *color, WMFont **font)
GC *gc, WMFont **font)
{ {
WFrameWindow *fwin; WFrameWindow *fwin;
@@ -81,7 +82,6 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
fwin->resizebar_texture = resize_texture; fwin->resizebar_texture = resize_texture;
fwin->title_pixel = color; fwin->title_pixel = color;
fwin->title_clearance = clearance; fwin->title_clearance = clearance;
fwin->title_gc = gc;
fwin->font = font; fwin->font = font;
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
fwin->languagemode = XkbGroup1Index; fwin->languagemode = XkbGroup1Index;
@@ -1049,7 +1049,9 @@ wFrameWindowPaint(WFrameWindow *fwin)
#endif #endif
if (fwin->title) { if (fwin->title) {
char *title; char *title;
WMColor *color;
WMPixel pixel;
title = ShrinkString(*fwin->font, fwin->title, title = ShrinkString(*fwin->font, fwin->title,
fwin->titlebar->width - lofs - rofs); fwin->titlebar->width - lofs - rofs);
@@ -1073,12 +1075,15 @@ wFrameWindowPaint(WFrameWindow *fwin)
break; break;
} }
XSetForeground(dpy, *fwin->title_gc, color = WMBlackColor(scr->wmscreen);
fwin->title_pixel[fwin->flags.state]); /* ugly hack */
pixel = color->color.pixel;
WMDrawString(scr->wmscreen, fwin->titlebar->window, color->color.pixel = fwin->title_pixel[fwin->flags.state];
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE, WMDrawString(scr->wmscreen, fwin->titlebar->window, color,
title, titlelen); *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
title, titlelen);
color->color.pixel = pixel;
WMReleaseColor(color);
wfree(title); wfree(title);
} }
+1 -3
View File
@@ -82,7 +82,6 @@ typedef struct WFrameWindow {
union WTexture **title_texture; union WTexture **title_texture;
union WTexture **resizebar_texture; union WTexture **resizebar_texture;
unsigned long *title_pixel; unsigned long *title_pixel;
GC *title_gc;
WMFont **font; WMFont **font;
char *title; /* window name (title) */ char *title; /* window name (title) */
@@ -157,8 +156,7 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
int width, int height, int *clearance, int flags, int width, int height, int *clearance, int flags,
union WTexture **title_texture, union WTexture **title_texture,
union WTexture **resize_texture, union WTexture **resize_texture,
unsigned long *color, unsigned long *color, WMFont **font);
GC *gc, WMFont **font);
void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags); void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags);
+5 -16
View File
@@ -9,7 +9,8 @@ typedef struct W_GeometryView {
W_Class widgetClass; W_Class widgetClass;
WMView *view; WMView *view;
GC gc; WMColor *black;
WMColor *gray;
WMFont *font; WMFont *font;
WMSize textSize; WMSize textSize;
@@ -67,20 +68,8 @@ WCreateGeometryView(WMScreen *scr)
return NULL; return NULL;
} }
{ gview->black = WMBlackColor(scr);
WMColor *black = WMBlackColor(scr); gview->gray = WMGrayColor(scr);
WMColor *gray = WMGrayColor(scr);
XGCValues gcv;
gcv.foreground = WMColorPixel(black);
gcv.background = WMColorPixel(gray);
gview->gc = XCreateGC(WMScreenDisplay(scr), W_DRAWABLE(scr),
GCForeground|GCBackground, &gcv);
WMReleaseColor(black);
WMReleaseColor(gray);
}
WMCreateEventHandler(gview->view, ExposureMask, handleEvents, gview); WMCreateEventHandler(gview->view, ExposureMask, handleEvents, gview);
@@ -136,7 +125,7 @@ paint(WGeometryView *gview)
WMDrawImageString(W_VIEW_SCREEN(gview->view), WMDrawImageString(W_VIEW_SCREEN(gview->view),
W_VIEW_DRAWABLE(gview->view), W_VIEW_DRAWABLE(gview->view),
gview->gc, gview->font, gview->black, gview->gray, gview->font,
(W_VIEW_WIDTH(gview->view)-gview->textSize.width)/2, (W_VIEW_WIDTH(gview->view)-gview->textSize.width)/2,
(W_VIEW_HEIGHT(gview->view)-gview->textSize.height)/2, (W_VIEW_HEIGHT(gview->view)-gview->textSize.height)/2,
buffer, strlen(buffer)); buffer, strlen(buffer));
+1 -2
View File
@@ -812,7 +812,6 @@ void
wIconPaint(WIcon *icon) wIconPaint(WIcon *icon)
{ {
WScreen *scr=icon->core->screen_ptr; WScreen *scr=icon->core->screen_ptr;
GC gc = scr->icon_title_gc;
int x; int x;
char *tmp; char *tmp;
@@ -838,7 +837,7 @@ wIconPaint(WIcon *icon)
else else
x = (icon->core->width - w)/2; x = (icon->core->width - w)/2;
WMDrawString(scr->wmscreen, icon->core->window, gc, WMDrawString(scr->wmscreen, icon->core->window, scr->icon_title_color,
scr->icon_title_font, x, 1, tmp, l); scr->icon_title_font, x, 1, tmp, l);
wfree(tmp); wfree(tmp);
} }
+32 -11
View File
@@ -43,6 +43,8 @@
#include "stacking.h" #include "stacking.h"
#include "text.h" #include "text.h"
#include <WINGs/WINGsP.h>
/****** Global Variables ******/ /****** Global Variables ******/
@@ -174,7 +176,6 @@ wMenuCreate(WScreen *screen, char *title, int main_menu)
wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance, flags, wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance, flags,
screen->menu_title_texture, NULL, screen->menu_title_texture, NULL,
screen->menu_title_pixel, screen->menu_title_pixel,
&screen->menu_title_gc,
&screen->menu_title_font); &screen->menu_title_font);
menu->frame->core->descriptor.parent = menu; menu->frame->core->descriptor.parent = menu;
@@ -724,7 +725,9 @@ paintEntry(WMenu *menu, int index, int selected)
{ {
int x, y, w, h, tw; int x, y, w, h, tw;
int type; int type;
GC light, dim, dark, textGC; GC light, dim, dark, textGC, saveGC;
WMColor *color;
WMPixel pixel, savePixel;
WScreen *scr=menu->frame->screen_ptr; WScreen *scr=menu->frame->screen_ptr;
Window win = menu->menu->window; Window win = menu->menu->window;
WMenuEntry *entry=menu->entries[index]; WMenuEntry *entry=menu->entries[index];
@@ -765,24 +768,36 @@ paintEntry(WMenu *menu, int index, int selected)
} }
} }
/* very ugly hack */
saveGC = scr->wmscreen->drawStringGC;
color = WMBlackColor(scr->wmscreen);
savePixel = color->color.pixel;
if (selected) { if (selected) {
textGC = scr->select_menu_gc; textGC = scr->select_menu_gc;
if (entry->flags.enabled) if (entry->flags.enabled)
XSetForeground(dpy, textGC, scr->select_text_pixel); pixel = scr->select_text_pixel;
else else
XSetForeground(dpy, textGC, scr->dtext_pixel); pixel = scr->dtext_pixel;
} else if (!entry->flags.enabled) { } else if (!entry->flags.enabled) {
textGC = scr->disabled_menu_entry_gc; textGC = scr->disabled_menu_entry_gc;
pixel = scr->dtext_pixel;
} else { } else {
textGC = scr->menu_entry_gc; textGC = scr->menu_entry_gc;
pixel = scr->mtext_pixel;
} }
/* draw text */ /* draw text */
x = 5; x = 5;
if (entry->flags.indicator) if (entry->flags.indicator)
x += MENU_INDICATOR_SPACE + 2; x += MENU_INDICATOR_SPACE + 2;
WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font, /* this is nasty */
scr->wmscreen->drawStringGC = textGC;
color->color.pixel = pixel;
WMDrawString(scr->wmscreen, win, color, scr->menu_entry_font,
x, 3 + y + wPreferences.menu_text_clearance, entry->text, strlen(entry->text)); x, 3 + y + wPreferences.menu_text_clearance, entry->text, strlen(entry->text));
color->color.pixel = savePixel;
scr->wmscreen->drawStringGC = saveGC;
if (entry->cascade>=0) { if (entry->cascade>=0) {
/* draw the cascade indicator */ /* draw the cascade indicator */
@@ -844,12 +859,18 @@ paintEntry(WMenu *menu, int index, int selected)
/* draw right text */ /* draw right text */
if (entry->rtext && entry->cascade<0) { if (entry->rtext && entry->cascade<0) {
tw = WMWidthOfString(scr->menu_entry_font, entry->rtext,
strlen(entry->rtext));
tw = WMWidthOfString(scr->menu_entry_font, entry->rtext, /* this is nasty */
strlen(entry->rtext)); scr->wmscreen->drawStringGC = textGC;
WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font, w-6-tw, color->color.pixel = pixel;
y + 3 + wPreferences.menu_text_clearance, entry->rtext, strlen(entry->rtext)); WMDrawString(scr->wmscreen, win, color, scr->menu_entry_font, w-6-tw,
y + 3 + wPreferences.menu_text_clearance, entry->rtext, strlen(entry->rtext));
color->color.pixel = savePixel;
scr->wmscreen->drawStringGC = saveGC;
} }
WMReleaseColor(color);
} }
+26 -5
View File
@@ -42,6 +42,8 @@
#include "geomview.h" #include "geomview.h"
#include <WINGs/WINGsP.h>
#ifdef KWM_HINTS #ifdef KWM_HINTS
#include "kwm.h" #include "kwm.h"
@@ -210,11 +212,13 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
{ {
WScreen *scr = wwin->screen_ptr; WScreen *scr = wwin->screen_ptr;
Window root = scr->root_win; Window root = scr->root_win;
GC gc = scr->line_gc; GC gc = scr->line_gc, saveGC;
int ty, by, my, x, y, mx, s; int ty, by, my, x, y, mx, s;
char num[16]; char num[16];
XSegment segment[4]; XSegment segment[4];
int fw, fh; int fw, fh;
WMColor *color;
WMPixel pixel;
ty = y1 + wwin->frame->top_width; ty = y1 + wwin->frame->top_width;
by = y2 - wwin->frame->bottom_width; by = y2 - wwin->frame->bottom_width;
@@ -276,9 +280,20 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
/* XSetForeground(dpy, gc, scr->window_title_pixel[WS_UNFOCUSED]); */ /* XSetForeground(dpy, gc, scr->window_title_pixel[WS_UNFOCUSED]); */
/* Display the height. */ color = WMBlackColor(scr->wmscreen);
WMDrawString(scr->wmscreen, root, gc, scr->info_text_font, saveGC = scr->wmscreen->drawStringGC;
x - s + 3 - fw/2, my - fh/2 + 1, num, strlen(num)); pixel = color->color.pixel;
/* Display the height. */
/* ugly hack */
color->color.pixel = scr->line_pixel;
scr->wmscreen->drawStringGC = gc;
WMDrawString(scr->wmscreen, root, color, scr->info_text_font,
x - s + 3 - fw/2, my - fh/2 + 1, num, strlen(num));
scr->wmscreen->drawStringGC = saveGC;
color->color.pixel = pixel;
XSetForeground(dpy, gc, scr->line_pixel); XSetForeground(dpy, gc, scr->line_pixel);
/* horizontal geometry */ /* horizontal geometry */
if (y1 < 15) { if (y1 < 15) {
@@ -332,8 +347,14 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
/* XSetForeground(dpy, gc, scr->window_title_pixel[WS_UNFOCUSED]); */ /* XSetForeground(dpy, gc, scr->window_title_pixel[WS_UNFOCUSED]); */
/* Display the width. */ /* Display the width. */
WMDrawString(scr->wmscreen, root, gc, scr->info_text_font, /* ugly hack */
color->color.pixel = scr->line_pixel;
scr->wmscreen->drawStringGC = gc;
WMDrawString(scr->wmscreen, root, color, scr->info_text_font,
mx - fw/2 + 1, y - s - fh/2 + 1, num, strlen(num)); mx - fw/2 + 1, y - s - fh/2 + 1, num, strlen(num));
scr->wmscreen->drawStringGC = saveGC;
color->color.pixel = pixel;
WMReleaseColor(color);
} else { } else {
WSetGeometryViewShownSize(scr->gview, WSetGeometryViewShownSize(scr->gview,
(x2 - x1 - wwin->normal_hints->base_width) (x2 - x1 - wwin->normal_hints->base_width)
-3
View File
@@ -375,9 +375,6 @@ allocGCs(WScreen *scr)
gcv.graphics_exposures = False; gcv.graphics_exposures = False;
scr->window_title_gc = XCreateGC(dpy, scr->w_win,GCGraphicsExposures,&gcv); scr->window_title_gc = XCreateGC(dpy, scr->w_win,GCGraphicsExposures,&gcv);
/* icon title GC */
scr->icon_title_gc = XCreateGC(dpy, scr->w_win, GCGraphicsExposures, &gcv);
/* clip title GC */ /* clip title GC */
scr->clip_title_gc = XCreateGC(dpy, scr->w_win, GCGraphicsExposures, &gcv); scr->clip_title_gc = XCreateGC(dpy, scr->w_win, GCGraphicsExposures, &gcv);
+4 -4
View File
@@ -164,9 +164,9 @@ typedef struct _WScreen {
/* foreground colors */ /* foreground colors */
WMPixel window_title_pixel[3]; /* window titlebar text (foc, unfoc, pfoc)*/ WMPixel window_title_pixel[3]; /* window titlebar text (foc, unfoc, pfoc)*/
WMPixel menu_title_pixel[3]; /* menu titlebar text */ WMPixel menu_title_pixel[3]; /* menu titlebar text */
WMPixel clip_title_pixel[2]; /* clip title text */ WMColor *clip_title_color[2]; /* clip title text */
WMPixel mtext_pixel; /* menu item text */ WMPixel mtext_pixel; /* menu item text */
WMPixel dtext_pixel; /* disabled menu item text */ WMPixel dtext_pixel; /* disabled menu item text */
WMPixel line_pixel; WMPixel line_pixel;
WMPixel frame_border_pixel; /* frame border */ WMPixel frame_border_pixel; /* frame border */
@@ -188,7 +188,7 @@ typedef struct _WScreen {
GC window_title_gc; /* window title text GC */ GC window_title_gc; /* window title text GC */
GC menu_title_gc; /* menu titles */ GC menu_title_gc; /* menu titles */
GC icon_title_gc; /* icon title background */ WMColor *icon_title_color; /* icon title color */
GC clip_title_gc; /* clip title */ GC clip_title_gc; /* clip title */
GC menu_entry_gc; /* menu entries */ GC menu_entry_gc; /* menu entries */
GC select_menu_gc; /* selected menu entries */ GC select_menu_gc; /* selected menu entries */
+11 -5
View File
@@ -323,9 +323,10 @@ wTextDestroy( WTextInput *wtext )
\********************************************************************/ \********************************************************************/
static void static void
textRefresh( WTextInput *wtext ) textRefresh( WTextInput *wtext )
{ {
int x1,x2,y1,y2; int x1,x2,y1,y2;
char *ptr = wtext->text.txt; char *ptr = wtext->text.txt;
WMColor *black, *white;
/* x1,y1 is the upper left corner of the text box */ /* x1,y1 is the upper left corner of the text box */
x1 = wtext->xOffset; x1 = wtext->xOffset;
@@ -339,9 +340,11 @@ textRefresh( WTextInput *wtext )
XFillRectangle( dpy, wtext->core->window, wtext->invGC, XFillRectangle( dpy, wtext->core->window, wtext->invGC,
x1, y1, x2-x1, y2-y1 ); x1, y1, x2-x1, y2-y1 );
black = WMBlackColor(wtext->core->screen_ptr->wmscreen);
white = WMWhiteColor(wtext->core->screen_ptr->wmscreen);
/* Draw the text normally */ /* Draw the text normally */
WMDrawString(wtext->core->screen_ptr->wmscreen, wtext->core->window, WMDrawImageString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
wtext->regGC, wtext->font, x1, y1, ptr, wtext->text.length); black, white, wtext->font, x1, y1, ptr, wtext->text.length);
/* Draw the selected text */ /* Draw the selected text */
if( wtext->text.startPos != wtext->text.endPos ) 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 /* Draw the selected text... use invGC so it will be the
* opposite color as the filled rectangle */ * opposite color as the filled rectangle */
WMDrawString(wtext->core->screen_ptr->wmscreen, wtext->core->window, WMDrawImageString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
wtext->invGC, wtext->font, x1, y1, ptr, (ep - sp)); white, black, wtext->font, x1, y1, ptr, (ep - sp));
} }
WMReleaseColor(white);
WMReleaseColor(black);
/* And draw a quick little line for the cursor position */ /* And draw a quick little line for the cursor position */
x1 = WMWidthOfString( wtext->font, wtext->text.txt, wtext->text.endPos ) x1 = WMWidthOfString( wtext->font, wtext->text.txt, wtext->text.endPos )
+ wtext->xOffset; + wtext->xOffset;
-6
View File
@@ -474,24 +474,20 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
*/ */
if (wwin->user_flags.no_appicon && wwin->defined_user_flags.no_appicon) if (wwin->user_flags.no_appicon && wwin->defined_user_flags.no_appicon)
wwin->user_flags.emulate_appicon = 0; wwin->user_flags.emulate_appicon = 0;
/*//WSETUFLAG(wwin, emulate_appicon, 0);*/
if (wwin->main_window!=None) { if (wwin->main_window!=None) {
WApplication *wapp = wApplicationOf(wwin->main_window); WApplication *wapp = wApplicationOf(wwin->main_window);
if (wapp && !wapp->flags.emulated) if (wapp && !wapp->flags.emulated)
wwin->user_flags.emulate_appicon = 0; wwin->user_flags.emulate_appicon = 0;
/*//WSETUFLAG(wwin, emulate_appicon, 0);*/
} }
if (wwin->transient_for!=None if (wwin->transient_for!=None
&& wwin->transient_for!=wwin->screen_ptr->root_win) && wwin->transient_for!=wwin->screen_ptr->root_win)
wwin->user_flags.emulate_appicon = 0; wwin->user_flags.emulate_appicon = 0;
/*//WSETUFLAG(wwin, emulate_appicon, 0);*/
if (wwin->user_flags.sunken && wwin->defined_user_flags.sunken if (wwin->user_flags.sunken && wwin->defined_user_flags.sunken
&& wwin->user_flags.floating && wwin->defined_user_flags.floating) && wwin->user_flags.floating && wwin->defined_user_flags.floating)
wwin->user_flags.sunken = 0; wwin->user_flags.sunken = 0;
/*//WSETUFLAG(wwin, sunken, 0);*/
WSETUFLAG(wwin, no_shadeable, WFLAGP(wwin, no_titlebar)); WSETUFLAG(wwin, no_shadeable, WFLAGP(wwin, no_titlebar));
@@ -1159,7 +1155,6 @@ wManageWindow(WScreen *scr, Window window)
scr->window_title_texture, scr->window_title_texture,
scr->resizebar_texture, scr->resizebar_texture,
scr->window_title_pixel, scr->window_title_pixel,
&scr->window_title_gc,
&scr->title_font); &scr->title_font);
wwin->frame->flags.is_client_window_frame = 1; wwin->frame->flags.is_client_window_frame = 1;
@@ -1519,7 +1514,6 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
scr->window_title_texture, scr->window_title_texture,
scr->resizebar_texture, scr->resizebar_texture,
scr->window_title_pixel, scr->window_title_pixel,
&scr->window_title_gc,
&scr->title_font); &scr->title_font);
XSaveContext(dpy, window, wWinContext, (XPointer)&wwin->client_descriptor); XSaveContext(dpy, window, wWinContext, (XPointer)&wwin->client_descriptor);
+20 -6
View File
@@ -50,7 +50,7 @@
#include "kwm.h" #include "kwm.h"
#endif #endif
#include <WINGs/WUtil.h> #include <WINGs/WINGsP.h>
extern WPreferences wPreferences; extern WPreferences wPreferences;
@@ -275,6 +275,7 @@ showWorkspaceName(WScreen *scr, int workspace)
WorkspaceNameData *data; WorkspaceNameData *data;
RXImage *ximg; RXImage *ximg;
Pixmap text, mask; Pixmap text, mask;
WMColor *color;
int w, h; int w, h;
int px, py; int px, py;
char *name = scr->workspaces[workspace]->name; char *name = scr->workspaces[workspace]->name;
@@ -348,17 +349,30 @@ showWorkspaceName(WScreen *scr, int workspace)
XFillRectangle(dpy, mask, scr->mono_gc, 0, 0, w+4, h+4); XFillRectangle(dpy, mask, scr->mono_gc, 0, 0, w+4, h+4);
XSetForeground(dpy, scr->mono_gc, 1); XSetForeground(dpy, scr->mono_gc, 1);
color = WMWhiteColor(scr->wmscreen);
for (x = 0; x <= 4; x++) { for (x = 0; x <= 4; x++) {
GC saveGC = scr->wmscreen->drawStringGC;
WMPixel pixel = color->color.pixel;
/* ugly hack */
color->color.pixel = 1;
scr->wmscreen->drawStringGC = scr->mono_gc;
for (y = 0; y <= 4; y++) { for (y = 0; y <= 4; y++) {
WMDrawString(scr->wmscreen, mask, scr->mono_gc, WMDrawString(scr->wmscreen, mask, color,
scr->workspace_name_font, x, y, name, len); scr->workspace_name_font, x, y, name, len);
} }
scr->wmscreen->drawStringGC = saveGC;
color->color.pixel = pixel;
} }
XSetForeground(dpy, scr->draw_gc, scr->white_pixel); WMDrawString(scr->wmscreen, text, color, scr->workspace_name_font,
WMDrawString(scr->wmscreen, text, scr->draw_gc, scr->workspace_name_font,
2, 2, scr->workspaces[workspace]->name, 2, 2, scr->workspaces[workspace]->name,
strlen(scr->workspaces[workspace]->name)); strlen(scr->workspaces[workspace]->name));
WMReleaseColor(color);
#ifdef SHAPE #ifdef SHAPE
XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask, XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask,
ShapeSet); ShapeSet);
+4
View File
@@ -994,6 +994,9 @@ RConvertImage(RContext *context, RImage *image, Pixmap *pixmap)
} }
/* make the gc permanent (create with context creation).
* GC creation is very expensive. altering its properties is not. -Dan
*/
int int
RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap, RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap,
Pixmap *mask, int threshold) Pixmap *mask, int threshold)
@@ -1142,3 +1145,4 @@ RGetClosestXColor(RContext *context, RColor *color, XColor *retColor)
return True; return True;
} }