Changeset 24cf391a in mainline for uspace/srv/hid/display/output.c
- Timestamp:
- 2019-12-03T10:59:47Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 973efd36
- Parents:
- 79949f3
- git-author:
- Jiri Svoboda <jiri@…> (2019-11-02 18:59:43)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-12-03 10:59:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/output.c
r79949f3 r24cf391a 37 37 #include <gfx/context.h> 38 38 #include <guigfx/canvas.h> 39 #include <io/kbd_event.h> 40 #include <io/pos_event.h> 39 41 #include <stdio.h> 40 42 #include <stdlib.h> … … 44 46 static void (*kbd_ev_handler)(void *, kbd_event_t *); 45 47 static void *kbd_ev_arg; 48 static void (*pos_ev_handler)(void *, pos_event_t *); 49 static void *pos_ev_arg; 46 50 47 51 static void on_keyboard_event(widget_t *widget, void *data) … … 51 55 } 52 56 57 static void on_position_event(widget_t *widget, void *data) 58 { 59 pos_ev_handler(pos_ev_arg, (pos_event_t *) data); 60 } 61 53 62 errno_t output_init(void (*kbd_event_handler)(void *, kbd_event_t *), 54 void *arg, gfx_context_t **rgc) 63 void *karg, void (*pos_event_handler)(void *, pos_event_t *), 64 void *parg, gfx_context_t **rgc) 55 65 { 56 66 canvas_gc_t *cgc = NULL; … … 64 74 printf("Init canvas..\n"); 65 75 kbd_ev_handler = kbd_event_handler; 66 kbd_ev_arg = arg; 76 kbd_ev_arg = karg; 77 78 pos_ev_handler = pos_event_handler; 79 pos_ev_arg = parg; 67 80 68 81 window = window_open("comp:0/winreg", NULL, … … 96 109 97 110 sig_connect(&canvas->keyboard_event, NULL, on_keyboard_event); 111 sig_connect(&canvas->position_event, NULL, on_position_event); 98 112 99 113 window_resize(window, 0, 0, vw + 10, vh + 30, WINDOW_PLACEMENT_ANY);
Note:
See TracChangeset
for help on using the changeset viewer.