[mutter/wip/garnacho/virtual-input-device: 67/94] clutter: Add virtual input device API



commit 454fdc4b534604d2f5eb5e148965675725bb5054
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue May 3 11:27:57 2016 +0800

    clutter: Add virtual input device API
    
    Virtual input devices aim to enable injecting input events as if they
    came from hardware events. This is useful for things such as remote
    controlling, for example via a remote desktop session.
    
    The API so far only consists of stumps.

 clutter/clutter/Makefile.am                        |   12 +++
 clutter/clutter/clutter-device-manager.c           |   14 +++
 clutter/clutter/clutter-device-manager.h           |    7 ++
 clutter/clutter/clutter-virtual-input-device.c     |   92 +++++++++++++++++++
 clutter/clutter/clutter-virtual-input-device.h     |   93 ++++++++++++++++++++
 clutter/clutter/clutter.h                          |    1 +
 .../clutter/evdev/clutter-device-manager-evdev.c   |    9 ++
 .../evdev/clutter-virtual-input-device-evdev.c     |   89 +++++++++++++++++++
 .../evdev/clutter-virtual-input-device-evdev.h     |   35 ++++++++
 .../clutter/x11/clutter-device-manager-core-x11.c  |    9 ++
 .../clutter/x11/clutter-virtual-input-device-x11.c |   89 +++++++++++++++++++
 .../clutter/x11/clutter-virtual-input-device-x11.h |   35 ++++++++
 12 files changed, 485 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter/Makefile.am b/clutter/clutter/Makefile.am
index 31506f4..c588d68 100644
--- a/clutter/clutter/Makefile.am
+++ b/clutter/clutter/Makefile.am
@@ -168,6 +168,7 @@ source_c = \
        clutter-image.c         \
        clutter-input-device.c  \
        clutter-input-device-tool.c     \
+       clutter-virtual-input-device.c  \
        clutter-interval.c            \
        clutter-keyframe-transition.c   \
        clutter-keysyms-table.c \
@@ -239,6 +240,7 @@ source_h_priv = \
        clutter-stage-manager-private.h         \
        clutter-stage-private.h                 \
        clutter-stage-window.h                  \
+       clutter-virtual-input-device.h          \
        $(NULL)
 
 # private source code; these should not be introspected
@@ -418,6 +420,14 @@ x11_source_h_priv += \
        x11/clutter-input-device-xi2.h  \
        $(NULL)
 
+x11_source_c += \
+       x11/clutter-virtual-input-device-x11.c  \
+       $(NULL)
+
+x11_source_h_priv += \
+       x11/clutter-virtual-input-device-x11.h  \
+       $(NULL)
+
 backend_source_h += $(x11_source_h)
 backend_source_c += $(x11_source_c)
 backend_source_h_priv += $(x11_source_h_priv)
@@ -458,6 +468,7 @@ backend_source_c += $(glx_source_c)
 evdev_c_priv = \
        evdev/clutter-device-manager-evdev.c    \
        evdev/clutter-input-device-evdev.c      \
+       evdev/clutter-virtual-input-device-evdev.c      \
        evdev/clutter-event-evdev.c             \
        evdev/clutter-input-device-tool-evdev.c \
        $(NULL)
@@ -465,6 +476,7 @@ evdev_h_priv = \
        evdev/clutter-device-manager-evdev.h    \
        evdev/clutter-input-device-evdev.h      \
        evdev/clutter-input-device-tool-evdev.h \
+       evdev/clutter-virtual-input-device-evdev.h      \
        $(NULL)
 evdev_h = evdev/clutter-evdev.h
 
diff --git a/clutter/clutter/clutter-device-manager.c b/clutter/clutter/clutter-device-manager.c
index 885f973..e532bbe 100644
--- a/clutter/clutter/clutter-device-manager.c
+++ b/clutter/clutter/clutter-device-manager.c
@@ -47,6 +47,7 @@
 #include "clutter-marshal.h"
 #include "clutter-private.h"
 #include "clutter-stage-private.h"
+#include "clutter-virtual-input-device.h"
 
 struct _ClutterDeviceManagerPrivate
 {
@@ -435,3 +436,16 @@ _clutter_device_manager_get_backend (ClutterDeviceManager *manager)
 
   return manager->priv->backend;
 }
+
+ClutterVirtualInputDevice *
+clutter_device_manager_create_virtual_device (ClutterDeviceManager  *device_manager,
+                                              ClutterInputDeviceType device_type)
+{
+  ClutterDeviceManagerClass *manager_class;
+
+  g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
+
+  manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
+  return manager_class->create_virtual_device (device_manager,
+                                               device_type);
+}
diff --git a/clutter/clutter/clutter-device-manager.h b/clutter/clutter/clutter-device-manager.h
index 0bb9041..6ff52ea 100644
--- a/clutter/clutter/clutter-device-manager.h
+++ b/clutter/clutter/clutter-device-manager.h
@@ -30,6 +30,7 @@
 
 #include <clutter/clutter-input-device.h>
 #include <clutter/clutter-stage.h>
+#include <clutter/clutter-virtual-input-device.h>
 
 G_BEGIN_DECLS
 
@@ -83,6 +84,8 @@ struct _ClutterDeviceManagerClass
                                            ClutterInputDevice     *device);
   void                (* select_stage_events) (ClutterDeviceManager *manager,
                                                ClutterStage       *stage);
+  ClutterVirtualInputDevice *(* create_virtual_device) (ClutterDeviceManager  *manager,
+                                                        ClutterInputDeviceType device_type);
 
   /* padding */
   gpointer _padding[7];
@@ -105,6 +108,10 @@ CLUTTER_AVAILABLE_IN_1_2
 ClutterInputDevice *  clutter_device_manager_get_core_device (ClutterDeviceManager   *device_manager,
                                                               ClutterInputDeviceType  device_type);
 
+CLUTTER_AVAILABLE_IN_ALL
+ClutterVirtualInputDevice *clutter_device_manager_create_virtual_device (ClutterDeviceManager  
*device_manager,
+                                                                         ClutterInputDeviceType device_type);
+
 G_END_DECLS
 
 #endif /* __CLUTTER_DEVICE_MANAGER_H__ */
diff --git a/clutter/clutter/clutter-virtual-input-device.c b/clutter/clutter/clutter-virtual-input-device.c
new file mode 100644
index 0000000..878c1d5
--- /dev/null
+++ b/clutter/clutter/clutter-virtual-input-device.c
@@ -0,0 +1,92 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2016  Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Jonas Ådahl <jadahl gmail com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "clutter-build-config.h"
+#endif
+
+#include <glib-object.h>
+
+#include "clutter-virtual-input-device.h"
+
+G_DEFINE_TYPE (ClutterVirtualInputDevice,
+               clutter_virtual_input_device,
+               G_TYPE_OBJECT)
+
+static void
+clutter_virtual_input_device_init (ClutterVirtualInputDevice *virtual_device)
+{
+}
+
+static void
+clutter_virtual_input_device_class_init (ClutterVirtualInputDeviceClass *klass)
+{
+}
+
+void
+clutter_virtual_input_device_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
+                                                     uint64_t                   time_us,
+                                                     double                     dx,
+                                                     double                     dy)
+{
+  ClutterVirtualInputDeviceClass *klass =
+    CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
+
+  klass->notify_relative_motion (virtual_device, time_us, dx, dy);
+}
+
+void
+clutter_virtual_input_device_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
+                                                     uint64_t                   time_us,
+                                                     double                     x,
+                                                     double                     y)
+{
+  ClutterVirtualInputDeviceClass *klass =
+    CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
+
+  klass->notify_absolute_motion (virtual_device, time_us, x, y);
+}
+
+void
+clutter_virtual_input_device_notify_button (ClutterVirtualInputDevice *virtual_device,
+                                            uint64_t                   time_us,
+                                            uint32_t                   button,
+                                            ClutterButtonState         button_state)
+{
+  ClutterVirtualInputDeviceClass *klass =
+    CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
+
+  klass->notify_button (virtual_device, time_us, button, button_state);
+}
+
+void
+clutter_virtual_input_device_notify_key (ClutterVirtualInputDevice *virtual_device,
+                                         uint64_t                   time_us,
+                                         uint32_t                   key,
+                                         ClutterKeyState            key_state)
+{
+  ClutterVirtualInputDeviceClass *klass =
+    CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
+
+  klass->notify_relative_motion (virtual_device, time_us, key, key_state);
+}
diff --git a/clutter/clutter/clutter-virtual-input-device.h b/clutter/clutter/clutter-virtual-input-device.h
new file mode 100644
index 0000000..c511521
--- /dev/null
+++ b/clutter/clutter/clutter-virtual-input-device.h
@@ -0,0 +1,93 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2016  Red Hat inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Jonas Ådahl <jadahl gmail com>
+ */
+
+#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_H__
+#define __CLUTTER_VIRTUAL_INPUT_DEVICE_H__
+
+#include <glib-object.h>
+#include <stdint.h>
+
+#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE (clutter_virtual_input_device_get_type ())
+G_DECLARE_DERIVABLE_TYPE (ClutterVirtualInputDevice,
+                          clutter_virtual_input_device,
+                          CLUTTER, VIRTUAL_INPUT_DEVICE,
+                          GObject)
+
+typedef enum _ClutterButtonState
+{
+  CLUTTER_BUTTON_STATE_RELEASED,
+  CLUTTER_BUTTON_STATE_PRESSED
+} ClutterButtonState;
+
+typedef enum _ClutterKeyState
+{
+  CLUTTER_KEY_STATE_RELEASED,
+  CLUTTER_KEY_STATE_PRESSED
+} ClutterKeyState;
+
+struct _ClutterVirtualInputDeviceClass
+{
+  GObjectClass parent_class;
+
+  void (*notify_relative_motion) (ClutterVirtualInputDevice *virtual_device,
+                                  uint64_t                   time_us,
+                                  double                     dx,
+                                  double                     dy);
+
+  void (*notify_absolute_motion) (ClutterVirtualInputDevice *virtual_device,
+                                  uint64_t                   time_us,
+                                  double                     x,
+                                  double                     y);
+
+  void (*notify_button) (ClutterVirtualInputDevice *virtual_device,
+                         uint64_t                   time_us,
+                         uint32_t                   button,
+                         ClutterButtonState         button_state);
+
+  void (*notify_key) (ClutterVirtualInputDevice *virtual_device,
+                      uint64_t                   time_us,
+                      uint32_t                   key,
+                      ClutterKeyState            key_state);
+};
+
+void clutter_virtual_input_device_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
+                                                          uint64_t                   time_us,
+                                                          double                     dx,
+                                                          double                     dy);
+
+void clutter_virtual_input_device_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
+                                                          uint64_t                   time_us,
+                                                          double                     x,
+                                                          double                     y);
+
+void clutter_virtual_input_device_notify_button (ClutterVirtualInputDevice *virtual_device,
+                                                 uint64_t                   time_us,
+                                                 uint32_t                   button,
+                                                 ClutterButtonState         button_state);
+
+void clutter_virtual_input_device_notify_key (ClutterVirtualInputDevice *virtual_device,
+                                              uint64_t                   time_us,
+                                              uint32_t                   key,
+                                              ClutterKeyState            key_state);
+
+#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */
diff --git a/clutter/clutter/clutter.h b/clutter/clutter/clutter.h
index 6f6a37d..cdf54ac 100644
--- a/clutter/clutter/clutter.h
+++ b/clutter/clutter/clutter.h
@@ -107,6 +107,7 @@
 #include "clutter-transition.h"
 #include "clutter-units.h"
 #include "clutter-version.h"
+#include "clutter-virtual-input-device.h"
 #include "clutter-zoom-action.h"
 
 #include "clutter-deprecated.h"
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c 
b/clutter/clutter/evdev/clutter-device-manager-evdev.c
index 9877da2..4c78065 100644
--- a/clutter/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c
@@ -46,6 +46,7 @@
 #include "clutter-device-manager-private.h"
 #include "clutter-event-private.h"
 #include "clutter-input-device-evdev.h"
+#include "clutter-virtual-input-device-evdev.h"
 #include "clutter-main.h"
 #include "clutter-private.h"
 #include "clutter-stage-manager.h"
@@ -2190,6 +2191,13 @@ static const struct libinput_interface libinput_interface = {
   close_restricted
 };
 
+static ClutterVirtualInputDevice *
+clutter_device_manager_evdev_create_virtual_device (ClutterDeviceManager  *manager,
+                                                    ClutterInputDeviceType device_type)
+{
+  return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV, NULL);
+}
+
 /*
  * GObject implementation
  */
@@ -2316,6 +2324,7 @@ clutter_device_manager_evdev_class_init (ClutterDeviceManagerEvdevClass *klass)
   manager_class->get_devices = clutter_device_manager_evdev_get_devices;
   manager_class->get_core_device = clutter_device_manager_evdev_get_core_device;
   manager_class->get_device = clutter_device_manager_evdev_get_device;
+  manager_class->create_virtual_device = clutter_device_manager_evdev_create_virtual_device;
 }
 
 static void
diff --git a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c 
b/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
new file mode 100644
index 0000000..f8786bd
--- /dev/null
+++ b/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
@@ -0,0 +1,89 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2016  Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Jonas Ådahl <jadahl gmail com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "clutter-build-config.h"
+#endif
+
+#include <glib-object.h>
+
+#include "clutter-virtual-input-device.h"
+#include "evdev/clutter-virtual-input-device-evdev.h"
+
+struct _ClutterVirtualInputDeviceEvdev
+{
+  ClutterVirtualInputDevice parent;
+};
+
+G_DEFINE_TYPE (ClutterVirtualInputDeviceEvdev,
+               clutter_virtual_input_device_evdev,
+               CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE)
+
+static void
+clutter_virtual_input_device_evdev_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
+                                                           uint64_t                   time_us,
+                                                           double                     dx,
+                                                           double                     dy)
+{
+}
+
+static void
+clutter_virtual_input_device_evdev_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
+                                                           uint64_t                   time_us,
+                                                           double                     x,
+                                                           double                     y)
+{
+}
+
+static void
+clutter_virtual_input_device_evdev_notify_button (ClutterVirtualInputDevice *virtual_device,
+                                                  uint64_t                   time_us,
+                                                  uint32_t                   button,
+                                                  ClutterButtonState         button_state)
+{
+}
+
+static void
+clutter_virtual_input_device_evdev_notify_key (ClutterVirtualInputDevice *virtual_device,
+                                               uint64_t                   time_us,
+                                               uint32_t                   key,
+                                               ClutterKeyState            key_state)
+{
+}
+
+static void
+clutter_virtual_input_device_evdev_init (ClutterVirtualInputDeviceEvdev *virtual_device_evdev)
+{
+}
+
+static void
+clutter_virtual_input_device_evdev_class_init (ClutterVirtualInputDeviceEvdevClass *klass)
+{
+  ClutterVirtualInputDeviceClass *virtual_input_device_class =
+    CLUTTER_VIRTUAL_INPUT_DEVICE_CLASS (klass);
+
+  virtual_input_device_class->notify_relative_motion = 
clutter_virtual_input_device_evdev_notify_relative_motion;
+  virtual_input_device_class->notify_absolute_motion = 
clutter_virtual_input_device_evdev_notify_absolute_motion;
+  virtual_input_device_class->notify_button = clutter_virtual_input_device_evdev_notify_button;
+  virtual_input_device_class->notify_key = clutter_virtual_input_device_evdev_notify_key;
+}
diff --git a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.h 
b/clutter/clutter/evdev/clutter-virtual-input-device-evdev.h
new file mode 100644
index 0000000..9bb8db0
--- /dev/null
+++ b/clutter/clutter/evdev/clutter-virtual-input-device-evdev.h
@@ -0,0 +1,35 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2016  Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Jonas Ådahl <jadahl gmail com>
+ */
+
+#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__
+#define __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__
+
+#include "clutter-virtual-input-device.h"
+
+#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV (clutter_virtual_input_device_evdev_get_type ())
+G_DECLARE_FINAL_TYPE (ClutterVirtualInputDeviceEvdev,
+                      clutter_virtual_input_device_evdev,
+                      CLUTTER, VIRTUAL_INPUT_DEVICE_EVDEV,
+                      ClutterVirtualInputDevice)
+
+#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__ */
diff --git a/clutter/clutter/x11/clutter-device-manager-core-x11.c 
b/clutter/clutter/x11/clutter-device-manager-core-x11.c
index 497b40b..a410600 100644
--- a/clutter/clutter/x11/clutter-device-manager-core-x11.c
+++ b/clutter/clutter/x11/clutter-device-manager-core-x11.c
@@ -28,6 +28,7 @@
 #include "clutter-backend-x11.h"
 #include "clutter-input-device-core-x11.h"
 #include "clutter-stage-x11.h"
+#include "clutter-virtual-input-device-x11.h"
 
 #include "clutter-backend.h"
 #include "clutter-debug.h"
@@ -480,6 +481,13 @@ clutter_device_manager_x11_get_device (ClutterDeviceManager *manager,
                               GINT_TO_POINTER (id));
 }
 
+static ClutterVirtualInputDevice *
+clutter_device_manager_x11_create_virtual_device (ClutterDeviceManager  *device_manager,
+                                                  ClutterInputDeviceType device_type)
+{
+  return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_X11, NULL);
+}
+
 static void
 clutter_device_manager_x11_set_property (GObject      *gobject,
                                          guint         prop_id,
@@ -526,6 +534,7 @@ clutter_device_manager_x11_class_init (ClutterDeviceManagerX11Class *klass)
   manager_class->get_devices = clutter_device_manager_x11_get_devices;
   manager_class->get_core_device = clutter_device_manager_x11_get_core_device;
   manager_class->get_device = clutter_device_manager_x11_get_device;
+  manager_class->create_virtual_device = clutter_device_manager_x11_create_virtual_device;
 }
 
 static void
diff --git a/clutter/clutter/x11/clutter-virtual-input-device-x11.c 
b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
new file mode 100644
index 0000000..a13915b
--- /dev/null
+++ b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
@@ -0,0 +1,89 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2016  Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Jonas Ådahl <jadahl gmail com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "clutter-build-config.h"
+#endif
+
+#include <glib-object.h>
+
+#include "clutter-virtual-input-device.h"
+#include "x11/clutter-virtual-input-device-x11.h"
+
+struct _ClutterVirtualInputDeviceX11
+{
+  ClutterVirtualInputDevice parent;
+};
+
+G_DEFINE_TYPE (ClutterVirtualInputDeviceX11,
+               clutter_virtual_input_device_x11,
+               CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE)
+
+static void
+clutter_virtual_input_device_x11_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
+                                                         uint64_t                   time_us,
+                                                         double                     dx,
+                                                         double                     dy)
+{
+}
+
+static void
+clutter_virtual_input_device_x11_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
+                                                         uint64_t                   time_us,
+                                                         double                     x,
+                                                         double                     y)
+{
+}
+
+static void
+clutter_virtual_input_device_x11_notify_button (ClutterVirtualInputDevice *virtual_device,
+                                                uint64_t                   time_us,
+                                                uint32_t                   button,
+                                                ClutterButtonState         button_state)
+{
+}
+
+static void
+clutter_virtual_input_device_x11_notify_key (ClutterVirtualInputDevice *virtual_device,
+                                             uint64_t                   time_us,
+                                             uint32_t                   key,
+                                             ClutterKeyState            key_state)
+{
+}
+
+static void
+clutter_virtual_input_device_x11_init (ClutterVirtualInputDeviceX11 *virtual_device_x11)
+{
+}
+
+static void
+clutter_virtual_input_device_x11_class_init (ClutterVirtualInputDeviceX11Class *klass)
+{
+  ClutterVirtualInputDeviceClass *virtual_input_device_class =
+    CLUTTER_VIRTUAL_INPUT_DEVICE_CLASS (klass);
+
+  virtual_input_device_class->notify_relative_motion = 
clutter_virtual_input_device_x11_notify_relative_motion;
+  virtual_input_device_class->notify_absolute_motion = 
clutter_virtual_input_device_x11_notify_absolute_motion;
+  virtual_input_device_class->notify_button = clutter_virtual_input_device_x11_notify_button;
+  virtual_input_device_class->notify_key = clutter_virtual_input_device_x11_notify_key;
+}
diff --git a/clutter/clutter/x11/clutter-virtual-input-device-x11.h 
b/clutter/clutter/x11/clutter-virtual-input-device-x11.h
new file mode 100644
index 0000000..b1bb101
--- /dev/null
+++ b/clutter/clutter/x11/clutter-virtual-input-device-x11.h
@@ -0,0 +1,35 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2016  Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Jonas Ådahl <jadahl gmail com>
+ */
+
+#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_X11_H__
+#define __CLUTTER_VIRTUAL_INPUT_DEVICE_X11_H__
+
+#include "clutter-virtual-input-device.h"
+
+#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_X11 (clutter_virtual_input_device_x11_get_type ())
+G_DECLARE_FINAL_TYPE (ClutterVirtualInputDeviceX11,
+                      clutter_virtual_input_device_x11,
+                      CLUTTER, VIRTUAL_INPUT_DEVICE_X11,
+                      ClutterVirtualInputDevice)
+
+#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_X11_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]