head 1.16; access; symbols initial:1.1.1.1 start:1.1.1; locks; strict; comment @ * @; 1.16 date 2005.07.09.23.40.55; author keithp; state Exp; branches; next 1.15; commitid 13c342d060824567; 1.15 date 2005.07.07.08.09.21; author keithp; state Exp; branches; next 1.14; commitid 1de242cce3254567; 1.14 date 2005.05.18.06.21.15; author keithp; state Exp; branches; next 1.13; commitid 431d428aded64567; 1.13 date 2005.05.02.20.24.38; author keithp; state Exp; branches; next 1.12; commitid 416842768c824567; 1.12 date 2005.03.14.21.43.06; author keithp; state Exp; branches; next 1.11; 1.11 date 2005.02.11.21.15.46; author keithp; state Exp; branches; next 1.10; 1.10 date 2004.12.24.09.00.10; author keithp; state Exp; branches; next 1.9; 1.9 date 2004.12.23.22.39.40; author keithp; state Exp; branches; next 1.8; 1.8 date 2004.12.19.00.06.26; author keithp; state Exp; branches; next 1.7; 1.7 date 2004.12.18.08.16.28; author keithp; state Exp; branches; next 1.6; 1.6 date 2004.12.18.01.09.40; author keithp; state Exp; branches; next 1.5; 1.5 date 2004.12.17.09.40.43; author keithp; state Exp; branches; next 1.4; 1.4 date 2004.12.17.02.09.45; author keithp; state Exp; branches; next 1.3; 1.3 date 2004.12.15.07.04.50; author keithp; state Exp; branches; next 1.2; 1.2 date 2004.12.14.08.34.27; author keithp; state Exp; branches; next 1.1; 1.1 date 2004.12.11.06.26.52; author keithp; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.11.06.26.52; author keithp; state Exp; branches; next ; desc @@ 1.16 log @2005-07-09 Keith Packard * cairo-5c.h: * cairo.c: (cairo_5c_get): * examples/animate.5c: * gtk.c: (configure_event), (expose_event), (delete_drawing_area), (gtk_repaint), (gtk_tool_free), (cairo_5c_tool_create), (cairo_5c_tool_destroy): * surface.c: (create_cairo_window): Pass GtkPixmap objects around as they are reference counted. Use proposed new cairo_xlib_surface_set_drawable API to deal with window back-buffer resize issue. @ text @/* $Id: cairo-5c.h,v 1.15 2005/07/07 08:09:21 keithp Exp $ * * Copyright © 2004 Keith Packard * * This library is free software; you can redistribute it and/or * modify it either under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * (the "LGPL") or, at your option, under the terms of the Mozilla * Public License Version 1.1 (the "MPL"). If you do not alter this * notice, a recipient may use your version of this file under either * the MPL or the LGPL. * * You should have received a copy of the LGPL along with this library * in the file COPYING-LGPL-2.1; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * You should have received a copy of the MPL along with this library * in the file COPYING-MPL-1.1 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY * OF ANY KIND, either express or implied. See the LGPL or the MPL for * the specific language governing rights and limitations. * * The Original Code is the cairo graphics library. * * The Initial Developer of the Original Code is Keith Packard * * Contributor(s): * Keith Packard */ #ifndef _CAIRO_5C_H_ #define _CAIRO_5C_H_ #include #define Atom XAtom #undef True #undef False #include #include #include #include #include #include #undef Atom #define GTK_DISABLE_DEPRECATED #include #include typedef enum { CAIRO_5C_WINDOW, CAIRO_5C_IMAGE, CAIRO_5C_PDF, CAIRO_5C_SCRATCH } cairo_5c_kind_t; typedef struct _cairo_5c_tool cairo_5c_tool_t; typedef struct _cairo_5c_window_t { GdkPixmap *pixmap; GdkPixmap *curpix; cairo_5c_tool_t *tool; FILE *send_events; } cairo_5c_window_t; typedef struct _cairo_5c_pdf_t { Value file; } cairo_5c_pdf_t; typedef struct _cairo_5c_image_t { int unused; } cairo_5c_image_t; typedef struct _cairo_5c_t { DataType *data; cairo_t *cr; Value surface; } cairo_5c_t; typedef struct _cairo_5c_surface_t { DataType *data; cairo_5c_kind_t kind; cairo_surface_t *surface; double width; double height; Bool dirty; Value recv_events; Bool copied; union { cairo_5c_window_t window; cairo_5c_pdf_t pdf; cairo_5c_image_t image; } u; } cairo_5c_surface_t; typedef struct _cairo_5c_pattern_t { DataType *data; cairo_pattern_t *pattern; } cairo_5c_pattern_t; typedef struct _cairo_5c_scaled_font_t { DataType *data; cairo_scaled_font_t *scaled_font; } cairo_5c_scaled_font_t; typedef struct _cairo_5c_font_face_t { DataType *data; cairo_font_face_t *font_face; } cairo_5c_font_face_t; extern Type *typeCairo; extern Type *typeCairoSurface; extern Type *typeCairoStatus; extern Type *typeCairoOperator; extern Type *typeCairoFillRule; extern Type *typeCairoLineCap; extern Type *typeCairoLineJoin; extern Type *typeCairoFontSlant; extern Type *typeCairoFontWeight; extern Type *typeCairoTextExtents; extern Type *typeCairoFontExtents; extern Type *typeCairoMatrix; extern Type *typeCairoPoint; extern Type *typeCairoRect; extern Type *typeCairoRgbColor; extern Type *typeCairoRgbaColor; extern Type *typeCairoPattern; extern Type *typeCairoPath; extern Type *typeCairoCurveTo; extern Type *typeCairoFilter; extern Type *typeCairoScaledFont; extern Type *typeCairoFontFace; extern Type *typeCairoPatternExtend; extern Type *typeCairoPatternFilter; /* cairo.c */ cairo_5c_t * cairo_5c_get (Value av); void cairo_5c_dirty (cairo_5c_t *c5c); Value do_Cairo_create (Value sv); Value do_Cairo_destroy (Value cv); Value do_Cairo_get_target (Value cv); /* Error status queries */ Value do_Cairo_status (Value cv); Value do_Cairo_status_to_string (Value sv); Value do_Cairo_enable (Value cv); Value do_Cairo_disable (Value cv); /* surface.c */ cairo_5c_surface_t * cairo_5c_surface_get (Value av); Value do_Cairo_Surface_create_window (Value namev, Value wv, Value hv); Value do_Cairo_Image_surface_create (Value fv, Value wv, Value hv); Value do_Cairo_Image_surface_create_from_png (Value fnv); Value do_Cairo_Image_surface_create_from_png_file (Value fv); Value do_Cairo_Pdf_surface_create (Value fnv, Value wv, Value hv); Value do_Cairo_Pdf_surface_create_for_file (Value fv, Value wv, Value hv); Value do_Cairo_Surface_write_to_png (Value sv, Value fnv); Value do_Cairo_Surface_write_to_png_file (Value sv, Value fv); Value do_Cairo_Surface_create_similar (Value sv, Value wv, Value hv); Value do_Cairo_Surface_finish (Value sv); Value do_Cairo_Surface_destroy (Value sv); Value do_Cairo_Surface_write_to_png (Value sv, Value fnv); Value do_Cairo_Surface_write_to_png_file (Value sv, Value fv); Value do_Cairo_Surface_set_device_offset (Value sv, Value xv, Value yv); Value do_Cairo_Surface_width (Value sv); Value do_Cairo_Surface_height (Value sv); /* event.c */ Value do_Cairo_Surface_open_event (Value sv); /* init.c */ Value nickle_init (void); int EnumIntPart (Value ev, char *err); Value IntToEnum (Type *type, int i); /* gstate.c */ Value do_Cairo_save (Value cv); Value do_Cairo_restore (Value cv); Value do_Cairo_set_operator (Value cv, Value ov); Value do_Cairo_identity_matrix (Value cv); Value do_Cairo_set_source_rgb (Value cv, Value rv, Value gv, Value bv); Value do_Cairo_set_source_rgba (Value cv, Value rv, Value gv, Value bv, Value av); Value do_Cairo_set_source_surface (Value cv, Value sv, Value xv, Value yv); Value do_Cairo_set_tolerance (Value cv, Value tv); Value do_Cairo_set_fill_rule (Value cv, Value fv); Value do_Cairo_set_line_width (Value cv, Value lv); Value do_Cairo_set_line_cap (Value cv, Value lv); Value do_Cairo_set_line_join (Value cv, Value lv); Value do_Cairo_set_dash (Value cv, Value dv, Value ov); Value do_Cairo_set_miter_limit (Value cv, Value mv); Value do_Cairo_translate (Value cv, Value xv, Value yv); Value do_Cairo_scale (Value cv, Value xv, Value yv); Value do_Cairo_rotate (Value cv, Value av); Value do_Cairo_transform (Value cv, Value mv); Value do_Cairo_set_matrix (Value cv, Value mv); Value do_Cairo_identity_matrix (Value cv); Value do_Cairo_user_to_device (Value cv, Value pv); Value do_Cairo_user_to_device_distance (Value cv, Value pv); Value do_Cairo_device_to_user (Value cv, Value pv); Value do_Cairo_device_to_user_distance (Value cv, Value pv); /* Query functions */ Value do_Cairo_get_operator (Value cv); Value do_Cairo_get_tolerance (Value cv); Value do_Cairo_get_current_point (Value cv); Value do_Cairo_get_fill_rule (Value cv); Value do_Cairo_get_line_width (Value cv); Value do_Cairo_get_line_cap (Value cv); Value do_Cairo_get_line_join (Value cv); Value do_Cairo_get_miter_limit (Value cv); Value do_Cairo_get_matrix (Value cv); /* draw.c */ Value do_Cairo_new_path (Value cv); Value do_Cairo_move_to (Value cv, Value xv, Value yv); Value do_Cairo_line_to (Value cv, Value xv, Value yv); Value do_Cairo_curve_to (Value cv, Value x1v, Value y1v, Value x2v, Value y2v, Value x3v, Value y3v); Value do_Cairo_arc (Value cv, Value x1v, Value y1v, Value x2v, Value y2v, Value rv); Value do_Cairo_arc_negative (Value cv, Value x1v, Value y1v, Value x2v, Value y2v, Value rv); Value do_Cairo_rel_move_to (Value cv, Value xv, Value yv); Value do_Cairo_rel_line_to (Value cv, Value xv, Value yv); Value do_Cairo_rel_curve_to (Value cv, Value x1v, Value y1v, Value x2v, Value y2v, Value x3v, Value y3v); Value do_Cairo_rectangle (Value cv, Value xv, Value yv, Value wv, Value hv); Value do_Cairo_close_path (Value cv); /* Painting functions */ Value do_Cairo_paint (Value cv); Value do_Cairo_paint_with_alpha (Value cv, Value av); Value do_Cairo_mask (Value cv, Value pv); Value do_Cairo_mask_surface (Value cv, Value sv, Value xv, Value yv); Value do_Cairo_stroke (Value cv); Value do_Cairo_stroke_preserve (Value cv); Value do_Cairo_fill (Value cv); Value do_Cairo_fill_preserve (Value cv); Value do_Cairo_copy_page (Value cv); Value do_Cairo_show_page (Value cv); /* Insideness testing */ Value do_Cairo_in_stroke (Value cv, Value xv, Value yv); Value do_Cairo_in_fill (Value cv, Value xv, Value yv); /* Rectangular extents */ Value do_Cairo_stroke_extents (Value cv); Value do_Cairo_fill_extents (Value cv); /* Clipping */ Value do_Cairo_reset_clip (Value cv); Value do_Cairo_clip (Value cv); Value do_Cairo_clip_preserve (Value cv); Value do_Cairo_copy_path (Value cv); Value do_Cairo_copy_path_flat (Value cv); Value do_Cairo_append_path (Value cv, Value pv); /* matrix.c */ void cairo_matrix_part (Value matrixv, cairo_matrix_t *matrix, char *err); Value new_cairo_matrix (cairo_matrix_t *matrix); /* pattern.c */ cairo_pattern_t * get_cairo_pattern (Value pv); Value do_Cairo_get_source (Value cv); Value do_Cairo_set_source (Value cv, Value patv); Value do_Cairo_Pattern_create_for_surface (Value sv); Value do_Cairo_Pattern_create_linear (Value x0v, Value y0v, Value x1v, Value y1v); Value do_Cairo_Pattern_create_radial (Value cx0v, Value cy0v, Value radius0v, Value cx1v, Value cy1v, Value radius1v); Value do_Cairo_Pattern_add_color_stop_rgb (Value patv, Value offsetv, Value redv, Value greenv, Value bluev); Value do_Cairo_Pattern_add_color_stop_rgba (Value patv, Value offsetv, Value redv, Value greenv, Value bluev, Value alphav); Value do_Cairo_Pattern_set_matrix (Value patv, Value matrixv); Value do_Cairo_Pattern_get_matrix (Value patv); Value do_Cairo_Pattern_set_extend (Value patv, Value extendv); Value do_Cairo_Pattern_get_extend (Value patv); Value do_Cairo_Pattern_set_filter (Value patv, Value filterv); Value do_Cairo_Pattern_get_filter (Value patv); /* text.c */ Value do_Cairo_select_font_face (Value cv, Value fv, Value sv, Value wv); Value do_Cairo_set_font (Value cv, Value fnv); Value do_Cairo_set_font_size (Value cv, Value sv); Value do_Cairo_set_font_matrix (Value cv, Value mv); Value do_Cairo_get_font_matrix (Value cv); Value do_Cairo_show_text (Value cv, Value uv); Value do_Cairo_font_extents (Value cv); Value do_Cairo_set_font_face (Value cv, Value fv); Value do_Cairo_text_extents (Value cv, Value uv); Value do_Cairo_text_path (Value cv, Value uv); /* Portable interface to general font features. */ #if 0 /* not actually useful until we expose freetype/fontconfig to nickle apps */ Value do_Cairo_scaled_font_create (Value fv, Value mv, Value ctm); Value do_Cairo_scaled_font_extents (Value sfv); Value do_Cairo_scaled_text_extents (Value sfv, Value uv); #endif /* gtk.c */ Bool cairo_5c_tool_create (cairo_5c_surface_t *c5s, char *name, int width, int height); Bool cairo_5c_tool_destroy (cairo_5c_surface_t *c5s); void cairo_5c_tool_dirty (cairo_5c_surface_t *c5s); Bool cairo_5c_tool_disable (cairo_5c_surface_t *c5s); Bool cairo_5c_tool_enable (cairo_5c_surface_t *c5s); Display * cairo_5c_tool_display (cairo_5c_surface_t *c5s); void cairo_5c_tool_mark (cairo_5c_surface_t *c5s); #endif /* _CAIRO_5C_H_ */ @ 1.15 log @2005-07-07 Keith Packard * cairo-5c.h: * cairo.c: (do_Cairo_status_to_string): * examples/fob.5c: * gtk.c: (create_gtk_global): * init.c: (nickle_init): * pattern.c: (do_Cairo_Pattern_add_color_stop_rgba), (do_Cairo_Pattern_add_color_stop_rgb), (do_Cairo_Pattern_set_matrix), (do_Cairo_Pattern_set_extend), (do_Cairo_Pattern_set_filter): Match current cairo API. Use XInitThreads, as it's necessary for stable operation. Requires at least one bug fix not yet in Xlib CVS to work @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.14 2005/05/18 06:21:15 keithp Exp $ d50 3 d59 2 a60 2 Pixmap pixmap; Pixmap curpix; @ 1.14 log @2005-05-17 Keith Packard * cairo-5c.h: * cairo.5c: * cairo.c: (cairo_5c_get), (do_Cairo_create), (cairo_5c_dirty), (cairo_5c_enable), (cairo_5c_disable), (do_Cairo_get_target): * draw.c: (do_Cairo_paint), (do_Cairo_paint_with_alpha), (do_Cairo_mask), (do_Cairo_mask_surface), (do_Cairo_fill_preserve), (do_Cairo_stroke_preserve), (path_elt_new), (path_array), (do_Cairo_copy_path), (do_Cairo_copy_path_flat), (do_Cairo_append_path): * event.c: (do_Cairo_Surface_open_event): * examples/animate.5c: * examples/draw.5c: * examples/fob.5c: * examples/metrics.5c: * examples/sin.5c: * examples/spin.5c: * examples/spinman.5c: * examples/test.5c: * gstate.c: (do_Cairo_set_source_surface), (do_Cairo_identity_matrix), (do_Cairo_transform), (do_Cairo_user_to_device), (do_Cairo_user_to_device_distance), (do_Cairo_device_to_user), (do_Cairo_device_to_user_distance), (do_Cairo_reset_clip), (do_Cairo_clip_preserve): * gtk.c: (create_gtk_global): * init.c: (init_types), (nickle_init): * pattern.c: (do_Cairo_Pattern_create_for_surface), (do_Cairo_Pattern_add_color_stop_rgba), (do_Cairo_Pattern_add_color_stop_rgb): * surface.c: (cairo_5c_surface_get), (cairo_5c_surface_mark), (cairo_5c_surface_destroy), (do_Cairo_Surface_write_to_png), (do_Cairo_Surface_write_to_png_file), (do_Cairo_Surface_set_device_offset), (do_Cairo_Surface_create_similar), (do_Cairo_Surface_finish), (do_Cairo_Surface_destroy), (do_Cairo_Surface_width), (do_Cairo_Surface_height), (do_Cairo_Image_surface_create), (do_Cairo_Image_surface_create_from_png), (do_Cairo_Image_surface_create_from_png_file), (do_Cairo_Pdf_surface_create): * text.c: (do_Cairo_select_font_face), (do_Cairo_get_font_matrix): Another round of API changes for cairo 0.5, the putative final API structure. @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.13 2005/05/02 20:24:38 keithp Exp $ a44 1 #include d156 1 a156 1 do_Cairo_status_string (Value cv); @ 1.13 log @2005-05-02 Keith Packard * cairo-5c.h: * cairo.5c: * cairo.c: (cairo_5c_dirty), (cairo_5c_enable), (cairo_5c_disable), (do_Cairo_get_target_surface): * event.c: (do_Cairo_Surface_open_event): * gstate.c: (do_Cairo_set_source_rgb), (do_Cairo_set_source_rgba), (do_Cairo_get_matrix), (do_Cairo_concat_matrix), (do_Cairo_set_matrix), (do_Cairo_get_operator), (do_Cairo_get_tolerance), (do_Cairo_get_current_point), (do_Cairo_get_fill_rule), (do_Cairo_get_line_width), (do_Cairo_get_line_cap), (do_Cairo_get_line_join), (do_Cairo_get_miter_limit): * gtk.c: (delete_drawing_area), (motion_notify_event), (button_press_event), (button_release_event), (gtk_repaint_timeout), (gtk_thread_main), (gtk_global_free), (create_gtk_global), (cairo_5c_tool_dirty), (cairo_5c_tool_enable): * init.c: (init_types), (nickle_init): * matrix.c: (cairo_matrix_part), (new_cairo_matrix): * pattern.c: (do_Cairo_set_source), (do_Cairo_get_source), (do_Cairo_Pattern_set_matrix), (do_Cairo_Pattern_get_matrix): * surface.c: (cairo_5c_surface_get), (cairo_5c_surface_mark), (cairo_5c_surface_destroy), (do_Cairo_Surface_create_image), (do_Cairo_Surface_write_to_png): * text.c: (do_Cairo_set_font), (do_Cairo_set_font_size), (do_Cairo_set_font_matrix), (do_Cairo_font_extents): Match cairo API as of today. * examples/draw.5c: * examples/fob.5c: * examples/graph.5c: * examples/grid.5c: * examples/led.5c: * examples/pie-new.5c: * examples/pie.5c: * examples/rottext.5c: * examples/sin.5c: * examples/spin-cairo.5c: * examples/spin.5c: * examples/spinman.5c: * examples/test.5c: * examples/text45.5c: Update examples to match API changes @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.12 2005/03/14 21:43:06 keithp Exp $ d46 1 a46 1 #include d52 1 a52 1 typedef enum { CAIRO_5C_WINDOW, CAIRO_5C_IMAGE, CAIRO_5C_PS, CAIRO_5C_SCRATCH } cairo_5c_kind_t; d63 7 a69 3 typedef struct _cairo_ps_t { FILE *file; } cairo_5c_ps_t; d81 2 a82 2 int width; int height; d88 2 a89 1 cairo_5c_ps_t ps; d93 15 a125 2 extern Type *typeCairoMoveTo; extern Type *typeCairoLineTo; a126 1 extern Type *typeCairoClosePath; d128 2 d143 1 a143 1 do_Cairo_create (void); d149 3 a151 7 do_Cairo_set_target_surface (Value cv, Value sv); Value do_Cairo_get_target_surface (Value cv); Value do_Cairo_copy (Value dstv, Value srcv); d174 4 a177 1 do_Cairo_Surface_create_image (Value wv, Value hv); d180 1 a180 1 do_Cairo_Surface_write_to_png (Value sv, Value fv); d183 10 a192 1 do_Cairo_Surface_create_ps (Value fv, Value wv, Value hv, Value xppiv, Value yppiv); d198 3 d204 9 a243 3 do_Cairo_default_matrix (Value cv); Value d253 3 d286 1 a286 4 do_Cairo_get_matrix (Value cv); Value do_Cairo_concat_matrix (Value cv, Value mv); d292 1 a292 1 do_Cairo_transform_point (Value cv, Value pv); d295 1 a295 1 do_Cairo_transform_distance (Value cv, Value pv); d298 1 a298 1 do_Cairo_inverse_transform_point (Value cv, Value pv); d301 1 a301 1 do_Cairo_inverse_transform_distance (Value cv, Value pv); d304 1 a304 1 do_Cairo_init_clip (Value cv); d306 1 a306 2 Value do_Cairo_clip (Value cv); d332 3 d381 19 d404 1 a404 1 do_Cairo_stroke (Value cv); d412 1 d419 1 d426 13 d440 1 a440 1 do_Cairo_current_path_list (Value cv); d443 1 a443 1 do_Cairo_current_path_flat_list (Value cv); d463 1 a463 1 do_Cairo_Pattern_create_png (Value filenamev); d473 2 a474 1 do_Cairo_Pattern_create_for_surface (Value cv); d477 3 a479 3 do_Cairo_Pattern_add_color_stop (Value patv, Value offsetv, Value redv, Value greenv, Value bluev, Value alphav); d501 1 a501 1 do_Cairo_select_font (Value cv, Value fv, Value sv, Value wv); d504 1 a504 1 do_Cairo_set_font (Value cv, Value fv); d513 6 d522 4 a525 1 do_Cairo_show_text (Value cv, Value uv); d530 5 d536 7 a542 1 do_Cairo_text_extents (Value cv, Value uv); d544 1 @ 1.12 log @2005-03-14 Keith Packard * cairo-5c.h: Must explicitly reference desired backends * pattern.c: (do_Cairo_current_pattern), (create_surface_from_png): Switch from deprecated functions to current ones * text.c: (do_Cairo_set_font): Fix sizing from supplied pattern * examples/graph.5c: metrics got fixed. @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.11 2005/02/11 21:15:46 keithp Exp $ d52 1 a52 1 typedef enum { CAIRO_5C_WINDOW, CAIRO_5C_PNG, CAIRO_5C_PS, CAIRO_5C_SCRATCH } cairo_5c_kind_t; a62 4 typedef struct _cairo_png_t { FILE *file; } cairo_5c_png_t; a83 1 cairo_5c_png_t png; d103 1 d133 1 a133 1 do_Cairo_current_target_surface (Value cv); d159 4 a162 1 do_Cairo_Surface_create_png (Value fv, Value wv, Value hv); d211 1 a211 1 do_Cairo_set_rgb_color (Value av, Value rv, Value gv, Value bv); d214 1 a214 1 do_Cairo_set_alpha (Value cv, Value av); d247 1 a247 1 do_Cairo_current_matrix (Value cv); d274 1 a274 1 do_Cairo_current_operator (Value cv); d277 1 a277 1 do_Cairo_current_rgb_color (Value cv); d280 1 a280 1 do_Cairo_current_alpha (Value cv); d283 1 a283 1 do_Cairo_current_tolerance (Value cv); d286 1 a286 1 do_Cairo_current_point (Value cv); d289 1 a289 1 do_Cairo_current_fill_rule (Value cv); d292 1 a292 1 do_Cairo_current_line_width (Value cv); d295 1 a295 7 do_Cairo_current_line_cap (Value cv); Value do_Cairo_current_line_join (Value cv); Value do_Cairo_current_miter_limit (Value cv); d374 2 a375 2 cairo_matrix_t * cairo_matrix_part (Value matrixv, char *err); d385 1 a385 1 do_Cairo_current_pattern (Value cv); d388 1 a388 1 do_Cairo_set_pattern (Value cv, Value patv); d434 1 a434 1 do_Cairo_scale_font (Value cv, Value sv); d437 1 a437 1 do_Cairo_transform_font (Value cv, Value mv); d440 1 a440 1 do_Cairo_current_font_extents (Value cv); @ 1.11 log @2005-01-02 Keith Packard * cairo-5c.h: Add do_Cairo_copy_page and do_Cairo_show_page. Track whether copy_page/show_page have ever been called so that they can be when the surface is destroyed. * cairo.c: (cairo_5c_free), (cairo_5c_dirty): * draw.c: (do_Cairo_arc), (do_Cairo_arc_negative), (do_Cairo_copy_page), (do_Cairo_show_page): Fix arc arguments * event.c: (do_Cairo_Surface_open_event): * gtk.c: (cairo_5c_tool_destroy): * init.c: (nickle_init): * surface.c: (cairo_5c_surface_mark), (cairo_5c_surface_destroy), (cairo_5c_surface_free), (do_Cairo_Surface_create_window), (do_Cairo_Surface_create_png), (do_Cairo_Surface_create_ps), (do_Cairo_Surface_create_similar), (do_Cairo_Surface_destroy): dunno @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.10 2004/12/24 09:00:10 keithp Exp $ d41 2 d44 4 @ 1.10 log @2004-12-24 Keith Packard * cairo-5c.h: * cairo.5c: * cairo.c: (do_Cairo_set_target_surface): * gtk.c: (delete_drawing_area), (gtk_tool_free), (cairo_5c_tool_create), (cairo_5c_tool_destroy): * init.c: (nickle_init): * surface.c: (create_cairo_window), (cairo_5c_surface_get), (do_Cairo_Surface_create_window): Handle window delete more gracefully; report exception on drawing, report 'delete' event to event reader. Have default surface creation code re-create a surface when the old default surface has been destroyed. @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.8 2004/12/19 00:06:26 keithp Exp $ d79 1 d351 6 @ 1.9 log @2004-12-23 Keith Packard * Makefile.am: * cairo-5c.h: * cairo.5c: * cairo.c: (cairo_5c_get), (cairo_5c_mark), (cairo_5c_free), (cairo_foreign_mark), (cairo_foreign_free), (do_Cairo_create), (cairo_5c_dirty), (cairo_5c_enable), (cairo_5c_disable), (do_Cairo_set_target_surface), (do_Cairo_current_target_surface), (do_Cairo_destroy), (do_Cairo_copy), (do_Cairo_status), (do_Cairo_status_string), (do_Cairo_enable), (do_Cairo_disable): * draw.c: (do_Cairo_new_path), (do_Cairo_move_to), (do_Cairo_line_to), (do_Cairo_curve_to), (do_Cairo_arc), (do_Cairo_arc_negative), (do_Cairo_rel_move_to), (do_Cairo_rel_line_to), (do_Cairo_rel_curve_to), (do_Cairo_rectangle), (do_Cairo_close_path), (do_Cairo_fill), (do_Cairo_stroke), (do_Cairo_in_stroke), (do_Cairo_in_fill), (do_Cairo_stroke_extents), (do_Cairo_fill_extents), (do_Cairo_current_path_list), (do_Cairo_current_path_flat_list): * event.c: (do_Cairo_Surface_open_event): * examples/draw.5c: * examples/graph.5c: * examples/grid.5c: * examples/rottext.5c: * gstate.c: (do_Cairo_save), (do_Cairo_restore), (do_Cairo_set_operator), (do_Cairo_set_rgb_color), (do_Cairo_set_alpha), (do_Cairo_set_tolerance), (do_Cairo_set_fill_rule), (do_Cairo_set_line_width), (do_Cairo_set_line_cap), (do_Cairo_set_line_join), (do_Cairo_set_dash), (do_Cairo_set_miter_limit), (do_Cairo_identity_matrix), (do_Cairo_default_matrix), (do_Cairo_translate), (do_Cairo_scale), (do_Cairo_rotate), (do_Cairo_current_matrix), (do_Cairo_concat_matrix), (do_Cairo_set_matrix), (do_Cairo_transform_point), (do_Cairo_transform_distance), (do_Cairo_inverse_transform_point), (do_Cairo_inverse_transform_distance), (do_Cairo_init_clip), (do_Cairo_clip), (do_Cairo_current_operator), (do_Cairo_current_rgb_color), (do_Cairo_current_alpha), (do_Cairo_current_tolerance), (do_Cairo_current_point), (do_Cairo_current_fill_rule), (do_Cairo_current_line_width), (do_Cairo_current_line_cap), (do_Cairo_current_line_join), (do_Cairo_current_miter_limit): * gtk.c: (configure_event), (expose_event), (delete_drawing_area), (delete_event), (motion_notify_event), (button_press_event), (button_release_event), (gtk_repaint), (gtk_repaint_timeout), (gtk_global_mark), (gtk_global_free), (create_gtk_global), (gtk_tool_mark), (gtk_tool_free), (cairo_5c_tool_create), (cairo_5c_tool_destroy), (cairo_5c_tool_mark), (cairo_5c_tool_dirty), (cairo_5c_tool_disable), (cairo_5c_tool_enable), (cairo_5c_tool_display): * init.c: (init_types), (nickle_init): * pattern.c: (mark_cairo_pattern), (make_pattern_value), (do_Cairo_set_pattern), (do_Cairo_current_pattern), (do_Cairo_Pattern_create_for_surface): * surface.c: (create_cairo_window), (cairo_5c_surface_get), (cairo_5c_surface_mark), (cairo_5c_surface_free), (cairo_surface_foreign_mark), (cairo_surface_foreign_free), (do_Cairo_Surface_create_window), (do_Cairo_Surface_create_png), (do_Cairo_Surface_create_ps), (do_Cairo_Surface_create_similar), (do_Cairo_Surface_destroy), (do_Cairo_Surface_width), (do_Cairo_Surface_height): * text.c: (do_Cairo_select_font), (do_Cairo_set_font), (do_Cairo_scale_font), (do_Cairo_transform_font), (do_Cairo_current_font_extents), (do_Cairo_show_text), (do_Cairo_text_path), (do_Cairo_text_extents): Split cairo_t and cairo_surface_t functions apart, permitting more complex programs to be written that use more than a single window. Switch allocations around to mostly use the nickle memory allocator now. Requires updated nickle bits that expose this change in the foreign object API. @ text @d153 1 a153 1 do_Cairo_Surface_create_window (Value wv, Value hv); d449 1 a449 1 cairo_5c_tool_create (cairo_5c_surface_t *c5s, int width, int height); @ 1.8 log @2004-12-18 Keith Packard * cairo.5c: Add matrix operations * cairo-5c.h: * text.c: (do_Cairo_set_font), (do_Cairo_transform_font): * init.c: (nickle_init): Add set_font and transform_font interfaces * examples/animate.5c: * examples/pie.5c: use set_font interface * surface.c: (do_Cairo_dup): Duplicate gstate in dup operator @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.7 2004/12/18 08:16:28 keithp Exp $ d46 1 a46 1 typedef enum { CAIRO_5C_WINDOW, CAIRO_5C_PNG, CAIRO_5C_SCRATCH } cairo_5c_kind_t; d48 1 a48 7 typedef struct _cairo_5c_x_t { Display *dpy; Pixmap pixmap; int width; int height; FILE *send_events; } cairo_5c_x_t; d50 23 a72 1 typedef struct { d74 5 a78 5 cairo_t *cr; int width; int height; Bool dirty; Value recv_events; d80 3 a82 10 struct { Pixmap pix; cairo_5c_x_t *x; } window; struct { FILE *file; } png; struct { cairo_surface_t *surface; } scratch; d84 1 a84 1 } cairo_5c_t; d87 1 d96 1 d112 2 a113 1 /* surface.c */ d115 1 a115 1 get_cairo_5c (Value av); d118 1 a118 1 free_cairo_5c (void *v); d120 14 a133 2 void dirty_cairo_5c (cairo_5c_t *c5c); d136 1 a136 1 do_Cairo_new (int n, Value *v); d139 1 a139 1 do_Cairo_new_png (Value fv, Value wv, Value hv); d142 1 a142 1 do_Cairo_new_scratch (Value cov, Value wv, Value hv); d145 7 a151 2 do_Cairo_dup (Value cov); d153 1 a153 1 do_Cairo_width (Value av); d156 1 a156 1 do_Cairo_height (Value av); d159 1 a159 1 do_Cairo_status (Value cv); d162 1 a162 1 do_Cairo_status_string (Value cv); d165 1 a165 1 do_Cairo_dispose (Value av); d168 1 a168 1 do_Cairo_enable (Value cv); d171 1 a171 1 do_Cairo_disable (Value cv); d175 1 a175 1 do_Cairo_open_event (Value cv); d244 3 d434 3 a443 3 Value do_Cairo_select_ft_font (Value pv); a444 3 /* gtk+.c */ cairo_5c_x_t * start_x (int width, int height); d446 7 a452 2 void repaint_x (cairo_5c_x_t *c5cx, int x, int y, int w, int h); d455 1 a455 1 dirty_x (cairo_5c_x_t *c5cx, int x, int y, int w, int h); d458 1 a458 1 enable_x (cairo_5c_x_t *c5cx); d461 7 a467 1 disable_x (cairo_5c_x_t *c5cx); a468 1 @ 1.7 log @2004-12-18 Keith Packard * Makefile.am: * cairo.5c: * examples/animate.5c: * examples/draw.5c: * examples/pie.5c: * examples/rottext.5c: Fix examples to match API changes * gstate.c: (do_Cairo_transform_point), (do_Cairo_transform_distance), (do_Cairo_inverse_transform_point), (do_Cairo_inverse_transform_distance): transforms take point_t, return point_t * cairo-5c.h: * init.c: (nickle_init): * pattern.c: (do_Cairo_Pattern_create_for_surface), (premultiply_data), (create_surface_from_png), (do_Cairo_Pattern_create_png): * surface.c: (get_cairo_5c), (free_cairo_5c), (dirty_cairo_5c), (enable_cairo_5c), (disable_cairo_5c), (do_Cairo_new_png), (do_Cairo_new_scratch), (do_Cairo_dup), (do_Cairo_status): Add png loading, scratch surfaces and surface patterns @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.6 2004/12/18 01:09:40 keithp Exp $ d393 3 d399 3 @ 1.6 log @2004-12-17 Keith Packard * Makefile.am: * cairo-5c.h: * cairo.5c: * gstate.c: (do_Cairo_set_alpha), (do_Cairo_current_matrix), (do_Cairo_set_matrix): * init.c: (make_typedef), (init_types), (nickle_init): * matrix.c: (cairo_matrix_part), (new_cairo_matrix): * pattern.c: (get_cairo_pattern), (free_cairo_pattern), (make_pattern_value), (do_Cairo_set_pattern), (do_Cairo_current_pattern), (do_Cairo_Pattern_create_linear), (do_Cairo_Pattern_create_radial), (do_Cairo_Pattern_add_color_stop), (do_Cairo_Pattern_set_matrix), (do_Cairo_Pattern_get_matrix), (do_Cairo_Pattern_set_extend), (do_Cairo_Pattern_get_extend), (do_Cairo_Pattern_set_filter), (do_Cairo_Pattern_get_filter): Add gradient pattern support. Split out matrix support to share. @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.5 2004/12/17 09:40:43 keithp Exp $ d46 1 a46 1 typedef enum { CAIRO_5C_WINDOW, CAIRO_5C_PNG } cairo_5c_kind_t; d71 3 d118 6 d353 3 d363 3 @ 1.5 log @2004-12-17 Keith Packard * cairo-5c.h: * cairo.5c: * draw.c: (path_new), (path_box), (cairo_5c_move_to), (cairo_5c_line_to), (cairo_5c_curve_to), (cairo_5c_close_path), (do_Cairo_current_path_list), (do_Cairo_current_path_flat_list): * init.c: (make_typedef), (init_types), (nickle_init): * surface.c: (get_cairo_5c): Add current_path/current_path_flat by creating nickle structure in C code holding the entire path and walking it in nickle code. * examples/.cvsignore: ignore build files @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.4 2004/12/17 02:09:45 keithp Exp $ d93 4 d326 47 @ 1.4 log @2004-12-16 Keith Packard * Makefile.am: * autogen.sh: * cairo.5c: * configure.in: Add cairo.5c and install it to nickle libary * cairo-5c.h: * draw.c: (do_Cairo_rectangle), (do_Cairo_in_stroke), (do_Cairo_in_fill), (do_Cairo_stroke_extents), (do_Cairo_fill_extents), (cairo_5c_move_to), (do_Cairo_current_path), (do_Cairo_current_path_flat): * gstate.c: (do_Cairo_set_operator), (do_Cairo_set_fill_rule), (do_Cairo_set_line_cap), (do_Cairo_set_line_join), (do_Cairo_set_dash), (do_Cairo_set_miter_limit), (do_Cairo_default_matrix), (do_Cairo_transform_point), (do_Cairo_transform_distance), (do_Cairo_inverse_transform_point), (do_Cairo_inverse_transform_distance), (do_Cairo_init_clip), (do_Cairo_clip), (do_Cairo_current_operator), (do_Cairo_current_rgb_color), (do_Cairo_current_alpha), (do_Cairo_current_tolerance), (do_Cairo_current_point), (do_Cairo_current_fill_rule), (do_Cairo_current_line_width), (do_Cairo_current_line_cap), (do_Cairo_current_line_join), (do_Cairo_current_miter_limit): * init.c: (make_typedef), (init_types), (EnumIntPart), (IntToEnum), (nickle_init): * text.c: (do_Cairo_select_font), (do_Cairo_text_extents), (do_Cairo_select_ft_font): Add a bunch more bindings. Still more to do, especially the path walkers. Switch from int constants to enums for enumerated types. * gtk.c: (motion_notify_event), (button_press_event), (button_release_event), (cairo_5c_window_new): * surface.c: (do_Cairo_new): Add mouse input support. * examples/animate.5c: * examples/cairo.5c: * examples/draw.5c: * examples/graph.5c: * examples/pie.5c: * examples/rottext.5c: * examples/sin.5c: * examples/test.5c: Change examples to use cairo.5c file with autoimport @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.2 2004/12/14 08:34:27 keithp Exp $ d87 6 d317 1 a317 1 do_Cairo_current_path (Value cv, Value mv, Value lv, Value cuv, Value clp); d320 1 a320 1 do_Cairo_current_path_flat (Value cv, Value mv, Value lv, Value np); @ 1.3 log @2004-12-14 Keith Packard * cairo-5c.h: * gtk.c: (gtk_repaint_timeout), (dirty_x), (disable_x), (enable_x): * init.c: (nickle_init): * surface.c: (enable_cairo_5c), (disable_cairo_5c), (do_Cairo_enable), (do_Cairo_disable): Add enable/disable to take advantage of double buffering for smooth animation. * examples/animate.5c: Use enable/disable to smooth this animation out @ text @d42 2 d53 1 d62 1 d74 13 a86 1 extern Type *typeTextExtents; d125 4 d133 6 d148 6 d166 3 d178 6 d198 48 d287 3 a291 1 d298 18 d332 3 @ 1.2 log @2004-12-14 Keith Packard * .cvsignore: * Makefile.am: * cairo-5c.h: * configure.in: * draw.c: (do_Cairo_fill), (do_Cairo_stroke): * gtk.c: (configure_event), (expose_event), (cairo_5c_window_new), (repaint_x), (gtk_repaint_timeout), (gtk_thread_main), (start_x), (dirty_x): * init.c: (nickle_init): * surface.c: (get_cairo_5c), (free_cairo_5c), (dirty_cairo_5c), (do_Cairo_new): * text.c: (do_Cairo_show_text): Replace lame Xlib-based output with more capable gtk+ based output, including backing storage and resize handling. Input still isn't hooked up. * gstate.c: (do_Cairo_current_matrix), (do_Cairo_set_matrix): Add current_matrix and set_matrix functions; these only do affine matrices. * examples/animate.5c: * examples/pie.5c: * examples/rottext.5c: * examples/sin.5c: * examples/test.5c: Update examples to use installed library @ text @d1 1 a1 1 /* $Id: cairo-5c.h,v 1.1.1.1 2004/12/11 06:26:52 keithp Exp $ d103 6 d233 7 @ 1.1 log @Initial revision @ text @d1 1 a1 1 /* $Id: $ d46 7 d61 2 a62 2 Display *dpy; Window w; d65 1 a65 1 FILE *file; d79 3 d145 6 d217 10 @ 1.1.1.1 log @Add cairo-5c to repository @ text @@