gnomemm r2061 - in cluttermm_tutorial/branches/cluttermm-0.8: . docs/tutorial examples/behaviour examples/custom_actor examples/full_example examples/multiline_text_entry



Author: murrayc
Date: Tue Feb 17 10:28:43 2009
New Revision: 2061
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2061&view=rev

Log:
2009-02-17  Murray Cumming  <murrayc murrayc com>

* Makefile.am:
* configure.ac:
* docs/tutorial/cluttermm-tut.xml:
* examples/behaviour/main.cc:
* examples/custom_actor/triangle_actor.cc:
* examples/custom_actor/triangle_actor.h:
* examples/full_example/main.cc:
* examples/multiline_text_entry/multiline_entry.cc:
Back-ported to the cluttermm-0.8 API.

Modified:
   cluttermm_tutorial/branches/cluttermm-0.8/ChangeLog
   cluttermm_tutorial/branches/cluttermm-0.8/Makefile.am
   cluttermm_tutorial/branches/cluttermm-0.8/configure.ac
   cluttermm_tutorial/branches/cluttermm-0.8/docs/tutorial/cluttermm-tut.xml
   cluttermm_tutorial/branches/cluttermm-0.8/examples/behaviour/main.cc
   cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.cc
   cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.h
   cluttermm_tutorial/branches/cluttermm-0.8/examples/full_example/main.cc
   cluttermm_tutorial/branches/cluttermm-0.8/examples/multiline_text_entry/multiline_entry.cc

Modified: cluttermm_tutorial/branches/cluttermm-0.8/Makefile.am
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/Makefile.am	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/Makefile.am	Tue Feb 17 10:28:43 2009
@@ -86,7 +86,7 @@
 	examples/full_example/images/mikael_hallendal.jpg	\
 	examples/full_example/images/ryan_lortie.jpg
 
-cluttermm_docdir = $(datadir)/doc/cluttermm-0.9/docs
+cluttermm_docdir = $(datadir)/doc/cluttermm-0.8/docs
 tutorialdir	= $(cluttermm_docdir)/tutorial/html
 figuresdir	= $(cluttermm_docdir)/tutorial/figures
 iconsdir	= $(cluttermm_docdir)/tutorial/icons
@@ -122,7 +122,7 @@
 	docs/tutorial/icons/warning.png
 
 web_host	= www.openismus.com
-web_path	= /home/murrayc/openismus.com/documents/cluttermm_tutorial/0.9/
+web_path	= /home/murrayc/openismus.com/documents/cluttermm_tutorial/0.8/
 web_path_docs	= $(web_path)docs/
 
 clutter_tut_path = $(web_path_docs)tutorial

Modified: cluttermm_tutorial/branches/cluttermm-0.8/configure.ac
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/configure.ac	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/configure.ac	Tue Feb 17 10:28:43 2009
@@ -16,7 +16,7 @@
 ## along with the Cluttermm Tutorial; if not, write to the Free Software
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
-AC_INIT([cluttermm_tutorial], [0.9], [http://www.gtkmm.org/], [cluttermm_tutorial])
+AC_INIT([cluttermm_tutorial], [0.7.4], [http://www.gtkmm.org/], [cluttermm_tutorial])
 AC_PREREQ([2.58])
 
 AC_CONFIG_SRCDIR([examples/custom_actor/triangle_actor.cc])
@@ -27,7 +27,7 @@
 AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
 
 AC_PROG_CXX()
-PKG_CHECK_MODULES([TUTORIAL_MODULES], [cluttermm-0.9 >= 0.9.0 clutter-gtkmm-0.9 >= 0.9.0])
+PKG_CHECK_MODULES([TUTORIAL_MODULES], [cluttermm-0.8 >= 0.7.4 clutter-gtkmm-0.8 >= 0.7.4])
 
 AC_LANG([C++])
 

Modified: cluttermm_tutorial/branches/cluttermm-0.8/docs/tutorial/cluttermm-tut.xml
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/docs/tutorial/cluttermm-tut.xml	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/docs/tutorial/cluttermm-tut.xml	Tue Feb 17 10:28:43 2009
@@ -5,16 +5,16 @@
  <!ENTITY clutter "<application>Clutter</application>">
  <!ENTITY cluttermm "<application>Cluttermm</application>">
  <!ENTITY tidy "<application>Tidy</application>">
- <!ENTITY clutterversion "0.9">
+ <!ENTITY clutterversion "0.8">
  <!ENTITY gtk "<application>GTK+</application>">
  <!ENTITY gtkmm "<application>gtkmm</application>">
  <!ENTITY url_figures_base "../figures/">
  <!ENTITY url_examples_base "../../../examples/">
- <!ENTITY url_refdocs_base_clutter "http://clutter-project.org/docs/clutter/0.9/Clutter";>
- <!ENTITY url_refdocs_base_clutter_alt "http://clutter-project.org/docs/clutter/0.9/clutter-Clutter-";>
- <!ENTITY url_refdocs_base_clutter_gtk "http://www.clutter-project.org/docs/clutter-gtk/0.9/";>
- <!ENTITY url_refdocs_base_cluttermm "http://www.gtkmm.org/docs/cluttermm-0.9/docs/reference/html/";>
- <!ENTITY url_refdocs_base_clutter_gtkmm "http://www.gtkmm.org/docs/clutter-gtkmm-0.9/docs/reference/html/";>
+ <!ENTITY url_refdocs_base_clutter "http://clutter-project.org/docs/clutter/0.8/Clutter";>
+ <!ENTITY url_refdocs_base_clutter_alt "http://clutter-project.org/docs/clutter/0.8/clutter-Clutter-";>
+ <!ENTITY url_refdocs_base_clutter_gtk "http://www.clutter-project.org/docs/clutter-gtk/0.8/";>
+ <!ENTITY url_refdocs_base_cluttermm "http://www.gtkmm.org/docs/cluttermm-0.8/docs/reference/html/";>
+ <!ENTITY url_refdocs_base_clutter_gtkmm "http://www.gtkmm.org/docs/clutter-gtkmm-0.8/docs/reference/html/";>
 ]>
 
 <!--

Modified: cluttermm_tutorial/branches/cluttermm-0.8/examples/behaviour/main.cc
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/examples/behaviour/main.cc	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/examples/behaviour/main.cc	Tue Feb 17 10:28:43 2009
@@ -81,7 +81,7 @@
     knots[1].set_xy(150, 150);
 
     const Glib::RefPtr<Clutter::Behaviour>
-      behaviour = Clutter::BehaviourPath::create_with_knots(alpha, knots);
+      behaviour = Clutter::BehaviourPath::create(alpha, knots);
     behaviour->apply(rect);
   }
 

Modified: cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.cc
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.cc	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.cc	Tue Feb 17 10:28:43 2009
@@ -43,12 +43,12 @@
 Triangle::~Triangle()
 {}
 
-void Triangle::do_triangle_paint(const CoglColor* color)
+void Triangle::do_triangle_paint(const Clutter::Color& color)
 {
   const Clutter::Geometry geom = get_geometry();
 
   cogl_push_matrix();
-  cogl_set_source_color(color);
+  cogl_color(color.gobj());
 
   ClutterFixed coords[6];
 
@@ -71,16 +71,10 @@
 
 void Triangle::on_paint()
 {
-  CoglColor coglcolor;
-
   // Paint the triangle with the actor's color:
-  cogl_color_set_from_4ub(&coglcolor,
-    color_.get_red(),
-    color_.get_green(),
-    color_.get_blue(),
-    get_opacity());
-
-  do_triangle_paint(&coglcolor);
+  Clutter::Color color(color_);
+  color.set_alpha( get_opacity() );
+  do_triangle_paint(color);
 }
 
 void Triangle::pick_vfunc(const Clutter::Color& color)
@@ -88,13 +82,7 @@
   // Paint the triangle with the pick color, offscreen.
   // This is used by Clutter to detect the actor under the cursor 
   // by identifying the unique color under the cursor.
-  CoglColor coglcolor;
-  cogl_color_set_from_4ub(&coglcolor,
-                          color.get_red(),
-                          color.get_green(),
-                          color.get_blue(),
-                          color.get_alpha());
-  do_triangle_paint(&coglcolor);
+  do_triangle_paint(color);
 }
 
 /**

Modified: cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.h
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.h	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/examples/custom_actor/triangle_actor.h	Tue Feb 17 10:28:43 2009
@@ -44,7 +44,7 @@
 private:
   Clutter::Color color_;
 
-  void do_triangle_paint(const CoglColor* color);
+  void do_triangle_paint(const Clutter::Color& color);
 };
 
 } // namespace Tutorial

Modified: cluttermm_tutorial/branches/cluttermm-0.8/examples/full_example/main.cc
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/examples/full_example/main.cc	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/examples/full_example/main.cc	Tue Feb 17 10:28:43 2009
@@ -251,7 +251,7 @@
   knots[0].set_xy(actor->get_x(), actor->get_y());
   knots[1].set_xy(knots[0].get_x(), knots[0].get_y() - 250);
 
-  behaviour_path_ = Clutter::BehaviourPath::create_with_knots(alpha, knots);
+  behaviour_path_ = Clutter::BehaviourPath::create(alpha, knots);
   behaviour_path_->apply(actor);
 
   // Show the filename gradually:

Modified: cluttermm_tutorial/branches/cluttermm-0.8/examples/multiline_text_entry/multiline_entry.cc
==============================================================================
--- cluttermm_tutorial/branches/cluttermm-0.8/examples/multiline_text_entry/multiline_entry.cc	(original)
+++ cluttermm_tutorial/branches/cluttermm-0.8/examples/multiline_text_entry/multiline_entry.cc	Tue Feb 17 10:28:43 2009
@@ -17,7 +17,7 @@
 
 #include "multiline_entry.h"
 #include <cogl/cogl.h>
-#include <cogl/cogl-pango.h>
+#include <clutter/pangoclutter.h>
 
 namespace
 {
@@ -29,6 +29,7 @@
 static Glib::RefPtr<Pango::Context> ref_shared_context()
 {
   static void* context = 0;
+  PangoClutterFontMap  *font_map = NULL;
 
   if(context == 0)
   {
@@ -37,10 +38,9 @@
     if(resolution < 0.0)
       resolution = 96.0; // fallback
 
-    PangoFontMap *const fontmap = cogl_pango_font_map_new();
-    cogl_pango_font_map_set_resolution(COGL_PANGO_FONT_MAP(fontmap), resolution);
-
-    context = cogl_pango_font_map_create_context(COGL_PANGO_FONT_MAP(fontmap));
+    font_map = PANGO_CLUTTER_FONT_MAP (pango_clutter_font_map_new ());
+    pango_clutter_font_map_set_resolution (font_map, resolution);
+    context = pango_clutter_font_map_create_context (font_map);
 
     // Clear the pointer when the object is destroyed:
     g_object_add_weak_pointer(static_cast<GObject*>(context), &context);
@@ -330,13 +330,10 @@
     text_x_ = 0;
   }
 
-  CoglColor color;
+  Clutter::Color color = fgcol_;
+  color.set_alpha( get_opacity() );
 
-  cogl_color_set_from_4ub(&color, fgcol_.get_red(),
-                                  fgcol_.get_green(),
-                                  fgcol_.get_blue(),
-                                  get_opacity());
-  cogl_pango_render_layout(layout_->gobj(), text_x_, 0, &color, 0);
+  pango_clutter_render_layout(layout_->gobj(), text_x_, 0, color.gobj(), 0);
 
   paint_cursor_vfunc();
 }



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