[cairo-commit] cairo-demo/cairo_snippets ChangeLog, 1.3, 1.4 cairo_snippets_pdf.c, 1.1, 1.2

OEyvind Kolaas commit at pdx.freedesktop.org
Tue May 18 05:50:41 PDT 2004


Committed by: pippin

Update of /cvs/cairo/cairo-demo/cairo_snippets
In directory pdx:/tmp/cvs-serv5464

Modified Files:
	ChangeLog cairo_snippets_pdf.c 
Log Message:
code cleanup


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/ChangeLog,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/ChangeLog	18 May 2004 12:47:41 -0000	1.3
--- b/ChangeLog	18 May 2004 12:50:39 -0000	1.4
***************
*** 1,2 ****
--- 1,5 ----
+ 2004-05-18 OEyvind Kolaas <pippin at freedesktop.org>
+ 	* cairo_snippets_pdf.c: code cleanup
+ 
  2004-05-18 OEyvind Kolaas <pippin at freedesktop.org> 
  	* cairo_snippets_png.c: code cleanup, change to use the actual png backend

Index: cairo_snippets_pdf.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/cairo_snippets/cairo_snippets_pdf.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/cairo_snippets_pdf.c	18 May 2004 02:34:16 -0000	1.1
--- b/cairo_snippets_pdf.c	18 May 2004 12:50:39 -0000	1.2
***************
*** 1,3 ****
! /* png/html frontend for cairo_snippets
   * (c) Øyvind Kolås 2004, placed in the public domain
   */
--- 1,3 ----
! /* pdf frontend for cairo_snippets
   * (c) Øyvind Kolås 2004, placed in the public domain
   */
***************
*** 13,21 ****
  #define Y_PPI    300.0
  
- 
  #define LINE_WIDTH 0.04
  
  
! static write_page (cairo_t *cr, int no)
  {
          fprintf (stdout, "processing %s", snippet_name[no]);
--- 13,47 ----
  #define Y_PPI    300.0
  
  #define LINE_WIDTH 0.04
  
+ /* add a page with the specified snippet to the output pdf file */
+ static void
+ write_page (cairo_t *cr,
+             int      no);
  
! int
! main (void)
! {
!         int i;
!         FILE *file;
!         cairo_t *cr;
! 
!         file = fopen ("snippets.pdf", "w");
!         cr = cairo_create ();
! 
!         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);
! 
!         cairo_destroy (cr);
!         fclose (file);
! 
!         return 0;
! }
! 
! static void
! write_page (cairo_t *cr,
!             int      no)
  {
          fprintf (stdout, "processing %s", snippet_name[no]);
***************
*** 40,62 ****
          fprintf (stdout, "\n");
  }
- 
- int
- main (void)
- {
-         int i;
-         FILE *file;
-         cairo_t *cr;
- 
-         file = fopen ("snippets.pdf", "w");
-         cr = cairo_create ();
- 
-         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);
- 
-         cairo_destroy (cr);
-         fclose (file);
- 
-         return 0;
- }
--- 66,67 ----





More information about the cairo-commit mailing list