mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-25 10:01: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:
@@ -9,8 +9,13 @@ Changes since version 0.80.1:
|
||||
- Patch to add binary mode on opening files (needed for Windows with Cygwin)
|
||||
(sent by luke <luke@posh.optushome.com.au>)
|
||||
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
|
||||
- removed Hermes lib dependency in wrlib
|
||||
- put back asm/MMX code in wrlib
|
||||
- Removed Hermes lib dependency 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:
|
||||
|
||||
@@ -74,7 +74,7 @@ The following is required to build Window Maker:
|
||||
These tools are NOT needed, but IF you have one or
|
||||
more of them installed, make sure you have ALL of the following
|
||||
with exactly these versions:
|
||||
autoconf 2.52
|
||||
autoconf 2.54
|
||||
automake 1.4
|
||||
libtool 1.4.2
|
||||
If you have a different version, disable them by temporarily
|
||||
@@ -115,11 +115,6 @@ might work too.
|
||||
For GIF image support
|
||||
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
|
||||
If you want to use translated messages, you will need GNU gettext.
|
||||
Other versions of gettext are not compatible and will not work.
|
||||
|
||||
+2
-7
@@ -64,9 +64,9 @@ N
|
||||
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ě
|
||||
následující VERZE:
|
||||
autoconf 2.13
|
||||
autoconf 2.54
|
||||
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
|
||||
odinstalujte z vašeho systému. Pokud nebudete programovat, tak ji
|
||||
stejně nebudete potřebovat, takže ji můžete bezpečně odinstalovat.
|
||||
@@ -106,11 +106,6 @@ garantuje,
|
||||
Pro podporu GIF obrázků
|
||||
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
|
||||
Když chcete používat češtinu nebo jiné jazyky kromě angličtiny,
|
||||
tak potřebujete GNU xgettext.
|
||||
|
||||
+2
-7
@@ -78,9 +78,9 @@ Lo siguiente se necesita para compilar Window Maker:
|
||||
instaladas, asegúrese de tener TODO lo siguiente con estas versiones
|
||||
exactas:
|
||||
|
||||
autoconf 2.13
|
||||
autoconf 2.54
|
||||
automake 1.4
|
||||
libtool 1.3
|
||||
libtool 1.4.2
|
||||
|
||||
Si tiene una versión distinta, desactívelas temporalemte renombrándolas
|
||||
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.
|
||||
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
|
||||
Si quiere usar mensajes traducidos, necesitará GNU gettext.
|
||||
Otras versiones de gettext no son compatibles y no funcionarán.
|
||||
|
||||
+2
-8
@@ -77,9 +77,9 @@ Les
|
||||
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
|
||||
que les versions de ces outils sont exactement :
|
||||
autoconf 2.13
|
||||
autoconf 2.54
|
||||
automake 1.4
|
||||
libtool 1.3
|
||||
libtool 1.4.2
|
||||
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
|
||||
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.
|
||||
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
|
||||
Si vous voulez disposer des traductions en d'autres langues, GNU gettext
|
||||
est nécessaire. Les autres versions de gettext sont incompatibles et ne
|
||||
|
||||
+2
-2
@@ -68,9 +68,9 @@ Para compilar o Window Maker voc
|
||||
- autoconf, automake and libtool
|
||||
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:
|
||||
autoconf 2.13
|
||||
autoconf 2.54
|
||||
automake 1.4
|
||||
libtool 1.3
|
||||
libtool 1.4.2
|
||||
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
|
||||
software você não precisa deles, logo, você pode desinstalá-los com segurança.
|
||||
|
||||
+2
-2
@@ -71,9 +71,9 @@ Nasledovn
|
||||
- autoconf, automake a libtool
|
||||
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:
|
||||
autoconf 2.13
|
||||
autoconf 2.54
|
||||
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 neprogramujete, nebudete ich potrebova» a teda ich mô¾ete
|
||||
odin¹talova».
|
||||
|
||||
+1
-2
@@ -4,8 +4,7 @@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\
|
||||
contrib
|
||||
|
||||
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \
|
||||
Install acconfig.h INSTALL.pt README.pt\
|
||||
FAQ.I18N.cs INSTALL.cs\
|
||||
Install INSTALL.pt README.pt FAQ.I18N.cs INSTALL.cs\
|
||||
mkpatch README.KDE README.GNOME WindowMaker.lsm.in\
|
||||
README.definable-cursor \
|
||||
FAQ.I18N.sk INSTALL.sk INSTALL.es INSTALL.fr
|
||||
|
||||
@@ -4,6 +4,13 @@ Changes since wmaker 0.80.1:
|
||||
- added WMSetConnectionShutdownOnClose()
|
||||
- added an extra member to the ConnectionDelegate: canResumeSending
|
||||
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:
|
||||
............................
|
||||
|
||||
@@ -11,7 +11,7 @@ typedef struct {
|
||||
WMFont *font;
|
||||
GC gc;
|
||||
GC selGC;
|
||||
GC textGC;
|
||||
WMColor *textColor;
|
||||
} StringData;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct {
|
||||
WMFont *font;
|
||||
GC gc;
|
||||
GC selGC;
|
||||
GC textGC;
|
||||
WMColor *textColor;
|
||||
} StringEditorData;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ typedef struct {
|
||||
int count;
|
||||
GC gc;
|
||||
GC selGC;
|
||||
GC textGC;
|
||||
WMColor *textColor;
|
||||
} EnumSelectorData;
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ static char *SelectionColor = "#bbbbcc";
|
||||
|
||||
|
||||
|
||||
static void stringDraw(WMScreen *scr, Drawable d, GC gc,
|
||||
GC sgc, GC stgc, WMFont *font, void *data,
|
||||
static void stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc,
|
||||
WMColor *textColor, WMFont *font, void *data,
|
||||
WMRect rect, Bool selected)
|
||||
{
|
||||
int x, y;
|
||||
@@ -77,12 +77,12 @@ static void stringDraw(WMScreen *scr, Drawable d, GC gc,
|
||||
if (!selected) {
|
||||
XFillRectangles(dpy, d, gc, rects, 1);
|
||||
|
||||
WMDrawString(scr, d, stgc, font, x, y,
|
||||
WMDrawString(scr, d, textColor, font, x, y,
|
||||
data, strlen(data));
|
||||
} else {
|
||||
XFillRectangles(dpy, d, sgc, rects, 1);
|
||||
|
||||
WMDrawString(scr, d, stgc, font, x, y,
|
||||
WMDrawString(scr, d, textColor, font, x, y,
|
||||
data, strlen(data));
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ static void SECellPainter(WMTableColumnDelegate *self,
|
||||
WMTableView *table = WMGetTableColumnTableView(column);
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||
WMTableViewDataForCell(table, column, row),
|
||||
WMTableViewRectForCell(table, column, row),
|
||||
False);
|
||||
@@ -156,7 +156,7 @@ static void selectedSECellPainter(WMTableColumnDelegate *self,
|
||||
WMTableView *table = WMGetTableColumnTableView(column);
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||
WMTableViewDataForCell(table, column, row),
|
||||
WMTableViewRectForCell(table, column, row),
|
||||
True);
|
||||
@@ -203,9 +203,9 @@ WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *parent)
|
||||
0, 0);
|
||||
data->table = parent;
|
||||
data->font = WMSystemFontOfSize(scr, 12);
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textGC = WMColorGC(WMBlackColor(scr));
|
||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textColor = WMBlackColor(scr);
|
||||
|
||||
delegate->data = data;
|
||||
delegate->drawCell = SECellPainter;
|
||||
@@ -229,7 +229,7 @@ static void ESCellPainter(WMTableColumnDelegate *self,
|
||||
int i = (int)WMTableViewDataForCell(table, column, row);
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||
strdata->options[i],
|
||||
WMTableViewRectForCell(table, column, row),
|
||||
False);
|
||||
@@ -244,7 +244,7 @@ static void selectedESCellPainter(WMTableColumnDelegate *self,
|
||||
int i = (int)WMTableViewDataForCell(table, column, row);
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||
strdata->options[i],
|
||||
WMTableViewRectForCell(table, column, row),
|
||||
True);
|
||||
@@ -294,9 +294,9 @@ WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *parent)
|
||||
0, 0);
|
||||
data->table = parent;
|
||||
data->font = WMSystemFontOfSize(scr, 12);
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textGC = WMColorGC(WMBlackColor(scr));
|
||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textColor = WMBlackColor(scr);
|
||||
data->count = 0;
|
||||
data->options = NULL;
|
||||
|
||||
@@ -444,7 +444,7 @@ static void SCellPainter(WMTableColumnDelegate *self,
|
||||
WMTableView *table = WMGetTableColumnTableView(column);
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||
WMTableViewDataForCell(table, column, row),
|
||||
WMTableViewRectForCell(table, column, row),
|
||||
False);
|
||||
@@ -458,7 +458,7 @@ static void selectedSCellPainter(WMTableColumnDelegate *self,
|
||||
WMTableView *table = WMGetTableColumnTableView(column);
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
|
||||
WMTableViewDataForCell(table, column, row),
|
||||
WMTableViewRectForCell(table, column, row),
|
||||
True);
|
||||
@@ -473,9 +473,9 @@ WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *parent)
|
||||
|
||||
data->table = parent;
|
||||
data->font = WMSystemFontOfSize(scr, 12);
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textGC = WMColorGC(WMBlackColor(scr));
|
||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textColor = WMBlackColor(scr);
|
||||
|
||||
delegate->data = data;
|
||||
delegate->drawCell = SCellPainter;
|
||||
@@ -525,8 +525,8 @@ WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView *table)
|
||||
StringData *data = wmalloc(sizeof(StringData));
|
||||
|
||||
data->table = table;
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
|
||||
delegate->data = data;
|
||||
delegate->drawCell = PCellPainter;
|
||||
@@ -574,9 +574,8 @@ static void drawPSCell(WMTableColumnDelegate *self, Drawable d,
|
||||
rect.size.width = owidth-size.width+1;
|
||||
}
|
||||
|
||||
stringDraw(WMWidgetScreen(table), d,
|
||||
strdata->gc, strdata->selGC, strdata->textGC, strdata->font,
|
||||
str, rect, selected);
|
||||
stringDraw(WMWidgetScreen(table), d, strdata->gc, strdata->selGC,
|
||||
strdata->textColor, strdata->font, str, rect, selected);
|
||||
}
|
||||
|
||||
|
||||
@@ -602,9 +601,9 @@ WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent)
|
||||
|
||||
data->table = parent;
|
||||
data->font = WMSystemFontOfSize(scr, 12);
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textGC = WMColorGC(WMBlackColor(scr));
|
||||
data->gc = WMColorGC(WMWhiteColor(scr));
|
||||
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
|
||||
data->textColor = WMBlackColor(scr);
|
||||
|
||||
delegate->data = data;
|
||||
delegate->drawCell = PSCellPainter;
|
||||
@@ -614,3 +613,5 @@ WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent)
|
||||
|
||||
return delegate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ paintMyWidget(_MyWidget *mPtr)
|
||||
color = WMWhiteColor(scr);
|
||||
|
||||
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));
|
||||
|
||||
WMReleaseColor(color);
|
||||
|
||||
+11
-4
@@ -804,8 +804,14 @@ WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
|
||||
unsigned short green, unsigned short blue,
|
||||
Bool exact);
|
||||
|
||||
WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
|
||||
unsigned short green, unsigned short blue,
|
||||
unsigned short alpha, Bool exact);
|
||||
|
||||
WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
|
||||
|
||||
void WMSetColorAlpha(WMColor *color, unsigned short alpha);
|
||||
|
||||
unsigned short WMRedComponentOfColor(WMColor *color);
|
||||
|
||||
unsigned short WMGreenComponentOfColor(WMColor *color);
|
||||
@@ -817,11 +823,12 @@ char* WMGetColorRGBDescription(WMColor *color);
|
||||
/* ....................................................................... */
|
||||
|
||||
|
||||
void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
|
||||
int y, char *text, int length);
|
||||
void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
||||
int x, int y, char *text, int length);
|
||||
|
||||
void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
|
||||
int y, char *text, int length);
|
||||
void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
|
||||
WMColor *background, WMFont *font, int x, int y,
|
||||
char *text, int length);
|
||||
|
||||
int WMWidthOfString(WMFont *font, char *text, int length);
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ typedef struct W_Color {
|
||||
struct W_Screen *screen;
|
||||
|
||||
XColor color;
|
||||
unsigned short alpha;
|
||||
short refCount;
|
||||
GC gc;
|
||||
struct {
|
||||
@@ -183,7 +184,9 @@ typedef struct W_Screen {
|
||||
|
||||
GC ixorGC; /* IncludeInferiors XOR */
|
||||
|
||||
GC textFieldGC;
|
||||
GC drawStringGC; /* for WMDrawString() */
|
||||
|
||||
GC drawImStringGC; /* for WMDrawImageString() */
|
||||
|
||||
W_Font *normalFont;
|
||||
|
||||
@@ -488,13 +491,13 @@ void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
|
||||
|
||||
void W_CallDestroyHandlers(W_View *view);
|
||||
|
||||
void W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
|
||||
WMReliefType relief, char *text,
|
||||
void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
|
||||
W_Font *font, WMReliefType relief, char *text,
|
||||
WMAlignment alignment, W_Pixmap *image,
|
||||
WMImagePosition position, GC backGC, int ofs);
|
||||
WMImagePosition position, WMColor *backColor, int ofs);
|
||||
|
||||
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
|
||||
int width, WMAlignment alignment, GC gc,
|
||||
int width, WMAlignment alignment, WMColor *color,
|
||||
int wrap, char *text, int length);
|
||||
|
||||
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);
|
||||
|
||||
+1
-1
@@ -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,
|
||||
width, bPtr->flags.alignment,
|
||||
WMColorGC(bPtr->textColor ? bPtr->textColor : scr->black),
|
||||
bPtr->textColor ? bPtr->textColor : scr->black,
|
||||
False, text, strlen(text));
|
||||
|
||||
XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap);
|
||||
|
||||
+4
-4
@@ -280,13 +280,13 @@ drawTitleOfColumn(WMBrowser *bPtr, int column)
|
||||
&titleLen, widthC);
|
||||
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
|
||||
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
|
||||
bPtr->columnSize.width, WACenter, WMColorGC(scr->white),
|
||||
bPtr->columnSize.width, WACenter, scr->white,
|
||||
False, titleBuf, titleLen);
|
||||
wfree (titleBuf);
|
||||
} else {
|
||||
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
|
||||
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
|
||||
bPtr->columnSize.width, WACenter, WMColorGC(scr->white),
|
||||
bPtr->columnSize.width, WACenter, scr->white,
|
||||
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) {
|
||||
char *textBuf = createTruncatedString(font, text, &textLen, 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);
|
||||
} else {
|
||||
W_PaintText(view, d, font, x+4, y, widthC,
|
||||
WALeft, WMColorGC(scr->black), False, text, textLen);
|
||||
WALeft, scr->black, False, text, textLen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -612,9 +612,9 @@ paintButton(Button *bPtr)
|
||||
char *caption;
|
||||
WMPixmap *image;
|
||||
WMColor *textColor;
|
||||
GC gc;
|
||||
WMColor *backColor;
|
||||
|
||||
gc = NULL;
|
||||
backColor = NULL;
|
||||
caption = bPtr->caption;
|
||||
|
||||
if (bPtr->flags.enabled) {
|
||||
@@ -637,7 +637,7 @@ paintButton(Button *bPtr)
|
||||
|
||||
if (bPtr->flags.selected) {
|
||||
if (bPtr->flags.stateLight) {
|
||||
gc = WMColorGC(scrPtr->white);
|
||||
backColor = scrPtr->white;
|
||||
textColor = scrPtr->black;
|
||||
}
|
||||
|
||||
@@ -662,7 +662,7 @@ paintButton(Button *bPtr)
|
||||
offset = 1;
|
||||
}
|
||||
if (bPtr->flags.pushLight) {
|
||||
gc = WMColorGC(scrPtr->white);
|
||||
backColor = scrPtr->white;
|
||||
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),
|
||||
relief, caption, bPtr->flags.alignment, image,
|
||||
bPtr->flags.imagePosition, gc, offset);
|
||||
bPtr->flags.imagePosition, backColor, offset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+41
-14
@@ -16,8 +16,9 @@ static unsigned char DARK_STIPPLE_BITS[] = {
|
||||
0x0a, 0x04, 0x0a, 0x01};
|
||||
|
||||
|
||||
static WMColor *createRGBColor(WMScreen *scr, unsigned short red,
|
||||
unsigned short green, unsigned short blue);
|
||||
static WMColor *createRGBAColor(WMScreen *scr, unsigned short red,
|
||||
unsigned short green, unsigned short blue,
|
||||
unsigned short alpha);
|
||||
|
||||
/*
|
||||
* 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*
|
||||
findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
unsigned short blue)
|
||||
unsigned short blue, unsigned short alpha)
|
||||
{
|
||||
WMColor *color;
|
||||
XColor xcolor;
|
||||
@@ -37,6 +38,7 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
rcolor.red = red>>8;
|
||||
rcolor.green = green>>8;
|
||||
rcolor.blue = blue>>8;
|
||||
rcolor.alpha = alpha>>8;
|
||||
|
||||
if (!RGetClosestXColor(scr->rcontext, &rcolor, &xcolor))
|
||||
return NULL;
|
||||
@@ -49,6 +51,7 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
color->screen = scr;
|
||||
color->refCount = 1;
|
||||
color->color = xcolor;
|
||||
color->alpha = alpha;
|
||||
color->flags.exact = 1;
|
||||
color->gc = NULL;
|
||||
|
||||
@@ -58,8 +61,8 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
|
||||
|
||||
static WMColor*
|
||||
createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
unsigned short blue)
|
||||
createRGBAColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
unsigned short blue, unsigned short alpha)
|
||||
{
|
||||
WMColor *color;
|
||||
XColor xcolor;
|
||||
@@ -76,6 +79,7 @@ createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
color->screen = scr;
|
||||
color->refCount = 1;
|
||||
color->color = xcolor;
|
||||
color->alpha = alpha;
|
||||
color->flags.exact = 1;
|
||||
color->gc = NULL;
|
||||
|
||||
@@ -83,15 +87,30 @@ createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
}
|
||||
|
||||
|
||||
|
||||
WMColor*
|
||||
WMCreateRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
|
||||
unsigned short blue, Bool exact)
|
||||
{
|
||||
WMColor *color = NULL;
|
||||
|
||||
if (!exact || !(color=createRGBColor(scr, red, green, blue))) {
|
||||
color = findCloseColor(scr, red, green, blue);
|
||||
if (!exact || !(color=createRGBAColor(scr, red, green, blue, 0xffff))) {
|
||||
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)
|
||||
color = WMBlackColor(scr);
|
||||
@@ -112,9 +131,9 @@ WMCreateNamedColor(WMScreen *scr, char *name, Bool exact)
|
||||
if (scr->visual->class == TrueColor)
|
||||
exact = True;
|
||||
|
||||
if (!exact || !(color=createRGBColor(scr, xcolor.red, xcolor.green,
|
||||
xcolor.blue))) {
|
||||
color = findCloseColor(scr, xcolor.red, xcolor.green, xcolor.blue);
|
||||
if (!exact || !(color=createRGBAColor(scr, xcolor.red, xcolor.green,
|
||||
xcolor.blue, 0xffff))) {
|
||||
color = findCloseColor(scr, xcolor.red, xcolor.green, xcolor.blue, 0xffff);
|
||||
}
|
||||
return color;
|
||||
}
|
||||
@@ -147,6 +166,13 @@ WMReleaseColor(WMColor *color)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetColorAlpha(WMColor *color, unsigned short alpha)
|
||||
{
|
||||
color->alpha = alpha;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
|
||||
unsigned int width, unsigned int height)
|
||||
@@ -201,7 +227,6 @@ WMWhiteColor(WMScreen *scr)
|
||||
}
|
||||
|
||||
|
||||
|
||||
WMColor*
|
||||
WMBlackColor(WMScreen *scr)
|
||||
{
|
||||
@@ -231,7 +256,7 @@ WMGrayColor(WMScreen *scr)
|
||||
LIGHT_STIPPLE_BITS, LIGHT_STIPPLE_WIDTH,
|
||||
LIGHT_STIPPLE_HEIGHT);
|
||||
|
||||
color = createRGBColor(scr, 0xffff, 0xffff, 0xffff);
|
||||
color = createRGBAColor(scr, 0xffff, 0xffff, 0xffff, 0xffff);
|
||||
|
||||
gcv.foreground = white->color.pixel;
|
||||
gcv.background = black->color.pixel;
|
||||
@@ -272,7 +297,7 @@ WMDarkGrayColor(WMScreen *scr)
|
||||
DARK_STIPPLE_BITS, DARK_STIPPLE_WIDTH,
|
||||
DARK_STIPPLE_HEIGHT);
|
||||
|
||||
color = createRGBColor(scr, 0, 0, 0);
|
||||
color = createRGBAColor(scr, 0, 0, 0, 0xffff);
|
||||
|
||||
gcv.foreground = white->color.pixel;
|
||||
gcv.background = black->color.pixel;
|
||||
@@ -327,3 +352,5 @@ WMGetColorRGBDescription(WMColor *color)
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+22
-28
@@ -605,7 +605,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (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")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
@@ -681,8 +681,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Red"),
|
||||
strlen(_("Red")));
|
||||
2, 0, 100, WALeft, scrPtr->white, False, _("Red"),
|
||||
strlen(_("Red")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -714,8 +714,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Green"),
|
||||
strlen(_("Green")));
|
||||
2, 0, 100, WALeft, scrPtr->white, False, _("Green"),
|
||||
strlen(_("Green")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -748,8 +748,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Blue"),
|
||||
strlen(_("Blue")));
|
||||
2, 0, 100, WALeft, scrPtr->white, False, _("Blue"),
|
||||
strlen(_("Blue")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -808,8 +808,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Cyan"),
|
||||
strlen(_("Cyan")));
|
||||
2, 0, 100, WALeft, scrPtr->black, False, _("Cyan"),
|
||||
strlen(_("Cyan")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -842,8 +842,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Magenta"),
|
||||
strlen(_("Magenta")));
|
||||
2, 0, 100, WALeft, scrPtr->black, False, _("Magenta"),
|
||||
strlen(_("Magenta")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -876,8 +876,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Yellow"),
|
||||
strlen(_("Yellow")));
|
||||
2, 0, 100, WALeft, scrPtr->black, False, _("Yellow"),
|
||||
strlen(_("Yellow")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -911,8 +911,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
|
||||
|
||||
if (pixmap)
|
||||
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12,
|
||||
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Black"),
|
||||
strlen(_("Black")));
|
||||
2, 0, 100, WALeft, scrPtr->black, False, _("Black"),
|
||||
strlen(_("Black")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
|
||||
@@ -2824,7 +2824,7 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
|
||||
|
||||
if (sliderPxmp)
|
||||
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")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
@@ -2859,8 +2859,8 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
|
||||
|
||||
if (sliderPxmp)
|
||||
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap,
|
||||
panel->font12, 2, 0, 100, WALeft,
|
||||
WMColorGC(from.hsv.value < 128 ? scr->white : scr->black), False,
|
||||
panel->font12, 2, 0, 100, WALeft,
|
||||
from.hsv.value < 128 ? scr->white : scr->black, False,
|
||||
_("Saturation"), strlen(_("Saturation")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
@@ -2895,8 +2895,8 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
|
||||
|
||||
if (sliderPxmp)
|
||||
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap,
|
||||
panel->font12, 2, 0, 100, WALeft,
|
||||
WMColorGC(hsvcolor.value < 128 ? scr->white : scr->black), False,
|
||||
panel->font12, 2, 0, 100, WALeft,
|
||||
hsvcolor.value < 128 ? scr->white : scr->black, False,
|
||||
_("Hue"), strlen(_("Hue")));
|
||||
else
|
||||
wwarning(_("Color Panel: Could not allocate memory"));
|
||||
@@ -3427,8 +3427,6 @@ colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
|
||||
WMScreen *scr = WMWidgetScreen(lPtr);
|
||||
Display *dpy = WMScreenDisplay(scr);
|
||||
W_ColorPanel *panel = WMGetHangedData(lPtr);
|
||||
WMColor *white = WMWhiteColor(scr);
|
||||
WMColor *black = WMBlackColor(scr);
|
||||
WMColor *fillColor;
|
||||
|
||||
width = rect->size.width;
|
||||
@@ -3437,7 +3435,7 @@ colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
|
||||
y = rect->pos.y;
|
||||
|
||||
if (state & WLDSSelected)
|
||||
WMPaintColorSwatch(white, d, x +15, y, width -15, height);
|
||||
WMPaintColorSwatch(scr->white, d, x +15, y, width -15, height);
|
||||
else
|
||||
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);
|
||||
WMReleaseColor(fillColor);
|
||||
|
||||
WMDrawString(scr, d, WMColorGC(black), panel->font12, x+18, y, text,
|
||||
strlen(text));
|
||||
|
||||
WMReleaseColor(white);
|
||||
WMReleaseColor(black);
|
||||
WMDrawString(scr, d, scr->black, panel->font12, x+18, y, text, strlen(text));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+17
-12
@@ -387,33 +387,38 @@ WMWidthOfString(WMFont *font, char *text, int length)
|
||||
|
||||
|
||||
void
|
||||
WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, int y,
|
||||
char *text, int length)
|
||||
WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
||||
int x, int y, char *text, int length)
|
||||
{
|
||||
wassertr(font!=NULL);
|
||||
|
||||
XSetForeground(scr->display, scr->drawStringGC, W_PIXEL(color));
|
||||
if (font->notFontSet) {
|
||||
XSetFont(scr->display, gc, font->font.normal->fid);
|
||||
XDrawString(scr->display, d, gc, x, y + font->y, text, length);
|
||||
XSetFont(scr->display, scr->drawStringGC, font->font.normal->fid);
|
||||
XDrawString(scr->display, d, scr->drawStringGC, x, y + font->y, text,
|
||||
length);
|
||||
} else {
|
||||
XmbDrawString(scr->display, d, font->font.set, gc, x, y + font->y,
|
||||
text, length);
|
||||
XmbDrawString(scr->display, d, font->font.set, scr->drawStringGC,
|
||||
x, y + font->y, text, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, int y,
|
||||
char *text, int length)
|
||||
WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color, WMColor *background,
|
||||
WMFont *font, int x, int y, char *text, int length)
|
||||
{
|
||||
wassertr(font != NULL);
|
||||
|
||||
XSetForeground(scr->display, scr->drawImStringGC, W_PIXEL(color));
|
||||
XSetBackground(scr->display, scr->drawImStringGC, W_PIXEL(background));
|
||||
if (font->notFontSet) {
|
||||
XSetFont(scr->display, gc, font->font.normal->fid);
|
||||
XDrawImageString(scr->display, d, gc, x, y + font->y, text, length);
|
||||
XSetFont(scr->display, scr->drawImStringGC, font->font.normal->fid);
|
||||
XDrawImageString(scr->display, d, scr->drawImStringGC, x, y + font->y,
|
||||
text, length);
|
||||
} else {
|
||||
XmbDrawImageString(scr->display, d, font->font.set, gc, x, y + font->y,
|
||||
text, length);
|
||||
XmbDrawImageString(scr->display, d, font->font.set, scr->drawImStringGC,
|
||||
x, y + font->y, text, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -193,9 +193,8 @@ paintFrame(Frame *fPtr)
|
||||
}
|
||||
|
||||
if (drawTitle) {
|
||||
WMDrawString(scrPtr, view->window, WMColorGC(scrPtr->black),
|
||||
scrPtr->normalFont, tx, ty, fPtr->caption,
|
||||
strlen(fPtr->caption));
|
||||
WMDrawString(scrPtr, view->window, scrPtr->black, scrPtr->normalFont,
|
||||
tx, ty, fPtr->caption, strlen(fPtr->caption));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -727,7 +727,6 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
scrPtr->clipGC = XCreateGC(display, W_DRAWABLE(scrPtr), GCFunction
|
||||
|GCGraphicsExposures, &gcv);
|
||||
|
||||
|
||||
stipple = XCreateBitmapFromData(display, W_DRAWABLE(scrPtr),
|
||||
STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT);
|
||||
gcv.foreground = W_PIXEL(scrPtr->darkGray);
|
||||
@@ -738,10 +737,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
GCForeground|GCBackground|GCStipple
|
||||
|GCFillStyle|GCGraphicsExposures, &gcv);
|
||||
|
||||
gcv.foreground = W_PIXEL(scrPtr->black);
|
||||
gcv.background = W_PIXEL(scrPtr->white);
|
||||
scrPtr->textFieldGC = XCreateGC(display, W_DRAWABLE(scrPtr),
|
||||
GCForeground|GCBackground, &gcv);
|
||||
scrPtr->drawStringGC = XCreateGC(display, W_DRAWABLE(scrPtr),
|
||||
GCGraphicsExposures, &gcv);
|
||||
scrPtr->drawImStringGC = XCreateGC(display, W_DRAWABLE(scrPtr),
|
||||
GCGraphicsExposures, &gcv);
|
||||
|
||||
/* we need a 1bpp drawable for the monoGC, so borrow this one */
|
||||
scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL);
|
||||
|
||||
+2
-7
@@ -205,14 +205,9 @@ static void
|
||||
paintLabel(Label *lPtr)
|
||||
{
|
||||
W_Screen *scrPtr = lPtr->view->screen;
|
||||
GC gc;
|
||||
|
||||
if (lPtr->textColor)
|
||||
gc = WMColorGC(lPtr->textColor);
|
||||
else
|
||||
gc = WMColorGC(scrPtr->black);
|
||||
|
||||
W_PaintTextAndImage(lPtr->view, !lPtr->flags.noWrap, gc,
|
||||
W_PaintTextAndImage(lPtr->view, !lPtr->flags.noWrap,
|
||||
lPtr->textColor ? lPtr->textColor : scrPtr->black,
|
||||
(lPtr->font!=NULL ? lPtr->font : scrPtr->normalFont),
|
||||
lPtr->flags.relief, lPtr->caption,
|
||||
lPtr->flags.alignment, lPtr->image,
|
||||
|
||||
+1
-1
@@ -530,7 +530,7 @@ paintItem(List *lPtr, int index)
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -154,7 +154,7 @@ W_GetTextHeight(WMFont *font, char *text, int width, int wrap)
|
||||
|
||||
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)
|
||||
{
|
||||
char *ptr = text;
|
||||
@@ -174,7 +174,7 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
|
||||
else
|
||||
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')
|
||||
y += fheight;
|
||||
@@ -191,10 +191,10 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
|
||||
|
||||
|
||||
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,
|
||||
WMAlignment alignment, W_Pixmap *image,
|
||||
WMImagePosition position, GC backGC, int ofs)
|
||||
WMImagePosition position, WMColor *backColor, int ofs)
|
||||
{
|
||||
W_Screen *screen = view->screen;
|
||||
int ix, iy;
|
||||
@@ -209,15 +209,15 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
|
||||
|
||||
/* background */
|
||||
#ifndef DOUBLE_BUFFER
|
||||
if (backGC) {
|
||||
XFillRectangle(screen->display, d, backGC,
|
||||
if (backColor) {
|
||||
XFillRectangle(screen->display, d, WMColorGC(backColor),
|
||||
0, 0, view->size.width, view->size.height);
|
||||
} else {
|
||||
XClearWindow(screen->display, d);
|
||||
}
|
||||
#else
|
||||
if (backGC)
|
||||
XFillRectangle(screen->display, d, backGC, 0, 0,
|
||||
if (backColor)
|
||||
XFillRectangle(screen->display, d, WMColorGC(backColor), 0, 0,
|
||||
view->size.width, view->size.height);
|
||||
else {
|
||||
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);
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ paintPopUpButton(PopUpButton *bPtr)
|
||||
W_PaintText(bPtr->view, pixmap, scr->normalFont, 6,
|
||||
(bPtr->view->size.height-WMFontHeight(scr->normalFont))/2,
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ paintMenuEntry(PopUpButton *bPtr, int index, int highlight)
|
||||
width, itemHeight, WRRaised);
|
||||
|
||||
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));
|
||||
|
||||
if (!bPtr->flags.pullsDown && index == bPtr->selectedItemIndex) {
|
||||
@@ -457,7 +457,7 @@ makeMenuPixmap(PopUpButton *bPtr)
|
||||
|
||||
i = 0;
|
||||
WM_ITERATE_ARRAY(bPtr->items, item, iter) {
|
||||
GC gc;
|
||||
WMColor *color;
|
||||
char *text;
|
||||
|
||||
text = WMGetMenuItemTitle(item);
|
||||
@@ -466,12 +466,12 @@ makeMenuPixmap(PopUpButton *bPtr)
|
||||
WRRaised);
|
||||
|
||||
if (!WMGetMenuItemEnabled(item))
|
||||
gc = WMColorGC(scr->darkGray);
|
||||
color = scr->darkGray;
|
||||
else
|
||||
gc = WMColorGC(scr->black);
|
||||
color = scr->black;
|
||||
|
||||
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));
|
||||
|
||||
if (!bPtr->flags.pullsDown && i == bPtr->selectedItemIndex) {
|
||||
|
||||
+40
-41
@@ -33,7 +33,8 @@ typedef struct W_Ruler {
|
||||
WMAction *releaseAction; /* what to do when released */
|
||||
void *clientData;
|
||||
|
||||
GC fg, bg;
|
||||
WMColor *fg;
|
||||
GC fgGC, bgGC;
|
||||
WMFont *font;
|
||||
WMRulerMargins margins;
|
||||
int offset;
|
||||
@@ -68,11 +69,10 @@ static void
|
||||
drawLeftMarker(Ruler * rPtr)
|
||||
{
|
||||
XPoint points[4];
|
||||
int xpos = (rPtr->flags.whichMarker == 1 ?
|
||||
rPtr->motion : rPtr->margins.left);
|
||||
int xpos = (rPtr->flags.whichMarker==1 ? rPtr->motion : rPtr->margins.left);
|
||||
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, xpos, 8, xpos, 22);
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
xpos, 8, xpos, 22);
|
||||
points[0].x = xpos;
|
||||
points[0].y = 1;
|
||||
points[1].x = points[0].x + 6;
|
||||
@@ -81,8 +81,8 @@ drawLeftMarker(Ruler * rPtr)
|
||||
points[2].y = 9;
|
||||
points[3].x = points[0].x;
|
||||
points[3].y = 9;
|
||||
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, points, 4, Convex, CoordModeOrigin);
|
||||
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
points, 4, Convex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,10 @@ drawLeftMarker(Ruler * rPtr)
|
||||
static void drawRightMarker(Ruler * rPtr)
|
||||
{
|
||||
XPoint points[4];
|
||||
int xpos = (rPtr->flags.whichMarker == 2 ?
|
||||
rPtr->motion : rPtr->margins.right);
|
||||
int xpos = (rPtr->flags.whichMarker==2 ? rPtr->motion : rPtr->margins.right);
|
||||
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, xpos, 8, xpos, 22);
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
xpos, 8, xpos, 22);
|
||||
points[0].x = xpos + 1;
|
||||
points[0].y = 0;
|
||||
points[1].x = points[0].x - 6;
|
||||
@@ -111,8 +110,8 @@ static void drawRightMarker(Ruler * rPtr)
|
||||
points[2].y = 9;
|
||||
points[3].x = points[0].x;
|
||||
points[3].y = 9;
|
||||
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, points, 4, Convex, CoordModeOrigin);
|
||||
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
points, 4, Convex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,10 +126,10 @@ static void drawFirstMarker(Ruler * rPtr)
|
||||
int xpos = ((rPtr->flags.whichMarker == 3 || rPtr->flags.whichMarker == 6) ?
|
||||
rPtr->motion : rPtr->margins.first);
|
||||
|
||||
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, xpos - 5, 10, 11, 5);
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, xpos, 12, xpos, 22);
|
||||
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
xpos - 5, 10, 11, 5);
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
xpos, 12, xpos, 22);
|
||||
}
|
||||
|
||||
/* Marker for rest of body
|
||||
@@ -150,8 +149,8 @@ static void drawBodyMarker(Ruler * rPtr)
|
||||
points[1].y = 16;
|
||||
points[2].x = points[0].x + 5;
|
||||
points[2].y = 22;
|
||||
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, points, 3, Convex, CoordModeOrigin);
|
||||
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
points, 3, Convex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +166,7 @@ static void createDrawBuffer(Ruler * rPtr)
|
||||
rPtr->view->window, rPtr->view->size.width, 40,
|
||||
rPtr->view->screen->depth);
|
||||
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;
|
||||
char c[3];
|
||||
int marks[9] =
|
||||
{11, 3, 5, 3, 7, 3, 5, 3};
|
||||
int marks[9] = {11, 3, 5, 3, 7, 3, 5, 3};
|
||||
|
||||
if (!rPtr->drawBuffer || !rPtr->view->flags.realized)
|
||||
return;
|
||||
|
||||
|
||||
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,
|
||||
rPtr->font, rPtr->margins.left + 2, 26, _("0 inches"), 10);
|
||||
@@ -192,26 +190,26 @@ static void drawRulerOnPixmap(Ruler * rPtr)
|
||||
i = j = m = 0;
|
||||
w = rPtr->view->size.width - rPtr->margins.left;
|
||||
while (m < w) {
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fg, rPtr->margins.left + m, 23,
|
||||
rPtr->margins.left + m, marks[i % 8] + 23);
|
||||
if (i != 0 && i % 8 == 0) {
|
||||
if (j < 10)
|
||||
snprintf(c, 3, "%d", ++j);
|
||||
else
|
||||
snprintf(c, 3, "%2d", ++j);
|
||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
|
||||
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
|
||||
}
|
||||
m = (++i) * 10;
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->fgGC, rPtr->margins.left + m, 23,
|
||||
rPtr->margins.left + m, marks[i % 8] + 23);
|
||||
if (i != 0 && i % 8 == 0) {
|
||||
if (j < 10)
|
||||
snprintf(c, 3, "%d", ++j);
|
||||
else
|
||||
snprintf(c, 3, "%2d", ++j);
|
||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
|
||||
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
|
||||
}
|
||||
m = (++i) * 10;
|
||||
}
|
||||
|
||||
rPtr->end = rPtr->margins.left + m - 10;
|
||||
if (rPtr->margins.right > rPtr->end)
|
||||
rPtr->margins.right = rPtr->end;
|
||||
/* base line */
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fg,
|
||||
rPtr->margins.left, 22, rPtr->margins.left + m - 10, 22);
|
||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
|
||||
rPtr->margins.left, 22, rPtr->margins.left + m - 10, 22);
|
||||
|
||||
drawLeftMarker(rPtr);
|
||||
drawRightMarker(rPtr);
|
||||
@@ -230,8 +228,8 @@ static void paintRuler(Ruler * rPtr)
|
||||
if (rPtr->flags.redraw)
|
||||
drawRulerOnPixmap(rPtr);
|
||||
XCopyArea(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||
rPtr->view->window, rPtr->bg, 0, 0, rPtr->view->size.width, 40,
|
||||
0, 0);
|
||||
rPtr->view->window, rPtr->bgGC, 0, 0,
|
||||
rPtr->view->size.width, 40, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -447,8 +445,9 @@ WMCreateRuler(WMWidget * parent)
|
||||
|
||||
rPtr->view->delegate = &_RulerViewDelegate;
|
||||
|
||||
rPtr->bg = WMColorGC(WMGrayColor(rPtr->view->screen));
|
||||
rPtr->fg = WMColorGC(WMBlackColor(rPtr->view->screen));
|
||||
rPtr->fg = WMBlackColor(rPtr->view->screen);
|
||||
rPtr->fgGC = WMColorGC(rPtr->fg);
|
||||
rPtr->bgGC = WMColorGC(WMGrayColor(rPtr->view->screen));
|
||||
rPtr->font = WMSystemFontOfSize(rPtr->view->screen, 8);
|
||||
|
||||
rPtr->offset = 22;
|
||||
|
||||
+1
-1
@@ -882,7 +882,7 @@ W_DrawLabel(WMTabViewItem *item, Drawable d, WMRect rect, Bool enabled)
|
||||
if (!item->label)
|
||||
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->label, strlen(item->label));
|
||||
}
|
||||
|
||||
+38
-62
@@ -106,8 +106,9 @@ typedef struct W_Text {
|
||||
WMColor *dColor; /* the default color */
|
||||
WMPixmap *dBulletPix; /* the default pixmap for bullets */
|
||||
|
||||
GC bgGC; /* the background GC to draw with */
|
||||
GC fgGC; /* the foreground GC to draw with */
|
||||
WMColor *fgColor; /* The current foreground color */
|
||||
WMColor *bgColor; /* The background color */
|
||||
|
||||
GC stippledGC; /* the GC to overlay selected graphics with */
|
||||
Pixmap db; /* the buffer on which to draw */
|
||||
WMPixmap *bgPixmap; /* the background pixmap */
|
||||
@@ -648,7 +649,6 @@ paintText(Text *tPtr)
|
||||
{
|
||||
TextBlock *tb;
|
||||
WMFont *font;
|
||||
GC gc, greyGC;
|
||||
char *text;
|
||||
int len, y, c, s, done=False, prev_y=-23, dir /* 1 = down */;
|
||||
WMScreen *scr = tPtr->view->screen;
|
||||
@@ -660,8 +660,8 @@ paintText(Text *tPtr)
|
||||
return;
|
||||
|
||||
|
||||
XFillRectangle(dpy, tPtr->db, tPtr->bgGC,
|
||||
0, 0, tPtr->visible.w, tPtr->visible.h);
|
||||
XFillRectangle(dpy, tPtr->db, WMColorGC(tPtr->bgColor), 0, 0,
|
||||
tPtr->visible.w, tPtr->visible.h);
|
||||
|
||||
if (tPtr->bgPixmap) {
|
||||
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;
|
||||
|
||||
|
||||
@@ -721,8 +715,6 @@ _getSibling:
|
||||
|
||||
/* first, place all text that can be viewed */
|
||||
while (!done && tb) {
|
||||
|
||||
|
||||
if (tb->graphic) {
|
||||
tb = tb->next;
|
||||
continue;
|
||||
@@ -742,10 +734,10 @@ _getSibling:
|
||||
|
||||
if (tPtr->flags.monoFont) {
|
||||
font = tPtr->dFont;
|
||||
gc = tPtr->fgGC;
|
||||
color = tPtr->fgColor;
|
||||
} else {
|
||||
font = tb->d.font;
|
||||
gc = WMColorGC(tb->color);
|
||||
color = tb->color;
|
||||
}
|
||||
|
||||
if (tPtr->flags.ownsSelection) {
|
||||
@@ -753,7 +745,7 @@ _getSibling:
|
||||
|
||||
if ( sectionWasSelected(tPtr, tb, &rect, s)) {
|
||||
tb->selected = True;
|
||||
XFillRectangle(dpy, tPtr->db, greyGC,
|
||||
XFillRectangle(dpy, tPtr->db, WMColorGC(scr->gray),
|
||||
rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
}
|
||||
@@ -763,21 +755,18 @@ _getSibling:
|
||||
len = tb->sections[s].end - tb->sections[s].begin;
|
||||
text = &(tb->text[tb->sections[s].begin]);
|
||||
y = tb->sections[s].y - tPtr->vpos;
|
||||
WMDrawString(scr, tPtr->db, gc, font,
|
||||
tb->sections[s].x - tPtr->hpos, y, text, len);
|
||||
WMDrawString(scr, tPtr->db, color, font,
|
||||
tb->sections[s].x - tPtr->hpos, y, text, len);
|
||||
|
||||
if (!tPtr->flags.monoFont && tb->underlined) {
|
||||
XDrawLine(dpy, tPtr->db, gc,
|
||||
tb->sections[s].x - tPtr->hpos,
|
||||
y + font->y + 1,
|
||||
tb->sections[s].x + tb->sections[s].w - tPtr->hpos,
|
||||
y + font->y + 1);
|
||||
XDrawLine(dpy, tPtr->db, WMColorGC(color),
|
||||
tb->sections[s].x - tPtr->hpos,
|
||||
y + font->y + 1,
|
||||
tb->sections[s].x + tb->sections[s].w - tPtr->hpos,
|
||||
y + font->y + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tb = (!done? tb->next : NULL);
|
||||
|
||||
}
|
||||
|
||||
/* now , show all graphic items that can be viewed */
|
||||
@@ -855,22 +844,22 @@ _copy_area:
|
||||
if (tPtr->flags.editable && tPtr->flags.cursorShown
|
||||
&& tPtr->cursor.x != -23 && tPtr->flags.focused) {
|
||||
int y = tPtr->cursor.y - tPtr->vpos;
|
||||
XDrawLine(dpy, tPtr->db, tPtr->fgGC,
|
||||
tPtr->cursor.x, y,
|
||||
tPtr->cursor.x, y + tPtr->cursor.h);
|
||||
XDrawLine(dpy, tPtr->db, WMColorGC(tPtr->fgColor),
|
||||
tPtr->cursor.x, y,
|
||||
tPtr->cursor.x, y + tPtr->cursor.h);
|
||||
}
|
||||
|
||||
XCopyArea(dpy, tPtr->db, win, tPtr->bgGC, 0, 0,
|
||||
tPtr->visible.w, tPtr->visible.h,
|
||||
tPtr->visible.x, tPtr->visible.y);
|
||||
XCopyArea(dpy, tPtr->db, win, WMColorGC(tPtr->bgColor), 0, 0,
|
||||
tPtr->visible.w, tPtr->visible.h,
|
||||
tPtr->visible.x, tPtr->visible.y);
|
||||
|
||||
W_DrawRelief(scr, win, 0, 0,
|
||||
tPtr->view->size.width, tPtr->view->size.height,
|
||||
tPtr->flags.relief);
|
||||
|
||||
if (tPtr->ruler && tPtr->flags.rulerShown)
|
||||
XDrawLine(dpy, win, tPtr->fgGC,
|
||||
2, 42, tPtr->view->size.width-4, 42);
|
||||
XDrawLine(dpy, win, WMColorGC(tPtr->fgColor),
|
||||
2, 42, tPtr->view->size.width-4, 42);
|
||||
|
||||
}
|
||||
|
||||
@@ -3138,30 +3127,27 @@ WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser, WMAction *writer
|
||||
tPtr->view->attribFlags |= CWOverrideRedirect | CWCursor;
|
||||
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->fgGC = WMColorGC(tPtr->dColor);
|
||||
tPtr->fgColor = WMBlackColor(scr);
|
||||
tPtr->bgColor = WMWhiteColor(scr);
|
||||
W_SetViewBackgroundColor(tPtr->view, tPtr->bgColor);
|
||||
|
||||
gcv.graphics_exposures = False;
|
||||
gcv.foreground = W_PIXEL(scr->gray);
|
||||
gcv.background = W_PIXEL(scr->darkGray);
|
||||
gcv.fill_style = FillStippled;
|
||||
/* why not use scr->stipple here? */
|
||||
gcv.stipple = XCreateBitmapFromData(dpy, W_DRAWABLE(scr),
|
||||
STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT);
|
||||
gcv.stipple = XCreateBitmapFromData(dpy, W_DRAWABLE(scr), STIPPLE_BITS,
|
||||
STIPPLE_WIDTH, STIPPLE_HEIGHT);
|
||||
tPtr->stippledGC = XCreateGC(dpy, W_DRAWABLE(scr),
|
||||
GCForeground|GCBackground|GCStipple
|
||||
|GCFillStyle|GCGraphicsExposures, &gcv);
|
||||
GCForeground|GCBackground|GCStipple
|
||||
|GCFillStyle|GCGraphicsExposures, &gcv);
|
||||
|
||||
tPtr->ruler = NULL;
|
||||
tPtr->vS = NULL;
|
||||
tPtr->hS = NULL;
|
||||
|
||||
tPtr->dFont = WMRetainFont(WMSystemFontOfSize(scr, 12));
|
||||
tPtr->dFont = WMSystemFontOfSize(scr, 12);
|
||||
|
||||
tPtr->view->delegate = &_TextViewDelegate;
|
||||
|
||||
@@ -3668,8 +3654,8 @@ WMDestroyTextBlock(WMText *tPtr, void *vtb)
|
||||
/* 5 months later... destroy it 10 seconds after now which should
|
||||
* be enough time for the widget's action to be completed... :-) */
|
||||
/* This is a bad assumption. Just destroy the widget here.
|
||||
// if the caller needs it, it can protect it with W_RetainView()
|
||||
//WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);*/
|
||||
* if the caller needs it, it can protect it with W_RetainView()
|
||||
* WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);*/
|
||||
WMDestroyWidget(tb->d.widget);
|
||||
} else {
|
||||
WMReleasePixmap(tb->d.pixmap);
|
||||
@@ -3693,13 +3679,8 @@ WMSetTextForegroundColor(WMText *tPtr, WMColor *color)
|
||||
if (!tPtr)
|
||||
return;
|
||||
|
||||
if (color)
|
||||
tPtr->fgGC = WMColorGC(color);
|
||||
else {
|
||||
WMColor *color = WMBlackColor(tPtr->view->screen);
|
||||
tPtr->fgGC = WMColorGC(color);
|
||||
WMReleaseColor(color);
|
||||
}
|
||||
WMReleaseColor(tPtr->fgColor);
|
||||
tPtr->fgColor = WMRetainColor(color ? color : tPtr->view->screen->black);
|
||||
|
||||
paintText(tPtr);
|
||||
}
|
||||
@@ -3710,14 +3691,9 @@ WMSetTextBackgroundColor(WMText *tPtr, WMColor *color)
|
||||
if (!tPtr)
|
||||
return;
|
||||
|
||||
if (color) {
|
||||
tPtr->bgGC = WMColorGC(color);
|
||||
W_SetViewBackgroundColor(tPtr->view, color);
|
||||
} else {
|
||||
tPtr->bgGC = WMColorGC(WMWhiteColor(tPtr->view->screen));
|
||||
W_SetViewBackgroundColor(tPtr->view,
|
||||
WMWhiteColor(tPtr->view->screen));
|
||||
}
|
||||
WMReleaseColor(tPtr->bgColor);
|
||||
tPtr->bgColor = WMRetainColor(color ? color : tPtr->view->screen->white);
|
||||
W_SetViewBackgroundColor(tPtr->view, tPtr->bgColor);
|
||||
|
||||
paintText(tPtr);
|
||||
}
|
||||
|
||||
+8
-21
@@ -816,6 +816,7 @@ paintTextField(TextField *tPtr)
|
||||
int totalWidth;
|
||||
char *text;
|
||||
Pixmap drawbuffer;
|
||||
WMColor *color;
|
||||
|
||||
|
||||
if (!view->flags.realized || !view->flags.mapped)
|
||||
@@ -877,12 +878,10 @@ paintTextField(TextField *tPtr)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!tPtr->flags.enabled)
|
||||
WMSetColorInGC(screen->darkGray, screen->textFieldGC);
|
||||
color = tPtr->flags.enabled ? screen->black : screen->darkGray;
|
||||
|
||||
WMDrawImageString(screen, drawbuffer, screen->textFieldGC,
|
||||
tPtr->font, tx, ty,
|
||||
&(text[tPtr->viewPosition]),
|
||||
WMDrawImageString(screen, drawbuffer, color, screen->white,
|
||||
tPtr->font, tx, ty, &(text[tPtr->viewPosition]),
|
||||
tPtr->textLen - tPtr->viewPosition);
|
||||
|
||||
if (tPtr->selection.count) {
|
||||
@@ -897,27 +896,15 @@ paintTextField(TextField *tPtr)
|
||||
count = tPtr->viewPosition;
|
||||
}
|
||||
|
||||
|
||||
rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count)
|
||||
- WMWidthOfString(tPtr->font,text,tPtr->viewPosition);
|
||||
|
||||
XSetBackground(screen->display, screen->textFieldGC,
|
||||
screen->gray->color.pixel);
|
||||
|
||||
WMDrawImageString(screen, drawbuffer, screen->textFieldGC,
|
||||
tPtr->font, rx, ty, &(text[count]),
|
||||
count2);
|
||||
|
||||
XSetBackground(screen->display, screen->textFieldGC,
|
||||
screen->white->color.pixel);
|
||||
WMDrawImageString(screen, drawbuffer, color, screen->gray,
|
||||
tPtr->font, rx, ty, &(text[count]), count2);
|
||||
}
|
||||
|
||||
if (!tPtr->flags.enabled)
|
||||
WMSetColorInGC(screen->black, screen->textFieldGC);
|
||||
} else {
|
||||
XFillRectangle(screen->display, drawbuffer,
|
||||
WMColorGC(screen->white),
|
||||
bd,bd, totalWidth,view->size.height-2*bd);
|
||||
XFillRectangle(screen->display, drawbuffer, WMColorGC(screen->white),
|
||||
bd, bd, totalWidth,view->size.height-2*bd);
|
||||
}
|
||||
|
||||
/* draw relief */
|
||||
|
||||
+2
-2
@@ -560,10 +560,10 @@ W_SetViewBackgroundColor(W_View *view, WMColor *color)
|
||||
view->backColor = WMRetainColor(color);
|
||||
|
||||
view->attribFlags |= CWBackPixel;
|
||||
view->attribs.background_pixel = color->color.pixel;
|
||||
view->attribs.background_pixel = W_PIXEL(color);
|
||||
if (view->flags.realized) {
|
||||
XSetWindowBackground(view->screen->display, view->window,
|
||||
color->color.pixel);
|
||||
W_PIXEL(color));
|
||||
XClearWindow(view->screen->display, view->window);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -667,10 +667,10 @@ handleEvents(XEvent *event, void *clientData)
|
||||
}
|
||||
break;
|
||||
/*
|
||||
// was causing windows to ignore commands like closeWindow
|
||||
* // after the windows is iconized/restored or a workspace change
|
||||
* // if this is really needed, put the MapNotify portion too and
|
||||
* // fix the restack bug in wmaker
|
||||
* was causing windows to ignore commands like closeWindow
|
||||
* after the windows is iconized/restored or a workspace change
|
||||
* if this is really needed, put the MapNotify portion too and
|
||||
* fix the restack bug in wmaker
|
||||
case UnmapNotify:
|
||||
WMUnmapWidget(win);
|
||||
break;
|
||||
|
||||
@@ -1329,11 +1329,11 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
||||
else if (titem->selectedFor)
|
||||
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,
|
||||
strlen(titem->title));
|
||||
|
||||
WMDrawString(scr, d, WMColorGC(black), panel->smallFont,
|
||||
WMDrawString(scr, d, black, panel->smallFont,
|
||||
x + TEXPREV_WIDTH + 14, y + 18, 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;
|
||||
break;
|
||||
}
|
||||
WMDrawString(scr, d, WMColorGC(color), font, x,
|
||||
y + (h - WMFontHeight(font))/2, text, l);
|
||||
WMDrawString(scr, d, color, font, x, y + (h - WMFontHeight(font))/2,
|
||||
text, l);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+21
-21
@@ -85,26 +85,30 @@ static WMPropList *DefaultDisplayFont = NULL;
|
||||
|
||||
|
||||
static void
|
||||
drawMenuItem(WMScreen *scr, Display *dpy, Drawable d,
|
||||
int x, int y, int w, int h,
|
||||
GC light, GC dark, GC black, GC white,
|
||||
WMFont *font, int fh, char *text)
|
||||
drawMenuItem(Panel *panel, int x, int y, int w, int h, 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);
|
||||
XDrawLine(dpy, d, black, x+w, y, x+w, y+h);
|
||||
XFillRectangle(dpy, panel->preview, WMColorGC(panel->light), x, y, w, h);
|
||||
|
||||
XDrawLine(dpy, d, white, x+1, y, x+1, y+h-1);
|
||||
XDrawLine(dpy, d, white, x+1, y, x+w-1, y);
|
||||
XDrawLine(dpy, panel->preview, black, x, y, x, y+h);
|
||||
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, d, dark, x+1, y+h-2, x+w-1, y+h-2);
|
||||
XDrawLine(dpy, panel->preview, white, x+1, y, x+1, y+h-1);
|
||||
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,
|
||||
text, strlen(text));
|
||||
XDrawLine(dpy, panel->preview, black, x, y+h-1, x+w, y+h-1);
|
||||
|
||||
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,
|
||||
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+(h-fh)/2, "Window Titlebar", 15);
|
||||
}
|
||||
@@ -186,7 +190,7 @@ paintPreviewBox(Panel *panel)
|
||||
XDrawLine(dpy, panel->preview, dark,
|
||||
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);
|
||||
|
||||
fh2 = WMFontHeight(panel->menuItemFont);
|
||||
@@ -194,11 +198,7 @@ paintPreviewBox(Panel *panel)
|
||||
|
||||
/* menu items */
|
||||
for (i = 0; i < 4; i++) {
|
||||
drawMenuItem(scr, dpy, panel->preview,
|
||||
mx-1, my+2+h+i*h2, mw+2, h2,
|
||||
light, dark, black, white,
|
||||
panel->menuItemFont, fh2,
|
||||
"Menu Item");
|
||||
drawMenuItem(panel, mx-1, my+2+h+i*h2, mw+2, h2, "Menu Item");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -453,8 +453,7 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
||||
WMReleasePixmap(pix);
|
||||
}
|
||||
|
||||
WMDrawString(scr, d, WMColorGC(panel->black), panel->font, x+20, y,
|
||||
text, strlen(text));
|
||||
WMDrawString(scr, d, panel->black, panel->font, x+20, y, text, strlen(text));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-4
@@ -200,11 +200,9 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
||||
XClearArea(dpy, d, x, y, width, height, False);
|
||||
|
||||
if (state & 1) {
|
||||
WMDrawString(scr, d, WMColorGC(panel->red), panel->font, x+4, y,
|
||||
text, strlen(text));
|
||||
WMDrawString(scr, d, panel->red, panel->font, x+4, y, text, strlen(text));
|
||||
} else {
|
||||
WMDrawString(scr, d, WMColorGC(panel->black), panel->font, x+4, y,
|
||||
text, strlen(text));
|
||||
WMDrawString(scr, d, panel->black, panel->font, x+4, y, text, strlen(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -327,13 +327,13 @@ updateSVSlider(WMSlider *sPtr, Bool saturation, WMFont *font, RHSVColor *hsv)
|
||||
if (hsv->value < 128 || !saturation) {
|
||||
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));
|
||||
WMReleaseColor(col);
|
||||
} else {
|
||||
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));
|
||||
WMReleaseColor(col);
|
||||
}
|
||||
@@ -368,14 +368,14 @@ updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
|
||||
if (hsv->value < 128) {
|
||||
WMColor *col = WMWhiteColor(scr);
|
||||
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), col, font, 2,
|
||||
(16 - WMFontHeight(font))/2 - 1,
|
||||
_("Hue"), strlen(_("Hue")));
|
||||
WMReleaseColor(col);
|
||||
} else {
|
||||
WMColor *col = WMBlackColor(scr);
|
||||
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(col), font, 2,
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), col, font, 2,
|
||||
(16 - WMFontHeight(font))/2 - 1,
|
||||
_("Hue"), strlen(_("Hue")));
|
||||
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),
|
||||
0, height*index, 30, height, x + 5, y);
|
||||
}
|
||||
WMDrawString(scr, d, WMColorGC(black), panel->listFont,
|
||||
x + 40, y + 1, text, strlen(text));
|
||||
WMDrawString(scr, d, black, panel->listFont, x + 40, y + 1,
|
||||
text, strlen(text));
|
||||
|
||||
WMReleaseColor(white);
|
||||
WMReleaseColor(black);
|
||||
@@ -1333,7 +1333,7 @@ CreateTexturePanel(WMWindow *keyWindow)
|
||||
WMColorGC(color), 0, 0, 130, 16);
|
||||
WMReleaseColor(color);
|
||||
color = WMWhiteColor(color);
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(color),
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), color,
|
||||
panel->listFont, 2,
|
||||
(16 - WMFontHeight(panel->listFont))/2 - 1,
|
||||
"Brightness", 10);
|
||||
@@ -1357,7 +1357,7 @@ CreateTexturePanel(WMWindow *keyWindow)
|
||||
WMColorGC(color), 0, 0, 130, 16);
|
||||
WMReleaseColor(color);
|
||||
color = WMWhiteColor(scr);
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), WMColorGC(color),
|
||||
WMDrawString(scr, WMGetPixmapXID(pixmap), color,
|
||||
panel->listFont, 2,
|
||||
(16 - WMFontHeight(panel->listFont))/2 - 1,
|
||||
"Contrast", 8);
|
||||
@@ -1463,9 +1463,8 @@ CreateTexturePanel(WMWindow *keyWindow)
|
||||
WMReleaseColor(color);
|
||||
|
||||
color = WMWhiteColor(scr);
|
||||
WMDrawString(scr, p, WMColorGC(color), panel->listFont,
|
||||
2, 1, "0%", 2);
|
||||
WMDrawString(scr, p, WMColorGC(color), panel->listFont,
|
||||
WMDrawString(scr, p, color, panel->listFont, 2, 1, "0%", 2);
|
||||
WMDrawString(scr, p, color, panel->listFont,
|
||||
153 - WMWidthOfString(panel->listFont, "100%", 4), 1,
|
||||
"100%", 4);
|
||||
WMReleaseColor(color);
|
||||
|
||||
@@ -716,6 +716,7 @@ Initialize(WMScreen *scr)
|
||||
#ifdef akk
|
||||
InitFont(scr, WPrefs.banner);
|
||||
#endif
|
||||
|
||||
#ifdef not_yet_fully_implemented
|
||||
InitThemes(scr, WPrefs.banner);
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ paintDoubleTest(_DoubleTest *dPtr)
|
||||
y = (dPtr->view->size.height-scr->normalFont->height)/2;
|
||||
W_PaintText(dPtr->view, dPtr->view->window, scr->normalFont,
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -219,8 +219,7 @@ paintEditMenuItem(WEditMenuItem *iPtr)
|
||||
|
||||
W_DrawRelief(scr, win, 0, 0, w+1, h, WRRaised);
|
||||
|
||||
WMDrawString(scr, win, WMColorGC(color), font, 5, 3, iPtr->label,
|
||||
strlen(iPtr->label));
|
||||
WMDrawString(scr, win, color, font, 5, 3, iPtr->label, strlen(iPtr->label));
|
||||
|
||||
if (iPtr->pixmap) {
|
||||
WMSize size = WMGetPixmapSize(iPtr->pixmap);
|
||||
|
||||
-97
@@ -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
@@ -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
|
||||
|
||||
@@ -127,7 +127,7 @@ main() { foo("hello"); }
|
||||
],
|
||||
_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
|
||||
AC_DEFINE(HAVE_C99_VSNPRINTF)
|
||||
AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [define if you have vsnprintf with C99 semantics (set by configure)])
|
||||
fi
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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)])
|
||||
|
||||
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
|
||||
fi
|
||||
fi
|
||||
@@ -258,7 +258,7 @@ fi
|
||||
|
||||
if test "$LINGUAS" != ""; then
|
||||
if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
|
||||
AC_DEFINE(I18N)
|
||||
AC_DEFINE(I18N, 1, [Internationalization (I18N) support (set by configure)])
|
||||
PO=""
|
||||
# if test "$LINGUAS" = ""; then
|
||||
# ling=` (cd src/po; /bin/ls *.po) `
|
||||
@@ -371,7 +371,7 @@ dnl ===============================
|
||||
AC_ARG_ENABLE(gnome,
|
||||
[ --enable-gnome enable stuff needed for GNOME ],
|
||||
[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
|
||||
fi])
|
||||
|
||||
@@ -379,7 +379,7 @@ AC_ARG_ENABLE(gnome,
|
||||
AC_ARG_ENABLE(kde,
|
||||
[ --enable-kde enable support for KDE window manager (kwm) hints ],
|
||||
[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
|
||||
fi])
|
||||
|
||||
@@ -387,7 +387,7 @@ AC_ARG_ENABLE(kde,
|
||||
AC_ARG_ENABLE(openlook,
|
||||
[ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ],
|
||||
[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
|
||||
fi])
|
||||
|
||||
@@ -399,7 +399,7 @@ AC_ARG_ENABLE(lite,
|
||||
[ --enable-lite disable some stuff (dont use it) ],
|
||||
[if test x$enableval = xyes; then
|
||||
LITE=yes
|
||||
AC_DEFINE(LITE)
|
||||
AC_DEFINE(LITE, 1, [define if you want the 'lite' version])
|
||||
AC_SUBST(LITE)
|
||||
fi])
|
||||
|
||||
@@ -417,7 +417,7 @@ AC_CHECK_FUNC(connect,,
|
||||
AC_CHECK_FUNC(gethostbyname,,
|
||||
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
|
||||
AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON)
|
||||
NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS)
|
||||
@@ -464,24 +464,30 @@ AC_ARG_ENABLE(locale,
|
||||
use_locale=no)
|
||||
|
||||
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
|
||||
|
||||
|
||||
dnl Check whether XInternAtoms() exist
|
||||
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 ==================================
|
||||
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 ============================
|
||||
AC_ARG_ENABLE(modelock,
|
||||
[ --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
|
||||
AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
|
||||
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
|
||||
|
||||
|
||||
@@ -510,7 +517,8 @@ xinerama=no
|
||||
|
||||
if test "$xinerama" = yes; then
|
||||
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
|
||||
|
||||
|
||||
@@ -533,7 +541,7 @@ if test "$shm" = yes; then
|
||||
if test "$added_xext" = no; then
|
||||
XLIBS="-lXext $XLIBS"
|
||||
fi
|
||||
AC_DEFINE(XSHM)
|
||||
AC_DEFINE(XSHM, 1, [define if X's shared memory extension is available (set by configure)])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -571,7 +579,7 @@ if test "$xpm" = yes; then
|
||||
if test "x$ac_cv_header_X11_xpm_h" = xyes; then
|
||||
GFXLIBS="$GFXLIBS -lXpm"
|
||||
supported_gfx="XPM"
|
||||
AC_DEFINE(USE_XPM)
|
||||
AC_DEFINE(USE_XPM, 1, [define if XPM libraries are available (set by configure)])
|
||||
else
|
||||
supported_gfx="builtin-XPM"
|
||||
fi
|
||||
@@ -608,7 +616,7 @@ if test "$png" = yes ; then
|
||||
if test "x$ac_cv_header_png_h" = xyes; then
|
||||
GFXLIBS="$GFXLIBS -lpng -lz"
|
||||
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
|
||||
@@ -633,7 +641,7 @@ if test "$jpeg" = yes; then
|
||||
if test "x$ac_cv_header_jpeglib_h" = xyes; then
|
||||
GFXLIBS="$GFXLIBS -ljpeg"
|
||||
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
|
||||
@@ -667,7 +675,7 @@ dnl
|
||||
if test "x$ac_cv_header_gif_lib_h" = xyes; then
|
||||
GFXLIBS="$GFXLIBS $my_libname"
|
||||
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
|
||||
@@ -721,7 +729,7 @@ dnl
|
||||
GFXLIBS="$my_libname $GFXLIBS"
|
||||
ICONEXT="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
|
||||
@@ -759,13 +767,13 @@ else
|
||||
pixmapdir=`eval echo ${datadir}/pixmaps`
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
|
||||
AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir", [define an extra path for pixmaps (set by configure)])
|
||||
|
||||
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`
|
||||
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
|
||||
@@ -798,7 +806,7 @@ AC_ARG_ENABLE(usermenu,
|
||||
[ --enable-usermenu user defined menus for applications
|
||||
],
|
||||
if test "$enableval" = yes; then
|
||||
AC_DEFINE(USER_MENU)
|
||||
AC_DEFINE(USER_MENU, 1, [define if you want user defined menus for applications])
|
||||
fi
|
||||
)
|
||||
|
||||
|
||||
+7
-11
@@ -289,14 +289,11 @@ updateDockNumbers(WScreen *scr)
|
||||
{
|
||||
int length;
|
||||
char *ws_numbers;
|
||||
GC numbers_gc;
|
||||
XGCValues my_gc_values;
|
||||
unsigned long my_v_mask = (GCForeground);
|
||||
WAppIcon *dicon = scr->dock->icon_array[0];
|
||||
WMColor *black, *white;
|
||||
|
||||
my_gc_values.foreground = scr->white_pixel;
|
||||
numbers_gc = XCreateGC(dpy, dicon->icon->core->window,
|
||||
my_v_mask, &my_gc_values);
|
||||
black = WMBlackColor(scr->wmscreen);
|
||||
white = WMWhiteColor(scr->wmscreen);
|
||||
|
||||
ws_numbers = wmalloc(20);
|
||||
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,
|
||||
WMFontHeight(scr->icon_title_font)+1, False);
|
||||
|
||||
XSetForeground(dpy, numbers_gc, scr->black_pixel);
|
||||
WMDrawString(scr->wmscreen, dicon->icon->core->window, numbers_gc,
|
||||
WMDrawString(scr->wmscreen, dicon->icon->core->window, black,
|
||||
scr->icon_title_font, 4, 3, ws_numbers, length);
|
||||
|
||||
XSetForeground(dpy, numbers_gc, scr->white_pixel);
|
||||
WMDrawString(scr->wmscreen, dicon->icon->core->window, numbers_gc,
|
||||
WMDrawString(scr->wmscreen, dicon->icon->core->window, white,
|
||||
scr->icon_title_font, 3, 2, ws_numbers, length);
|
||||
|
||||
XFreeGC(dpy, numbers_gc);
|
||||
WMReleaseColor(black);
|
||||
WMReleaseColor(white);
|
||||
wfree(ws_numbers);
|
||||
}
|
||||
#endif /* WS_INDICATOR */
|
||||
|
||||
+17
-6
@@ -34,6 +34,8 @@
|
||||
|
||||
#include <wraster.h>
|
||||
|
||||
#include <WINGs/WINGsP.h>
|
||||
|
||||
#include "WindowMaker.h"
|
||||
#include "screen.h"
|
||||
#include "texture.h"
|
||||
@@ -170,6 +172,7 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
|
||||
Pixmap pixmap;
|
||||
Pixmap mask;
|
||||
WMFont *font = scr->info_text_font;
|
||||
WMColor *color;
|
||||
int side = 0;
|
||||
int ty;
|
||||
int bx, by;
|
||||
@@ -209,12 +212,14 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
|
||||
}
|
||||
pixmap = makePixmap(scr, width, height, side, &mask);
|
||||
|
||||
XSetForeground(dpy, scr->info_text_gc, scr->black_pixel);
|
||||
color = WMBlackColor(scr->wmscreen);
|
||||
|
||||
WMDrawString(scr->wmscreen, pixmap, scr->info_text_gc, font, 8,
|
||||
WMDrawString(scr->wmscreen, pixmap, color, font, 8,
|
||||
ty + (height - WMFontHeight(font))/2,
|
||||
text, strlen(text));
|
||||
|
||||
WMReleaseColor(color);
|
||||
|
||||
XSetWindowBackgroundPixmap(dpy, scr->balloon->window, pixmap);
|
||||
scr->balloon->contents = pixmap;
|
||||
|
||||
@@ -225,6 +230,7 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
|
||||
XMoveWindow(dpy, scr->balloon->window, bx, by);
|
||||
XMapRaised(dpy, scr->balloon->window);
|
||||
|
||||
|
||||
scr->balloon->mapped = 1;
|
||||
}
|
||||
#else /* !SHAPED_BALLOON */
|
||||
@@ -235,6 +241,8 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
|
||||
int height;
|
||||
Pixmap pixmap;
|
||||
WMFont *font = scr->info_text_font;
|
||||
WMColor *color;
|
||||
WMPixel pixel;
|
||||
|
||||
if (scr->balloon->contents)
|
||||
XFreePixmap(dpy, scr->balloon->contents);
|
||||
@@ -264,10 +272,13 @@ showText(WScreen *scr, int x, int y, int h, int w, char *text)
|
||||
pixmap = XCreatePixmap(dpy, scr->root_win, width, height, scr->w_depth);
|
||||
XFillRectangle(dpy, pixmap, scr->draw_gc, 0, 0, width, height);
|
||||
|
||||
XSetForeground(dpy, scr->info_text_gc, scr->window_title_pixel[0]);
|
||||
|
||||
WMDrawString(scr->wmscreen, pixmap, scr->info_text_gc, font,
|
||||
4, 2, text, strlen(text));
|
||||
/* ugly hack */
|
||||
color = WMBlackColor(scr->wmscreen);
|
||||
pixel = color->color.pixel;
|
||||
color->color.pixel = scr->window_title_pixel[0];
|
||||
WMDrawString(scr->wmscreen, pixmap, color, font, 4, 2, text, strlen(text));
|
||||
color->color.pixel = pixel;
|
||||
WMReleaseColor(color);
|
||||
|
||||
XResizeWindow(dpy, scr->balloon->window, width, height);
|
||||
XMoveWindow(dpy, scr->balloon->window, x, y);
|
||||
|
||||
+11
-6
@@ -51,6 +51,7 @@
|
||||
|
||||
#include <wraster.h>
|
||||
|
||||
#include <WINGs/WINGsP.h>
|
||||
|
||||
#include "WindowMaker.h"
|
||||
#include "wcore.h"
|
||||
@@ -2989,11 +2990,11 @@ setHightlightText(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
|
||||
static int
|
||||
setClipTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index)
|
||||
{
|
||||
if (scr->clip_title_pixel[index]!=scr->white_pixel &&
|
||||
scr->clip_title_pixel[index]!=scr->black_pixel) {
|
||||
wFreeColor(scr, scr->clip_title_pixel[index]);
|
||||
}
|
||||
scr->clip_title_pixel[index] = color->pixel;
|
||||
if (scr->clip_title_color[index])
|
||||
WMReleaseColor(scr->clip_title_color[index]);
|
||||
scr->clip_title_color[index] = WMCreateRGBColor(scr->wmscreen, color->red,
|
||||
color->green, color->blue,
|
||||
True);
|
||||
|
||||
#ifdef GRADIENT_CLIP_ARROW
|
||||
if (index == CLIP_NORMAL) {
|
||||
@@ -3115,7 +3116,11 @@ setMenuDisabledColor(WScreen *scr, WDefaultEntry *entry, XColor *color, void *fo
|
||||
static int
|
||||
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;
|
||||
}
|
||||
|
||||
+4
-5
@@ -521,12 +521,11 @@ drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
|
||||
|
||||
for(i=-1;i<2;i++)
|
||||
for(j=-1;j<2;j++)
|
||||
WMDrawString(wmscr, d, WMColorGC(whitecolor),
|
||||
panel->normalfont, ofx+i, ofy+j,
|
||||
text, tlen);
|
||||
WMDrawString(wmscr, d, whitecolor, panel->normalfont,
|
||||
ofx+i, ofy+j, text, tlen);
|
||||
|
||||
WMDrawString(wmscr, d, WMColorGC(blackcolor), panel->normalfont,
|
||||
ofx, ofy, text, tlen);
|
||||
WMDrawString(wmscr, d, blackcolor, panel->normalfont, ofx, ofy,
|
||||
text, tlen);
|
||||
}
|
||||
|
||||
WMReleasePixmap(pixmap);
|
||||
|
||||
+18
-13
@@ -56,7 +56,7 @@
|
||||
#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 as = pt - 15; /* 15 = 5+5+5 */
|
||||
GC gc = scr->clip_title_gc;
|
||||
WMColor *color;
|
||||
#ifdef GRADIENT_CLIP_ARROW
|
||||
Bool collapsed = clipIcon->dock->collapsed;
|
||||
#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) {
|
||||
p[0].x = tp+1;
|
||||
p[0].y = 1;
|
||||
@@ -1279,7 +1287,7 @@ wClipIconPaint(WAppIcon *aicon)
|
||||
{
|
||||
WScreen *scr = aicon->icon->core->screen_ptr;
|
||||
WWorkspace *workspace = scr->workspaces[scr->current_workspace];
|
||||
GC gc;
|
||||
WMColor *color;
|
||||
Window win = aicon->icon->core->window;
|
||||
int length, nlength;
|
||||
char *ws_name, ws_number[10];
|
||||
@@ -1293,26 +1301,24 @@ wClipIconPaint(WAppIcon *aicon)
|
||||
snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1);
|
||||
nlength = strlen(ws_number);
|
||||
|
||||
gc = scr->clip_title_gc;
|
||||
|
||||
if (!workspace->clip->collapsed)
|
||||
XSetForeground(dpy, gc, scr->clip_title_pixel[CLIP_NORMAL]);
|
||||
color = scr->clip_title_color[CLIP_NORMAL];
|
||||
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;
|
||||
|
||||
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);
|
||||
/*WMDrawString(scr->wmscreen, win, gc, scr->clip_title_font, 4,
|
||||
/*WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, 4,
|
||||
2, ws_name, length);*/
|
||||
|
||||
tx = (ICON_SIZE/2 - WMWidthOfString(scr->clip_title_font, ws_number,
|
||||
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);
|
||||
|
||||
wfree(ws_name);
|
||||
@@ -4213,11 +4219,10 @@ showClipBalloon(WDock *dock, int workspace)
|
||||
XRestackWindows(dpy, stack, 2);
|
||||
}
|
||||
XMoveWindow(dpy, scr->clip_balloon, x, y);
|
||||
XSetForeground(dpy, scr->clip_title_gc,
|
||||
scr->clip_title_pixel[CLIP_NORMAL]);
|
||||
XClearWindow(dpy, scr->clip_balloon);
|
||||
WMDrawString(scr->wmscreen, scr->clip_balloon, scr->clip_title_gc,
|
||||
scr->clip_title_font, 0, 0, text, strlen(text));
|
||||
WMDrawString(scr->wmscreen, scr->clip_balloon,
|
||||
scr->clip_title_color[CLIP_NORMAL], scr->clip_title_font,
|
||||
0, 0, text, strlen(text));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+15
-10
@@ -32,6 +32,8 @@
|
||||
|
||||
#include <wraster.h>
|
||||
|
||||
#include <WINGs/WINGsP.h>
|
||||
|
||||
#include "WindowMaker.h"
|
||||
#include "GNUstep.h"
|
||||
#include "texture.h"
|
||||
@@ -65,8 +67,7 @@ WFrameWindow*
|
||||
wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
|
||||
int width, int height, int *clearance, int flags,
|
||||
WTexture **title_texture, WTexture **resize_texture,
|
||||
unsigned long *color,
|
||||
GC *gc, WMFont **font)
|
||||
unsigned long *color, WMFont **font)
|
||||
{
|
||||
WFrameWindow *fwin;
|
||||
|
||||
@@ -81,7 +82,6 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
|
||||
fwin->resizebar_texture = resize_texture;
|
||||
fwin->title_pixel = color;
|
||||
fwin->title_clearance = clearance;
|
||||
fwin->title_gc = gc;
|
||||
fwin->font = font;
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
fwin->languagemode = XkbGroup1Index;
|
||||
@@ -1049,7 +1049,9 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
||||
#endif
|
||||
|
||||
if (fwin->title) {
|
||||
char *title;
|
||||
char *title;
|
||||
WMColor *color;
|
||||
WMPixel pixel;
|
||||
|
||||
title = ShrinkString(*fwin->font, fwin->title,
|
||||
fwin->titlebar->width - lofs - rofs);
|
||||
@@ -1073,12 +1075,15 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
||||
break;
|
||||
}
|
||||
|
||||
XSetForeground(dpy, *fwin->title_gc,
|
||||
fwin->title_pixel[fwin->flags.state]);
|
||||
|
||||
WMDrawString(scr->wmscreen, fwin->titlebar->window,
|
||||
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
|
||||
title, titlelen);
|
||||
color = WMBlackColor(scr->wmscreen);
|
||||
/* ugly hack */
|
||||
pixel = color->color.pixel;
|
||||
color->color.pixel = fwin->title_pixel[fwin->flags.state];
|
||||
WMDrawString(scr->wmscreen, fwin->titlebar->window, color,
|
||||
*fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
|
||||
title, titlelen);
|
||||
color->color.pixel = pixel;
|
||||
WMReleaseColor(color);
|
||||
|
||||
wfree(title);
|
||||
}
|
||||
|
||||
+1
-3
@@ -82,7 +82,6 @@ typedef struct WFrameWindow {
|
||||
union WTexture **title_texture;
|
||||
union WTexture **resizebar_texture;
|
||||
unsigned long *title_pixel;
|
||||
GC *title_gc;
|
||||
WMFont **font;
|
||||
|
||||
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,
|
||||
union WTexture **title_texture,
|
||||
union WTexture **resize_texture,
|
||||
unsigned long *color,
|
||||
GC *gc, WMFont **font);
|
||||
unsigned long *color, WMFont **font);
|
||||
|
||||
void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags);
|
||||
|
||||
|
||||
+5
-16
@@ -9,7 +9,8 @@ typedef struct W_GeometryView {
|
||||
W_Class widgetClass;
|
||||
WMView *view;
|
||||
|
||||
GC gc;
|
||||
WMColor *black;
|
||||
WMColor *gray;
|
||||
WMFont *font;
|
||||
|
||||
WMSize textSize;
|
||||
@@ -67,20 +68,8 @@ WCreateGeometryView(WMScreen *scr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
{
|
||||
WMColor *black = WMBlackColor(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);
|
||||
}
|
||||
gview->black = WMBlackColor(scr);
|
||||
gview->gray = WMGrayColor(scr);
|
||||
|
||||
WMCreateEventHandler(gview->view, ExposureMask, handleEvents, gview);
|
||||
|
||||
@@ -136,7 +125,7 @@ paint(WGeometryView *gview)
|
||||
|
||||
WMDrawImageString(W_VIEW_SCREEN(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_HEIGHT(gview->view)-gview->textSize.height)/2,
|
||||
buffer, strlen(buffer));
|
||||
|
||||
+1
-2
@@ -812,7 +812,6 @@ void
|
||||
wIconPaint(WIcon *icon)
|
||||
{
|
||||
WScreen *scr=icon->core->screen_ptr;
|
||||
GC gc = scr->icon_title_gc;
|
||||
int x;
|
||||
char *tmp;
|
||||
|
||||
@@ -838,7 +837,7 @@ wIconPaint(WIcon *icon)
|
||||
else
|
||||
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);
|
||||
wfree(tmp);
|
||||
}
|
||||
|
||||
+32
-11
@@ -43,6 +43,8 @@
|
||||
#include "stacking.h"
|
||||
#include "text.h"
|
||||
|
||||
#include <WINGs/WINGsP.h>
|
||||
|
||||
|
||||
/****** 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,
|
||||
screen->menu_title_texture, NULL,
|
||||
screen->menu_title_pixel,
|
||||
&screen->menu_title_gc,
|
||||
&screen->menu_title_font);
|
||||
|
||||
menu->frame->core->descriptor.parent = menu;
|
||||
@@ -724,7 +725,9 @@ paintEntry(WMenu *menu, int index, int selected)
|
||||
{
|
||||
int x, y, w, h, tw;
|
||||
int type;
|
||||
GC light, dim, dark, textGC;
|
||||
GC light, dim, dark, textGC, saveGC;
|
||||
WMColor *color;
|
||||
WMPixel pixel, savePixel;
|
||||
WScreen *scr=menu->frame->screen_ptr;
|
||||
Window win = menu->menu->window;
|
||||
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) {
|
||||
textGC = scr->select_menu_gc;
|
||||
if (entry->flags.enabled)
|
||||
XSetForeground(dpy, textGC, scr->select_text_pixel);
|
||||
pixel = scr->select_text_pixel;
|
||||
else
|
||||
XSetForeground(dpy, textGC, scr->dtext_pixel);
|
||||
pixel = scr->dtext_pixel;
|
||||
} else if (!entry->flags.enabled) {
|
||||
textGC = scr->disabled_menu_entry_gc;
|
||||
textGC = scr->disabled_menu_entry_gc;
|
||||
pixel = scr->dtext_pixel;
|
||||
} else {
|
||||
textGC = scr->menu_entry_gc;
|
||||
textGC = scr->menu_entry_gc;
|
||||
pixel = scr->mtext_pixel;
|
||||
}
|
||||
/* draw text */
|
||||
x = 5;
|
||||
if (entry->flags.indicator)
|
||||
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));
|
||||
color->color.pixel = savePixel;
|
||||
scr->wmscreen->drawStringGC = saveGC;
|
||||
|
||||
if (entry->cascade>=0) {
|
||||
/* draw the cascade indicator */
|
||||
@@ -844,12 +859,18 @@ paintEntry(WMenu *menu, int index, int selected)
|
||||
/* draw right text */
|
||||
|
||||
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,
|
||||
strlen(entry->rtext));
|
||||
WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font, w-6-tw,
|
||||
y + 3 + wPreferences.menu_text_clearance, entry->rtext, strlen(entry->rtext));
|
||||
/* this is nasty */
|
||||
scr->wmscreen->drawStringGC = textGC;
|
||||
color->color.pixel = pixel;
|
||||
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
@@ -42,6 +42,8 @@
|
||||
|
||||
#include "geomview.h"
|
||||
|
||||
#include <WINGs/WINGsP.h>
|
||||
|
||||
|
||||
#ifdef KWM_HINTS
|
||||
#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;
|
||||
Window root = scr->root_win;
|
||||
GC gc = scr->line_gc;
|
||||
GC gc = scr->line_gc, saveGC;
|
||||
int ty, by, my, x, y, mx, s;
|
||||
char num[16];
|
||||
XSegment segment[4];
|
||||
int fw, fh;
|
||||
WMColor *color;
|
||||
WMPixel pixel;
|
||||
|
||||
ty = y1 + wwin->frame->top_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]); */
|
||||
|
||||
/* Display the height. */
|
||||
WMDrawString(scr->wmscreen, root, gc, scr->info_text_font,
|
||||
x - s + 3 - fw/2, my - fh/2 + 1, num, strlen(num));
|
||||
color = WMBlackColor(scr->wmscreen);
|
||||
saveGC = scr->wmscreen->drawStringGC;
|
||||
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);
|
||||
/* horizontal geometry */
|
||||
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]); */
|
||||
|
||||
/* 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));
|
||||
scr->wmscreen->drawStringGC = saveGC;
|
||||
color->color.pixel = pixel;
|
||||
WMReleaseColor(color);
|
||||
} else {
|
||||
WSetGeometryViewShownSize(scr->gview,
|
||||
(x2 - x1 - wwin->normal_hints->base_width)
|
||||
|
||||
@@ -375,9 +375,6 @@ allocGCs(WScreen *scr)
|
||||
gcv.graphics_exposures = False;
|
||||
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 */
|
||||
scr->clip_title_gc = XCreateGC(dpy, scr->w_win, GCGraphicsExposures, &gcv);
|
||||
|
||||
|
||||
+4
-4
@@ -164,9 +164,9 @@ typedef struct _WScreen {
|
||||
/* foreground colors */
|
||||
WMPixel window_title_pixel[3]; /* window titlebar text (foc, unfoc, pfoc)*/
|
||||
WMPixel menu_title_pixel[3]; /* menu titlebar text */
|
||||
WMPixel clip_title_pixel[2]; /* clip title text */
|
||||
WMPixel mtext_pixel; /* menu item text */
|
||||
WMPixel dtext_pixel; /* disabled menu item text */
|
||||
WMColor *clip_title_color[2]; /* clip title text */
|
||||
WMPixel mtext_pixel; /* menu item text */
|
||||
WMPixel dtext_pixel; /* disabled menu item text */
|
||||
WMPixel line_pixel;
|
||||
WMPixel frame_border_pixel; /* frame border */
|
||||
|
||||
@@ -188,7 +188,7 @@ typedef struct _WScreen {
|
||||
GC window_title_gc; /* window title text GC */
|
||||
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 menu_entry_gc; /* menu entries */
|
||||
GC select_menu_gc; /* selected menu entries */
|
||||
|
||||
+11
-5
@@ -323,9 +323,10 @@ wTextDestroy( WTextInput *wtext )
|
||||
\********************************************************************/
|
||||
static void
|
||||
textRefresh( WTextInput *wtext )
|
||||
{
|
||||
{
|
||||
int x1,x2,y1,y2;
|
||||
char *ptr = wtext->text.txt;
|
||||
WMColor *black, *white;
|
||||
|
||||
/* x1,y1 is the upper left corner of the text box */
|
||||
x1 = wtext->xOffset;
|
||||
@@ -339,9 +340,11 @@ textRefresh( WTextInput *wtext )
|
||||
XFillRectangle( dpy, wtext->core->window, wtext->invGC,
|
||||
x1, y1, x2-x1, y2-y1 );
|
||||
|
||||
black = WMBlackColor(wtext->core->screen_ptr->wmscreen);
|
||||
white = WMWhiteColor(wtext->core->screen_ptr->wmscreen);
|
||||
/* Draw the text normally */
|
||||
WMDrawString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
|
||||
wtext->regGC, wtext->font, x1, y1, ptr, wtext->text.length);
|
||||
WMDrawImageString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
|
||||
black, white, wtext->font, x1, y1, ptr, wtext->text.length);
|
||||
|
||||
/* Draw the selected text */
|
||||
if( wtext->text.startPos != wtext->text.endPos )
|
||||
@@ -372,10 +375,13 @@ textRefresh( WTextInput *wtext )
|
||||
|
||||
/* Draw the selected text... use invGC so it will be the
|
||||
* opposite color as the filled rectangle */
|
||||
WMDrawString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
|
||||
wtext->invGC, wtext->font, x1, y1, ptr, (ep - sp));
|
||||
WMDrawImageString(wtext->core->screen_ptr->wmscreen, wtext->core->window,
|
||||
white, black, wtext->font, x1, y1, ptr, (ep - sp));
|
||||
}
|
||||
|
||||
WMReleaseColor(white);
|
||||
WMReleaseColor(black);
|
||||
|
||||
/* And draw a quick little line for the cursor position */
|
||||
x1 = WMWidthOfString( wtext->font, wtext->text.txt, wtext->text.endPos )
|
||||
+ wtext->xOffset;
|
||||
|
||||
@@ -474,24 +474,20 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
|
||||
*/
|
||||
if (wwin->user_flags.no_appicon && wwin->defined_user_flags.no_appicon)
|
||||
wwin->user_flags.emulate_appicon = 0;
|
||||
/*//WSETUFLAG(wwin, emulate_appicon, 0);*/
|
||||
|
||||
if (wwin->main_window!=None) {
|
||||
WApplication *wapp = wApplicationOf(wwin->main_window);
|
||||
if (wapp && !wapp->flags.emulated)
|
||||
wwin->user_flags.emulate_appicon = 0;
|
||||
/*//WSETUFLAG(wwin, emulate_appicon, 0);*/
|
||||
}
|
||||
|
||||
if (wwin->transient_for!=None
|
||||
&& wwin->transient_for!=wwin->screen_ptr->root_win)
|
||||
wwin->user_flags.emulate_appicon = 0;
|
||||
/*//WSETUFLAG(wwin, emulate_appicon, 0);*/
|
||||
|
||||
if (wwin->user_flags.sunken && wwin->defined_user_flags.sunken
|
||||
&& wwin->user_flags.floating && wwin->defined_user_flags.floating)
|
||||
wwin->user_flags.sunken = 0;
|
||||
/*//WSETUFLAG(wwin, sunken, 0);*/
|
||||
|
||||
WSETUFLAG(wwin, no_shadeable, WFLAGP(wwin, no_titlebar));
|
||||
|
||||
@@ -1159,7 +1155,6 @@ wManageWindow(WScreen *scr, Window window)
|
||||
scr->window_title_texture,
|
||||
scr->resizebar_texture,
|
||||
scr->window_title_pixel,
|
||||
&scr->window_title_gc,
|
||||
&scr->title_font);
|
||||
|
||||
wwin->frame->flags.is_client_window_frame = 1;
|
||||
@@ -1519,7 +1514,6 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
||||
scr->window_title_texture,
|
||||
scr->resizebar_texture,
|
||||
scr->window_title_pixel,
|
||||
&scr->window_title_gc,
|
||||
&scr->title_font);
|
||||
|
||||
XSaveContext(dpy, window, wWinContext, (XPointer)&wwin->client_descriptor);
|
||||
|
||||
+20
-6
@@ -50,7 +50,7 @@
|
||||
#include "kwm.h"
|
||||
#endif
|
||||
|
||||
#include <WINGs/WUtil.h>
|
||||
#include <WINGs/WINGsP.h>
|
||||
|
||||
|
||||
extern WPreferences wPreferences;
|
||||
@@ -275,6 +275,7 @@ showWorkspaceName(WScreen *scr, int workspace)
|
||||
WorkspaceNameData *data;
|
||||
RXImage *ximg;
|
||||
Pixmap text, mask;
|
||||
WMColor *color;
|
||||
int w, h;
|
||||
int px, py;
|
||||
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);
|
||||
|
||||
XSetForeground(dpy, scr->mono_gc, 1);
|
||||
|
||||
color = WMWhiteColor(scr->wmscreen);
|
||||
|
||||
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++) {
|
||||
WMDrawString(scr->wmscreen, mask, scr->mono_gc,
|
||||
WMDrawString(scr->wmscreen, mask, color,
|
||||
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, scr->draw_gc, scr->workspace_name_font,
|
||||
WMDrawString(scr->wmscreen, text, color, scr->workspace_name_font,
|
||||
2, 2, scr->workspaces[workspace]->name,
|
||||
strlen(scr->workspaces[workspace]->name));
|
||||
strlen(scr->workspaces[workspace]->name));
|
||||
WMReleaseColor(color);
|
||||
#ifdef SHAPE
|
||||
XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask,
|
||||
ShapeSet);
|
||||
|
||||
@@ -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
|
||||
RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap,
|
||||
Pixmap *mask, int threshold)
|
||||
@@ -1142,3 +1145,4 @@ RGetClosestXColor(RContext *context, RColor *color, XColor *retColor)
|
||||
return True;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user