[cluttermm] AlignConstraint class added.



commit 62b91bd7c5d429edded052e67b1a5cd079c62bbe
Author: Ian Martin <martin_id vodafone co nz>
Date:   Thu Mar 27 19:58:32 2014 +1300

    AlignConstraint class added.
    
    Adds AlignConstraint class and includes it in the build.

 clutter/cluttermm.h                              |    1 +
 clutter/src/align-constraint.ccg                 |   25 +++++++++
 clutter/src/align-constraint.hg                  |   62 ++++++++++++++++++++++
 clutter/src/filelist.am                          |    1 +
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 codegen/m4/convert_clutter.m4                    |    1 +
 6 files changed, 91 insertions(+), 0 deletions(-)
---
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index 7ba6d93..57efa4b 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -58,6 +58,7 @@
 #include <cluttermm/actor.h>
 #include <cluttermm/actor-box.h>
 #include <cluttermm/actor-meta.h>
+#include <cluttermm/align-constraint.h>
 #include <cluttermm/alpha.h>
 #include <cluttermm/animatable.h>
 #include <cluttermm/animation.h>
diff --git a/clutter/src/align-constraint.ccg b/clutter/src/align-constraint.ccg
new file mode 100644
index 0000000..34c9991
--- /dev/null
+++ b/clutter/src/align-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>
+
+namespace Clutter
+{
+
+
+} //namespace Clutter
diff --git a/clutter/src/align-constraint.hg b/clutter/src/align-constraint.hg
new file mode 100644
index 0000000..5cb61f6
--- /dev/null
+++ b/clutter/src/align-constraint.hg
@@ -0,0 +1,62 @@
+/* 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)
+
+
+namespace Clutter
+{
+
+class Actor;
+_WRAP_ENUM(AlignAxis, ClutterAlignAxis)
+
+/** AlignConstraint is a Constraint that aligns the position of the Actor to
+ * which it is applied to the size of another Actor using an alignment factor.
+ *
+ * @newin{1,4}
+ */
+class AlignConstraint  : public Constraint
+{
+  _CLASS_GOBJECT(AlignConstraint, ClutterAlignConstraint, CLUTTER_ALIGN_CONSTRAINT, Constraint, 
ClutterConstraint)
+  _DERIVES_INITIALLY_UNOWNED()
+
+protected:
+  _WRAP_CTOR(AlignConstraint(const Glib::RefPtr<Actor>& source, Clutter::AlignAxis align_axis, float 
factor), clutter_align_constraint_new)
+
+public:
+  _WRAP_CREATE(const Glib::RefPtr<Actor>& source, AlignAxis axis, float factor)
+
+  _WRAP_METHOD(void set_source(const Glib::RefPtr<Actor>& source),  clutter_align_constraint_set_source)
+
+  _WRAP_METHOD(Glib::RefPtr<Actor> get_source(), clutter_align_constraint_get_source, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Actor> get_source() const, clutter_align_constraint_get_source, refreturn, 
constversion)
+
+  _WRAP_METHOD(void set_align_axis(AlignAxis axis), clutter_align_constraint_set_align_axis)
+  _WRAP_METHOD(AlignAxis get_align_axis() const, clutter_align_constraint_get_align_axis)
+  _WRAP_METHOD(void set_factor(float factor), clutter_align_constraint_set_factor )
+  _WRAP_METHOD(float get_factor() const, clutter_align_constraint_get_factor )
+
+  _WRAP_PROPERTY("align-axis", AlignAxis)
+  _WRAP_PROPERTY("factor", float)
+  _WRAP_PROPERTY("source", Actor)
+};
+
+} // namespace Clutter
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 25c2c1e..3be077e 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -15,6 +15,7 @@ files_hg =                    \
        actor-box.hg            \
        actor-meta.hg           \
        action.hg               \
+       align-constraint.hg \
        alpha.hg                \
        animatable.hg           \
        animation.hg            \
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc 
b/codegen/extradefs/generate_extra_defs_clutter.cc
index 83b3b05..333bf90 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -28,6 +28,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_ACTOR)
     << get_defs(CLUTTER_TYPE_ACTOR_META)
     << get_defs(CLUTTER_TYPE_ACTION)
+    << get_defs(CLUTTER_TYPE_ALIGN_CONSTRAINT)
     << get_defs(CLUTTER_TYPE_ALPHA)
     << get_defs(CLUTTER_TYPE_ANIMATABLE)
     << get_defs(CLUTTER_TYPE_ANIMATION)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 66c1f92..c2a1397 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -166,6 +166,7 @@ _EQUAL(ClutterScrollEvent*,ScrollEvent*)
 
 _CONV_ENUM(Clutter,ActorAlign)
 _CONV_ENUM(Clutter,ActorFlags)
+_CONV_ENUM(Clutter,AlignAxis)
 _CONV_ENUM(Clutter,AllocationFlags)
 _CONV_ENUM(Clutter,AnimationMode)
 _CONV_ENUM(Clutter,BinAlignment)


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