gnomemm r1900 - in cluttermm/trunk: . clutter/src



Author: daniel
Date: Mon Dec 22 15:08:26 2008
New Revision: 1900
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1900&view=rev

Log:
* clutter/src/effecttemplate.{ccg,hg} (EffectTemplate::path):
Use C++ container wrapper instead of a POD array.

Modified:
   cluttermm/trunk/ChangeLog
   cluttermm/trunk/clutter/src/effecttemplate.ccg
   cluttermm/trunk/clutter/src/effecttemplate.hg

Modified: cluttermm/trunk/clutter/src/effecttemplate.ccg
==============================================================================
--- cluttermm/trunk/clutter/src/effecttemplate.ccg	(original)
+++ cluttermm/trunk/clutter/src/effecttemplate.ccg	Mon Dec 22 15:08:26 2008
@@ -93,9 +93,14 @@
   return timeline;
 }
 
-Glib::RefPtr<Timeline> EffectTemplate::path(const Glib::RefPtr<Actor>& actor, const ClutterKnot* knots, guint n_knots, const SlotEffectCompleteFunc& func)
+Glib::RefPtr<Timeline> EffectTemplate::path(const Glib::RefPtr<Actor>& actor,
+                                            const Glib::ArrayHandle<Knot>& knots,
+                                            const SlotEffectCompleteFunc& func)
 {
-  Glib::RefPtr<Timeline> timeline(Glib::wrap(clutter_effect_path(gobj(), actor->gobj(), knots, n_knots, NULL, NULL), true));
+  // Note: Don't copy this code if you don't understand WHY the cast works here.
+  const Glib::RefPtr<Timeline> timeline = Glib::wrap(clutter_effect_path(
+      gobj(), actor->gobj(), reinterpret_cast<const ClutterKnot*>(knots.data()),
+      knots.size(), 0, 0), true);
   CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
@@ -115,5 +120,3 @@
 }
 
 } // namespace Clutter
-
-//vim: ts=2,sw=2

Modified: cluttermm/trunk/clutter/src/effecttemplate.hg
==============================================================================
--- cluttermm/trunk/clutter/src/effecttemplate.hg	(original)
+++ cluttermm/trunk/clutter/src/effecttemplate.hg	Mon Dec 22 15:08:26 2008
@@ -59,7 +59,9 @@
 
   // TODO: Use C++ container for knots
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_path)
-  Glib::RefPtr<Timeline> path(const Glib::RefPtr<Actor>& actor, const ClutterKnot* knots, guint n_knots, const SlotEffectCompleteFunc& func);
+  Glib::RefPtr<Timeline> path(const Glib::RefPtr<Actor>& actor,
+                              const Glib::ArrayHandle<Knot>& knots,
+                              const SlotEffectCompleteFunc& func);
 
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_scale)
   Glib::RefPtr<Timeline> scale(const Glib::RefPtr<Actor>& actor, double x_scale_end, double y_scale_end, const SlotEffectCompleteFunc& func);
@@ -72,5 +74,3 @@
 };
 
 } // namespace Clutter
-
-//vim: ts=2,sw=2



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