[cluttermm] Constraint base class added.



commit 8af7c294d33c97e56fb4fa9f86260596f282a2a9
Author: Ian Martin <martin_id vodafone co nz>
Date:   Thu Mar 27 19:33:47 2014 +1300

    Constraint base class added.

 clutter/cluttermm.h                              |    1 +
 clutter/src/constraint.ccg                       |   25 +++++++++
 clutter/src/constraint.hg                        |   58 ++++++++++++++++++++++
 clutter/src/filelist.am                          |    1 +
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 5 files changed, 86 insertions(+), 0 deletions(-)
---
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index c26581b..e4c4955 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -79,6 +79,7 @@
 #include <cluttermm/clone.h>
 #include <cluttermm/color.h>
 #include <cluttermm/colorize-effect.h>
+#include <cluttermm/constraint.h>
 #include <cluttermm/content.h>
 #include <cluttermm/deform-effect.h>
 #include <cluttermm/device-manager.h>
diff --git a/clutter/src/constraint.ccg b/clutter/src/constraint.ccg
new file mode 100644
index 0000000..63b71c5
--- /dev/null
+++ b/clutter/src/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/types.h>
+
+namespace Clutter
+{
+
+} //namespace Clutter
diff --git a/clutter/src/constraint.hg b/clutter/src/constraint.hg
new file mode 100644
index 0000000..6e67b4e
--- /dev/null
+++ b/clutter/src/constraint.hg
@@ -0,0 +1,58 @@
+/* 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/actor-meta.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+_PINCLUDE(cluttermm/private/actor-meta_p.h)
+
+
+namespace Clutter
+{
+class Actor;
+
+// TODO: fill this out once the examples are built.
+/**
+ * Constraint is a base abstract class for modifiers of an Actor position or size.
+ *
+ * A Constraint sub-class should contain the logic for modifying the position or
+ * size of the Actor to which it is applied, by updating the actor's
+ * allocation. Each Constraint can change the allocation of the actor to which
+ * they are applied by overriding the Constraint::update_allocation_vfunc() virtual
+ * function.
+ *
+ * @newin{1,4}
+ */
+class Constraint : public Clutter::ActorMeta
+{
+  _CLASS_GOBJECT(Constraint, ClutterConstraint, CLUTTER_CONSTRAINT, ActorMeta, ClutterActorMeta)
+  _DERIVES_INITIALLY_UNOWNED()
+
+protected:
+  _CTOR_DEFAULT()
+
+public:
+  //There is no create() because this is an abstract base class.
+  //_WRAP_CREATE()
+
+protected:
+   _WRAP_VFUNC(void update_allocation(Glib::RefPtr<Actor>& actor, ActorBox& allocation), update_allocation)
+};
+
+}
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 7944d49..fcbe283 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -37,6 +37,7 @@ files_hg =                    \
        clone.hg                \
        color.hg                \
        colorize-effect.hg \
+       constraint.hg           \
        container.hg            \
        content.hg              \
        deform-effect.hg \
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc 
b/codegen/extradefs/generate_extra_defs_clutter.cc
index 3355c75..4f72d22 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -47,6 +47,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_CHILD_META)
     << get_defs(CLUTTER_TYPE_CLONE)
     << get_defs(CLUTTER_TYPE_COLOR)
+    << get_defs(CLUTTER_TYPE_CONSTRAINT)
     << get_defs(CLUTTER_TYPE_CONTENT)
     << get_defs(CLUTTER_TYPE_CONTAINER)
     << get_defs(CLUTTER_TYPE_DEVICE_MANAGER)


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