diff options
Diffstat (limited to 'src/compositor/wayland_wrapper/qwlinputdevice_p.h')
-rw-r--r-- | src/compositor/wayland_wrapper/qwlinputdevice_p.h | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index 9365fa9de..fd1b0fb4e 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -41,8 +41,6 @@ #ifndef WLINPUTDEVICE_H #define WLINPUTDEVICE_H -#include <QtCompositor/qwaylandobject.h> - #include <stdint.h> #include <QtCore/QList> @@ -52,6 +50,8 @@ #include <xkbcommon/xkbcommon.h> #endif +#include <qwayland-server-wayland.h> + QT_BEGIN_NAMESPACE class QKeyEvent; @@ -65,7 +65,7 @@ class DataDevice; class Surface; class DataDeviceManager; -class InputDevice : public Object<struct wl_seat> +class InputDevice : public QtWaylandServer::wl_seat, public QtWaylandServer::wl_pointer, public QtWaylandServer::wl_keyboard, public QtWaylandServer::wl_touch { public: InputDevice(QWaylandInputDevice *handle, Compositor *compositor); @@ -100,12 +100,18 @@ public: Compositor *compositor() const; QWaylandInputDevice *handle() const; - wl_pointer *pointerDevice(); - wl_keyboard *keyboardDevice(); - wl_touch *touchDevice(); - const wl_pointer *pointerDevice() const; - const wl_keyboard *keyboardDevice() const; - const wl_touch *touchDevice() const; + ::wl_pointer *pointerDevice(); + ::wl_keyboard *keyboardDevice(); + ::wl_touch *touchDevice(); + + const ::wl_pointer *pointerDevice() const; + const ::wl_keyboard *keyboardDevice() const; + const ::wl_touch *touchDevice() const; + + static InputDevice *fromSeatResource(struct ::wl_resource *resource) + { + return static_cast<InputDevice *>(wl_seat::Resource::fromResource(resource)->seat); + } private: void initDevices(); @@ -117,12 +123,15 @@ private: QWaylandInputDevice *m_handle; Compositor *m_compositor; QList<DataDevice *> m_data_devices; + struct { - wl_pointer pointer; - wl_keyboard keyboard; - wl_touch touch; + ::wl_pointer pointer; + ::wl_keyboard keyboard; + ::wl_touch touch; } m_device_interfaces; + ::wl_seat m_seat; + #ifndef QT_NO_WAYLAND_XKB struct xkb_keymap *m_keymap; struct xkb_state *m_state; @@ -133,30 +142,24 @@ private: uint32_t toWaylandButton(Qt::MouseButton button); - static void bind_func(struct wl_client *client, void *data, - uint32_t version, uint32_t id); - - static void set_cursor(struct wl_client *client, - struct wl_resource *device_base, - uint32_t serial, - struct wl_resource *surface, - int32_t hotspot_x, - int32_t hotspot_y); - const static struct wl_pointer_interface pointer_interface; - - static void get_pointer(struct wl_client *client, - struct wl_resource *resource, - uint32_t id); - static void get_keyboard(struct wl_client *client, - struct wl_resource *resource, - uint32_t id); - static void get_touch(struct wl_client *client, - struct wl_resource *resource, - uint32_t id); - const static struct wl_seat_interface seat_interface; - - static void destroy_resource(wl_resource *resource); - static void destroy_device_resource(wl_resource *resource); + void seat_bind_resource(wl_seat::Resource *resource) Q_DECL_OVERRIDE; + + void pointer_set_cursor(wl_pointer::Resource *resource, + uint32_t serial, + struct wl_resource *surface, + int32_t hotspot_x, + int32_t hotspot_y) Q_DECL_OVERRIDE; + + void keyboard_bind_resource(wl_keyboard::Resource *resource) Q_DECL_OVERRIDE; + + void seat_get_pointer(wl_seat::Resource *resource, + uint32_t id) Q_DECL_OVERRIDE; + void seat_get_keyboard(wl_seat::Resource *resource, + uint32_t id) Q_DECL_OVERRIDE; + void seat_get_touch(wl_seat::Resource *resource, + uint32_t id) Q_DECL_OVERRIDE; + + void seat_destroy_resource(wl_seat::Resource *resource) Q_DECL_OVERRIDE; }; } |