diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 16b8caad..b3b7d7b6 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -24,6 +24,7 @@ Changes since wmaker 0.80.1: details and incompatibilities introduced by this change. - Added new Bool WMIsAAFont(WMFont *font) to check if a font is AA or not. - Added WMGetColorAlpha(WMColor *color) +- Added WMCreateNonAAFont() Changes since wmaker 0.80.0: diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index 3a085283..f499e0d5 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -701,6 +701,8 @@ WMFont* WMCreateNormalFont(WMScreen *scrPtr, char *fontName); WMFont* WMCreateAAFont(WMScreen *scrPtr, char *fontName); +WMFont* WMCreateNonAAFont(WMScreen *scrPtr, char *fontName); + WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName); WMFont* WMRetainFont(WMFont *font); diff --git a/WINGs/wfont.c b/WINGs/wfont.c index b729a2c1..cd9ba981 100644 --- a/WINGs/wfont.c +++ b/WINGs/wfont.c @@ -285,6 +285,17 @@ WMCreateAAFont(WMScreen *scrPtr, char *fontName) } +WMFont* +WMCreateNonAAFont(WMScreen *scrPtr, char *fontName) +{ + if (scrPtr->useMultiByte) { + return WMCreateFontSet(scrPtr, fontName); + } else { + return WMCreateNormalFont(scrPtr, fontName); + } +} + + WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName) { diff --git a/src/framewin.c b/src/framewin.c index be1a3b18..c7ee541d 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -787,7 +787,7 @@ updateTexture(WFrameWindow *fwin) { int i; unsigned long pixel; - + i = fwin->flags.state; if (fwin->titlebar) { if (fwin->title_texture[i]->any.type!=WTEX_SOLID) { @@ -802,9 +802,9 @@ updateTexture(WFrameWindow *fwin) if (fwin->language_button && fwin->languagebutton_back[i]) { XSetWindowBackgroundPixmap(dpy, fwin->language_button->window, fwin->languagebutton_back[i]); - } + } #endif - + if (fwin->right_button && fwin->rbutton_back[i]) XSetWindowBackgroundPixmap(dpy, fwin->right_button->window, fwin->rbutton_back[i]); @@ -867,10 +867,10 @@ remakeTexture(WFrameWindow *fwin, int state) if (fwin->title_texture[state]->any.type!=WTEX_SOLID) { int left, right; -#ifdef XKB_BUTTON_HINT - int language; -#endif int width; +#ifdef XKB_BUTTON_HINT + int language; +#endif /* eventually surrounded by if new_style */ left = fwin->left_button && !fwin->flags.hide_left_button @@ -1050,6 +1050,7 @@ wFrameWindowPaint(WFrameWindow *fwin) if (fwin->title) { char *title; + int h, y; title = ShrinkString(*fwin->font, fwin->title, fwin->titlebar->width - lofs - rofs); @@ -1073,13 +1074,47 @@ wFrameWindowPaint(WFrameWindow *fwin) break; } + y = *fwin->title_clearance + TITLEBAR_EXTEND_SPACE; + h = WMFontHeight(*fwin->font); + +//#define DBL_BUF +#ifdef DBL_BUF + // what is going on here? + { + Drawable buf; + int i; + + buf = XCreatePixmap(dpy, fwin->titlebar->window, w, h, + scr->w_depth); + + i = fwin->flags.state; + if (fwin->title_texture[i]->any.type!=WTEX_SOLID) { + XCopyArea(dpy, fwin->title_back[i], buf, scr->copy_gc, + x, y, w, h, 0, 0); + } else { + XSetForeground(dpy, scr->copy_gc, + fwin->title_texture[i]->solid.normal.pixel); + XFillRectangle(dpy, buf, scr->copy_gc, 0, 0, w, h); + } + + WMDrawString(scr->wmscreen, buf, + fwin->title_color[fwin->flags.state], + *fwin->font, 0, 0, title, titlelen); + + XCopyArea(dpy, buf, fwin->titlebar->window, scr->copy_gc, + 0, 0, w, h, x, y); + + XFreePixmap(dpy, buf); + } +#else + XClearArea(dpy, fwin->titlebar->window, x, y, w, h, False); + WMDrawString(scr->wmscreen, fwin->titlebar->window, fwin->title_color[fwin->flags.state], - *fwin->font, x, - *fwin->title_clearance + TITLEBAR_EXTEND_SPACE, - title, titlelen); + *fwin->font, x, y, title, titlelen); +#endif - wfree(title); + wfree(title); } if (fwin->left_button) diff --git a/src/screen.c b/src/screen.c index a4b9ec35..6886bb38 100644 --- a/src/screen.c +++ b/src/screen.c @@ -823,9 +823,9 @@ wScreenInit(int screen_number) /* initialize balloon text stuff */ wBalloonInitialize(scr); #endif - + scr->info_text_font = WMBoldSystemFontOfSize(scr->wmscreen, 12); - + scr->gview = WCreateGeometryView(scr->wmscreen); WMRealizeWidget(scr->gview);