[cairo-commit] cairomm/cairomm surface.cc, 1.5, 1.6 surface.h, 1.3, 1.4

Murray Cumming commit at pdx.freedesktop.org
Sat Jan 7 03:53:04 PST 2006


Committed by: murrayc

Update of /cvs/cairo/cairomm/cairomm
In directory gabe:/tmp/cvs-serv1730/cairomm

Modified Files:
	surface.cc surface.h 
Log Message:
2006-01-06  Jonathon Jongsma  <jonathon.jongsma at gmail.com>

        * cairomm/surface.cc:
        * cairomm/surface.h: Added implementation of write_to_png() and
        write_to_png_stream() when PNG support is available in the base cairo
        library
        * examples/png_file/*: Added an example of creating an image surface and
        saving it to a png image file
        * examples/Makefile.am: add new example directory to SUBDIRS list
        * configure.in: added output declaration for examples/png_file/Makefile
        * examples/makefile.am_fragment: fix leftover libxml boilerplate


Index: surface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- surface.cc	6 Jan 2006 16:14:19 -0000	1.5
+++ surface.cc	7 Jan 2006 11:53:02 -0000	1.6
@@ -63,7 +63,7 @@
   check_object_status_and_throw_exception(*this);
 }
 
-/* Seems to have been removed from the Cairo API:
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
 Status Surface::write_to_png(const std::string& filename)
 {
   return (Status)cairo_surface_write_to_png(m_cobject, filename.c_str());
@@ -73,7 +73,7 @@
 {
   return (Status)cairo_surface_write_to_png_stream(m_cobject, write_func, closure);
 }
-*/
+#endif
 
 void* Surface::get_user_data(const cairo_user_data_key_t *key)
 {

Index: surface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- surface.h	20 Dec 2005 09:17:53 -0000	1.3
+++ surface.h	7 Jan 2006 11:53:02 -0000	1.4
@@ -55,8 +55,9 @@
   static RefPtr<Surface> create(Format format, int width, int height);
   static RefPtr<Surface> create(unsigned char* data, Format format, int width, int height, int stride);
 
-  //void write_to_png(const std::string& filename);
-  //void write_to_png_stream(cairo_write_func_t write_func, void *closure); //TODO: Use a sigc::slot?
+  Status write_to_png(const std::string& filename);
+  Status write_to_png_stream(cairo_write_func_t write_func, void *closure); //TODO: Use a sigc::slot?
+
   void *get_user_data(const cairo_user_data_key_t *key);
 
   void set_user_data(const cairo_user_data_key_t *key, void *user_data, cairo_destroy_func_t destroy); //TODO: Use a sigc::slot?



More information about the cairo-commit mailing list