| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | #ifndef SUWAUI_H |
| 25 | #define SUWAUI_H |
| 26 | |
| 27 | #if defined(_WIN32) || defined(_WIN64) |
| 28 | #if defined(_WIN32) |
| 29 | #define WIN32_LEAN_AND_MEAN |
| 30 | #else |
| 31 | #define WIN64_LEAN_AND_MEAN |
| 32 | #endif |
| 33 | #include <windows.h> |
| 34 | #define SUWAUI_WINDOWS |
| 35 | #elif defined(__unix__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__sunos) || defined(__apple__) |
| 36 | #include <X11/Xlib.h> |
| 37 | #include <X11/Xft/Xft.h> |
| 38 | #include <X11/Xatom.h> |
| 39 | #define SUWAUI_UNIX |
| 40 | #endif |
| 41 | |
| 42 | #include <stdio.h> |
| 43 | |
| 44 | #define COLOR_WHITE 0xfcfcfc |
| 45 | #if defined(__OpenBSD__) |
| 46 | #define COLOR_BD 0x232320 |
| 47 | #define COLOR_BS "#232320" |
| 48 | #define COLOR_DD 0xb8b515 |
| 49 | #define COLOR_DS "#b8b515" |
| 50 | #define COLOR_ND 0xf1ed25 |
| 51 | #define COLOR_NS "#f1ed25" |
| 52 | #define COLOR_LD 0xecea71 |
| 53 | #define COLOR_LS "#ecea71" |
| 54 | #elif defined(__FreeBSD__) |
| 55 | #define COLOR_BD 0x232020 |
| 56 | #define COLOR_BS "#232020" |
| 57 | #define COLOR_DD 0xb61729 |
| 58 | #define COLOR_DS "#b61729" |
| 59 | #define COLOR_ND 0xee4030 |
| 60 | #define COLOR_NS "#ee4030" |
| 61 | #define COLOR_LD 0xf35869 |
| 62 | #define COLOR_LS "#f35869" |
| 63 | #elif defined(__NetBSD__) |
| 64 | #define COLOR_BD 0x232018 |
| 65 | #define COLOR_BS "#232018" |
| 66 | #define COLOR_DD 0xac7718 |
| 67 | #define COLOR_DS "#ac7718" |
| 68 | #define COLOR_ND 0xf7a717 |
| 69 | #define COLOR_NS "#f7a717" |
| 70 | #define COLOR_LD 0xf8c56a |
| 71 | #define COLOR_LS "#f8c56a" |
| 72 | #elif defined(SUWAUI_WINDOWS) |
| 73 | #define COLOR_BD 0x202023 |
| 74 | #define COLOR_BS "#202023" |
| 75 | #define COLOR_DD 0x1a6ecf |
| 76 | #define COLOR_DS "#1a6ecf" |
| 77 | #define COLOR_ND 0x2687f7 |
| 78 | #define COLOR_NS "#2687f7" |
| 79 | #define COLOR_LD 0x6aa6eb |
| 80 | #define COLOR_LS "#6aa6eb" |
| 81 | #elif defined(__apple__) |
| 82 | #define COLOR_BD 0x232323 |
| 83 | #define COLOR_BS "#232323" |
| 84 | #define COLOR_DD 0x746c74 |
| 85 | #define COLOR_DS "#746c74" |
| 86 | #define COLOR_ND 0x988f98 |
| 87 | #define COLOR_NS "#988f98" |
| 88 | #define COLOR_LD 0xbdb4bd |
| 89 | #define COLOR_LS "#bdb4bd" |
| 90 | #elif defined(__sunos) |
| 91 | #define COLOR_BD 0x182023 |
| 92 | #define COLOR_BS "#182023" |
| 93 | #define COLOR_DD 0x1cbcd0 |
| 94 | #define COLOR_DS "#1cbcd0" |
| 95 | #define COLOR_ND 0x29d3ff |
| 96 | #define COLOR_NS "#29d3ff" |
| 97 | #define COLOR_LD 0x8ae5ff |
| 98 | #define COLOR_LS "#8ae5ff" |
| 99 | #endif |
| 100 | |
| 101 | #if defined(__cplusplus) |
| 102 | extern "C" { |
| 103 | #endif |
| 104 | |
| 105 | #if defined(SUWAUI_IMPLEMENTS_SUWAWINDOW) |
| 106 | #include <string.h> |
| 107 | |
| 108 | typedef struct { |
| 109 | int x, y, width, height; |
| 110 | int start_width, start_height; |
| 111 | int isrunning; |
| 112 | const char *name; |
| 113 | const char *version; |
| 114 | #if defined(SUWAUI_WINDOWS) |
| 115 | HWND hwnd; |
| 116 | HDC hdc_mem; |
| 117 | HBITMAP backbitmap; |
| 118 | HFONT hfont; |
| 119 | COLORREF fg_color; |
| 120 | #elif defined(SUWAUI_UNIX) |
| 121 | const char *res_name; |
| 122 | const char *class_name; |
| 123 | Display *display; |
| 124 | Window xwindow; |
| 125 | int screen; |
| 126 | Drawable target; |
| 127 | GC gc; |
| 128 | Visual visual; |
| 129 | XftColor color; |
| 130 | XftFont *font; |
| 131 | Colormap colormap; |
| 132 | Pixmap backbuf; |
| 133 | XEvent event; |
| 134 | #endif |
| 135 | } SuwaWindow; |
| 136 | |
| 137 | __attribute__((unused)) static void suwaui_destroy_window(SuwaWindow *w); |
| 138 | |
| 139 | __attribute__((unused)) static inline float get_scale(SuwaWindow *w) { |
| 140 | #if defined(SUWAUI_WINDOWS) |
| 141 | #elif defined(SUWAUI_UNIX) |
| 142 | XWindowAttributes attr; |
| 143 | XGetWindowAttributes(w->display, w->xwindow, &attr); |
| 144 | float sx = (float)attr.width / w->start_width; |
| 145 | float sy = (float)attr.height / w->start_height; |
| 146 | #endif |
| 147 | return sx < sy ? sx : sy; |
| 148 | } |
| 149 | |
| 150 | #if defined(SUWAUI_WINDOWS) |
| 151 | LRESULT CALLBACK SuwaWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { |
| 152 | SuwaWindow *w = (SuwaWindow *)GetWindowLongPtr(hwnd, GWLP_USERDATA); |
| 153 | |
| 154 | switch (msg) { |
| 155 | case WM_CREATE: |
| 156 | LPCREATESTRUCT cs = (LPCREATESTRUCT)lParam; |
| 157 | w = (SuwaWindow *)cs->lpCreateParams; |
| 158 | SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)w); |
| 159 | return 0 |
| 160 | case WM_SIZE: |
| 161 | if (w == NULL) break; |
| 162 | |
| 163 | int new_w = LOWORD(lParam); |
| 164 | int new_h = HIWORD(lParam); |
| 165 | |
| 166 | if (w->back_bitmap != NULL) { |
| 167 | DeleteObject(w->back_bitmap); |
| 168 | w->back_bitmap = NULL; |
| 169 | } |
| 170 | |
| 171 | HDC hdc = GetDC(hwnd); |
| 172 | if (hdc) { |
| 173 | w->back_bitmap = CreateCompatibleBitmap(hdc, new_w, new_h); |
| 174 | if (w->back_bitmap) { |
| 175 | SelectObject(w->hdc_memm, w->back_bitmap); |
| 176 | } |
| 177 | ReleaseDC(hwnd, hdc); |
| 178 | } |
| 179 | |
| 180 | w->width = new_w; |
| 181 | w->height = new_h; |
| 182 | |
| 183 | InvalidateRect(hwnd, NULL, FALSE); |
| 184 | return 0; |
| 185 | case WM_PAINT: |
| 186 | PAINTSTRUCT ps; |
| 187 | HDC hdc = BeginPaint(hwnd, &ps); |
| 188 | |
| 189 | if (w && w->hdc_mem) { |
| 190 | RECT client; |
| 191 | GetClientRect(hwnd, &client); |
| 192 | FillRect(w->hdc_mem, &client, (HBRUSH)GetStockObject(COLOR_BD)); |
| 193 | |
| 194 | |
| 195 | |
| 196 | BitBlt(hdc, 0, 0, w->width, w->height, w->hdc_mem, 0, 0, SRCCOPY); |
| 197 | } |
| 198 | |
| 199 | EndPaint(hwnd, &ps); |
| 200 | return 0; |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | case WM_DESTROY: |
| 209 | PostQuitMessage(0); |
| 210 | return 0; |
| 211 | default: |
| 212 | return DefWindowProc(hwnd, msg, wParam, lParam); |
| 213 | } |
| 214 | |
| 215 | return DefWindowProc(hwnd, msg, wParam, lParam); |
| 216 | } |
| 217 | #endif |
| 218 | |
| 219 | __attribute__((unused)) static SuwaWindow suwaui_create_window(int x, int y, int width, int height, |
| 220 | const char *software_name, const char *software_version, |
| 221 | const char *res_name, const char *class_name, |
| 222 | const char *font, const char *fg_color, |
| 223 | int is_centered, int cannot_shrink, int cannot_grow) { |
| 224 | (void)cannot_grow; |
| 225 | |
| 226 | SuwaWindow w = {0}; |
| 227 | w.isrunning = 1; |
| 228 | w.width = width; |
| 229 | w.height = height; |
| 230 | w.start_width = width; |
| 231 | w.start_height = height; |
| 232 | w.name = software_name; |
| 233 | w.version = software_version; |
| 234 | #if defined(SUWAUI_WINDOWS) |
| 235 | WNDCLASSEX wc = { sizeof(WNDCLASSEX) }; |
| 236 | wc.style = CS_HREDRAW | CS_VREDRAW; |
| 237 | wc.lpfnWndProc = SuwaWindowsProc; |
| 238 | wc.hInstance = GetModuleHandle(NULL); |
| 239 | wc.hCursor = LoadCursor(NULL, IDCARROW); |
| 240 | wc.hbrBackground = NULL; |
| 241 | wc.lpszClassName = TEXT("SuwaWindowClass"); |
| 242 | |
| 243 | RegisterClassEx(&wc); |
| 244 | |
| 245 | DWORD style = WS_OVERLAPPEDWINDOW; |
| 246 | |
| 247 | w.hwnd = CreateWindowEx(0, wc.lpszClassName, name, style, |
| 248 | x, y, width, height, NULL, NULL, wc.hInstance, NULL); |
| 249 | if (!w.hwnd) return (SUwaWindow){0}; |
| 250 | |
| 251 | HDC hdc = GetDC(w.hwnd); |
| 252 | w.hdc_mem = CreateCompatibleDC(hdc); |
| 253 | w.back_bitmap = CreateCompatibleBitmap(hdc, width, height); |
| 254 | SelectObject(w.hdc_mem, w.back_bitmap); |
| 255 | ReleaseDC(w.hwnd, hdc); |
| 256 | |
| 257 | ShowWindow(w.hwnd, hdc); |
| 258 | UpdateWindow(w.hwnd); |
| 259 | #elif defined(SUWAUI_UNIX) |
| 260 | w.res_name = res_name; |
| 261 | w.class_name = class_name; |
| 262 | |
| 263 | XGCValues values; |
| 264 | |
| 265 | w.display = XOpenDisplay(NULL); |
| 266 | if (w.display == NULL) return (SuwaWindow){0}; |
| 267 | |
| 268 | w.screen = DefaultScreen(w.display); |
| 269 | |
| 270 | if (is_centered > 0) { |
| 271 | int sw = DisplayWidth(w.display, w.screen); |
| 272 | int sh = DisplayHeight(w.display, w.screen); |
| 273 | w.x = (sw - w.width) / 2; |
| 274 | w.y = (sh - w.height) / 2; |
| 275 | } else { |
| 276 | w.x = x; |
| 277 | w.y = y; |
| 278 | } |
| 279 | |
| 280 | w.xwindow = XCreateSimpleWindow(w.display, |
| 281 | RootWindow(w.display, w.screen), |
| 282 | w.x, w.y, |
| 283 | w.width, w.height, |
| 284 | 1, COLOR_ND, COLOR_BD); |
| 285 | if (!w.xwindow) { |
| 286 | suwaui_destroy_window(&w); |
| 287 | return (SuwaWindow){0}; |
| 288 | } |
| 289 | |
| 290 | if (cannot_shrink) { |
| 291 | XSizeHints *sizeHint = XAllocSizeHints(); |
| 292 | if (sizeHint) { |
| 293 | sizeHint->flags = PMinSize; |
| 294 | sizeHint->min_width = width; |
| 295 | sizeHint->min_height = height; |
| 296 | XSetWMNormalHints(w.display, w.xwindow, sizeHint); |
| 297 | XFree(sizeHint); |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | w.backbuf = XCreatePixmap(w.display, w.xwindow, |
| 302 | w.width, w.height, |
| 303 | DefaultDepth(w.display, w.screen)); |
| 304 | w.target = w.backbuf; |
| 305 | |
| 306 | Atom net_wm_window_type = XInternAtom(w.display, "_NET_WM_WINDOW_TYPE", False); |
| 307 | Atom dialog = XInternAtom(w.display, "_NET_WM_WINDOW_TYPE_DIALOG", False); |
| 308 | |
| 309 | XChangeProperty(w.display, w.xwindow, net_wm_window_type, XA_ATOM, 32, |
| 310 | PropModeReplace, (unsigned char *)&dialog, 1); |
| 311 | |
| 312 | XStoreName(w.display, w.xwindow, w.name); |
| 313 | Atom net_wm_name = XInternAtom(w.display, "_NET_WM_NAME", False); |
| 314 | char displayname[16]; |
| 315 | snprintf(displayname, 16, "%s %s", w.name, w.version); |
| 316 | XChangeProperty(w.display, w.xwindow, net_wm_name, |
| 317 | XInternAtom(w.display, "UTF8_STRING", False), 8, |
| 318 | PropModeReplace, (unsigned char *)displayname, strlen(displayname)); |
| 319 | |
| 320 | XClassHint *classHint = XAllocClassHint(); |
| 321 | if (classHint) { |
| 322 | classHint->res_name = strdup(w.res_name); |
| 323 | classHint->res_class = strdup(w.class_name); |
| 324 | XSetClassHint(w.display, w.xwindow, classHint); |
| 325 | XFree(classHint); |
| 326 | } |
| 327 | |
| 328 | XSetWindowBackground(w.display, w.xwindow, COLOR_BD); |
| 329 | |
| 330 | XSelectInput(w.display, w.xwindow, |
| 331 | ExposureMask |
| 332 | | ButtonPressMask |
| 333 | | ButtonReleaseMask |
| 334 | | KeyPressMask |
| 335 | | PointerMotionMask |
| 336 | | ButtonMotionMask |
| 337 | |
| 338 | ); |
| 339 | |
| 340 | w.gc = XCreateGC(w.display, w.xwindow, 0, &values); |
| 341 | if (!w.gc) { |
| 342 | suwaui_destroy_window(&w); |
| 343 | return (SuwaWindow){0}; |
| 344 | } |
| 345 | |
| 346 | w.visual = *DefaultVisual(w.display, w.screen); |
| 347 | |
| 348 | w.colormap = XCreateColormap(w.display, w.xwindow, |
| 349 | &w.visual, AllocNone); |
| 350 | if (w.colormap == None) { |
| 351 | suwaui_destroy_window(&w); |
| 352 | return (SuwaWindow){0}; |
| 353 | } |
| 354 | |
| 355 | w.font = XftFontOpenName(w.display, w.screen, font); |
| 356 | if (!w.font) { |
| 357 | suwaui_destroy_window(&w); |
| 358 | return (SuwaWindow){0}; |
| 359 | } |
| 360 | |
| 361 | if (!XftColorAllocName(w.display, &w.visual, |
| 362 | w.colormap, fg_color, &w.color)) { |
| 363 | suwaui_destroy_window(&w); |
| 364 | return (SuwaWindow){0}; |
| 365 | } |
| 366 | #endif |
| 367 | |
| 368 | return w; |
| 369 | } |
| 370 | |
| 371 | __attribute__((unused)) static void suwaui_destroy_window(SuwaWindow *w) { |
| 372 | #if defined(SUWAUI_WINDOWS) |
| 373 | if (w->back_bitmap) DeleteObject(w->back_bitmap); |
| 374 | if (w->hdc_mem) DeleteDC(w->hdc_mem); |
| 375 | if (w->hwnd) DestroyWindow(w->hwnd); |
| 376 | #elif defined(SUWAUI_UNIX) |
| 377 | if (w->font) XftFontClose(w->display, w->font); |
| 378 | |
| 379 | if (w->gc) XFreeGC(w->display, w->gc); |
| 380 | if (w->backbuf) { |
| 381 | XFreePixmap(w->display, w->backbuf); |
| 382 | w->backbuf = None; |
| 383 | } |
| 384 | if (w->xwindow) XDestroyWindow(w->display, w->xwindow); |
| 385 | if (w->display) XCloseDisplay(w->display); |
| 386 | #endif |
| 387 | |
| 388 | *w = (SuwaWindow){0}; |
| 389 | } |
| 390 | #endif |
| 391 | |
| 392 | #if defined(SUWAUI_IMPLEMENTS_SUWABUTTON) |
| 393 | typedef struct { |
| 394 | int x, y, width, height; |
| 395 | int row, col; |
| 396 | const char *text; |
| 397 | XftFont *font; |
| 398 | unsigned long bg_color; |
| 399 | XftColor fg_color; |
| 400 | int pressed; |
| 401 | int hovered; |
| 402 | } SuwaButton; |
| 403 | |
| 404 | |
| 405 | |
| 406 | __attribute__((unused)) static XftColor suwaui_set_button_fgcolor(SuwaWindow *window, const char *color) { |
| 407 | XftColor xcolor; |
| 408 | XftColorAllocName(window->display, |
| 409 | DefaultVisual(window->display, DefaultScreen(window->display)), |
| 410 | DefaultColormap(window->display, DefaultScreen(window->display)), |
| 411 | color, &xcolor); |
| 412 | |
| 413 | return xcolor; |
| 414 | } |
| 415 | |
| 416 | __attribute__((unused)) static void suwaui_draw_button(SuwaWindow *window, SuwaButton *btn, XftDraw *xftdraw) { |
| 417 | unsigned long curbg; |
| 418 | if (btn->pressed) curbg = COLOR_DD; |
| 419 | else if (btn->hovered) curbg = COLOR_LD; |
| 420 | else curbg = btn->bg_color; |
| 421 | XSetForeground(window->display, window->gc, curbg); |
| 422 | XFillRectangle(window->display, window->target, window->gc, btn->x, btn->y, |
| 423 | btn->width, btn->height); |
| 424 | |
| 425 | |
| 426 | if (btn->text && window->font && xftdraw) { |
| 427 | const FcChar8 *str = (const FcChar8 *)btn->text; |
| 428 | int len = strlen((const char *)str); |
| 429 | |
| 430 | XGlyphInfo extents; |
| 431 | XftTextExtentsUtf8(window->display, window->font, str, len, &extents); |
| 432 | |
| 433 | int text_w = extents.xOff; |
| 434 | int text_h = window->font->ascent + window->font->descent; |
| 435 | |
| 436 | int tx = btn->x + (btn->width - text_w) / 2; |
| 437 | int ty = btn->y + (btn->height - text_h) / 2 + window->font->ascent; |
| 438 | |
| 439 | XftDrawStringUtf8(xftdraw, &btn->fg_color, window->font, tx, ty, |
| 440 | (FcChar8 *)btn->text, len); |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | __attribute__((unused)) static SuwaButton suwaui_add_button(int x, int y, int width, int height, |
| 445 | const char *text, XftFont *font, unsigned long bg_color, XftColor fg_color) { |
| 446 | SuwaButton button = { |
| 447 | .x = x, |
| 448 | .y = y, |
| 449 | .width = width, |
| 450 | .height = height, |
| 451 | .text = text, |
| 452 | .font = font, |
| 453 | .bg_color = bg_color, |
| 454 | .fg_color = fg_color, |
| 455 | .pressed = 0 |
| 456 | }; |
| 457 | |
| 458 | return button; |
| 459 | } |
| 460 | #endif |
| 461 | |
| 462 | #if defined(SUWAUI_IMPLEMENTS_SUWALABEL) |
| 463 | typedef struct { |
| 464 | int x, y, width, height; |
| 465 | char text[64]; |
| 466 | XftFont *font; |
| 467 | XftColor fg_color; |
| 468 | } SuwaLabel; |
| 469 | |
| 470 | __attribute__((unused)) static void suwaui_del_label(SuwaWindow *window, SuwaLabel *label); |
| 471 | |
| 472 | __attribute__((unused)) static SuwaLabel suwaui_add_label(SuwaWindow *window, |
| 473 | int x, int y, int width, int height, char text[64], const char *font, |
| 474 | const char *fg_color, int rtl) { |
| 475 | (void)width; |
| 476 | (void)height; |
| 477 | SuwaLabel label = { |
| 478 | .x = x, |
| 479 | .y = y, |
| 480 | .width = width, |
| 481 | .height = height |
| 482 | }; |
| 483 | |
| 484 | label.font = XftFontOpenName(window->display, window->screen, font); |
| 485 | if (!label.font) { |
| 486 | fprintf(stderr, "font create fail\n"); |
| 487 | return (SuwaLabel){0}; |
| 488 | } |
| 489 | |
| 490 | strncpy(label.text, text ? text : "", sizeof(label.text) - 1); |
| 491 | label.text[sizeof(label.text)-1] = '\0'; |
| 492 | |
| 493 | const FcChar8 *txt = (const FcChar8 *)label.text; |
| 494 | int len = strlen((const char *)txt); |
| 495 | |
| 496 | XGlyphInfo extents; |
| 497 | XftTextExtentsUtf8(window->display, label.font, txt, len, &extents); |
| 498 | |
| 499 | if (rtl > 0) { |
| 500 | XWindowAttributes attr; |
| 501 | XGetWindowAttributes(window->display, window->xwindow, &attr); |
| 502 | int w = attr.width; |
| 503 | label.x = w - label.x - extents.xOff; |
| 504 | } |
| 505 | |
| 506 | if (!XftColorAllocName(window->display, |
| 507 | DefaultVisual(window->display, DefaultScreen(window->display)), |
| 508 | DefaultColormap(window->display, DefaultScreen(window->display)), |
| 509 | fg_color, &label.fg_color)) { |
| 510 | suwaui_del_label(window, &label); |
| 511 | fprintf(stderr, "color estimate fail\n"); |
| 512 | return (SuwaLabel){0}; |
| 513 | } |
| 514 | |
| 515 | return label; |
| 516 | } |
| 517 | |
| 518 | __attribute__((unused)) static void suwaui_del_label(SuwaWindow *window, SuwaLabel *label) { |
| 519 | if (label->font) XftFontClose(window->display, label->font); |
| 520 | } |
| 521 | #endif |
| 522 | |
| 523 | #if defined(__cplusplus) |
| 524 | } |
| 525 | #endif |
| 526 | |
| 527 | #if defined(SUWAUI_IMPLEMENTS_SUWATABS) |
| 528 | typedef struct { |
| 529 | int x, y, width, height; |
| 530 | } SuwaTab; |
| 531 | |
| 532 | typedef struct { |
| 533 | int x, y, width, height; |
| 534 | } SuwaTabs; |
| 535 | #endif |
| 536 | |
| 537 | #if defined(SUWAUI_IMPLEMENTS_SUWASIDE) |
| 538 | typedef struct { |
| 539 | int x, y, width, height; |
| 540 | } SuwaSide; |
| 541 | #endif |
| 542 | |
| 543 | #if defined(SUWAUI_IMPLEMENTS_SUWATEXTBOX) |
| 544 | typedef struct { |
| 545 | int x, y, width, height; |
| 546 | } SuwaTextbox; |
| 547 | #endif |
| 548 | |
| 549 | #if defined(SUWAUI_IMPLEMENTS_SUWATEXTEDIT) |
| 550 | typedef struct { |
| 551 | int x, y, width, height; |
| 552 | } SuwaTextEdit; |
| 553 | #endif |
| 554 | |
| 555 | #if defined(SUWAUI_IMPLEMENTS_SUWAMENUBAR) |
| 556 | typedef struct { |
| 557 | int x, y, width, height; |
| 558 | } SuwaMenubar; |
| 559 | #endif |
| 560 | |
| 561 | #if defined(SUWAUI_IMPLEMENTS_SUWADIALOG) |
| 562 | typedef struct { |
| 563 | int x, y, width, height; |
| 564 | } SuwaDialog; |
| 565 | #endif |
| 566 | |
| 567 | #if defined(SUWAUI_IMPLEMENTS_SUWAIO) |
| 568 | typedef struct { |
| 569 | int x, y, width, height; |
| 570 | } SuwaIO; |
| 571 | #endif |
| 572 | #endif |