aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_x11.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-29Clean up file documentationDavid Robillard1-1/+1
2019-07-29Completely separate backends from platform implementationDavid Robillard1-18/+0
This removes PuglContextType and allows the user to pass a backend directly. Normally this would come from one of the two accessors declared in the headers, but it would be possible to add backends without changing any of the existing code at all. Unfortunately, it is not possible to preserve backwards compatibility and achieve the ultimate goal of linking only to the required dependencies, so puglInitContextType() has just been removed.
2019-07-29Move trivial backend dispatch functions to common codeDavid Robillard1-18/+0
2019-07-29Move backend to PuglViewDavid Robillard1-11/+11
2019-07-28Make enterContext take a drawing parameter like leaveContextDavid Robillard1-9/+10
These need to be symmetric because sometimes different things need to happen in either situation when entering the context as well.
2019-07-28Give backends general namesDavid Robillard1-13/+13
Towards making them opaque and exposing them to the user to decouple the core library from backends. The general names mean that it won't be possible to build multiple backends for one platform into the same binary, but that seems reasonable for now, and it will make things simpler without needing to add a bunch of dispatch code. That will still be possible if it's ever needed, though.
2019-07-28Rename getHandle to getContext for consistent terminologyDavid Robillard1-1/+1
2019-07-28Rename PuglDrawContext to PuglBackendDavid Robillard1-11/+11
This name was pretty confusing since there is already the concept of a "context".
2019-07-25X11: Close input context on destructionDavid Robillard1-0/+6
2019-07-24Support additional special keysDavid Robillard1-29/+36
2019-07-24Unify key and character fields and separate text eventsDavid Robillard1-23/+44
Only one field is necessary to store any kind of key, including special keys, since PuglKey occupies a reserved Unicode region. This is generally much simpler to deal with since there is only one value to dispatch on. Text events are separated from key events (like Windows but unlike MacOS or X11) because it is not possible to derive text events from key press events when they occur on Windows. Since merging the two has been the source of some confusion, this approach has some advantages anyway, even though it introduces the need to handle another event type. In the process, text input has been almost completely rewritten. I have tested this with a compose key on X11 and dead keys on Windows and MacOS and everything seems to work correctly, though there may (as always) still be issues with more exotic input methods.
2019-07-24Rename PuglEventKey::utf8 to "string" with char typeDavid Robillard1-7/+6
This matches Gtk and is generally less annoying to work with.
2019-07-24Remove view pointer from eventsDavid Robillard1-3/+2
This makes events POD, which is generally nice. The view was originally added to reflect the display and window references in XEvent, but doesn't seem very useful in Pugl applications.
2019-07-24Represent event time as double in seconds on all platformsStefan Westerfeld1-5/+5
2019-07-24Simplify modifier translation codeDavid Robillard1-7/+5
2019-07-23X11: Factor out impl variable for brevityDavid Robillard1-11/+12
2019-07-23X11: Improve live resize smoothnessDavid Robillard1-9/+15
This avoids a double context swap when both a configure and expose event arrive in the same loop iteration, which happens often during resize.
2019-07-23X11: Factor out window event maskDavid Robillard1-5/+6
2019-07-21Fix some warningsDavid Robillard1-8/+8
2019-07-21Tidy up X11 codeDavid Robillard1-30/+16
2019-07-21Add puglRequestAttention()David Robillard1-0/+33
2019-07-21Fix handling of WM_DELETE_WINDOWDavid Robillard1-8/+11
2019-07-21Use local display and window variables for brevityDavid Robillard1-18/+18
2019-07-21Make time start from approximately zeroDavid Robillard1-1/+1
2019-07-20Remove redisplay flag and use system events insteadDavid Robillard1-11/+7
2019-06-30Make translateKey take a PuglEventKeyDavid Robillard1-9/+9
2019-06-30Send a configure event on initial window mappingDavid Robillard1-0/+10
2019-06-30Tidy up whitespaceDavid Robillard1-0/+1
2019-06-27Add puglGetTime()David Robillard1-0/+10
2019-06-27Consistently use uint32_t everywhereDavid Robillard1-2/+2
2019-02-17Add configuration APIDavid Robillard1-3/+3
2019-02-16Add missing default caseDavid Robillard1-0/+1
2019-02-16Fix implicit double to int castsDavid Robillard1-2/+2
2019-02-16Clean up includesDavid Robillard1-10/+9
2019-02-16Factor out drawing context from platform window implementationDavid Robillard1-188/+37
2019-02-15Remove PUGL_CAIRO_GLDavid Robillard1-36/+0
The old cairo_gl.h header or something similar is easy enough to use in application code if someone wants to do this, and maintaining a separate context type for it is a hassle and arguably out of scope.
2018-09-15Fix minor clang-tidy warningsDavid Robillard1-1/+1
2018-09-11Fix GCC8 fall-through warningsDavid Robillard1-1/+2
2017-10-03Don't clear entire cairo surface on each exposeDavid Robillard1-6/+0
2017-07-23Fix merging of expose eventsDavid Robillard1-7/+13
Thanks JP Cimalando
2016-09-20Move entire API to pugl.hDavid Robillard1-1/+0
2016-09-18Remove GLUT-like event callbacksDavid Robillard1-0/+5
2016-09-14Fix compose keyDavid Robillard1-3/+5
Turns out the app needs to call setlocale(LC_ALL, "") for this to work. I am not sure if it is possible to make things work correctly purely in Pugl (since plugin UIs can't call setlocale).
2016-09-14Fix focus eventsDavid Robillard1-1/+1
2016-09-14Fix puglInitInternals prototypeDavid Robillard1-1/+1
2016-09-01Add PUGL_CLOSE eventDavid Robillard1-11/+9
This allows purely event-driven applications to handle window close. Something more extensible for WM message seems like it might be a good idea here, but I can't think of specific uses, so this will do.
2016-09-01Add puglGetVisible()David Robillard1-0/+2
2016-08-31Replace send_event with extensible flagsDavid Robillard1-3/+4
This is currently functionally equivalent, but taking up space in the event struct for a single bool which could be used for 32 flags for any number of things that might show up in the future seems like a very bad idea.
2016-07-28Add support for Cairo on GLDavid Robillard1-24/+90
2016-07-28Clean up GL attributes and simplify configurationDavid Robillard1-21/+32