aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-08-04 23:20:04 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:34:56 +0200
commit67a5799618186beecd0ea028101395de3569345f (patch)
treef0f264c0d3e9965a8143d6effd990f41bb306635 /pugl/detail/mac.m
parent59359e4f3d81231e7c665aa53ceeba7de0671d95 (diff)
downloadpugl-67a5799618186beecd0ea028101395de3569345f.tar.gz
pugl-67a5799618186beecd0ea028101395de3569345f.tar.bz2
pugl-67a5799618186beecd0ea028101395de3569345f.zip
Make almost everything return a status
Prepares the API for proper error handling, even though there isn't any for these functions yet.
Diffstat (limited to 'pugl/detail/mac.m')
-rw-r--r--pugl/detail/mac.m18
1 files changed, 12 insertions, 6 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index bf845fc..8570709 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -713,7 +713,7 @@ puglConstraint(id item, NSLayoutAttribute attribute, float constant)
constant: constant];
}
-int
+PuglStatus
puglCreateWindow(PuglView* view, const char* title)
{
PuglInternals* impl = view->impl;
@@ -798,19 +798,21 @@ puglCreateWindow(PuglView* view, const char* title)
return 0;
}
-void
+PuglStatus
puglShowWindow(PuglView* view)
{
[view->impl->window setIsVisible:YES];
updateViewRect(view);
view->visible = true;
+ return PUGL_SUCCESS;
}
-void
+PuglStatus
puglHideWindow(PuglView* view)
{
[view->impl->window setIsVisible:NO];
view->visible = false;
+ return PUGL_SUCCESS;
}
void
@@ -829,13 +831,14 @@ puglFreeViewInternals(PuglView* view)
free(view->impl);
}
-void
+PuglStatus
puglGrabFocus(PuglView* view)
{
NSWindow* window = [view->impl->wrapperView window];
[window makeKeyWindow];
[window makeFirstResponder:view->impl->wrapperView];
+ return PUGL_SUCCESS;
}
bool
@@ -847,7 +850,7 @@ puglHasFocus(const PuglView* view)
[[impl->wrapperView window] firstResponder] == impl->wrapperView);
}
-void
+PuglStatus
puglRequestAttention(PuglView* view)
{
if (![view->impl->window isKeyWindow]) {
@@ -859,6 +862,8 @@ puglRequestAttention(PuglView* view)
userInfo:nil
repeats:YES];
}
+
+ return PUGL_SUCCESS;
}
PuglStatus
@@ -931,10 +936,11 @@ puglGetTime(const PuglWorld* world)
return (mach_absolute_time() / 1e9) - world->startTime;
}
-void
+PuglStatus
puglPostRedisplay(PuglView* view)
{
[view->impl->drawView setNeedsDisplay: YES];
+ return PUGL_SUCCESS;
}
PuglNativeWindow