[cluttermm] BindConstraint class added.



commit 12ecf17fe6b35ded1934b7dd47177ecc55921c81
Author: Ian Martin <martin_id vodafone co nz>
Date:   Thu Mar 27 20:20:17 2014 +1300

    BindConstraint class added.
    
    Adds the BindConstraint class, and the changes required to include it in the build.

 clutter/cluttermm.h                              |    1 +
 clutter/src/bind-constraint.ccg                  |   25 ++++++++
 clutter/src/bind-constraint.hg                   |   71 ++++++++++++++++++++++
 clutter/src/clutter_methods.defs                 |   12 ++--
 clutter/src/filelist.am                          |    1 +
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 codegen/m4/convert_clutter.m4                    |    1 +
 7 files changed, 106 insertions(+), 6 deletions(-)
---
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index e4c4955..955dccb 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -70,6 +70,7 @@
 #include <cluttermm/behaviour-rotate.h>
 #include <cluttermm/behaviour-scale.h>
 #include <cluttermm/bin-layout.h>
+#include <cluttermm/bind-constraint.h>
 #include <cluttermm/box.h>
 #include <cluttermm/box-layout.h>
 #include <cluttermm/blur-effect.h>
diff --git a/clutter/src/bind-constraint.ccg b/clutter/src/bind-constraint.ccg
new file mode 100644
index 0000000..22ee0fc
--- /dev/null
+++ b/clutter/src/bind-constraint.ccg
@@ -0,0 +1,25 @@
+/* Copyright (C) 2009 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> //source
+#include <cluttermm/types.h> //for BindCoordinate
+
+namespace Clutter
+{
+
+} //namespace Clutter
diff --git a/clutter/src/bind-constraint.hg b/clutter/src/bind-constraint.hg
new file mode 100644
index 0000000..b617026
--- /dev/null
+++ b/clutter/src/bind-constraint.hg
@@ -0,0 +1,71 @@
+/* Copyright (C) 2013 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;
+
+_WRAP_ENUM(BindCoordinate, ClutterBindCoordinate)
+
+//TODO: rewrite the example code.
+/**
+ * BindConstraint is a Constraint that binds the position or the size of the
+ * Actor to which it is applied to the the position or the size of another
+ * Actor, or "source".
+ *
+ * An offset can be applied to the constraint, to avoid overlapping. The offset
+ * can also be animated.
+ */
+class BindConstraint : public Constraint
+{
+  _CLASS_GOBJECT(BindConstraint, ClutterBindConstraint, CLUTTER_BIND_CONSTRAINT, Constraint, 
ClutterConstraint)
+  _DERIVES_INITIALLY_UNOWNED()
+
+protected:
+  _WRAP_CTOR(BindConstraint(const Glib::RefPtr<Actor>& source, BindCoordinate coordinate, float offset), 
clutter_bind_constraint_new)
+
+public:
+  _WRAP_CREATE(const Glib::RefPtr<Actor>& source, BindCoordinate coordinate, float offset)
+
+  _WRAP_METHOD(void set_source(const Glib::RefPtr<Actor>& source), clutter_bind_constraint_set_source)
+
+  _WRAP_METHOD(Glib::RefPtr<Actor> get_source(), clutter_bind_constraint_get_source, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Actor> get_source() const, clutter_bind_constraint_get_source, refreturn, 
constversion)
+
+  _WRAP_METHOD(void set_coordinate(BindCoordinate coordinate), clutter_bind_constraint_set_coordinate)
+  _WRAP_METHOD(BindCoordinate get_coordinate() const, clutter_bind_constraint_get_coordinate)
+
+  _WRAP_METHOD(void set_offset(float offset), clutter_bind_constraint_set_offset)
+  _WRAP_METHOD(float get_offset() const, clutter_bind_constraint_get_offset )
+
+protected:
+  _WRAP_PROPERTY("coordinate", BindCoordinate)
+  _WRAP_PROPERTY("offset", float)
+  _WRAP_PROPERTY("source", Glib::RefPtr<Actor>)
+
+};
+
+} // namespace Clutter
diff --git a/clutter/src/clutter_methods.defs b/clutter/src/clutter_methods.defs
index fb3dd81..f285ddb 100644
--- a/clutter/src/clutter_methods.defs
+++ b/clutter/src/clutter_methods.defs
@@ -2997,7 +2997,7 @@
   )
 )
 
-(define-function clutter_bind_constraint_set_source
+(define-method set_source
   (c-name "clutter_bind_constraint_set_source")
   (return-type "none")
   (parameters
@@ -3005,14 +3005,14 @@
   )
 )
 
-(define-function clutter_bind_constraint_get_source
+(define-method get_source
   (c-name "clutter_bind_constraint_get_source")
   (return-type "ClutterActor*")
   (parameters
   )
 )
 
-(define-function clutter_bind_constraint_set_coordinate
+(define-method set_coordinate
   (c-name "clutter_bind_constraint_set_coordinate")
   (return-type "none")
   (parameters
@@ -3020,14 +3020,14 @@
   )
 )
 
-(define-function clutter_bind_constraint_get_coordinate
+(define-method get_coordinate
   (c-name "clutter_bind_constraint_get_coordinate")
   (return-type "ClutterBindCoordinate")
   (parameters
   )
 )
 
-(define-function clutter_bind_constraint_set_offset
+(define-method set_offset
   (c-name "clutter_bind_constraint_set_offset")
   (return-type "none")
   (parameters
@@ -3035,7 +3035,7 @@
   )
 )
 
-(define-function clutter_bind_constraint_get_offset
+(define-method get_offset
   (c-name "clutter_bind_constraint_get_offset")
   (return-type "gfloat")
   (parameters
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index fcbe283..141eb25 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -28,6 +28,7 @@ files_hg =                    \
        behaviour-rotate.hg     \
        behaviour-scale.hg      \
        bin-layout.hg           \
+  bind-constraint.hg \
        box.hg                  \
        box-layout.hg           \
        blur-effect.hg          \
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc 
b/codegen/extradefs/generate_extra_defs_clutter.cc
index 4f72d22..fa4fbf5 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -41,6 +41,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_ROTATE)
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_SCALE)
     << get_defs(CLUTTER_TYPE_BIN_LAYOUT)
+    << get_defs(CLUTTER_TYPE_BIND_CONSTRAINT)
     << get_defs(CLUTTER_TYPE_BOX)
     << get_defs(CLUTTER_TYPE_BOX_LAYOUT)
     << get_defs(CLUTTER_TYPE_CAIRO_TEXTURE)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 0ffc084..dbedd66 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -169,6 +169,7 @@ _CONV_ENUM(Clutter,ActorFlags)
 _CONV_ENUM(Clutter,AllocationFlags)
 _CONV_ENUM(Clutter,AnimationMode)
 _CONV_ENUM(Clutter,BinAlignment)
+_CONV_ENUM(Clutter,BindCoordinate)
 _CONV_ENUM(Clutter,BoxAlignment)
 _CONV_ENUM(Clutter,ContentGravity)
 _CONV_ENUM(Clutter,ContentRepeat)


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