display is where pixels are drawn to and user input are read from

struct mbtk_display_s { union { void *ptr[64]; long int i[64]; } backend_data; /* opaque backend data */ mbtk_backend_t *be; mbtk_window_t *topwin; gdl_list_t windows; /* all windows open within this display */ unsigned need_win_redraw:1; /* if any of the windows needs a window redraw */ double win_next_redraw; /* when to next redraw windows (0 means default timeout) */ const mbtk_style_t *style; /* style implementation to use for drawing widgets that don't have their own style */ mbtk_styleprop_t *styleprop; /* fallback (default) style properties for all widgets without own styleprop */ unsigned short button_mask; /* mouse button mask: each bit is the last known state of a mouse button */ struct { mbtk_event_t ev_win_resize, ev_win_expose; double exp_win_resize, exp_win_expose; /* when ev_win_* will next expire */ double last_win_resize, last_win_expose; /* when ev_win_* was last done */ } evi; /* event handler internals */ mbtk_font_id_t default_fid; /* labels are drawn with this font by default */ htip_t mpm; /* mpm; key is "name" (mbtk_kw_t), value is (mbtk_mbm_styled_t *); see mbm.h */ gdl_elem_t link; /* all displays within a backend */ vtp0_t timers; /* all timers that are still allocated */ void *timerq; /* timer queue for currently running timers */ #if 0 /* last popup is the topmost */ int *popups; int popup_used, popup_alloced; }; /* Change the top window of display. By default the first window created under a display becomes the top window. Top window is used when reporting generic, window-idependent events (such as timers, fdwatch, stdin, etc.) */ void mbtk_display_set_topwin(mbtk_display_t *disp, mbtk_window_t *win); /* Query backend and return bitfield of keyboard modifiers currently pressed */ mbtk_keymod_t mbtk_display_query_kbd_mods(mbtk_display_t *disp);