Commit Graph

8 Commits

Author SHA1 Message Date
Emmanuele Bassi
405e611279 device/xi2: Translate the axis data after setting devices
We need the devices (source and virtual) to be set before translating
the axis data from XI2 to the Clutter event.
2011-01-21 10:25:45 +00:00
Emmanuele Bassi
431200f40d device: Add keys and axes accessors
Allow retrieving the number of keys and axes, since we provide the API
to iterate over them both.
2011-01-21 10:25:44 +00:00
Emmanuele Bassi
a3102a777e docs: Fill out documentation for new symbols 2011-01-21 10:25:44 +00:00
Emmanuele Bassi
2cb0077f7d device/xi2: Implement get_core_device()
We ask XI2 to get the client pointer for CLUTTER_POINTER_DEVICE, and
we use the attached keyboard device for CLUTTER_KEYBOARD_DEVICE. For
everything else, we return NULL.
2011-01-21 10:25:44 +00:00
Emmanuele Bassi
9c48486d7a device/xi2: Remove the ::remove implementation
Removing a device is only internal API, and we already have a function
for that: we don't need to implement the DeviceManager virtual as well.
2011-01-21 10:25:44 +00:00
Emmanuele Bassi
0075c45ca4 device/xi2: Blow the cached devices list
Every time we add or remove a device we should clear the cached list
that we return in get_devices(), so that it gets repopulated.
2011-01-21 10:25:44 +00:00
Emmanuele Bassi
de93f721c1 Clean up the copyright and licensing blurbs 2011-01-21 10:25:43 +00:00
Emmanuele Bassi
1b1e77b469 event/x11: Rework the way we translate X11 events
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.
2011-01-21 10:25:43 +00:00