[clutter-box2dmm: 1/10] Exposed collision signal of children of the Clutter::Box2D * clutter-box2d/src/box2d.hg: added def
- From: Aidan Delaney <adelaney src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-box2dmm: 1/10] Exposed collision signal of children of the Clutter::Box2D * clutter-box2d/src/box2d.hg: added def
- Date: Sun, 11 Mar 2012 22:06:50 +0000 (UTC)
commit 70a1919410774e50fb39971193d729f6d45c3afc
Author: Aidan Delaney <aidan phoric eu>
Date: Fri Mar 2 21:03:18 2012 +0000
Exposed collision signal of children of the Clutter::Box2D
* clutter-box2d/src/box2d.hg: added definitions for Clutter::Box2D::Box2DChild and Clutter::Box2D::Box2DCollision
* clutter-box2d/src/clutter-box2d_*.defs: updated for clutter-box2d 0.12
* codegen/m4/*.m4: removed all but the necessary definitions and added convert_clutter.m4 as some distros do not ship this in their dev packages.
* configure.ac: added the cluttermm m4 definitions
* examples/main.cc: added an example collision callback to show things are working
clutter-box2d/src/box2d.hg | 40 +++-
clutter-box2d/src/clutter-box2d_methods.defs | 233 +++++++++++++++
clutter-box2d/src/clutter-box2d_signals.defs | 298 ++++----------------
.../extradefs/generate_extra_defs_clutter_box2d.cc | 2 +
codegen/m4/convert.m4 | 2 +
codegen/m4/convert_clutter-box2dmm.m4 | 84 +-----
codegen/m4/convert_clutter.m4 | 159 +++++++++++
configure.ac | 1 +
examples/slides/main.cc | 10 +-
9 files changed, 513 insertions(+), 316 deletions(-)
---
diff --git a/clutter-box2d/src/box2d.hg b/clutter-box2d/src/box2d.hg
index b2fb6bb..26c74c3 100644
--- a/clutter-box2d/src/box2d.hg
+++ b/clutter-box2d/src/box2d.hg
@@ -15,12 +15,15 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <cluttermm/group.h>
-#include <cluttermm/types.h> //For Clutter::Vertex.
-#include <clutter-box2d/clutter-box2d-joint.h>
+#include <cluttermm.h>
+#include <cluttermm/childmeta.h>
+#include <clutter-box2d.h>
+#include <clutter-box2d-child.h>
+#include <clutter-box2d-collision.h>
_DEFS(clutter-box2dmm,clutter-box2d)
_PINCLUDE(cluttermm/private/group_p.h)
+_PINCLUDE(cluttermm/private/childmeta_p.h)
namespace Clutter
{
@@ -30,6 +33,32 @@ namespace Box2D
_WRAP_ENUM(Type, ClutterBox2DType, NO_GTYPE)
+class Box2DCollision:
+ public Glib::Object
+{
+ _CLASS_GOBJECT(Box2DCollision, ClutterBox2DCollision, CLUTTER_BOX2D_COLLISION, Glib::Object, GObject)
+
+protected:
+ _CTOR_DEFAULT
+
+public:
+ _WRAP_CREATE()
+};
+
+class Box2DChild :
+ public Clutter::ChildMeta
+{
+ _CLASS_GOBJECT(Box2DChild, ClutterBox2DChild, CLUTTER_BOX2D_CHILD, Clutter::ChildMeta, ClutterChildMeta)
+
+protected:
+ _CTOR_DEFAULT
+
+public:
+ _WRAP_CREATE()
+ _WRAP_SIGNAL(void collision(const Glib::RefPtr<Clutter::Box2D::Box2DCollision> & c), "collision", no_default_handler)
+};
+
+
/** This is a container that can physically simulate collisions between dynamic and static actors.
* Use set_child_property() on the child actors.
*/
@@ -45,6 +74,11 @@ protected:
public:
_WRAP_CREATE()
+// The clutter_box2d_get_child method is in
+// #include "clutter-box2d-private.h"
+// and, therefore, cannot be wrapped.
+// _WRAP_METHOD(const Glib::RefPtr<Clutter::Box2D::Box2DChild>& get_child(const Glib::RefPtr<Clutter::Actor>& actor), clutter_box2d_get_child)
+
_WRAP_METHOD(void set_simulating(gboolean simulating = true), clutter_box2d_set_simulating)
// TODO: similar compile problem to below _WRAP_METHOD(gboolean get_simulating() const, clutter_box2d_get_simulating)
diff --git a/clutter-box2d/src/clutter-box2d_methods.defs b/clutter-box2d/src/clutter-box2d_methods.defs
index c201fc4..8988041 100644
--- a/clutter-box2d/src/clutter-box2d_methods.defs
+++ b/clutter-box2d/src/clutter-box2d_methods.defs
@@ -168,3 +168,236 @@
)
+;; From clutter-box2d-private.h
+
+(define-method get_child
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_get_child")
+ (return-type "ClutterBox2DChild*")
+ (parameters
+ '("ClutterActor*" "actor")
+ )
+)
+;; -*- scheme -*-
+; object definitions ...
+(define-object ChildMeta
+ (in-module "Clutter")
+ (parent "GObject")
+ (c-name "ClutterChildMeta")
+ (gtype-id "CLUTTER_TYPE_CHILD_META")
+)
+
+;; Enumerations and flags ...
+;; -*- scheme -*-
+; object definitions ...
+(define-object Box2DChild
+ (in-module "Clutter")
+ (parent "ClutterChildMeta")
+ (c-name "ClutterBox2DChild")
+ (gtype-id "CLUTTER_TYPE_BOX2_DCHILD")
+)
+
+;; Enumerations and flags ...
+
+
+;; From clutter-box2d-child.h
+
+(define-function clutter_box2d_child_get_type
+ (c-name "clutter_box2d_child_get_type")
+ (return-type "GType")
+)
+
+(define-method child_set_is_bullet
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_is_bullet")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gboolean" "is_bullet")
+ )
+)
+
+(define-method child_get_is_bullet
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_is_bullet")
+ (return-type "gboolean")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_is_circle
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_is_circle")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gboolean" "is_circle")
+ )
+)
+
+(define-method child_get_is_circle
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_is_circle")
+ (return-type "gboolean")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_outline
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_outline")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("const-ClutterVertex*" "outline")
+ '("guint" "n_vertices")
+ )
+)
+
+(define-method child_get_outline
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_outline")
+ (return-type "const-ClutterVertex*")
+ (parameters
+ '("ClutterActor*" "child")
+ '("guint*" "n_vertices")
+ )
+)
+
+(define-method child_set_density
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_density")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gfloat" "density")
+ )
+)
+
+(define-method child_get_density
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_density")
+ (return-type "gfloat")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_friction
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_friction")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gfloat" "friction")
+ )
+)
+
+(define-method child_get_friction
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_friction")
+ (return-type "gfloat")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_restitution
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_restitution")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gfloat" "restitution")
+ )
+)
+
+(define-method child_get_restitution
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_restitution")
+ (return-type "gfloat")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_linear_velocity
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_linear_velocity")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("const-ClutterVertex*" "velocity")
+ )
+)
+
+(define-method child_get_linear_velocity
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_linear_velocity")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("ClutterVertex*" "velocity")
+ )
+)
+
+(define-method child_set_angular_velocity
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_angular_velocity")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gfloat" "velocity")
+ )
+)
+
+(define-method child_get_angular_velocity
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_angular_velocity")
+ (return-type "gfloat")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_mode
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_mode")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("ClutterBox2DType" "mode")
+ )
+)
+
+(define-method child_get_mode
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_mode")
+ (return-type "ClutterBox2DType")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+(define-method child_set_manipulatable
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_set_manipulatable")
+ (return-type "none")
+ (parameters
+ '("ClutterActor*" "child")
+ '("gboolean" "manipulatable")
+ )
+)
+
+(define-method child_get_manipulatable
+ (of-object "ClutterBox2D")
+ (c-name "clutter_box2d_child_get_manipulatable")
+ (return-type "gboolean")
+ (parameters
+ '("ClutterActor*" "child")
+ )
+)
+
+
diff --git a/clutter-box2d/src/clutter-box2d_signals.defs b/clutter-box2d/src/clutter-box2d_signals.defs
index da19ea9..5978ab4 100644
--- a/clutter-box2d/src/clutter-box2d_signals.defs
+++ b/clutter-box2d/src/clutter-box2d_signals.defs
@@ -1,333 +1,157 @@
;; From ClutterBox2D
-(define-property name
- (of-object "ClutterBox2D")
- (prop-type "GParamString")
- (docs "Name of the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property x
- (of-object "ClutterBox2D")
- (prop-type "GParamInt")
- (docs "X coordinate of the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property y
- (of-object "ClutterBox2D")
- (prop-type "GParamInt")
- (docs "Y coordinate of the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property width
- (of-object "ClutterBox2D")
- (prop-type "GParamInt")
- (docs "Width of the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property height
- (of-object "ClutterBox2D")
- (prop-type "GParamInt")
- (docs "Height of the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property fixed-x
- (of-object "ClutterBox2D")
- (prop-type "ClutterParamSpecUnit")
- (docs "Forced X position of the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property fixed-y
+(define-property gravity
(of-object "ClutterBox2D")
- (prop-type "ClutterParamSpecUnit")
- (docs "Forced Y position of the actor")
+ (prop-type "GParamBoxed")
+ (docs "The gravity of ")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property fixed-position-set
+(define-property simulating
(of-object "ClutterBox2D")
(prop-type "GParamBoolean")
- (docs "Whether to use fixed positioning for the actor")
+ (docs "Whether ClutterBox2D is performing physical simulation or not.")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property min-width
+(define-property scale-factor
(of-object "ClutterBox2D")
- (prop-type "ClutterParamSpecUnit")
- (docs "Forced minimum width request for the actor")
+ (prop-type "GParamFloat")
+ (docs "The scaling factor of pixels to world units")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property min-width-set
+(define-property time-step
(of-object "ClutterBox2D")
- (prop-type "GParamBoolean")
- (docs "Whether to use the min-width property")
+ (prop-type "GParamFloat")
+ (docs "The amount of time simulated in a physics step, in milliseconds")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property min-height
+(define-property iterations
(of-object "ClutterBox2D")
- (prop-type "ClutterParamSpecUnit")
- (docs "Forced minimum height request for the actor")
+ (prop-type "GParamFloat")
+ (docs "The amount of iterations in a physics step")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property min-height-set
+(define-property simulate-inactive
(of-object "ClutterBox2D")
(prop-type "GParamBoolean")
- (docs "Whether to use the min-height property")
+ (docs "Whether to simulate inactive bodies")
(readable #t)
(writable #t)
- (construct-only #f)
+ (construct-only #t)
)
-(define-property natural-width
- (of-object "ClutterBox2D")
- (prop-type "ClutterParamSpecUnit")
- (docs "Forced natural width request for the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
+;; From ClutterBox2DCollision
-(define-property natural-width-set
- (of-object "ClutterBox2D")
- (prop-type "GParamBoolean")
- (docs "Whether to use the natural-width property")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
+;; From ClutterBox2DChild
-(define-property natural-height
- (of-object "ClutterBox2D")
- (prop-type "ClutterParamSpecUnit")
- (docs "Forced natural height request for the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
+(define-signal collision
+ (of-object "ClutterBox2DChild")
+ (return-type "void")
+ (when "last")
+ (parameters
+ '("ClutterBox2DCollision*" "p0")
+ )
)
-(define-property natural-height-set
- (of-object "ClutterBox2D")
+(define-property is-bullet
+ (of-object "ClutterBox2DChild")
(prop-type "GParamBoolean")
- (docs "Whether to use the natural-height property")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property request-mode
- (of-object "ClutterBox2D")
- (prop-type "GParamEnum")
- (docs "The actor's request mode")
+ (docs "Whether this object is a bullet (fast moving object that should not be allowed tunneling through other dynamic objects.)")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property allocation
- (of-object "ClutterBox2D")
- (prop-type "GParamBoxed")
- (docs "The actor's allocation")
- (readable #t)
- (writable #f)
- (construct-only #f)
-)
-
-(define-property depth
- (of-object "ClutterBox2D")
- (prop-type "GParamInt")
- (docs "Depth of actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property clip
- (of-object "ClutterBox2D")
- (prop-type "GParamBoxed")
- (docs "The clip region for the actor")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property has-clip
- (of-object "ClutterBox2D")
+(define-property is-circle
+ (of-object "ClutterBox2DChild")
(prop-type "GParamBoolean")
- (docs "Whether the actor has a clip set or not")
- (readable #t)
- (writable #f)
- (construct-only #f)
-)
-
-(define-property opacity
- (of-object "ClutterBox2D")
- (prop-type "GParamUChar")
- (docs "Opacity of actor")
+ (docs "Whether this object is a circle instead of a rectangle.")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property visible
- (of-object "ClutterBox2D")
- (prop-type "GParamBoolean")
- (docs "Whether the actor is visible or not")
+(define-property outline
+ (of-object "ClutterBox2DChild")
+ (prop-type "GParamValueArray")
+ (docs "ClutterVertex array describing the outline of the shape.")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property reactive
- (of-object "ClutterBox2D")
- (prop-type "GParamBoolean")
- (docs "Whether the actor is reactive to events or not")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property scale-x
- (of-object "ClutterBox2D")
- (prop-type "GParamDouble")
- (docs "Scale factor on the X axis")
+(define-property density
+ (of-object "ClutterBox2DChild")
+ (prop-type "GParamFloat")
+ (docs "Density")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property scale-y
- (of-object "ClutterBox2D")
- (prop-type "GParamDouble")
- (docs "Scale factor on the Y axis")
+(define-property friction
+ (of-object "ClutterBox2DChild")
+ (prop-type "GParamFloat")
+ (docs "Friction")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property rotation-angle-x
- (of-object "ClutterBox2D")
- (prop-type "GParamDouble")
- (docs "The rotation angle on the X axis")
+(define-property restitution
+ (of-object "ClutterBox2DChild")
+ (prop-type "GParamFloat")
+ (docs "Restitution")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property rotation-angle-y
- (of-object "ClutterBox2D")
- (prop-type "GParamDouble")
- (docs "The rotation angle on the Y axis")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property rotation-angle-z
- (of-object "ClutterBox2D")
- (prop-type "GParamDouble")
- (docs "The rotation angle on the Z axis")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property rotation-center-x
- (of-object "ClutterBox2D")
- (prop-type "GParamBoxed")
- (docs "The rotation center on the X axis")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property rotation-center-y
- (of-object "ClutterBox2D")
+(define-property linear-velocity
+ (of-object "ClutterBox2DChild")
(prop-type "GParamBoxed")
- (docs "The rotation center on the Y axis")
+ (docs "Linear velocity")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property rotation-center-z
- (of-object "ClutterBox2D")
- (prop-type "GParamBoxed")
- (docs "The rotation center on the Z axis")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property anchor-x
- (of-object "ClutterBox2D")
- (prop-type "GParamInt")
- (docs "X coordinate of the anchor point")
+(define-property angular-velocity
+ (of-object "ClutterBox2DChild")
+ (prop-type "GParamFloat")
+ (docs "Angular velocity")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property anchor-y
- (of-object "ClutterBox2D")
+(define-property mode
+ (of-object "ClutterBox2DChild")
(prop-type "GParamInt")
- (docs "Y coordinate of the anchor point")
+ (docs "The mode of the actor (none, static or dynamic)")
(readable #t)
(writable #t)
(construct-only #f)
)
-(define-property show-on-set-parent
- (of-object "ClutterBox2D")
+(define-property manipulatable
+ (of-object "ClutterBox2DChild")
(prop-type "GParamBoolean")
- (docs "Whether the actor is shown when parented")
- (readable #t)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property gravity
- (of-object "ClutterBox2D")
- (prop-type "GParamBoxed")
- (docs "The gravity of ")
- (readable #f)
- (writable #t)
- (construct-only #f)
-)
-
-(define-property simulating
- (of-object "ClutterBox2D")
- (prop-type "GParamBoolean")
- (docs "Whether ClutterBox2D is performing physical simulation or not.")
+ (docs "Whether the user is able to interact (using a pointer device) with this actor or not.)")
(readable #t)
(writable #t)
(construct-only #f)
diff --git a/codegen/extradefs/generate_extra_defs_clutter_box2d.cc b/codegen/extradefs/generate_extra_defs_clutter_box2d.cc
index 2a2dda2..c4021bf 100644
--- a/codegen/extradefs/generate_extra_defs_clutter_box2d.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter_box2d.cc
@@ -27,6 +27,8 @@ int main (int argc, char *argv[])
std::cout
<< get_defs(CLUTTER_TYPE_BOX2D)
+ << get_defs(CLUTTER_TYPE_BOX2D_COLLISION)
+ << get_defs(CLUTTER_TYPE_BOX2D_CHILD)
;
return 0;
diff --git a/codegen/m4/convert.m4 b/codegen/m4/convert.m4
index 55c4d3a..6185cb5 100644
--- a/codegen/m4/convert.m4
+++ b/codegen/m4/convert.m4
@@ -2,4 +2,6 @@ dnl $Id: convert.m4,v 1.1 2002/04/14 14:53:01 murrayc Exp $
# Override of the file of the same name in gtkmm.
+include(convert_base.m4)
+include(convert_clutter.m4)
include(convert_clutter-box2dmm.m4)
diff --git a/codegen/m4/convert_clutter-box2dmm.m4 b/codegen/m4/convert_clutter-box2dmm.m4
index e347dfe..6d652ce 100644
--- a/codegen/m4/convert_clutter-box2dmm.m4
+++ b/codegen/m4/convert_clutter-box2dmm.m4
@@ -1,76 +1,10 @@
-_CONVERSION(`const Glib::RefPtr<Actor>&',`ClutterActor*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`const Glib::RefPtr<ActorBox>&',`ClutterActorBox*',__CONVERT_REFPTR_TO_P)
-
-_CONVERSION(`ClutterActor*',`Glib::RefPtr<Actor>',`Glib::wrap($3)')
-_CONVERSION(`ClutterActor*',`Glib::RefPtr<const Actor>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<Clutter::Actor>&',`ClutterActor*',__CONVERT_REFPTR_TO_P)
-
-_CONVERSION(`const Glib::RefPtr<Shader>&',`ClutterShader*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`ClutterShader*',`Glib::RefPtr<Shader>', `Glib::wrap($3)')
-_CONVERSION(`ClutterShader*',`Glib::RefPtr<const Shader>', `Glib::wrap($3)')
-
-_CONVERSION(`const Glib::RefPtr<Timeline>&',`ClutterTimeline*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`ClutterTimeline*',`Glib::RefPtr<Timeline>',`Glib::wrap($3)')
-_CONVERSION(`ClutterTimeline*',`Glib::RefPtr<const Timeline>',`Glib::wrap($3)')
-
-_CONVERSION(`const Glib::RefPtr<Alpha>&',`ClutterAlpha*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`ClutterAlpha*',`Glib::RefPtr<Alpha>',`Glib::wrap($3)')
-_CONVERSION(`ClutterAlpha*',`Glib::RefPtr<const Alpha>',`Glib::wrap($3)')
-#_CONVERSION(`ClutterBehaviourBspline*',`const Glib::RefPtr<const BehaviourBspline>&',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<const BehaviourBspline>&',`ClutterBehaviourBspline*',const_cast<ClutterBehaviourBspline*>(__CONVERT_REFPTR_TO_P))
-
-_CONVERSION(`const Glib::RefPtr<Texture>&',`ClutterTexture*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`ClutterTexture*',`Glib::RefPtr<Texture>',`Glib::wrap($3)')
-
-_CONVERSION(`const Color&',`const ClutterColor*',`($3).gobj()')
-_CONVERSION(`const Margin&',`const ClutterMargin*',`($3).gobj()')
-
-_CONVERSION(`ClutterUnit&',`ClutterUnit*',`&($3)')
-_CONVERSION(`ClutterUnit*',`ClutterUnit&',`*($3)')
-_CONVERSION(`Knot&',`ClutterKnot*',`($3).gobj()')
-_CONVERSION(`const Knot&',`ClutterKnot*',`const_cast<ClutterKnot*>(($3).gobj())')
-_CONVERSION(`const Knot&',`const ClutterKnot*',`($3).gobj()')
-_CONVERSION(`ClutterKnot*',`const Knot&',`Knot($3)')
-_CONVERSION(`const ClutterKnot*',`const Knot&',`Knot($3)')
-_CONVERSION(`Padding&',`ClutterPadding*',`&($3)')
-_CONVERSION(`const Padding&',`const ClutterPadding*',`&($3)')
-_CONVERSION(`ClutterPadding*',`Padding&',`*($3)')
-
-_CONVERSION(`guint8&',`guint8*',`&($3)')
-_CONVERSION(`guint8*',`guint8&',`*($3)')
-_CONVERSION(`ClutterFixed&',`ClutterFixed*',`&($3)')
-_CONVERSION(`ClutterFixed*',`ClutterFixed&',`*($3)')
-
-_EQUAL(ClutterUnit,Unit)
-_CONVERSION(`Unit&',`ClutterUnit*',`&($3)')
-
-_EQUAL(ClutterFixed,Fixed)
-_CONVERSION(`Fixed&',`ClutterFixed*',`&($3)')
-_EQUAL(ClutterAngle,Angle)
-_CONVERSION(`Angle&',`ClutterAngle*',`&($3)')
-_EQUAL(ClutterFog,Fog)
-_CONVERSION(`Fog&',`ClutterFog*',`&($3)')
-
-_EQUAL(ClutterEvent*,Event*)
-_EQUAL(ClutterButtonEvent*,ButtonEvent*)
-_EQUAL(ClutterMotionEvent*,MotionEvent*)
-_EQUAL(ClutterKeyEvent*,KeyEvent*)
-_EQUAL(ClutterScrollEvent*,ScrollEvent*)
-_EQUAL(ClutterCrossingEvent*,CrossingEvent*)
-
-_CONV_ENUM(Clutter,LayoutFlags)
-_CONV_ENUM(Clutter,PackType)
-_CONV_ENUM(Clutter,TextureFlags)
-_CONV_ENUM(Clutter,RotateDirection)
-_CONV_ENUM(Clutter,RotateAxis)
-_CONV_ENUM(Clutter,Gravity)
-_CONV_ENUM(Clutter,TimelineDirection)
-_CONV_ENUM(Clutter,TextureQuality)
-_CONV_ENUM(Pango,EllipsizeMode)
-_CONV_ENUM(Pango,WrapMode)
-
-_CONVERSION(`const gchar*', `const Glib::ustring&',__GCHARP_TO_USTRING)
-
-_CONVERSION(`const Clutter::Vertex&', `const ClutterVertex*', `($3).gobj()')
-
+_CONVERSION(`const Glib::RefPtr<Box2DChild>&',`ClutterBox2DChild*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterBox2DChild*',`Glib::RefPtr<Box2DChild>',`Glib::wrap($3)')
+_CONVERSION(`ClutterBox2DChild*',`Glib::RefPtr<const Box2DChild>',`Glib::wrap($3)')
+_CONVERSION(`ClutterBox2DChild*',`const Glib::RefPtr<Clutter::Box2D::Box2DChild>&',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Clutter::Box2D::Box2DChild>&',`ClutterBox2DChild*',__CONVERT_REFPTR_TO_P)
+
+_CONVERSION(`const Glib::RefPtr<Box2DCollision>&',`ClutterBox2DCollision*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterBox2DCollision*',`Glib::RefPtr<Box2DCollision>',`Glib::wrap($3)')
+_CONVERSION(`ClutterBox2DCollision*',`const Glib::RefPtr<Clutter::Box2D::Box2DCollision>&',`Glib::wrap($3)')
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
new file mode 100644
index 0000000..1cc5f28
--- /dev/null
+++ b/codegen/m4/convert_clutter.m4
@@ -0,0 +1,159 @@
+_CONVERSION(`const Glib::RefPtr<Actor>&',`ClutterActor*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const Actor>&',`ClutterActor*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Clutter::Actor>&',`ClutterActor*',__CONVERT_CONST_REFPTR_TO_P)
+
+_CONVERSION(`ClutterActor*',`Glib::RefPtr<Actor>',`Glib::wrap($3)')
+_CONVERSION(`ClutterActor*',`Glib::RefPtr<const Actor>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Action>&',`ClutterAction*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const Action>&',`ClutterAction*',__CONVERT_CONST_REFPTR_TO_P)
+
+_CONVERSION(`ClutterAction*',`Glib::RefPtr<Action>',`Glib::wrap($3)')
+_CONVERSION(`ClutterAction*',`Glib::RefPtr<const Action>',`Glib::wrap($3)')
+
+_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)')
+_CONVERSION(`ClutterShader*',`Glib::RefPtr<const Shader>', `Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Timeline>&',`ClutterTimeline*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterTimeline*',`Glib::RefPtr<Timeline>',`Glib::wrap($3)')
+_CONVERSION(`ClutterTimeline*',`Glib::RefPtr<const Timeline>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Alpha>&',`ClutterAlpha*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterAlpha*',`Glib::RefPtr<Alpha>',`Glib::wrap($3)')
+_CONVERSION(`ClutterAlpha*',`Glib::RefPtr<const Alpha>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Animation>&',`ClutterAnimation*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterAnimation*',`Glib::RefPtr<Animation>',`Glib::wrap($3)')
+_CONVERSION(`ClutterAnimation*',`Glib::RefPtr<const Animation>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Animator>&',`ClutterAnimator*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterAnimator*',`Glib::RefPtr<Animator>',`Glib::wrap($3)')
+_CONVERSION(`ClutterAnimator*',`Glib::RefPtr<const Animator>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Backend>&',`ClutterBackend*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterBackend*',`Glib::RefPtr<Backend>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<InputDevice>&',`ClutterInputDevice*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterInputDevice*',`Glib::RefPtr<InputDevice>',`Glib::wrap($3)')
+_CONVERSION(`ClutterInputDevice*',`Glib::RefPtr<const InputDevice>',`Glib::wrap($3)')
+_CONVERSION(`ClutterInputDevice*',`const Glib::RefPtr<InputDevice>&', `Glib::wrap(($3),true)')
+
+_CONVERSION(`ClutterDeviceManager*',`Glib::RefPtr<DeviceManager>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Effect>&',`ClutterEffect*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const Effect>&',`ClutterEffect*',__CONVERT_CONST_REFPTR_TO_P)
+
+_CONVERSION(`ClutterEffect*',`Glib::RefPtr<Effect>',`Glib::wrap($3)')
+_CONVERSION(`ClutterEffect*',`Glib::RefPtr<const Effect>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Interval>&',`ClutterInterval*',__CONVERT_REFPTR_TO_P)
+_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)')
+
+_CONVERSION(`const Glib::RefPtr<Path>&',`ClutterPath*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterPath*',`Glib::RefPtr<Path>',`Glib::wrap($3)')
+_CONVERSION(`ClutterPath*',`Glib::RefPtr<const Path>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<Container>&',`ClutterContainer*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterContainer*',`Glib::RefPtr<Container>',`Glib::wrap($3)')
+_CONVERSION(`ClutterContainer*',`Glib::RefPtr<const Container>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<ChildMeta>&',`ClutterChildMeta*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`Glib::RefPtr<ChildMeta>',`ClutterChildMeta*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterChildMeta*',`Glib::RefPtr<ChildMeta>',`Glib::wrap($3)')
+_CONVERSION(`ClutterChildMeta*',`Glib::RefPtr<const ChildMeta>',`Glib::wrap($3)')
+
+_CONVERSION(`Color&',`ClutterColor*',`($3).gobj()')
+_CONVERSION(`const Color&',`const ClutterColor*',`($3).gobj()')
+_CONVERSION(`const Margin&',`const ClutterMargin*',`($3).gobj()')
+
+_CONVERSION(`ClutterStage*',`Glib::RefPtr<Stage>',`Glib::wrap($3)')
+
+_CONVERSION(`ClutterUnit&',`ClutterUnit*',`&($3)')
+_CONVERSION(`ClutterUnit*',`ClutterUnit&',`*($3)')
+_CONVERSION(`Knot&',`ClutterKnot*',`($3).gobj()')
+_CONVERSION(`const Knot&',`ClutterKnot*',`const_cast<ClutterKnot*>(($3).gobj())')
+_CONVERSION(`const Knot&',`const ClutterKnot*',`($3).gobj()')
+_CONVERSION(`ClutterKnot*',`const Knot&',`Knot($3)')
+_CONVERSION(`const ClutterKnot*',`const Knot&',`Knot($3)')
+
+_CONVERSION(`Vertex&',`ClutterVertex*',`($3).gobj()')
+_CONVERSION(`const Vertex&',`const ClutterVertex*',`($3).gobj()')
+_CONVERSION(`const ClutterVertex*',`const Vertex&',`Vertex($3)')
+
+_CONVERSION(`Padding&',`ClutterPadding*',`&($3)')
+_CONVERSION(`const Padding&',`const ClutterPadding*',`&($3)')
+_CONVERSION(`ClutterPadding*',`Padding&',`*($3)')
+
+_CONVERSION(`Geometry&',`Clutter::Geometry*',`($3).gobj()')
+_CONVERSION(`const Geometry&',`ClutterGeometry*',`const_cast<ClutterGeometry*>(($3).gobj())')
+_CONVERSION(`const Geometry&',`const ClutterGeometry*',`($3).gobj()')
+_CONVERSION(`ClutterGeometry*',`const Geometry&',`Geometry($3)')
+_CONVERSION(`const ClutterGeometry*',`const Geometry&',`Geometry($3)')
+
+_EQUAL(`guint8',`guchar')
+_EQUAL(`guint8*',`guchar*')
+_EQUAL(`const guint8*',`const guchar*')
+
+_CONVERSION(`guint8&',`guint8*',`&($3)')
+_CONVERSION(`guint8*',`guint8&',`*($3)')
+
+_EQUAL(ClutterUnit,Unit)
+_CONVERSION(`Unit&',`ClutterUnit*',`&($3)')
+
+_EQUAL(ClutterAngle,Angle)
+_CONVERSION(`Angle&',`ClutterAngle*',`&($3)')
+_EQUAL(ClutterFog,Fog)
+_CONVERSION(`Fog&',`ClutterFog*',`&($3)')
+
+_EQUAL(ClutterButtonEvent*,ButtonEvent*)
+_EQUAL(ClutterCrossingEvent*,CrossingEvent*)
+_EQUAL(ClutterEvent*,Event*)
+_EQUAL(ClutterKeyEvent*,KeyEvent*)
+_EQUAL(ClutterMotionEvent*,MotionEvent*)
+_EQUAL(ClutterScrollEvent*,ScrollEvent*)
+
+_CONV_ENUM(Clutter,ActorFlags)
+_CONV_ENUM(Clutter,AllocationFlags)
+_CONV_ENUM(Clutter,AnimationMode)
+_CONV_ENUM(Clutter,BinAlignment)
+_CONV_ENUM(Clutter,BoxAlignment)
+_CONV_ENUM(Clutter,FlowOrientation)
+_CONV_ENUM(Clutter,Gravity)
+_CONV_ENUM(Clutter,InputDeviceType)
+_CONV_ENUM(Clutter,Interpolation)
+_CONV_ENUM(Clutter,LayoutFlags)
+_CONV_ENUM(Clutter,PackType)
+_CONV_ENUM(Clutter,PickMode)
+_CONV_ENUM(Clutter,RequestMode)
+_CONV_ENUM(Clutter,RotateAxis)
+_CONV_ENUM(Clutter,RotateDirection)
+_CONV_ENUM(Clutter,TextDirection)
+_CONV_ENUM(Clutter,TextureFlags)
+_CONV_ENUM(Clutter,TextureQuality)
+_CONV_ENUM(Clutter,TimelineDirection)
+_CONV_ENUM(Pango,EllipsizeMode)
+_CONV_ENUM(Pango,WrapMode)
+
+_CONVERSION(`guint32', `ActorFlags', `static_cast<ActorFlags>($3)')
+_CONVERSION(`const gchar*', `const Glib::ustring&',__GCHARP_TO_USTRING)
+
+_CONVERSION(`BinAlignment&',`ClutterBinAlignment*',`(($2) &($3))')
+_CONVERSION(`BoxAlignment&',`ClutterBoxAlignment*',`(($2) &($3))')
+
+_CONVERSION(`PangoContext*',`Glib::RefPtr<const Pango::Context>',Glib::wrap($3))
diff --git a/configure.ac b/configure.ac
index 3d544d4..426d00a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,6 +44,7 @@ AC_PROG_LIBTOOL
AC_SUBST([CLUTTER_BOX2DMM_MODULES], ['clutter-box2d-0.12 >= 0.12.0 cluttermm-1.0 >= 1.0.0'])
PKG_CHECK_MODULES([CLUTTER_BOX2DMM], [$CLUTTER_BOX2DMM_MODULES])
MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.4])
+MM_PKG_CONFIG_SUBST([GMMPROC_EXTRA_M4_DIR], [--variable=gmmprocm4dir pangomm-1.4 atkmm-1.6 cluttermm-1.0])
MM_ARG_ENABLE_DOCUMENTATION
MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
diff --git a/examples/slides/main.cc b/examples/slides/main.cc
index bb5ed92..79d19a5 100644
--- a/examples/slides/main.cc
+++ b/examples/slides/main.cc
@@ -2,6 +2,12 @@
#include <clutter-box2dmm.h>
#include <iostream>
+void
+handle_collision(const Glib::RefPtr<Clutter::Box2D::Box2DCollision> & c)
+{
+ std::cout << "Collision detected" << std::endl;
+}
+
static void
add_static_box(const Glib::RefPtr<Clutter::Box2D::Box2D>& box2d,
int x, int y, int width, int height)
@@ -58,7 +64,6 @@ int main(int argc, char *argv[])
Glib::RefPtr<Clutter::Box2D::Box2D> box2d = Clutter::Box2D::Box2D::create();
stage->add_actor(box2d);
-
add_cage(box2d, false /* no roof */);
@@ -70,6 +75,9 @@ int main(int argc, char *argv[])
box2d->add_actor(ground1);
box2d->set_child_mode(ground1, Clutter::Box2D::BOX2D_STATIC);
+ Glib::RefPtr<Clutter::Box2D::Box2DChild> b2dchild = Glib::RefPtr<Clutter::Box2D::Box2DChild>::cast_static(box2d->get_child_meta(ground1));
+ b2dchild->signal_collision().connect(sigc::ptr_fun(&handle_collision));
+
Glib::RefPtr<Clutter::Rectangle> ground2 = Clutter::Rectangle::create();
ground2->set_size(256, 3);
ground2->set_position(200, 200);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]