[cairo-commit] cairo/src Makefile.am, 1.28, 1.29 cairo-features.h.in, 1.10, 1.11 cairo.h, 1.62, 1.63 cairo_array.c, NONE, 1.1 cairo_gdip_surface.cpp, 1.1, 1.2 cairo_pdf_surface.c, NONE, 1.1 cairoint.h, 1.78, 1.79

Kristian Hogsberg commit at pdx.freedesktop.org
Wed Jan 5 14:29:34 PST 2005


Committed by: krh

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

Modified Files:
	Makefile.am cairo-features.h.in cairo.h cairo_gdip_surface.cpp 
	cairoint.h 
Added Files:
	cairo_array.c cairo_pdf_surface.c 
Log Message:
2005-01-05  Kristian Høgsberg  <krh at redhat.com>

        * src/cairo_pdf_surface.c: New PDF backend.
        * src/cairo.h: Add PDF surface constructors.
        * src/cairo_array.c: New file - generic array implementation.
        * src/cairoint.h: Add cairo_array prototypes.
        * src/Makefile.am (libcairo_la_SOURCES): Add cairo_array.c and cairo_pdf_surface.c.



Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- Makefile.am	26 Oct 2004 21:38:43 -0000	1.28
+++ Makefile.am	5 Jan 2005 22:29:31 -0000	1.29
@@ -5,6 +5,10 @@
 libcairo_ps_sources = cairo_ps_surface.c
 endif
 
+if CAIRO_HAS_PDF_SURFACE
+libcairo_pdf_sources = cairo_pdf_surface.c
+endif
+
 if CAIRO_HAS_PNG_SURFACE
 libcairo_png_sources = cairo_png_surface.c
 endif
@@ -31,6 +35,7 @@
 libcairo_la_SOURCES = 		\
 	cairo.c			\
 	cairo.h			\
+	cairo_array.c		\
 	cairo_cache.c		\
 	cairo_color.c		\
 	cairo_fixed.c		\
@@ -54,6 +59,7 @@
 	cairo_wideint.c		\
 	cairo_wideint.h		\
 	$(libcairo_ps_sources)  \
+	$(libcairo_pdf_sources) \
 	$(libcairo_png_sources) \
 	$(libcairo_xlib_sources)\
 	$(libcairo_xcb_sources) \

Index: cairo-features.h.in
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-features.h.in,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cairo-features.h.in	11 Sep 2004 11:23:18 -0000	1.10
+++ cairo-features.h.in	5 Jan 2005 22:29:31 -0000	1.11
@@ -39,6 +39,8 @@
 
 #define @PS_SURFACE_FEATURE@
 
+#define @PDF_SURFACE_FEATURE@
+
 #define @PNG_SURFACE_FEATURE@
 
 #define @XLIB_SURFACE_FEATURE@

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- cairo.h	1 Nov 2004 15:58:27 -0000	1.62
+++ cairo.h	5 Jan 2005 22:29:31 -0000	1.63
@@ -112,6 +112,20 @@
 
 #endif /* CAIRO_HAS_PS_SURFACE */
 
+#ifdef CAIRO_HAS_PDF_SURFACE
+
+#include <stdio.h>
+
+void
+cairo_set_target_pdf (cairo_t	*cr,
+		      FILE	*file,
+		      double	width_inches,
+		      double	height_inches,
+		      double	x_pixels_per_inch,
+		      double	y_pixels_per_inch);
+
+#endif /* CAIRO_HAS_PDF_SURFACE */
+
 #ifdef CAIRO_HAS_PNG_SURFACE
 
 #include <stdio.h>
@@ -748,6 +762,17 @@
 
 #endif /* CAIRO_HAS_PS_SURFACE */
 
+#ifdef CAIRO_HAS_PDF_SURFACE
+
+cairo_surface_t *
+cairo_pdf_surface_create (FILE		*file,
+			  double	width_inches,
+			  double	height_inches,
+			  double	x_pixels_per_inch,
+			  double	y_pixels_per_inch);
+
+#endif /* CAIRO_HAS_PDF_SURFACE */
+
 #ifdef CAIRO_HAS_PNG_SURFACE
 
 /* PNG-surface functions */

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

Index: cairo_gdip_surface.cpp
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gdip_surface.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo_gdip_surface.cpp	12 Nov 2004 22:46:23 -0000	1.1
+++ cairo_gdip_surface.cpp	5 Jan 2005 22:29:31 -0000	1.2
@@ -53,6 +53,10 @@
 #pragma comment(linker, "/EXPORT:_cairo_set_target_ps")
 #endif
 
+#ifdef CAIRO_HAS_PS_SURFACE
+#pragma comment(linker, "/EXPORT:_cairo_set_target_pdf")
+#endif
+
 #ifdef CAIRO_HAS_PNG_SURFACE
 #pragma comment(linker, "/EXPORT:_cairo_set_target_png")
 #endif

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

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- cairoint.h	21 Dec 2004 21:22:44 -0000	1.78
+++ cairoint.h	5 Jan 2005 22:29:31 -0000	1.79
@@ -254,6 +254,40 @@
 typedef struct cairo_color cairo_color_t;
 typedef struct cairo_image_surface cairo_image_surface_t;
 
+/* cairo_array.c structures and functions */ 
+
+typedef struct cairo_array cairo_array_t;
+struct cairo_array {
+    int size;
+    int num_elements;
+    int element_size;
+    char *elements;
+};
+
+cairo_private void
+_cairo_array_init (cairo_array_t *array, int element_size);
+
+cairo_private void
+_cairo_array_fini (cairo_array_t *array);
+
+cairo_private cairo_status_t
+_cairo_array_grow_by (cairo_array_t *array, int additional);
+
+cairo_private void
+_cairo_array_truncate (cairo_array_t *array, int length);
+
+cairo_private cairo_status_t
+_cairo_array_append (cairo_array_t *array, void *elements, int num_elements);
+
+cairo_private void *
+_cairo_array_index (cairo_array_t *array, int index);
+
+cairo_private void
+_cairo_array_copy_element (cairo_array_t *array, int index, void *dst);
+
+cairo_private int
+_cairo_array_num_elements (cairo_array_t *array);
+
 /* cairo_cache.c structures and functions */ 
 
 typedef struct cairo_cache_backend {




More information about the cairo-commit mailing list