[cluttermm/cluttermm-1.2] Initial wrapping of ClutterLayoutMeta and ClutterLayoutManager.
- From: Chris Kühl <chriskuehl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cluttermm/cluttermm-1.2] Initial wrapping of ClutterLayoutMeta and ClutterLayoutManager.
- Date: Thu, 3 Feb 2011 14:30:41 +0000 (UTC)
commit e2bb3f90f28fc60c0942351df40806fe6fc11d55
Author: Chris Kühl <chrisk openismus com>
Date: Mon Jan 10 13:07:46 2011 +0100
Initial wrapping of ClutterLayoutMeta and ClutterLayoutManager.
* clutter/cluttermm.h: Added header files for new classes.
* clutter/src/clutter_signals.defs: Added properties for new classes.
* clutter/src/clutter_vfuncs.defs: Added vfunc definitions for
LayoutManager.
* clutter/src/filelist.am: Added new classes to files_hg list.
* clutter/src/layout-manager.*g: Initial wrapping for
ClutterLayoutManager.
* clutter/src/layoutmeta.*g: Initial wrapping for
ClutterLayoutMeta.
* codegen/extradefs/generate_extra_defs_clutter.cc: Added new classes.
* codegen/m4/convert_clutter.m4: Added conversion for new classes.
ChangeLog | 34 +++++++
clutter/cluttermm.h | 2 +
clutter/src/clutter_signals.defs | 19 ++++
clutter/src/clutter_vfuncs.defs | 75 ++++++++++++++++
clutter/src/filelist.am | 3 +
clutter/src/layout-manager.ccg | 35 ++++++++
clutter/src/layout-manager.hg | 103 ++++++++++++++++++++++
clutter/src/layoutmeta.ccg | 28 ++++++
clutter/src/layoutmeta.hg | 41 +++++++++
codegen/extradefs/generate_extra_defs_clutter.cc | 2 +
codegen/m4/convert_clutter.m4 | 9 ++
11 files changed, 351 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f37b18c..9221609 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2011-01-10 Chris Kühl <chrisk openismus com>
+
+ Initial wrapping of ClutterLayoutMeta and ClutterLayoutManager.
+
+ * clutter/cluttermm.h: Added header files for new classes.
+ * clutter/src/clutter_signals.defs: Added properties for new classes.
+ * clutter/src/clutter_vfuncs.defs: Added vfunc definitions for
+ LayoutManager.
+ * clutter/src/filelist.am: Added new classes to files_hg list.
+ * clutter/src/layout-manager.*g: Initial wrapping for
+ ClutterLayoutManager.
+ * clutter/src/layoutmeta.*g: Initial wrapping for
+ ClutterLayoutMeta.
+ * codegen/extradefs/generate_extra_defs_clutter.cc: Added new classes.
+ * codegen/m4/convert_clutter.m4: Added conversion for new classes.
+
+2011-01-08 Murray Cumming <murrayc murrayc com>
+
+ Depend on necessary versions of atkmm and pangomm.
+
+ * configure.ac: Depend on the versions of atkmm and pangomm that provide
+ conversions in .m4 files, now that glibmm does not provide them implicitly.
+ This is only relevant when building from git, however. The older versions
+ would be OK when building from a tarball.
+
+2011-01-07 Murray Cumming <murrayc murrayc com>
+
+ Fix the build with the latest glibmm.
+
+ * configure.ac: Get and use the path to the atkmm and pangomm m4 files.
+ * codegen/m4/convert.m4: Include the atkmm and pangomm m4 convert files.
+
+ This requires the latest atkmm and pangomm.
+
2010-11-02 Murray Cumming <murrayc murrayc com>
Fix the build with clutter git master.
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index 2a61ec1..e51d7a3 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -72,6 +72,8 @@
#include <cluttermm/group.h>
#include <cluttermm/init.h>
#include <cluttermm/interval.h>
+#include <cluttermm/layout-manager.h>
+#include <cluttermm/layoutmeta.h>
#include <cluttermm/main.h>
#include <cluttermm/media.h>
#include <cluttermm/path.h>
diff --git a/clutter/src/clutter_signals.defs b/clutter/src/clutter_signals.defs
index 51c584c..28f15a2 100644
--- a/clutter/src/clutter_signals.defs
+++ b/clutter/src/clutter_signals.defs
@@ -2468,6 +2468,25 @@
(construct-only #t)
)
+;; From ClutterLayoutManager
+
+(define-signal layout-changed
+ (of-object "ClutterLayoutManager")
+ (return-type "void")
+ (when "last")
+)
+
+;; From ClutterLayoutMeta
+
+(define-property manager
+ (of-object "ClutterLayoutMeta")
+ (prop-type "GParamObject")
+ (docs "The manager that created this data")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
;; From ClutterMedia
(define-signal eos
diff --git a/clutter/src/clutter_vfuncs.defs b/clutter/src/clutter_vfuncs.defs
index 085dc50..d4943e2 100644
--- a/clutter/src/clutter_vfuncs.defs
+++ b/clutter/src/clutter_vfuncs.defs
@@ -43,6 +43,81 @@
)
)
+; ClutterLayoutManager
+
+(define-vfunc get_preferred_width
+ (of-object "ClutterLayoutManager")
+ (return-type "void")
+ (parameters
+ '("ClutterContainer*" "container")
+ '("float" "for_height")
+ '("float*" "minimum_width_p")
+ '("float*" "natural_width_p")
+ )
+)
+
+(define-vfunc get_preferred_height
+ (of-object "ClutterLayoutManager")
+ (return-type "void")
+ (parameters
+ '("ClutterContainer*" "container")
+ '("float" "for_width")
+ '("float*" "minimum_height_p")
+ '("float*" "natural_height_p")
+ )
+)
+
+(define-vfunc allocate
+ (of-object "ClutterLayoutManager")
+ (return-type "void")
+ (parameters
+ '("ClutterContainer*" "container")
+ '("const-ClutterActorBox*" "allocation")
+ '("ClutterAllocationFlags" "flags")
+ )
+)
+
+(define-vfunc set_container
+ (of-object "ClutterLayoutManager")
+ (return-type "void")
+ (parameters
+ '("ClutterContainer*" "container")
+ )
+)
+
+(define-vfunc get_child_meta_type
+ (of-object "ClutterLayoutManager")
+ (return-type "GType")
+)
+
+(define-vfunc create_child_meta
+ (of-object "ClutterLayoutManager")
+ (return-type "ClutterLayouMeta*")
+ (parameters
+ '("ClutterContainer*" "container")
+ '("ClutterActor*" "actorallocation")
+ )
+)
+
+(define-vfunc begin_animation
+ (of-object "ClutterLayoutManager")
+ (return-type "ClutterAlpha*")
+ (parameters
+ '("guint" "duration")
+ '("gulong" "mode")
+ )
+)
+
+(define-vfunc get_animation_progress
+ (of-object "ClutterLayoutManager")
+ (return-type "double")
+)
+
+(define-vfunc end_animation
+ (of-object "ClutterLayoutManager")
+ (return-type "void")
+)
+
; ClutterBox
(define-vfunc unpack_child
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index d4246ba..593185c 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -27,8 +27,11 @@ files_hg = \
clone.hg \
color.hg \
container.hg \
+ effect.hg \
group.hg \
interval.hg \
+ layoutmeta.hg \
+ layout-manager.hg \
media.hg \
path.hg \
rectangle.hg \
diff --git a/clutter/src/layout-manager.ccg b/clutter/src/layout-manager.ccg
new file mode 100644
index 0000000..018f83b
--- /dev/null
+++ b/clutter/src/layout-manager.ccg
@@ -0,0 +1,35 @@
+/* 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/layout-manager.h>
+#include <cluttermm/container.h>
+
+namespace Clutter
+{
+
+void LayoutManager::get_child_property_value(const Glib::RefPtr<Container>& container,
+ const Glib::RefPtr<const Actor>& child,
+ const Glib::ustring& property_name,
+ Glib::ValueBase& value) const
+{
+ clutter_layout_manager_child_get_property(const_cast<ClutterLayoutManager*>(gobj()),
+ const_cast<ClutterContainer*>(container->gobj()),
+ const_cast<ClutterActor*>(child->gobj()),
+ property_name.c_str(), value.gobj());
+}
+
+} // namespace Clutter
diff --git a/clutter/src/layout-manager.hg b/clutter/src/layout-manager.hg
new file mode 100644
index 0000000..3aeb14b
--- /dev/null
+++ b/clutter/src/layout-manager.hg
@@ -0,0 +1,103 @@
+/* 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 <glibmm/object.h>
+#include <clutter/clutter.h>
+#include <cluttermm/actor.h>
+#include <cluttermm/alpha.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Clutter
+{
+
+class Container;
+class ActorBox;
+
+class LayoutManager : public Glib::Object
+{
+ _CLASS_GOBJECT(LayoutManager, ClutterLayoutManager, CLUTTER_LAYOUT_MANAGER, Glib::Object, GObject)
+ _DERIVES_INITIALLY_UNOWNED()
+
+protected:
+ _CTOR_DEFAULT()
+
+public:
+
+ // not sure the valist stuff is good to wrap in C++
+ _IGNORE(clutter_layout_manager_child_get, clutter_layout_manager_child_set)
+
+ // not sure the valist stuff is good to wrap in C++
+ _IGNORE(clutter_layout_manager_child_get, clutter_layout_manager_child_set,
+ clutter_layout_manager_class_find_child_property,
+ clutter_layout_manager_class_list_child_properties)
+
+ template <class PropertyType> inline
+ void set_child_property(const Glib::RefPtr<Container>& container, const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const PropertyType& value);
+
+ _WRAP_METHOD(void set_child_property_value(const Glib::RefPtr<Container>& container, const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const Glib::ValueBase& value), clutter_layout_manager_child_set_property)
+
+ template <class PropertyType> inline
+ void get_child_property(const Glib::RefPtr<Container>& container, const Glib::RefPtr<const Actor>& actor, const Glib::ustring& property_name, PropertyType& value) const;
+
+ void get_child_property_value(const Glib::RefPtr<Container>& container, const Glib::RefPtr<const Actor>& actor, const Glib::ustring& property_name, Glib::ValueBase& value) const;
+ _IGNORE(clutter_layout_manager_child_get_property)
+
+ // FIXME: Get vfuncs working.
+ // #m4 _CONVERSION(`float*', `float&', `*($3)')
+ // #m4 _CONVERSION(`float&', `float*', `*($3)')
+ // #m4 _CONVERSION(`const ClutterActorBox*', `const ActorBox&', `Glib::wrap($3)')
+ // #m4 _CONVERSION(`const ActorBox&', `const ClutterActorBox*', `Glib::wrap($3)')
+ // #m4 _CONVERSION(`const Container&',`ClutterContainer*',`const_cast<ClutterContainer*>(($3).gobj())')
+ // #m4 _CONVERSION(`ClutterContainer*', `const Container&', `Glib::wrap($3)')
+ // _WRAP_VFUNC(void get_preferred_width(const Container& container, float for_height, float& min_width_p, float& natural_width_p) const, "get_preferred_width")
+ // _WRAP_VFUNC(void get_preferred_height(const Container& container, float for_width, float& min_height_p, float& natural_height_p) const, "get_preferred_height")
+ // _WRAP_VFUNC(void allocate(const Container& container, const ActorBox& box, AllocationFlags absolute_origin_changed), "allocate")
+ // _WRAP_VFUNC(void set_container(const Container& container), "set_container")
+ // // _WRAP_VFUNC(GType get_child_meta_type(Container& container), "get_child_meta_type")
+ // // _WRAP_VFUNC(Glib::RefPtr<LayoutMeta> create_child_meta(Container& container, const Glib::RefPtr<Actor>& actor), "create_child_meta")
+
+ // //_WRAP_VFUNC(Glib::RefPtr<Alpha> begin_animation(guint duration, gulong mode), "begin_animation")
+ // _WRAP_VFUNC(double get_animation_progress(), "get_animation_progress")
+ // _WRAP_VFUNC(void end_animation(), "end_animation")
+
+ _WRAP_SIGNAL(void layout_changed(),"layout-changed")
+};
+
+template <class PropertyType> inline
+void LayoutManager::set_child_property(const Glib::RefPtr<Container>& container, const Glib::RefPtr<Actor>& actor, const Glib::ustring& property_name, const PropertyType& value)
+{
+ Glib::Value<PropertyType> property_value;
+ property_value.init(Glib::Value<PropertyType>::value_type());
+
+ property_value.set(value);
+ this->set_child_property_value(container, actor, property_name, property_value);
+}
+
+template <class PropertyType> inline
+void LayoutManager::get_child_property(const Glib::RefPtr<Container>& container, const Glib::RefPtr<const Actor>& actor, const Glib::ustring& property_name, PropertyType& value) const
+{
+ Glib::Value<PropertyType> property_value;
+ property_value.init(Glib::Value<PropertyType>::value_type());
+
+ this->get_child_property_value(container, actor, property_name, property_value);
+
+ value = property_value.get();
+}
+
+} // namespace Clutter
diff --git a/clutter/src/layoutmeta.ccg b/clutter/src/layoutmeta.ccg
new file mode 100644
index 0000000..03fb3ef
--- /dev/null
+++ b/clutter/src/layoutmeta.ccg
@@ -0,0 +1,28 @@
+/*
+ * 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 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <cluttermm/layout-manager.h>
+
+namespace Clutter
+{
+
+LayoutMeta::LayoutMeta(const Glib::RefPtr<LayoutManager>& manager)
+:
+ _CONSTRUCT("manager", Glib::unwrap(manager))
+{}
+
+} // namespace Clutter
diff --git a/clutter/src/layoutmeta.hg b/clutter/src/layoutmeta.hg
new file mode 100644
index 0000000..6df1698
--- /dev/null
+++ b/clutter/src/layoutmeta.hg
@@ -0,0 +1,41 @@
+/* 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/childmeta.h>
+#include <cluttermm/layout-manager.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(cluttermm/private/childmeta_p.h)
+
+namespace Clutter{
+
+ //class LayoutManager;
+
+class LayoutMeta : public ChildMeta
+{
+ _CLASS_GOBJECT(LayoutMeta, ClutterLayoutMeta, CLUTTER_LAYOUT_META, ChildMeta, ClutterChildMeta)
+protected:
+ LayoutMeta(const Glib::RefPtr<LayoutManager>& layoutManager);
+
+public:
+ _WRAP_METHOD(Glib::RefPtr<LayoutManager> get_manager(), clutter_layout_meta_get_manager, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const LayoutManager> get_manager() const, clutter_layout_meta_get_manager, refreturn, constversion)
+
+ _WRAP_PROPERTY("manager", Glib::RefPtr<LayoutManager>)
+};
+
+} // namespace Clutter
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc b/codegen/extradefs/generate_extra_defs_clutter.cc
index 423198d..9a778a3 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -48,6 +48,8 @@ int main(int argc, char** argv)
<< get_defs(CLUTTER_TYPE_INTERVAL)
// << get_defs(CLUTTER_TYPE_HBOX)
// << get_defs(CLUTTER_TYPE_LAYOUT)
+ << get_defs(CLUTTER_TYPE_LAYOUT_MANAGER)
+ << get_defs(CLUTTER_TYPE_LAYOUT_META)
<< get_defs(CLUTTER_TYPE_MEDIA)
<< get_defs(CLUTTER_TYPE_PATH)
<< get_defs(CLUTTER_TYPE_RECTANGLE)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index c8fc9a5..551ea0a 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -41,6 +41,15 @@ _CONVERSION(`const Glib::RefPtr<Interval>&',`ClutterInterval*',__CONVERT_REFPTR_
_CONVERSION(`ClutterInterval*',`Glib::RefPtr<Interval>',`Glib::wrap($3)')
_CONVERSION(`ClutterInterval*',`Glib::RefPtr<const Interval>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<LayoutManager>&',`ClutterLayoutManager*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterLayoutManager*',`Glib::RefPtr<LayoutManager>',`Glib::wrap($3)')
+_CONVERSION(`ClutterLayoutManager*',`Glib::RefPtr<const LayoutManager>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<LayoutMeta>&',`ClutterLayoutMeta*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`Glib::RefPtr<LayoutMeta>',`ClutterLayoutMeta*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterLayoutMeta*',`Glib::RefPtr<LayoutMeta>',`Glib::wrap($3)')
+_CONVERSION(`ClutterLayoutMeta*',`Glib::RefPtr<const LayoutMeta>',`Glib::wrap($3)')
+
_CONVERSION(`const Glib::RefPtr<Texture>&',`ClutterTexture*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`ClutterTexture*',`Glib::RefPtr<Texture>',`Glib::wrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]