aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
AgeCommit message (Collapse)AuthorFilesLines
2023-11-11Add action parameter to puglAcceptOffer()David Robillard1-1/+19
2023-11-11Add API support for multiple clipboardsDavid Robillard1-21/+40
Adds a PuglClipboard enum, and uses it everywhere necessary to "structurally" support multiple clipboards. Towards re-using this API to support DnD.
2023-11-11Add region parameter to puglAcceptOffer()David Robillard1-4/+9
2023-10-21MacOS: Fix horizontal scroll directionDavid Robillard1-1/+1
2023-10-21Filter out corresponding modifiers from key eventsDavid Robillard1-3/+3
Platforms differ here, but it's meaningless to ask about the state of a modifier that's currently being pressed or released, so simply mask this out in general so it's easy for platform implementations to clean events up before dispatching them.
2023-10-07Fix puglGetTime() on Apple SiliconDavid Robillard1-3/+5
The floating point precision of these chips is... strange.
2023-05-29Add support for numeric keypad and simplify keyboard handlingDavid Robillard1-25/+44
2023-05-29Deprecate redundant key symbolsDavid Robillard1-4/+4
2023-05-12Factor out puglIsValidSize() and use consistent rules everywhereDavid Robillard1-4/+3
2023-05-12MacOS: Fix inverted puglPostRedisplay() coordinatesDavid Robillard1-1/+5
2023-05-03Fix internal function linkageDavid Robillard1-1/+1
2023-01-14Add general string hint interfaceDavid Robillard1-11/+23
This replaces the window title and class name APIs with a more general one that can be easily extended to other things, like icon names, more detailed application hints, and so on.
2023-01-11MacOS: Avoid calling sendEvent in modulesreuk1-56/+31
2023-01-11Clean up puglRealize() implementationsDavid Robillard1-6/+4
2023-01-11Remove cached frame from viewDavid Robillard1-88/+141
This was just a source of ambiguity and bugs, since it represented different things at different times and could become stale. Redundant data is always trouble, so eliminate it, leaving just two positions/sizes: the defaults (used when the view is not yet realized), and the last configuration.
2023-01-11Fix checks for invalid view positionsDavid Robillard1-1/+1
2023-01-11Center windows on their transient parent where possibleDavid Robillard1-6/+32
This is only really relevant in practice on MacOS and Windows. On X11, the window manager places new windows where it pleases.
2023-01-10Add PUGL_CURSOR_ALL_SCROLLDavid Robillard1-0/+2
2023-01-08Use ensureHint pattern everywhereDavid Robillard1-12/+4
2023-01-08Add support for raising windowsDavid Robillard1-3/+15
2023-01-07Replace map/unmap events with more expressive configure eventsDavid Robillard1-5/+4
2023-01-07Add support for special view types and stylesDavid Robillard1-20/+187
2023-01-07Support closing views by sending a close eventDavid Robillard1-0/+5
2023-01-07Rename create/destroy events to realize/unrealizeDavid Robillard1-4/+2
As evidence that this was confusing, the documentation for these was an outright lie, and I've burned quite a bit of time in the past few days trying to rework things based around that flawed understanding. These names make it clear what these events actually are. If we need actual create/destroy events with a broader scope, they'll have to be added, but I suspect those aren't actually useful anyway.
2023-01-07Replace visible flag with a more descriptive view "stage"David Robillard1-6/+4
2023-01-06MacOS: Fix repeated realize/unrealizeDavid Robillard1-1/+0
2023-01-04Add puglUnrealize()David Robillard1-1/+38
2023-01-02Factor out common realize checks and initializationDavid Robillard1-14/+5
2023-01-02Remove dead codeDavid Robillard1-5/+0
2022-12-27Fix inconsistent initial window positioning across platformsDavid Robillard1-4/+8
2022-12-27Set transient parent when views are realized if necessaryDavid Robillard1-0/+3
2022-12-27Fail to set transient parent of views with a parent windowDavid Robillard1-0/+4
2022-12-27MacOS: Fix timestamps on systems with different clock ratesDavid Robillard1-3/+9
This seems to be a thing at least on MacOS 12 on M1.
2022-12-24Add diagonal cursorsfalkTX1-0/+17
2022-10-07Use uppercase integer literal suffixesDavid Robillard1-2/+2
2022-06-08Use consistent terminology for native viewsDavid Robillard1-1/+1
On MacOS in particular, views and windows are entirely different concepts, so confusing them... confuses things. This was the last holdover in the API that used the old "native window".
2022-06-08Separate platform.h from internal.hDavid Robillard1-0/+1
This makes the internal header structure match the "kinds" of definition inside Pugl: common implementations of public API, things available internally to platform implementations, and things the platform must define.
2022-06-08Separate private and public function implementationsDavid Robillard1-1/+1
2022-06-07Use a consistent scheme for enum sizesDavid Robillard1-2/+2
2022-06-07Make puglRealize() always gracefully fail with a bad configurationDavid Robillard1-0/+5
2022-05-23Add rich clipboard supportDavid Robillard1-24/+172
This implements a more powerful protocol for working with clipboards, which supports datatype negotiation, and fixes various issues by mapping more directly to how things work on X11.
2022-05-21Add puglGetScaleFactor()David Robillard1-2/+10
2022-05-21Add puglSetPosition() and puglSetSize()David Robillard1-11/+71
These are redundant with puglSetFrame in a sense, but allow setting the size of a view without the position, or vice-versa. This API also maps more nicely to Wayland, where applications can not position themselves (but can resize).
2022-05-21Use consistent integer types for view positions and sizesDavid Robillard1-10/+13
Actual window sizes and positions fit easily in a 16-bit integer. So, we use that in "representation contexts" like events. This makes structures smaller, and allows the values to be converted to float, double, or integer without casting (since any int16_t or uint16_t value can fit in them without loss). Setter APIs use native integers for convenience, to avoid casting hassles when doing arithmetic. Ranges are checked at runtime.
2022-05-21Add a uniform API for setting size hintsDavid Robillard1-74/+66
This collapses many functions into one, which makes the API more easily extensible and reduces code size.
2022-05-21Rename PUGL_UNSUPPORTED_TYPE to be more genericDavid Robillard1-1/+1
2022-05-21MacOS: Specify maximum size constraint on draw viewDavid Robillard1-15/+37
I am not sure why the minimum was only specified before, but it seems like an oversight.
2021-12-17Adopt REUSE machine-readable licensing standardDavid Robillard1-16/+3
See https://reuse.software/ for details.
2021-12-17Make button numbers consistent across platformsDavid Robillard1-2/+2
There's no universal consensus on how buttons are numbered. Left, right, middle as 0, 1, 2 seems to be the most common convention on modern vaguely similar libraries, so I've gone with that. The switch to zero-based indices will obviously break all current client code. Particularly since now is the time to finish any breaking changes before a stable release, I think that is better than only changing the middle and right numbers, which would likely go unnoticed.
2021-12-16Rename puglSetTransientFor to puglSetTransientParentDavid Robillard1-1/+1