gnomemm r2152 - in cluttermm/trunk: . clutter clutter/cluttermm clutter/src tools/m4



Author: siavashs
Date: Sat Apr 11 15:05:48 2009
New Revision: 2152
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2152&view=rev

Log:
* Added the Cairo API and wrapped most of the remaining method

  * trunk/clutter/src/cairo-texture.ccg:
  * trunk/clutter/src/cairo-texture.hg: Added the Cairo API
  * trunk/tools/m4/convert_cairomm.m4:
  * clutter/cluttermm.h:
  * clutter/cluttermm/main.cc:
  * clutter/cluttermm/main.h: Added get_font_map()
  * clutter/src/Makefile_list_of_hg.am_fragment:
  * clutter/src/alpha.ccg: Remove Deprecated API which is replaced by
  the Animation API
  * clutter/src/color.hg: Ignored clutter_color_from_string() which
  is already hand coded
  * clutter/src/media.hg: Added set/get_progress() methods and progress
  property
  * clutter/src/path.hg: Hand coded PathNodeType enum, added Cairo API and
  clear(), get_position() methods
  * clutter/src/script.ccg:
  * clutter/src/script.hg: Added add_search_paths() and lookup_filename()
  methods
  * clutter/src/shader.hg: Added Cogl API
  * clutter/src/stage.hg: Added ensure_viewport()
  * clutter/src/texture.hg: Added Cogl API
  * tools/m4/Makefile_list_of_sources.am_fragment:
  * tools/m4/convert.m4:

Added:
   cluttermm/trunk/clutter/src/cairo-texture.ccg
   cluttermm/trunk/clutter/src/cairo-texture.hg
   cluttermm/trunk/tools/m4/convert_cairomm.m4
Modified:
   cluttermm/trunk/ChangeLog
   cluttermm/trunk/clutter/cluttermm.h
   cluttermm/trunk/clutter/cluttermm/main.cc
   cluttermm/trunk/clutter/cluttermm/main.h
   cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment
   cluttermm/trunk/clutter/src/alpha.ccg
   cluttermm/trunk/clutter/src/color.hg
   cluttermm/trunk/clutter/src/media.hg
   cluttermm/trunk/clutter/src/path.hg
   cluttermm/trunk/clutter/src/script.ccg
   cluttermm/trunk/clutter/src/script.hg
   cluttermm/trunk/clutter/src/shader.hg
   cluttermm/trunk/clutter/src/stage.hg
   cluttermm/trunk/clutter/src/texture.hg
   cluttermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment
   cluttermm/trunk/tools/m4/convert.m4

Modified: cluttermm/trunk/clutter/cluttermm.h
==============================================================================
--- cluttermm/trunk/clutter/cluttermm.h	(original)
+++ cluttermm/trunk/clutter/cluttermm.h	Sat Apr 11 15:05:48 2009
@@ -37,6 +37,7 @@
 #include <cluttermm/behaviour-path.h>
 #include <cluttermm/behaviour-rotate.h>
 #include <cluttermm/behaviour-scale.h>
+#include <cluttermm/cairo-texture.h>
 #include <cluttermm/clone.h>
 #include <cluttermm/color.h>
 #include <cluttermm/event.h>

Modified: cluttermm/trunk/clutter/cluttermm/main.cc
==============================================================================
--- cluttermm/trunk/clutter/cluttermm/main.cc	(original)
+++ cluttermm/trunk/clutter/cluttermm/main.cc	Sat Apr 11 15:05:48 2009
@@ -103,6 +103,11 @@
   return (FontFlags)clutter_get_font_flags();
 }
 
+Glib::RefPtr<Pango::FontMap> get_font_map()
+{
+  return Glib::wrap(clutter_get_font_map());
+}
+
 Glib::RefPtr<Actor> get_keyboard_grab()
 {
   return Glib::wrap(clutter_get_keyboard_grab(), true);

Modified: cluttermm/trunk/clutter/cluttermm/main.h
==============================================================================
--- cluttermm/trunk/clutter/cluttermm/main.h	(original)
+++ cluttermm/trunk/clutter/cluttermm/main.h	Sat Apr 11 15:05:48 2009
@@ -128,6 +128,7 @@
 
 FontFlags get_font_flags();
 
+Glib::RefPtr<Pango::FontMap> get_font_map();
 
 /** Queries the current keyboard grab of clutter.
  * @return the actor currently holding the keyboard grab, or an empty

Modified: cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment	(original)
+++ cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment	Sat Apr 11 15:05:48 2009
@@ -13,6 +13,7 @@
 behaviour-path.hg \
 behaviour-rotate.hg \
 behaviour-scale.hg \
+cairo-texture.hg \
 childmeta.hg \
 clone.hg \
 color.hg \

Modified: cluttermm/trunk/clutter/src/alpha.ccg
==============================================================================
--- cluttermm/trunk/clutter/src/alpha.ccg	(original)
+++ cluttermm/trunk/clutter/src/alpha.ccg	Sat Apr 11 15:05:48 2009
@@ -51,100 +51,6 @@
 namespace Clutter
 {
 
-/* TODO: What's the clutter-0.10 equivalent?
-
-guint32 Alpha::ramp_inc_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_ramp_inc_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::ramp_dec_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_ramp_dec_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::ramp_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_ramp_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_inc_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_inc_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_dec_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_dec_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_half_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_half_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_in_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_in_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_out_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_out_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::sine_in_out_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_sine_in_out_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::square_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_square_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::smoothstep_inc_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_smoothstep_inc_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::smoothstep_dec_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_smoothstep_dec_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::exp_inc_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_exp_inc_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::exp_dec_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_exp_dec_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::ease_in_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_ease_in_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::ease_out_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_ease_out_func(alpha->gobj(), 0);
-}
-
-guint32 Alpha::ease_in_out_func(const Glib::RefPtr<Alpha>& alpha)
-{
-  return clutter_ease_in_out_func(alpha->gobj(), 0);
-}
-
-*/
-
 Alpha::Alpha(const Glib::RefPtr<Timeline>& timeline, const SlotAlphaFunc& slot)
 :
   _CONSTRUCT()

Added: cluttermm/trunk/clutter/src/cairo-texture.ccg
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter/src/cairo-texture.ccg	Sat Apr 11 15:05:48 2009
@@ -0,0 +1,34 @@
+/* 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <clutter/clutter.h>
+
+namespace Clutter
+{
+
+namespace Cairo
+{
+
+void set_source_color(Glib::RefPtr< ::Cairo::Context >& context, ::Clutter::Color color)
+{
+  clutter_cairo_set_source_color(context->cobj(), color.gobj());
+}
+
+} // namespace Cairo
+
+} //namespace Clutter
+

Added: cluttermm/trunk/clutter/src/cairo-texture.hg
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter/src/cairo-texture.hg	Sat Apr 11 15:05:48 2009
@@ -0,0 +1,53 @@
+/* Copyright (C) 2009 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/object.h>
+#include <cairomm/context.h>
+#include <cluttermm/color.h>
+#include <cluttermm/texture.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(cluttermm/private/texture_p.h)
+
+namespace Clutter
+{
+
+namespace Cairo
+{
+
+class Texture : public ::Clutter::Texture
+{
+  _CLASS_GOBJECT(Texture, ClutterCairoTexture, CLUTTER_CAIRO_TEXTURE, ::Clutter::Texture, ClutterTexture)
+  _IMPLEMENTS_INTERFACE(Scriptable)
+
+protected:
+  _WRAP_CTOR(Texture(guint width, guint height), clutter_cairo_texture_new)
+
+public:
+  _WRAP_CREATE(guint width, guint height)
+
+  _WRAP_METHOD(void set_surface_size(guint width, guint height), clutter_cairo_texture_set_surface_size)
+  _WRAP_METHOD(void get_surface_size(guint& width, guint& height) const, clutter_cairo_texture_get_surface_size)
+  _WRAP_METHOD(Glib::RefPtr< ::Cairo::Context > create_context(), clutter_cairo_texture_create)
+  _WRAP_METHOD(Glib::RefPtr< ::Cairo::Context > create_context_region(int x_offset, int y_offset, int width, int height), clutter_cairo_texture_create_region)
+};
+
+void set_source_color(Glib::RefPtr< ::Cairo::Context >& context, ::Clutter::Color color);
+
+} // namespace Cairo
+
+} // namespace Clutter

Modified: cluttermm/trunk/clutter/src/color.hg
==============================================================================
--- cluttermm/trunk/clutter/src/color.hg	(original)
+++ cluttermm/trunk/clutter/src/color.hg	Sat Apr 11 15:05:48 2009
@@ -51,6 +51,7 @@
 
   void set_from_rgb(guint8 red, guint8 blue, guint8 green);
   void set_from_string(const Glib::ustring& color);
+  _IGNORE(clutter_color_from_string)
   _WRAP_METHOD(Glib::ustring to_string() const, clutter_color_to_string)
   _WRAP_METHOD(void set_from_hls(float hue, float luminance, float saturation), clutter_color_from_hls)
   _WRAP_METHOD(void to_hls(float& hue, float& luminance, float& saturation) const, clutter_color_to_hls)

Modified: cluttermm/trunk/clutter/src/media.hg
==============================================================================
--- cluttermm/trunk/clutter/src/media.hg	(original)
+++ cluttermm/trunk/clutter/src/media.hg	Sat Apr 11 15:05:48 2009
@@ -36,6 +36,8 @@
   _WRAP_METHOD(Glib::ustring get_uri() const, clutter_media_get_uri)
   _WRAP_METHOD(void set_playing(bool playing=true), clutter_media_set_playing)
   _WRAP_METHOD(bool get_playing() const, clutter_media_get_playing)
+  _WRAP_METHOD(void set_progress(double progress), clutter_media_set_progress)
+  _WRAP_METHOD(double get_progress() const, clutter_media_get_progress)
   _WRAP_METHOD(void set_audio_volume(double volume), clutter_media_set_audio_volume)
   _WRAP_METHOD(double get_audio_volume() const, clutter_media_get_audio_volume)
   _WRAP_METHOD(double get_buffer_percent() const, clutter_media_get_buffer_fill)
@@ -43,7 +45,6 @@
   _WRAP_METHOD(bool get_can_seek() const, clutter_media_get_can_seek)
   _WRAP_METHOD(double get_duration() const, clutter_media_get_duration)
 
-
   _WRAP_SIGNAL(void eos(), "eos")
   // TODO: figure out what to do with this GError parameter
   //_WRAP_SIGNAL(void error(GError* error), "error")
@@ -52,11 +53,9 @@
   _WRAP_PROPERTY("can-seek", bool)
   _WRAP_PROPERTY("duration", guint)
   _WRAP_PROPERTY("playing", bool)
+  _WRAP_PROPERTY("progress", double)
   _WRAP_PROPERTY("uri", Glib::ustring)
   _WRAP_PROPERTY("audio-volume", double)
-
-  //TODO: There are probably some extra propertys in clutter-0.10.
-
 };
 
 } // namespace Clutter

Modified: cluttermm/trunk/clutter/src/path.hg
==============================================================================
--- cluttermm/trunk/clutter/src/path.hg	(original)
+++ cluttermm/trunk/clutter/src/path.hg	Sat Apr 11 15:05:48 2009
@@ -20,13 +20,23 @@
 
 #include <cluttermm/types.h>
 #include <glibmm/object.h>
+#include <cairomm/context.h>
 #include <clutter/clutter.h>
 _PINCLUDE(glibmm/private/object_p.h)
 
 namespace Clutter
 {
 
-_WRAP_ENUM(PathNodeType, ClutterPathNodeType)
+enum PathNodeType
+{
+  PATH_MOVE_TO,
+  PATH_LINE_TO,
+  PATH_CURVE_TO,
+  PATH_CLOSE,
+  PATH_REL_MOVE_TO = PATH_MOVE_TO | CLUTTER_PATH_RELATIVE,
+  PATH_REL_LINE_TO = PATH_LINE_TO | CLUTTER_PATH_RELATIVE,
+  PATH_REL_CURVE_TO = PATH_CURVE_TO | CLUTTER_PATH_RELATIVE
+};
 
 class PathNode
 {
@@ -119,6 +129,11 @@
   _WRAP_METHOD(Glib::ustring get_description() const, clutter_path_get_description)
   _WRAP_METHOD(void set_description(const Glib::ustring& str), clutter_path_set_description)
 
+  _WRAP_METHOD(void add_cairo_path(const Glib::RefPtr<Cairo::Path>& path), clutter_path_add_cairo_path)
+  _WRAP_METHOD(void to_cairo_path(Glib::RefPtr<Cairo::Context>& context) const, clutter_path_to_cairo_path)
+
+  _WRAP_METHOD(void clear(), clutter_path_clear)
+  _WRAP_METHOD(guint get_position(double progress, Knot& position), clutter_path_get_position)
   _WRAP_METHOD(guint get_length() const, clutter_path_get_length)
 
   _WRAP_PROPERTY("description", Glib::ustring)

Modified: cluttermm/trunk/clutter/src/script.ccg
==============================================================================
--- cluttermm/trunk/clutter/src/script.ccg	(original)
+++ cluttermm/trunk/clutter/src/script.ccg	Sat Apr 11 15:05:48 2009
@@ -39,6 +39,11 @@
   return result;
 }
 
+void Script::add_search_paths(const Glib::ArrayHandle<Glib::ustring>& paths)
+{
+  clutter_script_add_search_paths(gobj(), paths.data(), paths.size());
+}
+
 #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.

Modified: cluttermm/trunk/clutter/src/script.hg
==============================================================================
--- cluttermm/trunk/clutter/src/script.hg	(original)
+++ cluttermm/trunk/clutter/src/script.hg	Sat Apr 11 15:05:48 2009
@@ -48,6 +48,9 @@
 #endif
   _WRAP_METHOD(guint load_from_file(const std::string& filename), clutter_script_load_from_file, errthrow)
 
+  _IGNORE(clutter_script_add_search_paths)
+  void add_search_paths(const Glib::ArrayHandle<Glib::ustring>& paths);
+  _WRAP_METHOD(Glib::ustring lookup_filename(const Glib::ustring& filename), clutter_script_lookup_filename)
   _WRAP_METHOD(Glib::RefPtr<Glib::Object> get_object(const Glib::ustring& name), clutter_script_get_object, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Glib::Object> get_object(const Glib::ustring& name) const, clutter_script_get_object, refreturn, constverrsion)
 

Modified: cluttermm/trunk/clutter/src/shader.hg
==============================================================================
--- cluttermm/trunk/clutter/src/shader.hg	(original)
+++ cluttermm/trunk/clutter/src/shader.hg	Sat Apr 11 15:05:48 2009
@@ -58,8 +58,10 @@
   _WRAP_METHOD(void release(), clutter_shader_release)
   _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_METHOD(void set_uniform_1f(const std::string& name, float value), clutter_shader_set_uniform_1f)
+  _WRAP_METHOD(void set_uniform(const Glib::ustring& name, const Glib::ValueBase& value), clutter_shader_set_uniform)
+  _WRAP_METHOD(CoglHandle get_cogl_program() const, clutter_shader_get_cogl_program)
+  _WRAP_METHOD(CoglHandle get_cogl_vertex_shader() const, clutter_shader_get_cogl_vertex_shader)
+  _WRAP_METHOD(CoglHandle get_cogl_fragment_shader() const, clutter_shader_get_cogl_fragment_shader)
 
   _WRAP_PROPERTY("compiled", bool)
   _WRAP_PROPERTY("enabled", bool)

Modified: cluttermm/trunk/clutter/src/stage.hg
==============================================================================
--- cluttermm/trunk/clutter/src/stage.hg	(original)
+++ cluttermm/trunk/clutter/src/stage.hg	Sat Apr 11 15:05:48 2009
@@ -93,6 +93,7 @@
   _WRAP_METHOD(void stage_event(Event* event), clutter_stage_event)
   _WRAP_METHOD(bool is_default() const, clutter_stage_is_default)
   _WRAP_METHOD(void ensure_current(), clutter_stage_ensure_current)
+  _WRAP_METHOD(void ensure_viewport(), clutter_stage_ensure_viewport)
 
   _WRAP_SIGNAL(void fullscreen(), "fullscreen")
   _WRAP_SIGNAL(void unfullscreen(), "unfullscreen")

Modified: cluttermm/trunk/clutter/src/texture.hg
==============================================================================
--- cluttermm/trunk/clutter/src/texture.hg	(original)
+++ cluttermm/trunk/clutter/src/texture.hg	Sat Apr 11 15:05:48 2009
@@ -70,7 +70,11 @@
   // TODO: Is there a coglmm we could depend on for this?
   _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_METHOD(CoglHandle get_cogl_material() const, clutter_texture_get_cogl_material)
+  _WRAP_METHOD(void set_cogl_material(CoglHandle handle), clutter_texture_set_cogl_material)
 
+  // TODO: figure out what to do with this GError parameter
+  //_WRAP_SIGNAL(void load_finished(GError* error), "load_finished")
   _WRAP_SIGNAL(void size_change(int width, int height), "size_change")
   _WRAP_SIGNAL(void pixbuf_change(), "pixbuf_change")
 

Modified: cluttermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment
==============================================================================
--- cluttermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment	(original)
+++ cluttermm/trunk/tools/m4/Makefile_list_of_sources.am_fragment	Sat Apr 11 15:05:48 2009
@@ -1 +1 @@
-files_tools_m4 = convert.m4 convert_cluttermm.m4 convert_coglmm.m4
+files_tools_m4 = convert.m4 convert_cairomm.m4 convert_cluttermm.m4 convert_coglmm.m4

Modified: cluttermm/trunk/tools/m4/convert.m4
==============================================================================
--- cluttermm/trunk/tools/m4/convert.m4	(original)
+++ cluttermm/trunk/tools/m4/convert.m4	Sat Apr 11 15:05:48 2009
@@ -4,4 +4,5 @@
 
 include(convert_gtkmm.m4)
 include(convert_coglmm.m4)
+include(convert_cairomm.m4)
 include(convert_cluttermm.m4)

Added: cluttermm/trunk/tools/m4/convert_cairomm.m4
==============================================================================
--- (empty file)
+++ cluttermm/trunk/tools/m4/convert_cairomm.m4	Sat Apr 11 15:05:48 2009
@@ -0,0 +1,5 @@
+_CONVERSION(`const Glib::RefPtr<Cairo::Path>&',`const cairo_path_t*',`($3)->cobj()')
+_CONVERSION(`Glib::RefPtr<Cairo::Context>&',`cairo_t*',`($3)->cobj()')
+_CONVERSION(`Glib::RefPtr< ::Cairo::Context >&',`cairo_t*',`($3)->cobj()')
+_CONVERSION(`cairo_t*',`Glib::RefPtr< ::Cairo::Context >',`$2(new ::Cairo::Context ($3, true))')
+



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