gnomemm r1586 - in cluttermm/trunk: . clutter/src examples tests



Author: arminb
Date: Tue Jun 24 17:45:21 2008
New Revision: 1586
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1586&view=rev

Log:
2008-06-22  Armin Burgmeier  <armin openismus com>

	* clutter/src/script.ccg: Fixed a typo so that the vfuncs is actually
	used.

	* clutter/src/shader.hg: Wrapped new methods and properties.

	* clutter/src/actor.hg:
	* clutter/src/actor.ccg: Removed the get_paint_area function and vfunc
	since it has been removed from clutter trunk.

	* tests/test-alpha-func.cc:
	* tests/test-alpha-creation.cc:
	* examples/test-actors.cc: Adapt to new clutter API.


Modified:
   cluttermm/trunk/ChangeLog
   cluttermm/trunk/clutter/src/actor.ccg
   cluttermm/trunk/clutter/src/actor.hg
   cluttermm/trunk/clutter/src/script.ccg
   cluttermm/trunk/clutter/src/shader.hg
   cluttermm/trunk/examples/test-actors.cc
   cluttermm/trunk/tests/test-alpha-creation.cc
   cluttermm/trunk/tests/test-alpha-func.cc

Modified: cluttermm/trunk/clutter/src/actor.ccg
==============================================================================
--- cluttermm/trunk/clutter/src/actor.ccg	(original)
+++ cluttermm/trunk/clutter/src/actor.ccg	Tue Jun 24 17:45:21 2008
@@ -35,12 +35,14 @@
   return geom;
 }
 
+#if 0
 ActorBox Actor::get_paint_area() const
 {
   ActorBox box;
   clutter_actor_get_paint_area(const_cast<ClutterActor*>(gobj()), box.gobj());
   return box;
 }
+#endif
 
 void Actor::get_abs_allocation_vertices(Vertex vertices[4]) const
 {
@@ -76,6 +78,7 @@
   return geom;
 }
 
+#if 0
 // We need to hand-code this vfunc to write the result back into the
 // box variable. The C++ wrapper cannot ref the existing variable, but only
 // make a copy.
@@ -133,7 +136,7 @@
   if(base && base->get_paint_area)
     (*base->get_paint_area)(const_cast<ClutterActor*>(gobj()), box.gobj());
 }
-
+#endif
 
 } //namespace Clutter
 

Modified: cluttermm/trunk/clutter/src/actor.hg
==============================================================================
--- cluttermm/trunk/clutter/src/actor.hg	(original)
+++ cluttermm/trunk/clutter/src/actor.hg	Tue Jun 24 17:45:21 2008
@@ -143,8 +143,8 @@
   _WRAP_METHOD(Glib::RefPtr<const Shader> get_shader() const, clutter_actor_get_shader, constversion)
   _WRAP_METHOD(void set_shader(const Glib::RefPtr<Shader>& shader), clutter_actor_set_shader)
   _WRAP_METHOD(void set_shader_param(const Glib::ustring& param, float value), clutter_actor_set_shader_param)
-  _WRAP_METHOD_DOCS_ONLY(clutter_actor_get_paint_area)
-  ActorBox get_paint_area() const;
+  //_WRAP_METHOD_DOCS_ONLY(clutter_actor_get_paint_area)
+  //ActorBox get_paint_area() const;
   _WRAP_METHOD(bool is_rotated() const, clutter_actor_is_rotated)
   _WRAP_METHOD(bool is_scaled() const, clutter_actor_is_scaled)
   _WRAP_METHOD_DOCS_ONLY(clutter_actor_get_allocation_vertices)
@@ -281,19 +281,6 @@
   _WRAP_VFUNC(void get_preferred_height(Unit for_width, Unit& min_height_p, Unit& natural_height_p) const, "get_preferred_height")
   _WRAP_VFUNC(void allocate(const ActorBox& box, bool absolute_origin_changed), "allocate")
 
-#ifdef GLIBMM_VFUNCS_ENABLED
-  // Hand code, since ActorBox can only copy a ClutterActorBox* but not ref one.
-  virtual void get_paint_area_vfunc(ActorBox& box) const;
-  //_WRAP_VFUNC(void get_paint_area(ActorBox& box), "get_paint_area")
-#endif
-
-#m4begin
-  _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
-  klass->get_paint_area = &get_paint_area_vfunc_callback;
-  _SECTION(SECTION_PH_VFUNCS)
-  static void get_paint_area_vfunc_callback(ClutterActor* self, ClutterActorBox* box);
-  _POP()
-#m4end
 };
 
 } // namespace Clutter

Modified: cluttermm/trunk/clutter/src/script.ccg
==============================================================================
--- cluttermm/trunk/clutter/src/script.ccg	(original)
+++ cluttermm/trunk/clutter/src/script.ccg	Tue Jun 24 17:45:21 2008
@@ -39,10 +39,10 @@
   return result;
 }
 
-#ifdef GLIBMM_VFUNGS_ENABLED
+#ifdef GLIBMM_VFUNCS_ENABLED
 // Custom coded so that we can custom-code the vfunc in the ClutterScript class.
 // This is marginally better than modifying gtkmmproc to allow this.
-GType Script_Class::get_type_from_name_vfunc_callback(ClutterScript* slef, const char* type_name)
+GType Script_Class::get_type_from_name_vfunc_callback(ClutterScript* self, const char* type_name)
 {
   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
       Glib::ObjectBase::_get_current_wrapper((GObject*) self));
@@ -68,13 +68,13 @@
         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class.
     );
 
-    if(base && base->lookup_type)
-      return (*base->lookup_type)(self, type_name);
+    if(base && base->get_type_from_name)
+      return (*base->get_type_from_name)(self, type_name);
   }
 
   return 0;
 }
-#endif
+#endif // GLIBMM_VFUNCS_ENABLED
 
 GType Script::get_type_from_name_vfunc(const Glib::ustring& type_name)
 {

Modified: cluttermm/trunk/clutter/src/shader.hg
==============================================================================
--- cluttermm/trunk/clutter/src/shader.hg	(original)
+++ cluttermm/trunk/clutter/src/shader.hg	Tue Jun 24 17:45:21 2008
@@ -35,25 +35,33 @@
 public:
   _WRAP_CREATE()
 
-  //TODO: Documentation:
+  /** Sets the GLSL source code to be used by a Shader for the vertex program.
+   * @param source_code The GLSL source code.
+   */
   void set_vertex_source(const std::string& source_code);
   _IGNORE(clutter_shader_set_vertex_source)
 
   _WRAP_METHOD(std::string get_vertex_source() const, clutter_shader_get_vertex_source)
 
     //TODO: Documentation:
+  /** Sets the GLSL source code to be used by a Shader for the fragment
+   * program.
+   * @param source_code The GLSL source code.
+   */
   void set_fragment_source(const std::string& source_code);
   _IGNORE(clutter_shader_set_fragment_source)
 
   _WRAP_METHOD(std::string get_fragment_source() const, clutter_shader_get_fragment_source)
 
-  //_WRAP_METHOD(bool bind(), clutter_shader_bind, errthrow)
+  _WRAP_METHOD(bool compile(), clutter_shader_compile, errthrow)
+  _WRAP_METHOD(bool is_compiled() const, clutter_shader_is_compiled)
   _WRAP_METHOD(void release(), clutter_shader_release)
-  //_WRAP_METHOD(bool is_bound() const, clutter_shader_is_bound)
   _WRAP_METHOD(void set_is_enabled(bool enabled = true), clutter_shader_set_is_enabled)
   _WRAP_METHOD(bool get_is_enabled() const, clutter_shader_get_is_enabled)
 
-  _WRAP_PROPERTY("bound", bool)
+  _WRAP_METHOD(void set_uniform_1f(const std::string& name, float value), clutter_shader_set_uniform_1f)
+
+  _WRAP_PROPERTY("compiled", bool)
   _WRAP_PROPERTY("enabled", bool)
   _WRAP_PROPERTY("fragment-source", std::string)
   _WRAP_PROPERTY("vertex-source", std::string)

Modified: cluttermm/trunk/examples/test-actors.cc
==============================================================================
--- cluttermm/trunk/examples/test-actors.cc	(original)
+++ cluttermm/trunk/examples/test-actors.cc	Tue Jun 24 17:45:21 2008
@@ -176,14 +176,12 @@
     Glib::RefPtr<Clutter::BehaviourScale> scaler_1 =
         Clutter::BehaviourScale::create (alpha,
                 0.5, 0.5,
-                1.0, 1.0,
-                Clutter::GRAVITY_CENTER);
+                1.0, 1.0);
 
     Glib::RefPtr<Clutter::BehaviourScale> scaler_2 =
         Clutter::BehaviourScale::create (alpha,
                 1.0, 1.0,
-                0.5, 0.5,
-                Clutter::GRAVITY_CENTER);
+                0.5, 0.5);
 
     // create a new group to hold multiple actors in a group
     oh->group = Clutter::Group::create ();

Modified: cluttermm/trunk/tests/test-alpha-creation.cc
==============================================================================
--- cluttermm/trunk/tests/test-alpha-creation.cc	(original)
+++ cluttermm/trunk/tests/test-alpha-creation.cc	Tue Jun 24 17:45:21 2008
@@ -25,8 +25,7 @@
     Glib::RefPtr<Clutter::BehaviourScale> scaler_1 =
         Clutter::BehaviourScale::create (alpha,
                 0.5, 0.5,
-                1.0, 1.0,
-                Clutter::GRAVITY_CENTER);
+                1.0, 1.0);
 
     // Show everying ( and map window )
     stage->show ();

Modified: cluttermm/trunk/tests/test-alpha-func.cc
==============================================================================
--- cluttermm/trunk/tests/test-alpha-func.cc	(original)
+++ cluttermm/trunk/tests/test-alpha-func.cc	Tue Jun 24 17:45:21 2008
@@ -33,8 +33,7 @@
     Glib::RefPtr<Clutter::BehaviourScale> scaler_1 =
         Clutter::BehaviourScale::create (alpha,
                 0.5, 0.5,
-                1.0, 1.0,
-                Clutter::GRAVITY_CENTER);
+                1.0, 1.0);
 
     // Show everying ( and map window )
     stage->show ();



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