Changeset 1ebcb791 in mainline
- Timestamp:
- 2021-09-01T19:44:37Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f7c12b3
- Parents:
- 45004f3
- Location:
- uspace/lib/ui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/private/resource.h
r45004f3 r1ebcb791 1 1 /* 2 * Copyright (c) 202 0Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 59 59 bool textmode; 60 60 61 /** UI background color */ 62 gfx_color_t *ui_bg_color; 63 61 64 /** Button frame color */ 62 65 gfx_color_t *btn_frame_color; -
uspace/lib/ui/private/ui.h
r45004f3 r1ebcb791 39 39 40 40 #include <adt/list.h> 41 #include <gfx/coord.h> 41 42 #include <display.h> 42 43 #include <io/console.h> … … 54 55 /** Display */ 55 56 display_t *display; 57 /** UI rectangle (only used in fullscreen mode) */ 58 gfx_rect_t rect; 56 59 /** Output owned by UI, clean up when destroying UI */ 57 60 bool myoutput; -
uspace/lib/ui/src/resource.c
r45004f3 r1ebcb791 327 327 goto error; 328 328 329 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, 330 &btn_highlight_color); 329 rc = gfx_color_new_ega(0x20, &btn_highlight_color); 331 330 if (rc != EOK) 332 331 goto error; -
uspace/lib/ui/src/ui.c
r45004f3 r1ebcb791 39 39 #include <errno.h> 40 40 #include <fibril.h> 41 #include <gfx/color.h> 42 #include <gfx/render.h> 41 43 #include <io/console.h> 42 44 #include <stdbool.h> … … 109 111 ui_winsys_t ws; 110 112 const char *osvc; 113 sysarg_t cols; 114 sysarg_t rows; 111 115 ui_t *ui; 112 116 … … 128 132 return EIO; 129 133 134 rc = console_get_size(console, &cols, &rows); 135 if (rc != EOK) { 136 console_done(console); 137 return rc; 138 } 139 130 140 console_cursor_visibility(console, false); 131 141 … … 145 155 146 156 ui->cgc = cgc; 157 ui->rect.p0.x = 0; 158 ui->rect.p0.y = 0; 159 ui->rect.p1.x = cols; 160 ui->rect.p1.y = rows; 161 162 (void) ui_paint(ui); 147 163 } else { 148 164 return EINVAL; … … 284 300 { 285 301 errno_t rc; 302 gfx_context_t *gc; 286 303 ui_window_t *awnd; 304 gfx_color_t *color = NULL; 305 306 gc = console_gc_get_ctx(ui->cgc); 307 308 rc = gfx_color_new_ega(0x11, &color); 309 if (rc != EOK) 310 return rc; 311 312 rc = gfx_set_color(gc, color); 313 if (rc != EOK) { 314 gfx_color_delete(color); 315 return rc; 316 } 317 318 rc = gfx_fill_rect(gc, &ui->rect); 319 if (rc != EOK) { 320 gfx_color_delete(color); 321 return rc; 322 } 323 324 gfx_color_delete(color); 287 325 288 326 /* XXX Should repaint all windows */
Note:
See TracChangeset
for help on using the changeset viewer.