[cairo-commit] cairomm/examples/text-rotate text-rotate.cc,1.1,1.2

Jonathon Jongsma commit at pdx.freedesktop.org
Mon Apr 3 16:52:28 PDT 2006


Committed by: jjongsma

Update of /cvs/cairo/cairomm/examples/text-rotate
In directory kemper:/tmp/cvs-serv20743/examples/text-rotate

Modified Files:
	text-rotate.cc 
Log Message:
2006-04-03  Jonathon Jongsma  <jonathon.jongsma at gmail.com>

	* examples/text-rotate/text-rotate.cc: protect PNG functions with #ifdef in
	case cairo wasn't compiled with PNG support


Index: text-rotate.cc
===================================================================
RCS file: /cvs/cairo/cairomm/examples/text-rotate/text-rotate.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- text-rotate.cc	15 Mar 2006 01:42:52 -0000	1.1
+++ text-rotate.cc	3 Apr 2006 23:52:26 -0000	1.2
@@ -18,6 +18,7 @@
  */
 
 #include <string>
+#include <iostream>
 #include <cairomm/cairomm.h>
 
 // This example is based on the C cairo example of the same name
@@ -83,5 +84,9 @@
     Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, WIDTH, HEIGHT);
     Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
     draw(cr, WIDTH, HEIGHT);
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
     surface->write_to_png("text-rotate.png");
+#else
+    std::cout << "You must compile cairo with PNG support for this example to work" << std::endl;
+#endif
 }



More information about the cairo-commit mailing list