wlt: toolkit: add wlt_window_get_eloop() helper
This helper allows widgets to retrieve the eloop that is used by the window. Otherwise, we couldn't dispatch events there. No refcounting is needed as all widgets are destroyed before the window is destroyed. Other users need to perform ref-counting by themself. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
89cb239fce
commit
27fa6c3310
@ -1219,6 +1219,14 @@ void wlt_window_close(struct wlt_window *wnd)
|
||||
ev_eloop_register_idle_cb(wnd->disp->eloop, close_window, wnd);
|
||||
}
|
||||
|
||||
struct ev_eloop *wlt_window_get_eloop(struct wlt_window *wnd)
|
||||
{
|
||||
if (!wnd)
|
||||
return NULL;
|
||||
|
||||
return wnd->disp->eloop;
|
||||
}
|
||||
|
||||
void wlt_widget_destroy(struct wlt_widget *widget)
|
||||
{
|
||||
if (!widget)
|
||||
|
@ -138,6 +138,7 @@ void wlt_window_set_cursor(struct wlt_window *wnd, unsigned int cursor);
|
||||
void wlt_window_set_close_cb(struct wlt_window *wnd,
|
||||
wlt_window_close_cb cb);
|
||||
void wlt_window_close(struct wlt_window *wnd);
|
||||
struct ev_eloop *wlt_window_get_eloop(struct wlt_window *wnd);
|
||||
|
||||
void wlt_widget_destroy(struct wlt_widget *widget);
|
||||
struct wlt_window *wlt_widget_get_window(struct wlt_widget *widget);
|
||||
|
Loading…
x
Reference in New Issue
Block a user