head 1.26; access; symbols rel-1-060:1.25 rel-1-053:1.25 rel-1-052:1.25 rel-1-045:1.20.2.1 rel-1-051:1.24 rel-1-044:1.20 stable-1-04:1.20.0.2 stable-1-02:1.17.2.1.0.2 rel-1-050:1.20 rel-1-043:1.20 rel-1-042:1.19 rel-1-041:1.19 rel-1-040:1.19 rel-1-023:1.17.2.1 rel-1-031:1.18 rel-1-022:1.17.2.1 rel-1-030:1.18 rel-1-021:1.17 stable-1-0:1.17.0.2 rel-1-02:1.17 rel-1-01:1.17 rel-1-00:1.16 rel-0-92:1.16 rel-0-91:1.14 rel-0-90:1.13 rel-0-04:1.12 rel-0-03:1.8 rel-0-02:1.8 rel-0-01:1.8; 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.10.18.36.33; author tsch; state Exp; branches; next 1.24; commitid DnXwZmbIx6KQLSQs; 1.24 date 2008.01.07.17.41.01; author tsch; state Exp; branches; next 1.23; commitid eqd37OHbRZLyyvMs; 1.23 date 2008.01.07.17.34.09; author tsch; state Exp; branches; next 1.22; commitid DgkkF7411CNcwvMs; 1.22 date 2008.01.07.17.13.33; author tsch; state Exp; branches; next 1.21; commitid e5wpYT9pIpG6pvMs; 1.21 date 2007.12.29.13.56.30; author tsch; state Exp; branches; next 1.20; commitid FWkjNvA6INSsBkLs; 1.20 date 2007.09.30.12.54.32; author tsch; state Exp; branches 1.20.2.1; next 1.19; commitid PfPFbmmBLvIy9Lzs; 1.19 date 2007.03.17.16.13.32; author tsch; state Exp; branches; next 1.18; 1.18 date 2006.11.23.19.09.12; author tsch; state Exp; branches; next 1.17; 1.17 date 2006.09.24.12.20.43; author tsch; state Exp; branches 1.17.2.1; next 1.16; 1.16 date 2006.08.13.18.53.26; author tsch; state Exp; branches; next 1.15; 1.15 date 2006.08.10.23.13.57; 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.06.14.18.20.23; 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 2005.08.10.17.01.53; author tsch; state Exp; branches; next 1.7; commitid 55d042fa32fe4567; 1.7 date 2005.07.29.17.19.55; author tsch; state Exp; branches; next 1.6; commitid 3b1e42ea65374567; 1.6 date 2005.07.12.20.29.47; author tsch; state Exp; branches; next 1.5; commitid 758542d428324567; 1.5 date 2005.02.06.16.21.26; author rwmcfa1; state Exp; branches; next 1.4; 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.20.2.1 date 2007.12.29.14.03.53; author tsch; state Exp; branches; next ; commitid 2Vxybvpfv0d0EkLs; 1.17.2.1 date 2006.11.23.19.13.01; author tsch; state Exp; branches; next ; desc @@ 1.26 log @In preparation of the move to SVN, use the Id keyword in place of Header. @ text @/* * Copyright (c) 2004-2006 by the cairo perl team (see the file README) * * Licensed under the LGPL, see LICENSE file for more information. * * $Id: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.25 2008-02-10 18:36:33 tsch Exp $ */ #include #include #define NEED_sv_2pv_flags #include "ppport.h" #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) static HV *pointer_to_package = NULL; /* A hex character represents four bits in the address of a pointer, so we'll * need BITS_PER_LONG/4 characters. That's sizeof (long) * 2. Add 2 for the * "0x" part. Add 1 for the trailing \0. Reasoning courtesy of Robert Love. */ #define MAX_KEY_LENGTH ((sizeof(long) * 2) + 2 + 1) /* This stuff is also used in CairoPattern.xs, hence no static on the * functions. */ void cairo_perl_package_table_insert (void *pointer, const char *package) { char key[MAX_KEY_LENGTH]; if (!pointer_to_package) { pointer_to_package = newHV (); } sprintf (key, "%p", pointer); hv_store (pointer_to_package, key, strlen (key), newSVpv (package, PL_na), 0); } const char * cairo_perl_package_table_lookup (void *pointer) { char key[MAX_KEY_LENGTH]; SV **sv; if (!pointer_to_package) { return NULL; } sprintf (key, "%p", pointer); sv = hv_fetch (pointer_to_package, key, strlen (key), 0); if (sv && SvOK (*sv)) { return SvPV_nolen (*sv); } return NULL; } #endif /* !1.2.0 */ static const char * get_package (cairo_surface_t *surface) { #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_surface_type_t type; const char *package; type = cairo_surface_get_type (surface); switch (type) { case CAIRO_SURFACE_TYPE_IMAGE: package = "Cairo::ImageSurface"; break; case CAIRO_SURFACE_TYPE_PDF: package = "Cairo::PdfSurface"; break; case CAIRO_SURFACE_TYPE_PS: package = "Cairo::PsSurface"; break; case CAIRO_SURFACE_TYPE_SVG: package = "Cairo::SvgSurface"; break; case CAIRO_SURFACE_TYPE_XLIB: case CAIRO_SURFACE_TYPE_XCB: case CAIRO_SURFACE_TYPE_GLITZ: case CAIRO_SURFACE_TYPE_QUARTZ: case CAIRO_SURFACE_TYPE_WIN32: case CAIRO_SURFACE_TYPE_BEOS: case CAIRO_SURFACE_TYPE_DIRECTFB: package = "Cairo::Surface"; break; default: warn ("unknown surface type %d encountered", type); package = "Cairo::Surface"; break; } return package; #else const char *package = cairo_perl_package_table_lookup (surface); return package ? package : "Cairo::Surface"; #endif } SV * cairo_surface_to_sv (cairo_surface_t *surface) { SV *sv = newSV (0); sv_setref_pv(sv, get_package (surface), surface); return sv; } /* -------------------------------------------------------------------------- */ typedef struct { SV *func; SV *data; void *context; } CairoPerlCallback; #ifdef PERL_IMPLICIT_CONTEXT # define dCAIRO_PERL_CALLBACK_MARSHAL_SP \ SV ** sp; # define CAIRO_PERL_CALLBACK_MARSHAL_INIT(callback) \ PERL_SET_CONTEXT (callback->context); \ SPAGAIN; #else # define dCAIRO_PERL_CALLBACK_MARSHAL_SP \ dSP; # define CAIRO_PERL_CALLBACK_MARSHAL_INIT(callback) \ /* nothing to do */ #endif static CairoPerlCallback * cairo_perl_callback_new (SV *func, SV *data) { CairoPerlCallback *callback; Newz (0, callback, 1, CairoPerlCallback); callback->func = newSVsv (func); if (data) callback->data = newSVsv (data); #ifdef PERL_IMPLICIT_CONTEXT callback->context = aTHX; #endif return callback; } static void cairo_perl_callback_free (CairoPerlCallback *callback) { SvREFCNT_dec (callback->func); if (callback->data) SvREFCNT_dec (callback->data); Safefree (callback); } /* -------------------------------------------------------------------------- */ static cairo_status_t write_func_marshaller (void *closure, const unsigned char *data, unsigned int length) { CairoPerlCallback *callback; cairo_status_t status = CAIRO_STATUS_SUCCESS; dCAIRO_PERL_CALLBACK_MARSHAL_SP; callback = (CairoPerlCallback *) closure; CAIRO_PERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (callback->data ? callback->data : &PL_sv_undef); PUSHs (sv_2mortal (newSVpv ((const char *) data, length))); PUTBACK; call_sv (callback->func, G_DISCARD | G_EVAL); SPAGAIN; if (SvTRUE (ERRSV)) { status = SvCairoStatus (ERRSV); } PUTBACK; FREETMPS; LEAVE; return status; } /* -------------------------------------------------------------------------- */ static cairo_status_t read_func_marshaller (void *closure, unsigned char *data, unsigned int length) { CairoPerlCallback *callback; cairo_status_t status = CAIRO_STATUS_SUCCESS; dCAIRO_PERL_CALLBACK_MARSHAL_SP; callback = (CairoPerlCallback *) closure; CAIRO_PERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (callback->data ? callback->data : &PL_sv_undef); PUSHs (sv_2mortal (newSVuv (length))); PUTBACK; call_sv (callback->func, G_SCALAR | G_EVAL); SPAGAIN; if (SvTRUE (ERRSV)) { status = SvCairoStatus (ERRSV); } else { SV *retval = POPs; memcpy (data, SvPV_nolen (retval), sv_len (retval)); } PUTBACK; FREETMPS; LEAVE; return status; } /* -------------------------------------------------------------------------- */ MODULE = Cairo::Surface PACKAGE = Cairo::Surface PREFIX = cairo_surface_ void DESTROY (cairo_surface_t * surface); CODE: cairo_surface_destroy (surface); cairo_surface_t_noinc * cairo_surface_create_similar (cairo_surface_t * other, cairo_content_t content, int width, int height); POSTCALL: #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) { const char *package = cairo_perl_package_table_lookup (other); cairo_perl_package_table_insert (RETVAL, package ? package : "Cairo::Surface"); } #endif void cairo_surface_finish (cairo_surface_t *surface); cairo_status_t cairo_surface_status (cairo_surface_t *surface); void cairo_surface_set_device_offset (cairo_surface_t *surface, double x_offset, double y_offset); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) void cairo_surface_get_device_offset (cairo_surface_t *surface, OUTLIST double x_offset, OUTLIST double y_offset); void cairo_surface_set_fallback_resolution (cairo_surface_t *surface, double x_pixels_per_inch, double y_pixels_per_inch); #endif ##void cairo_surface_get_font_options (cairo_surface_t *surface, cairo_font_options_t *options); cairo_font_options_t * cairo_surface_get_font_options (cairo_surface_t *surface) CODE: RETVAL = cairo_font_options_create (); cairo_surface_get_font_options (surface, RETVAL); OUTPUT: RETVAL void cairo_surface_flush (cairo_surface_t *surface); void cairo_surface_mark_dirty (cairo_surface_t *surface); void cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface, int x, int y, int width, int height); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_surface_type_t cairo_surface_get_type (cairo_surface_t *surface); cairo_content_t cairo_surface_get_content (cairo_surface_t *surface); #endif #ifdef CAIRO_HAS_PNG_FUNCTIONS cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename); ##cairo_status_t cairo_surface_write_to_png_stream (cairo_surface_t *surface, cairo_write_func_t write_func, void *closure); cairo_status_t cairo_surface_write_to_png_stream (cairo_surface_t *surface, SV *func, SV *data=NULL) PREINIT: CairoPerlCallback *callback; CODE: callback = cairo_perl_callback_new (func, data); RETVAL = cairo_surface_write_to_png_stream (surface, write_func_marshaller, callback); cairo_perl_callback_free (callback); OUTPUT: RETVAL #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE (1, 5, 8) /* FIXME: 1.6 */ void cairo_surface_copy_page (cairo_surface_t *surface); void cairo_surface_show_page (cairo_surface_t *surface); #endif # --------------------------------------------------------------------------- # MODULE = Cairo::Surface PACKAGE = Cairo::ImageSurface PREFIX = cairo_image_surface_ BOOT: cairo_perl_set_isa ("Cairo::ImageSurface", "Cairo::Surface"); ##cairo_surface_t * cairo_image_surface_create (cairo_format_t format, int width, int height); cairo_surface_t_noinc * cairo_image_surface_create (class, cairo_format_t format, int width, int height) C_ARGS: format, width, height POSTCALL: #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::ImageSurface"); #endif ##cairo_surface_t * cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, int width, int height, int stride); cairo_surface_t_noinc * cairo_image_surface_create_for_data (class, unsigned char *data, cairo_format_t format, int width, int height, int stride) C_ARGS: data, format, width, height, stride POSTCALL: #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::ImageSurface"); #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) # unsigned char * cairo_image_surface_get_data (cairo_surface_t *surface); SV * cairo_image_surface_get_data (cairo_surface_t *surface) PREINIT: unsigned char *data; int height, stride; CODE: data = cairo_image_surface_get_data (surface); height = cairo_image_surface_get_height (surface); stride = cairo_image_surface_get_stride (surface); RETVAL = data ? newSVpv ((char *) data, height * stride) : &PL_sv_undef; OUTPUT: RETVAL cairo_format_t cairo_image_surface_get_format (cairo_surface_t *surface); #endif int cairo_image_surface_get_width (cairo_surface_t *surface); int cairo_image_surface_get_height (cairo_surface_t *surface); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) int cairo_image_surface_get_stride (cairo_surface_t *surface); #endif #ifdef CAIRO_HAS_PNG_FUNCTIONS ##cairo_surface_t * cairo_image_surface_create_from_png (const char *filename); cairo_surface_t_noinc * cairo_image_surface_create_from_png (class, const char *filename) C_ARGS: filename POSTCALL: #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::ImageSurface"); #endif ##cairo_surface_t * cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func, void *closure); cairo_surface_t_noinc * cairo_image_surface_create_from_png_stream (class, SV *func, SV *data=NULL) PREINIT: CairoPerlCallback *callback; CODE: callback = cairo_perl_callback_new (func, data); RETVAL = cairo_image_surface_create_from_png_stream ( read_func_marshaller, callback); cairo_perl_callback_free (callback); #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::ImageSurface"); #endif OUTPUT: RETVAL #endif # --------------------------------------------------------------------------- # #ifdef CAIRO_HAS_PDF_SURFACE MODULE = Cairo::Surface PACKAGE = Cairo::PdfSurface PREFIX = cairo_pdf_surface_ BOOT: cairo_perl_set_isa ("Cairo::PdfSurface", "Cairo::Surface"); ##cairo_surface_t * cairo_pdf_surface_create (const char *filename, double width_in_points, double height_in_points); cairo_surface_t_noinc * cairo_pdf_surface_create (class, const char *filename, double width_in_points, double height_in_points) C_ARGS: filename, width_in_points, height_in_points POSTCALL: #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::PdfSurface"); #endif ##cairo_surface_t * cairo_pdf_surface_create_for_stream (cairo_write_func_t write_func, void *closure, double width_in_points, double height_in_points); cairo_surface_t_noinc * cairo_pdf_surface_create_for_stream (class, SV *func, SV *data, double width_in_points, double height_in_points) PREINIT: CairoPerlCallback *callback; CODE: callback = cairo_perl_callback_new (func, data); RETVAL = cairo_pdf_surface_create_for_stream (write_func_marshaller, callback, width_in_points, height_in_points); cairo_surface_set_user_data ( RETVAL, (const cairo_user_data_key_t *) &callback, callback, (cairo_destroy_func_t) cairo_perl_callback_free); #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::PdfSurface"); #endif OUTPUT: RETVAL #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) void cairo_pdf_surface_set_size (cairo_surface_t *surface, double width_in_points, double height_in_points); #endif #endif # --------------------------------------------------------------------------- # #ifdef CAIRO_HAS_PS_SURFACE MODULE = Cairo::Surface PACKAGE = Cairo::PsSurface PREFIX = cairo_ps_surface_ BOOT: cairo_perl_set_isa ("Cairo::PsSurface", "Cairo::Surface"); ##cairo_surface_t * cairo_ps_surface_create (const char *filename, double width_in_points, double height_in_points); cairo_surface_t_noinc * cairo_ps_surface_create (class, const char *filename, double width_in_points, double height_in_points) C_ARGS: filename, width_in_points, height_in_points POSTCALL: #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::PsSurface"); #endif ##cairo_surface_t * cairo_ps_surface_create_for_stream (cairo_write_func_t write_func, void *closure, double width_in_points, double height_in_points); cairo_surface_t_noinc * cairo_ps_surface_create_for_stream (class, SV *func, SV *data, double width_in_points, double height_in_points) PREINIT: CairoPerlCallback *callback; CODE: callback = cairo_perl_callback_new (func, data); RETVAL = cairo_ps_surface_create_for_stream (write_func_marshaller, callback, width_in_points, height_in_points); cairo_surface_set_user_data ( RETVAL, (const cairo_user_data_key_t *) &callback, callback, (cairo_destroy_func_t) cairo_perl_callback_free); #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 2, 0) cairo_perl_package_table_insert (RETVAL, "Cairo::PsSurface"); #endif OUTPUT: RETVAL #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) void cairo_ps_surface_set_size (cairo_surface_t *surface, double width_in_points, double height_in_points); void cairo_ps_surface_dsc_comment (cairo_surface_t *surface, const char *comment); void cairo_ps_surface_dsc_begin_setup (cairo_surface_t *surface); void cairo_ps_surface_dsc_begin_page_setup (cairo_surface_t *surface); #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 2) /* FIXME: 1.6 */ void cairo_ps_surface_restrict_to_level (cairo_surface_t *surface, cairo_ps_level_t level); # void cairo_ps_get_levels (cairo_ps_level_t const **levels, int *num_levels); void cairo_ps_surface_get_levels (class=NULL) PREINIT: cairo_ps_level_t const *levels = NULL; int num_levels = 0, i; PPCODE: PERL_UNUSED_VAR (ax); cairo_ps_get_levels (&levels, &num_levels); EXTEND (sp, num_levels); for (i = 0; i < num_levels; i++) PUSHs (sv_2mortal (newSVCairoPsLevel (levels[i]))); # const char * cairo_ps_level_to_string (cairo_ps_level_t level); const char * cairo_ps_surface_level_to_string (...) CODE: if (items == 1) { RETVAL = cairo_ps_level_to_string (SvCairoPsLevel (ST (0))); } else if (items == 2) { RETVAL = cairo_ps_level_to_string (SvCairoPsLevel (ST (1))); } else { RETVAL = NULL; croak ("Usage: Cairo::PsSurface::level_to_string (level) or Cairo::PsSurface->level_to_string (level)"); } OUTPUT: RETVAL void cairo_ps_surface_set_eps (cairo_surface_t *surface, cairo_bool_t eps); cairo_bool_t cairo_ps_surface_get_eps (cairo_surface_t *surface); #endif #endif # --------------------------------------------------------------------------- # # The SVG surface doesn't need the special package treatment because it didn't # exist in cairo 1.0. #ifdef CAIRO_HAS_SVG_SURFACE MODULE = Cairo::Surface PACKAGE = Cairo::SvgSurface PREFIX = cairo_svg_surface_ BOOT: cairo_perl_set_isa ("Cairo::SvgSurface", "Cairo::Surface"); # cairo_surface_t * cairo_svg_surface_create (const char *filename, double width_in_points, double height_in_points); cairo_surface_t_noinc * cairo_svg_surface_create (class, const char *filename, double width_in_points, double height_in_points) C_ARGS: filename, width_in_points, height_in_points # cairo_surface_t * cairo_svg_surface_create_for_stream (cairo_write_func_t write_func, void *closure, double width_in_points, double height_in_points); cairo_surface_t_noinc * cairo_svg_surface_create_for_stream (class, SV *func, SV *data, double width_in_points, double height_in_points) PREINIT: CairoPerlCallback *callback; CODE: callback = cairo_perl_callback_new (func, data); RETVAL = cairo_svg_surface_create_for_stream (write_func_marshaller, callback, width_in_points, height_in_points); cairo_surface_set_user_data ( RETVAL, (const cairo_user_data_key_t *) &callback, callback, (cairo_destroy_func_t) cairo_perl_callback_free); OUTPUT: RETVAL void cairo_svg_surface_restrict_to_version (cairo_surface_t *surface, cairo_svg_version_t version); # void cairo_svg_get_versions (cairo_svg_version_t const **versions, int *num_versions); void cairo_svg_surface_get_versions (class=NULL) PREINIT: cairo_svg_version_t const *versions = NULL; int num_versions = 0, i; PPCODE: PERL_UNUSED_VAR (ax); cairo_svg_get_versions (&versions, &num_versions); EXTEND (sp, num_versions); for (i = 0; i < num_versions; i++) PUSHs (sv_2mortal (newSVCairoSvgVersion (versions[i]))); # const char * cairo_svg_version_to_string (cairo_svg_version_t version); const char * cairo_svg_surface_version_to_string (...) CODE: if (items == 1) { RETVAL = cairo_svg_version_to_string (SvCairoSvgVersion (ST (0))); } else if (items == 2) { RETVAL = cairo_svg_version_to_string (SvCairoSvgVersion (ST (1))); } else { RETVAL = NULL; croak ("Usage: Cairo::SvgSurface::version_to_string (version) or Cairo::SvgSurface->version_to_string (version)"); } OUTPUT: RETVAL #endif # --------------------------------------------------------------------------- # #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 8) /* FIXME: 1.6 */ MODULE = Cairo::Surface PACKAGE = Cairo::Format PREFIX = cairo_format_ =for apidoc __function__ =cut int cairo_format_stride_for_width (cairo_format_t format, int width); #endif @ 1.25 log @ * CairoSurface.xs * t/CairoSurface.t: Wrap cairo_format_stride_for_width. Adapt to API changes: cairo_surface_copy_page and cairo_surface_show_page don't return cairo_status_t anymore. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.24 2008-01-07 17:41:01 tsch Exp $ @ 1.24 log @ * CairoSurface.xs * t/CairoSurface.t: Wrap cairo_ps_surface_set_eps and cairo_ps_surface_get_eps. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.23 2008-01-07 17:34:09 tsch Exp $ d319 1 a319 1 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE (1, 5, 2) /* FIXME: 1.6 */ d321 1 a321 1 cairo_status_t cairo_surface_copy_page (cairo_surface_t *surface); d323 1 a323 1 cairo_status_t cairo_surface_show_page (cairo_surface_t *surface); d613 12 @ 1.23 log @ * CairoSurface.xs * t/CairoSurface.t: Wrap cairo_ps_surface_restrict_to_level, cairo_ps_get_levels, and cairo_ps_level_to_string. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.22 2008-01-07 17:13:33 tsch Exp $ d539 4 @ 1.22 log @ * CairoSurface.xs * t/CairoSurface.t: Wrap cairo_surface_copy_page and cairo_surface_show_page. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.21 2007-12-29 13:56:30 tsch Exp $ d507 34 @ 1.21 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/CairoSurface.xs,v 1.20 2007-09-30 12:54:32 tsch Exp $ d319 8 @ 1.20 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/CairoSurface.xs,v 1.19 2007-03-17 16:13:32 tsch Exp $ d145 1 a145 1 callback = calloc (sizeof (CairoPerlCallback), 1); d164 1 a164 1 free (callback); @ 1.20.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/CairoSurface.xs,v 1.20 2007-09-30 12:54:32 tsch Exp $ d145 1 a145 1 Newz (0, callback, 1, CairoPerlCallback); d164 1 a164 1 Safefree (callback); @ 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/CairoSurface.xs,v 1.18 2006/11/23 19:09:12 tsch Exp $ d12 3 @ 1.18 log @ * CairoSurface.xs, t/CairoSurface.t: Make Cairo::ImageSurface::get_data usable by specifying the buffer length. * MANIFEST, Makefile.PL, doctypes: Describe our types. * NEWS: Merge from stable-1-0. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.17 2006/09/24 12:20:43 tsch Exp $ d260 2 @ 1.17 log @ * t/CairoSurface.t: Don't check the specific type of similar surfaces created from PS and PDF surfaces; it's not reliable. * xs/CairoSurface.xs: Cosmetical changes. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.16 2006/08/13 18:53:26 tsch Exp $ d346 1 d349 3 a351 1 RETVAL = data ? newSVpv ((char *) data, 0) : &PL_sv_undef; @ 1.17.2.1 log @ * CairoSurface.xs, t/CairoSurface.t: Make Cairo::ImageSurface::get_data usable by specifying the buffer length. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.17 2006/09/24 12:20:43 tsch Exp $ a345 1 int height, stride; d348 1 a348 3 height = cairo_image_surface_get_height (surface); stride = cairo_image_surface_get_stride (surface); RETVAL = data ? newSVpv ((char *) data, height * stride) : &PL_sv_undef; @ 1.16 log @ * CairoSurface.xs (read_func_marshaller): Use POPs, SvPV, and sv_len instead of POPpx to avoid problems on perl 5.8.8 reported by Joe Smith and Alexey Tourbin. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.15 2006/08/10 23:13:57 tsch Exp $ d58 1 a58 1 #endif d172 1 a172 1 cairo_status_t status; d191 3 a193 1 status = SvTRUE (ERRSV) ? SvCairoStatus (ERRSV) : CAIRO_STATUS_SUCCESS; @ 1.15 log @ * CairoSurface.xs: Patch from Yaakov S puts version guards around a few PDF and PS functions that appeared in 1.2.0. * t/CairoSurface.t: Do the same for the corresponding tests. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.14 2006/08/10 17:34:40 tsch Exp $ d230 2 a231 4 STRLEN n_a; char *retval; retval = POPpx; memcpy (data, retval, n_a); @ 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 @d2 1 a2 1 * Copyright (c) 2004-2005 by the cairo perl team (see the file README) d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.13 2006/07/15 14:41:11 tsch Exp $ d433 2 d439 2 d479 3 a481 1 void cairo_ps_surface_set_size (cairo_surface_t *surface, double width_in_points, double height_in_points); d491 2 @ 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/CairoSurface.xs,v 1.12 2006/06/14 18:20:23 tsch Exp $ d12 48 d63 1 d102 4 d252 7 d264 3 a266 11 ##void cairo_surface_get_device_offset (cairo_surface_t *surface, double *x_offset, double *y_offset); void cairo_surface_get_device_offset (cairo_surface_t *surface) PREINIT: double x_offset; double y_offset; PPCODE: cairo_surface_get_device_offset (surface, &x_offset, &y_offset); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVnv (x_offset))); PUSHs (sv_2mortal (newSVnv (y_offset))); d270 2 d286 2 d292 2 d319 1 a319 1 cair_perl_set_isa ("Cairo::ImageSurface", "Cairo::Surface"); d325 4 d334 6 d354 2 d360 2 d364 2 d372 4 d387 3 d402 1 a402 1 cair_perl_set_isa ("Cairo::PdfSurface", "Cairo::Surface"); d408 4 d427 3 d444 1 a444 1 cair_perl_set_isa ("Cairo::PsSurface", "Cairo::Surface"); d450 4 d469 3 d487 3 d495 1 a495 1 cair_perl_set_isa ("Cairo::SvgSurface", "Cairo::Surface"); @ 1.12 log @ * Makefile.PL: Require cairo >= 1.1.8. * CairoSurface.xs, t/CairoSurface.t: Wrap and test cairo_surface_set_fallback_resolution, cairo_image_surface_get_data, cairo_image_surface_get_format, and cairo_image_surface_get_stride. Remove the wrappers and tests for cairo_pdf_surface_set_dpi and cairo_ps_surface_set_dpi. * t/CairoSurface.t: Test Cairo::ImageSurface::get_width and get_height. @ text @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.11 2006/06/03 14:21:09 tsch Exp $ d10 1 d32 4 a42 1 case CAIRO_SURFACE_TYPE_SVG: d260 3 d320 3 d355 3 d389 64 @ 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/CairoSurface.xs,v 1.10 2006/05/14 13:43:10 tsch Exp $ d212 2 d266 13 d283 2 a334 2 void cairo_pdf_surface_set_dpi (cairo_surface_t *surface, double x_dpi, double y_dpi); a366 2 void cairo_ps_surface_set_dpi (cairo_surface_t *surface, double x_dpi, double y_dpi); @ 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/CairoSurface.xs,v 1.9 2006/05/07 14:17:39 tsch Exp $ d47 1 a47 1 d228 2 @ 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/CairoSurface.xs,v 1.8 2005/08/10 17:01:53 tsch Exp $ d59 129 d194 1 a194 1 cairo_surface_t * cairo_surface_create_similar (cairo_surface_t * other, cairo_content_t content, int width, int height); a197 2 void cairo_surface_finish (cairo_surface_t *surface); a231 1 # FIXME d233 12 a272 1 # FIXME d274 11 a298 1 # FIXME d300 15 a332 1 # FIXME d334 15 @ 1.8 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/CairoSurface.xs,v 1.7 2005/07/29 17:19:55 tsch Exp $ d11 48 d65 1 a65 16 ##cairo_surface_t * cairo_surface_create_similar (cairo_surface_t * other, cairo_content_t content, int width, int height); SV * cairo_surface_create_similar (SV * other, cairo_content_t content, int width, int height) PREINIT: char *package; IV pointer; cairo_surface_t *other_surface, *surface; CODE: package = sv_reftype (SvRV (other), TRUE); pointer = SvIV ((SV *) SvRV (other)); other_surface = INT2PTR (cairo_surface_t *, pointer); surface = cairo_surface_create_similar (other_surface, content, width, height); RETVAL = newSV (0); sv_setref_pv (RETVAL, package, (void *) surface); OUTPUT: RETVAL d73 12 d99 2 d105 1 a105 1 # FIXME? d115 1 a115 1 cairo_image_surface_t_noinc * cairo_image_surface_create (class, cairo_format_t format, int width, int height) d120 1 a120 1 cairo_image_surface_t_noinc * cairo_image_surface_create_for_data (class, unsigned char *data, cairo_format_t format, int width, int height, int stride) d131 1 a131 1 cairo_image_surface_t_noinc * cairo_image_surface_create_from_png (class, const char *filename) d135 1 a135 1 # FIXME? d147 1 a147 1 cairo_pdf_surface_t_noinc * cairo_pdf_surface_create (class, const char *filename, double width_in_points, double height_in_points) d151 1 a151 1 # FIXME? d156 2 d167 1 a167 1 cairo_ps_surface_t_noinc * cairo_ps_surface_create (class, const char *filename, double width_in_points, double height_in_points) d171 1 a171 1 # FIXME? d174 9 a182 2 # FIXME: this is listed in the header but apparently not implemented yet. ##void cairo_ps_surface_set_dpi (cairo_surface_t *surface, double x_dpi, double y_dpi); @ 1.7 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/CairoSurface.xs,v 1.6 2005/07/12 20:29:47 tsch Exp $ d48 6 @ 1.6 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/CairoSurface.xs,v 1.5 2005/02/06 16:21:26 rwmcfa1 Exp $ d34 3 a36 1 cairo_status_t cairo_surface_finish (cairo_surface_t *surface); d40 8 @ 1.5 log @ * CairoSurface.xs: fixed a bug in wrapping of cairo_surface_xlib_create where the return value wasn't being caught in RETVAL. thank you -Wall -W * cairo-perl.h: wrapped new includes (prev log msg) in #ifdef HAS's so that we can build on systems where no all backends are supported. XS code already supports this. @ 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/CairoSurface.xs,v 1.4 2004/11/12 03:26:34 rwmcfa1 Exp $ d11 1 a11 5 /* * TODO: * - the names are bad on these, should be cairo_surface_image_create etc. * don't want to put them in these pkgs, going to have to mangle somehow. */ d13 3 a15 1 MODULE = Cairo::Surface PACKAGE = Cairo::Surface PREFIX = cairo_surface_ d17 6 a22 1 cairo_surface_t * image_create (class, cairo_format_t format, int width, int height) d24 7 a30 1 RETVAL = cairo_image_surface_create (format, width, height); d34 14 a47 6 cairo_surface_t * image_create_for_data (class, char * data, cairo_format_t format, int width, int height, int stride); CODE: RETVAL = cairo_image_surface_create_for_data (data, format, width, height, stride); OUTPUT: RETVAL d49 1 a49 2 ## XXX: duplicates the above, no need to bind ##cairo_surface_t * cairo_surface_create_for_image (class, char * data, cairo_format_t format, int width, int height, int stride); d51 4 a54 1 #ifdef CAIRO_HAS_PS_SURFACE d56 4 a59 6 cairo_surface_t * ps_create (class, FILE * file, double width_inches, double height_inches, double x_pixels_per_inch, double y_pixels_per_inch); CODE: RETVAL = cairo_ps_surface_create (file, width_inches, height_inches, x_pixels_per_inch, y_pixels_per_inch); OUTPUT: RETVAL d61 1 a61 1 #endif /* CAIRO_HAS_PS_SURFACE */ d63 1 a63 1 #ifdef CAIRO_HAS_PNG_SURFACE d65 1 a65 5 cairo_surface_t * png_create (class, FILE * file, cairo_format_t format, int width, int height); CODE: RETVAL = cairo_png_surface_create (file, format, width, height); OUTPUT: RETVAL d67 4 a70 1 #endif /* CAIRO_HAS_PNG_SURFACE */ d72 2 a73 1 #ifdef CAIRO_HAS_XLIB_SURFACE d75 1 a75 6 ## XXX: Display, Drawable ... cairo_surface_t * xlib_create (class, Display * dpy, Drawable drawable, Visual * visual, cairo_format_t format, Colormap colormap); CODE: RETVAL = cairo_xlib_surface_create (dpy, drawable, visual, format, colormap); OUTPUT: RETVAL d77 1 a77 1 #endif /* CAIRO_HAS_XLIB_SURFACE */ d79 1 a79 1 #ifdef CAIRO_HAS_GLITZ_SURFACE d81 1 a81 6 ## XXX: glitz_surface_t cairo_surface_t * glitz_create (class, glitz_surface_t * surface); CODE: RETVAL = cairo_glitz_surface_create (surface); OUTPUT: RETVAL d83 4 a86 1 #endif /* CAIRO_HAS_GLITZ_SURFACE */ d88 2 a89 2 ## shouldn't have to deal with references from perl ##void cairo_surface_reference (cairo_surface_t * surface); d91 1 a91 5 ## destroy should happen auto-magically ## void cairo_surface_destroy (cairo_surface_t * surface); void cairo_surface_DESTROY (cairo_surface_t * surface); CODE: cairo_surface_destroy (surface); d93 1 a93 1 cairo_surface_t * cairo_surface_create_similar (cairo_surface_t * other, cairo_format_t format, int width, int height); d95 1 a95 1 void cairo_surface_destroy (cairo_surface_t * surface); d97 1 a97 1 cairo_status_t cairo_surface_set_repeat (cairo_surface_t * surface, int repeat); d99 1 a99 1 cairo_status_t cairo_surface_set_matrix (cairo_surface_t * surface, cairo_matrix_t * matrix); d101 4 a104 8 ## XXX: status return type? ## cairo_status_t cairo_surface_get_matrix (cairo_surface_t * surface, cairo_matrix_t * matrix); cairo_matrix_t * cairo_surface_get_matrix (cairo_surface_t * surface); CODE: RETVAL = cairo_matrix_create (); cairo_surface_get_matrix (surface, RETVAL); OUTPUT: RETVAL d106 2 a107 1 cairo_status_t cairo_surface_set_filter (cairo_surface_t * surface, cairo_filter_t filter); d109 2 a110 1 cairo_filter_t cairo_surface_get_filter (cairo_surface_t * surface); d112 1 @ 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 @d6 1 a6 1 * $Header: /cvs/cairo/cairo-perl/CairoSurface.xs,v 1.3 2004/11/11 02:20:32 rwmcfa1 Exp $ d61 1 a61 1 cairo_xlib_surface_create (dpy, drawable, visual, format, colormap); @ 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/CairoSurface.xs,v 1.2 2004/11/09 02:59:43 rwmcfa1 Exp $ a16 10 MODULE = Cairo::Surface PACKAGE = Cairo::ImageSurface PREFIX = cairo_image_surface_ cairo_surface_t * cairo_image_surface_create (class, cairo_format_t format, int width, int height) ALIAS: Cairo::Surface::new = 1 C_ARGS: format, width, height CLEANUP: CAIRO_PERL_UNUSED (ix); d19 1 a19 3 ## destroy should happen auto-magically ## void cairo_surface_destroy (cairo_surface_t * surface); void cairo_surface_DESTROY (cairo_surface_t * surface); d21 3 a23 1 cairo_surface_destroy (surface); d25 6 a30 6 ## 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); d32 2 a33 21 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 d37 6 a42 3 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 d48 5 a52 3 cairo_surface_t * cairo_png_surface_create (class, FILE * file, cairo_format_t format, int width, int height); C_ARGS: file, format, width, height d59 5 a63 3 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 d70 5 a74 3 cairo_surface_t * cairo_glitz_surface_create (class, glitz_surface_t * surface); C_ARGS: surface d78 30 @ 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/CairoSurface.xs,v 1.1 2004/11/05 01:34:04 rwmcfa1 Exp $ d11 6 d34 64 @ 1.1 log @initial import @ text @d6 1 a6 1 * $Header:$ a12 1 ## XXX: add format d14 6 a19 5 CODE: RETVAL = cairo_image_surface_create (format, width, height); DBG ("creating surface %p\n", RETVAL); OUTPUT: RETVAL d23 2 a24 2 ## manipulate state objects a26 1 DBG ("destroying surface: %p\n", surface); @