Changeset b3c185b6 in mainline for uspace/lib/display/include


Ignore:
Timestamp:
2019-11-04T14:05:35Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be15256
Parents:
22faaf2
git-author:
Jiri Svoboda <jiri@…> (2019-10-03 18:05:09)
git-committer:
Jiri Svoboda <jiri@…> (2019-11-04 14:05:35)
Message:

Window event delivery mechanism

Location:
uspace/lib/display/include
Files:
2 added
4 edited

Legend:

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

    r22faaf2 rb3c185b6  
    3838#include <async.h>
    3939#include <errno.h>
     40#include <types/display/event.h>
    4041
    4142typedef struct display_ops display_ops_t;
     
    5152        errno_t (*window_create)(void *, sysarg_t *);
    5253        errno_t (*window_destroy)(void *, sysarg_t);
     54        errno_t (*get_event)(void *, sysarg_t *, display_wnd_ev_t *);
    5355};
    5456
    5557extern void display_conn(ipc_call_t *, display_srv_t *);
     58extern void display_srv_ev_pending(display_srv_t *);
    5659
    5760#endif
  • uspace/lib/display/include/display.h

    r22faaf2 rb3c185b6  
    4343extern errno_t display_open(const char *, display_t **);
    4444extern void display_close(display_t *);
    45 extern errno_t display_window_create(display_t *, display_window_t **);
     45extern errno_t display_window_create(display_t *, display_wnd_cb_t *,
     46    void *, display_window_t **);
    4647extern errno_t display_window_destroy(display_window_t *);
    4748extern errno_t display_window_get_gc(display_window_t *, gfx_context_t **);
  • uspace/lib/display/include/ipc/display.h

    r22faaf2 rb3c185b6  
    3939
    4040typedef enum {
    41         DISPLAY_WINDOW_CREATE = IPC_FIRST_USER_METHOD,
     41        DISPLAY_CALLBACK_CREATE = IPC_FIRST_USER_METHOD,
     42        DISPLAY_WINDOW_CREATE,
    4243        DISPLAY_WINDOW_DESTROY,
    43         DISPLAY_WINDOW_GC
     44        DISPLAY_GET_EVENT
    4445} display_request_t;
     46
     47typedef enum {
     48        DISPLAY_EV_PENDING = IPC_FIRST_USER_METHOD
     49} display_event_t;
    4550
    4651#endif
  • uspace/lib/display/include/types/display.h

    r22faaf2 rb3c185b6  
    3737
    3838#include <async.h>
     39#include <fibril_synch.h>
     40#include <io/kbd_event.h>
    3941#include <ipc/devman.h>
    4042#include <stdint.h>
     
    4446        /** Session with display server */
    4547        async_sess_t *sess;
     48        /** Synchronize access to display object */
     49        fibril_mutex_t lock;
     50        /** @c true if callback handler terminated */
     51        bool cb_done;
     52        /** Signalled when cb_done or ev_pending is changed */
     53        fibril_condvar_t cv;
     54        /** Windows (of display_window_t) */
     55        list_t windows;
    4656} display_t;
     57
     58/** Display window callbacks */
     59typedef struct {
     60        void (*kbd_event)(void *, kbd_event_t *);
     61} display_wnd_cb_t;
     62
     63typedef struct {
     64        kbd_event_t kbd_event;
     65} display_wnd_ev_t;
    4766
    4867/** Display window */
     
    5069        /** Display associated with the window */
    5170        display_t *display;
     71        /** Link to @c display->windows */
     72        link_t lwindows;
    5273        /** Window ID */
    5374        sysarg_t id;
     75        /** Callback functions */
     76        display_wnd_cb_t *cb;
     77        /** Argument to callback functions */
     78        void *cb_arg;
    5479} display_window_t;
    5580
Note: See TracChangeset for help on using the changeset viewer.