mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 13:28:05 +01:00
- Added double buffering when drawing a WMFrame title with an AA font to avoid
flickering. - Added double buffering when drawing WMList items to avoid flickering - Shared xft drawable - Renamed AASystemFont and AABoldSystemFont to AntialiasedSystemFont respectively AntialiasedBoldSystemFont in WMGLOBAL - WMCreateFont falls back to normal fonts if antialiased fonts cannot be created (even if enabled)
This commit is contained in:
@@ -16,6 +16,9 @@ Changes since wmaker 0.80.1:
|
|||||||
- New options in WMGLOBAL: AntialiasedText, AASystemFont and AABoldSystemFont.
|
- New options in WMGLOBAL: AntialiasedText, AASystemFont and AABoldSystemFont.
|
||||||
Check NEWS for details.
|
Check NEWS for details.
|
||||||
- Fixed some improper calls to snprintf in wfont.c
|
- Fixed some improper calls to snprintf in wfont.c
|
||||||
|
- Added double buffering when drawing a WMFrame title with an AA font to avoid
|
||||||
|
flickering.
|
||||||
|
- Added double buffering when drawing WMList items to avoid flickering
|
||||||
|
|
||||||
|
|
||||||
Changes since wmaker 0.80.0:
|
Changes since wmaker 0.80.0:
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ testList(WMScreen *scr)
|
|||||||
list = WMCreateList(win);
|
list = WMCreateList(win);
|
||||||
/*WMSetListAllowEmptySelection(list, True);*/
|
/*WMSetListAllowEmptySelection(list, True);*/
|
||||||
WMMoveWidget(list, 10, 40);
|
WMMoveWidget(list, 10, 40);
|
||||||
for (i=0; i<50; i++) {
|
for (i=0; i<14050; i++) {
|
||||||
sprintf(text, "Item %i", i);
|
sprintf(text, "Item %i", i);
|
||||||
WMAddListItem(list, text);
|
WMAddListItem(list, text);
|
||||||
}
|
}
|
||||||
@@ -248,7 +248,7 @@ testList(WMScreen *scr)
|
|||||||
WMSetListAllowMultipleSelection(mlist, True);
|
WMSetListAllowMultipleSelection(mlist, True);
|
||||||
/*WMSetListAllowEmptySelection(mlist, True);*/
|
/*WMSetListAllowEmptySelection(mlist, True);*/
|
||||||
WMMoveWidget(mlist, 210, 40);
|
WMMoveWidget(mlist, 210, 40);
|
||||||
for (i=0; i<135; i++) {
|
for (i=0; i<14135; i++) {
|
||||||
sprintf(text, "Item %i", i);
|
sprintf(text, "Item %i", i);
|
||||||
WMAddListItem(mlist, text);
|
WMAddListItem(mlist, text);
|
||||||
}
|
}
|
||||||
@@ -1293,6 +1293,7 @@ main(int argc, char **argv)
|
|||||||
testDragAndDrop(scr);
|
testDragAndDrop(scr);
|
||||||
testText(scr);
|
testText(scr);
|
||||||
testFontPanel(scr);
|
testFontPanel(scr);
|
||||||
|
testList(scr);
|
||||||
#if 0
|
#if 0
|
||||||
testColorPanel(scr);
|
testColorPanel(scr);
|
||||||
testScrollView(scr);
|
testScrollView(scr);
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ typedef struct W_Screen {
|
|||||||
|
|
||||||
Window rootWin;
|
Window rootWin;
|
||||||
|
|
||||||
|
struct _XftDraw *xftdraw;
|
||||||
|
|
||||||
struct W_View *rootView;
|
struct W_View *rootView;
|
||||||
|
|
||||||
RContext *rcontext;
|
RContext *rcontext;
|
||||||
@@ -408,8 +410,8 @@ typedef struct W_EventHandler {
|
|||||||
typedef struct _WINGsConfiguration {
|
typedef struct _WINGsConfiguration {
|
||||||
char *systemFont;
|
char *systemFont;
|
||||||
char *boldSystemFont;
|
char *boldSystemFont;
|
||||||
char *aaSystemFont;
|
char *antialiasedSystemFont;
|
||||||
char *aaBoldSystemFont;
|
char *antialiasedBoldSystemFont;
|
||||||
int defaultFontSize;
|
int defaultFontSize;
|
||||||
Bool antialiasedText;
|
Bool antialiasedText;
|
||||||
Bool useMultiByte;
|
Bool useMultiByte;
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ W_ReadConfigurations(void)
|
|||||||
WINGsConfiguration.boldSystemFont =
|
WINGsConfiguration.boldSystemFont =
|
||||||
WMGetUDStringForKey(defaults, "BoldSystemFont");
|
WMGetUDStringForKey(defaults, "BoldSystemFont");
|
||||||
|
|
||||||
WINGsConfiguration.aaSystemFont =
|
WINGsConfiguration.antialiasedSystemFont =
|
||||||
WMGetUDStringForKey(defaults, "AASystemFont");
|
WMGetUDStringForKey(defaults, "AntialiasedSystemFont");
|
||||||
|
|
||||||
WINGsConfiguration.aaBoldSystemFont =
|
WINGsConfiguration.antialiasedBoldSystemFont =
|
||||||
WMGetUDStringForKey(defaults, "AABoldSystemFont");
|
WMGetUDStringForKey(defaults, "AntialiasedBoldSystemFont");
|
||||||
|
|
||||||
#ifdef XFT
|
#ifdef XFT
|
||||||
WINGsConfiguration.antialiasedText =
|
WINGsConfiguration.antialiasedText =
|
||||||
@@ -139,11 +139,11 @@ W_ReadConfigurations(void)
|
|||||||
if (!WINGsConfiguration.boldSystemFont) {
|
if (!WINGsConfiguration.boldSystemFont) {
|
||||||
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
||||||
}
|
}
|
||||||
if (!WINGsConfiguration.aaSystemFont) {
|
if (!WINGsConfiguration.antialiasedSystemFont) {
|
||||||
WINGsConfiguration.aaSystemFont = AASYSTEM_FONT;
|
WINGsConfiguration.antialiasedSystemFont = AASYSTEM_FONT;
|
||||||
}
|
}
|
||||||
if (!WINGsConfiguration.aaBoldSystemFont) {
|
if (!WINGsConfiguration.antialiasedBoldSystemFont) {
|
||||||
WINGsConfiguration.aaBoldSystemFont = AABOLD_SYSTEM_FONT;
|
WINGsConfiguration.antialiasedBoldSystemFont = AABOLD_SYSTEM_FONT;
|
||||||
}
|
}
|
||||||
if (!WINGsConfiguration.floppyPath) {
|
if (!WINGsConfiguration.floppyPath) {
|
||||||
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
||||||
|
|||||||
@@ -540,28 +540,39 @@ willResizeBrowser(W_ViewDelegate *self, WMView *view,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
paintItem(WMList *lPtr, int index, Drawable drawable, char *text, int state,
|
||||||
WMRect *rect)
|
WMRect *rect)
|
||||||
{
|
{
|
||||||
WMView *view = W_VIEW(lPtr);
|
WMView *view = W_VIEW(lPtr);
|
||||||
W_Screen *scr = view->screen;
|
W_Screen *scr = view->screen;
|
||||||
int width, height, x, y;
|
Display *display = scr->display;
|
||||||
|
WMFont *font = ((state & WLDSIsBranch) ? scr->boldFont : scr->normalFont);
|
||||||
|
int width, height, x, y, textLen;
|
||||||
|
Drawable d = drawable;
|
||||||
|
|
||||||
width = rect->size.width;
|
width = rect->size.width;
|
||||||
height = rect->size.height;
|
height = rect->size.height;
|
||||||
x = rect->pos.x;
|
x = rect->pos.x;
|
||||||
y = rect->pos.y;
|
y = rect->pos.y;
|
||||||
|
textLen = strlen(text);
|
||||||
|
|
||||||
|
#ifdef DOUBLE_BUFFER_no
|
||||||
|
x = y = 0;
|
||||||
|
d = XCreatePixmap(display, drawable, width, height, scr->depth);
|
||||||
if (state & WLDSSelected)
|
if (state & WLDSSelected)
|
||||||
XFillRectangle(scr->display, d, WMColorGC(scr->white), x, y,
|
XFillRectangle(display, d, WMColorGC(scr->white), 0, 0, width, height);
|
||||||
width, height);
|
|
||||||
else
|
else
|
||||||
XClearArea(scr->display, d, x, y, width, height, False);
|
XFillRectangle(display, d, WMColorGC(view->backColor), 0, 0, width, height);
|
||||||
|
#else
|
||||||
|
if (state & WLDSSelected)
|
||||||
|
XFillRectangle(display, d, WMColorGC(scr->white), x, y, width, height);
|
||||||
|
else
|
||||||
|
//XFillRectangle(display, d, WMColorGC(view->backColor), x, y, width, height);
|
||||||
|
XClearArea(display, d, x, y, width, height, False);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
/* Avoid overlaping... */
|
/* Avoid overlaping... */
|
||||||
WMFont *font = (state & WLDSIsBranch) ? scr->boldFont : scr->normalFont;
|
|
||||||
int textLen = strlen(text);
|
|
||||||
int widthC = (state & WLDSIsBranch) ? width-20 : width-8;
|
int widthC = (state & WLDSIsBranch) ? width-20 : width-8;
|
||||||
if (WMWidthOfString(font, text, textLen) > widthC) {
|
if (WMWidthOfString(font, text, textLen) > widthC) {
|
||||||
char *textBuf = createTruncatedString(font, text, &textLen, widthC);
|
char *textBuf = createTruncatedString(font, text, &textLen, widthC);
|
||||||
@@ -575,17 +586,23 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (state & WLDSIsBranch) {
|
if (state & WLDSIsBranch) {
|
||||||
XDrawLine(scr->display, d, WMColorGC(scr->darkGray), x+width-11, y+3,
|
XDrawLine(display, d, WMColorGC(scr->darkGray), x+width-11, y+3,
|
||||||
x+width-6, y+height/2);
|
x+width-6, y+height/2);
|
||||||
if (state & WLDSSelected)
|
if (state & WLDSSelected)
|
||||||
XDrawLine(scr->display, d,WMColorGC(scr->gray), x+width-11, y+height-5,
|
XDrawLine(display, d,WMColorGC(scr->gray), x+width-11, y+height-5,
|
||||||
x+width-6, y+height/2);
|
x+width-6, y+height/2);
|
||||||
else
|
else
|
||||||
XDrawLine(scr->display, d,WMColorGC(scr->white), x+width-11, y+height-5,
|
XDrawLine(display, d,WMColorGC(scr->white), x+width-11, y+height-5,
|
||||||
x+width-6, y+height/2);
|
x+width-6, y+height/2);
|
||||||
XDrawLine(scr->display, d, WMColorGC(scr->black), x+width-12, y+3,
|
XDrawLine(display, d, WMColorGC(scr->black), x+width-12, y+3,
|
||||||
x+width-12, y+height-5);
|
x+width-12, y+height-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DOUBLE_BUFFER_no
|
||||||
|
XCopyArea(display, d, drawable, scr->copyGC, 0, 0, width, height,
|
||||||
|
rect->pos.x, rect->pos.y);
|
||||||
|
XFreePixmap(display, d);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -291,8 +291,8 @@ WMCreateFont(WMScreen *scrPtr, char *fontName)
|
|||||||
if (scrPtr->useMultiByte) {
|
if (scrPtr->useMultiByte) {
|
||||||
return WMCreateFontSet(scrPtr, fontName);
|
return WMCreateFontSet(scrPtr, fontName);
|
||||||
} else if (scrPtr->antialiasedText) {
|
} else if (scrPtr->antialiasedText) {
|
||||||
/*// should revert to normal if this fails? */
|
WMFont *font = WMCreateAAFont(scrPtr, fontName);
|
||||||
return WMCreateAAFont(scrPtr, fontName);
|
return font ? font : WMCreateNormalFont(scrPtr, fontName);
|
||||||
} else {
|
} else {
|
||||||
return WMCreateNormalFont(scrPtr, fontName);
|
return WMCreateNormalFont(scrPtr, fontName);
|
||||||
}
|
}
|
||||||
@@ -373,13 +373,15 @@ makeSystemFontOfSize(WMScreen *scrPtr, int size, Bool bold)
|
|||||||
WMFont *font;
|
WMFont *font;
|
||||||
char *fontSpec, *aaFontSpec;
|
char *fontSpec, *aaFontSpec;
|
||||||
|
|
||||||
|
#define WConf WINGsConfiguration
|
||||||
if (bold) {
|
if (bold) {
|
||||||
fontSpec = makeFontSetOfSize(WINGsConfiguration.boldSystemFont, size);
|
fontSpec = makeFontSetOfSize(WConf.boldSystemFont, size);
|
||||||
aaFontSpec = makeFontSetOfSize(WINGsConfiguration.aaBoldSystemFont, size);
|
aaFontSpec = makeFontSetOfSize(WConf.antialiasedBoldSystemFont, size);
|
||||||
} else {
|
} else {
|
||||||
fontSpec = makeFontSetOfSize(WINGsConfiguration.systemFont, size);
|
fontSpec = makeFontSetOfSize(WConf.systemFont, size);
|
||||||
aaFontSpec = makeFontSetOfSize(WINGsConfiguration.aaSystemFont, size);
|
aaFontSpec = makeFontSetOfSize(WConf.antialiasedSystemFont, size);
|
||||||
}
|
}
|
||||||
|
#undef WConf
|
||||||
|
|
||||||
if (scrPtr->useMultiByte) {
|
if (scrPtr->useMultiByte) {
|
||||||
font = WMCreateFontSet(scrPtr, fontSpec);
|
font = WMCreateFontSet(scrPtr, fontSpec);
|
||||||
@@ -497,7 +499,6 @@ WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
|||||||
if (font->antialiased) {
|
if (font->antialiased) {
|
||||||
#ifdef XFT
|
#ifdef XFT
|
||||||
XftColor xftcolor;
|
XftColor xftcolor;
|
||||||
XftDraw *xftdraw;
|
|
||||||
|
|
||||||
xftcolor.color.red = color->color.red;
|
xftcolor.color.red = color->color.red;
|
||||||
xftcolor.color.green = color->color.green;
|
xftcolor.color.green = color->color.green;
|
||||||
@@ -505,13 +506,10 @@ WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
|||||||
xftcolor.color.alpha = color->alpha;;
|
xftcolor.color.alpha = color->alpha;;
|
||||||
xftcolor.pixel = W_PIXEL(color);
|
xftcolor.pixel = W_PIXEL(color);
|
||||||
|
|
||||||
/* //share if possible */
|
XftDrawChange(scr->xftdraw, d);
|
||||||
xftdraw = XftDrawCreate(scr->display, d, scr->visual, scr->colormap);
|
|
||||||
|
|
||||||
XftDrawString8(xftdraw, &xftcolor, font->font.xft,
|
XftDrawString8(scr->xftdraw, &xftcolor, font->font.xft,
|
||||||
x, y + font->y, text, length);
|
x, y + font->y, text, length);
|
||||||
|
|
||||||
XftDrawDestroy(xftdraw);
|
|
||||||
#else
|
#else
|
||||||
assert(False);
|
assert(False);
|
||||||
#endif
|
#endif
|
||||||
@@ -540,7 +538,6 @@ WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color, WMColor *background
|
|||||||
#ifdef XFT
|
#ifdef XFT
|
||||||
XftColor textColor;
|
XftColor textColor;
|
||||||
XftColor bgColor;
|
XftColor bgColor;
|
||||||
XftDraw *xftdraw;
|
|
||||||
|
|
||||||
textColor.color.red = color->color.red;
|
textColor.color.red = color->color.red;
|
||||||
textColor.color.green = color->color.green;
|
textColor.color.green = color->color.green;
|
||||||
@@ -554,16 +551,14 @@ WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color, WMColor *background
|
|||||||
bgColor.color.alpha = background->alpha;;
|
bgColor.color.alpha = background->alpha;;
|
||||||
bgColor.pixel = W_PIXEL(background);
|
bgColor.pixel = W_PIXEL(background);
|
||||||
|
|
||||||
/* //share if possible */
|
|
||||||
xftdraw = XftDrawCreate(scr->display, d, scr->visual, scr->colormap);
|
|
||||||
|
|
||||||
XftDrawRect(xftdraw, &bgColor, x, y,
|
XftDrawChange(scr->xftdraw, d);
|
||||||
|
|
||||||
|
XftDrawRect(scr->xftdraw, &bgColor, x, y,
|
||||||
WMWidthOfString(font, text, length), font->height);
|
WMWidthOfString(font, text, length), font->height);
|
||||||
|
|
||||||
XftDrawString8(xftdraw, &textColor, font->font.xft, x, y + font->y,
|
XftDrawString8(scr->xftdraw, &textColor, font->font.xft,
|
||||||
text, length);
|
x, y + font->y, text, length);
|
||||||
|
|
||||||
XftDrawDestroy(xftdraw);
|
|
||||||
#else
|
#else
|
||||||
assert(False);
|
assert(False);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -82,14 +82,18 @@ paintFrame(Frame *fPtr)
|
|||||||
{
|
{
|
||||||
W_View *view = fPtr->view;
|
W_View *view = fPtr->view;
|
||||||
W_Screen *scrPtr = view->screen;
|
W_Screen *scrPtr = view->screen;
|
||||||
int tx, ty, tw, th;
|
WMFont *font = scrPtr->normalFont;
|
||||||
|
Display *display = scrPtr->display;
|
||||||
|
int tx, ty, tw, th, tlen;
|
||||||
int fy, fh;
|
int fy, fh;
|
||||||
Bool drawTitle;
|
Bool drawTitle;
|
||||||
|
|
||||||
if (fPtr->caption!=NULL)
|
if (fPtr->caption!=NULL) {
|
||||||
th = WMFontHeight(scrPtr->normalFont);
|
th = WMFontHeight(font);
|
||||||
else {
|
tlen = strlen(fPtr->caption);
|
||||||
|
} else {
|
||||||
th = 0;
|
th = 0;
|
||||||
|
tlen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fh = view->size.height;
|
fh = view->size.height;
|
||||||
@@ -139,8 +143,7 @@ paintFrame(Frame *fPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fPtr->caption!=NULL && fPtr->flags.titlePosition!=WTPNoTitle) {
|
if (fPtr->caption!=NULL && fPtr->flags.titlePosition!=WTPNoTitle) {
|
||||||
tw = WMWidthOfString(scrPtr->normalFont, fPtr->caption,
|
tw = WMWidthOfString(font, fPtr->caption, tlen);
|
||||||
strlen(fPtr->caption));
|
|
||||||
|
|
||||||
tx = (view->size.width - tw) / 2;
|
tx = (view->size.width - tw) / 2;
|
||||||
|
|
||||||
@@ -180,7 +183,7 @@ paintFrame(Frame *fPtr)
|
|||||||
gc[3] = WMColorGC(scrPtr->white);
|
gc[3] = WMColorGC(scrPtr->white);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
XSetRegion(scrPtr->display, gc[i], region);
|
XSetRegion(display, gc[i], region);
|
||||||
}
|
}
|
||||||
XDestroyRegion(region);
|
XDestroyRegion(region);
|
||||||
|
|
||||||
@@ -188,13 +191,31 @@ paintFrame(Frame *fPtr)
|
|||||||
fPtr->flags.relief, gc[0], gc[1], gc[2], gc[3]);
|
fPtr->flags.relief, gc[0], gc[1], gc[2], gc[3]);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
XSetClipMask(scrPtr->display, gc[i], None);
|
XSetClipMask(display, gc[i], None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawTitle) {
|
if (drawTitle) {
|
||||||
WMDrawString(scrPtr, view->window, scrPtr->black, scrPtr->normalFont,
|
/* can't draw AA text over and over again because it gets messed */
|
||||||
tx, ty, fPtr->caption, strlen(fPtr->caption));
|
if (font->antialiased) {
|
||||||
|
#ifdef DOUBLE_BUFFER
|
||||||
|
Drawable d;
|
||||||
|
|
||||||
|
d = XCreatePixmap(display, view->window, tw, th, scrPtr->depth);
|
||||||
|
XFillRectangle(display, d, WMColorGC(view->backColor), 0, 0, tw, th);
|
||||||
|
|
||||||
|
WMDrawString(scrPtr, d, scrPtr->black, font, 0, 0, fPtr->caption, tlen);
|
||||||
|
XCopyArea(display, d, view->window, scrPtr->copyGC, 0, 0, tw, th, tx, ty);
|
||||||
|
XFreePixmap(display, d);
|
||||||
|
#else
|
||||||
|
XClearArea(display, view->window, tx, ty, tw, th, False);
|
||||||
|
WMDrawString(scrPtr, view->window, scrPtr->black, font, tx, ty,
|
||||||
|
fPtr->caption, tlen);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
WMDrawString(scrPtr, view->window, scrPtr->black, font, tx, ty,
|
||||||
|
fPtr->caption, tlen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
#include "WINGsP.h"
|
#include "WINGsP.h"
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
|
#ifdef XFT
|
||||||
|
# include <X11/Xft/Xft.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
@@ -620,6 +624,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
|||||||
|
|
||||||
scrPtr->fontSetCache = WMCreateHashTable(WMStringPointerHashCallbacks);
|
scrPtr->fontSetCache = WMCreateHashTable(WMStringPointerHashCallbacks);
|
||||||
|
|
||||||
|
#ifdef XFT
|
||||||
|
scrPtr->xftdraw = XftDrawCreate(scrPtr->display, W_DRAWABLE(scrPtr),
|
||||||
|
scrPtr->visual, scrPtr->colormap);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* create input method stuff */
|
/* create input method stuff */
|
||||||
W_InitIMStuff(scrPtr);
|
W_InitIMStuff(scrPtr);
|
||||||
|
|||||||
@@ -491,7 +491,8 @@ paintItem(List *lPtr, int index)
|
|||||||
{
|
{
|
||||||
WMView *view = lPtr->view;
|
WMView *view = lPtr->view;
|
||||||
W_Screen *scr = view->screen;
|
W_Screen *scr = view->screen;
|
||||||
int width, height, x, y;
|
Display *display = scr->display;
|
||||||
|
int width, height, x, y, tlen;
|
||||||
WMListItem *itemPtr;
|
WMListItem *itemPtr;
|
||||||
|
|
||||||
itemPtr = WMGetFromArray(lPtr->items, index);
|
itemPtr = WMGetFromArray(lPtr->items, index);
|
||||||
@@ -500,11 +501,14 @@ paintItem(List *lPtr, int index)
|
|||||||
height = lPtr->itemHeight;
|
height = lPtr->itemHeight;
|
||||||
x = 19;
|
x = 19;
|
||||||
y = 2 + (index-lPtr->topItem) * lPtr->itemHeight + 1;
|
y = 2 + (index-lPtr->topItem) * lPtr->itemHeight + 1;
|
||||||
|
tlen = strlen(itemPtr->text);
|
||||||
|
|
||||||
if (lPtr->flags.userDrawn) {
|
if (lPtr->flags.userDrawn) {
|
||||||
WMRect rect;
|
WMRect rect;
|
||||||
|
Drawable d = view->window;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
|
|
||||||
rect.size.width = width;
|
rect.size.width = width;
|
||||||
rect.size.height = height;
|
rect.size.height = height;
|
||||||
rect.pos.x = x;
|
rect.pos.x = x;
|
||||||
@@ -518,20 +522,41 @@ paintItem(List *lPtr, int index)
|
|||||||
if (itemPtr->isBranch)
|
if (itemPtr->isBranch)
|
||||||
flags |= WLDSIsBranch;
|
flags |= WLDSIsBranch;
|
||||||
|
|
||||||
|
#ifdef DOUBLE_BUFFER_no
|
||||||
|
d = XCreatePixmap(display, view->window, view->size.width,
|
||||||
|
view->size.height, scr->depth);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (lPtr->draw)
|
if (lPtr->draw)
|
||||||
(*lPtr->draw)(lPtr, index, view->window, itemPtr->text, flags,
|
(*lPtr->draw)(lPtr, index, d, itemPtr->text, flags, &rect);
|
||||||
&rect);
|
|
||||||
|
#ifdef DOUBLE_BUFFER_no
|
||||||
|
XCopyArea(display, d, view->window, scr->copyGC, x, y, width, height, x, y);
|
||||||
|
XFreePixmap(display, d);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef DOUBLE_BUFFER
|
||||||
|
WMColor *back = (itemPtr->selected ? scr->white : view->backColor);
|
||||||
|
Drawable d;
|
||||||
|
|
||||||
|
d = XCreatePixmap(display, view->window, width, height, scr->depth);
|
||||||
|
XFillRectangle(display, d, WMColorGC(back), 0, 0, width, height);
|
||||||
|
|
||||||
|
W_PaintText(view, d, scr->normalFont, 4, 0, width, WALeft, scr->black,
|
||||||
|
False, itemPtr->text, tlen);
|
||||||
|
XCopyArea(display, d, view->window, scr->copyGC, 0, 0, width, height, x, y);
|
||||||
|
XFreePixmap(display, d);
|
||||||
|
#else
|
||||||
if (itemPtr->selected) {
|
if (itemPtr->selected) {
|
||||||
XFillRectangle(scr->display, view->window, WMColorGC(scr->white),
|
XFillRectangle(display, view->window, WMColorGC(scr->white),
|
||||||
x, y, width, height);
|
x, y, width, height);
|
||||||
} else {
|
} else {
|
||||||
XClearArea(scr->display, view->window, x, y, width, height, False);
|
XClearArea(display, view->window, x, y, width, height, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
W_PaintText(view, view->window, scr->normalFont, x+4, y, width,
|
W_PaintText(view, view->window, scr->normalFont, x+4, y, width,
|
||||||
WALeft, scr->black, False,
|
WALeft, scr->black, False, itemPtr->text, tlen);
|
||||||
itemPtr->text, strlen(itemPtr->text));
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((index-lPtr->topItem+lPtr->fullFitLines)*lPtr->itemHeight >
|
if ((index-lPtr->topItem+lPtr->fullFitLines)*lPtr->itemHeight >
|
||||||
|
|||||||
@@ -208,24 +208,19 @@ W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor, W_Font *font,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* background */
|
/* background */
|
||||||
#ifndef DOUBLE_BUFFER
|
|
||||||
if (backColor) {
|
if (backColor) {
|
||||||
XFillRectangle(screen->display, d, WMColorGC(backColor),
|
XFillRectangle(screen->display, d, WMColorGC(backColor),
|
||||||
0, 0, view->size.width, view->size.height);
|
0, 0, view->size.width, view->size.height);
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef DOUBLE_BUFFER
|
||||||
XClearWindow(screen->display, d);
|
XClearWindow(screen->display, d);
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (backColor)
|
|
||||||
XFillRectangle(screen->display, d, WMColorGC(backColor), 0, 0,
|
|
||||||
view->size.width, view->size.height);
|
|
||||||
else {
|
|
||||||
XSetForeground(screen->display, screen->copyGC,
|
XSetForeground(screen->display, screen->copyGC,
|
||||||
view->attribs.background_pixel);
|
view->attribs.background_pixel);
|
||||||
XFillRectangle(screen->display, d, screen->copyGC, 0, 0,
|
XFillRectangle(screen->display, d, screen->copyGC, 0, 0,
|
||||||
view->size.width, view->size.height);
|
view->size.width, view->size.height);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (relief == WRFlat) {
|
if (relief == WRFlat) {
|
||||||
|
|||||||
@@ -440,10 +440,10 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
|||||||
y = rect->pos.y;
|
y = rect->pos.y;
|
||||||
|
|
||||||
if (state & WLDSSelected)
|
if (state & WLDSSelected)
|
||||||
XFillRectangle(dpy, d, WMColorGC(panel->white), x, y, width,
|
XFillRectangle(dpy, d, WMColorGC(panel->white), x, y, width, height);
|
||||||
height);
|
|
||||||
else
|
else
|
||||||
XClearArea(dpy, d, x, y, width, height, False);
|
//XClearArea(dpy, d, x, y, width, height, False);
|
||||||
|
XFillRectangle(dpy, d, WMColorGC(WMGrayColor(scr)), x, y, width, height);
|
||||||
|
|
||||||
if (panel->shortcuts[index]) {
|
if (panel->shortcuts[index]) {
|
||||||
WMPixmap *pix = WMGetSystemPixmap(scr, WSICheckMark);
|
WMPixmap *pix = WMGetSystemPixmap(scr, WSICheckMark);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
SystemFont = "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*";
|
SystemFont = "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*";
|
||||||
BoldSystemFont = "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*";
|
BoldSystemFont = "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*";
|
||||||
AASystemFont = "-*-arial-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
AntialiasedSystemFont = "-*-trebuchet ms-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
||||||
AABoldSystemFont = "-*-arial-bold-r-normal-*-%d-*-*-*-*-*-*-*";
|
AntialiasedBoldSystemFont = "-*-trebuchet ms-bold-r-normal-*-%d-*-*-*-*-*-*-*";
|
||||||
DefaultFontSize = 12;
|
DefaultFontSize = 12;
|
||||||
AntialiasedText = NO;
|
AntialiasedText = NO;
|
||||||
MultiByteText = AUTO;
|
MultiByteText = AUTO;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ with a .po extension, reconfigure WindowMaker and run
|
|||||||
make install.
|
make install.
|
||||||
|
|
||||||
To update an already translated message file use the msgmerge command. As in:
|
To update an already translated message file use the msgmerge command. As in:
|
||||||
msgmerge WindowMaker.pot pt.po > pt.po.new
|
msgmerge pt.po WindowMaker.pot > pt.po.new
|
||||||
|
|
||||||
If you use an older version of gettext, the command is tupdate, instead
|
If you use an older version of gettext, the command is tupdate, instead
|
||||||
of msgmerge.
|
of msgmerge.
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ INCLUDES = \
|
|||||||
wmaker_LDADD = \
|
wmaker_LDADD = \
|
||||||
$(top_builddir)/WINGs/libWINGs.a\
|
$(top_builddir)/WINGs/libWINGs.a\
|
||||||
$(top_builddir)/wrlib/libwraster.la\
|
$(top_builddir)/wrlib/libwraster.la\
|
||||||
@XLIBS@ \
|
|
||||||
@XFTLIBS@ \
|
@XFTLIBS@ \
|
||||||
|
@XLIBS@ \
|
||||||
@INTLIBS@ \
|
@INTLIBS@ \
|
||||||
@DLLIBS@
|
@DLLIBS@
|
||||||
|
|
||||||
|
|||||||
@@ -650,7 +650,8 @@ wGNOMERemoveClient(WWindow *wwin)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void observer(void *self, WMNotification *notif)
|
static void
|
||||||
|
observer(void *self, WMNotification *notif)
|
||||||
{
|
{
|
||||||
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
|
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
|
||||||
const char *name = WMGetNotificationName(notif);
|
const char *name = WMGetNotificationName(notif);
|
||||||
@@ -668,7 +669,9 @@ static void observer(void *self, WMNotification *notif)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wsobserver(void *self, WMNotification *notif)
|
|
||||||
|
static void
|
||||||
|
wsobserver(void *self, WMNotification *notif)
|
||||||
{
|
{
|
||||||
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
|
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
|
||||||
const char *name = WMGetNotificationName(notif);
|
const char *name = WMGetNotificationName(notif);
|
||||||
@@ -681,8 +684,6 @@ static void wsobserver(void *self, WMNotification *notif)
|
|||||||
wGNOMEUpdateWorkspaceNamesHint(scr);
|
wGNOMEUpdateWorkspaceNamesHint(scr);
|
||||||
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
|
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
|
||||||
wGNOMEUpdateCurrentWorkspaceHint(scr);
|
wGNOMEUpdateCurrentWorkspaceHint(scr);
|
||||||
|
|
||||||
|
|
||||||
} else if (strcmp(name, WMNResetStacking) == 0) {
|
} else if (strcmp(name, WMNResetStacking) == 0) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -352,6 +352,9 @@ wOLWMCheckClientHints(WWindow *wwin)
|
|||||||
|
|
||||||
menuType = MT_LIMITED;
|
menuType = MT_LIMITED;
|
||||||
|
|
||||||
|
/* this is a transient-like window */
|
||||||
|
wwin->client_flags.olwm_transient = 1;
|
||||||
|
|
||||||
} else if (hints.winType == WT_NOTICE) {
|
} else if (hints.winType == WT_NOTICE) {
|
||||||
|
|
||||||
decoration = OL_DECORATION_ICONNAME;
|
decoration = OL_DECORATION_ICONNAME;
|
||||||
@@ -397,11 +400,6 @@ wOLWMCheckClientHints(WWindow *wwin)
|
|||||||
else
|
else
|
||||||
wwin->flags.olwm_limit_menu = 1;
|
wwin->flags.olwm_limit_menu = 1;
|
||||||
|
|
||||||
/* this is a transient-like window */
|
|
||||||
if (hints.winType == WT_CMD) {
|
|
||||||
wwin->client_flags.olwm_transient = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Emulate olwm pushpin.
|
* Emulate olwm pushpin.
|
||||||
* If the initial state of the pin is in, then put the normal close
|
* If the initial state of the pin is in, then put the normal close
|
||||||
|
|||||||
Reference in New Issue
Block a user