Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
|
|
|
|
|
|
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).
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|