head 1.9; access; symbols rel-1-060:1.8 rel-1-053:1.8 rel-1-052:1.8 rel-1-045:1.7.6.1 rel-1-051:1.8 rel-1-044:1.7 stable-1-04:1.7.0.6 stable-1-02:1.7.0.4 rel-1-050:1.7 rel-1-043:1.7 rel-1-042:1.7 rel-1-041:1.7 rel-1-040:1.7 rel-1-023:1.7 rel-1-031:1.7 rel-1-022:1.7 rel-1-030:1.7 rel-1-021:1.7 stable-1-0:1.7.0.2 rel-1-02:1.7 rel-1-01:1.7 rel-1-00:1.7 rel-0-92:1.7 rel-0-91:1.7 rel-0-90:1.7 rel-0-04:1.7 rel-0-03:1.5 rel-0-02:1.5 rel-0-01:1.5; locks; strict; comment @# @; 1.9 date 2008.10.05.19.59.40; author tsch; state Exp; branches; next 1.8; commitid jap73dqgVgT1Atlt; 1.8 date 2007.12.29.13.56.30; author tsch; state Exp; branches; next 1.7; commitid FWkjNvA6INSsBkLs; 1.7 date 2006.05.14.13.43.10; author tsch; state Exp; branches 1.7.6.1; next 1.6; 1.6 date 2006.05.07.14.17.39; author tsch; state Exp; branches; next 1.5; 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.7.6.1 date 2007.12.29.14.03.53; author tsch; state Exp; branches; next ; commitid 2Vxybvpfv0d0EkLs; desc @@ 1.9 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/CairoMatrix.xs,v 1.8 2007-12-29 13:56:30 tsch Exp $ */ #include cairo_matrix_t * cairo_perl_copy_matrix (cairo_matrix_t *src) { cairo_matrix_t *dst; New (0, dst, 1, cairo_matrix_t); dst->xx = src->xx; dst->xy = src->xy; dst->x0 = src->x0; dst->yx = src->yx; dst->yy = src->yy; dst->y0 = src->y0; return dst; } MODULE = Cairo::Matrix PACKAGE = Cairo::Matrix PREFIX = cairo_matrix_ ##void cairo_matrix_init (cairo_matrix_t *matrix, double xx, double yx, double xy, double yy, double x0, double y0); cairo_matrix_t * cairo_matrix_init (class, double xx, double yx, double xy, double yy, double x0, double y0) PREINIT: cairo_matrix_t matrix; CODE: cairo_matrix_init (&matrix, xx, yx, xy, yy, x0, y0); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL ##void cairo_matrix_init_identity (cairo_matrix_t *matrix); cairo_matrix_t * cairo_matrix_init_identity (class) PREINIT: cairo_matrix_t matrix; CODE: cairo_matrix_init_identity (&matrix); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL ##void cairo_matrix_init_translate (cairo_matrix_t *matrix, double tx, double ty); cairo_matrix_t * cairo_matrix_init_translate (class, double tx, double ty) PREINIT: cairo_matrix_t matrix; CODE: cairo_matrix_init_translate (&matrix, tx, ty); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL ##void cairo_matrix_init_scale (cairo_matrix_t *matrix, double sx, double sy); cairo_matrix_t * cairo_matrix_init_scale (class, double sx, double sy) PREINIT: cairo_matrix_t matrix; CODE: cairo_matrix_init_scale (&matrix, sx, sy); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL ##void cairo_matrix_init_rotate (cairo_matrix_t *matrix, double radians); cairo_matrix_t * cairo_matrix_init_rotate (class, double radians) PREINIT: cairo_matrix_t matrix; CODE: cairo_matrix_init_rotate (&matrix, radians); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL void cairo_matrix_translate (cairo_matrix_t * matrix, double tx, double ty); void cairo_matrix_scale (cairo_matrix_t * matrix, double sx, double sy); void cairo_matrix_rotate (cairo_matrix_t * matrix, double radians); cairo_status_t cairo_matrix_invert (cairo_matrix_t * matrix); ##void cairo_matrix_multiply (cairo_matrix_t * result, const cairo_matrix_t * a, const cairo_matrix_t * b); cairo_matrix_t * cairo_matrix_multiply (cairo_matrix_t * a, cairo_matrix_t * b) PREINIT: cairo_matrix_t matrix; CODE: cairo_matrix_multiply (&matrix, a, b); RETVAL = cairo_perl_copy_matrix (&matrix); OUTPUT: RETVAL ##void cairo_matrix_transform_distance (cairo_matrix_t * matrix, double * dx, double * dy); void cairo_matrix_transform_distance (cairo_matrix_t * matrix, IN_OUTLIST double dx, IN_OUTLIST double dy); ##void cairo_matrix_transform_point (cairo_matrix_t * matrix, double * x, double * y); void cairo_matrix_transform_point (cairo_matrix_t * matrix, IN_OUTLIST double x, IN_OUTLIST double y); void DESTROY (cairo_matrix_t * matrix) CODE: Safefree (matrix); @ 1.8 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/CairoMatrix.xs,v 1.7 2006/05/14 13:43:10 tsch Exp $ @ 1.7 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/CairoMatrix.xs,v 1.6 2006/05/07 14:17:39 tsch Exp $ d14 2 a15 1 cairo_matrix_t *dst = malloc (sizeof (cairo_matrix_t)); d105 1 a105 1 free (matrix); @ 1.7.6.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/CairoMatrix.xs,v 1.7 2006-05-14 13:43:10 tsch Exp $ d14 1 a14 2 cairo_matrix_t *dst; New (0, dst, 1, cairo_matrix_t); d104 1 a104 1 Safefree (matrix); @ 1.6 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/CairoMatrix.xs,v 1.5 2005/07/12 20:29:47 tsch Exp $ d12 1 a12 1 pcairo_copy_matrix (cairo_matrix_t *src) d34 1 a34 1 RETVAL = pcairo_copy_matrix (&matrix); d44 1 a44 1 RETVAL = pcairo_copy_matrix (&matrix); d54 1 a54 1 RETVAL = pcairo_copy_matrix (&matrix); d64 1 a64 1 RETVAL = pcairo_copy_matrix (&matrix); d74 1 a74 1 RETVAL = pcairo_copy_matrix (&matrix); d92 1 a92 1 RETVAL = pcairo_copy_matrix (&matrix); @ 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/CairoMatrix.xs,v 1.4 2004/11/12 03:26:34 rwmcfa1 Exp $ d11 15 d30 2 d33 2 a34 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_matrix_init (RETVAL, xx, yx, xy, yy, x0, y0); d40 2 d43 2 a44 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_matrix_init_identity (RETVAL); d50 2 d53 2 a54 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_matrix_init_translate (RETVAL, tx, ty); d60 2 d63 2 a64 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_matrix_init_scale (RETVAL, sx, sy); d70 2 d73 2 a74 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_matrix_init_rotate (RETVAL, radians); d87 3 a89 1 cairo_matrix_t * cairo_matrix_multiply (cairo_matrix_t * a, cairo_matrix_t * b); d91 2 a92 2 RETVAL = malloc (sizeof (cairo_matrix_t)); cairo_matrix_multiply (RETVAL, a, b); @ 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/CairoMatrix.xs,v 1.3 2004/11/11 02:20:32 rwmcfa1 Exp $ d13 7 a19 3 cairo_matrix_t * cairo_matrix_create (class); C_ARGS: /* void */ d21 2 a22 3 ## destroy should happen auto-magically ##void cairo_matrix_destroy (cairo_matrix_t * matrix); void cairo_matrix_DESTROY (cairo_matrix_t * matrix); d24 4 a27 1 cairo_matrix_destroy (matrix); d29 2 a30 3 ## XXX: status return type? ## XXX: cairo_status_t cairo_matrix_copy (cairo_matrix_t * matrix, const cairo_matrix_t * other); cairo_matrix_t * cairo_matrix_copy (cairo_matrix_t * matrix); d32 2 a33 2 RETVAL = cairo_matrix_create (); cairo_matrix_copy (matrix, RETVAL); d37 7 a43 1 cairo_status_t cairo_matrix_set_identity (cairo_matrix_t * matrix); d45 7 a51 1 cairo_status_t cairo_matrix_set_affine (cairo_matrix_t * cr, double a, double b, double c, double d, double tx, double ty); d53 1 a53 3 ## XXX: status return type? ##cairo_status_t cairo_matrix_get_affine (cairo_matrix_t * matrix, double * a, double * b, double * c, double * d, double * tx, double * ty); void cairo_matrix_get_affine (cairo_matrix_t * matrix, OUTLIST double a, OUTLIST double b, OUTLIST double c, OUTLIST double d, OUTLIST double tx, OUTLIST double ty); d55 1 a55 1 cairo_status_t cairo_matrix_translate (cairo_matrix_t * matrix, double tx, double ty); d57 1 a57 3 cairo_status_t cairo_matrix_scale (cairo_matrix_t * matrix, double sx, double sy); cairo_status_t cairo_matrix_rotate (cairo_matrix_t * matrix, double radians); d61 1 a61 2 ## XXX: status return type? ##cairo_status_t cairo_matrix_multiply (cairo_matrix_t * result, cairo_matrix_t * a, const cairo_matrix_t * b); d64 1 a64 1 RETVAL = cairo_matrix_create (); d69 1 a69 2 ## XXX: status return type? ##cairo_status_t cairo_matrix_transform_distance (cairo_matrix_t * matrix, double * dx, double * dy); d72 1 a72 2 ## XXX: status return type? ##cairo_status_t cairo_matrix_transform_point (cairo_matrix_t * matrix, double * x, double * y); d74 4 @ 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/CairoMatrix.xs,v 1.2 2004/11/09 02:59:43 rwmcfa1 Exp $ a13 2 ALIAS: Cairo::Matrix::new = 1 a15 2 CLEANUP: CAIRO_PERL_UNUSED (ix); d23 1 d25 6 a30 1 cairo_status_t cairo_matrix_copy (cairo_matrix_t * matrix, cairo_matrix_t * other); d48 1 a48 1 ## XXX: d50 6 d59 1 a59 1 void cairo_matrix_transform_distance (cairo_matrix_t * matrix, OUTLIST double dx, OUTLIST double dy); d63 1 a63 1 void cairo_matrix_transform_point (cairo_matrix_t * matrix, OUTLIST double x, OUTLIST double y); @ 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/CairoMatrix.xs,v 1.1 2004/11/05 01:34:04 rwmcfa1 Exp $ d34 1 a34 1 ## XXX: double * d36 1 a36 1 cairo_status_t cairo_matrix_get_affine (cairo_matrix_t * matrix, OUTLIST double a, OUTLIST double b, OUTLIST double c, OUTLIST double d, OUTLIST double tx, OUTLIST double ty); d49 1 a49 1 ## XXX: double * d51 1 a51 1 cairo_status_t cairo_matrix_transform_distance (cairo_matrix_t * matrix, OUTLIST double dx, OUTLIST double dy); d53 1 a53 1 ## XXX: double * d55 1 a55 1 cairo_status_t cairo_matrix_transform_point (cairo_matrix_t * matrix, OUTLIST double x, OUTLIST double y); @ 1.1 log @initial import @ text @d6 1 a6 1 * $Header:$ d14 6 a19 5 CODE: RETVAL = cairo_matrix_create (); DBG ("creating matrix: %p\n", RETVAL); OUTPUT: RETVAL d21 1 a24 1 DBG ("destroying matrix: %p\n", matrix); @