[cairo-commit] cairo-demo/cairo_snippets ChangeLog, 1.19, 1.20 Makefile, 1.10, 1.11 cairo_snippets_pdf.c, 1.2, 1.3

Kristian Hogsberg commit at pdx.freedesktop.org
Wed Jan 5 14:32:33 PST 2005


Committed by: krh

Update of /cvs/cairo/cairo-demo/cairo_snippets
In directory gabe:/tmp/cvs-serv22583/cairo_snippets

Modified Files:
	ChangeLog Makefile cairo_snippets_pdf.c 
Log Message:
2005-01-05  Kristian Høgsberg  <krh at redhat.com>

        * Makefile (COMPILE_PROGS): Reenable PDF snippets.
        * cairo_snippets_pdf.c (main): Add feature to only output specific snippets.



Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/ChangeLog,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- ChangeLog	13 Oct 2004 18:24:11 -0000	1.19
+++ ChangeLog	5 Jan 2005 22:32:30 -0000	1.20
@@ -1,3 +1,8 @@
+2005-01-05  Kristian Høgsberg  <krh at redhat.com>
+
+	* Makefile (COMPILE_PROGS): Reenable PDF snippets.
+	* cairo_snippets_pdf.c (main): Add feature to only output specific snippets.
+
 2004-09-6  Owen Taylor  <otaylor at redhat.com>
 
 	* cairo_snippets_html.c (do_index): index() is a C library

Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile	13 Oct 2004 18:24:11 -0000	1.10
+++ Makefile	5 Jan 2005 22:32:30 -0000	1.11
@@ -1,8 +1,9 @@
-COMPILE_PROGS = cairo_snippets_gtk  \
-                cairo_snippets_png  \
-				cairo_snippets_ps   \
-				cairo_snippets_html
-#				cairo_snippets_pdf
+COMPILE_PROGS =					\
+	cairo_snippets_gtk			\
+	cairo_snippets_png			\
+	cairo_snippets_ps			\
+	cairo_snippets_html			\
+	cairo_snippets_pdf
 
 CFLAGS = `pkg-config --cflags cairo libpng libsvg-cairo`
 LIBS   = `pkg-config --libs   cairo libpng libsvg-cairo`

Index: cairo_snippets_pdf.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/cairo_snippets_pdf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo_snippets_pdf.c	18 May 2004 12:50:39 -0000	1.2
+++ cairo_snippets_pdf.c	5 Jan 2005 22:32:30 -0000	1.3
@@ -20,7 +20,7 @@
             int      no);
 
 int
-main (void)
+main (int argc, char *argv[])
 {
         int i;
         FILE *file;
@@ -31,11 +31,17 @@
 
         cairo_set_target_pdf (cr, file, X_INCHES, Y_INCHES, X_PPI, Y_PPI);
 
-        for (i=0;i<snippet_count;i++)
-             write_page (cr, i);
+	if (argc == 1) {
+		for (i = 0; i < snippet_count; i++)
+			write_page (cr, i);
+	}
+	else {
+		for (i = 1; i < argc; i++)
+			write_page (cr, atoi (argv[i]));
+	}
 
-        cairo_destroy (cr);
-        fclose (file);
+        cairo_destroy (cr); 
+	fclose (file);
 
         return 0;
 }




More information about the cairo-commit mailing list