head 1.10; access; symbols rel-1-060:1.9 rel-1-053:1.9 rel-1-052:1.9 rel-1-045:1.8.6.1 rel-1-051:1.9 rel-1-044:1.8 stable-1-04:1.8.0.6 stable-1-02:1.8.0.4 rel-1-050:1.8 rel-1-043:1.8 rel-1-042:1.8 rel-1-041:1.8 rel-1-040:1.8 rel-1-023:1.8 rel-1-031:1.8 rel-1-022:1.8 rel-1-030:1.8 rel-1-021:1.8 stable-1-0:1.8.0.2 rel-1-02:1.8 rel-1-01:1.8 rel-1-00:1.8 rel-0-92:1.8 rel-0-91:1.8 rel-0-90:1.7 rel-0-04:1.6 rel-0-03:1.4 rel-0-02:1.4 rel-0-01:1.4; locks; strict; comment @# @; 1.10 date 2008.10.05.19.59.40; author tsch; state Exp; branches; next 1.9; commitid jap73dqgVgT1Atlt; 1.9 date 2007.12.29.13.56.29; author tsch; state Exp; branches; next 1.8; commitid FWkjNvA6INSsBkLs; 1.8 date 2006.08.10.17.34.40; author tsch; state Exp; branches 1.8.6.1; next 1.7; 1.7 date 2006.07.02.13.11.26; author tsch; state Exp; branches; next 1.6; 1.6 date 2006.05.14.13.43.10; author tsch; state Exp; branches; next 1.5; 1.5 date 2006.05.07.14.17.39; author tsch; state Exp; branches; next 1.4; 1.4 date 2005.07.29.17.19.55; author tsch; state Exp; branches; next 1.3; commitid 3b1e42ea65374567; 1.3 date 2005.07.12.20.29.47; author tsch; state Exp; branches; next 1.2; commitid 758542d428324567; 1.2 date 2004.11.12.03.26.34; author rwmcfa1; state Exp; branches; next 1.1; 1.1 date 2004.11.05.01.34.04; author rwmcfa1; state Exp; branches; next ; 1.8.6.1 date 2007.12.29.14.03.53; author tsch; state Exp; branches; next ; commitid 2Vxybvpfv0d0EkLs; desc @@ 1.10 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/CairoFont.xs,v 1.9 2007-12-29 13:56:29 tsch Exp $ */ #include #include MODULE = Cairo::Font PACKAGE = Cairo::FontFace PREFIX = cairo_font_face_ cairo_status_t cairo_font_face_status (cairo_font_face_t * font); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_font_type_t cairo_font_face_get_type (cairo_font_face_t *font_face); #endif void DESTROY (cairo_font_face_t * font) CODE: cairo_font_face_destroy (font); # --------------------------------------------------------------------------- # MODULE = Cairo::Font PACKAGE = Cairo::ScaledFont PREFIX = cairo_scaled_font_ ##cairo_scaled_font_t* cairo_scaled_font_create (cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm, const cairo_font_options_t *options); cairo_scaled_font_t_noinc * cairo_scaled_font_create (class, cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm, const cairo_font_options_t *options) C_ARGS: font_face, font_matrix, ctm, options cairo_status_t cairo_scaled_font_status (cairo_scaled_font_t *scaled_font); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_font_type_t cairo_scaled_font_get_type (cairo_scaled_font_t *scaled_font); #endif ##cairo_status_t cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *extents); cairo_font_extents_t * cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font) PREINIT: cairo_font_extents_t extents; CODE: cairo_scaled_font_extents (scaled_font, &extents); RETVAL = &extents; OUTPUT: RETVAL #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) ##void cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_text_extents_t *extents); cairo_text_extents_t * cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, const char *utf8) PREINIT: cairo_text_extents_t extents; CODE: cairo_scaled_font_text_extents (scaled_font, utf8, &extents); RETVAL = &extents; OUTPUT: RETVAL #endif ##void cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents); cairo_text_extents_t * cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, ...) PREINIT: cairo_glyph_t * glyphs = NULL; int num_glyphs, i; cairo_text_extents_t extents; 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_scaled_font_glyph_extents (scaled_font, glyphs, num_glyphs, &extents); RETVAL = &extents; Safefree (glyphs); OUTPUT: RETVAL #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_font_face_t * cairo_scaled_font_get_font_face (cairo_scaled_font_t *scaled_font); ##void cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font, cairo_matrix_t *font_matrix); cairo_matrix_t * cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font) PREINIT: cairo_matrix_t font_matrix; CODE: cairo_scaled_font_get_font_matrix (scaled_font, &font_matrix); RETVAL = cairo_perl_copy_matrix (&font_matrix); OUTPUT: RETVAL ##void cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font, cairo_matrix_t *ctm); cairo_matrix_t * cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font) PREINIT: cairo_matrix_t ctm; CODE: cairo_scaled_font_get_ctm (scaled_font, &ctm); RETVAL = cairo_perl_copy_matrix (&ctm); OUTPUT: RETVAL ##void cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font, cairo_font_options_t *options); cairo_font_options_t * cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font) CODE: RETVAL = cairo_font_options_create (); cairo_scaled_font_get_font_options (scaled_font, RETVAL); OUTPUT: RETVAL #endif void DESTROY (cairo_scaled_font_t * font) CODE: cairo_scaled_font_destroy (font); # --------------------------------------------------------------------------- # MODULE = Cairo::Font PACKAGE = Cairo::FontOptions PREFIX = cairo_font_options_ ##cairo_font_options_t * cairo_font_options_create (void); cairo_font_options_t * cairo_font_options_create (class) C_ARGS: /* void */ # FIXME: Necessary? ##cairo_font_options_t * cairo_font_options_copy (const cairo_font_options_t *original); cairo_status_t cairo_font_options_status (cairo_font_options_t *options); void cairo_font_options_merge (cairo_font_options_t *options, const cairo_font_options_t *other); cairo_bool_t cairo_font_options_equal (const cairo_font_options_t *options, const cairo_font_options_t *other); unsigned long cairo_font_options_hash (const cairo_font_options_t *options); void cairo_font_options_set_antialias (cairo_font_options_t *options, cairo_antialias_t antialias); cairo_antialias_t cairo_font_options_get_antialias (const cairo_font_options_t *options); void cairo_font_options_set_subpixel_order (cairo_font_options_t *options, cairo_subpixel_order_t subpixel_order); cairo_subpixel_order_t cairo_font_options_get_subpixel_order (const cairo_font_options_t *options); void cairo_font_options_set_hint_style (cairo_font_options_t *options, cairo_hint_style_t hint_style); cairo_hint_style_t cairo_font_options_get_hint_style (const cairo_font_options_t *options); void cairo_font_options_set_hint_metrics (cairo_font_options_t *options, cairo_hint_metrics_t hint_metrics); cairo_hint_metrics_t cairo_font_options_get_hint_metrics (const cairo_font_options_t *options); void DESTROY (cairo_font_options_t *options) CODE: cairo_font_options_destroy (options); @ 1.9 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/CairoFont.xs,v 1.8 2006/08/10 17:34:40 tsch Exp $ @ 1.8 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/CairoFont.xs,v 1.7 2006/07/02 13:11:26 tsch Exp $ d75 1 a75 1 glyphs = calloc (sizeof (cairo_glyph_t), num_glyphs); d80 1 a80 1 free (glyphs); @ 1.8.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/CairoFont.xs,v 1.8 2006-08-10 17:34:40 tsch Exp $ d75 1 a75 1 Newz (0, glyphs, num_glyphs, cairo_glyph_t); d80 1 a80 1 Safefree (glyphs); @ 1.7 log @Cosmetical changes. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoFont.xs,v 1.6 2006/05/14 13:43:10 tsch Exp $ d16 2 d20 2 d37 2 d41 2 d53 2 d65 2 d84 2 d116 2 @ 1.6 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/CairoFont.xs,v 1.5 2006/05/07 14:17:39 tsch Exp $ d22 2 d106 2 @ 1.5 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/CairoFont.xs,v 1.4 2005/07/29 17:19:55 tsch Exp $ d78 1 a78 1 RETVAL = pcairo_copy_matrix (&font_matrix); d88 1 a88 1 RETVAL = pcairo_copy_matrix (&ctm); @ 1.4 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/CairoFont.xs,v 1.3 2005/07/12 20:29:47 tsch Exp $ d10 1 d16 2 d31 2 d43 10 d70 30 @ 1.3 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/CairoFont.xs,v 1.2 2004/11/12 03:26:34 rwmcfa1 Exp $ d11 3 a13 1 MODULE = Cairo::Font PACKAGE = Cairo::FontFace d21 2 a22 2 ##cairo_scaled_font_t* cairo_scaled_font_create (cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm); cairo_scaled_font_t_noinc * cairo_scaled_font_create (class, cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm) d24 3 a26 1 font_face, font_matrix, ctm d33 2 a34 5 if (CAIRO_STATUS_SUCCESS != cairo_scaled_font_extents (scaled_font, &extents)) RETVAL = NULL; else RETVAL = &extents; d58 38 @ 1.2 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/CairoFont.xs,v 1.1 2004/11/05 01:34:04 rwmcfa1 Exp $ d11 1 a11 1 MODULE = Cairo::Font PACKAGE = Cairo::Font PREFIX = cairo_font_ d13 44 a56 9 ## XXX: what about all of these ## void cairo_font_reference (cairo_font_t * font); ## void cairo_font_destroy (cairo_font_t * font); ## void cairo_font_set_transform (cairo_font_t * font, cairo_matrix_t * matrix); ## void cairo_font_current_transform (cairo_font_t * font, cairo_matrix_t * matrix); @ 1.1 log @initial import @ text @d6 1 a6 1 * $Header:$ d15 1 a15 1 void cairo_font_reference (cairo_font_t * font); d17 1 a17 1 void cairo_font_destroy (cairo_font_t * font); d19 1 a19 3 void cairo_font_set_transform (cairo_font_t * font, cairo_matrix_t * matrix); void cairo_font_current_transform (cairo_font_t * font, cairo_matrix_t * matrix); d21 1 @