[cluttermm] PathConstraint class added.



commit 55414fea09169c0d58fa1325418f6c389997d406
Author: Ian Martin <martin_id vodafone co nz>
Date:   Thu Mar 27 21:31:11 2014 +1300

    PathConstraint class added.
    
    PathConstraint source added, and modifies the build to use the class.

 clutter/cluttermm.h                              |    1 +
 clutter/src/clutter_methods.defs                 |   18 +++++-
 clutter/src/filelist.am                          |    1 +
 clutter/src/path-constraint.ccg                  |   25 ++++++++
 clutter/src/path-constraint.hg                   |   67 ++++++++++++++++++++++
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 6 files changed, 109 insertions(+), 4 deletions(-)
---
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index 955dccb..2de695d 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -102,6 +102,7 @@
 #include <cluttermm/offscreen-effect.h>
 #include <cluttermm/page-turn-effect.h>
 #include <cluttermm/path.h>
+#include <cluttermm/path-constraint.h>
 #include <cluttermm/property-transition.h>
 #include <cluttermm/rectangle.h>
 #include <cluttermm/score.h>
diff --git a/clutter/src/clutter_methods.defs b/clutter/src/clutter_methods.defs
index f285ddb..9a3e19f 100644
--- a/clutter/src/clutter_methods.defs
+++ b/clutter/src/clutter_methods.defs
@@ -2998,6 +2998,7 @@
 )
 
 (define-method set_source
+  (of-object "ClutterBindConstraint")
   (c-name "clutter_bind_constraint_set_source")
   (return-type "none")
   (parameters
@@ -3006,6 +3007,7 @@
 )
 
 (define-method get_source
+  (of-object "ClutterBindConstraint")
   (c-name "clutter_bind_constraint_get_source")
   (return-type "ClutterActor*")
   (parameters
@@ -3013,6 +3015,7 @@
 )
 
 (define-method set_coordinate
+  (of-object "ClutterBindConstraint")
   (c-name "clutter_bind_constraint_set_coordinate")
   (return-type "none")
   (parameters
@@ -3021,6 +3024,7 @@
 )
 
 (define-method get_coordinate
+  (of-object "ClutterBindConstraint")
   (c-name "clutter_bind_constraint_get_coordinate")
   (return-type "ClutterBindCoordinate")
   (parameters
@@ -3028,6 +3032,7 @@
 )
 
 (define-method set_offset
+  (of-object "ClutterBindConstraint")
   (c-name "clutter_bind_constraint_set_offset")
   (return-type "none")
   (parameters
@@ -3036,6 +3041,7 @@
 )
 
 (define-method get_offset
+  (of-object "ClutterBindConstraint")
   (c-name "clutter_bind_constraint_get_offset")
   (return-type "gfloat")
   (parameters
@@ -7425,7 +7431,8 @@
   )
 )
 
-(define-function clutter_path_constraint_set_path
+(define-method set_path
+  (of-object "ClutterPathConstraint")
   (c-name "clutter_path_constraint_set_path")
   (return-type "none")
   (parameters
@@ -7433,14 +7440,16 @@
   )
 )
 
-(define-function clutter_path_constraint_get_path
+(define-method get_path
+  (of-object "ClutterPathConstraint")
   (c-name "clutter_path_constraint_get_path")
   (return-type "ClutterPath*")
   (parameters
   )
 )
 
-(define-function clutter_path_constraint_set_offset
+(define-method set_offset
+  (of-object "ClutterPathConstraint")
   (c-name "clutter_path_constraint_set_offset")
   (return-type "none")
   (parameters
@@ -7448,7 +7457,8 @@
   )
 )
 
-(define-function clutter_path_constraint_get_offset
+(define-method clutter_path_constraint_get_offset
+  (of-object "ClutterPathConstraint")
   (c-name "clutter_path_constraint_get_offset")
   (return-type "gfloat")
   (parameters
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 141eb25..80949ce 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -57,6 +57,7 @@ files_hg =                    \
        offscreen-effect.hg \
        page-turn-effect.hg \
        path.hg                 \
+  path-constraint.hg \
        property-transition.hg  \
        rectangle.hg            \
        score.hg                \
diff --git a/clutter/src/path-constraint.ccg b/clutter/src/path-constraint.ccg
new file mode 100644
index 0000000..51f231b
--- /dev/null
+++ b/clutter/src/path-constraint.ccg
@@ -0,0 +1,25 @@
+/* Copyright (C) 2014 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 <clutter/clutter.h>
+#include <cluttermm/actor.h>
+#include <cluttermm/path.h>
+
+namespace Clutter
+{
+
+} //namespace Clutter
diff --git a/clutter/src/path-constraint.hg b/clutter/src/path-constraint.hg
new file mode 100644
index 0000000..b680179
--- /dev/null
+++ b/clutter/src/path-constraint.hg
@@ -0,0 +1,67 @@
+/* Copyright (C) 2014 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/constraint.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(cluttermm/private/constraint_p.h)
+_PINCLUDE(glibmm/private/object_p.h)
+
+
+namespace Clutter
+{
+
+class Actor;
+class Path;
+
+/** PathConstraint is a simple constraint that modifies the allocation of
+ * the Actor to which it has been applied using a ClutterPath.
+ *
+ * By setting the “offset” property it is possible to control how far along the
+ * path the Actor should be.
+ *
+ * @newin{1,6}
+ */
+class PathConstraint : public Constraint
+{
+  _CLASS_GOBJECT(PathConstraint, ClutterPathConstraint, CLUTTER_PATH_CONSTRAINT, Constraint, 
ClutterConstraint)
+  _DERIVES_INITIALLY_UNOWNED()
+
+protected:
+
+  _WRAP_CTOR(PathConstraint(const Glib::RefPtr<Path>& path, float offset), clutter_path_constraint_new)
+
+public:
+
+  _WRAP_CREATE(const Glib::RefPtr<Path>& path, float offset)
+
+  _WRAP_METHOD(void set_path(const Glib::RefPtr<Path>& path), clutter_path_constraint_set_path)
+
+  _WRAP_METHOD(Glib::RefPtr<Path> get_path(), clutter_path_constraint_get_path, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Path> get_path() const, clutter_path_constraint_get_path, refreturn, 
constversion)
+
+  _WRAP_METHOD(void set_offset(float offset), clutter_path_constraint_set_offset)
+
+  _WRAP_METHOD(float get_offset() const, clutter_path_constraint_get_offset)
+
+  _WRAP_PROPERTY("offset", float)
+  _WRAP_PROPERTY("path", Glib::RefPtr<Path>)
+
+  _WRAP_SIGNAL(void node_reached(const Glib::RefPtr<Actor> actor, int index), "node-reached")
+};
+
+} // namespace Clutter
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc 
b/codegen/extradefs/generate_extra_defs_clutter.cc
index fa4fbf5..65ab619 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -65,6 +65,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_LAYOUT_META)
     << get_defs(CLUTTER_TYPE_MEDIA)
     << get_defs(CLUTTER_TYPE_PATH)
+    << get_defs(CLUTTER_TYPE_PATH_CONSTRAINT)
     << get_defs(CLUTTER_TYPE_PROPERTY_TRANSITION)
     << get_defs(CLUTTER_TYPE_RECTANGLE)
     << get_defs(CLUTTER_TYPE_SCORE)


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