[cluttermm] InputDevice: Add methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cluttermm] InputDevice: Add methods.
- Date: Thu, 10 Apr 2014 18:48:01 +0000 (UTC)
commit 1137138adf31e2f0fbc4b2694a495272897d1a9b
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Apr 10 20:47:10 2014 +0200
InputDevice: Add methods.
This is based on changes in this patch:
https://bugzilla.gnome.org/show_bug.cgi?id=725125#c9
clutter/src/backend.hg | 2 --
clutter/src/input-device.hg | 35 ++++++++++++++++++++++++++++++++++-
codegen/m4/convert_clutter.m4 | 4 ++++
3 files changed, 38 insertions(+), 3 deletions(-)
---
diff --git a/clutter/src/backend.hg b/clutter/src/backend.hg
index da99744..01ced7b 100644
--- a/clutter/src/backend.hg
+++ b/clutter/src/backend.hg
@@ -42,8 +42,6 @@ public:
_WRAP_METHOD(double get_resolution() const, clutter_backend_get_resolution, deprecated "Use Settings's
front-dpi property instead.")
_WRAP_METHOD(void set_resolution(double dpi), clutter_backend_set_resolution, deprecated "Use Settings's
front-dpi property instead.")
- _WRAP_METHOD(static Glib::RefPtr<Backend> get_default_backend(), clutter_get_default_backend, refreturn)
-
_WRAP_METHOD(guint get_double_click_time() const, clutter_backend_get_double_click_time, deprecated "Use
Settings's double-click-time property instead.")
_WRAP_METHOD(void set_double_click_time(guint msec), clutter_backend_set_double_click_time, deprecated
"Use Settings's double-click-time property instead.")
diff --git a/clutter/src/input-device.hg b/clutter/src/input-device.hg
index e989a28..c284901 100644
--- a/clutter/src/input-device.hg
+++ b/clutter/src/input-device.hg
@@ -31,15 +31,20 @@ typedef struct _ClutterEventSequence ClutterEventSequence;
namespace Clutter
{
+_WRAP_ENUM(InputAxis, ClutterInputAxis)
+_WRAP_ENUM(InputMode, ClutterInputMode)
_WRAP_ENUM(InputDeviceType, ClutterInputDeviceType)
_WRAP_ENUM(ModifierType, ClutterModifierType)
class Actor;
+class Backend;
class Stage;
+class DeviceManager;
class InputDevice : public Glib::Object
{
_CLASS_GOBJECT(InputDevice, ClutterInputDevice, CLUTTER_INPUT_DEVICE, Glib::Object, GObject)
+ _DERIVES_INITIALLY_UNOWNED()
protected:
_CTOR_DEFAULT()
@@ -57,15 +62,43 @@ public:
_WRAP_METHOD(InputDeviceType get_device_type() const, clutter_input_device_get_device_type)
_WRAP_METHOD(Glib::ustring get_device_name() const, clutter_input_device_get_device_name)
_WRAP_METHOD(void get_device_coords(int &x, int &y) const, clutter_input_device_get_device_coords,
deprecated "Use get_coords() instead.")
+
+ _WRAP_METHOD(InputMode get_device_mode() const, clutter_input_device_get_device_mode)
+ _WRAP_METHOD(bool get_has_cursor() const, clutter_input_device_get_has_cursor)
+ _WRAP_METHOD(void set_enabled(bool enabled = true), clutter_input_device_set_enabled)
+ _WRAP_METHOD(bool get_enabled() const, clutter_input_device_get_enabled)
+
+ _WRAP_METHOD(Glib::RefPtr<InputDevice> get_associated_device(),
clutter_input_device_get_associated_device, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const InputDevice> get_associated_device() const,
clutter_input_device_get_associated_device, refreturn, constversion)
+
+ _WRAP_METHOD(bool keycode_to_evdev(guint hardware_keycode, guint& evdev_keycode) const,
clutter_input_device_keycode_to_evdev)
+ _WRAP_METHOD(bool get_n_keys() const, clutter_input_device_get_n_keys)
+ _WRAP_METHOD(void set_key(guint index, guint keyval, ModifierType modifiers), clutter_input_device_set_key)
+
+ #m4 _CONVERSION(`ModifierType&', `ClutterModifierType*', `($2)(&($3))')
+ _WRAP_METHOD(bool get_key(guint index, guint& keyval, ModifierType& modifiers) const,
clutter_input_device_get_key)
+
+ _WRAP_METHOD(guint get_n_axes(), clutter_input_device_get_n_axes)
+ _WRAP_METHOD(InputAxis get_axis(guint index_), clutter_input_device_get_axis)
+
_WRAP_METHOD(Glib::RefPtr<Actor> get_pointer_actor(), clutter_input_device_get_pointer_actor, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Actor> get_pointer_actor() const, clutter_input_device_get_pointer_actor,
refreturn, constversion)
_WRAP_METHOD(Glib::RefPtr<Stage> get_pointer_stage(), clutter_input_device_get_pointer_stage, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Stage> get_pointer_stage() const, clutter_input_device_get_pointer_stage,
refreturn, , constversion)
- //_WRAP_METHOD(void update_from_event(const Event &event, bool update_stage),
clutter_input_device_update_from_event)
+ _WRAP_METHOD(void grab(const Glib::RefPtr<const Actor>& actor), clutter_input_device_grab)
+ _WRAP_METHOD(void ungrab(), clutter_input_device_ungrab)
+
+ //TODO: _WRAP_METHOD(void update_from_event(const Glib::RefPtr<Event>& event, bool update_stage),
clutter_input_device_update_from_event)
+ _WRAP_PROPERTY("backend", Glib::RefPtr<Backend>)
+ _WRAP_PROPERTY("device-manager", Glib::RefPtr<DeviceManager>)
+ _WRAP_PROPERTY("device-mode", InputMode)
_WRAP_PROPERTY("device-type", InputDeviceType)
+ _WRAP_PROPERTY("enabled", bool)
+ _WRAP_PROPERTY("has-cursor", bool)
_WRAP_PROPERTY("id", int)
+ _WRAP_PROPERTY("n-axes", int)
_WRAP_PROPERTY("name", Glib::ustring)
};
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 3fa556f..8c8f49b 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -64,6 +64,8 @@ _CONVERSION(`const Glib::RefPtr<const Effect>&',`ClutterEffect*',__CONVERT_CONST
_CONVERSION(`ClutterEffect*',`Glib::RefPtr<Effect>',`Glib::wrap($3)')
_CONVERSION(`ClutterEffect*',`Glib::RefPtr<const Effect>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Event>&', `ClutterEvent*',__CONVERT_REFPTR_TO_P)
+
_CONVERSION(`Geometry&',`Clutter::Geometry*',`($3).gobj()')
_CONVERSION(`const Geometry&',`ClutterGeometry*',`const_cast<ClutterGeometry*>(($3).gobj())')
_CONVERSION(`const Geometry&',`const ClutterGeometry*',`($3).gobj()')
@@ -192,7 +194,9 @@ _CONV_ENUM(Clutter,ContentRepeat)
_CONV_ENUM(Clutter,FlowOrientation)
_CONV_ENUM(Clutter,Gravity)
_CONV_ENUM(Clutter,GridPosition)
+_CONV_ENUM(Clutter,InputAxis)
_CONV_ENUM(Clutter,InputDeviceType)
+_CONV_ENUM(Clutter,InputMode)
_CONV_ENUM(Clutter,Interpolation)
_CONV_ENUM(Clutter,LayoutFlags)
_CONV_ENUM(Clutter,ModifierType)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]