[cluttermm] Initial wrapping of ClutterInputDevice.



commit 9e9c0e3bde0c5a5bb37b69b02af0b4bf51a144a6
Author: Chris Kühl <chrisk openismus com>
Date:   Sat Jan 22 14:39:30 2011 +0100

    Initial wrapping of ClutterInputDevice.
    
    * clutter/cluttermm.h: Added header file for new class.
    * clutter/src/input-device.[hg|ccg]: Initial wrapping of ClutterInputDevice.
    * clutter/src/clutter_signals.defs: Added properties for new class.
    * clutter/src/filelist.am: Added new classes to files_hg list.
    * codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
    * codegen/m4/convert_clutter.m4: Added enum conversion for Stage and
    InputDeviceType.

 ChangeLog                                        |   14 +++++-
 clutter/cluttermm.h                              |    2 +
 clutter/src/clutter_signals.defs                 |   29 ++++++++++++
 clutter/src/filelist.am                          |    1 +
 clutter/src/input-device.ccg                     |   26 +++++++++++
 clutter/src/input-device.hg                      |   53 ++++++++++++++++++++++
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 codegen/m4/convert_clutter.m4                    |    3 +
 8 files changed, 128 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6d40462..c75a3c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-22  Chris Kühl  <chrisk openismus com>
+
+	Initial wrapping of ClutterInputDevice.
+
+	* clutter/cluttermm.h: Added header file for new class.
+	* clutter/src/input-device.[hg|ccg]: Initial wrapping of ClutterInputDevice.
+	* clutter/src/clutter_signals.defs: Added properties for new class.
+	* clutter/src/filelist.am: Added new classes to files_hg list.
+	* codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
+	* codegen/m4/convert_clutter.m4: Added enum conversion for Stage and
+	InputDeviceType.
+
 2011-01-21  Chris Kühl  <chrisk openismus com>
 
 	Sorted _EQUAL & _CONV_ENUM entries.
@@ -9,7 +21,7 @@
 	Initial wrapping of ClutterAnimator.
 
 	* clutter/cluttermm.h: Added header file for new class.
-	* clutter/src/animator.[hg|ccg]: Initial wrapping of ClutterFlowLayout.
+	* clutter/src/animator.[hg|ccg]: Initial wrapping of ClutterAnimator.
 	* clutter/src/clutter_signals.defs: Added properties for new class.
 	* clutter/src/filelist.am: Added new classes to files_hg list.
 	* codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index e7a701b..75eda61 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -59,6 +59,7 @@
 #include <cluttermm/actor-meta.h>
 #include <cluttermm/alpha.h>
 #include <cluttermm/animation.h>
+#include <cluttermm/animator.h>
 #include <cluttermm/behaviour.h>
 #include <cluttermm/behaviour-depth.h>
 #include <cluttermm/behaviour-ellipse.h>
@@ -78,6 +79,7 @@
 #include <cluttermm/frame-source.h>
 #include <cluttermm/group.h>
 #include <cluttermm/init.h>
+#include <cluttermm/input-device.h>
 #include <cluttermm/interval.h>
 #include <cluttermm/layout-manager.h>
 #include <cluttermm/layoutmeta.h>
diff --git a/clutter/src/clutter_signals.defs b/clutter/src/clutter_signals.defs
index 90c75f6..1487224 100644
--- a/clutter/src/clutter_signals.defs
+++ b/clutter/src/clutter_signals.defs
@@ -2666,6 +2666,35 @@
   (construct-only #f)
 )
 
+;; ClutterInputDevice
+
+(define-property id
+  (of-object "ClutterInputDevice")
+  (prop-type "GParamInt")
+  (docs "Unique identifier of the device")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property device-type
+  (of-object "ClutterInputDevice")
+  (prop-type "GParamEnum")
+  (docs "The type of the device")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property name
+  (of-object "ClutterInputDevice")
+  (prop-type "GParamString")
+  (docs "The name of the device")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
 ;; From ClutterInterval
 
 (define-property value-type
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 41f2074..d799b0d 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -37,6 +37,7 @@ files_hg =			\
 	fixed-layout.hg         \
 	flow-layout.hg          \
 	group.hg		\
+	input-device.hg		\
 	interval.hg		\
 	layoutmeta.hg		\
 	layout-manager.hg	\
diff --git a/clutter/src/input-device.ccg b/clutter/src/input-device.ccg
new file mode 100644
index 0000000..211e1c8
--- /dev/null
+++ b/clutter/src/input-device.ccg
@@ -0,0 +1,26 @@
+/* Copyright (C) 2011 The cluttermm Development Team
+ *
+ * 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.1 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <cluttermm/input-device.h>
+#include <cluttermm/stage.h>
+
+#include <clutter/clutter.h>
+
+namespace Clutter
+{
+
+} // namespace Clutter
diff --git a/clutter/src/input-device.hg b/clutter/src/input-device.hg
new file mode 100644
index 0000000..294579d
--- /dev/null
+++ b/clutter/src/input-device.hg
@@ -0,0 +1,53 @@
+/* Copyright (C) 2011 The cluttermm Development Team
+ *
+ * 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.1 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, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/object.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Clutter
+{
+
+_WRAP_ENUM(InputDeviceType, ClutterInputDeviceType)
+
+class Actor;
+class Stage;
+
+class InputDevice : public Glib::Object
+{
+  _CLASS_GOBJECT(InputDevice, ClutterInputDevice, CLUTTER_INPUT_DEVICE, Glib::Object, GObject)
+
+protected:
+  _CTOR_DEFAULT()
+
+public:
+
+  _WRAP_METHOD(int get_device_id() const, clutter_input_device_get_device_id)
+  _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)
+  _WRAP_METHOD(Glib::RefPtr<Actor> get_pointer_actor() const, clutter_input_device_get_pointer_actor)
+  _WRAP_METHOD(Glib::RefPtr<Stage> get_pointer_stage() const, clutter_input_device_get_pointer_stage)
+  //_WRAP_METHOD(void update_from_event(const Event &event, bool update_stage), clutter_input_device_update_from_event)
+
+  _WRAP_PROPERTY("device-type", InputDeviceType)
+  _WRAP_PROPERTY("id", int)
+  _WRAP_PROPERTY("name", Glib::ustring)
+};
+
+} // namespace Clutter
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc b/codegen/extradefs/generate_extra_defs_clutter.cc
index 5a09f2e..0dc3f2e 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -53,6 +53,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_FLOW_LAYOUT)
     << get_defs(CLUTTER_TYPE_GROUP)
     << get_defs(CLUTTER_TYPE_INTERVAL)
+    << get_defs(CLUTTER_TYPE_INPUT_DEVICE)
 //    << get_defs(CLUTTER_TYPE_HBOX)
 //    << get_defs(CLUTTER_TYPE_LAYOUT)
     << get_defs(CLUTTER_TYPE_LAYOUT_MANAGER)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index a2fe2b7..178efd4 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -74,6 +74,8 @@ _CONVERSION(`Color&',`ClutterColor*',`($3).gobj()')
 _CONVERSION(`const Color&',`const ClutterColor*',`($3).gobj()')
 _CONVERSION(`const Margin&',`const ClutterMargin*',`($3).gobj()')
 
+_CONVERSION(`ClutterStage*',`Glib::RefPtr<Stage>',`Glib::wrap($3)')
+
 _CONVERSION(`ClutterUnit&',`ClutterUnit*',`&($3)')
 _CONVERSION(`ClutterUnit*',`ClutterUnit&',`*($3)')
 _CONVERSION(`Knot&',`ClutterKnot*',`($3).gobj()')
@@ -125,6 +127,7 @@ _CONV_ENUM(Clutter,BinAlignment)
 _CONV_ENUM(Clutter,BoxAlignment)
 _CONV_ENUM(Clutter,FlowOrientation)
 _CONV_ENUM(Clutter,Gravity)
+_CONV_ENUM(Clutter,InputDeviceType)
 _CONV_ENUM(Clutter,Interpolation)
 _CONV_ENUM(Clutter,LayoutFlags)
 _CONV_ENUM(Clutter,PackType)



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