Changes in uspace/lib/ui/src/popup.c [d92b8e8f:d7f82635] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/popup.c
rd92b8e8f rd7f82635 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 36 36 #include <errno.h> 37 37 #include <gfx/context.h> 38 #include <io/kbd_event.h>38 //#include <io/kbd_event.h> 39 39 #include <io/pos_event.h> 40 40 #include <mem.h> … … 47 47 48 48 static void ui_popup_window_close(ui_window_t *, void *); 49 static void ui_popup_window_kbd(ui_window_t *, void *, kbd_event_t *);50 49 static void ui_popup_window_pos(ui_window_t *, void *, pos_event_t *); 51 50 52 51 static ui_window_cb_t ui_popup_window_cb = { 53 52 .close = ui_popup_window_close, 54 .kbd = ui_popup_window_kbd,55 53 .pos = ui_popup_window_pos 56 54 }; … … 98 96 wparams.style &= ~ui_wds_decorated; 99 97 wparams.placement = ui_wnd_place_popup; 100 wparams.flags |= ui_wndf_popup | ui_wndf_topmost; 101 wparams.idev_id = params->idev_id; 98 wparams.flags |= ui_wndf_popup; 102 99 103 100 /* Compute position of parent rectangle relative to the screen */ … … 190 187 } 191 188 192 /** Get ID of device that sent the last position event.193 *194 * @param popup Popup window195 * @return Input device ID196 */197 sysarg_t ui_popup_get_idev_id(ui_popup_t *popup)198 {199 return popup->idev_id;200 }201 202 189 /** Handle close event in popup window. 203 190 * … … 211 198 if (popup->cb != NULL && popup->cb->close != NULL) 212 199 popup->cb->close(popup, popup->arg); 213 }214 215 /** Handle keyboard event in popup window.216 *217 * @param window Window218 * @param arg Argument (ui_popup_t *)219 * @param event Keyboard event220 */221 static void ui_popup_window_kbd(ui_window_t *window, void *arg,222 kbd_event_t *event)223 {224 ui_popup_t *popup = (ui_popup_t *)arg;225 226 /* Remember ID of device that sent the last event */227 popup->idev_id = event->kbd_id;228 229 if (popup->cb != NULL && popup->cb->kbd != NULL)230 popup->cb->kbd(popup, popup->arg, event);231 200 } 232 201 … … 242 211 ui_popup_t *popup = (ui_popup_t *)arg; 243 212 244 /* Remember ID of device that sent the last event */245 popup->idev_id = event->pos_id;246 247 213 if (popup->cb != NULL && popup->cb->pos != NULL) 248 214 popup->cb->pos(popup, popup->arg, event);
Note:
See TracChangeset
for help on using the changeset viewer.