head 1.10; access; symbols; locks; strict; comment @ * @; 1.10 date 2005.06.03.19.09.35; author krh; state Exp; branches; next 1.9; commitid 629942a0aaec4567; 1.9 date 2005.05.11.21.15.31; author otaylor; state Exp; branches; next 1.8; commitid 4fe428275f24567; 1.8 date 2005.05.03.02.22.48; author krh; state Exp; branches; next 1.7; commitid 33124276e0734567; 1.7 date 2005.04.21.21.01.37; author cworth; state Exp; branches; next 1.6; commitid 1b2e426814b04567; 1.6 date 2005.01.11.22.38.03; author pippin; state Exp; branches; next 1.5; 1.5 date 2004.10.13.18.24.11; author cworth; state Exp; branches; next 1.4; 1.4 date 2004.06.07.01.02.35; author pippin; state Exp; branches; next 1.3; 1.3 date 2004.05.20.13.17.20; author pippin; state Exp; branches; next 1.2; 1.2 date 2004.05.19.18.11.24; author pippin; state Exp; branches; next 1.1; 1.1 date 2004.05.16.19.09.50; author pippin; state Exp; branches; next ; desc @@ 1.10 log @2005-06-03 Kristian Høgsberg * cairo_snippets_html.c: Update html snippets. * snippets/pattern_fill.cairo: Remove this, was accidentally committed. @ text @/* small program to preprocess data for inclusion in cairo_snippets * (c) Øyvind Kolås, placed in the public domain */ #include #include #include #define SNIPPETS_DIR "snippets/" #define MAX_SNIPPETS 512 char *snippet_name[MAX_SNIPPETS]; int snippet_count=0; static FILE *out; static void make_header (void) { fprintf (out, "/* DO NOT EDIT!, file autogenerated by prepare_snippets, using *.cairo files */\n"); fprintf (out, "#include \"snippets.h\"\n"); } static void make_index (void) { int i; fprintf (out, "\n\nint snippet_count=%i;\n", snippet_count); fprintf (out, "\n"); fprintf (out, "const char *snippet_name[%i]={\n", snippet_count+1); 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 @d9 2 d61 1 a61 1 sprintf (filename, "%s.cairo", snippet_name[i]); d95 1 a95 1 sprintf (filename, "%s.cairo", snippet_name[i]); d188 1 d203 5 d209 2 a210 2 snippet_name[snippet_count++]=strdup (name); free (name); @ 1.8 log @2005-05-02 Kristian Høgsberg * png_io.c: * png_io.h: * cairo_snippets_png.c: * Makefile.am: Drop custom PNG IO functions and use cairo's new PNG functions. * prepare_snippets.c: * snippets/clip_image.cairo: * snippets/curve_rectangle.cairo: * snippets/fill_and_stroke.cairo: * snippets/fill_and_stroke2.cairo: * snippets/image.cairo: * snippets/imagepattern.cairo: * snippets/libsvg.cairo: * snippets/text.cairo: Port to cairos new group semantics by using cairo_fill_preserve() instead of cairo_save()/cairo_restore() to keep the current path after filling it. Use cairo_image_surface_create_from_png() to load png files. Fix pointer signedness in a couple of places. @ text @d146 2 a147 2 " cairo_move_to (cr, 0,0);\n" " cairo_show_surface (cr, image,w,h);\n" @ 1.7 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 @d139 1 a139 2 " int w,h,stride;\n" " unsigned char *buffer;\n" d141 3 a143 2 " buffer = read_png_argb32 (file, &w,&h, &stride);\n" " image = cairo_surface_create_for_image (buffer, CAIRO_FORMAT_ARGB32,w,h,stride);\n" a149 1 " free (buffer);\n" d157 1 a157 1 " int width,height;\n" @ 1.6 log @added normalization function, and removed then redundant initialization code from snippets @ text @d140 1 a140 1 " char *buffer;\n" @ 1.5 log @ * cairo_snippets_html.c (do_index): index() is a C library function, rename to do_index(). * Makefile: Add -g -Wall -O2, to get good warnings. * cairo_snippets_html.c prepare_snippets.c: Fix warnings. * cairo_snippets_png.c: Allow individual snippet names to be specified on the command line. @ text @d45 1 a45 1 "snippet_do (cairo_t *cr, int snippet_no)\n" d171 10 @ 1.4 log @escape back slashes correctly @ text @d6 1 d36 1 a36 1 fprintf (out, "};\n", snippet_count); d62 1 a62 1 while (read=fread (&c, 1,1, file)){ d96 1 a96 1 while (read=fread (&c, 1,1, file)){ d116 1 a116 1 fprintf (out, "};\n", snippet_count); d206 2 @ 1.3 log @added visual explaination for the parameters of the cairo_arc function @ text @d98 1 a98 1 fprintf (out, "\\\"", c); d101 4 a104 1 fprintf (out, "\\n\"\n\"", c); @ 1.2 log @added operator tests, and snipepts.ps, snippets.pdf to .cvsignore @ text @d150 17 a168 2 @ 1.1 log @initial import of cairo_snippets @ text @d129 21 @