head 1.26; access; symbols rel-1-060:1.25 rel-1-053:1.25 rel-1-052:1.24 rel-1-045:1.21.2.1 rel-1-051:1.23 rel-1-044:1.21 stable-1-04:1.21.0.2 stable-1-02:1.14.0.4 rel-1-050:1.22 rel-1-043:1.21 rel-1-042:1.20 rel-1-041:1.20 rel-1-040:1.20 rel-1-023:1.14 rel-1-031:1.18 rel-1-022:1.14 rel-1-030:1.16 rel-1-021:1.14 stable-1-0:1.14.0.2 rel-1-02:1.14 rel-1-01:1.14 rel-1-00:1.14 rel-0-92:1.14 rel-0-91:1.14 rel-0-90:1.13 rel-0-04:1.11 rel-0-03:1.8 rel-0-02:1.7 rel-0-01:1.7; locks; strict; comment @# @; 1.26 date 2008.10.05.19.59.40; author tsch; state Exp; branches; next 1.25; commitid jap73dqgVgT1Atlt; 1.25 date 2008.02.24.14.03.07; author tsch; state Exp; branches; next 1.24; commitid JzC4ZDgWgbH8OESs; 1.24 date 2008.02.10.18.37.19; author tsch; state Exp; branches; next 1.23; commitid 0m0QlRl3ZIB7MSQs; 1.23 date 2007.12.29.13.56.29; author tsch; state Exp; branches; next 1.22; commitid FWkjNvA6INSsBkLs; 1.22 date 2007.10.24.16.32.05; author tsch; state Exp; branches; next 1.21; commitid n4jyLFAXsD0mARCs; 1.21 date 2007.09.30.12.54.31; author tsch; state Exp; branches 1.21.2.1; next 1.20; commitid PfPFbmmBLvIy9Lzs; 1.20 date 2007.05.06.11.28.37; author tsch; state Exp; branches; next 1.19; 1.19 date 2007.03.17.16.13.32; author tsch; state Exp; branches; next 1.18; 1.18 date 2007.01.21.15.09.07; author tsch; state Exp; branches; next 1.17; 1.17 date 2007.01.18.19.53.39; author tsch; state Exp; branches; next 1.16; 1.16 date 2006.12.28.18.53.09; author tsch; state Exp; branches; next 1.15; 1.15 date 2006.11.09.19.43.43; author tsch; state Exp; branches; next 1.14; 1.14 date 2006.08.10.17.34.40; author tsch; state Exp; branches; next 1.13; 1.13 date 2006.07.15.14.41.11; author tsch; state Exp; branches; next 1.12; 1.12 date 2006.07.02.13.10.44; author tsch; state Exp; branches; next 1.11; 1.11 date 2006.06.03.14.21.09; author tsch; state Exp; branches; next 1.10; 1.10 date 2006.05.14.13.43.10; author tsch; state Exp; branches; next 1.9; 1.9 date 2006.05.07.14.17.39; author tsch; state Exp; branches; next 1.8; 1.8 date 2006.01.08.17.06.29; author tsch; state Exp; branches; next 1.7; commitid 64a343c146924567; 1.7 date 2005.08.10.17.01.53; author tsch; state Exp; branches; next 1.6; commitid 55d042fa32fe4567; 1.6 date 2005.07.29.17.19.55; author tsch; state Exp; branches; next 1.5; commitid 3b1e42ea65374567; 1.5 date 2005.07.12.20.29.47; author tsch; state Exp; branches; next 1.4; commitid 758542d428324567; 1.4 date 2004.11.12.03.26.34; author rwmcfa1; state Exp; branches; next 1.3; 1.3 date 2004.11.11.02.20.32; author rwmcfa1; state Exp; branches; next 1.2; 1.2 date 2004.11.09.02.59.43; author rwmcfa1; state Exp; branches; next 1.1; 1.1 date 2004.11.05.01.34.04; author rwmcfa1; state Exp; branches; next ; 1.21.2.1 date 2007.12.29.14.03.52; author tsch; state Exp; branches; next ; commitid 2Vxybvpfv0d0EkLs; desc @@ 1.26 log @In preparation of the move to SVN, use the Id keyword in place of Header. @ text @/* * Copyright (c) 2004-2005 by the cairo perl team (see the file README) * * Licensed under the LGPL, see LICENSE file for more information. * * $Id: /cvs/cairo/cairo-perl/Cairo.xs,v 1.25 2008-02-24 14:03:07 tsch Exp $ * */ #include #include #define NEED_newRV_noinc_GLOBAL #include "ppport.h" /* ------------------------------------------------------------------------- */ static void call_xs (pTHX_ void (*subaddr) (pTHX_ CV *), CV * cv, SV ** mark) { dSP; PUSHMARK (mark); (*subaddr) (aTHX_ cv); PUTBACK; /* forget return values */ } #define CAIRO_PERL_CALL_BOOT(name) \ { \ extern XS(name); \ call_xs (aTHX_ name, cv, mark); \ } /* ------------------------------------------------------------------------- */ /* Copied from Glib/GType.xs. */ void cairo_perl_set_isa (const char *child_package, const char *parent_package) { char *child_isa_full; AV *isa; New (0, child_isa_full, strlen(child_package) + 5 + 1, char); child_isa_full = strcpy (child_isa_full, child_package); child_isa_full = strcat (child_isa_full, "::ISA"); isa = get_av (child_isa_full, TRUE); /* create on demand */ Safefree (child_isa_full); av_push (isa, newSVpv (parent_package, 0)); } /* ------------------------------------------------------------------------- */ void * cairo_object_from_sv (SV *sv, const char *package) { if (!SvOK (sv) || !SvROK (sv) || !sv_derived_from (sv, package)) croak("Cannot convert scalar 0x%x to an object of type %s", sv, package); return INT2PTR (void *, SvIV ((SV *) SvRV (sv))); } SV * cairo_object_to_sv (void *object, const char *package) { SV *sv = newSV (0); sv_setref_pv(sv, package, object); return sv; } /* ------------------------------------------------------------------------- */ void * cairo_struct_from_sv (SV *sv, const char *package) { if (!SvOK (sv) || !SvROK (sv) || !sv_derived_from (sv, package)) croak("Cannot convert scalar 0x%x to a struct of type %s", sv, package); return INT2PTR (void *, SvIV ((SV *) SvRV (sv))); } SV * cairo_struct_to_sv (void *object, const char *package) { SV *sv = newSV (0); sv_setref_pv(sv, package, object); return sv; } /* ------------------------------------------------------------------------- */ SV * newSVCairoFontExtents (cairo_font_extents_t *extents) { HV *hv; double value; if (!extents) return &PL_sv_undef; hv = newHV (); value = extents->ascent; hv_store (hv, "ascent", 6, newSVnv (value), 0); value = extents->descent; hv_store (hv, "descent", 7, newSVnv (value), 0); value = extents->height; hv_store (hv, "height", 6, newSVnv (value), 0); value = extents->max_x_advance; hv_store (hv, "max_x_advance", 13, newSVnv (value), 0); value = extents->max_y_advance; hv_store (hv, "max_y_advance", 13, newSVnv (value), 0); return newRV_noinc ((SV *) hv); } /* ------------------------------------------------------------------------- */ SV * newSVCairoTextExtents (cairo_text_extents_t *extents) { HV *hv; double value; if (!extents) return &PL_sv_undef; hv = newHV (); value = extents->x_bearing; hv_store (hv, "x_bearing", 9, newSVnv (value), 0); value = extents->y_bearing; hv_store (hv, "y_bearing", 9, newSVnv (value), 0); value = extents->width; hv_store (hv, "width", 5, newSVnv (value), 0); value = extents->height; hv_store (hv, "height", 6, newSVnv (value), 0); value = extents->x_advance; hv_store (hv, "x_advance", 9, newSVnv (value), 0); value = extents->y_advance; hv_store (hv, "y_advance", 9, newSVnv (value), 0); return newRV_noinc ((SV *) hv); } /* ------------------------------------------------------------------------- */ /* taken from Glib/Glib.xs */ void * cairo_perl_alloc_temp (int nbytes) { dTHR; SV * s; if (nbytes <= 0) return NULL; s = sv_2mortal (NEWSV (0, nbytes)); memset (SvPVX (s), 0, nbytes); return SvPVX (s); } SV * newSVCairoGlyph (cairo_glyph_t *glyph) { HV *hv; unsigned long index; double value; if (!glyph) return &PL_sv_undef; hv = newHV (); index = glyph->index; hv_store (hv, "index", 5, newSVuv (index), 0); value = glyph->x; hv_store (hv, "x", 1, newSVnv (value), 0); value = glyph->y; hv_store (hv, "y", 1, newSVnv (value), 0); return newRV_noinc ((SV *) hv); } cairo_glyph_t * SvCairoGlyph (SV *sv) { HV *hv; SV **value; cairo_glyph_t *glyph; if (!SvOK (sv) || !SvRV (sv) || SvTYPE (SvRV (sv)) != SVt_PVHV) croak ("cairo_glyph_t must be a hash reference"); hv = (HV *) SvRV (sv); glyph = cairo_perl_alloc_temp (sizeof (cairo_glyph_t)); value = hv_fetch (hv, "index", 5, 0); if (value && SvOK (*value)) glyph->index = SvUV (*value); value = hv_fetch (hv, "x", 1, 0); if (value && SvOK (*value)) glyph->x = SvNV (*value); value = hv_fetch (hv, "y", 1, 0); if (value && SvOK (*value)) glyph->y = SvNV (*value); return glyph; } /* ------------------------------------------------------------------------- */ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0) SV * newSVCairoRectangle (cairo_rectangle_t *rectangle) { HV *hv; if (!rectangle) return &PL_sv_undef; hv = newHV (); hv_store (hv, "x", 1, newSVnv (rectangle->x), 0); hv_store (hv, "y", 1, newSVnv (rectangle->y), 0); hv_store (hv, "width", 5, newSVnv (rectangle->width), 0); hv_store (hv, "height", 6, newSVnv (rectangle->height), 0); return newRV_noinc ((SV *) hv); } #endif /* ------------------------------------------------------------------------- */ MODULE = Cairo PACKAGE = Cairo PREFIX = cairo_ BOOT: #include "cairo-perl-boot.xsh" #if CAIRO_PERL_DEBUG call_atexit ((ATEXIT_t) cairo_debug_reset_static_data, NULL); #endif int VERSION (class=NULL) CODE: RETVAL = CAIRO_VERSION; OUTPUT: RETVAL int VERSION_ENCODE (...) PREINIT: int major, minor, micro; CODE: if (items == 3) { major = SvIV (ST (0)); minor = SvIV (ST (1)); micro = SvIV (ST (2)); } else if (items == 4) { major = SvIV (ST (1)); minor = SvIV (ST (2)); micro = SvIV (ST (3)); } else { croak ("Usage: Cairo::VERSION_ENCODE (major, minor, micro) or Cairo->VERSION_ENCODE (major, minor, micro)"); } RETVAL = CAIRO_VERSION_ENCODE (major, minor, micro); OUTPUT: RETVAL # int cairo_version (); int cairo_version (class=NULL) C_ARGS: /* void */ # const char* cairo_version_string (); const char* cairo_version_string (class=NULL) C_ARGS: /* void */ # ---------------------------------------------------------------------------- # MODULE = Cairo PACKAGE = Cairo::Context PREFIX = cairo_ cairo_t_noinc * cairo_create (class, cairo_surface_t * target); C_ARGS: target void DESTROY (cairo_t * cr); CODE: cairo_destroy (cr); void cairo_save (cairo_t * cr); void cairo_restore (cairo_t * cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) void cairo_push_group (cairo_t *cr); void cairo_push_group_with_content (cairo_t *cr, cairo_content_t content); cairo_pattern_t * cairo_pop_group (cairo_t *cr); void cairo_pop_group_to_source (cairo_t *cr); #endif void cairo_set_operator (cairo_t * cr, cairo_operator_t op); void cairo_set_source_rgb (cairo_t *cr, double red, double green, double blue); void cairo_set_source_rgba (cairo_t *cr, double red, double green, double blue, double alpha); void cairo_set_source (cairo_t *cr, cairo_pattern_t *source); void cairo_set_source_surface (cairo_t *cr, cairo_surface_t *surface, double x, double y); void cairo_set_tolerance (cairo_t * cr, double tolerance); void cairo_set_antialias (cairo_t *cr, cairo_antialias_t antialias); void cairo_set_fill_rule (cairo_t * cr, cairo_fill_rule_t fill_rule); void cairo_set_line_width (cairo_t * cr, double width); void cairo_set_line_cap (cairo_t * cr, cairo_line_cap_t line_cap); void cairo_set_line_join (cairo_t * cr, cairo_line_join_t line_join); ##void cairo_set_dash (cairo_t * cr, double * dashes, int ndash, double offset); void cairo_set_dash (cairo_t * cr, double offset, ...) PREINIT: int i, n; double *pts; CODE: #define FIRST 2 n = (items - FIRST); if (n == 0) { pts = NULL; } else { New (0, pts, n, double); if (!pts) croak ("malloc failure for (%d) elements", n); for (i = FIRST ; i < items ; i++) pts[i - FIRST] = SvNV (ST (i)); } #undef FIRST cairo_set_dash (cr, pts, n, offset); CLEANUP: if (pts) Safefree (pts); void cairo_set_miter_limit (cairo_t * cr, double limit); void cairo_translate (cairo_t * cr, double tx, double ty); void cairo_scale (cairo_t * cr, double sx, double sy); void cairo_rotate (cairo_t * cr, double angle); void cairo_transform (cairo_t *cr, const cairo_matrix_t *matrix); void cairo_set_matrix (cairo_t * cr, const cairo_matrix_t * matrix); void cairo_identity_matrix (cairo_t * cr); void cairo_user_to_device (cairo_t *cr, IN_OUTLIST double x, IN_OUTLIST double y); void cairo_user_to_device_distance (cairo_t *cr, IN_OUTLIST double dx, IN_OUTLIST double dy); void cairo_device_to_user (cairo_t *cr, IN_OUTLIST double x, IN_OUTLIST double y); void cairo_device_to_user_distance (cairo_t *cr, IN_OUTLIST double dx, IN_OUTLIST double dy); void cairo_new_path (cairo_t * cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) void cairo_new_sub_path (cairo_t *cr); #endif void cairo_move_to (cairo_t * cr, double x, double y); void cairo_line_to (cairo_t * cr, double x, double y); void cairo_curve_to (cairo_t * cr, double x1, double y1, double x2, double y2, double x3, double y3); void cairo_arc (cairo_t * cr, double xc, double yc, double radius, double angle1, double angle2); void cairo_arc_negative (cairo_t * cr, double xc, double yc, double radius, double angle1, double angle2); void cairo_rel_move_to (cairo_t * cr, double dx, double dy); void cairo_rel_line_to (cairo_t * cr, double dx, double dy); void cairo_rel_curve_to (cairo_t * cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); void cairo_rectangle (cairo_t * cr, double x, double y, double width, double height); void cairo_close_path (cairo_t * cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 8) /* FIXME: 1.6 */ void cairo_path_extents (cairo_t *cr, OUTLIST double x1, OUTLIST double y1, OUTLIST double x2, OUTLIST double y2); #endif void cairo_paint (cairo_t *cr); void cairo_paint_with_alpha (cairo_t *cr, double alpha); void cairo_mask (cairo_t *cr, cairo_pattern_t *pattern); void cairo_mask_surface (cairo_t *cr, cairo_surface_t *surface, double surface_x, double surface_y); void cairo_stroke (cairo_t * cr); void cairo_stroke_preserve (cairo_t *cr); void cairo_fill (cairo_t * cr); void cairo_fill_preserve (cairo_t *cr); void cairo_copy_page (cairo_t * cr); void cairo_show_page (cairo_t * cr); int cairo_in_stroke (cairo_t * cr, double x, double y); int cairo_in_fill (cairo_t * cr, double x, double y); void cairo_stroke_extents (cairo_t * cr, OUTLIST double x1, OUTLIST double y1, OUTLIST double x2, OUTLIST double y2); void cairo_fill_extents (cairo_t * cr, OUTLIST double x1, OUTLIST double y1, OUTLIST double x2, OUTLIST double y2); void cairo_clip (cairo_t * cr); void cairo_clip_preserve (cairo_t *cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0) ##cairo_rectangle_list_t * cairo_copy_clip_rectangle_list (cairo_t *cr); void cairo_copy_clip_rectangle_list (cairo_t *cr) PREINIT: cairo_rectangle_list_t *list; int i; PPCODE: list = cairo_copy_clip_rectangle_list (cr); CAIRO_PERL_CHECK_STATUS (list->status); EXTEND (sp, list->num_rectangles); for (i = 0; i < list->num_rectangles; i++) PUSHs (sv_2mortal (newSVCairoRectangle (&(list->rectangles[i])))); cairo_rectangle_list_destroy (list); void cairo_clip_extents (cairo_t *cr, OUTLIST double x1, OUTLIST double y1, OUTLIST double x2, OUTLIST double y2); #endif void cairo_reset_clip (cairo_t *cr); void cairo_select_font_face (cairo_t *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight); void cairo_set_font_size (cairo_t *cr, double size); void cairo_set_font_matrix (cairo_t *cr, const cairo_matrix_t *matrix); ##void cairo_get_font_matrix (cairo_t *cr, cairo_matrix_t *matrix); cairo_matrix_t * cairo_get_font_matrix (cairo_t *cr) PREINIT: cairo_matrix_t matrix; CODE: cairo_get_font_matrix (cr, &matrix); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL void cairo_set_font_options (cairo_t *cr, const cairo_font_options_t *options); ##void cairo_get_font_options (cairo_t *cr, cairo_font_options_t *options); cairo_font_options_t * cairo_get_font_options (cairo_t *cr) CODE: RETVAL = cairo_font_options_create (); cairo_get_font_options (cr, RETVAL); OUTPUT: RETVAL #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) void cairo_set_scaled_font (cairo_t *cr, const cairo_scaled_font_t *scaled_font); #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0) cairo_scaled_font_t * cairo_get_scaled_font (cairo_t *cr); #endif void cairo_show_text (cairo_t * cr, const char * utf8); ##void cairo_show_glyphs (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs); void cairo_show_glyphs (cairo_t * cr, ...) PREINIT: cairo_glyph_t * glyphs = NULL; int num_glyphs, i; CODE: num_glyphs = items - 1; Newz (0, glyphs, num_glyphs, cairo_glyph_t); for (i = 1; i < items; i++) glyphs[i - 1] = *SvCairoGlyph (ST (i)); cairo_show_glyphs (cr, glyphs, num_glyphs); Safefree (glyphs); cairo_font_face_t * cairo_get_font_face (cairo_t *cr); ##void cairo_font_extents (cairo_t *cr, cairo_font_extents_t *extents); cairo_font_extents_t * cairo_font_extents (cairo_t *cr) PREINIT: cairo_font_extents_t extents; CODE: cairo_font_extents (cr, &extents); RETVAL = &extents; OUTPUT: RETVAL void cairo_set_font_face (cairo_t *cr, cairo_font_face_t *font_face); ##void cairo_text_extents (cairo_t * cr, const unsigned char * utf8, cairo_text_extents_t * extents); cairo_text_extents_t * cairo_text_extents (cairo_t * cr, const char * utf8) PREINIT: cairo_text_extents_t extents; CODE: cairo_text_extents (cr, utf8, &extents); RETVAL = &extents; OUTPUT: RETVAL ##void cairo_glyph_extents (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs, cairo_text_extents_t * extents); cairo_text_extents_t * cairo_glyph_extents (cairo_t * cr, ...) PREINIT: cairo_text_extents_t extents; cairo_glyph_t * glyphs = NULL; int num_glyphs, i; CODE: num_glyphs = items - 1; Newz (0, glyphs, num_glyphs, cairo_glyph_t); for (i = 1; i < items; i++) glyphs[i - 1] = *SvCairoGlyph (ST (i)); cairo_glyph_extents (cr, glyphs, num_glyphs, &extents); RETVAL = &extents; Safefree (glyphs); OUTPUT: RETVAL void cairo_text_path (cairo_t * cr, const char * utf8); ##void cairo_glyph_path (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs); void cairo_glyph_path (cairo_t * cr, ...) PREINIT: cairo_glyph_t * glyphs = NULL; int num_glyphs, i; CODE: num_glyphs = items - 1; Newz (0, glyphs, num_glyphs, cairo_glyph_t); for (i = 1; i < items; i++) glyphs[i - 1] = *SvCairoGlyph (ST (i)); cairo_glyph_path (cr, glyphs, num_glyphs); Safefree (glyphs); cairo_operator_t cairo_get_operator (cairo_t *cr); cairo_pattern_t * cairo_get_source (cairo_t *cr); double cairo_get_tolerance (cairo_t *cr); cairo_antialias_t cairo_get_antialias (cairo_t *cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 10) /* FIXME: 1.6 */ cairo_bool_t cairo_has_current_point (cairo_t *cr); #endif void cairo_get_current_point (cairo_t *cr, OUTLIST double x, OUTLIST double y); cairo_fill_rule_t cairo_get_fill_rule (cairo_t *cr); double cairo_get_line_width (cairo_t *cr); cairo_line_cap_t cairo_get_line_cap (cairo_t *cr); cairo_line_join_t cairo_get_line_join (cairo_t *cr); double cairo_get_miter_limit (cairo_t *cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 4, 0) ## int cairo_get_dash_count (cairo_t *cr); ## void cairo_get_dash (cairo_t *cr, double *dashes, double *offset); void cairo_get_dash (cairo_t *cr) PREINIT: int count, i; double *dashes, offset; PPCODE: count = cairo_get_dash_count (cr); if (count == 0) { dashes = NULL; } else { New (0, dashes, count, double); if (!dashes) croak ("malloc failure for (%d) elements", count); } cairo_get_dash (cr, dashes, &offset); EXTEND (sp, count + 1); PUSHs (sv_2mortal (newSVnv (offset))); for (i = 0; i < count; i++) PUSHs (sv_2mortal (newSVnv (dashes[i]))); Safefree (dashes); #endif ##void cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix); cairo_matrix_t * cairo_get_matrix (cairo_t *cr) PREINIT: cairo_matrix_t matrix; CODE: cairo_get_matrix (cr, &matrix); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL cairo_surface_t * cairo_get_target (cairo_t *cr); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_surface_t * cairo_get_group_target (cairo_t *cr); #endif cairo_path_t * cairo_copy_path (cairo_t *cr); cairo_path_t * cairo_copy_path_flat (cairo_t *cr); void cairo_append_path (cairo_t *cr, cairo_path_t *path); cairo_status_t cairo_status (cairo_t *cr); # --------------------------------------------------------------------------- # MODULE = Cairo PACKAGE = Cairo PREFIX = cairo_ bool HAS_PS_SURFACE () CODE: #ifdef CAIRO_HAS_PS_SURFACE RETVAL = TRUE; #else RETVAL = FALSE; #endif OUTPUT: RETVAL bool HAS_PDF_SURFACE () CODE: #ifdef CAIRO_HAS_PDF_SURFACE RETVAL = TRUE; #else RETVAL = FALSE; #endif OUTPUT: RETVAL bool HAS_SVG_SURFACE () CODE: #ifdef CAIRO_HAS_SVG_SURFACE RETVAL = TRUE; #else RETVAL = FALSE; #endif OUTPUT: RETVAL bool HAS_FT_FONT () CODE: #ifdef CAIRO_HAS_FT_FONT RETVAL = TRUE; #else RETVAL = FALSE; #endif OUTPUT: RETVAL bool HAS_PNG_FUNCTIONS () CODE: #ifdef CAIRO_HAS_PNG_FUNCTIONS RETVAL = TRUE; #else RETVAL = FALSE; #endif OUTPUT: RETVAL @ 1.25 log @ * Cairo.pm * Cairo.xs * t/Cairo.t: Wrap cairo_has_current_point. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.24 2008-02-10 18:37:19 tsch Exp $ @ 1.24 log @ * Cairo.xs * t/Cairo.t: Wrap cairo_path_extents. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.23 2007-12-29 13:56:29 tsch Exp $ d592 6 @ 1.23 log @ * Cairo.xs * CairoFont.xs * CairoMatrix.xs * CairoSurface.xs: Use perl's New*/Safefree facilities instead of calloc/malloc/free as the latter aren't safe on some platforms, notably Win32. Patch by T.J. Ferraro. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.22 2007-10-24 16:32:05 tsch Exp $ d416 6 @ 1.22 log @ * Cairo.pm * Cairo.xs * CairoFt.xs * Makefile.PL * cairo-perl.h * cairo-perl.typemap * examples/freetype-font.pl * t/CairoFt.t: Add support for part of cairo's FreeType integration API. Currently, that's just Cairo::FtFontFace::create, which lets you create a cairo font face from a FreeType font face. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.21 2007-09-30 12:54:31 tsch Exp $ d43 1 a43 1 child_isa_full = malloc (strlen (child_package) + 5 + 1); d47 1 a47 1 free (child_isa_full); d354 1 a354 1 pts = malloc (sizeof (double) * n); d364 1 a364 1 free (pts); d516 1 a516 1 glyphs = calloc (sizeof (cairo_glyph_t), num_glyphs); d520 1 a520 1 free (glyphs); d554 1 a554 1 glyphs = calloc (sizeof (cairo_glyph_t), num_glyphs); d559 1 a559 1 free (glyphs); d572 1 a572 1 glyphs = calloc (sizeof (cairo_glyph_t), num_glyphs); d576 1 a576 1 free (glyphs); d611 1 a611 1 dashes = malloc (sizeof (double) * count); d620 1 a620 1 free (dashes); @ 1.21 log @ * ppport.h * Cairo.xs * CairoPath.xs * CairoPattern.xs * CairoSurface.xs * MANIFEST * cairo-perl-private.h * cairo-perl.h: Add and use the portability header ppport.h from Devel::PPPort to hopefully fix compilation on older perls. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.20 2007-05-06 11:28:37 tsch Exp $ d688 11 @ 1.21.2.1 log @ * Cairo.xs * CairoFont.xs * CairoMatrix.xs * CairoSurface.xs: Use perl's New*/Safefree facilities instead of calloc/malloc/free as the latter aren't safe on some platforms, notably Win32. Patch by T.J. Ferraro. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.21 2007-09-30 12:54:31 tsch Exp $ d43 1 a43 1 New (0, child_isa_full, strlen(child_package) + 5 + 1, char); d47 1 a47 1 Safefree (child_isa_full); d354 1 a354 1 New (0, pts, n, double); d364 1 a364 1 Safefree (pts); d516 1 a516 1 Newz (0, glyphs, num_glyphs, cairo_glyph_t); d520 1 a520 1 Safefree (glyphs); d554 1 a554 1 Newz (0, glyphs, num_glyphs, cairo_glyph_t); d559 1 a559 1 Safefree (glyphs); d572 1 a572 1 Newz (0, glyphs, num_glyphs, cairo_glyph_t); d576 1 a576 1 Safefree (glyphs); d611 1 a611 1 New (0, dashes, count, double); d620 1 a620 1 Safefree (dashes); @ 1.20 log @ * Cairo.xs * CairoPattern.xs * Makefile.PL * cairo-perl.h * t/Cairo.t * t/CairoPattern.t: Use 1.4.0 in version checks. * Cairo.xs: If CAIRO_PERL_DEBUG is true, call cairo_debug_reset_static_data at exit. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.19 2007/03/17 16:13:32 tsch Exp $ d13 3 @ 1.19 log @ * Cairo.xs * t/Cairo.t: Wrap cairo_get_scaled_font. * CairoSurface.xs * t/CairoSurface.t: Re-add the binding for cairo_surface_finish. It was orignally removed because its effect can also be achieved by destroying the surface or letting it go out of scope. But Oleksandr Alex Protasenko convinced me that it's still a good idea to have it anyway, mainly for paginated surfaces like PDF and PS which defer rendering as long as they can. With $surf->finish you can more clearly express what you're intending to do than with $surf = undef. * examples/png-streams.pl: Fix indention. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.18 2007/01/21 15:09:07 tsch Exp $ d222 1 a222 1 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 3, 0) /* FIXME: 1.4 */ d248 6 a293 3 BOOT: #include "cairo-perl-boot.xsh" d445 1 a445 1 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 3, 0) /* FIXME: 1.4 */ d595 1 a595 1 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 3, 0) /* FIXME: 1.4 */ @ 1.18 log @ * Cairo.xs: Track upstream API change: cairo_get_dash_count returns the count directly; cairo_get_dash_count and cairo_get_dash don't return a status anymore. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.17 2007/01/18 19:53:39 tsch Exp $ d495 6 @ 1.17 log @ * t/Cairo.t, Cairo.xs: Track upstream API improvement: cairo_copy_clip_rectangles -> cairo_copy_clip_rectangle_list. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.16 2006/12/28 18:53:09 tsch Exp $ d588 2 a589 2 ## cairo_status_t cairo_get_dash_count (cairo_t *cr, int *count); ## cairo_status_t cairo_get_dash (cairo_t *cr, double *dashes, double *offset); a591 1 cairo_status_t status; d595 1 a595 2 status = cairo_get_dash_count (cr, &count); CAIRO_PERL_CHECK_STATUS (status); d603 1 a603 2 status = cairo_get_dash (cr, dashes, &offset); CAIRO_PERL_CHECK_STATUS (status); @ 1.16 log @ * Cairo.xs, cairo-perl.h, t/Cairo.t: Wrap and test cairo_copy_clip_rectangles and cairo_clip_extents. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.15 2006/11/09 19:43:43 tsch Exp $ d444 2 a445 2 ##cairo_rectangle_list_t * cairo_copy_clip_rectangles (cairo_t *cr); void cairo_copy_clip_rectangles (cairo_t *cr) d450 1 a450 1 list = cairo_copy_clip_rectangles (cr); @ 1.15 log @ * Cairo.xs, cairo-perl-private.h: Export cairo_perl_alloc_temp privately. * Cairo.xs: Remove the DOUBLES_ macros and inline them. They were used only in one place. * Cairo.xs, t/Cairo.t: Wrap cairo_get_dash. * CairoPattern.xs, cairo-perl-private.h, t/CairoPattern.t: Wrap cairo_pattern_get_rgba, cairo_pattern_get_surface, cairo_pattern_get_color_stop_rgba, cairo_pattern_get_points, and cairo_pattern_get_circles. * Makefile.PL: Support new cairo_status_t values. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.14 2006/08/10 17:34:40 tsch Exp $ d90 1 a90 1 newSVCairoFontExtents (cairo_font_extents_t * extents) d121 1 a121 1 newSVCairoTextExtents (cairo_text_extents_t * extents) d169 1 a169 1 newSVCairoGlyph (cairo_glyph_t * glyph) d193 1 a193 1 SvCairoGlyph (SV * sv) d222 24 d442 19 @ 1.14 log @ * Cairo.xs, CairoFont.xs, CairoPattern.xs, CairoSurface.xs, MakeHelper.pm, Makefile.PL, cairo-perl-private.h, t/Cairo.t, t/CairoFont.t, t/CairoPattern.t, t/CairoSurface.t: Make it possible to compile and run the bindings against cairo 1.0.x. Use a package lookup table for patterns and surfaces to work around the lack of type accessors. Add version guards around things that were introduced in 1.2.0. * CairoSurface.xs: Use OUTLIST for cairo_surface_get_device_offset. * CairoPattern.xs, CairoSurface.xs, cairo-perl-private.h: Rename cair_perl_set_isa to cairo_perl_set_isa. Doh! * t/CairoSurface.t: Explicitly clear the image surface on cairo 1.0.x before writing it out since 1.0.x doesn't do it for us. Use lexical surface variables to make sure they get destroyed before execution ends which in turn makes sure all tests inside callbacks are run before Test::More checks if reality matches the test plan. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.13 2006/07/15 14:41:11 tsch Exp $ a31 17 #define DOUBLES_DECLARE \ int i, n; double * pts; #define DOUBLES_SLURP_FROM_STACK(first) \ n = (items - first); \ pts = (double*)malloc (sizeof (double) * n); \ if (!pts) \ croak ("malloc failure for (%d) elements", n); \ for (i = first ; i < items ; i++) { \ pts[i-first] = SvIV (ST (i)); \ } #define DOUBLES_LEN n #define DOUBLES_ARRAY pts #define DOUBLES_CLEANUP \ free (pts); /* ------------------------------------------------------------------------- */ d155 2 a156 2 static void * alloc_temp (int nbytes) d203 1 a203 1 glyph = alloc_temp (sizeof (cairo_glyph_t)); d314 1 a314 1 void cairo_set_dash (cairo_t * cr, double offset, dash1, ...) d316 2 a317 1 DOUBLES_DECLARE d319 13 a331 2 DOUBLES_SLURP_FROM_STACK (2) cairo_set_dash (cr, DOUBLES_ARRAY, DOUBLES_LEN, offset); d333 2 a334 1 DOUBLES_CLEANUP d543 29 @ 1.13 log @ * Cairo.pm, Cairo.xs, CairoPattern.xs, CairoSurface.xs, cairo-perl-private.h: Add cairo_perl_set_isa and use it for surfaces and patterns. * CairoSurface.xs, Makefile.PL, cairo-perl.h, t/CairoSurface.t: Add support for svg surfaces if available. * t/CairoSurface.t: Remove TODO block and revert workaround related to the weird unknown surface types. It's been fixed upstream: https://bugs.freedesktop.org/show_bug.cgi?id=7322 @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.12 2006/07/02 13:10:44 tsch Exp $ d51 2 a52 2 cair_perl_set_isa (const char *child_package, const char *parent_package) d296 2 d306 2 d364 2 d368 2 d450 2 d454 2 d559 2 d563 2 @ 1.12 log @ * Makefile.PL: Require cairo 1.2.0. Add CAIRO_FORMAT_RGB16_565. * Cairo.pm, CairoFont.xs: Cosmetical changes. * Cairo.xs: Add Cairo::VERSION and Cairo::VERSION_ENCODE. * t/CairoSurface.t: Shuffle a few tests around to avoid some strange singularities. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.11 2006/06/03 14:21:09 tsch Exp $ a31 2 /* XXX: these need extensive testing */ d49 19 d584 1 a584 12 HAS_XLIB_SURFACE () CODE: #ifdef CAIRO_HAS_XLIB_SURFACE RETVAL = TRUE; #else RETVAL = FALSE; #endif OUTPUT: RETVAL bool HAS_FT_FONT () d586 1 a586 1 #ifdef CAIRO_HAS_FT_FONT @ 1.11 log @ * Cairo.pm: Document Cairo::get_group_target, Cairo::new_sub_path, Cairo::Pattern::get_type, Cairo::set_scaled_font, Cairo::version, and Cairo::version_string. * t/Cairo.t, Cairo.xs: Allow Cairo::version[_string] to be called as a function and as a class method. * CairoPattern.xs, CairoSurface.xs, t/CairoSurface.t, Makefile.PL, examples/simple.pl, examples/png/caps_joins.pl, examples/png/hering.pl: Whitespace fixes. * t/CairoSurface.t, CairoSurface.xs: Wrap cairo_surface_get_content. * MakeHelper.pm: Don't add a linebreak to croaks so perl prints line information. * Makefile.PL: Require cairo 1.1.7. * examples/png/README, examples/png/bevels.pl, examples/png/spline-pipeline.pl, examples/png/text-rotate.pl, examples/png/text.pl: New example ports. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.10 2006/05/14 13:43:10 tsch Exp $ d224 26 @ 1.10 log @ * t/CairoSurface.t, CairoSurface.xs: Remove Cairo::Surface::finish; it's memory management related and not needed, as far as I can tell. Scream if you used it. * t/CairoSurface.t, CairoSurface.xs: Bind and test cairo_surface_write_to_png_stream, cairo_image_surface_create_from_png_stream, cairo_pdf_surface_create_for_stream, and cairo_ps_surface_create_for_stream. * CairoSurface.xs: Don't leak cairo_surface_create_similar's return value. * cairo-perl-private.h: Remove CAIRO_PERL_UNUSED. * cairo-perl-private.h, Cairo.xs, CairoFont.xs, CairoMatrix.xs, CairoPattern.xs: Rename pcairo_copy_matrix to cairo_perl_copy_matrix. * TODO: Update. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.9 2006/05/07 14:17:39 tsch Exp $ d224 4 a227 1 int cairo_version (); d229 4 a232 1 const char* cairo_version_string (); @ 1.9 log @ * .cvsignore, MANIFEST.SKIP: Update. * Cairo.pm: Update copyright notice. * MANIFEST, cairo-perl-private.h: Add a private header file for non-public declarations that are used in more than one place. * MakeHelper.pm: Improve the enum converters to produce more useful error messages. * Makefile.PL: Incorporate a slightly modified patch from Christopher Oezbek to prompt the user if he wants to install EU::Depends and EU::PkgConfig if they can't be found. Require cairo >= 1.1.6. Update and rearrange enums. * cairo-perl.h, Cairo.xs: Move CAIRO_PERL_CALL_BOOT to Cairo.xs. * cairo-perl.h, CairoSurface.xs, CairoPattern.xs, Makefile.PL: Use cairo_surface_get_type and cairo_pattern_get_type to redo the sub-type handling for surfaces and patterns. * cairo-perl-private.h, Cairo.xs, CairoMatrix.xs, CairoPattern.xs: Add pcairo_copy_matrix and use it all over the place to make matrix handling more robust. * Cairo.xs, t/Cairo.t: Wrap cairo_version, cairo_version_string, cairo_push_group, cairo_push_group_with_content, cairo_pop_group, cairo_pop_group_to_source, cairo_new_sub_path, cairo_set_scaled_font, and cairo_get_group_target. * CairoFont.xs, t/CairoFont.t: Wrap cairo_font_face_get_type, cairo_scaled_font_get_type, cairo_scaled_font_text_extents, cairo_scaled_font_get_font_face, cairo_scaled_font_get_font_matrix, cairo_scaled_font_get_ctm, and cairo_scaled_font_get_font_options. * CairoPattern.xs, t/CairoPattern.t: Wrap cairo_pattern_get_type. * CairoSurface.xs, t/CairoSurface.t: Wrap cairo_surface_get_device_offset, cairo_surface_get_type, cairo_pdf_surface_set_size, cairo_ps_surface_set_dpi, cairo_ps_surface_set_size, cairo_ps_surface_dsc_comment, cairo_ps_surface_dsc_begin_setup, and cairo_ps_surface_dsc_begin_setup. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.8 2006/01/08 17:06:29 tsch Exp $ d379 1 a379 1 RETVAL = pcairo_copy_matrix (&matrix); d492 1 a492 1 RETVAL = pcairo_copy_matrix (&matrix); @ 1.8 log @ * Cairo.pm: Make DynaLoader export all our symbols. * Cairo.xs, MakeHelper.pm, Makefile.PL, cairo-perl.h: Revamp the type conversion API. Instead of implementing everything in the typemap, we now have macros like newSVCairoPattern SvCairoPattern. These get exported, so other modules can make use of them. * cairo-perl.h: Remove the DBG macro. * cairo-perl.typemap: Use T_UV instead of T_IV for cairo_bool_t. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.7 2005/08/10 17:01:53 tsch Exp $ d11 1 d15 2 a16 2 void _cairo_perl_call_XS (pTHX_ void (*subaddr) (pTHX_ CV *), CV * cv, SV ** mark) d24 6 d222 8 d247 8 d311 2 d375 2 d378 2 a379 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_get_font_matrix (cr, RETVAL); d393 2 d488 2 d491 2 a492 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_get_matrix (cr, RETVAL); d498 2 @ 1.7 log @ * t/Cairo.t, Cairo.xs: Bind cairo_set_antialias and cairo_get_antialias. * t/CairoSurface.t, CairoSurface.xs: Bind cairo_surface_flush, cairo_surface_mark_dirty, cairo_surface_mark_dirty_rectangle. * MANIFEST, META.yml: Remove META.yml; let EU::MakeMaker generate it on "make dist". * Makefile.PL: Require cairo 0.9.0. Add our prerequisites to the WriteMakefile call so that they appear in the generated META.yml. Support CAIRO_STATUS_FILE_NOT_FOUND. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.6 2005/07/29 17:19:55 tsch Exp $ d44 38 @ 1.6 log @ * t/Cairo.t, xs/Cairo.xs: Wrap cairo_get_font_options. * t/CairoFont.t, xs/CairoFont.xs: Wrap cairo_font_face_status, cairo_scaled_font_status, cairo_font_options_*. Update cairo_scaled_font_create. * t/CairoSurface.t, CairoSurface.xs: Wrap cairo_surface_status, cairo_surface_get_font_options. * Makefile.PL: Wrap the new cairo_font_options_t stuff. * Makefile.PL: Require cairo 0.6.0. Add new and update the old enums. Install all files necessary for other modules to use Cairo. * cairo-perl.typemap: Add a cairo_bool_t typemap. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.5 2005/07/12 20:29:47 tsch Exp $ d206 2 d405 2 @ 1.5 log @ * Cairo.pm, Cairo.xs, t/Cairo.t: Replace the %backends hash with Cairo::HAS_PS_SURFACE, HAS_PDF_SURFACE, HAS_XLIB_SURFACE, HAS_FT_FONT and HAS_PNG_FUNCTIONS. * Cairo.pm, CairoPattern.xs, CairoSurface.xs, Makefile.PL: Implement the pattern and surface hierarchy suggested by the language bindings guidelines. * Cairo.xs: Use Cairo::Context for the namespace of cairo_t, instead of just Cairo, as suggested by the guidelines. * Cairo.xs, CairoFont.xs, CairoMatrix.xs, CairoPattern.xs, CairoSurface.xs, cairo-perl.h: Add new, remove old API. Shuffle some things around. * Cairo.xs: Convert font and text extents and glyphs to and from native Perl data structures. * Cairo.xs, cairo-perl.h, cairo-perl.typemap: Remove everything that cannot be used from Perl, like the XLib and Glitz stuff. * CairoPath.xs, t/CairoPath.t: Add support for cairo_path_t, including a nice tied interface that lets you iterate over paths as if they were normal array references. * MakeHelper.pm: Extend the typemap generator to support "const" and "_noinc" types. Change the enum handling to use the Glib convention, i.e. lowercase and hyphen instead of underscore. * Makefile.PL, README: Use ExtUtils::Depends. * examples/simple.pl, examples/png/caps_join.pl, examples/png/hering.pl, examples/png/outline.pl, examples/png/spiral.pl, examples/png/splines_tolerance.pl, examples/png/stars.pl: Update the examples to make them work again after all those API changes. * t/Cairo.t, t/CairoFont.t, CairoMatrix.t, CairoPattern.t, CairoSurface.t: Redo and/or expand the whole test suite. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.4 2004/11/12 03:26:34 rwmcfa1 Exp $ d316 10 @ 1.4 log @ * t/CairoMatrix.t, t/CairoPattern.t, t/CairoSurface.t: initial import, 95% complete tests * Cairo.xs, CairoMatrix.xs, CairoSurface.xs, CairoPattern.xs: no more new's, not really a good idea. * CairoFont.xs: all disabled for now * CairoMatrix.xs: copy, multiply, and transforms fixed while doing tests * CairoPattern.xs: get_matrix fixed whlie doing tests * CairoSurface.xs: cleaned up the namespace problems herein. fixed several output funcs. * MANIFEST: added TODO and new tests. * MANIFEST.SKIP: skip CairoEnums.xs * t/Cairo.t: no new test, change Surface stuff due to namespace above @ text @d2 1 a2 1 * Copyright (c) 2004 by the cairo perl team (see the file README) d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.3 2004/11/11 02:20:32 rwmcfa1 Exp $ d12 2 d23 3 a25 1 MODULE = Cairo PACKAGE = Cairo PREFIX = cairo_ d27 9 a35 3 BOOT: { #include "cairo-perl-boot.xsh" d37 29 d67 30 a96 3 cairo_t * cairo_create (class); C_ARGS: /* void */ d98 2 a99 2 ## shouldn't have to deal with references from perl ##void cairo_reference (cairo_t * cr); d101 2 a102 5 ## destroy should happen auto-magically ##void cairo_destroy (cairo_t * cr); void cairo_DESTROY (cairo_t * cr); CODE: cairo_destroy (cr); d104 2 a105 1 void cairo_save (cairo_t * cr); d107 1 a107 1 void cairo_restore (cairo_t * cr); d109 6 a114 7 ## void cairo_copy (cairo_t * dest, cairo_t * src); cairo_t * cairo_copy (cairo_t * src) CODE: RETVAL = cairo_create (); cairo_copy (RETVAL, src); OUTPUT: RETVAL d116 1 a116 1 void cairo_set_target_surface (cairo_t * cr, cairo_surface_t * surface); d118 4 a121 1 void cairo_set_target_image (cairo_t * cr, char * data, cairo_format_t format, int width, int height, int stride); d123 6 d130 2 a131 2 #ifdef CAIRO_HAS_PS_SURFACE # include d133 1 a133 1 void cairo_set_target_ps (cairo_t * cr, FILE * file, double width_inches, double height_inches, double x_pixels_per_inch, double y_pixels_per_inch); d135 2 a136 1 #endif /* CAIRO_HAS_PS_SURFACE */ d138 2 d141 2 a142 2 #ifdef CAIRO_HAS_PNG_SURFACE # include d144 2 a145 1 void cairo_set_target_png (cairo_t * cr, FILE * file, cairo_format_t format, int width, int height); d147 6 a152 1 #endif /* CAIRO_HAS_PNG_SURFACE */ d154 2 d157 2 a158 2 #ifdef CAIRO_HAS_XLIB_SURFACE # include d160 3 a162 2 ## XXX: how would you get a Display and Drawable in perl void cairo_set_target_drawable (cairo_t * cr, Display * dpy, Drawable drawable); d164 3 a166 1 #endif /* CAIRO_HAS_XLIB_SURFACE */ d168 3 d172 2 a173 3 #ifdef CAIRO_HAS_XCB_SURFACE # include # include d175 1 a175 2 ## XXX: how would you get these XCB types in perl void cairo_set_target_xcb (cairo_t * cr, XCBConnection * dpy, XCBDRAWABLE drawable, XCBVISUALTYPE * visual, cairo_format_t format); d177 1 a177 1 #endif /* CAIRO_HAS_XCB_SURFACE */ d179 2 d182 3 a184 2 #ifdef CAIRO_HAS_GLITZ_SURFACE # include d186 3 a188 2 ## XXX: how would you get a glitz_surface_t in perl void cairo_set_target_glitz (cairo_t * cr, glitz_surface_t * surface); d190 1 a190 1 #endif /* CAIRO_HAS_GLITZ_SURFACE */ d192 1 d196 3 a198 1 void cairo_set_rgb_color (cairo_t * cr, double red, double green, double blue); d200 1 a200 1 void cairo_set_pattern (cairo_t * cr, cairo_pattern_t * pattern); d202 1 a202 1 void cairo_set_alpha (cairo_t * cr, double alpha); a213 1 ## XXX: double * d232 5 a236 1 void cairo_concat_matrix (cairo_t * cr, cairo_matrix_t * matrix); d238 1 a238 1 void cairo_set_matrix (cairo_t * cr, cairo_matrix_t * matrix); d240 1 a240 1 void cairo_default_matrix (cairo_t * cr); d242 1 a242 1 void cairo_identity_matrix (cairo_t * cr); d244 1 a244 15 ## XXX: double * ##void cairo_transform_point (cairo_t * cr, double * x, double * y); void cairo_transform_point (cairo_t * cr, IN_OUTLIST double x, IN_OUTLIST double y); ## XXX: double * ##void cairo_transform_distance (cairo_t * cr, double * dx, double * dy); void cairo_transform_distance (cairo_t * cr, IN_OUTLIST double dx, IN_OUTLIST double dy); ## XXX: double * ##void cairo_inverse_transform_point (cairo_t * cr, double * x, double * y); void cairo_inverse_transform_point (cairo_t * cr, IN_OUTLIST double x, IN_OUTLIST double y); ## XXX: double * ##void cairo_inverse_transform_distance (cairo_t * cr, double * dx, double * dy); void cairo_inverse_transform_distance (cairo_t * cr, IN_OUTLIST double dx, IN_OUTLIST double dy); d268 8 d278 2 d282 2 a291 2 ## XXX: double * ##void cairo_stroke_extents (cairo_t * cr, double * x1, double * y1, double * x2, double * y2); a293 2 ## XXX: double * ##void cairo_fill_extents (cairo_t * cr, double * x1, double * y1, double * x2, double * y2); a295 2 void cairo_init_clip (cairo_t * cr); d298 1 a298 1 void cairo_select_font (cairo_t * cr, const char * family, cairo_font_slant_t slant, cairo_font_weight_t weight); d300 1 a300 1 void cairo_scale_font (cairo_t * cr, double scale); d302 1 a302 1 void cairo_transform_font (cairo_t * cr, cairo_matrix_t * matrix); d304 1 a304 1 void cairo_show_text (cairo_t * cr, const unsigned char * utf8); d306 1 a306 1 void cairo_show_glyphs (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs); d308 7 a314 1 cairo_font_t * cairo_current_font (cairo_t * cr); d316 1 a316 1 void cairo_current_font_extents (cairo_t * cr, cairo_font_extents_t * extents); d318 12 a329 1 void cairo_set_font (cairo_t * cr, cairo_font_t * font); d331 1 a331 1 void cairo_text_extents (cairo_t * cr, const unsigned char * utf8, cairo_text_extents_t * extents); d333 9 a341 1 void cairo_glyph_extents (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs, cairo_text_extents_t * extents); d343 1 a343 1 void cairo_text_path (cairo_t * cr, const unsigned char * utf8); d345 9 a353 1 void cairo_glyph_path (cairo_t * cr, cairo_glyph_t * glyphs, int num_glyphs); d355 16 a370 3 #include #include #include FT_FREETYPE_H d372 1 a372 2 ## XXX: FT... ##cairo_font_t * cairo_ft_font_create (FT_Library ft_library, FcPattern * pattern); d374 12 a385 2 ## XXX: FT... ##cairo_font_t * cairo_ft_font_create_for_ft_face (FT_Face face); d387 1 a387 2 ## XXX: this symbol is undefined ##void cairo_ft_font_destroy (cairo_font_t * ft_font); d389 1 a389 2 ## XXX: FT... ##FT_Face cairo_ft_font_face (cairo_font_t * ft_font); d391 1 a391 2 ## XXX: Fc... ##FcPattern * cairo_ft_font_pattern (cairo_font_t * ft_font); d393 1 a393 1 void cairo_show_surface (cairo_t * cr, cairo_surface_t * surface, int width, int height); d395 1 a395 1 cairo_operator_t cairo_current_operator (cairo_t * cr); d397 1 a397 2 ##void cairo_current_rgb_color (cairo_t * cr, double * red, double * green, double * blue); void cairo_current_rgb_color (cairo_t * cr, OUTLIST double red, OUTLIST double green, OUTLIST double blue); d399 1 a399 1 cairo_pattern_t * cairo_current_pattern (cairo_t * cr); d401 1 a401 1 double cairo_current_alpha (cairo_t * cr); d403 1 a403 1 double cairo_current_tolerance (cairo_t * cr); d405 9 a413 2 ##void cairo_current_point (cairo_t * cr, double * x, double * y); void cairo_current_point (cairo_t * cr, OUTLIST double x, OUTLIST double y); d415 1 a415 1 cairo_fill_rule_t cairo_current_fill_rule (cairo_t * cr); d417 1 a417 1 double cairo_current_line_width (cairo_t * cr); d419 1 a419 1 cairo_line_cap_t cairo_current_line_cap (cairo_t * cr); d421 1 a421 1 cairo_line_join_t cairo_current_line_join (cairo_t * cr); d423 1 a423 1 double cairo_current_miter_limit (cairo_t * cr); d425 4 a428 2 ##void cairo_current_matrix (cairo_t * cr, cairo_matrix_t * matrix); cairo_matrix_t * cairo_current_matrix (cairo_t * cr); d430 5 a434 2 RETVAL = cairo_matrix_create (); cairo_current_matrix (cr, RETVAL); d438 10 a447 22 cairo_surface_t * cairo_current_target_surface (cairo_t * cr); ## XXX: callbacks ##typedef void (cairo_move_to_func_t) (void * closure, double x, double y); ## ##typedef void (cairo_line_to_func_t) (void * closure, double x, double y); ## ##typedef void (cairo_curve_to_func_t) (void * closure, double x1, double y1, double x2, double y2, double x3, double y3); ## ##typedef void (cairo_close_path_func_t) (void * closure); ## ##extern void cairo_current_path (cairo_t * cr, cairo_move_to_func_t * move_to, cairo_line_to_func_t * line_to, cairo_curve_to_func_t * curve_to, cairo_close_path_func_t * close_path, void * closure); ## ##extern void cairo_current_path_flat (cairo_t * cr, cairo_move_to_func_t * move_to, cairo_line_to_func_t * line_to, cairo_close_path_func_t * close_path, void * closure); cairo_status_t cairo_status (cairo_t * cr); const char * cairo_status_string (cairo_t * cr); ## XXX: HAS section, test for capibilities, cairo really needs to dynamically ## register these. and there really ought to be version numbers associated with ## them d449 2 a450 1 void _register_backends (HV * backends); a451 6 #ifdef CAIRO_HAS_PS_SURFACE hv_store (backends, "ps", 2, newSViv (1), 0); #endif #ifdef CAIRO_HAS_PNG_SURFACE hv_store (backends, "png", 3, newSViv (1), 0); #endif d453 3 a455 1 hv_store (backends, "xlib", 4, newSViv (1), 0); d457 10 a466 2 #ifdef CAIRO_HAS_XCB_SURFACE hv_store (backends, "xcb", 3, newSViv (1), 0); d468 10 a477 2 #ifdef CAIRO_HAS_GLITZ_SURFACE hv_store (backends, "glitz", 5, newSViv (1), 0); d479 2 a480 1 @ 1.3 log @ * TODO: initial import * Cairo.pm, Cairo.xs: added %backends facility * Cario.xs, CairoSurface.xs: stuff moved out of Cairo.xs that belonged here * Cairo.xs: fixed some OUTLIST stuff (IN_OUTLIST.) cairo_current_matrix fixed. * CairoPattern.xs: added class param to create_for_surface * Makefile.PL: seperated structs out of objects. add refs to object typemaps OUTPUT sections. don't return full strings for OUTPUT enum types. * cairo-perl.h: don't need stdio.h * t/Cairo.t: test most all of cairo type. 90% done. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.2 2004/11/09 02:59:43 rwmcfa1 Exp $ a28 2 ALIAS: Cairo::new = 1 a30 2 CLEANUP: CAIRO_PERL_UNUSED (ix); @ 1.2 log @ * Cairo.xs, CairoMatrix.xs, CairoPattern.xs, CairoSurface.xs: all of the create functions have been cleaned up/fixed. debug prints removed. create's alised to new's where appropriate. * MANIFEST, MANIFEST.SKIP: ChangeLog added. build and CVS skipped * Makefile.PL, cairo-perl.h, Cairo.xs: new (write_)boot code added, in progress. use build dir for most of autogen'd stuff. fixed bug in enums creation (= -> ==) @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/Cairo.xs,v 1.1 2004/11/05 01:34:04 rwmcfa1 Exp $ d153 1 a153 1 void cairo_transform_point (cairo_t * cr, OUTLIST double x, OUTLIST double y); d157 1 a157 1 void cairo_transform_distance (cairo_t * cr, OUTLIST double dx, OUTLIST double dy); d161 1 a161 1 void cairo_inverse_transform_point (cairo_t * cr, OUTLIST double x, OUTLIST double y); d165 1 a165 1 void cairo_inverse_transform_distance (cairo_t * cr, OUTLIST double dx, OUTLIST double dy); d282 7 a288 1 void cairo_current_matrix (cairo_t * cr, cairo_matrix_t * matrix); d309 3 a311 28 ## XXX: this one is kinda odd, image data is the first param cairo_surface_t * cairo_surface_create_for_image (class, char * data, cairo_format_t format, int width, int height, int stride); C_ARGS: data, format, width, height, stride cairo_surface_t * cairo_surface_create_similar (cairo_surface_t * other, cairo_format_t format, int width, int height); void cairo_surface_reference (cairo_surface_t * surface); void cairo_surface_destroy (cairo_surface_t * surface); cairo_status_t cairo_surface_set_repeat (cairo_surface_t * surface, int repeat); cairo_status_t cairo_surface_set_matrix (cairo_surface_t * surface, cairo_matrix_t * matrix); cairo_status_t cairo_surface_get_matrix (cairo_surface_t * surface, cairo_matrix_t * matrix); cairo_status_t cairo_surface_set_filter (cairo_surface_t * surface, cairo_filter_t filter); cairo_filter_t cairo_surface_get_filter (cairo_surface_t * surface); cairo_surface_t * cairo_image_surface_create (class, cairo_format_t format, int width, int height); C_ARGS: format, width, height cairo_surface_t * cairo_image_surface_create_for_data (class, char * data, cairo_format_t format, int width, int height, int stride); C_ARGS: data, format, width, height, stride d313 2 d316 2 a317 7 cairo_surface_t * cairo_ps_surface_create (class, FILE * file, double width_inches, double height_inches, double x_pixels_per_inch, double y_pixels_per_inch); C_ARGS: file, width_inches, height_inches, x_pixels_per_inch, y_pixels_per_inch #endif /* CAIRO_HAS_PS_SURFACE */ d319 2 a320 7 cairo_surface_t * cairo_png_surface_create (class, FILE * file, cairo_format_t format, int width, int height); C_ARGS: file, format, width, height #endif /* CAIRO_HAS_PNG_SURFACE */ d322 5 a326 8 ## XXX: Display, Drawable ... cairo_surface_t * cairo_xlib_surface_create (class, Display * dpy, Drawable drawable, Visual * visual, cairo_format_t format, Colormap colormap); C_ARGS: dpy, drawable, visual, format, colormap #endif /* CAIRO_HAS_XLIB_SURFACE */ d328 3 a330 7 ## XXX: glitz_surface_t cairo_surface_t * cairo_glitz_surface_create (class, glitz_surface_t * surface); C_ARGS: surface #endif /* CAIRO_HAS_GLITZ_SURFACE */ @ 1.1 log @initial import @ text @d6 1 a6 1 * $Header:$ d12 9 d24 3 a26 2 # boot the second XS file boot_Cairo__Surface (aTHX_ cv); d29 6 a34 5 CODE: RETVAL = cairo_create (); DBG ("creating cr: %p\n", RETVAL); OUTPUT: RETVAL a42 1 DBG ("destroying cr: %p\n", cr); a53 1 DBG ("creating copy of %p: %p\n", src, RETVAL); a56 1 d126 1 a126 1 void cairo_set_dash (cairo_t * cr, double offset, double dash1, ...) d303 4 a306 1 cairo_surface_t * cairo_surface_create_for_image (char * data, cairo_format_t format, int width, int height, int stride); d324 7 a330 3 cairo_surface_t * cairo_image_surface_create (cairo_format_t format, int width, int height); cairo_surface_t * cairo_image_surface_create_for_data (char * data, cairo_format_t format, int width, int height, int stride); d334 3 a336 1 cairo_surface_t * cairo_ps_surface_create (FILE * file, double width_inches, double height_inches, double x_pixels_per_inch, double y_pixels_per_inch); d342 3 a344 1 cairo_surface_t * cairo_png_surface_create (FILE * file, cairo_format_t format, int width, int height); d351 3 a353 1 cairo_surface_t * cairo_xlib_surface_create (Display * dpy, Drawable drawable, Visual * visual, cairo_format_t format, Colormap colormap); d360 3 a362 1 cairo_surface_t * cairo_glitz_surface_create (glitz_surface_t * surface); @