summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-10-07 13:11:30 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-10-07 13:11:30 +0200
commit1c813d1d1dafa4e1224eb9ab059ffcded66e8213 (patch)
treef95e285ac8a2588b1c88c681caaa1d9483e36a64 /src
parent70bfc314e013b169d16e62cac671acf58f147dc7 (diff)
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 <dh.herrmann@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/wlt_toolkit.c8
-rw-r--r--src/wlt_toolkit.h1
2 files changed, 9 insertions, 0 deletions
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);