[cluttermm/cluttermm-1.2] LayoutManager: Wrap the vfuncs.
- From: Chris Kühl <chriskuehl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cluttermm/cluttermm-1.2] LayoutManager: Wrap the vfuncs.
- Date: Thu, 3 Feb 2011 14:30:46 +0000 (UTC)
commit 6541a129e68c5e518fc6cfce8e4c239e7d68ebb5
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jan 10 22:39:20 2011 +0100
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
will cause crashes.
* 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.
ChangeLog | 13 ++++++++++
clutter/src/actor.hg | 1 -
clutter/src/clutter_vfuncs.defs | 2 +-
clutter/src/layout-manager.ccg | 1 +
clutter/src/layout-manager.hg | 49 +++++++++++++++++++++-----------------
codegen/m4/convert_clutter.m4 | 2 +-
6 files changed, 43 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9221609..66f71ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-10 Murray Cumming <murrayc murrayc com>
+
+ 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
+ will cause crashes.
+
+ * 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.
+
2011-01-10 Chris Kühl <chrisk openismus com>
Initial wrapping of ClutterLayoutMeta and ClutterLayoutManager.
diff --git a/clutter/src/actor.hg b/clutter/src/actor.hg
index 3c7330d..e79ec34 100644
--- a/clutter/src/actor.hg
+++ b/clutter/src/actor.hg
@@ -187,7 +187,6 @@ public:
_WRAP_METHOD_DOCS_ONLY(clutter_actor_get_allocation_box)
ActorBox get_allocation_box() const;
-#m4 _CONVERSION(`const ActorBox&', `const ClutterActorBox*',`($3).gobj()')
_WRAP_METHOD(void allocate(const ActorBox& box, AllocationFlags absolute_origin_changed = ALLOCATION_NONE), clutter_actor_allocate)
_WRAP_METHOD(void allocate_preferred_size(AllocationFlags absolute_origin_changed = ALLOCATION_NONE), clutter_actor_allocate_preferred_size)
diff --git a/clutter/src/clutter_vfuncs.defs b/clutter/src/clutter_vfuncs.defs
index d4943e2..8fd0009 100644
--- a/clutter/src/clutter_vfuncs.defs
+++ b/clutter/src/clutter_vfuncs.defs
@@ -92,7 +92,7 @@
(define-vfunc create_child_meta
(of-object "ClutterLayoutManager")
- (return-type "ClutterLayouMeta*")
+ (return-type "ClutterLayoutMeta*")
(parameters
'("ClutterContainer*" "container")
'("ClutterActor*" "actorallocation")
diff --git a/clutter/src/layout-manager.ccg b/clutter/src/layout-manager.ccg
index 018f83b..8506d5b 100644
--- a/clutter/src/layout-manager.ccg
+++ b/clutter/src/layout-manager.ccg
@@ -16,6 +16,7 @@
*/
#include <cluttermm/layout-manager.h>
+#include <cluttermm/layoutmeta.h>
#include <cluttermm/container.h>
namespace Clutter
diff --git a/clutter/src/layout-manager.hg b/clutter/src/layout-manager.hg
index 3aeb14b..602c34b 100644
--- a/clutter/src/layout-manager.hg
+++ b/clutter/src/layout-manager.hg
@@ -16,9 +16,11 @@
*/
#include <glibmm/object.h>
-#include <clutter/clutter.h>
#include <cluttermm/actor.h>
#include <cluttermm/alpha.h>
+#include <cluttermm/container.h>
+//#include <cluttermm/layoutmeta.h>
+#include <clutter/clutter.h> //TODO: Remove this include?
_DEFS(cluttermm,clutter)
_PINCLUDE(glibmm/private/object_p.h)
@@ -26,8 +28,7 @@ _PINCLUDE(glibmm/private/object_p.h)
namespace Clutter
{
-class Container;
-class ActorBox;
+class LayoutMeta;
class LayoutManager : public Glib::Object
{
@@ -58,25 +59,29 @@ public:
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")
+#m4 _CONVERSION(`ClutterContainer*', `const Glib::RefPtr<Container>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`float*', `float&', `*($3)')
+#m4 _CONVERSION(`float&', `float*', `&($3)')
+ _WRAP_VFUNC(void get_preferred_width(const Glib::RefPtr<Container>& container, float for_height, float& min_width_p, float& natural_width_p) const, "get_preferred_width")
+
+ _WRAP_VFUNC(void get_preferred_height(const Glib::RefPtr<Container>& container, float for_width, float& min_height_p, float& natural_height_p) const, "get_preferred_height")
+
+#m4 _CONVERSION(`const ClutterActorBox*', `const ActorBox&', `ActorBox($3)')
+ _WRAP_VFUNC(void allocate(const Glib::RefPtr<Container>& container, const ActorBox& box, AllocationFlags absolute_origin_changed), "allocate")
+
+ _WRAP_VFUNC(void set_container(const Glib::RefPtr<Container>& container), "set_container")
+ _WRAP_VFUNC(GType get_child_meta_type() const, "get_child_meta_type")
+
+#m4 _CONVERSION(`ClutterActor*', `const Glib::RefPtr<Actor>&', `Glib::wrap($3, true)')
+ _WRAP_VFUNC(Glib::RefPtr<LayoutMeta> create_child_meta(const Glib::RefPtr<Container>& container, const Glib::RefPtr<Actor>& actor), "create_child_meta")
+
+#m4 _CONVERSION(`Glib::RefPtr<Alpha>',`ClutterAlpha*',__CONVERT_REFPTR_TO_P)
+ _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
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 551ea0a..169ba01 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -10,7 +10,7 @@ _CONVERSION(`const Glib::RefPtr<const Action>&',`ClutterAction*',__CONVERT_CONST
_CONVERSION(`ClutterAction*',`Glib::RefPtr<Action>',`Glib::wrap($3)')
_CONVERSION(`ClutterAction*',`Glib::RefPtr<const Action>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<ActorBox>&',`ClutterActorBox*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const ActorBox&', `const ClutterActorBox*',`($3).gobj()')
_CONVERSION(`const Glib::RefPtr<Shader>&',`ClutterShader*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`ClutterShader*',`Glib::RefPtr<Shader>', `Glib::wrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]