Changeset f03d1308 in mainline for uspace/lib/ui/src/window.c


Ignore:
Timestamp:
2020-10-28T12:42:11Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8009dc27
Parents:
d284ce9
git-author:
Jiri Svoboda <jiri@…> (2020-10-28 12:41:11)
git-committer:
Jiri Svoboda <jiri@…> (2020-10-28 12:42:11)
Message:

Convert terminal to using ui_window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/window.c

    rd284ce9 rf03d1308  
    3737#include <errno.h>
    3838#include <gfx/context.h>
     39#include <io/kbd_event.h>
    3940#include <io/pos_event.h>
    4041#include <mem.h>
     
    221222                ui_wdecor_paint(window->wdecor);
    222223        }
     224
     225        ui_window_focus(window);
    223226}
    224227
     
    229232
    230233        (void) window;
    231         (void) kbd_event;
     234        ui_window_kbd(window, kbd_event);
    232235}
    233236
     
    254257                ui_wdecor_paint(window->wdecor);
    255258        }
     259
     260        ui_window_unfocus(window);
    256261}
    257262
     
    291296}
    292297
     298/** Send window focus event.
     299 *
     300 * @param window Window
     301 */
     302void ui_window_focus(ui_window_t *window)
     303{
     304        if (window->cb != NULL && window->cb->focus != NULL)
     305                window->cb->focus(window, window->arg);
     306}
     307
     308/** Send window keyboard event.
     309 *
     310 * @param window Window
     311 */
     312void ui_window_kbd(ui_window_t *window, kbd_event_t *kbd)
     313{
     314        if (window->cb != NULL && window->cb->kbd != NULL)
     315                window->cb->kbd(window, window->arg, kbd);
     316}
     317
    293318/** Send window position event.
    294319 *
     
    301326}
    302327
     328/** Send window unfocus event.
     329 *
     330 * @param window Window
     331 */
     332void ui_window_unfocus(ui_window_t *window)
     333{
     334        if (window->cb != NULL && window->cb->unfocus != NULL)
     335                window->cb->unfocus(window, window->arg);
     336}
     337
    303338/** @}
    304339 */
Note: See TracChangeset for help on using the changeset viewer.