Changeset b3c185b6 in mainline for uspace/app/gfxdemo/gfxdemo.c
- Timestamp:
- 2019-11-04T14:05:35Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be15256
- Parents:
- 22faaf2
- git-author:
- Jiri Svoboda <jiri@…> (2019-10-03 18:05:09)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-11-04 14:05:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/gfxdemo/gfxdemo.c
r22faaf2 rb3c185b6 44 44 #include <io/console.h> 45 45 #include <io/pixelmap.h> 46 #include <stdbool.h> 46 47 #include <stdlib.h> 47 48 #include <str.h> 48 49 #include <window.h> 50 51 static void wnd_kbd_event(void *, kbd_event_t *); 52 53 static display_wnd_cb_t wnd_cb = { 54 .kbd_event = wnd_kbd_event 55 }; 56 57 static bool quit = false; 49 58 50 59 /** Clear screen. … … 126 135 127 136 fibril_usleep(500 * 1000); 137 138 if (quit) 139 break; 128 140 } 129 141 … … 245 257 goto error; 246 258 fibril_usleep(250 * 1000); 259 260 if (quit) 261 break; 247 262 } 248 263 } … … 298 313 299 314 fibril_usleep(500 * 1000); 315 316 if (quit) 317 break; 300 318 } 301 319 … … 318 336 errno_t rc; 319 337 320 while ( true) {338 while (!quit) { 321 339 rc = demo_rects(gc, w, h); 322 340 if (rc != EOK) … … 331 349 return rc; 332 350 } 351 352 return EOK; 333 353 } 334 354 … … 444 464 } 445 465 446 rc = display_window_create(display, &w indow);466 rc = display_window_create(display, &wnd_cb, NULL, &window); 447 467 if (rc != EOK) { 448 468 printf("Error creating window.\n"); … … 464 484 465 485 return EOK; 486 } 487 488 static void wnd_kbd_event(void *arg, kbd_event_t *event) 489 { 490 printf("Keyboard event type=%d key=%d\n", event->type, event->key); 491 quit = true; 466 492 } 467 493
Note:
See TracChangeset
for help on using the changeset viewer.