summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-03-06 16:29:14 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-03-06 16:29:14 +0100
commit96a82433b0ca2b489e0560d02217a88995fc2f8d (patch)
treee80229c14ededb6ebe69de7807c4887396033b20 /src
parente4d25266b08f56953bd53587f1509ec1d1b64375 (diff)
wlt: toolkit: add is_maximized/fullscreen helpers
These helpers return whether a window is maximized/fullscreen. This can be used by the theme/terminal control layer to change behavior depending on these flags. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/wlt_toolkit.c10
-rw-r--r--src/wlt_toolkit.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/wlt_toolkit.c b/src/wlt_toolkit.c
index 548cb1e..18a0233 100644
--- a/src/wlt_toolkit.c
+++ b/src/wlt_toolkit.c
@@ -1813,6 +1813,11 @@ void wlt_window_toggle_maximize(struct wlt_window *wnd)
wnd->maximized = !wnd->maximized;
}
+bool wlt_window_is_maximized(struct wlt_window *wnd)
+{
+ return wnd && wnd->maximized;
+}
+
void wlt_window_toggle_fullscreen(struct wlt_window *wnd)
{
if (!wnd)
@@ -1840,6 +1845,11 @@ void wlt_window_toggle_fullscreen(struct wlt_window *wnd)
wnd->fullscreen = !wnd->fullscreen;
}
+bool wlt_window_is_fullscreen(struct wlt_window *wnd)
+{
+ return wnd && wnd->fullscreen;
+}
+
struct ev_eloop *wlt_window_get_eloop(struct wlt_window *wnd)
{
if (!wnd)
diff --git a/src/wlt_toolkit.h b/src/wlt_toolkit.h
index 20fac59..44ce0ec 100644
--- a/src/wlt_toolkit.h
+++ b/src/wlt_toolkit.h
@@ -164,7 +164,9 @@ void wlt_window_set_close_cb(struct wlt_window *wnd,
wlt_window_close_cb cb);
void wlt_window_close(struct wlt_window *wnd);
void wlt_window_toggle_maximize(struct wlt_window *wnd);
+bool wlt_window_is_maximized(struct wlt_window *wnd);
void wlt_window_toggle_fullscreen(struct wlt_window *wnd);
+bool wlt_window_is_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);