summaryrefslogtreecommitdiff
path: root/clutter/clutter-event.c
Commit message (Collapse)AuthorAgeFilesLines
* clutter-event: Add scroll source enum and axis scroll flagsCarlos Garnacho2016-01-141-0/+42
| | | | | | | | | | Those can be used to implement different scrolling behaviors. The fields have been added to ClutterScrollEvent itself. According to pahole, this makes the struct as big as ClutterButtonEvent and ClutterTouchEvent, so already at the limit of the ClutterEvent union. https://bugzilla.gnome.org/show_bug.cgi?id=757026
* trivial: Fix return value error in clutter_event_get_gesture_motion_deltaTing-Wei Lan2015-07-111-3/+3
|
* clutter-event: Add API around touchpad gesture eventsCarlos Garnacho2015-07-101-0/+122
| | | | These are needed in order to make these events binding friendly
* event: Add pinch/swipe gesture event types and structsCarlos Garnacho2015-07-101-0/+34
| | | | | | | | | We now have ClutterTouchpadPinchEvent and ClutterTouchpadSwipeEvent, each bringing the necessary info for the specific gesture. Each of these events is defined by begin/update/end/cancel phases. These events have been also made to propagate down/up the pointer position, just like scroll and button events do.
* event: define a boxed type for ClutterEventSequenceCarlos Garnacho2014-07-231-0/+17
| | | | | | This allows for some minimal interaction from bindings. https://bugzilla.gnome.org/show_bug.cgi?id=733561
* Add API to install an event filterNeil Roberts2013-11-141-0/+106
| | | | | | | | | | | | This adds clutter_event_add/remove_filter which adds a callback function which will receive all Clutter events just before the event signal is emitted for them. The event filter will be invoked regardless of any grabs or captures. This will be used by Mutter which wants to access the events at a lower level then the event bubbling mechanism. It needs to see all mouse motion events even if there is a grab in place. https://bugzilla.gnome.org/show_bug.cgi?id=707560
* ClutterEvent: Mention _get_source_device() in docsBastien Nocera2013-10-081-0/+2
| | | | | | | It's too easy getting bitten by the ->device red herring, thinking that it's the original input device the event originated from. https://bugzilla.gnome.org/show_bug.cgi?id=709620
* ClutterEvent: preserve extended state across clutter_event_copy()Giovanni Campagna2013-09-191-0/+4
| | | | | | | We're going nowhere if we don't copy these, because the final delivered event is a copy of the event generated by the backend. https://bugzilla.gnome.org/show_bug.cgi?id=708383
* ClutterEvent: add API to query the full keyboard state when the event was ↵Giovanni Campagna2013-09-091-1/+65
| | | | | | | | | | | | | | | | | | | | | generated When talking to other applications or serializing the modifier state (and in particular when implementing a wayland compositor), the effective modifier state alone is not sufficient, one needs to know the base, latched and locked modifiers. Previously one could do with backend specific functionality such as clutter_device_manager_evdev_get_xkb_state(), but the problem is that the internal data structures are updated as soon as the events are fetched from the upstream source, but the events are reported to the application some time later, and thus the two can get out of sync. This way, on the other hand, the information is cached in the event, and provided to the application with the value that was current when the event was generated. https://bugzilla.gnome.org/show_bug.cgi?id=706494
* event: Use gunichar when dealing with unicode charactersJasper St. Pierre2013-03-121-2/+2
| | | | | | | This makes introspection return the keycode as a string, rather than an integer. https://bugzilla.gnome.org/show_bug.cgi?id=695188
* events: Make _clutter_process_event() reentrantEmanuele Aina2012-12-181-5/+5
| | | | | | | | | | | | | | | | | | | The _clutter_process_event() function may get called while already servicing a _clutter_process_event() invocation (eg. when generating ENTER events before emitting TOUCH_BEGIN). In these cases clutter_get_current_event() would return NULL after the inner call to _clutter_process_event() has finished, thereafter making the current event inaccessible during the remaining portion of the outer event emission. By stacking the current events in ClutterMainContext instead of simply replacing them we do not lose track of the real current event. Also update clutter_get_current_event_time() to be consistent from a reentrancy perspective. https://bugzilla.gnome.org/show_bug.cgi?id=688457
* event: Expose is-pointer-emulated flagEmmanuele Bassi2012-07-181-0/+23
| | | | | | | Clutter on X11 already stores this flag to distinguish between events that have been synthesized by the X server and real events. https://bugzilla.gnome.org/show_bug.cgi?id=680174
* event: Copy the is-pointer-emulated flagEmanuele Aina2012-07-181-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=680174
* event: Add convenience functions for Shift and Ctrl modifiersEmmanuele Bassi2012-05-251-0/+32
| | | | | | Instead of going through clutter_event_get_state() and checking if the modifier mask is set, we can provide simple convenience functions to do it for us.
* event: Fix copying touch eventsBastien Nocera2012-05-031-1/+1
| | | | | | We were trying to copy motion axes instead of touch ones. https://bugzilla.gnome.org/show_bug.cgi?id=675371
* docs: Annotation fixesEmmanuele Bassi2012-04-301-1/+1
| | | | | | The introspection scanner has become slightly more annoying, in the hope that people start fixing their annotations. As it turns out, it was the right move.
* event: Add distance and angle accessorsEmmanuele Bassi2012-04-271-17/+98
| | | | Let's start using ClutterPoint in the API.
* x11: Add support for touch eventsEmmanuele Bassi2012-03-191-0/+12
| | | | | For the time being, we just relay everything we get from the X server to the Clutter application.
* event: Add ClutterTouchEventEmmanuele Bassi2012-03-191-0/+97
| | | | | The ClutterTouchEvent structure contains the data relative to a touch event.
* event: Expose precise scrolling informationEmmanuele Bassi2012-03-191-0/+71
| | | | | | Some events may contain precise scrolling information coming from devices like trackpads and touchscreens. ClutterEvent should allow setting and getting this information.
* Eliminate G_CONST_RETURNEmmanuele Bassi2011-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy. We always used it to conform to the platform, at least for public-facing API. At first I assumed it has something to do with brain-damaged compilers or with weird platforms where const was not really supported; sadly, it's something much, much worse: it's a define that can be toggled at compile-time to remove const from the signature of public API. This is a truly terrifying feature that I assume was added in the past century, and whose inception clearly had something to do with massive doses of absynthe and opium — because any other explanation would make the existence of such a feature even worse than assuming drugs had anything to do with it. Anyway, and pleasing the gods, this dubious feature is being removed/deprecated in GLib; see bug: https://bugzilla.gnome.org/show_bug.cgi?id=644611 Before deprecation, though, we should just remove its usage from the whole API. We should especially remove its usage from Cally's internals, since there it never made sense in the first place.
* event: Return the CrossingEvent.device fieldEmmanuele Bassi2011-03-081-0/+3
| | | | | | The CLUTTER_ENTER and CLUTTER_LEAVE event types were mistakenly ignored by clutter_event_get_device(), when returning the device from a non-allocated ClutterEvent.
* event: Set the CrossingEvent device fieldEmmanuele Bassi2011-03-081-0/+3
| | | | | The CLUTTER_ENTER and CLUTTER_LEAVE should also have their device field set when calling clutter_event_set_device().
* Move the keysym ↔ Unicode table to .rodataEmmanuele Bassi2011-02-281-48/+0
| | | | | | | | | | | The table we use for converting between keysyms and Unicode should be static and constified, so that it can live in the .rodata section of the ELF shared object, and be shared among processes. This change moves the table to a source file, instead of an header; the change also requires the clutter_keysym_to_unicode() function to be moved from clutter-event.c into this new source file. The declaration is still in clutter-event.h, so we don't need to do anything special.
* event: Add setters for ClutterEvent membersEmmanuele Bassi2011-02-281-46/+322
| | | | | | | | | | Creating a synthetic event requires direct access to the ClutterEvent union members; this access does not map in bindings to high-level languages, especially run-time bindings using GObject-Introspection. It's also midly annoying from C, as it unnecessarily exposes the guts of ClutterEvent - something we might want to fix in the future. http://bugzilla.clutter-project.org/show_bug.cgi?id=2575
* Add private header for event-related APIEmmanuele Bassi2011-02-181-1/+1
|
* Avoid direct access to the main context events queueEmmanuele Bassi2011-02-091-3/+5
| | | | | | | | | | | | | | | | | The GQueue that stores the global events queue is handled all over the place: • the structure is created in _clutter_backend_init_events(); • the queue is handled in clutter-event.c, clutter-stage.c and clutter-backend.c; • ClutterStage::dispose cleans up the events associated with the stage being destroyed; • the queue is destroyed in ClutterBackend::dispose. Since we need to have access to it in different places we cannot put it inside ClutterBackendPrivate, hence it should stay in ClutterMainContext; but we should still manage it from just one place - preferably by the ClutterEvent API only.
* event: The device setter work on sub-typesEmmanuele Bassi2011-02-011-2/+0
| | | | | | Instead of just setting the input device pointer in the private event data, it should also set the field in the event sub-types, so that direct access to the structures still works.
* Clean up crossing event synthesis codeEmmanuele Bassi2011-01-281-0/+1
| | | | | | | | | | | | | | | Clutter should just require that the windowing system used by a backend adds a device to the stage when the device enters, and removes it from the stage when the device leaves; with this information, we can synthesize every crossing event and update the device state without other intervention from the backend-specific code. The generation of additional crossing events for actors that are covering the stage at the coordinates of the crossing event should be delegated to the event processing code. The x11 and win32 backends need to be modified to relay the enter and leave events from the windowing system.
* event: Add a setter for the device fieldEmmanuele Bassi2011-01-281-38/+60
| | | | | | | | | | | | | When synthesizing events coming from input devices it should be possible to just call a setter function, to avoid a huge switch on the type of the event. Clutter should also store the device pointer inside the private data, for faster access of the pointer in allocated events. Finally, the get_device_id() and get_device_type() accessors should just be wrappers around clutter_event_get_device(), to reduce the amount of code duplication.
* event: Clean up clutter_event_copy()Emmanuele Bassi2011-01-211-25/+21
| | | | Try to avoid duplication of variables and blocks.
* device: Allow enabling/disabling non-master devicesEmmanuele Bassi2011-01-211-0/+9
| | | | | | | | | | | | | Slave and floating devices should always be disabled, and not deliver events to the scene. It is up to the user to enable non-master devices and handle events coming from them. ClutterInputDevice gets a new :enabled property, defaulting to FALSE; when a device manager creates a new device it has to set it to TRUE if the :device-mode property is set to CLUTTER_INPUT_MODE_MASTER. The main event queue entry point, _clutter_event_push(), will automatically discard events coming from disabled devices.
* event: Fix up clutter_event_copy()Emmanuele Bassi2011-01-211-0/+25
| | | | | We need to copy the scroll axis data, and we need to copy the private Event data from the source event to the target event structure.
* event: Add accessor for the axes fieldEmmanuele Bassi2011-01-211-0/+57
| | | | | | CLUTTER_BUTTON_* and CLUTTER_MOTION event types have axes data attached to them, so we want to expose a common ClutterEvent method for extracting that data.
* docs: Fill out documentation for new symbolsEmmanuele Bassi2011-01-211-0/+82
|
* event/x11: Rework the way we translate X11 eventsEmmanuele Bassi2011-01-211-10/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a lump commit that is fairly difficult to break down without either breaking bisecting or breaking the test cases. The new design for handling X11 event translation works this way: - ClutterBackend::translate_event() has been added as the central point used by a ClutterBackend implementation to translate a native event into a ClutterEvent; - ClutterEventTranslator is a private interface that should be implemented by backend-specific objects, like stage implementations and ClutterDeviceManager sub-classes, and allows dealing with class-specific event translation; - ClutterStageX11 implements EventTranslator, and deals with the stage-relative X11 events coming from the X11 event source; - ClutterStageGLX overrides EventTranslator, in order to deal with the INTEL_GLX_swap_event extension, and it chains up to the X11 default implementation; - ClutterDeviceManagerX11 has been split into two separate classes, one that deals with core and (optionally) XI1 events, and the other that deals with XI2 events; the selection is done at run-time, since the core+XI1 and XI2 mechanisms are mutually exclusive. All the other backends we officially support still use their own custom event source and translation function, but the end goal is to migrate them to the translate_event() virtual function, and have the event source be a shared part of Clutter core.
* Clean up clutter-private.h/4Emmanuele Bassi2010-10-211-2/+3
| | | | | | | | Move the private Backend API to a separate header. This also allows us to finally move the class vtable and instance structure to a separate file and plug the visibility hole that left the Backend class bare for everyone to poke into.
* Clean up clutter-private.h/1Emmanuele Bassi2010-10-211-2/+2
| | | | Move DeviceManager/InputDevice private API to a different header.
* Use G_DEFINE_BOXED_TYPE for all boxed typesEmmanuele Bassi2010-10-181-12/+4
| | | | | | We actually need a couple more macros for registering GValue transformation functions. Those should be added to upstream GLib.
* Constify Event accessors and copy methodEmmanuele Bassi2010-09-081-24/+24
| | | | | This is still C, but at least we can get some sort of safety net when using the API correctly.
* introspection: Add annotationsEmmanuele Bassi2010-09-031-1/+3
| | | | Reduce the amount of warnings coming from g-ir-scanner.
* events: Add platform-data to allocated EventsEmmanuele Bassi2010-07-131-2/+66
| | | | | | | | | | | Events allocated by Clutter should have a pointer to platform-specific data; this would allow backends to add separate structures for holding ancillary data, whilst retaining the ClutterEvent structure for use on the stack. In theory, for Clutter 2.x we might just want to drop Event and use an opaque structure, or a typed data structure inheriting from GTypeInstance instead.
* event: Typos in event code could cause crashesChris Lord2010-06-291-1/+1
| | | | | | | A typo in clutter-event.c meant that the wrong struct location could be used for the input device of key events. Also, a typo in the X11 event code meant that key-presses would come from the pointer device (releases would still come from the keyboard device).
* Fix clutter_event_get_coords() for crossing eventsEmmanuele Bassi2010-04-281-0/+4
| | | | | | | | The ClutterCrossingEvent data structure contains the coordinates of the crossing; they are regularly filed out by Clutter and by the backend event processing code. And yet clutter_event_get_coords() returns (0, 0) because it thinks that CLUTTER_ENTER and CLUTTER_LEAVE events do not have coordinates.
* Remove mentions of the FSF addressEmmanuele Bassi2010-03-011-3/+3
| | | | | | | | | | | | | | | Since using addresses that might change is something that finally the FSF acknowledge as a plausible scenario (after changing address twice), the license blurb in the source files should use the URI for getting the license in case the library did not come with it. Not that URIs cannot possibly change, but at least it's easier to set up a redirection at the same place. As a side note: this commit closes the oldes bug in Clutter's bug report tool. http://bugzilla.openedhand.com/show_bug.cgi?id=521
* Move all picking-related operations inside InputDeviceEmmanuele Bassi2010-01-201-36/+0
| | | | | | | | The InputDevice objects stores pointer coordinates, state, stage and the actor under the cursor, so if the current backend provides us with one attached to the Event structure then we want the InputDevice itself to update its state and give us the ClutterActor underneath the pointer's cursor.
* Add clutter_get_current_eventColin Walters2009-12-101-0/+23
| | | | | | | | | | | | | | When getting signals from higher level toolkits, occasionally one wants access to the underlying event; say for a Button widget's "clicked" signal, to get the keyboard state. Rather than having all of the highlevel widgets emit ClutterEvent just for the more unusual use cases, add a global function to access the event state. http://bugzilla.openedhand.com/show_bug.cgi?id=1888 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* [input] Rework input device APIEmmanuele Bassi2009-06-191-2/+145
| | | | | | | | | | | | | | | | | | | The input device API is split halfway thorugh the backends in a very weird way. The data structures are private, as they should, but most of the information should be available in the main API since it's generic enough. The device type enumeration, for instance, should be common across every backend; the accessors for device type and id should live in the core API. The internal API should always use ClutterInputDevice and not the private X11 implementation when dealing with public structures like ClutterEvent. By adding accessors for the device type and id, and by moving the device type enumeration into the core API we can cut down the amount of symbols private and/or visible only to the X11 backends; this way when other backends start implementing multi-pointer support we can share the same API across the code.
* Hide clutter_context_get_default()Emmanuele Bassi2009-06-181-5/+5
| | | | | | The clutter_context_get_default() function is private, but shared across Clutter. For this reason, it should be prefixed by '_' so that the symbol is hidden from the shared object.
* [docs] Various gtk-docs fixesEmmanuele Bassi2009-06-091-1/+1
|