32 |
extern int g_height; |
extern int g_height; |
33 |
extern int g_xpos; |
extern int g_xpos; |
34 |
extern int g_ypos; |
extern int g_ypos; |
35 |
|
extern int g_pos; |
36 |
extern BOOL g_sendmotion; |
extern BOOL g_sendmotion; |
37 |
extern BOOL g_fullscreen; |
extern BOOL g_fullscreen; |
38 |
extern BOOL g_grab_keyboard; |
extern BOOL g_grab_keyboard; |
1164 |
wndwidth = g_fullscreen ? WidthOfScreen(g_screen) : g_width; |
wndwidth = g_fullscreen ? WidthOfScreen(g_screen) : g_width; |
1165 |
wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; |
wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; |
1166 |
|
|
1167 |
|
/* Handle -x-y portion of geometry string */ |
1168 |
|
if (g_xpos < 0 || (g_xpos == 0 && (g_pos & 2))) |
1169 |
|
g_xpos = WidthOfScreen(g_screen) + g_xpos - g_width; |
1170 |
|
if (g_ypos < 0 || (g_ypos == 0 && (g_pos & 4))) |
1171 |
|
g_ypos = HeightOfScreen(g_screen) + g_ypos - g_height; |
1172 |
|
|
1173 |
attribs.background_pixel = BlackPixelOfScreen(g_screen); |
attribs.background_pixel = BlackPixelOfScreen(g_screen); |
1174 |
attribs.border_pixel = WhitePixelOfScreen(g_screen); |
attribs.border_pixel = WhitePixelOfScreen(g_screen); |
1175 |
attribs.backing_store = g_ownbackstore ? NotUseful : Always; |
attribs.backing_store = g_ownbackstore ? NotUseful : Always; |
1213 |
if (sizehints) |
if (sizehints) |
1214 |
{ |
{ |
1215 |
sizehints->flags = PMinSize | PMaxSize; |
sizehints->flags = PMinSize | PMaxSize; |
1216 |
|
if (g_pos) |
1217 |
|
sizehints->flags |= PPosition; |
1218 |
sizehints->min_width = sizehints->max_width = g_width; |
sizehints->min_width = sizehints->max_width = g_width; |
1219 |
sizehints->min_height = sizehints->max_height = g_height; |
sizehints->min_height = sizehints->max_height = g_height; |
1220 |
XSetWMNormalHints(g_display, g_wnd, sizehints); |
XSetWMNormalHints(g_display, g_wnd, sizehints); |
1341 |
} |
} |
1342 |
} |
} |
1343 |
|
|
1344 |
/* Process all events in Xlib queue |
/* Process events in Xlib queue |
1345 |
Returns 0 after user quit, 1 otherwise */ |
Returns 0 after user quit, 1 otherwise */ |
1346 |
static int |
static int |
1347 |
xwin_process_events(void) |
xwin_process_events(void) |
1353 |
key_translation tr; |
key_translation tr; |
1354 |
char str[256]; |
char str[256]; |
1355 |
Status status; |
Status status; |
1356 |
|
int events = 0; |
1357 |
|
|
1358 |
while (XPending(g_display) > 0) |
while ((XPending(g_display) > 0) && events++ < 20) |
1359 |
{ |
{ |
1360 |
XNextEvent(g_display, &xevent); |
XNextEvent(g_display, &xevent); |
1361 |
|
|
2272 |
RESET_FUNCTION(opcode); |
RESET_FUNCTION(opcode); |
2273 |
} |
} |
2274 |
|
|
2275 |
|
void |
2276 |
|
ui_polyline(uint8 opcode, |
2277 |
|
/* dest */ POINT * points, int npoints, |
2278 |
|
/* pen */ PEN * pen) |
2279 |
|
{ |
2280 |
|
/* TODO: set join style */ |
2281 |
|
SET_FUNCTION(opcode); |
2282 |
|
SET_FOREGROUND(pen->colour); |
2283 |
|
XDrawLines(g_display, g_wnd, g_gc, (XPoint *) points, npoints, CoordModePrevious); |
2284 |
|
if (g_ownbackstore) |
2285 |
|
XDrawLines(g_display, g_backstore, g_gc, (XPoint *) points, npoints, |
2286 |
|
CoordModePrevious); |
2287 |
|
RESET_FUNCTION(opcode); |
2288 |
|
} |
2289 |
|
|
2290 |
void |
void |
2291 |
ui_ellipse(uint8 opcode, |
ui_ellipse(uint8 opcode, |
2292 |
/* mode */ uint8 fillmode, |
/* mode */ uint8 fillmode, |