[cluttermm] Initial wrapping of ClutterAnimator.



commit 75dca40ba6028df63abf2f00b93215aceb99d898
Author: Chris Kühl <chrisk openismus com>
Date:   Fri Jan 21 03:12:37 2011 +0100

    Initial wrapping of ClutterAnimator.
    
    * clutter/cluttermm.h: Added header file for new class.
    * clutter/src/animator.[hg|ccg]: Initial wrapping of ClutterFlowLayout.
    * 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 Animator.

 ChangeLog                                        |   11 +++
 clutter/src/animator.ccg                         |   24 +++++++
 clutter/src/animator.hg                          |   73 ++++++++++++++++++++++
 clutter/src/clutter_signals.defs                 |   20 ++++++
 clutter/src/filelist.am                          |    1 +
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 codegen/m4/convert_clutter.m4                    |    5 ++
 7 files changed, 135 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a889ca5..4ce8b9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-21  Chris Kühl  <chrisk openismus com>
+
+	Initial wrapping of ClutterAnimator.
+
+	* clutter/cluttermm.h: Added header file for new class.
+	* clutter/src/animator.[hg|ccg]: Initial wrapping of ClutterFlowLayout.
+	* 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 Animator.
+
 2011-01-20  Chris Kühl  <chrisk openismus com>
 
 	Removed unnecessary C headers in .hg files.
diff --git a/clutter/src/animator.ccg b/clutter/src/animator.ccg
new file mode 100644
index 0000000..b01d605
--- /dev/null
+++ b/clutter/src/animator.ccg
@@ -0,0 +1,24 @@
+/*
+ * 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 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/>.
+ */
+
+#include <clutter/clutter.h>
+
+namespace Clutter
+{
+
+} // namespace Clutter
+
diff --git a/clutter/src/animator.hg b/clutter/src/animator.hg
new file mode 100644
index 0000000..0bdbf27
--- /dev/null
+++ b/clutter/src/animator.hg
@@ -0,0 +1,73 @@
+/* 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>
+#include <cluttermm/scriptable.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Clutter
+{
+
+  _WRAP_ENUM(Interpolation, ClutterInterpolation)
+
+class Timeline;
+
+class Animator : public Glib::Object
+{
+  _CLASS_GOBJECT(Animator, ClutterAnimator, CLUTTER_ANIMATOR, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(Scriptable)
+
+protected:
+  _CTOR_DEFAULT()
+
+public:
+  _WRAP_CREATE()
+
+  _IGNORE(clutter_animator_set)
+  _WRAP_METHOD(Glib::RefPtr<Animator> set_key(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name, guint mode, double progress, const Glib::ValueBase& value), clutter_animator_set_key)
+  _WRAP_METHOD(void remove_key(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name, double progress), clutter_animator_remove_key)
+  // TODO: _WRAP_METHOD(std::vector<Glib::RefPtr<Animator> > get_keys(const Glib::RefPtr<Glib::Object>& object, const std::string &property_name, double progress), clutter_animator_get_keys)
+  _IGNORE(clutter_animator_get_keys)
+  _WRAP_METHOD(Glib::RefPtr<Timeline> start(), clutter_animator_start)
+  _WRAP_METHOD(bool compute_value(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name, double progress, Glib::ValueBase& value), clutter_animator_compute_value)
+
+  _WRAP_METHOD(void set_timeline(const Glib::RefPtr<Timeline>& timeline), clutter_animator_set_timeline)
+  _WRAP_METHOD(Glib::RefPtr<Timeline> get_timeline() const, clutter_animator_get_timeline)
+  _WRAP_METHOD(void set_duration(guint duration), clutter_animator_set_duration)
+  _WRAP_METHOD(guint get_duration() const, clutter_animator_get_duration)
+
+  _WRAP_METHOD(void property_set_ease_in(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name, bool ease_in), clutter_animator_property_set_ease_in)
+  _WRAP_METHOD(bool property_get_ease_in(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name), clutter_animator_property_get_ease_in)
+
+  _WRAP_METHOD(void property_set_interpolation(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name, Interpolation interpolation), clutter_animator_property_set_interpolation)
+  _WRAP_METHOD(Interpolation property_get_interpolation(const Glib::RefPtr<Glib::Object>& object, const Glib::ustring& property_name), clutter_animator_property_get_interpolation)
+
+  // TODO: Decide if these are needed.
+  // _WRAP_METHOD(Glib::RefPtr<Glib::Object> get_object() const, clutter_animator_key_get_objec)
+  // _WRAP_METHOD(Glib::ustring get_property_name() const, clutter_animator_key_get_property_name)
+  // _WRAP_METHOD(GType get_property_type() const, clutter_animator_key_get_property_type)
+  // _WRAP_METHOD(gulong get_mode() const, clutter_animator_key_get_mod)
+  // _WRAP_METHOD(double get_progress() const , clutter_animator_key_get_progres)
+  // _WRAP_METHOD(bool get_value(GValue *value) const, clutter_animator_key_get_value)
+
+  _WRAP_PROPERTY("duration", guint)
+  _WRAP_PROPERTY("timeline", Glib::RefPtr<Timeline>)
+};
+
+} // namespace Clutter
diff --git a/clutter/src/clutter_signals.defs b/clutter/src/clutter_signals.defs
index 53547fd..90c75f6 100644
--- a/clutter/src/clutter_signals.defs
+++ b/clutter/src/clutter_signals.defs
@@ -692,6 +692,26 @@
   (construct-only #f)
 )
 
+;; From ClutterAnimator
+
+(define-property duration
+  (of-object "ClutterAnimator")
+  (prop-type "GParamUInt")
+  (docs "The duration of the animation")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property timeline
+  (of-object "ClutterAnimator")
+  (prop-type "GParamObject")
+  (docs "The timeline of the animation")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From ClutterBackend
 
 (define-signal resolution-changed
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 8335301..41f2074 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -16,6 +16,7 @@ files_hg =			\
 	action.hg		\
 	alpha.hg		\
 	animation.hg		\
+	animator.hg		\
 	backend.hg		\
 	behaviour.hg		\
 	behaviour-depth.hg	\
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc b/codegen/extradefs/generate_extra_defs_clutter.cc
index 9800b48..5a09f2e 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -30,6 +30,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_ACTION)
     << get_defs(CLUTTER_TYPE_ALPHA)
     << get_defs(CLUTTER_TYPE_ANIMATION)
+    << get_defs(CLUTTER_TYPE_ANIMATOR)
     << get_defs(CLUTTER_TYPE_BACKEND)
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_DEPTH)
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_ELLIPSE)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 01ea734..57f8c18 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -28,6 +28,10 @@ _CONVERSION(`const Glib::RefPtr<Animation>&',`ClutterAnimation*',__CONVERT_REFPT
 _CONVERSION(`ClutterAnimation*',`Glib::RefPtr<Animation>',`Glib::wrap($3)')
 _CONVERSION(`ClutterAnimation*',`Glib::RefPtr<const Animation>',`Glib::wrap($3)')
 
+_CONVERSION(`const Glib::RefPtr<Animator>&',`ClutterAnimator*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterAnimator*',`Glib::RefPtr<Animator>',`Glib::wrap($3)')
+_CONVERSION(`ClutterAnimator*',`Glib::RefPtr<const Animator>',`Glib::wrap($3)')
+
 _CONVERSION(`const Glib::RefPtr<Backend>&',`ClutterBackend*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`ClutterBackend*',`Glib::RefPtr<Backend>',`Glib::wrap($3)')
 
@@ -117,6 +121,7 @@ _EQUAL(ClutterCrossingEvent*,CrossingEvent*)
 _CONV_ENUM(Clutter,ActorFlags)
 _CONV_ENUM(Clutter,AllocationFlags)
 _CONV_ENUM(Clutter,AnimationMode)
+_CONV_ENUM(Clutter,Interpolation)
 _CONV_ENUM(Clutter,BinAlignment)
 _CONV_ENUM(Clutter,BoxAlignment)
 _CONV_ENUM(Clutter,FlowOrientation)



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