217 |
} |
} |
218 |
|
|
219 |
BOOL |
BOOL |
220 |
ui_init() |
ui_init(void) |
221 |
{ |
{ |
222 |
XPixmapFormatValues *pfm; |
XPixmapFormatValues *pfm; |
223 |
uint16 test; |
uint16 test; |
293 |
} |
} |
294 |
|
|
295 |
void |
void |
296 |
ui_deinit() |
ui_deinit(void) |
297 |
{ |
{ |
298 |
if (IM != NULL) |
if (IM != NULL) |
299 |
XCloseIM(IM); |
XCloseIM(IM); |
307 |
} |
} |
308 |
|
|
309 |
BOOL |
BOOL |
310 |
ui_create_window() |
ui_create_window(void) |
311 |
{ |
{ |
312 |
XSetWindowAttributes attribs; |
XSetWindowAttributes attribs; |
313 |
XClassHint *classhints; |
XClassHint *classhints; |
350 |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
351 |
StructureNotifyMask | FocusChangeMask; |
StructureNotifyMask | FocusChangeMask; |
352 |
|
|
|
if (grab_keyboard) |
|
|
input_mask |= EnterWindowMask | LeaveWindowMask; |
|
353 |
if (sendmotion) |
if (sendmotion) |
354 |
input_mask |= PointerMotionMask; |
input_mask |= PointerMotionMask; |
355 |
if (ownbackstore) |
if (ownbackstore) |
379 |
} |
} |
380 |
|
|
381 |
void |
void |
382 |
ui_destroy_window() |
ui_destroy_window(void) |
383 |
{ |
{ |
384 |
if (IC != NULL) |
if (IC != NULL) |
385 |
XDestroyIC(IC); |
XDestroyIC(IC); |
388 |
} |
} |
389 |
|
|
390 |
void |
void |
391 |
xwin_toggle_fullscreen() |
xwin_toggle_fullscreen(void) |
392 |
{ |
{ |
393 |
Pixmap contents = 0; |
Pixmap contents = 0; |
394 |
|
|
414 |
|
|
415 |
/* Process all events in Xlib queue */ |
/* Process all events in Xlib queue */ |
416 |
static void |
static void |
417 |
xwin_process_events() |
xwin_process_events(void) |
418 |
{ |
{ |
419 |
XEvent xevent; |
XEvent xevent; |
420 |
KeySym keysym; |
KeySym keysym; |
516 |
MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); |
MOUSE_FLAG_MOVE, xevent.xmotion.x, xevent.xmotion.y); |
517 |
break; |
break; |
518 |
|
|
519 |
case EnterNotify: |
case FocusIn: |
520 |
|
reset_modifier_keys(); |
521 |
if (grab_keyboard) |
if (grab_keyboard) |
522 |
XGrabKeyboard(display, wnd, True, |
XGrabKeyboard(display, wnd, True, |
523 |
GrabModeAsync, GrabModeAsync, CurrentTime); |
GrabModeAsync, GrabModeAsync, CurrentTime); |
524 |
break; |
break; |
525 |
|
|
526 |
case LeaveNotify: |
case FocusOut: |
527 |
if (grab_keyboard) |
if (grab_keyboard) |
528 |
XUngrabKeyboard(display, CurrentTime); |
XUngrabKeyboard(display, CurrentTime); |
529 |
break; |
break; |
530 |
|
|
|
case FocusIn: |
|
|
reset_modifier_keys(); |
|
|
break; |
|
|
|
|
531 |
case Expose: |
case Expose: |
532 |
XCopyArea(display, backstore, wnd, gc, |
XCopyArea(display, backstore, wnd, gc, |
533 |
xevent.xexpose.x, xevent.xexpose.y, |
xevent.xexpose.x, xevent.xexpose.y, |
847 |
} |
} |
848 |
|
|
849 |
void |
void |
850 |
ui_reset_clip() |
ui_reset_clip(void) |
851 |
{ |
{ |
852 |
XRectangle rect; |
XRectangle rect; |
853 |
|
|
859 |
} |
} |
860 |
|
|
861 |
void |
void |
862 |
ui_bell() |
ui_bell(void) |
863 |
{ |
{ |
864 |
XBell(display, 0); |
XBell(display, 0); |
865 |
} |
} |