head 1.6; access; symbols; locks; strict; comment @ * @; 1.6 date 2005.06.03.19.09.35; author krh; state Exp; branches; next 1.5; commitid 629942a0aaec4567; 1.5 date 2005.05.11.21.15.31; author otaylor; state Exp; branches; next 1.4; commitid 4fe428275f24567; 1.4 date 2005.04.21.21.01.37; author cworth; state Exp; branches; next 1.3; commitid 1b2e426814b04567; 1.3 date 2005.02.24.16.21.01; author otaylor; state Exp; branches; next 1.2; 1.2 date 2005.01.11.22.38.03; author pippin; state Exp; branches; next 1.1; 1.1 date 2004.05.18.15.22.50; author pippin; state Exp; branches; next ; desc @@ 1.6 log @2005-06-03 Kristian Høgsberg * cairo_snippets_html.c: Update html snippets. * snippets/pattern_fill.cairo: Remove this, was accidentally committed. @ text @/* ps frontend for cairo_snippets * (c) Øyvind Kolås 2004, placed in the public domain */ #include "snippets.h" #include #define X_INCHES 2 #define Y_INCHES 2 #define X_PPI 300.0 #define Y_PPI 300.0 #define WIDTH X_INCHES * 72.0 #define HEIGHT Y_INCHES * 72.0 /* add a page with the specified snippet to the output ps file */ static void write_page (cairo_t *cr, int no); int main (void) { int i; cairo_surface_t *surface; cairo_t *cr; surface = cairo_ps_surface_create ("snippets.ps", WIDTH, HEIGHT); cr = cairo_create (surface); for (i=0;i * cairo_snippets_png.c cairo_snippets_ps.c cairo_snippets_win32.c snippets/*.cairo: Cairo API updates. * snippets.h: Remove a stray png-io.h include. * snippets/pattern_fill.cairo: Remove some unused extern @ text @a24 1 FILE *file; d28 1 a28 4 file = fopen ("snippets.ps", "w"); surface = cairo_ps_surface_create (file, X_INCHES, Y_INCHES, X_PPI, Y_PPI); a35 1 fclose (file); @ 1.4 log @ * cairo_snippets_pdf.c: * cairo_snippets_ps.c: * prepare_snippets.c: (make_util): * snippets/arc.cairo: * snippets/arc_negative.cairo: * snippets/curve_rectangle.cairo: * snippets/curve_to.cairo: * snippets/operator_add.cairo: * snippets/operator_atop.cairo: * snippets/operator_atop_reverse.cairo: * snippets/operator_in.cairo: * snippets/operator_in_reverse.cairo: * snippets/operator_out.cairo: * snippets/operator_out_reverse.cairo: * snippets/operator_over.cairo: * snippets/operator_over_reverse.cairo: * snippets/operator_saturate.cairo: * snippets/operator_xor.cairo: * snippets/text.cairo: * snippets/text_align_center.cairo: * snippets/text_extents.cairo: Update for changes in the cairo API, including: Use 72.0 scale factor instead of 96.0 Use unsigned char as appropriate Use cairo_set_source_rgba instead of cairo_set_rgb_color and cairo_set_alpha. @ text @d26 1 d30 5 a34 4 cr = cairo_create (); cairo_set_target_ps (cr, file, X_INCHES, Y_INCHES, X_PPI, Y_PPI); d39 1 @ 1.3 log @2005-02-24 Owen Taylor * configure.ac Makefile.am: Build the PDF and Win32 backends conditionally. * autogen.sh: Replace with something more comprehensive based on the Cairo version. * configure.ac: Add AC_CONFIG_HEADERS * cairo_snippets_ps.c: Include @ text @d13 2 a14 2 #define WIDTH X_INCHES * 96.0 #define HEIGHT Y_INCHES * 96.0 @ 1.2 log @added normalization function, and removed then redundant initialization code from snippets @ text @d6 1 @ 1.1 log @*** empty log message *** @ text @d7 2 a8 5 #define WIDTH 256 #define HEIGHT 256 #define X_INCHES (WIDTH / 96.0) #define Y_INCHES (HEIGHT / 96.0) d12 2 a13 1 #define LINE_WIDTH 0.04 d15 1 a15 1 /* add a page with the specified snippet to the output pdf file */ d48 2 a49 8 cairo_scale (cr, WIDTH/1.0, HEIGHT/1.0); cairo_rectangle (cr, 0,0, 1.0, 1.0); cairo_set_rgb_color (cr, 1,1,1); cairo_fill (cr); cairo_set_rgb_color (cr, 0.0, 0.0, 0.0); cairo_set_line_width (cr, LINE_WIDTH); snippet_do (cr, no); a51 6 cairo_set_line_width (cr, 2); cairo_set_rgb_color (cr, 0.0, 0.0, 0.0); cairo_rectangle (cr, 0,0, WIDTH, HEIGHT); cairo_stroke (cr); cairo_show_page (cr); @