[cluttermm] Initial wrapping of ClutterBox class.
- From: Chris Kühl <chriskuehl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cluttermm] Initial wrapping of ClutterBox class.
- Date: Wed, 12 Jan 2011 00:19:21 +0000 (UTC)
commit 1f20a290d805a076b565cfb8b4c93dcaf11bf80e
Author: Chris Kühl <chrisk openismus com>
Date: Wed Jan 12 00:55:34 2011 +0100
Initial wrapping of ClutterBox class.
* clutter/cluttermm.h: Added header file for new class.
* clutter/src/clutter_signals.defs: Added properties for new class.
* clutter/src/filelist.am: Added new classes to files_hg list.
* clutter/src/box.[hg|ccg]: Initial wrapping for ClutterBox.
* codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
ChangeLog | 20 +++++--
clutter/cluttermm.h | 1 +
clutter/src/box.ccg | 46 ++++++++++++++++
clutter/src/box.hg | 62 ++++++++++++++++++++++
clutter/src/clutter_signals.defs | 29 ++++++++++
clutter/src/filelist.am | 1 +
codegen/extradefs/generate_extra_defs_clutter.cc | 2 +-
7 files changed, 155 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cf8f2d4..6b0da72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
+2011-01-12 Chris Kühl <chrisk openismus com>
+
+ Initial wrapping of ClutterBox class.
+
+ * clutter/cluttermm.h: Added header file for new class.
+ * clutter/src/clutter_signals.defs: Added properties for new class.
+ * clutter/src/filelist.am: Added new classes to files_hg list.
+ * clutter/src/box.[hg|ccg]: Initial wrapping for ClutterBox.
+ * codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
+
2011-01-10 Murray Cumming <murrayc murrayc com>
LayoutMeta: Make the constructor explicit.
- * clutter/src/layoutmeta.hg: Use the explicit keyword on the constructor,
+ * clutter/src/layoutmeta.hg: Use the explicit keyword on the constructor,
as we do elsewhere in *mm projects.
2011-01-10 Murray Cumming <murrayc murrayc com>
@@ -10,11 +20,11 @@
LayoutManager: Wrap the vfuncs.
* clutter/src/clutter_vfuncs.defs: Fix a typo.
- * clutter/src/layout-manager.[hg|ccg]: Uncomment the _WRAP_VFUNC lines and
- correct them. But watch out - if I have made refcounting mistakes then this
+ * clutter/src/layout-manager.[hg|ccg]: Uncomment the _WRAP_VFUNC lines and
+ correct them. But watch out - if I have made refcounting mistakes then this
will cause crashes.
-
- * clutter/src/actor.hg: Move a conversion in to convert_clutter.m4 because
+
+ * clutter/src/actor.hg: Move a conversion in to convert_clutter.m4 because
it is not specific to the file, or dangerous to use generally.
* codegen/m4/convert_clutter.m4: Remove some incorrect conversions.
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index 1766967..4fd2a9b 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -66,6 +66,7 @@
#include <cluttermm/behaviour-path.h>
#include <cluttermm/behaviour-rotate.h>
#include <cluttermm/behaviour-scale.h>
+#include <cluttermm/box.h>
#include <cluttermm/cairo-texture.h>
#include <cluttermm/clone.h>
#include <cluttermm/color.h>
diff --git a/clutter/src/box.ccg b/clutter/src/box.ccg
new file mode 100644
index 0000000..63fe143
--- /dev/null
+++ b/clutter/src/box.ccg
@@ -0,0 +1,46 @@
+/* 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 <clutter/clutter.h>
+
+namespace Clutter
+{
+
+Color Box::get_color() const
+{
+ Color color;
+ clutter_box_get_color(const_cast<ClutterBox*>(gobj()), color.gobj());
+ return color;
+}
+
+void Box::pack(const Glib::RefPtr<Actor>& actor, const std::map<std::string, Glib::ValueBase>& properties)
+{
+ gchar* c_properties[properties.size()];
+ GValue values[properties.size()];
+
+ for(std::map<std::string, Glib::ValueBase>::const_iterator iter = properties.begin(); iter != properties.end(); ++iter)
+ {
+ c_properties[std::distance(properties.begin(), iter)] = g_strdup(iter->first.c_str());
+ g_value_copy(iter->second.gobj(), &values[std::distance(properties.begin(), iter)]);
+ }
+
+ clutter_box_packv(gobj(), actor->gobj(), properties.size(), c_properties, values);
+
+}
+
+} //namespace Clutter
+
diff --git a/clutter/src/box.hg b/clutter/src/box.hg
new file mode 100644
index 0000000..cb67a2d
--- /dev/null
+++ b/clutter/src/box.hg
@@ -0,0 +1,62 @@
+/* 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 <cluttermm/container.h>
+#include <cluttermm/layout-manager.h>
+#include <cluttermm/color.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(cluttermm/private/layout-manager_p.h)
+_PINCLUDE(cluttermm/private/container_p.h)
+
+namespace Clutter
+{
+
+class Box :
+ public LayoutManager,
+ public Container
+{
+ _CLASS_GOBJECT(Box, ClutterBox, CLUTTER_BOX, LayoutManager, ClutterLayoutManager)
+ _IMPLEMENTS_INTERFACE(Container)
+
+protected:
+ _CTOR_DEFAULT()
+ _WRAP_CTOR(Box(const Glib::RefPtr<LayoutManager>& layoutManager), clutter_box_new)
+
+public:
+ _WRAP_CREATE()
+
+ _WRAP_METHOD(Glib::RefPtr<LayoutManager> get_manager(), clutter_box_get_manager, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const LayoutManager> get_manager() const, clutter_box_get_manager, refreturn, constversion)
+
+ _WRAP_METHOD(void set_color(const Color& color), clutter_box_set_color)
+
+ _WRAP_METHOD_DOCS_ONLY(clutter_box_get_color)
+ Color get_color() const;
+
+ _IGNORE(clutter_box_packv, clutter_box_pack, clutter_box_pack_before, clutter_box_pack_after, clutter_box_pack_at)
+
+ // TODO: Documentation
+ void pack(const Glib::RefPtr<Actor>& actor, const std::map<std::string, Glib::ValueBase>& properties);
+
+ _WRAP_PROPERTY("color", Color)
+ _WRAP_PROPERTY("color-set", bool)
+ _WRAP_PROPERTY("manager", Glib::RefPtr<LayoutManager>)
+};
+
+} // namespace Clutter
+
diff --git a/clutter/src/clutter_signals.defs b/clutter/src/clutter_signals.defs
index 28f15a2..37f9444 100644
--- a/clutter/src/clutter_signals.defs
+++ b/clutter/src/clutter_signals.defs
@@ -1035,6 +1035,35 @@
(construct-only #f)
)
+;; From ClutterBox
+
+(define-property color
+ (of-object "ClutterBox")
+ (prop-type "GParamObject")
+ (docs "The color to be used to paint the background of the ClutterBox. Setting this property will set the 'color-set' property as a side effect")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property color-set
+ (of-object "ClutterBox")
+ (prop-type "GParamObject")
+ (docs "Whether the 'color' property has been set")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property manager
+ (of-object "ClutterBox")
+ (prop-type "GParamObject")
+ (docs "The ClutterLayoutManager used by the ClutterBox")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
;; From ClutterCairoTexture
(define-property name
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 4ea3a86..6057568 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -24,6 +24,7 @@ files_hg = \
behaviour-path.hg \
behaviour-rotate.hg \
behaviour-scale.hg \
+ box.hg \
cairo-texture.hg \
childmeta.hg \
clone.hg \
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc b/codegen/extradefs/generate_extra_defs_clutter.cc
index a928be7..9f0205f 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -38,7 +38,7 @@ int main(int argc, char** argv)
<< get_defs(CLUTTER_TYPE_BEHAVIOUR_PATH)
<< get_defs(CLUTTER_TYPE_BEHAVIOUR_ROTATE)
<< get_defs(CLUTTER_TYPE_BEHAVIOUR_SCALE)
-// << get_defs(CLUTTER_TYPE_BOX)
+ << get_defs(CLUTTER_TYPE_BOX)
<< get_defs(CLUTTER_TYPE_CAIRO_TEXTURE)
<< get_defs(CLUTTER_TYPE_CHILD_META)
<< get_defs(CLUTTER_TYPE_CLONE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]