From 1c813d1d1dafa4e1224eb9ab059ffcded66e8213 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 7 Oct 2012 13:11:30 +0200 Subject: wlt: toolkit: add wlt_window_get_display() helper This is useful to get access to input devices from the display when only a widget or window is available. Signed-off-by: David Herrmann --- src/wlt_toolkit.c | 8 ++++++++ src/wlt_toolkit.h | 1 + 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/wlt_toolkit.c b/src/wlt_toolkit.c index b2010aa..a89239b 100644 --- a/src/wlt_toolkit.c +++ b/src/wlt_toolkit.c @@ -1566,6 +1566,14 @@ struct ev_eloop *wlt_window_get_eloop(struct wlt_window *wnd) return wnd->disp->eloop; } +struct wlt_display *wlt_window_get_display(struct wlt_window *wnd) +{ + if (!wnd) + return NULL; + + return wnd->disp; +} + void wlt_widget_destroy(struct wlt_widget *widget) { if (!widget) diff --git a/src/wlt_toolkit.h b/src/wlt_toolkit.h index 263e76f..de0d75f 100644 --- a/src/wlt_toolkit.h +++ b/src/wlt_toolkit.h @@ -157,6 +157,7 @@ void wlt_window_close(struct wlt_window *wnd); void wlt_window_toggle_maximize(struct wlt_window *wnd); void wlt_window_toggle_fullscreen(struct wlt_window *wnd); struct ev_eloop *wlt_window_get_eloop(struct wlt_window *wnd); +struct wlt_display *wlt_window_get_display(struct wlt_window *wnd); void wlt_widget_destroy(struct wlt_widget *widget); struct wlt_window *wlt_widget_get_window(struct wlt_widget *widget); -- cgit v1.2.3