aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/mac.m
AgeCommit message (Collapse)AuthorFilesLines
2020-03-17Use clearer names for pointer eventsDavid Robillard1-3/+3
These old "notify" names are a smell from X11 which is a bit strange and inconsistent here, since nearly everything is a "notification" of sorts. I think the new names here are much more clear since they are consistent with the keyboard focus events.
2020-03-16Simplify puglRequestAttention()David Robillard1-17/+0
Now that timers are exposed, applications can repeatedly nag for attention themselves if they really want to.
2020-03-16Add timer eventsDavid Robillard1-0/+44
2020-03-16MacOS: Fix semantics of puglUpdate() with negative timeoutDavid Robillard1-0/+6
2020-03-16MacOS: Move initial configure to just before mapDavid Robillard1-11/+10
2020-03-16Factor out dispatching configure events in the drawing contextDavid Robillard1-1/+1
The updates here need to happen whenever a configure is dispatched, even outside puglDispatchEvent(). This removes the last remaining direct calls to the event callback so the common implementation can always do the right thing.
2020-03-16Only send update events when the view is visibleDavid Robillard1-1/+4
2020-03-15Unify event loop functions as puglUpdate()David Robillard1-31/+20
The previous separation between polling and dispatching was a lie, especially on MacOS where it is impossible to only poll for events without dispatching anything. Providing such an API is misleading, and problematic in various other ways. So, merge them into a single puglUpdate() function which can do the right thing on all platforms. This also adds the behaviour of actually processing all events in the given time interval, which is almost always what clients actually want to do when using a positive timeout (naively doing this before caused terrible input lag).
2020-03-15Add type and flags to worldDavid Robillard1-1/+2
Unfortunately this is an API break, but there's no reasonable way to deprecate the old function and this is required for things to work correctly. The type will be used in following commits to tick the main loop and dispatch events correctly for either case.
2020-03-15Cleanup: Add puglDispatchSimpleEvent() internal utilityDavid Robillard1-8/+4
2020-03-15Cleanup: Remove redundant PUGL_API declarationsDavid Robillard1-1/+1
2020-03-15Remove backend resize methodDavid Robillard1-8/+0
2020-03-09Add PuglEventClient and puglSendEvent()David Robillard1-0/+48
This event makes it possible to send an arbitrary event to a view, which is useful for many things. In particular, this method of communication with views will wake up the event loop, unlike hacks in applications that share data in some other way.
2020-03-09Add create, destroy, map, and unmap eventsDavid Robillard1-4/+35
These can be used to do things when a view is created or destroyed, in particular set up the GL context in a more controlled way. Map and unmap events are also added for when views are shown and hidden so application can react to this as well. Towards the deprecation of puglEnterContext() and puglLeaveContext(), which are prone to abuse. squash! Remove client event stuff
2020-03-08Mac: Prevent indefinite blocking of puglDispatchEventsDavid Robillard1-0/+9
2020-03-08Mac: Do not dispatch expose events if window is invisibleDavid Robillard1-0/+4
2020-03-08Mac: Make windows initially invisible as on other platformsDavid Robillard1-0/+1
2020-03-08Mac: Fix stub backendDavid Robillard1-17/+0
2020-03-08Cleanup: Fix typoDavid Robillard1-1/+1
2020-03-02Omit deprecated implementations with PUGL_DISABLE_DEPRECATEDDavid Robillard1-0/+4
2020-03-01Cleanup: Adjust some code to be more clang-format friendlyDavid Robillard1-40/+48
2020-03-01Put PuglEventAny member of PuglEvent first for easy initializationDavid Robillard1-6/+3
2019-12-09Mac: Fix missing NSWindowStyleMask type on 10.11Hanspeter Portner1-0/+8
2019-11-21Rename "backend" headersDavid Robillard1-1/+1
Working on Vulkan clarified what has always been slightly smelly about the design and organization here: not everything that is API specific is really in a "backend" (a PuglBackend). The concrete example is puglGetProcAddress(), which only makes sense for GL and is actually implemented in the "backend" files. Arguably puglGetContext() is also such a thing. So, rename the headers so they can be the place where API-specific things go in general, which happens to include a backend most of the time. The stub is a bit of an exception to this, but whatever. The includes look tidier this way. In place of the old headers are compatibility stubs that just emit a warning and include the new version, which will be maintained for a while.
2019-11-20Mac: Move puglGetProcAddress() to mac_gl.mDavid Robillard1-17/+0
2019-11-20Mac: Fix unused parameter warningDavid Robillard1-1/+1
2019-11-03Remove redisplay flag and add puglPostRedisplayRect()David Robillard1-0/+9
2019-11-03Add puglGetNativeWorld()David Robillard1-0/+6
2019-11-03Expose functional stub backendDavid Robillard1-0/+15
2019-11-03Fix puglFreeView() crashes when window creation failedJordan Halase1-10/+17
2019-09-07Add clipboard supportDavid Robillard1-0/+40
2019-09-03Make almost everything return a statusDavid Robillard1-6/+12
Prepares the API for proper error handling, even though there isn't any for these functions yet.
2019-09-03Add puglSetWindowTitle()David Robillard1-0/+18
2019-09-03Replace size and aspect ratio init functions with dynamic onesDavid Robillard1-0/+34
2019-09-03Use consistent naming conventionsDavid Robillard1-9/+9
2019-09-03Add functions to get and set view size and positionDavid Robillard1-14/+84
2019-09-03Add puglDispatchEvents()David Robillard1-7/+13
2019-09-03Add puglPollEvents()David Robillard1-14/+20
This allows waiting for events for any view in the world. It also improves on puglWaitForEvent() by the addition of a time parameter that allows indefinite blocking, non-blocking polling, and blocking polling with a timeout.
2019-09-03Move puglGetTime() to PuglWorldDavid Robillard1-2/+2
2019-09-03Add PuglWorldDavid Robillard1-12/+26
The old API was broken for programs that manage multiple views, since it was impossible to wait for events on any view. There are also several functions in the API which are not actually associated with views at all, so those can now be moved to the more appropriate PuglWorld to make this more clear. The old puglInit() and puglDestroy() functions are preserved for compatibility, but marked as deprecated.
2019-09-03Add puglHasFocus()David Robillard1-0/+9
2019-09-03Fix puglGrabFocus() to work between parent and childrenDavid Robillard1-1/+4
2019-09-03Simplify hints implementationDavid Robillard1-2/+2
2019-09-03Mac: Dispatch expose events from drawing viewMichael Fisher1-2/+2
2019-09-02Cleanup: Fix whitespaceDavid Robillard1-8/+8
2019-08-02Mac: Disable annoying bell on tab or other special key pressesDavid Robillard1-0/+5
2019-08-02Replace puglIgnoreKeyRepeat() with a hintDavid Robillard1-1/+1
2019-07-29Mac: Separate backends from platform implementationDavid Robillard1-390/+36
2019-07-29Mac: Add Cairo on Quartz supportDavid Robillard1-29/+113
This avoids the general hassles of OpenGL, which is deprecated on MacOS, and Cairo apps look much nicer and more integrated this way. As far as I can tell, Cairo actually works best here out of all the platforms, the Windows and X11 backends aren't quite as smooth.
2019-07-29Mac: Make drawView a generic NSViewDavid Robillard1-20/+46