1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-16 11:44:14 +01:00

pass texture to plugin so it doesn't have to grab from title bar.

add experiment plugin support to menu entry, performance need to
be improved. I'm thinking of making a compressed expose event geometry.
This commit is contained in:
id
2000-12-06 16:34:58 +00:00
parent 83824dbcc3
commit 756ab2c019
4 changed files with 51 additions and 8 deletions

View File

@@ -652,14 +652,17 @@ WDefaultEntry optionList[] = {
{"MenuTitleColor", "white", NULL,
NULL, getTextRenderer, setMenuTitleColor
},
{"MenuTextColor", "black", NULL,
NULL, getTextRenderer, setMenuTextColor
},
#else
{"MenuTitleColor", "white", NULL,
NULL, getColor, setMenuTitleColor
},
#endif
{"MenuTextColor", "black", NULL,
NULL, getColor, setMenuTextColor
},
#endif
{"MenuDisabledColor", "\"#616161\"", NULL,
NULL, getColor, setMenuDisabledColor
},

View File

@@ -1093,16 +1093,17 @@ wFrameWindowPaint(WFrameWindow *fwin)
scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->proc.drawString(
scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->arg,
fwin->titlebar->window,
x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
x, 0,
fwin->titlebar->width, fwin->top_width,
fwin->title, p);
free(p);
} else {
WMDrawString(scr->wmscreen, fwin->titlebar->window,
*fwin->title_gc, *fwin->font,
x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
x, ((signed)fwin->top_width - (signed)WMFontHeight(*fwin->font))/2,
title, titlelen);
}
#undef DRAWSTRING_CURRENT_STATE
#else
WMDrawString(scr->wmscreen, fwin->titlebar->window,
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,

View File

@@ -784,8 +784,37 @@ paintEntry(WMenu *menu, int index, int selected)
if (entry->flags.indicator)
x += MENU_INDICATOR_SPACE + 2;
#ifdef DRAWSTRING_PLUGIN
if (scr->drawstring_func[W_STRING_MTEXT]) {
Pixmap tmp_bg;
void **p;
tmp_bg = XCreatePixmap(dpy, win, w, menu->entry_height, DefaultDepth(dpy, DefaultScreen(dpy)));
XCopyArea(dpy, win, tmp_bg, textGC, 0, y, w, menu->entry_height, 0, 0);
p = wPluginPackData(4,
textGC,
scr->menu_entry_font,
scr->drawstring_func[W_STRING_MTEXT]->data,
/*menu->menu_texture_data,*/
tmp_bg,
"extendable");
scr->drawstring_func[W_STRING_MTEXT]->proc.drawString(
scr->drawstring_func[W_STRING_MTEXT]->arg,
win,
x, y,
menu->frame->titlebar->width, menu->entry_height,
entry->text, p);
XFreePixmap(dpy, tmp_bg);
free(p);
#undef DRAWSTRING_CURRENT_STATE
} else {
WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font,
x, 3 + y + wPreferences.menu_text_clearance, entry->text, strlen(entry->text));
}
#else
WMDrawString(scr->wmscreen, win, textGC, scr->menu_entry_font,
x, 3 + y + wPreferences.menu_text_clearance, entry->text, strlen(entry->text));
#endif
if (entry->cascade>=0) {
/* draw the cascade indicator */