Implemented the fullscreen stuff on GTK+.

This commit is contained in:
Pietro Gagliardi 2016-06-16 10:03:35 -04:00
parent fd9af04123
commit 132d925b70
1 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,7 @@ struct uiWindow {
void (*onContentSizeChanged)(uiWindow *, void *);
void *onContentSizeChangedData;
gboolean changingSize;
gboolean fullscreen;
};
static gboolean onClosing(GtkWidget *win, GdkEvent *e, gpointer data)
@ -212,6 +213,22 @@ void uiWindowSetContentSize(uiWindow *w, int width, int height)
gtk_widget_set_size_request(w->childHolderWidget, -1, -1);
}
int uiWindowFullscreen(uiWindow *w)
{
return w->fullscreen;
}
// TODO use window-state-event to track
// TODO does this send an extra size changed?
void uiWindowSetFullscreen(uiWindow *w, int fullscreen)
{
w->fullscreen = fullscreen;
if (w->fullscreen)
gtk_window_fullscreen(w->window);
else
gtk_window_unfullscreen(w->window);
}
void uiWindowOnContentSizeChanged(uiWindow *w, void (*f)(uiWindow *, void *), void *data)
{
w->onContentSizeChanged = f;