gnomemm r1663 - in clutter-box2dmm/trunk: . clutter-box2d/src demo



Author: murrayc
Date: Mon Aug  4 12:45:08 2008
New Revision: 1663
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1663&view=rev

Log:
2008-08-04  Murray Cumming  <murrayc murrayc com>

* clutter-box2d/src/clutter-box2d_signals.defs: 
Update these, copy/pasting from the terminal because the crash 
in extra_defs_gen for this stops the file from being created fully with 
>.
* clutter-box2d/src/box2d.hg: Added gravity and simulating properties.
Added a note that you should use set_child_property().
* Makefile.am:
* configure.in:
* demo/Makefile.am:
* demo/main.cc: Very bare beginnings of a demo, based on the C demo.
There is nothing but skeleton code here now.

Added:
   clutter-box2dmm/trunk/demo/
   clutter-box2dmm/trunk/demo/Makefile.am
   clutter-box2dmm/trunk/demo/actor.png
      - copied unchanged from r1629, /cluttermm/trunk/examples/actor.png
   clutter-box2dmm/trunk/demo/main.cc
Modified:
   clutter-box2dmm/trunk/ChangeLog
   clutter-box2dmm/trunk/Makefile.am
   clutter-box2dmm/trunk/clutter-box2d/src/box2d.hg
   clutter-box2dmm/trunk/clutter-box2d/src/clutter-box2d_signals.defs
   clutter-box2dmm/trunk/configure.in

Modified: clutter-box2dmm/trunk/Makefile.am
==============================================================================
--- clutter-box2dmm/trunk/Makefile.am	(original)
+++ clutter-box2dmm/trunk/Makefile.am	Mon Aug  4 12:45:08 2008
@@ -1,4 +1,4 @@
-SUBDIRS		= tools clutter-box2d docs examples
+SUBDIRS		= tools clutter-box2d examples demo docs
 DIST_SUBDIRS	= $(SUBDIRS) scripts
 
 EXTRA_DIST	=  \

Modified: clutter-box2dmm/trunk/clutter-box2d/src/box2d.hg
==============================================================================
--- clutter-box2dmm/trunk/clutter-box2d/src/box2d.hg	(original)
+++ clutter-box2dmm/trunk/clutter-box2d/src/box2d.hg	Mon Aug  4 12:45:08 2008
@@ -16,6 +16,7 @@
  */
 
 #include <cluttermm/group.h>
+#include <cluttermm/types.h> //For Clutter::Vertex.
  
 _DEFS(clutter-box2dmm,clutter-box2d)
 _PINCLUDE(cluttermm/private/group_p.h)
@@ -27,7 +28,9 @@
 namespace Box2D
 {
 
-//TODO: Documentation.
+/** TODO: Documentation.
+ * Use set_child_property() on the child actors.
+ */
 class Box2D :
   public Clutter::Group
 {
@@ -42,6 +45,9 @@
 
   _WRAP_METHOD(void set_simulating(bool simulating = true), clutter_box2d_set_simulating)
   _WRAP_METHOD(bool get_simulating() const, clutter_box2d_get_simulating)
+
+  _WRAP_PROPERTY("gravity", Clutter::Vertex)
+  _WRAP_PROPERTY("simulating", bool)
 };
 
 } // namespace Box2D

Modified: clutter-box2dmm/trunk/clutter-box2d/src/clutter-box2d_signals.defs
==============================================================================
--- clutter-box2dmm/trunk/clutter-box2d/src/clutter-box2d_signals.defs	(original)
+++ clutter-box2dmm/trunk/clutter-box2d/src/clutter-box2d_signals.defs	Mon Aug  4 12:45:08 2008
@@ -189,3 +189,147 @@
   (construct-only #f)
 )
 
+(define-property opacity
+  (of-object "ClutterBox2D")
+  (prop-type "GParamUChar")
+  (docs "Opacity of actor")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property visible
+  (of-object "ClutterBox2D")
+  (prop-type "GParamBoolean")
+  (docs "Whether the actor is visible or not")
+  (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")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property scale-y
+  (of-object "ClutterBox2D")
+  (prop-type "GParamDouble")
+  (docs "Scale factor on the Y axis")
+  (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")
+  (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")
+  (prop-type "GParamBoxed")
+  (docs "The rotation center on the Y axis")
+  (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")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property anchor-y
+  (of-object "ClutterBox2D")
+  (prop-type "GParamInt")
+  (docs "Y coordinate of the anchor point")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property show-on-set-parent
+  (of-object "ClutterBox2D")
+  (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.")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+

Modified: clutter-box2dmm/trunk/configure.in
==============================================================================
--- clutter-box2dmm/trunk/configure.in	(original)
+++ clutter-box2dmm/trunk/configure.in	Mon Aug  4 12:45:08 2008
@@ -117,6 +117,7 @@
   docs/reference/Makefile
     docs/reference/Doxyfile
 
+  demo/Makefile
   examples/Makefile
 ])
 :

Added: clutter-box2dmm/trunk/demo/Makefile.am
==============================================================================
--- (empty file)
+++ clutter-box2dmm/trunk/demo/Makefile.am	Mon Aug  4 12:45:08 2008
@@ -0,0 +1,9 @@
+SUBDIRS = 
+
+include $(top_srcdir)/examples/Makefile.am_fragment
+
+noinst_PROGRAMS = demo
+demo_SOURCES = main.cc
+
+EXTRA_DIST = actor.png
+

Added: clutter-box2dmm/trunk/demo/main.cc
==============================================================================
--- (empty file)
+++ clutter-box2dmm/trunk/demo/main.cc	Mon Aug  4 12:45:08 2008
@@ -0,0 +1,32 @@
+#include <cluttermm.h>
+#include <iostream>
+
+int main(int argc, char *argv[])
+{
+  try
+  {
+    // TODO: Pass context to init as soon as that init() overload has been
+    // uncommented in cluttermm. This depends on a clutter release with
+    // clutter bug #1033 fixed.
+    // initialize the C++ wrapper types
+    Clutter::init(&argc, &argv); //, context);
+  }
+  catch(const Glib::Exception& ex)
+  {
+    std::cerr << "Failed to initialize clutter: " << ex.what() << std::endl;
+    return -1;
+  }
+
+  Glib::RefPtr<Clutter::Stage> stage = Clutter::Stage::get_default ();
+  stage->set_size(720, 576);
+  stage->set_title("Box2D Test");
+
+  Clutter::Color stage_color(0x00, 0x00, 0x00, 0x00);
+  stage->set_color (stage_color);
+
+  //TODO: Much. Use the class/slot structure from the gtkmm demo? murrayc.
+
+  Clutter::main();
+
+  return 0;
+}



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