Changeset b71c0fc in mainline for uspace/app/uidemo/uidemo.c
- Timestamp:
- 2020-11-07T16:07:22Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d55ab823
- Parents:
- fa01c05
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/uidemo/uidemo.c
rfa01c05 rb71c0fc 34 34 35 35 #include <gfx/coord.h> 36 #include <io/pos_event.h>37 36 #include <stdio.h> 38 37 #include <str.h> … … 43 42 #include <ui/resource.h> 44 43 #include <ui/ui.h> 45 #include <ui/wdecor.h>46 44 #include <ui/window.h> 47 45 #include "uidemo.h" 48 46 49 47 static void wnd_close(ui_window_t *, void *); 50 static errno_t wnd_paint(ui_window_t *, void *);51 static void wnd_pos(ui_window_t *, void *, pos_event_t *pos);52 48 53 49 static ui_window_cb_t window_cb = { 54 .close = wnd_close, 55 .paint = wnd_paint, 56 .pos = wnd_pos 50 .close = wnd_close 57 51 }; 58 52 … … 73 67 74 68 ui_quit(demo->ui); 75 }76 77 /** Window paint request.78 *79 * @param window Window80 * @param arg Argument (demo)81 * @return EOK on success or an error code82 */83 static errno_t wnd_paint(ui_window_t *window, void *arg)84 {85 ui_demo_t *demo = (ui_demo_t *) arg;86 errno_t rc;87 88 /* Let window paint its background */89 rc = ui_window_def_paint(window);90 if (rc != EOK)91 return rc;92 93 return ui_fixed_paint(demo->fixed);94 }95 96 /** Window position event.97 *98 * @param window Window99 * @param arg Argument (demo)100 */101 static void wnd_pos(ui_window_t *window, void *arg, pos_event_t *event)102 {103 ui_demo_t *demo = (ui_demo_t *) arg;104 105 /* Make sure we don't process events until fully initialized */106 if (demo->fixed == NULL)107 return;108 109 ui_fixed_pos_event(demo->fixed, event);110 69 } 111 70 … … 240 199 } 241 200 201 ui_window_add(window, ui_fixed_ctl(demo.fixed)); 202 242 203 rc = ui_window_paint(window); 243 204 if (rc != EOK) { … … 248 209 ui_run(ui); 249 210 250 ui_fixed_destroy(demo.fixed);251 211 ui_window_destroy(window); 252 212 ui_destroy(ui);
Note:
See TracChangeset
for help on using the changeset viewer.