ui_x11.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. /*
  2. * ui_x11.h
  3. * https://gitlab.com/bztsrc/smgui
  4. *
  5. * Copyright (C) 2024 bzt (bztsrc@gitlab), MIT license
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8. * of this software and associated documentation files (the "Software"), to
  9. * deal in the Software without restriction, including without limitation the
  10. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  11. * sell copies of the Software, and to permit persons to whom the Software is
  12. * furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in
  15. * all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
  20. * DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  21. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
  22. * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * @brief X11 backend for SMGUI
  25. */
  26. #ifndef UI_X11_H
  27. #define UI_X11_H 1
  28. #ifndef UI_BACKEND
  29. #define UI_BACKEND 1
  30. #else
  31. #error "An UI backend has already been included"
  32. #endif
  33. #include <stdint.h>
  34. #include <string.h>
  35. #include <stdlib.h>
  36. #include <stdio.h>
  37. #include <Xlib.h>
  38. #include <Xutil.h>
  39. #include <Xos.h>
  40. #include <Xatom.h>
  41. #include <Xmu/Atoms.h>
  42. #include <keysymdef.h>
  43. #ifndef UI_H
  44. #include <ui.h>
  45. #undef UI_H
  46. #endif
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. /**
  51. * The UI backend structure, it's backend specific
  52. */
  53. typedef struct ui_backend_s {
  54. void *ctx;
  55. Display *display;
  56. Visual *visual;
  57. int screen, btn, fullscr;
  58. Window window;
  59. GC gc;
  60. Atom wmDel, wmState, wmFullscreen, target, CLIPBOARD, TARGETS, UTF8, XSEL_DATA;
  61. char selection[1024];
  62. } ui_backend_t;
  63. /**
  64. * Toggle fullscreen
  65. */
  66. int ui_backend_fullscreen(ui_backend_t *bck)
  67. {
  68. XEvent xev;
  69. long evmask = SubstructureRedirectMask | SubstructureNotifyMask;
  70. if(!bck || !bck->display || !bck->window) return UI_ERR_BADINP;
  71. if(bck->wmState == None || bck->wmFullscreen == None) return UI_ERR_BACKEND;
  72. bck->fullscr ^= 1;
  73. XChangeProperty(bck->display, bck->window, bck->wmState, XA_ATOM, 32, PropModeReplace,
  74. (uint8_t*)&bck->wmFullscreen, bck->fullscr);
  75. xev.type = ClientMessage;
  76. xev.xclient.window = bck->window;
  77. xev.xclient.message_type = bck->wmState;
  78. xev.xclient.format = 32;
  79. xev.xclient.data.l[0] = 2;
  80. xev.xclient.data.l[1] = bck->wmFullscreen;
  81. xev.xclient.data.l[2] = 0;
  82. xev.xclient.data.l[3] = 1;
  83. xev.xclient.data.l[4] = 0;
  84. if(!XSendEvent(bck->display, RootWindow(bck->display, bck->screen), 0, evmask, &xev))
  85. return UI_ERR_BACKEND;
  86. return UI_OK;
  87. }
  88. /**
  89. * Set window focus
  90. */
  91. int ui_backend_focus(ui_backend_t *bck)
  92. {
  93. if(!bck || !bck->display || !bck->window) return UI_ERR_BADINP;
  94. XMapWindow(bck->display, bck->window);
  95. XRaiseWindow(bck->display, bck->window);
  96. XFlush(bck->display);
  97. return UI_OK;
  98. }
  99. /**
  100. * Set window title
  101. */
  102. int ui_backend_settitle(ui_backend_t *bck, char *title)
  103. {
  104. XTextProperty title_property;
  105. int i;
  106. if(!bck || !title || !*title || !bck->display || !bck->window) return UI_ERR_BADINP;
  107. if((i = XStringListToTextProperty(&title, 1, &title_property))) {
  108. XSetWMName(bck->display, bck->window, &title_property);
  109. XSetWMIconName(bck->display, bck->window, &title_property);
  110. }
  111. return UI_OK;
  112. }
  113. /**
  114. * Get the clipboard's text
  115. */
  116. char *ui_backend_getclipboard(ui_backend_t *bck)
  117. {
  118. const char *str = (const char*)bck->selection;
  119. char *ret = NULL;
  120. if(!bck) return NULL;
  121. if(*str && (ret = (char*)malloc(strlen(str) + 1)))
  122. strcpy(ret, str);
  123. return ret;
  124. }
  125. /**
  126. * Set the clipboard's text
  127. */
  128. int ui_backend_setclipboard(ui_backend_t *bck, char *str)
  129. {
  130. if(!bck || !str || !bck->display || !bck->window) return UI_ERR_BADINP;
  131. strncpy(bck->selection, str, sizeof(bck->selection) - 1);
  132. XSetSelectionOwner(bck->display, XA_CLIPBOARD(bck->display), bck->window, CurrentTime);
  133. return UI_OK;
  134. }
  135. /**
  136. * Hide hardware mouse cursor
  137. */
  138. int ui_backend_hidecursor(ui_backend_t *bck)
  139. {
  140. if(!bck || !bck->display || !bck->window) return UI_ERR_BADINP;
  141. return UI_OK;
  142. }
  143. /**
  144. * Show hardware mouse cursor
  145. */
  146. int ui_backend_showcursor(ui_backend_t *bck)
  147. {
  148. if(!bck || !bck->display || !bck->window) return UI_ERR_BADINP;
  149. return UI_OK;
  150. }
  151. /**
  152. * Hide OS-native on-screen keyboard
  153. */
  154. int ui_backend_hideosk(ui_backend_t *bck)
  155. {
  156. (void)bck;
  157. return UI_OK;
  158. }
  159. /**
  160. * Show OS-native on-screen keyboard
  161. */
  162. int ui_backend_showosk(ui_backend_t *bck)
  163. {
  164. (void)bck;
  165. return UI_OK;
  166. }
  167. /**
  168. * Initialize the backend
  169. */
  170. int ui_backend_init(ui_t *ctx, char *title, int w, int h, ui_image_t *icon)
  171. {
  172. Atom net_wm_icon, cardinal;
  173. uint32_t *ptr;
  174. ui_backend_t *bck;
  175. if(!ctx || !title || !*title || w < 1 || h < 1) return UI_ERR_BADINP;
  176. if(!(ctx->bck = bck = (ui_backend_t*)realloc(ctx->bck, sizeof(ui_backend_t)))) return UI_ERR_NOMEM;
  177. memset(bck, 0, sizeof(ui_backend_t));
  178. bck->ctx = ctx;
  179. if(!(bck->display = XOpenDisplay(getenv("DISPLAY")))) return UI_ERR_BACKEND;
  180. bck->screen = DefaultScreen(bck->display);
  181. if(!(bck->visual = DefaultVisual(bck->display, bck->screen)) ||
  182. !(bck->window = XCreateSimpleWindow(bck->display, RootWindow(bck->display, bck->screen), 0, 0, w, h, 0, 0, 0))) {
  183. XCloseDisplay(bck->display); return UI_ERR_BACKEND;
  184. }
  185. XSelectInput(bck->display, bck->window, KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask|
  186. ButtonMotionMask|PointerMotionMask|ExposureMask|StructureNotifyMask);
  187. bck->gc = XCreateGC(bck->display, bck->window, 0, 0);
  188. bck->wmState = XInternAtom(bck->display, "_NET_WM_STATE", 0);
  189. bck->wmFullscreen = XInternAtom(bck->display, "_NET_WM_STATE_FULLSCREEN", 0);
  190. bck->wmDel = XInternAtom(bck->display, "WM_DELETE_WINDOW", False);
  191. XSetWMProtocols(bck->display, bck->window, &bck->wmDel, 1);
  192. bck->UTF8 = XInternAtom(bck->display, "UTF8_STRING", 0); if(bck->UTF8 == None) bck->UTF8 = XA_STRING;
  193. bck->CLIPBOARD = XInternAtom(bck->display, "CLIPBOARD", 0);
  194. bck->XSEL_DATA = XInternAtom(bck->display, "XSEL_DATA", 0);
  195. XSetSelectionOwner(bck->display, bck->CLIPBOARD, bck->window, CurrentTime);
  196. if(icon && icon->buf && (ptr = (uint32_t*)malloc((2 + icon->w * icon->h) * sizeof(uint32_t)))) {
  197. ptr[0] = icon->w; ptr[1] = icon->h;
  198. memcpy(&ptr[2], icon->buf, icon->w * icon->h * sizeof(uint32_t));
  199. net_wm_icon = XInternAtom(bck->display, "_NET_WM_ICON", False);
  200. cardinal = XInternAtom(bck->display, "CARDINAL", False);
  201. XChangeProperty(bck->display, bck->window, net_wm_icon, cardinal, 32, PropModeReplace, (uint8_t*)ptr, 2 + icon->w * icon->h);
  202. free(ptr);
  203. }
  204. ui_backend_settitle(bck, title);
  205. ui_backend_focus(bck);
  206. return UI_OK;
  207. }
  208. /**
  209. * Return a backend specific window handle
  210. */
  211. void *ui_backend_getwindow(ui_backend_t *bck)
  212. {
  213. return bck ? (void*)bck->window : NULL;
  214. }
  215. /**
  216. * Main event handler
  217. */
  218. int ui_backend_event(ui_backend_t *bck)
  219. {
  220. XEvent e = { 0 }, r = { 0 };
  221. ui_event_t *evt;
  222. char keystr[8] = { 0 };
  223. int m;
  224. KeySym key;
  225. unsigned long N, size, i;
  226. Atom target, *data = NULL;
  227. if(!bck || !bck->display || !bck->window) return UI_ERR_BADINP;
  228. while(XPending(bck->display)) {
  229. XNextEvent(bck->display, &e);
  230. switch(e.type) {
  231. case ClientMessage: if((Atom)e.xclient.data.l[0] == bck->wmDel) return 1; break;
  232. case ConfigureNotify: _ui_resize(bck->ctx, e.xconfigure.width, e.xconfigure.height); break;
  233. case ButtonPress:
  234. _ui_setmouse(bck->ctx, e.xbutton.x, e.xbutton.y);
  235. m = 0;
  236. switch(e.xbutton.button) {
  237. case 1: m = UI_BTN_L; break;
  238. case 2: m = UI_BTN_M; break;
  239. case 3: m = UI_BTN_R; break;
  240. case 4: m = UI_BTN_U; break;
  241. case 5: m = UI_BTN_D; break;
  242. case 6: m = UI_BTN_A; break;
  243. case 7: m = UI_BTN_B; break;
  244. }
  245. bck->btn |= m;
  246. if((evt = _ui_evtslot(bck->ctx))) {
  247. evt->x = e.xbutton.x;
  248. evt->y = e.xbutton.y;
  249. evt->btn = bck->btn;
  250. evt->type = UI_EVT_MOUSE;
  251. }
  252. break;
  253. case ButtonRelease:
  254. _ui_setmouse(bck->ctx, e.xbutton.x, e.xbutton.y);
  255. m = 0;
  256. switch(e.xbutton.button) {
  257. case 1: m = UI_BTN_L; break;
  258. case 2: m = UI_BTN_M; break;
  259. case 3: m = UI_BTN_R; break;
  260. case 4: m = UI_BTN_U; break;
  261. case 5: m = UI_BTN_D; break;
  262. case 6: m = UI_BTN_A; break;
  263. case 7: m = UI_BTN_B; break;
  264. }
  265. bck->btn &= ~m;
  266. if((evt = _ui_evtslot(bck->ctx))) {
  267. evt->x = e.xbutton.x;
  268. evt->y = e.xbutton.y;
  269. evt->btn = bck->btn | UI_BTN_RELEASE;
  270. evt->type = UI_EVT_MOUSE;
  271. }
  272. break;
  273. case MotionNotify: _ui_setmouse(bck->ctx, e.xmotion.x, e.xmotion.y); break;
  274. case KeyPress:
  275. key = XLookupKeysym(&e.xkey, 0);
  276. switch(key) {
  277. case XK_Shift_L: bck->btn |= UI_BTN_SHIFT; memcpy(keystr, "LShift", 6); break;
  278. case XK_Shift_R: bck->btn |= UI_BTN_SHIFT; memcpy(keystr, "RShift", 6); break;
  279. case XK_Control_L: bck->btn |= UI_BTN_CONTROL; memcpy(keystr, "LCtrl", 5); break;
  280. case XK_Control_R: bck->btn |= UI_BTN_CONTROL; memcpy(keystr, "RCtrl", 5); break;
  281. case XK_Alt_L: bck->btn |= UI_BTN_ALT; memcpy(keystr, "LAlt", 4); break;
  282. case XK_Alt_R: bck->btn |= UI_BTN_ALT; memcpy(keystr, "RAlt", 4); break;
  283. case XK_Super_L: bck->btn |= UI_BTN_GUI; memcpy(keystr, "LGui", 4); break;
  284. case XK_Super_R: bck->btn |= UI_BTN_GUI; memcpy(keystr, "RGui", 4); break;
  285. case XK_Escape: keystr[0] = 0x1b; break;
  286. case XK_BackSpace: keystr[0] = '\b'; break;
  287. case XK_Tab: keystr[0] = '\t'; break;
  288. case XK_Return: keystr[0] = '\n'; break;
  289. case XK_F1: memcpy(keystr, "F1", 2); break;
  290. case XK_F2: memcpy(keystr, "F2", 2); break;
  291. case XK_F3: memcpy(keystr, "F3", 2); break;
  292. case XK_F4: memcpy(keystr, "F4", 2); break;
  293. case XK_F5: memcpy(keystr, "F5", 2); break;
  294. case XK_F6: memcpy(keystr, "F6", 2); break;
  295. case XK_F7: memcpy(keystr, "F7", 2); break;
  296. case XK_F8: memcpy(keystr, "F8", 2); break;
  297. case XK_F9: memcpy(keystr, "F9", 2); break;
  298. case XK_F10: memcpy(keystr, "F10", 3); break;
  299. case XK_F11: memcpy(keystr, "F11", 3); break;
  300. case XK_F12: memcpy(keystr, "F12", 3); break;
  301. case XK_Sys_Req: memcpy(keystr, "PrScr", 5); break;
  302. case XK_Caps_Lock: memcpy(keystr, "CLck", 4); break;
  303. case XK_Scroll_Lock: memcpy(keystr, "SLck", 4); break;
  304. case XK_Num_Lock: memcpy(keystr, "NLck", 4); break;
  305. case XK_Up: memcpy(keystr, "Up", 2); break;
  306. case XK_Down: memcpy(keystr, "Down", 4); break;
  307. case XK_Left: memcpy(keystr, "Left", 4); break;
  308. case XK_Right: memcpy(keystr, "Right", 5); break;
  309. case XK_Home: memcpy(keystr, "Home", 4); break;
  310. case XK_End: memcpy(keystr, "End", 3); break;
  311. case XK_Page_Up: memcpy(keystr, "PgUp", 4); break;
  312. case XK_Page_Down: memcpy(keystr, "PgDown", 6); break;
  313. case XK_Delete: memcpy(keystr, "Del", 3); break;
  314. case XK_Multi_key: memcpy(keystr, "Int1", 4); break;
  315. case XK_Kanji: memcpy(keystr, "Int2", 4); break;
  316. case XK_Menu: memcpy(keystr, "Menu", 4); break;
  317. case XK_Z: if(bck->btn == UI_BTN_CONTROL) memcpy(keystr, "Undo", 4); else if(bck->btn & ~UI_BTN_SHIFT) keystr[0] = key; break;
  318. case XK_Y: if(bck->btn == UI_BTN_CONTROL) memcpy(keystr, "Redo", 4); else if(bck->btn & ~UI_BTN_SHIFT) keystr[0] = key; break;
  319. case XK_X: if(bck->btn == UI_BTN_CONTROL) memcpy(keystr, "Cut", 3); else if(bck->btn & ~UI_BTN_SHIFT) keystr[0] = key; break;
  320. case XK_C: if(bck->btn == UI_BTN_CONTROL) memcpy(keystr, "Copy", 4); else if(bck->btn & ~UI_BTN_SHIFT) keystr[0] = key; break;
  321. case XK_V: if(bck->btn == UI_BTN_CONTROL) memcpy(keystr, "Paste", 5); else if(bck->btn & ~UI_BTN_SHIFT) keystr[0] = key; break;
  322. case XK_Break: memcpy(keystr, "Stop", 4); break;
  323. case XK_Redo: memcpy(keystr, "Redo", 4); break;
  324. case XK_Undo: memcpy(keystr, "Undo", 4); break;
  325. case XK_Select: memcpy(keystr, "Copy", 4); break;
  326. case XK_Insert: memcpy(keystr, "Paste", 5); break;
  327. case XK_Find: memcpy(keystr, "Find", 4); break;
  328. default: if((bck->btn & ~UI_BTN_SHIFT) && key >= XK_A && key <= XK_Z) keystr[0] = key; break;
  329. }
  330. if(keystr[0] && (evt = _ui_evtslot(bck->ctx))) {
  331. memcpy(evt->key, keystr, 8);
  332. evt->btn = (bck->btn & 0xf00000);
  333. evt->type = UI_EVT_KEY;
  334. }
  335. break;
  336. case KeyRelease:
  337. key = XLookupKeysym(&e.xkey, 0);
  338. switch(key) {
  339. case XK_Shift_L: bck->btn &= ~UI_BTN_SHIFT; memcpy(keystr, "LShift", 6); break;
  340. case XK_Shift_R: bck->btn &= ~UI_BTN_SHIFT; memcpy(keystr, "RShift", 6); break;
  341. case XK_Control_L: bck->btn &= ~UI_BTN_CONTROL; memcpy(keystr, "LCtrl", 5); break;
  342. case XK_Control_R: bck->btn &= ~UI_BTN_CONTROL; memcpy(keystr, "RCtrl", 5); break;
  343. case XK_Alt_L: bck->btn &= ~UI_BTN_ALT; memcpy(keystr, "LAlt", 4); break;
  344. case XK_Alt_R: bck->btn &= ~UI_BTN_ALT; memcpy(keystr, "RAlt", 4); break;
  345. case XK_Super_L: bck->btn &= ~UI_BTN_GUI; memcpy(keystr, "LGui", 4); break;
  346. case XK_Super_R: bck->btn &= ~UI_BTN_GUI; memcpy(keystr, "RGui", 4); break;
  347. }
  348. if(keystr[0] && (evt = _ui_evtslot(bck->ctx))) {
  349. memcpy(evt->key, keystr, 8);
  350. evt->btn = (bck->btn & 0xf00000) | UI_BTN_RELEASE;
  351. evt->type = UI_EVT_KEY;
  352. }
  353. break;
  354. case SelectionRequest:
  355. if(bck->selection[0]) {
  356. XChangeProperty(bck->display, e.xselectionrequest.requestor, e.xselectionrequest.property,
  357. XA_UTF8_STRING(bck->display), 8, PropModeReplace, (uint8_t*)bck->selection, strlen(bck->selection));
  358. r.xselection.type = SelectionNotify;
  359. r.xselection.requestor = e.xselectionrequest.requestor;
  360. r.xselection.property = e.xselectionrequest.property;
  361. r.xselection.display = bck->display;
  362. r.xselection.selection = e.xselectionrequest.selection;
  363. r.xselection.target = e.xselectionrequest.target;
  364. r.xselection.time = e.xselectionrequest.time;
  365. XSendEvent(bck->display, e.xselectionrequest.requestor, 0, 0, &r);
  366. XFlush(bck->display);
  367. }
  368. break;
  369. case SelectionNotify:
  370. if(e.xselection.property != None) {
  371. XGetWindowProperty(bck->display, e.xselection.requestor, e.xselection.property, 0L,(~0L), 0,
  372. AnyPropertyType, &target, &m, &size, &N,(unsigned char**)&data);
  373. if(data) {
  374. if(e.xselection.target == bck->TARGETS) {
  375. for(i = 0; i < size; i++)
  376. if(data[i] == XA_STRING || data[i] == bck->UTF8)
  377. target = data[i];
  378. if(target != None) {
  379. XConvertSelection(bck->display, bck->CLIPBOARD, target, bck->XSEL_DATA, bck->window, CurrentTime);
  380. bck->target = target;
  381. }
  382. } else
  383. if(e.xselection.target == bck->target) {
  384. if(size > sizeof(bck->selection) - 1) size = sizeof(bck->selection) - 1;
  385. memset(bck->selection, 0, sizeof(bck->selection));
  386. memcpy(bck->selection, data, size);
  387. }
  388. XFree(data);
  389. }
  390. XDeleteProperty(bck->display, e.xselection.requestor, e.xselection.property);
  391. }
  392. break;
  393. }
  394. }
  395. return UI_OK;
  396. }
  397. /**
  398. * Main redraw handler
  399. */
  400. int ui_backend_redraw(ui_backend_t *bck)
  401. {
  402. ui_t *ctx;
  403. XImage *xi;
  404. if(!bck || !bck->display || !bck->window) return UI_ERR_BADINP;
  405. ctx = (ui_t*)bck->ctx;
  406. if(!ctx || !ctx->screen.buf) return UI_ERR_BADINP;
  407. if(!(xi = XCreateImage(bck->display, bck->visual, DefaultDepth(bck->display, bck->screen), ZPixmap, 0, NULL,
  408. ctx->screen.w, ctx->screen.h, 8, ctx->screen.p))) return UI_ERR_BACKEND;
  409. xi->data = (char*)ctx->screen.buf;
  410. xi->byte_order= LSBFirst;
  411. xi->bits_per_pixel = 32;
  412. XPutImage(bck->display, bck->window, bck->gc, xi, 0, 0, 0, 0, ctx->screen.w, ctx->screen.h);
  413. xi->data = NULL;
  414. XDestroyImage(xi);
  415. #ifndef UI_BACKEND_NOFLUSH
  416. XFlush(bck->display);
  417. #endif
  418. return UI_OK;
  419. }
  420. /**
  421. * Free backend resources
  422. */
  423. int ui_backend_free(ui_backend_t *bck)
  424. {
  425. if(!bck) return UI_ERR_BADINP;
  426. if(bck->display) {
  427. if(bck->fullscr) ui_backend_fullscreen(bck);
  428. if(bck->gc) XFreeGC(bck->display, bck->gc);
  429. if(bck->window) {
  430. XUnmapWindow(bck->display, bck->window);
  431. XDestroyWindow(bck->display, bck->window);
  432. }
  433. XFlush(bck->display);
  434. XCloseDisplay(bck->display);
  435. }
  436. free(bck);
  437. return UI_OK;
  438. }
  439. #ifdef __cplusplus
  440. }
  441. #endif
  442. #endif /* UI_X11_H */