gnomemm r2053 - in cluttermm/branches/cluttermm-0.8: . clutter/src tools/m4



Author: murrayc
Date: Tue Feb 17 08:47:51 2009
New Revision: 2053
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2053&view=rev

Log:
More back-porting from trunk.

Modified:
   cluttermm/branches/cluttermm-0.8/ChangeLog
   cluttermm/branches/cluttermm-0.8/clutter/src/actor.ccg
   cluttermm/branches/cluttermm-0.8/clutter/src/actor.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/alpha.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/box.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/container.ccg
   cluttermm/branches/cluttermm-0.8/clutter/src/container.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.ccg
   cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/layout.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/texture.ccg
   cluttermm/branches/cluttermm-0.8/clutter/src/texture.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/timeline.hg
   cluttermm/branches/cluttermm-0.8/clutter/src/types.hg
   cluttermm/branches/cluttermm-0.8/tools/m4/convert_cluttermm.m4

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/actor.ccg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/actor.ccg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/actor.ccg	Tue Feb 17 08:47:51 2009
@@ -28,6 +28,36 @@
   gobject_.y2 = y2;
 }
 
+void Actor::set_flags(ActorFlags flags)
+{
+  CLUTTER_ACTOR_SET_FLAGS(gobj(), static_cast<guint32>(flags));
+}
+
+void Actor::unset_flags(ActorFlags flags)
+{
+  CLUTTER_ACTOR_UNSET_FLAGS(gobj(), static_cast<guint32>(flags));
+}
+
+bool Actor::is_mapped() const
+{
+  return (CLUTTER_ACTOR_IS_MAPPED(gobj()) != 0);
+}
+
+bool Actor::is_realized() const
+{
+  return (CLUTTER_ACTOR_IS_REALIZED(gobj()) != 0);
+}
+
+bool Actor::is_visible() const
+{
+  return CLUTTER_ACTOR_IS_VISIBLE(gobj());
+}
+
+bool Actor::is_reactive() const
+{
+  return (CLUTTER_ACTOR_IS_REACTIVE(gobj()) != 0);
+}
+
 Geometry Actor::get_geometry() const
 {
   Geometry geom;

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/actor.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/actor.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/actor.hg	Tue Feb 17 08:47:51 2009
@@ -45,6 +45,8 @@
   _MEMBER_SET(y2, y2, Unit, ClutterUnit)
 };
 
+_WRAP_ENUM(ActorFlags, ClutterActorFlags)
+
 class Actor : public Glib::Object, public Scriptable
 {
   _CLASS_GOBJECT(Actor, ClutterActor, CLUTTER_ACTOR, Glib::Object, GObject)
@@ -57,7 +59,16 @@
 public:
   //There is no create() because this is an abstract base class.
   //_WRAP_CREATE()
-  
+
+  void set_flags(ActorFlags flags);
+  void unset_flags(ActorFlags flags);
+  _MEMBER_GET(flags, flags, ActorFlags, guint32)
+
+  bool is_mapped() const;
+  bool is_realized() const;
+  bool is_visible() const;
+  bool is_reactive() const;
+
   _WRAP_METHOD(void show(), clutter_actor_show)
   _WRAP_METHOD(void show_all(), clutter_actor_show_all)
   _WRAP_METHOD(void hide(), clutter_actor_hide)
@@ -203,6 +214,10 @@
   _WRAP_METHOD(void get_anchor_pointu(Unit& anchor_x, Unit& anchor_y), clutter_actor_get_anchor_pointu)
   _WRAP_METHOD(void set_anchor_point_from_gravity(ClutterGravity gravity), clutter_actor_set_anchor_point_from_gravity)
 
+  // These are needed by custom container implementations and therefore public.
+  _WRAP_METHOD(void pick(const Color& color), clutter_actor_pick)
+  _WRAP_METHOD(bool should_pick_paint() const, clutter_actor_should_pick_paint)
+
 // signals
   _WRAP_SIGNAL(bool button_press_event(ButtonEvent* event), "button_press_event")
   _WRAP_SIGNAL(bool button_release_event(ButtonEvent* event), "button_release_event")
@@ -259,10 +274,6 @@
 protected:
   _WRAP_METHOD(void set_shader_param_value(const Glib::ustring& param, float value),
                clutter_actor_set_shader_param)
-  // according to the clutter docs, these functions should never be called
-  // directly and are only for subclasses
-  _WRAP_METHOD(void pick(const Color& color), clutter_actor_pick)
-  _WRAP_METHOD(bool should_pick_paint() const, clutter_actor_should_pick_paint)
 
   _WRAP_VFUNC(void show_all(), "show_all")
   _WRAP_VFUNC(void hide_all(), "hide_all")

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/alpha.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/alpha.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/alpha.hg	Tue Feb 17 08:47:51 2009
@@ -62,6 +62,8 @@
   Alpha(const Glib::RefPtr<Timeline>& timeline, const SlotAlphaFunc& slot);
 
 public:
+  enum { MAX_ALPHA = 0xFFFF };
+
   _WRAP_CREATE()
   _WRAP_CREATE(const Glib::RefPtr<Timeline>& timeline, const SlotAlphaFunc& slot)
 

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/box.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/box.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/box.hg	Tue Feb 17 08:47:51 2009
@@ -29,7 +29,7 @@
 namespace Clutter
 {
 
-_WRAP_ENUM(PackType, ClutterPackType, NO_GTYPE)
+_WRAP_ENUM(PackType, ClutterPackType)
 
 typedef ClutterPadding Padding;
 

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/container.ccg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/container.ccg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/container.ccg	Tue Feb 17 08:47:51 2009
@@ -17,51 +17,66 @@
 
 #include <clutter/clutter.h>
 
-
+namespace
+{
+extern "C"
+{
 static void SignalProxy_Container_foreach_callback(ClutterActor *actor, gpointer user_data)
 {
-  Clutter::Container::SlotForEach* the_slot = static_cast<Clutter::Container::SlotForEach*>(user_data);
+  Clutter::Container::SlotForEach *const
+    the_slot = static_cast<Clutter::Container::SlotForEach*>(user_data);
 
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
+#endif
   {
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
-    Glib::RefPtr<Clutter::Actor> cpp_actor = Glib::wrap(actor, true /* take reference */);
+    const Glib::RefPtr<Clutter::Actor> cpp_actor = Glib::wrap(actor, true /* take reference */);
     (*the_slot)(cpp_actor);
-  #ifdef GLIBMM_EXCEPTIONS_ENABLED
   }
-  catch(...)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  catch (...)
   {
     Glib::exception_handlers_invoke();
   }
-  #endif //GLIBMM_EXCEPTIONS_ENABLED
+#endif
 }
+} // extern "C"
+} // anonymous namespace
 
 namespace Clutter
 {
 
 void Container::raise_child(const Glib::RefPtr<Actor>& actor)
 {
-  clutter_container_raise_child(gobj(), Glib::unwrap(actor), NULL); 
+  clutter_container_raise_child(gobj(), Glib::unwrap(actor), 0); 
 }
 
 void Container::lower_child(const Glib::RefPtr<Actor>& actor)
 {
-  clutter_container_lower_child(gobj(), Glib::unwrap(actor), NULL); 
+  clutter_container_lower_child(gobj(), Glib::unwrap(actor), 0); 
 }
 
 void Container::foreach(const SlotForEach& slot)
 {
-  clutter_container_foreach(
-      gobj(),
+  clutter_container_foreach(gobj(),
       &SignalProxy_Container_foreach_callback, const_cast<SlotForEach*>(&slot));
 }
 
+void Container::get_child_property_value(const Glib::RefPtr<const Actor>& child,
+                     const Glib::ustring& property_name, Glib::ValueBase& value) const
+{
+  clutter_container_child_get_property(const_cast<ClutterContainer*>(gobj()),
+      const_cast<ClutterActor*>(child->gobj()), property_name.c_str(), value.gobj());
+}
 
-void Container::get_child_property_value(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, Glib::ValueBase& value) const
+void Container::actor_added(const Glib::RefPtr<Actor>& actor)
 {
-  clutter_container_child_get_property(const_cast<ClutterContainer*>(gobj()), const_cast<ClutterActor*>(child->gobj()), property_name.c_str(), value.gobj());
+  g_signal_emit_by_name(gobj(), "actor_added", actor->gobj());
 }
 
-} //namespace Clutter
+void Container::actor_removed(const Glib::RefPtr<Actor>& actor)
+{
+  g_signal_emit_by_name(gobj(), "actor_removed", actor->gobj());
+}
 
+} // namespace Clutter

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/container.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/container.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/container.hg	Tue Feb 17 08:47:51 2009
@@ -45,8 +45,8 @@
   _WRAP_METHOD(void raise_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling), clutter_container_raise_child)
   void raise_child(const Glib::RefPtr<Actor>& actor);
 
-  _WRAP_METHOD(Glib::RefPtr<Actor> find_child (const Glib::ustring& child_name), clutter_container_find_child_by_name, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Actor> find_child (const Glib::ustring& child_name) const, clutter_container_find_child_by_name, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Actor> find_child(const Glib::ustring& child_name), clutter_container_find_child_by_name, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Actor> find_child(const Glib::ustring& child_name) const, clutter_container_find_child_by_name, constversion)
 
   /** For instance, 
    * void on_foreach(const Glib::RefPtr<Actor>& actor)
@@ -57,7 +57,9 @@
   _IGNORE(clutter_container_foreach)
 
   // not sure the valist stuff is good to wrap in C++
-  _IGNORE(clutter_container_add_valist, clutter_container_remove_valist, clutter_container_add, clutter_container_remove, clutter_container_child_get, clutter_container_child_set, clutter_container_class_find_child_property, clutter_container_class_list_child_properties)
+  _IGNORE(clutter_container_add_valist, clutter_container_remove_valist, clutter_container_add,
+          clutter_container_remove, clutter_container_child_get, clutter_container_child_set,
+          clutter_container_class_find_child_property, clutter_container_class_list_child_properties)
 
  
   template <class PropertyType> inline
@@ -107,16 +109,24 @@
   _WRAP_VFUNC(void add(const Glib::RefPtr<Actor>& actor), add)
   _WRAP_VFUNC(void remove(const Glib::RefPtr<Actor>& actor), remove)
   _WRAP_VFUNC(void raise(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling), raise)
-  _WRAP_VFUNC(void lower(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& lower), lower)
+  _WRAP_VFUNC(void lower(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling), lower)
   _WRAP_VFUNC(void sort_depth_order(), sort_depth_order)
 
+  // TODO: C++ify?
   _WRAP_VFUNC(void foreach(ClutterCallback callback, gpointer user_data), foreach)
 
+  /** Emit signal_actor_added().
+   */
+  void actor_added(const Glib::RefPtr<Actor>& actor);
+
+  /** Emit signal_actor_removed().
+   */
+  void actor_removed(const Glib::RefPtr<Actor>& actor);
+
   // TODO: Do we want to wrap create_child_meta, destory_child_meta,
   // get_child_meta?
 };
 
-
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 template <class PropertyType> inline
@@ -142,7 +152,4 @@
 
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
-
-
 } // namespace Clutter
-//vim: ts=2,sw=2

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.ccg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.ccg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.ccg	Tue Feb 17 08:47:51 2009
@@ -23,73 +23,108 @@
 namespace
 {
 
-guint32 c_alpha_callback(ClutterAlpha* alpha, gpointer user_data)
+extern "C"
 {
-  EffectTemplate::SlotAlphaFunc* alpha_func = static_cast<EffectTemplate::SlotAlphaFunc*>(user_data);
-  return (*alpha_func)(Glib::wrap(alpha, true));
+
+static guint32 c_alpha_callback(ClutterAlpha* alpha, gpointer user_data)
+{
+  try
+  {
+    EffectTemplate::SlotAlphaFunc* alpha_func = static_cast<EffectTemplate::SlotAlphaFunc*>(user_data);
+    return (*alpha_func)(Glib::wrap(alpha, true));
+  }
+  catch (...)
+  {
+    Glib::exception_handlers_invoke();
+  }
 }
 
-void c_alpha_destroy_notify(gpointer data)
+static void c_alpha_destroy_notify(gpointer data)
 {
-  delete static_cast<EffectTemplate::SlotAlphaFunc*>(data);
+  try
+  {
+    delete static_cast<EffectTemplate::SlotAlphaFunc*>(data);
+  }
+  catch (...)
+  {
+    Glib::exception_handlers_invoke();
+  }
 }
 
+} // extern "C"
+
 // We use this helper class instead of the ClutterEffectCompleteFuncs
 // because these don't have a GDestroyNotify.
-struct CompleteCallback: sigc::trackable
+struct CompleteCallback
 {
   EffectTemplate::SlotEffectCompleteFunc func;
 
-  static void create(const Glib::RefPtr<Timeline>& timeline, const Glib::RefPtr<Actor>& actor, const EffectTemplate::SlotEffectCompleteFunc& func)
-  {
-    CompleteCallback* cb = new CompleteCallback;
-    cb->func = func;
-    timeline->signal_completed().connect(sigc::bind(sigc::mem_fun(cb, &CompleteCallback::on_callback), actor));
-  }
-
-  void on_callback(const Glib::RefPtr<Actor>& actor)
-  {
-    func(actor);
-    // This causes the signal being disconnected from the timeline:
-    delete this;
-  }
+  static void create(const Glib::RefPtr<Timeline>& timeline, const Glib::RefPtr<Actor>& actor,
+                     const EffectTemplate::SlotEffectCompleteFunc& func);
+  static void on_callback(CompleteCallback* cb, const Glib::RefPtr<Actor>& actor);
 };
 
+void CompleteCallback::create(const Glib::RefPtr<Timeline>& timeline, const Glib::RefPtr<Actor>& actor,
+                              const EffectTemplate::SlotEffectCompleteFunc& func)
+{
+  CompleteCallback *const cb = new CompleteCallback;
+  cb->func = func;
+  timeline->signal_completed().connect(sigc::bind(&CompleteCallback::on_callback, cb, actor));
 }
 
-EffectTemplate::EffectTemplate(const Glib::RefPtr<Timeline>& timeline, const SlotAlphaFunc& alpha_func)
+void CompleteCallback::on_callback(CompleteCallback* cb, const Glib::RefPtr<Actor>& actor)
+{
+  cb->func(actor);
+  // This causes the signal being disconnected from the timeline:
+  delete cb;
+}
+
+} // anonymous namespace
+
+EffectTemplate::EffectTemplate(const Glib::RefPtr<Timeline>& timeline,
+                               const SlotAlphaFunc& alpha_func)
 :
   _CONSTRUCT()
 {
-  clutter_effect_template_construct(gobj(), timeline->gobj(), c_alpha_callback, new SlotAlphaFunc(alpha_func), c_alpha_destroy_notify);
+  clutter_effect_template_construct(gobj(), timeline->gobj(), &c_alpha_callback,
+                                    new SlotAlphaFunc(alpha_func), &c_alpha_destroy_notify);
 }
 
 EffectTemplate::EffectTemplate(guint msecs, const SlotAlphaFunc& alpha_func)
 :
   _CONSTRUCT()
 {
-  Glib::RefPtr<Timeline> timeline(Timeline::create(msecs));
-  clutter_effect_template_construct(gobj(), timeline->gobj(), c_alpha_callback, new SlotAlphaFunc(alpha_func), c_alpha_destroy_notify);
+  const Glib::RefPtr<Timeline> timeline = Timeline::create(msecs);
+  clutter_effect_template_construct(gobj(), timeline->gobj(), &c_alpha_callback,
+                                    new SlotAlphaFunc(alpha_func), &c_alpha_destroy_notify);
 }
 
 Glib::RefPtr<Timeline> EffectTemplate::fade(const Glib::RefPtr<Actor>& actor, guint8 opacity_end, const SlotEffectCompleteFunc& func)
 {
-  Glib::RefPtr<Timeline> timeline(Glib::wrap(clutter_effect_fade(gobj(), actor->gobj(), opacity_end, NULL, NULL), true));
-  CompleteCallback::create(timeline, actor, func);
+  const Glib::RefPtr<Timeline> timeline = Glib::wrap(clutter_effect_fade(
+      gobj(), actor->gobj(), opacity_end, 0, 0), true);
+  if (!func.empty())
+    CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
 
-Glib::RefPtr<Timeline> EffectTemplate::depth(const Glib::RefPtr<Actor>& actor, int depth_end, const SlotEffectCompleteFunc& func)
+Glib::RefPtr<Timeline> EffectTemplate::depth(const Glib::RefPtr<Actor>& actor, int depth_end,
+                                             const SlotEffectCompleteFunc& func)
 {
-  Glib::RefPtr<Timeline> timeline(Glib::wrap(clutter_effect_depth(gobj(), actor->gobj(), depth_end, NULL, NULL), true));
-  CompleteCallback::create(timeline, actor, func);
+  const Glib::RefPtr<Timeline> timeline = Glib::wrap(clutter_effect_depth(
+      gobj(), actor->gobj(), depth_end, 0, 0), true);
+  if (!func.empty())
+    CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
 
-Glib::RefPtr<Timeline> EffectTemplate::move(const Glib::RefPtr<Actor>& actor, int x, int y, const SlotEffectCompleteFunc& func)
+Glib::RefPtr<Timeline> EffectTemplate::move(const Glib::RefPtr<Actor>& actor, int x, int y,
+                                            const SlotEffectCompleteFunc& func)
 {
-  Glib::RefPtr<Timeline> timeline(Glib::wrap(clutter_effect_move(gobj(), actor->gobj(), x, y, NULL, NULL), true));
-  CompleteCallback::create(timeline, actor, func);
+  const Glib::RefPtr<Timeline> timeline = Glib::wrap(clutter_effect_move(
+      gobj(), actor->gobj(), x, y, 0, 0), true);
+  if (!func.empty())
+    CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
 
@@ -101,21 +136,32 @@
   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);
+  if (!func.empty())
+    CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
 
-Glib::RefPtr<Timeline> EffectTemplate::scale(const Glib::RefPtr<Actor>& actor, double x_scale_end, double y_scale_end, const SlotEffectCompleteFunc& func)
+Glib::RefPtr<Timeline> EffectTemplate::scale(const Glib::RefPtr<Actor>& actor,
+                                             double x_scale_end, double y_scale_end,
+                                             const SlotEffectCompleteFunc& func)
 {
-  Glib::RefPtr<Timeline> timeline(Glib::wrap(clutter_effect_scale(gobj(), actor->gobj(), x_scale_end, y_scale_end, NULL, NULL), true));
-  CompleteCallback::create(timeline, actor, func);
+  const Glib::RefPtr<Timeline> timeline = Glib::wrap(clutter_effect_scale(
+      gobj(), actor->gobj(), x_scale_end, y_scale_end, 0, 0), true);
+  if (!func.empty())
+    CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
 
-Glib::RefPtr<Timeline> EffectTemplate::rotate(const Glib::RefPtr<Actor>& actor, RotateAxis axis, double angle_end, int center_x, int center_y, int center_z, RotateDirection direction, const SlotEffectCompleteFunc& func)
+Glib::RefPtr<Timeline> EffectTemplate::rotate(const Glib::RefPtr<Actor>& actor, RotateAxis axis,
+                                              double angle_end, int center_x, int center_y, int center_z,
+                                              RotateDirection direction, const SlotEffectCompleteFunc& func)
 {
-  Glib::RefPtr<Timeline> timeline(Glib::wrap(clutter_effect_rotate(gobj(), actor->gobj(), static_cast<ClutterRotateAxis>(axis), angle_end, center_x, center_y, center_z, static_cast<ClutterRotateDirection>(direction), NULL, NULL), true));
-  CompleteCallback::create(timeline, actor, func);
+  const Glib::RefPtr<Timeline> timeline = Glib::wrap(clutter_effect_rotate(
+      gobj(), actor->gobj(), static_cast<ClutterRotateAxis>(axis), angle_end,
+      center_x, center_y, center_z, static_cast<ClutterRotateDirection>(direction),
+      0, 0), true);
+  if (!func.empty())
+    CompleteCallback::create(timeline, actor, func);
   return timeline;
 }
 

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/effecttemplate.hg	Tue Feb 17 08:47:51 2009
@@ -49,25 +49,28 @@
   _WRAP_METHOD(bool get_timeline_clone() const, clutter_effect_template_get_timeline_clone)
 
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_fade)
-  Glib::RefPtr<Timeline> fade(const Glib::RefPtr<Actor>& actor, guint8 opacity_end, const SlotEffectCompleteFunc& func);
+  Glib::RefPtr<Timeline> fade(const Glib::RefPtr<Actor>& actor, guint8 opacity_end,
+                              const SlotEffectCompleteFunc& func = SlotEffectCompleteFunc());
 
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_depth)
-  Glib::RefPtr<Timeline> depth(const Glib::RefPtr<Actor>& actor, int depth_end, const SlotEffectCompleteFunc& func);
+  Glib::RefPtr<Timeline> depth(const Glib::RefPtr<Actor>& actor, int depth_end,
+                               const SlotEffectCompleteFunc& func = SlotEffectCompleteFunc());
 
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_move)
-  Glib::RefPtr<Timeline> move(const Glib::RefPtr<Actor>& actor, int x, int y, const SlotEffectCompleteFunc& func);
+  Glib::RefPtr<Timeline> move(const Glib::RefPtr<Actor>& actor, int x, int y,
+                              const SlotEffectCompleteFunc& func = SlotEffectCompleteFunc());
 
-  // TODO: Use C++ container for knots
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_path)
-  Glib::RefPtr<Timeline> path(const Glib::RefPtr<Actor>& actor,
-                              const Glib::ArrayHandle<Knot>& knots,
-                              const SlotEffectCompleteFunc& func);
+  Glib::RefPtr<Timeline> path(const Glib::RefPtr<Actor>& actor, const Glib::ArrayHandle<Knot>& knots,
+                              const SlotEffectCompleteFunc& func = SlotEffectCompleteFunc());
 
   _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);
+  Glib::RefPtr<Timeline> scale(const Glib::RefPtr<Actor>& actor, double x_scale_end, double y_scale_end,
+                               const SlotEffectCompleteFunc& func = SlotEffectCompleteFunc());
 
   _WRAP_METHOD_DOCS_ONLY(clutter_effect_rotate)
-  Glib::RefPtr<Timeline> rotate(const Glib::RefPtr<Actor>& actor, RotateAxis axis, double angle_end, int center_x, int center_y, int center_z, RotateDirection direction, const SlotEffectCompleteFunc& func);
+  Glib::RefPtr<Timeline> rotate(const Glib::RefPtr<Actor>& actor, RotateAxis axis, double angle_end, int center_x, int center_y, int center_z, RotateDirection direction,
+                                const SlotEffectCompleteFunc& func = SlotEffectCompleteFunc());
 
   _WRAP_PROPERTY("timeline", Glib::RefPtr<Timeline>)
   _WRAP_PROPERTY("clone", bool)

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/layout.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/layout.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/layout.hg	Tue Feb 17 08:47:51 2009
@@ -26,7 +26,7 @@
 namespace Clutter
 {
 
-_WRAP_ENUM(LayoutFlags, ClutterLayoutFlags, NO_GTYPE)
+_WRAP_ENUM(LayoutFlags, ClutterLayoutFlags)
 
 class Layout : public Glib::Interface
 {

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/texture.ccg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/texture.ccg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/texture.ccg	Tue Feb 17 08:47:51 2009
@@ -1,4 +1,5 @@
-/* Copyright (C) 2007 The cluttermm Development Team
+/*
+ * Copyright (c) 2007 The cluttermm Development Team
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -20,5 +21,11 @@
 namespace Clutter
 {
 
-} //namespace Clutter
+Glib::RefPtr<Texture> Texture::create_from_file(const std::string& filename)
+{
+  const Glib::RefPtr<Texture> result (new Texture());
+  result->set_from_file(filename);
+  return result;
+}
 
+} // namespace Clutter

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/texture.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/texture.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/texture.hg	Tue Feb 17 08:47:51 2009
@@ -26,15 +26,14 @@
 namespace Clutter
 {
 
-_WRAP_ENUM(TextureFlags, ClutterTextureFlags, NO_GTYPE)
-_WRAP_ENUM(TextureQuality, ClutterTextureQuality, NO_GTYPE)
+_WRAP_ENUM(TextureFlags, ClutterTextureFlags)
+_WRAP_ENUM(TextureQuality, ClutterTextureQuality)
 
 /** Exception class for Clutter::Texture errors.
  */
 _WRAP_GERROR(TextureError, ClutterTextureError, CLUTTER_TEXTURE_ERROR)
 
-class Texture :
-  public Actor
+class Texture : public Actor
 {
   _CLASS_GOBJECT(Texture, ClutterTexture, CLUTTER_TEXTURE, Actor, ClutterActor)
 
@@ -43,7 +42,7 @@
   // We do not wrap this constructor because it might throw an error. This
   // gets difficult to get right especially for disabled exceptions in glibmm,
   // and it is easy enough to create a texture and call set_from_file() on
-  // it manually:
+  // it manually.  But we do wrap the create method at least. --danielk
   _IGNORE(clutter_texture_new_from_file)
 
   // TODO: Wrap clutter_texture_new_from_actor. This needs changes in clutter
@@ -54,14 +53,14 @@
 #m4 _CONVERSION(`ClutterActor*',`Glib::RefPtr<Texture>',`Glib::wrap((ClutterTexture*)$3)')
 
   _WRAP_CREATE()
-  //_WRAP_CREATE(const Glib::ustring& filename);
+  static Glib::RefPtr<Texture> create_from_file(const std::string& filename);
   //_WRAP_CREATE(const Glib::RefPtr<Actor>& actor);
 
-  _WRAP_METHOD(bool set_from_file(const Glib::ustring& filename), clutter_texture_set_from_file, errthrow)
+  _WRAP_METHOD(bool set_from_file(const std::string& filename), clutter_texture_set_from_file, errthrow)
   _WRAP_METHOD(bool set_from_rgb_data(const guchar* data, bool has_alpha, int width, int height, int rowstride, int bpp, TextureFlags flags), clutter_texture_set_from_rgb_data, errthrow)
   _WRAP_METHOD(bool set_from_yuv_data(const guchar* data, int width, int height, TextureFlags flags), clutter_texture_set_from_yuv_data, errthrow)
   _WRAP_METHOD(bool set_area_from_rgb_data(const guchar* data, bool has_alpha, int x, int y, int width, int height, int rowstride, int bpp, TextureFlags flags), clutter_texture_set_area_from_rgb_data, errthrow)
-  _WRAP_METHOD(void get_base_size(gint& width, gint& height) const, clutter_texture_get_base_size)
+  _WRAP_METHOD(void get_base_size(int& width, int& height) const, clutter_texture_get_base_size)
 
   _WRAP_METHOD(TextureQuality get_filter_quality() const, clutter_texture_get_filter_quality)
   _WRAP_METHOD(void set_filter_quality(TextureQuality filter_quality), clutter_texture_set_filter_quality)
@@ -72,12 +71,13 @@
   _WRAP_METHOD(CoglHandle get_cogl_texture() const, clutter_texture_get_cogl_texture)
   _WRAP_METHOD(void set_cogl_texture(CoglHandle handle), clutter_texture_set_cogl_texture)
 
-  _WRAP_SIGNAL(void size_change(gint width, gint height), "size_change")
+  _WRAP_SIGNAL(void size_change(int width, int height), "size_change")
   _WRAP_SIGNAL(void pixbuf_change(), "pixbuf_change")
 
+#m4 // TODO: What's with the C type?
   _WRAP_PROPERTY("cogl-texture", CoglHandle)
   _WRAP_PROPERTY("disable-slicing", bool)
-  _WRAP_PROPERTY("filename", Glib::ustring)
+  _WRAP_PROPERTY("filename", std::string)
   _WRAP_PROPERTY("filter-quality", TextureQuality)
   _WRAP_PROPERTY("pixel-format", int)
   _WRAP_PROPERTY("repeat-x", bool)
@@ -87,5 +87,3 @@
 };
 
 } // namespace Clutter
-
-//vim: ts=2,sw=2

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/timeline.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/timeline.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/timeline.hg	Tue Feb 17 08:47:51 2009
@@ -25,7 +25,7 @@
 namespace Clutter
 {
 
-_WRAP_ENUM(TimelineDirection, ClutterTimelineDirection, NO_GTYPE)
+_WRAP_ENUM(TimelineDirection, ClutterTimelineDirection)
 
 class Timeline : public Glib::Object
 {

Modified: cluttermm/branches/cluttermm-0.8/clutter/src/types.hg
==============================================================================
--- cluttermm/branches/cluttermm-0.8/clutter/src/types.hg	(original)
+++ cluttermm/branches/cluttermm-0.8/clutter/src/types.hg	Tue Feb 17 08:47:51 2009
@@ -34,12 +34,12 @@
 typedef ClutterFixed Fixed;
 typedef ClutterAngle Angle;
 
-_WRAP_GERROR(InitError, ClutterInitError, CLUTTER_INIT_ERROR, NO_GTYPE)
+_WRAP_GERROR(InitError, ClutterInitError, CLUTTER_INIT_ERROR)
 
-_WRAP_ENUM(RotateDirection, ClutterRotateDirection, NO_GTYPE)
-_WRAP_ENUM(RotateAxis, ClutterRotateAxis, NO_GTYPE)
-_WRAP_ENUM(Gravity, ClutterGravity, NO_GTYPE)
-_WRAP_ENUM(RequestMode, ClutterRequestMode, NO_GTYPE)
+_WRAP_ENUM(RotateDirection, ClutterRotateDirection)
+_WRAP_ENUM(RotateAxis, ClutterRotateAxis)
+_WRAP_ENUM(Gravity, ClutterGravity)
+_WRAP_ENUM(RequestMode, ClutterRequestMode)
 
 class Knot
 {

Modified: cluttermm/branches/cluttermm-0.8/tools/m4/convert_cluttermm.m4
==============================================================================
--- cluttermm/branches/cluttermm-0.8/tools/m4/convert_cluttermm.m4	(original)
+++ cluttermm/branches/cluttermm-0.8/tools/m4/convert_cluttermm.m4	Tue Feb 17 08:47:51 2009
@@ -35,6 +35,10 @@
 _CONVERSION(`const Padding&',`const ClutterPadding*',`&($3)')
 _CONVERSION(`ClutterPadding*',`Padding&',`*($3)')
 
+_EQUAL(`guint8',`guchar')
+_EQUAL(`guint8*',`guchar*')
+_EQUAL(`const guint8*',`const guchar*')
+
 _CONVERSION(`guint8&',`guint8*',`&($3)')
 _CONVERSION(`guint8*',`guint8&',`*($3)')
 _CONVERSION(`ClutterFixed&',`ClutterFixed*',`&($3)')
@@ -57,6 +61,7 @@
 _EQUAL(ClutterScrollEvent*,ScrollEvent*)
 _EQUAL(ClutterCrossingEvent*,CrossingEvent*)
 
+_CONV_ENUM(Clutter,ActorFlags)
 _CONV_ENUM(Clutter,LayoutFlags)
 _CONV_ENUM(Clutter,PackType)
 _CONV_ENUM(Clutter,TextureFlags)
@@ -68,4 +73,5 @@
 _CONV_ENUM(Pango,EllipsizeMode)
 _CONV_ENUM(Pango,WrapMode)
 
+_CONVERSION(`guint32', `ActorFlags', `static_cast<ActorFlags>($3)')
 _CONVERSION(`const gchar*', `const Glib::ustring&',__GCHARP_TO_USTRING)



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