event/x11: Rework the way we translate X11 events
authorEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 4 Jan 2011 12:32:04 +0000 (12:32 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 21 Jan 2011 10:25:43 +0000 (10:25 +0000)
commit1b1e77b46989ba97bfff8abdfa61df0f514a7eae
tree7861f08ff04777c7408138045a7b6b474b5d0200
parentca092477c2d3fcc74384c3f46216802db32ba0d9
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.
37 files changed:
clutter/Makefile.am
clutter/clutter-backend-private.h
clutter/clutter-backend.c
clutter/clutter-device-manager-private.h
clutter/clutter-device-manager.c
clutter/clutter-device-manager.h
clutter/clutter-event-translator.c [new file with mode: 0644]
clutter/clutter-event-translator.h [new file with mode: 0644]
clutter/clutter-event.c
clutter/clutter-event.h
clutter/clutter-input-device.c
clutter/clutter-input-device.h
clutter/clutter-marshal.list
clutter/clutter-private.h
clutter/clutter-types.h
clutter/glx/clutter-backend-glx.c
clutter/glx/clutter-event-glx.c [deleted file]
clutter/glx/clutter-event-glx.h [deleted file]
clutter/glx/clutter-stage-glx.c
clutter/x11/clutter-backend-x11.c
clutter/x11/clutter-backend-x11.h
clutter/x11/clutter-device-manager-core-x11.c [new file with mode: 0644]
clutter/x11/clutter-device-manager-core-x11.h [moved from clutter/x11/clutter-device-manager-x11.h with 97% similarity]
clutter/x11/clutter-device-manager-x11.c [deleted file]
clutter/x11/clutter-device-manager-xi2.c [new file with mode: 0644]
clutter/x11/clutter-device-manager-xi2.h [new file with mode: 0644]
clutter/x11/clutter-event-x11.c
clutter/x11/clutter-input-device-core-x11.c [new file with mode: 0644]
clutter/x11/clutter-input-device-core-x11.h [new file with mode: 0644]
clutter/x11/clutter-input-device-x11.c [deleted file]
clutter/x11/clutter-input-device-x11.h [deleted file]
clutter/x11/clutter-input-device-xi2.c [new file with mode: 0644]
clutter/x11/clutter-input-device-xi2.h [new file with mode: 0644]
clutter/x11/clutter-stage-x11.c
clutter/x11/clutter-stage-x11.h
configure.ac
tests/interactive/test-devices.c