[cairo-commit] cairo/src Makefile.am, 1.42, 1.43 cairo-features.h.in, 1.16, 1.17 cairo-pdf.h, 1.4, 1.5 cairo-png.c, NONE, 1.1 cairo-png.h, 1.3, 1.4 cairo.c, 1.64, 1.65 cairo_pdf_surface.c, 1.21, 1.22 cairo_png_surface.c, 1.20, NONE

Kristian Hogsberg commit at pdx.freedesktop.org
Mon Mar 28 13:58:28 PST 2005


Committed by: krh

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv8153/src

Modified Files:
	Makefile.am cairo-features.h.in cairo-pdf.h cairo-png.h 
	cairo.c cairo_pdf_surface.c 
Added Files:
	cairo-png.c 
Removed Files:
	cairo_png_surface.c 
Log Message:
2005-03-28  Kristian Høgsberg  <krh at redhat.com>

        * src/cairo-png.c (cairo_image_surface_write_png)
        (cairo_image_surface_create_from_png): New PNG utility functions.

        * src/cairo_pdf_surface.c, src/cairo-pdf.h: Reverse the naming of
        the pdf constructors so the callback based ones have the long
        names.



Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- Makefile.am	18 Mar 2005 19:15:25 -0000	1.42
+++ Makefile.am	28 Mar 2005 21:58:26 -0000	1.43
@@ -9,9 +9,9 @@
 libcairo_pdf_sources = cairo_pdf_surface.c
 endif
 
-if CAIRO_HAS_PNG_SURFACE
+if CAIRO_HAS_PNG_FUNCTIONS
 libcairo_png_headers = cairo-png.h
-libcairo_png_sources = cairo_png_surface.c
+libcairo_png_sources = cairo-png.c
 endif
 
 if CAIRO_HAS_XLIB_SURFACE

Index: cairo-features.h.in
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-features.h.in,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cairo-features.h.in	22 Feb 2005 19:35:03 -0000	1.16
+++ cairo-features.h.in	28 Mar 2005 21:58:26 -0000	1.17
@@ -41,8 +41,6 @@
 
 #define @PDF_SURFACE_FEATURE@
 
-#define @PNG_SURFACE_FEATURE@
-
 #define @XLIB_SURFACE_FEATURE@
 
 #define @QUARTZ_SURFACE_FEATURE@
@@ -59,6 +57,8 @@
 
 #define @ATSUI_FONT_FEATURE@
 
+#define @PNG_FUNCTIONS_FEATURE@
+
 #define @SANITY_CHECKING_FEATURE@
 
 #endif

Index: cairo-pdf.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo-pdf.h	16 Mar 2005 20:08:41 -0000	1.4
+++ cairo-pdf.h	28 Mar 2005 21:58:26 -0000	1.5
@@ -46,38 +46,38 @@
 CAIRO_BEGIN_DECLS
 
 void
-cairo_set_target_pdf (cairo_t			*cr,
-		      cairo_write_func_t	write_func,
-		      cairo_destroy_func_t	destroy_closure_func,
-		      void			*closure,
-		      double			width_inches,
-		      double			height_inches,
-		      double			x_pixels_per_inch,
-		      double			y_pixels_per_inch);
+cairo_set_target_pdf (cairo_t	*cr,
+		      FILE	*fp,
+		      double	width_inches,
+		      double	height_inches,
+		      double	x_pixels_per_inch,
+		      double	y_pixels_per_inch);
 
 void
-cairo_set_target_pdf_as_file (cairo_t	*cr,
-			      FILE	*fp,
-			      double	width_inches,
-			      double	height_inches,
-			      double	x_pixels_per_inch,
-			      double	y_pixels_per_inch);
+cairo_set_target_pdf_for_callback (cairo_t		*cr,
+				   cairo_write_func_t	write_func,
+				   cairo_destroy_func_t	destroy_closure_func,
+				   void			*closure,
+				   double		width_inches,
+				   double		height_inches,
+				   double		x_pixels_per_inch,
+				   double		y_pixels_per_inch);
 
 cairo_surface_t *
-cairo_pdf_surface_create (cairo_write_func_t	write_func,
-			  cairo_destroy_func_t	destroy_closure_func,
-			  void			*closure,
-			  double		width_inches,
-			  double		height_inches,
-			  double		x_pixels_per_inch,
-			  double		y_pixels_per_inch);
+cairo_pdf_surface_create (FILE		*fp,
+			  double	width_inches,
+			  double	height_inches,
+			  double	x_pixels_per_inch,
+			  double	y_pixels_per_inch);
 
 cairo_surface_t *
-cairo_pdf_surface_create_for_file (FILE		*fp,
-				   double	width_inches,
-				   double	height_inches,
-				   double	x_pixels_per_inch,
-				   double	y_pixels_per_inch);
+cairo_pdf_surface_create_for_callback (cairo_write_func_t	write_func,
+				       cairo_destroy_func_t	destroy_closure_func,
+				       void			*closure,
+				       double			width_inches,
+				       double			height_inches,
+				       double			x_pixels_per_inch,
+				       double			y_pixels_per_inch);
 
 CAIRO_END_DECLS
 

--- NEW FILE: cairo-png.c ---
(This appears to be a binary file; contents omitted.)

Index: cairo-png.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-png.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cairo-png.h	22 Feb 2005 19:35:03 -0000	1.3
+++ cairo-png.h	28 Mar 2005 21:58:26 -0000	1.4
@@ -39,26 +39,22 @@
 
 #include <cairo.h>
 
-#ifdef CAIRO_HAS_PNG_SURFACE
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
 
 #include <stdio.h>
 
 CAIRO_BEGIN_DECLS
 
-void
-cairo_set_target_png (cairo_t	*cr,
-		      FILE	*file,
-		      cairo_format_t	format,
-		      int	       	width,
-		      int		height);
+cairo_status_t
+cairo_surface_write_png (cairo_surface_t	*surface,
+			 FILE			*file);
 
 cairo_surface_t *
-cairo_png_surface_create (FILE			*file,
-			  cairo_format_t	format,
-			  int			width,
-			  int			height);
+cairo_image_surface_create_for_png (FILE	*file,
+				    int		*width,
+				    int		*height);
 
 CAIRO_END_DECLS
 
-#endif /* CAIRO_HAS_PNG_SURFACE */
+#endif /* CAIRO_HAS_PNG_FUNCTIONS */
 #endif /* CAIRO_PNG_H */

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- cairo.c	23 Mar 2005 21:52:11 -0000	1.64
+++ cairo.c	28 Mar 2005 21:58:26 -0000	1.65
@@ -389,14 +389,14 @@
 #include "cairo-pdf.h"
 
 void
-cairo_set_target_pdf (cairo_t			*cr,
-		      cairo_write_func_t	write,
-		      cairo_destroy_func_t	destroy_closure,
-		      void			*closure,
-		      double			width_inches,
-		      double			height_inches,
-		      double			x_pixels_per_inch,
-		      double			y_pixels_per_inch)
+cairo_set_target_pdf_for_callback (cairo_t		*cr,
+				   cairo_write_func_t	write,
+				   cairo_destroy_func_t	destroy_closure,
+				   void			*closure,
+				   double		width_inches,
+				   double		height_inches,
+				   double		x_pixels_per_inch,
+				   double		y_pixels_per_inch)
 {
     cairo_surface_t *surface;
 
@@ -404,9 +404,10 @@
     if (cr->status)
 	return;
 
-    surface = cairo_pdf_surface_create (write, destroy_closure, closure,
-					width_inches, height_inches,
-					x_pixels_per_inch, y_pixels_per_inch);
+    surface = cairo_pdf_surface_create_for_callback (write,
+						     destroy_closure, closure,
+						     width_inches, height_inches,
+						     x_pixels_per_inch, y_pixels_per_inch);
     if (surface == NULL) {
 	cr->status = CAIRO_STATUS_NO_MEMORY;
 	return;
@@ -419,12 +420,12 @@
 }
 
 void
-cairo_set_target_pdf_as_file (cairo_t	*cr,
-			      FILE	*fp,
-			      double	width_inches,
-			      double	height_inches,
-			      double	x_pixels_per_inch,
-			      double	y_pixels_per_inch)
+cairo_set_target_pdf (cairo_t	*cr,
+		      FILE	*fp,
+		      double	width_inches,
+		      double	height_inches,
+		      double	x_pixels_per_inch,
+		      double	y_pixels_per_inch)
 {
     cairo_surface_t *surface;
 
@@ -432,10 +433,10 @@
     if (cr->status)
 	return;
 
-    surface = cairo_pdf_surface_create_for_file (fp,
-						 width_inches, height_inches,
-						 x_pixels_per_inch,
-						 y_pixels_per_inch);
+    surface = cairo_pdf_surface_create (fp,
+					width_inches, height_inches,
+					x_pixels_per_inch,
+					y_pixels_per_inch);
     if (surface == NULL) {
 	cr->status = CAIRO_STATUS_NO_MEMORY;
 	return;

Index: cairo_pdf_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_pdf_surface.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cairo_pdf_surface.c	23 Mar 2005 21:49:33 -0000	1.21
+++ cairo_pdf_surface.c	28 Mar 2005 21:58:26 -0000	1.22
@@ -933,13 +933,13 @@
 }
 
 cairo_surface_t *
-cairo_pdf_surface_create (cairo_write_func_t	write,
-			  cairo_destroy_func_t	destroy_closure,
-			  void			*closure,
-			  double		width_inches,
-			  double		height_inches,
-			  double		x_pixels_per_inch,
-			  double		y_pixels_per_inch)
+cairo_pdf_surface_create_for_callback (cairo_write_func_t	write,
+				       cairo_destroy_func_t	destroy_closure,
+				       void			*closure,
+				       double			width_inches,
+				       double			height_inches,
+				       double			x_pixels_per_inch,
+				       double			y_pixels_per_inch)
 {
     cairo_output_stream_t *stream;
 
@@ -955,11 +955,11 @@
 }
 
 cairo_surface_t *
-cairo_pdf_surface_create_for_file (FILE		*fp,
-				   double	width_inches,
-				   double	height_inches,
-				   double	x_pixels_per_inch,
-				   double	y_pixels_per_inch)
+cairo_pdf_surface_create (FILE		*fp,
+			  double	width_inches,
+			  double	height_inches,
+			  double	x_pixels_per_inch,
+			  double	y_pixels_per_inch)
 {
     cairo_output_stream_t *stream;
 

--- cairo_png_surface.c DELETED ---




More information about the cairo-commit mailing list