aboutsummaryrefslogtreecommitdiffstats
path: root/src/internal.c
AgeCommit message (Collapse)AuthorFilesLines
2025-02-08Fix puglIsvalidPosition()David Robillard1-1/+2
Most obivously, this made top-level views initially invisible on Windows because they were placed at (-32768, -32768).
2025-02-08Replace frame with size and position hintsDavid Robillard1-3/+4
2025-02-07Use angle brackets for library includes and clean up include pathsDavid Robillard1-1/+1
2025-02-01Consistently use unsigned literals for event flagsDavid Robillard1-1/+1
2025-01-22Simplify initial position code and place children at the originDavid Robillard1-0/+47
The code to find the initial size and position for a view had a lot of duplication, and was inconsistent between platforms. Flaky positioning and attempting to center embedded children has historically caused a bunch of problems in general, particularly since windows can be resized. So, factor out all the initial size and position code so that the logic is in one centralized place used by all platforms, and always position embedded children within their parent at the top/left origin. For top-level windows, the view is centered on its transient parent or the screen (as before). A new platform function puglGetAncestorCenter() is used to do this in general code. Also towards a total separation of position and size, towards support for Wayland, where applications don't dictate their own positions.
2025-01-22Factor out puglIsValidSize()David Robillard1-2/+7
2025-01-22Factor out puglIsValidPosition()David Robillard1-0/+6
2025-01-22Rename PuglViewSize to PuglAreaDavid Robillard1-2/+2
2025-01-22Make puglSetSizeHint() consistent with puglSetSize()David Robillard1-0/+16
In general, it's more convenient to have full-width integers as parameters, since C will promote any arithmetic on smaller types to them anyway. Using narrow types here, then, doesn't really make anything stricter, just forces an annoying cast when lots of warnings are enabled, which is likely unchecked. Better to handle it here, since it's more convenient, and the integer range checks the compiler can do aren't correct anyway (the max width/height is intentionally smaller than the max PuglSpan, so it can fit in a signed 16-bit integer).
2023-11-11Add support for Num, Scroll, and Caps LockDavid Robillard1-0/+6
2023-10-21Remove spurious semicolonDavid Robillard1-1/+1
2023-10-21Filter out corresponding modifiers from key eventsDavid Robillard1-0/+23
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-05-12Factor out puglIsValidSize() and use consistent rules everywhereDavid Robillard1-8/+7
2023-05-12X11: Avoid deferring empty exposuresDavid Robillard1-10/+2
2023-05-03Remove dead codeDavid Robillard1-13/+0
2023-01-14Add general string hint interfaceDavid Robillard1-0/+17
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-11Clean up puglRealize() implementationsDavid Robillard1-4/+7
2023-01-11Remove cached frame from viewDavid Robillard1-15/+4
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-08Use ensureHint pattern everywhereDavid Robillard1-0/+8
2023-01-07Replace map/unmap events with more expressive configure eventsDavid Robillard1-18/+4
2023-01-07Rename create/destroy events to realize/unrealizeDavid Robillard1-7/+6
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-7/+28
2023-01-02Ensure that views have an event handler setDavid Robillard1-0/+5
Otherwise, there will be crashes in the implementation.
2023-01-02Factor out common realize checks and initializationDavid Robillard1-0/+28
2022-10-07Use uppercase integer literal suffixesDavid Robillard1-14/+14
2022-06-08Separate platform.h from internal.hDavid Robillard1-18/+17
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-0/+191