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>
This commit is contained in:
David Herrmann 2013-03-06 16:29:14 +01:00
parent e4d25266b0
commit 96a82433b0
2 changed files with 12 additions and 0 deletions

View File

@ -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)

View File

@ -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);