Changeset e422ff6 in mainline
- Timestamp:
- 2019-11-06T21:10:53Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bfddc62
- Parents:
- 959b7ec
- Location:
- uspace/srv/hid/display
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/client.c
r959b7ec re422ff6 34 34 */ 35 35 36 #include <adt/list.h> 36 37 #include <errno.h> 37 38 #include <stdlib.h> … … 58 59 59 60 list_initialize(&client->windows); 60 prodcons_initialize(&client->events);61 list_initialize(&client->events); 61 62 client->cb = cb; 62 63 client->cb_arg = cb_arg; … … 162 163 /** Get next event from client event queue. 163 164 * 164 * This function blocks until an event is available.165 * 166 * @param wnd Window165 * @param client Client 166 * @param ewindow Place to store pointer to window receiving the event 167 * @param event Place to store event 167 168 * @return Graphic context 168 169 */ … … 173 174 ds_window_ev_t *wevent; 174 175 175 link = prodcons_consume(&client->events); 176 link = list_first(&client->events); 177 if (link == NULL) 178 return ENOENT; 176 179 wevent = list_get_instance(link, ds_window_ev_t, levents); 177 180 … … 182 185 } 183 186 187 /** Post keyboard event to the client's message queue. 188 * 189 * @param client Client 190 * @param ewindow Window that the message is targetted to 191 * @param event Event 192 * 193 * @return EOK on success or an error code 194 */ 184 195 errno_t ds_client_post_kbd_event(ds_client_t *client, ds_window_t *ewindow, 185 196 kbd_event_t *event) … … 193 204 wevent->window = ewindow; 194 205 wevent->event.kbd_event = *event; 195 prodcons_produce(&client->events, &wevent->levents);206 list_append(&wevent->levents, &client->events); 196 207 197 208 /* Notify the client */ -
uspace/srv/hid/display/test/client.c
r959b7ec re422ff6 180 180 PCUT_ASSERT_FALSE(called_cb); 181 181 182 #if 0183 // XXX Forgot to change ds_client_get_event not to block184 182 rc = ds_client_get_event(client, &rwindow, &revent); 185 183 PCUT_ASSERT_ERRNO_VAL(ENOENT, rc); 186 #endif187 184 188 185 rc = ds_client_post_kbd_event(client, wnd, &event); -
uspace/srv/hid/display/types/display/client.h
r959b7ec re422ff6 38 38 39 39 #include <adt/list.h> 40 #include <adt/prodcons.h>41 40 42 41 typedef sysarg_t ds_wnd_id_t; … … 60 59 list_t windows; 61 60 /** Event queue (of ds_window_ev_t) */ 62 prodcons_t events;61 list_t events; 63 62 } ds_client_t; 64 63
Note:
See TracChangeset
for help on using the changeset viewer.