Changeset b3c185b6 in mainline for uspace/srv/hid/display/output.c


Ignore:
Timestamp:
2019-11-04T14:05:35Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
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)
Message:

Window event delivery mechanism

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/output.c

    r22faaf2 rb3c185b6  
    4242#include "output.h"
    4343
    44 errno_t output_init(gfx_context_t **rgc)
     44static void (*kbd_ev_handler)(void *, kbd_event_t *);
     45static void *kbd_ev_arg;
     46
     47static void on_keyboard_event(widget_t *widget, void *data)
     48{
     49        printf("Keyboard event\n");
     50        kbd_ev_handler(kbd_ev_arg, (kbd_event_t *) data);
     51}
     52
     53errno_t output_init(void (*kbd_event_handler)(void *, kbd_event_t *),
     54    void *arg, gfx_context_t **rgc)
    4555{
    4656        canvas_gc_t *cgc = NULL;
     
    5363
    5464        printf("Init canvas..\n");
     65        kbd_ev_handler = kbd_event_handler;
     66        kbd_ev_arg = arg;
    5567
    5668        window = window_open("comp:0/winreg", NULL,
     
    8395        }
    8496
     97        sig_connect(&canvas->keyboard_event, NULL, on_keyboard_event);
     98
    8599        window_resize(window, 0, 0, vw + 10, vh + 30, WINDOW_PLACEMENT_ANY);
    86100        window_exec(window);
Note: See TracChangeset for help on using the changeset viewer.