summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@gnome.org>2006-04-03 23:52:26 +0000
committerJonathon Jongsma <jjongsma@gnome.org>2006-04-03 23:52:26 +0000
commiteb9070f20ea20d2982940e048eb1a0e2032ab026 (patch)
tree4ce1087031c003e7fca3139c716501be7dc01047
parentc0759862cd5e99e914377e37fc5bcfec0f234efe (diff)
2006-04-03 Jonathon Jongsma <jonathon.jongsma@gmail.com>
* examples/text-rotate/text-rotate.cc: protect PNG functions with #ifdef in case cairo wasn't compiled with PNG support
-rw-r--r--ChangeLog5
-rw-r--r--examples/text-rotate/text-rotate.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8852408..35dab43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-03 Jonathon Jongsma <jonathon.jongsma@gmail.com>
+
+ * examples/text-rotate/text-rotate.cc: protect PNG functions with #ifdef in
+ case cairo wasn't compiled with PNG support
+
2006-03-31 Danilo Piazzalunga <danilopiazza@gmail.com>
* Makefile.am:
diff --git a/examples/text-rotate/text-rotate.cc b/examples/text-rotate/text-rotate.cc
index 3e210fa..9b3bceb 100644
--- a/examples/text-rotate/text-rotate.cc
+++ b/examples/text-rotate/text-rotate.cc
@@ -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 @@ int main (void)
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
}