41 if((width < 1) || (height < 1)) {
44 if(
Scr->Monochrome != COLOR) {
47 gcv.fill_style = FillOpaqueStippled;
48 XChangeGC(
dpy,
Scr->BorderGC, gcm, &gcv);
49 XFillRectangle(
dpy, w,
Scr->BorderGC,
x,
y, width, height);
53 gcv.line_style = (state ==
on) ? LineSolid : LineDoubleDash;
55 gcv.fill_style = FillSolid;
56 XChangeGC(
dpy,
Scr->BorderGC, gcm, &gcv);
57 for(i = 0; i < bw; i++) {
58 XDrawLine(
dpy, w,
Scr->BorderGC,
x,
y + i,
59 x + width - i - 1,
y + i);
60 XDrawLine(
dpy, w,
Scr->BorderGC,
x + i,
y,
61 x + i,
y + height - i - 1);
66 gcv.line_style = (state ==
on) ? LineDoubleDash : LineSolid;
68 gcv.fill_style = FillSolid;
69 XChangeGC(
dpy,
Scr->BorderGC, gcm, &gcv);
70 for(i = 0; i < bw; i++) {
71 XDrawLine(
dpy, w,
Scr->BorderGC,
x + width - i - 1,
y + i,
72 x + width - i - 1,
y + height - 1);
73 XDrawLine(
dpy, w,
Scr->BorderGC,
x + i,
y + height - i - 1,
74 x + width - 1,
y + height - i - 1);
81 XFillRectangle(
dpy, w,
Scr->BorderGC,
x,
y, width, height);
83 if(
Scr->BeNiceToColormap) {
88 gcv.line_style = (forcebw) ? LineSolid : LineDoubleDash;
90 gcv.background = cp.
back;
91 XChangeGC(
dpy,
Scr->BorderGC, gcm, &gcv);
94 XSetForeground(
dpy,
Scr->BorderGC,
Scr->Black);
97 XSetForeground(
dpy,
Scr->BorderGC,
Scr->White);
99 for(i = 0; i < bw; i++) {
100 XDrawLine(
dpy, w,
Scr->BorderGC,
x + i,
y + dashoffset,
101 x + i,
y + height - i - 1);
102 XDrawLine(
dpy, w,
Scr->BorderGC,
x + dashoffset,
y + i,
103 x + width - i - 1,
y + i);
104 dashoffset = 1 - dashoffset;
106 XSetForeground(
dpy,
Scr->BorderGC, ((state ==
on) ?
Scr->White :
Scr->Black));
107 for(i = 0; i < bw; i++) {
108 XDrawLine(
dpy, w,
Scr->BorderGC,
x + i,
y + height - i - 1,
109 x + width - 1,
y + height - i - 1);
110 XDrawLine(
dpy, w,
Scr->BorderGC,
x + width - i - 1,
y + i,
111 x + width - i - 1,
y + height - 1);
121 for(i = 0; i < bw; i++) {
122 XDrawLine(
dpy, w,
Scr->BorderGC,
x,
y + i,
123 x + width - i - 1,
y + i);
124 XDrawLine(
dpy, w,
Scr->BorderGC,
x + i,
y,
125 x + i,
y + height - i - 1);
134 for(i = 0; i < bw; i++) {
135 XDrawLine(
dpy, w,
Scr->BorderGC,
x + width - i - 1,
y + i,
136 x + width - i - 1,
y + height - 1);
137 XDrawLine(
dpy, w,
Scr->BorderGC,
x + i,
y + height - i - 1,
138 x + width - 1,
y + height - i - 1);
163 font =
Scr->workSpaceMgr.buttonFont;
184 XRectangle logical_rect;
186 XmbTextExtents(font.
font_set, label, strlen(label), &inc_rect,
188 strHei = logical_rect.height;
189 vspace = ((bheight + strHei - font.
descent) / 2);
190 strWid = logical_rect.width;
191 hspace = (bwidth - strWid) / 2;
194 if(hspace < (
Scr->WMgrButtonShadowDepth + 1)) {
195 hspace =
Scr->WMgrButtonShadowDepth + 1;
197 XClearWindow(
dpy, w);
199 if(
Scr->Monochrome == COLOR) {
201 cp, state,
true,
false);
203 switch(
Scr->workSpaceMgr.buttonStyle) {
209 Scr->WMgrButtonShadowDepth - 1,
210 Scr->WMgrButtonShadowDepth - 1,
211 bwidth - 2 *
Scr->WMgrButtonShadowDepth + 2,
212 bheight - 2 *
Scr->WMgrButtonShadowDepth + 2,
213 1, cp, (state ==
on) ?
off :
on,
true,
false);
218 Scr->WMgrButtonShadowDepth / 2,
219 Scr->WMgrButtonShadowDepth / 2,
220 bwidth -
Scr->WMgrButtonShadowDepth,
221 bheight -
Scr->WMgrButtonShadowDepth,
222 1, cp, (state ==
on) ?
off :
on,
true,
false);
231 1, cp, (state ==
on) ?
off :
on,
true,
false);
235 XmbDrawString(
dpy, w, font.
font_set,
Scr->NormalGC, hspace, vspace,
236 label, strlen(label));
240 cp, state,
true,
false);
243 XmbDrawImageString(
dpy, w, font.
font_set,
Scr->NormalGC, hspace, vspace,
244 label, strlen(label));
248 XmbDrawImageString(
dpy, w, font.
font_set,
Scr->NormalGC, hspace, vspace,
249 label, strlen(label));
void Draw3DBorder(Window w, int x, int y, int width, int height, int bw, ColorPair cp, ButtonState state, bool fill, bool forcebw)
void PaintWsButton(PWBType which, VirtualScreen *vs, Window w, char *label, ColorPair cp, ButtonState state)