aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2022-06-28Simplify clang-tidy configurationDavid Robillard1-1/+0
2022-06-17Call XrmInitialize()David Robillard1-0/+1
This must be called before any other Xrm functions are used.
2022-06-08Use consistent terminology for native viewsDavid Robillard3-3/+3
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-08Consolidate common deprecated API implementationDavid Robillard1-28/+0
2022-06-08Separate platform.h from internal.hDavid Robillard7-34/+58
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 Robillard11-249/+261
2022-06-08Fix potential null pointer dereferenceDavid Robillard1-5/+5
According to clang-tidy anyway, I'm not seeing it.
2022-06-07Use a consistent scheme for enum sizesDavid Robillard3-4/+4
2022-06-07Remove unnecessary forward-compatibility codeDavid Robillard2-11/+3
2022-06-07Make puglRealize() always gracefully fail with a bad configurationDavid Robillard1-0/+5
2022-06-07X11: Simplify dispatchX11Events()David Robillard1-31/+44
2022-06-07X11: Flush before returning from puglRealize()David Robillard1-0/+8
This avoids bugs in plugins, because otherwise it's possible that size hints are not available when the host embeds the UI.
2022-06-03X11: Fix crash when input context is unavailable due to localesPace Willisson1-11/+17
Calling X*ICFocus on NULL segfaults. This can happen if XCreateIC failed, for example due to missing locales on minimal Docker images.
2022-05-28Omit cursor_names if XCursor is not availableDavid Robillard1-0/+2
This avoids a Wunused-const-variable warning with GCC.
2022-05-23Add rich clipboard supportDavid Robillard8-178/+570
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-22Fix whitespaceDavid Robillard1-1/+1
2022-05-21Add puglGetScaleFactor()David Robillard5-4/+90
2022-05-21Windows: Send configure events when frame moves or resizesDavid Robillard1-0/+3
2022-05-21Add puglSetPosition() and puglSetSize()David Robillard3-24/+193
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 Robillard4-48/+55
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 Robillard5-181/+145
This collapses many functions into one, which makes the API more easily extensible and reduces code size.
2022-05-21X11: Remove redundant display memberDavid Robillard4-47/+52
2022-05-21Rename PUGL_UNSUPPORTED_TYPE to be more genericDavid Robillard4-5/+5
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.
2022-05-21X11: Use cursor themesDavid Robillard2-29/+42
This changes to getting cursors by name from the cursor theme, which makes the cursor match the ones used in modern desktop environments. As far as I can tell, there is no real standard for names, these ones seem to work for me in GNOME, KDE, and Xfce. I am not sure about the compatibility concerns here, but X11 without Xcursor themes strikes me as either too esoteric or too ancient to worry about, especially since cursor switching isn't critical functionality anyway.
2022-05-21Avoid setting cursor on realizationDavid Robillard1-4/+0
This avoids issues when the default X11 cursor isn't the expected "default" of the environment, for example with Plasma. A real application that changes the cursor needs to do so consistently on mouse enter and leave events anyway.
2022-05-20Windows: Set window class on local moduleDavid Robillard1-2/+10
This avoids potential clashes between multiple copies of Pugl statically compiled into several modules.
2022-05-03Fix crash when destroying OpenGL views that haven't been realizedJean Pierre Cimalando3-0/+9
2022-04-23Fix IWYU warningsDavid Robillard1-1/+0
I suspect that using the same configuration across both C and C++ is starting to wear a bit thin, but this will do for now.
2022-04-23Move reserved platform defines from code to build systemDavid Robillard2-8/+0
Numerous things warn about this, and it's generally a bad idea to put these in the code since it can result in incompatibly compiled code being linked together. Unfortunately this makes building manually (without the build system) more fiddly, but such is life.
2022-04-23Suppress warnings when building with clang on WindowsDavid Robillard1-0/+1
2022-04-23Windows: Remove redundant view size assignmentDavid Robillard1-5/+0
2022-04-23Windows: Avoid initialization warningDavid Robillard1-1/+2
2022-04-23Windows: Remove pointless const qualifiersDavid Robillard1-4/+1
2022-04-23Windows: Avoid else after returnDavid Robillard2-5/+15
2022-04-23Strengthen MSVC warningsDavid Robillard2-3/+3
2022-04-21Improve error handlingDavid Robillard8-79/+139
2022-04-21Remove unused return type from backend destroy methodsDavid Robillard11-35/+24
Since this is essentially a destructor, I don't think there's anything really useful to do with errors here, and in practice no backends actually used it anyway.
2022-04-21Move attribute definitions to a separate headerDavid Robillard4-12/+21
2022-04-21Fix private include guardsDavid Robillard5-15/+15
2021-12-17Reduce variable scopeDavid Robillard1-2/+2
2021-12-17Adopt REUSE machine-readable licensing standardDavid Robillard22-334/+48
See https://reuse.software/ for details.
2021-12-17Suppress new warnings in clang-tidy 13David Robillard1-1/+2
2021-12-17Windows: Support extended mouse buttonsDavid Robillard1-0/+14
2021-12-17Make button numbers consistent across platformsDavid Robillard3-7/+14
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-17Call glXQueryDrawable() from within the GLX contextDavid Robillard1-5/+8
This fixes getting the PUGL_SWAP_INTERVAL hint on some NVidia drivers.
2021-12-17Explicitly check for supported GLX extensionsDavid Robillard1-11/+24
2021-12-16Add puglGetBackend()David Robillard1-0/+6
2021-12-16Add puglGetClassName()David Robillard1-0/+6
2021-12-16Add puglGetWindowTitle()David Robillard1-0/+6