Changeset 20d2c6c in mainline for uspace/app/uidemo/uidemo.c
- Timestamp:
- 2020-10-21T20:58:52Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 172188a
- Parents:
- ba09d06
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/uidemo/uidemo.c
rba09d06 r20d2c6c 66 66 }; 67 67 68 static void wd_close(ui_wdecor_t *, void *); 68 69 static void wd_move(ui_wdecor_t *, void *, gfx_coord2_t *); 69 70 70 71 static ui_wdecor_cb_t wdecor_cb = { 72 .close = wd_close, 71 73 .move = wd_move 72 74 }; 73 75 74 static bool quit = false;75 76 76 /** Print syntax. */ 77 77 static void print_syntax(void) … … 83 83 static void wnd_close_event(void *arg) 84 84 { 85 ui_demo_t *demo = (ui_demo_t *) arg; 86 85 87 printf("Close event\n"); 86 quit = true;88 demo->quit = true; 87 89 } 88 90 … … 101 103 static void wnd_kbd_event(void *arg, kbd_event_t *event) 102 104 { 105 ui_demo_t *demo = (ui_demo_t *) arg; 106 107 (void) demo; 103 108 printf("Keyboard event type=%d key=%d\n", event->type, event->key); 104 if (event->type == KEY_PRESS)105 quit = true;106 109 } 107 110 … … 156 159 } 157 160 161 /** Window decoration requested window closure. 162 * 163 * @param wdecor Window decoration 164 * @param arg Argument (demo) 165 */ 166 static void wd_close(ui_wdecor_t *wdecor, void *arg) 167 { 168 ui_demo_t *demo = (ui_demo_t *) arg; 169 170 printf("Close window requested\n"); 171 demo->quit = true; 172 } 173 158 174 /** Window decoration requested window move. 159 175 * … … 205 221 } 206 222 223 demo.quit = false; 207 224 demo.dwindow = window; 208 225 … … 318 335 } 319 336 320 while (! quit) {337 while (!demo.quit) { 321 338 fibril_usleep(100 * 1000); 322 339 }
Note:
See TracChangeset
for help on using the changeset viewer.