78 |
XFillRectangle(display, backstore, gc, x, y, cx, cy); \ |
XFillRectangle(display, backstore, gc, x, y, cx, cy); \ |
79 |
} |
} |
80 |
|
|
81 |
|
#define FILL_RECTANGLE_BACKSTORE(x,y,cx,cy)\ |
82 |
|
{ \ |
83 |
|
XFillRectangle(display, ownbackstore ? backstore : wnd, gc, x, y, cx, cy); \ |
84 |
|
} |
85 |
|
|
86 |
/* colour maps */ |
/* colour maps */ |
87 |
BOOL owncolmap = False; |
BOOL owncolmap = False; |
88 |
static Colormap xcolmap; |
static Colormap xcolmap; |
128 |
hintsatom = XInternAtom(display, "_MOTIF_WM_HINTS", False); |
hintsatom = XInternAtom(display, "_MOTIF_WM_HINTS", False); |
129 |
if (!hintsatom) |
if (!hintsatom) |
130 |
{ |
{ |
131 |
error("Failed to get atom _MOTIF_WM_HINTS\n"); |
warning("Failed to get atom _MOTIF_WM_HINTS: probably your window manager does not support MWM hints\n"); |
132 |
return; |
return; |
133 |
} |
} |
134 |
|
|
300 |
{ |
{ |
301 |
xcolmap = DefaultColormapOfScreen(screen); |
xcolmap = DefaultColormapOfScreen(screen); |
302 |
if (depth <= 8) |
if (depth <= 8) |
303 |
{ |
warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n"); |
|
printf("You're using a screen depth of 8-bits or lower\n"); |
|
|
printf("If you get scewed colours, try the -C switch\n"); |
|
|
} |
|
304 |
} |
} |
305 |
|
|
306 |
gc = XCreateGC(display, RootWindowOfScreen(screen), 0, NULL); |
gc = XCreateGC(display, RootWindowOfScreen(screen), 0, NULL); |
315 |
if ((width == 0) || (height == 0)) |
if ((width == 0) || (height == 0)) |
316 |
{ |
{ |
317 |
/* Fetch geometry from _NET_WORKAREA */ |
/* Fetch geometry from _NET_WORKAREA */ |
318 |
uint32 xpos, ypos; |
uint32 x, y, cx, cy; |
319 |
|
|
320 |
if (get_current_workarea(&xpos, &ypos, &width, &height) < 0) |
if (get_current_workarea(&x, &y, &cx, &cy) == 0) |
321 |
{ |
{ |
322 |
error("Failed to get workarea.\n"); |
width = cx; |
323 |
error("Perhaps your window manager does not support EWMH?\n"); |
height = cy; |
324 |
error("Defaulting to geometry 800x600\n"); |
} |
325 |
|
else |
326 |
|
{ |
327 |
|
warning("Failed to get workarea: probably your window manager does not support extended hints\n"); |
328 |
width = 800; |
width = 800; |
329 |
height = 600; |
height = 600; |
330 |
} |
} |
607 |
break; |
break; |
608 |
|
|
609 |
case MotionNotify: |
case MotionNotify: |
610 |
|
if (fullscreen && !focused) |
611 |
|
XSetInputFocus(display, wnd, RevertToPointerRoot, |
612 |
|
CurrentTime); |
613 |
rdp_send_input(time(NULL), RDP_INPUT_MOUSE, |
rdp_send_input(time(NULL), RDP_INPUT_MOUSE, |
614 |
MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); |
MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); |
615 |
break; |
break; |
1192 |
XSetStipple(display, gc, (Pixmap) glyph); |
XSetStipple(display, gc, (Pixmap) glyph); |
1193 |
XSetTSOrigin(display, gc, x, y); |
XSetTSOrigin(display, gc, x, y); |
1194 |
|
|
1195 |
if (ownbackstore) |
FILL_RECTANGLE_BACKSTORE(x, y, cx, cy); |
|
XFillRectangle(display, backstore, gc, x, y, cx, cy); |
|
|
else |
|
|
XFillRectangle(display, wnd, gc, x, y, cx, cy); |
|
1196 |
|
|
1197 |
XSetFillStyle(display, gc, FillSolid); |
XSetFillStyle(display, gc, FillSolid); |
1198 |
} |
} |
1221 |
}\ |
}\ |
1222 |
if (glyph != NULL)\ |
if (glyph != NULL)\ |
1223 |
{\ |
{\ |
1224 |
ui_draw_glyph (mixmode, x + (short) glyph->offset,\ |
ui_draw_glyph (mixmode, x + glyph->offset,\ |
1225 |
y + (short) glyph->baseline,\ |
y + glyph->baseline,\ |
1226 |
glyph->width, glyph->height,\ |
glyph->width, glyph->height,\ |
1227 |
glyph->pixmap, 0, 0, bgcolour, fgcolour);\ |
glyph->pixmap, 0, 0, bgcolour, fgcolour);\ |
1228 |
if (flags & TEXT2_IMPLICIT_X)\ |
if (flags & TEXT2_IMPLICIT_X)\ |
1244 |
|
|
1245 |
if (boxcx > 1) |
if (boxcx > 1) |
1246 |
{ |
{ |
1247 |
FILL_RECTANGLE(boxx, boxy, boxcx, boxcy); |
FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy); |
1248 |
} |
} |
1249 |
else if (mixmode == MIX_OPAQUE) |
else if (mixmode == MIX_OPAQUE) |
1250 |
{ |
{ |
1251 |
FILL_RECTANGLE(clipx, clipy, clipcx, clipcy); |
FILL_RECTANGLE_BACKSTORE(clipx, clipy, clipcx, clipcy); |
1252 |
} |
} |
1253 |
|
|
1254 |
/* Paint text, character by character */ |
/* Paint text, character by character */ |
1282 |
else |
else |
1283 |
x += text[i + 2]; |
x += text[i + 2]; |
1284 |
} |
} |
|
if (i + 2 < length) |
|
|
i += 3; |
|
|
else |
|
|
i += 2; |
|
|
length -= i; |
|
|
/* this will move pointer from start to first character after FE command */ |
|
|
text = &(text[i]); |
|
|
i = 0; |
|
1285 |
for (j = 0; j < entry->size; j++) |
for (j = 0; j < entry->size; j++) |
1286 |
DO_GLYPH(((uint8 *) (entry->data)), j); |
DO_GLYPH(((uint8 *) (entry->data)), j); |
1287 |
} |
} |
1288 |
|
if (i + 2 < length) |
1289 |
|
i += 3; |
1290 |
|
else |
1291 |
|
i += 2; |
1292 |
|
length -= i; |
1293 |
|
/* this will move pointer from start to first character after FE command */ |
1294 |
|
text = &(text[i]); |
1295 |
|
i = 0; |
1296 |
break; |
break; |
1297 |
|
|
1298 |
default: |
default: |