aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-01 22:22:16 -0400
committerDavid Robillard <d@drobilla.net>2016-09-01 22:22:16 -0400
commit33be0a19a206963f3c600484aea4d1b920b44fd1 (patch)
treebaabaa8cf993bd5320e7c4d09a9943e79c131b26 /pugl
parent156d9f03f26b4dd85dc75f652fb370b07bc2dab7 (diff)
downloadpugl-33be0a19a206963f3c600484aea4d1b920b44fd1.tar.gz
pugl-33be0a19a206963f3c600484aea4d1b920b44fd1.tar.bz2
pugl-33be0a19a206963f3c600484aea4d1b920b44fd1.zip
Add puglGetVisible()
Diffstat (limited to 'pugl')
-rw-r--r--pugl/pugl.h6
-rw-r--r--pugl/pugl_internal.h7
-rw-r--r--pugl/pugl_osx.m2
-rw-r--r--pugl/pugl_win.cpp2
-rw-r--r--pugl/pugl_x11.c2
5 files changed, 19 insertions, 0 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 4d5467a..07d3cf4 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -278,6 +278,12 @@ PUGL_API void*
puglGetContext(PuglView* view);
/**
+ Return true iff the view is currently visible.
+*/
+PUGL_API bool
+puglGetVisible(PuglView* view);
+
+/**
Return the timestamp (if any) of the currently-processing event.
*/
PUGL_API uint32_t
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h
index 778ff1f..6e7e621 100644
--- a/pugl/pugl_internal.h
+++ b/pugl/pugl_internal.h
@@ -68,6 +68,7 @@ struct PuglViewImpl {
bool ignoreKeyRepeat;
bool redisplay;
bool resizable;
+ bool visible;
uint32_t event_timestamp_ms;
};
@@ -167,6 +168,12 @@ puglGetHandle(PuglView* view)
return view->handle;
}
+bool
+puglGetVisible(PuglView* view)
+{
+ return view->visible;
+}
+
uint32_t
puglGetEventTimestamp(PuglView* view)
{
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 7888c6c..ecf9373 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -526,12 +526,14 @@ void
puglShowWindow(PuglView* view)
{
[view->impl->window setIsVisible:YES];
+ view->visible = true;
}
void
puglHideWindow(PuglView* view)
{
[view->impl->window setIsVisible:NO];
+ view->visible = false;
}
void
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp
index b834143..c061f25 100644
--- a/pugl/pugl_win.cpp
+++ b/pugl/pugl_win.cpp
@@ -209,6 +209,7 @@ puglShowWindow(PuglView* view)
PuglInternals* impl = view->impl;
ShowWindow(impl->hwnd, SW_SHOWNORMAL);
+ view->visible = true;
}
void
@@ -217,6 +218,7 @@ puglHideWindow(PuglView* view)
PuglInternals* impl = view->impl;
ShowWindow(impl->hwnd, SW_HIDE);
+ view->visible = false;
}
void
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index 5cd4373..4d7010b 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -347,12 +347,14 @@ void
puglShowWindow(PuglView* view)
{
XMapRaised(view->impl->display, view->impl->win);
+ view->visible = true;
}
void
puglHideWindow(PuglView* view)
{
XUnmapWindow(view->impl->display, view->impl->win);
+ view->visible = false;
}
void