Changeset 7481ee19 in mainline for uspace/lib/ui/src/fixed.c


Ignore:
Timestamp:
2021-06-23T08:15:00Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a977e37
Parents:
034ce6bb
git-author:
Jiri Svoboda <jiri@…> (2021-06-22 17:14:40)
git-committer:
Jiri Svoboda <jiri@…> (2021-06-23 08:15:00)
Message:

Basic editable text entry

File:
1 edited

Legend:

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

    r034ce6bb r7481ee19  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4646static void ui_fixed_ctl_destroy(void *);
    4747static errno_t ui_fixed_ctl_paint(void *);
     48static ui_evclaim_t ui_fixed_ctl_kbd_event(void *, kbd_event_t *);
    4849static ui_evclaim_t ui_fixed_ctl_pos_event(void *, pos_event_t *);
    4950static void ui_fixed_ctl_unfocus(void *);
     
    5354        .destroy = ui_fixed_ctl_destroy,
    5455        .paint = ui_fixed_ctl_paint,
     56        .kbd_event = ui_fixed_ctl_kbd_event,
    5557        .pos_event = ui_fixed_ctl_pos_event,
    5658        .unfocus = ui_fixed_ctl_unfocus
     
    211213}
    212214
     215/** Handle fixed layout keyboard event.
     216 *
     217 * @param fixed Fixed layout
     218 * @param kbd_event Keyboard event
     219 * @return @c ui_claimed iff the event is claimed
     220 */
     221ui_evclaim_t ui_fixed_kbd_event(ui_fixed_t *fixed, kbd_event_t *event)
     222{
     223        ui_fixed_elem_t *elem;
     224        ui_evclaim_t claimed;
     225
     226        elem = ui_fixed_first(fixed);
     227        while (elem != NULL) {
     228                claimed = ui_control_kbd_event(elem->control, event);
     229                if (claimed == ui_claimed)
     230                        return ui_claimed;
     231
     232                elem = ui_fixed_next(elem);
     233        }
     234
     235        return ui_unclaimed;
     236}
     237
    213238/** Handle fixed layout position event.
    214239 *
     
    273298}
    274299
     300/** Handle fixed layout control keyboard event.
     301 *
     302 * @param arg Argument (ui_fixed_t *)
     303 * @param kbd_event Keyboard event
     304 * @return @c ui_claimed iff the event is claimed
     305 */
     306ui_evclaim_t ui_fixed_ctl_kbd_event(void *arg, kbd_event_t *event)
     307{
     308        ui_fixed_t *fixed = (ui_fixed_t *) arg;
     309
     310        return ui_fixed_kbd_event(fixed, event);
     311}
     312
    275313/** Handle fixed layout control position event.
    276314 *
Note: See TracChangeset for help on using the changeset viewer.