Changeset e022819 in mainline for uspace/lib/display


Ignore:
Timestamp:
2020-03-14T00:30:53Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03c8081
Parents:
1e4a937
Message:

Resizing windows

Location:
uspace/lib/display
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/display/include/types/display.h

    r1e4a937 re022819  
    7070        /** Position event */
    7171        void (*pos_event)(void *, pos_event_t *);
     72        /** Resize event */
     73        void (*resize_event)(void *, gfx_rect_t *);
    7274        /** Unfocus event */
    7375        void (*unfocus_event)(void *);
  • uspace/lib/display/include/types/display/event.h

    r1e4a937 re022819  
    3636#define _LIBDISPLAY_TYPES_DISPLAY_EVENT_H_
    3737
     38#include <gfx/coord.h>
    3839#include <io/kbd_event.h>
    3940#include <io/pos_event.h>
     
    4950        /** Position event */
    5051        wev_pos,
     52        /** Resize event */
     53        wev_resize,
    5154        /** Window lost focus */
    5255        wev_unfocus
    5356} display_wnd_ev_type_t;
     57
     58/** Display window resize event */
     59typedef struct {
     60        gfx_rect_t rect;
     61} display_wnd_resize_ev_t;
    5462
    5563/** Display window event */
     
    6270                /** Position event data */
    6371                pos_event_t pos;
     72                /** Resize event data */
     73                display_wnd_resize_ev_t resize;
    6474        } ev;
    6575} display_wnd_ev_t;
  • uspace/lib/display/src/display.c

    r1e4a937 re022819  
    460460                        }
    461461                        break;
     462                case wev_resize:
     463                        if (window->cb != NULL && window->cb->resize_event != NULL) {
     464                                window->cb->resize_event(window->cb_arg,
     465                                    &event.ev.resize.rect);
     466                        }
     467                        break;
    462468                case wev_unfocus:
    463469                        if (window->cb != NULL && window->cb->unfocus_event != NULL) {
Note: See TracChangeset for help on using the changeset viewer.