head 1.13; access; symbols rel-1-060:1.11 rel-1-053:1.11 rel-1-052:1.11 rel-1-045:1.11 rel-1-051:1.11 rel-1-044:1.11 stable-1-04:1.11.0.2 stable-1-02:1.10.2.1.0.2 rel-1-050:1.11 rel-1-043:1.11 rel-1-042:1.11 rel-1-041:1.11 rel-1-040:1.11 rel-1-023:1.10.2.1 rel-1-031:1.11 rel-1-022:1.10.2.1 rel-1-030:1.10 rel-1-021:1.10 stable-1-0:1.10.0.2 rel-1-02:1.10 rel-1-01:1.9 rel-1-00:1.9 rel-0-92:1.7 rel-0-91:1.7 rel-0-90:1.6 rel-0-04:1.6 rel-0-03:1.4 rel-0-02:1.3 rel-0-01:1.2; locks; strict; comment @# @; 1.13 date 2008.10.05.21.21.16; author tsch; state Exp; branches; next 1.12; commitid JtkkXu8cTCi42ult; 1.12 date 2008.10.05.19.59.40; author tsch; state Exp; branches; next 1.11; commitid jap73dqgVgT1Atlt; 1.11 date 2006.12.30.19.16.31; author tsch; state Exp; branches; next 1.10; 1.10 date 2006.11.09.18.44.49; author tsch; state Exp; branches 1.10.2.1; next 1.9; 1.9 date 2006.08.20.18.33.22; author tsch; state Exp; branches; next 1.8; 1.8 date 2006.08.20.18.09.47; author tsch; state Exp; branches; next 1.7; 1.7 date 2006.08.10.17.34.40; author tsch; state Exp; branches; next 1.6; 1.6 date 2006.06.03.14.21.09; 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 2006.01.08.17.06.29; author tsch; state Exp; branches; next 1.3; commitid 64a343c146924567; 1.3 date 2005.08.31.22.00.15; author tsch; state Exp; branches; next 1.2; commitid 1704431628664567; 1.2 date 2005.07.12.20.29.47; author tsch; state Exp; branches; next 1.1; commitid 758542d428324567; 1.1 date 2004.11.28.18.27.10; author rwmcfa1; state Exp; branches; next ; 1.10.2.1 date 2006.12.30.19.17.05; author tsch; state Exp; branches; next ; desc @@ 1.13 log @ * MakeHelper.pm: Use the correct enum type instead of int for the enum converters. @ text @# # this is all hacky etc. it works so it's gonna stay for now. it is not and # should not be installed. # # $Id: MakeHelper.pm,v 1.12 2008-10-05 19:59:40 tsch Exp $ # package MakeHelper; use strict; use warnings; use IO::File; use File::Spec; our $autogen_dir = '.'; # --------------------------------------------------------------------------- # # copied/borrowed from Gtk2-Perl's CodeGen sub write_boot { my %opts = ( ignore => '^[^:]+$', # ignore package with no colons in it filename => File::Spec->catdir ($autogen_dir, 'cairo-perl-boot.xsh'), 'glob' => File::Spec->catfile ('xs', '*.xs'), @@_, ); my $ignore = $opts{ignore}; my $file = IO::File->new (">$opts{filename}") or die "Cannot write $opts{filename}: $!"; print $file "\n\n/* This file is automatically generated, any changes made here will be lost! */\n\n"; my %boot=(); my @@xs_files = 'ARRAY' eq ref $opts{xs_files} ? @@{ $opts{xs_files} } : glob $opts{'glob'}; foreach my $xsfile (@@xs_files) { my $in = IO::File->new ($xsfile) or die "can't open $xsfile: $!\n"; while (<$in>) { next unless m/^MODULE\s*=\s*(\S+)/; #warn "found $1 in $&\n"; my $package = $1; next if $package =~ m/$ignore/; $package =~ s/:/_/g; my $sym = "boot_$package"; print $file "CAIRO_PERL_CALL_BOOT ($sym);\n" unless $boot{$sym}; $boot{$sym}++; } close $in; } close $file; } # --------------------------------------------------------------------------- # sub do_typemaps { my %objects = %{shift ()}; my %structs = %{shift ()}; my %enums = %{shift ()}; my %backend_guards = %{shift ()}; my %enum_guards = %{shift ()}; my $cairo_perl = File::Spec->catfile ($autogen_dir, 'cairo-perl-auto.typemap'); open TYPEMAP, '>', $cairo_perl or die "unable to open ($cairo_perl) for output"; print TYPEMAP <catfile ($autogen_dir, 'cairo-perl-auto.h'); open HEADER, '>', $header or die "unable to open ($header) for output"; print HEADER < EOS sub mangle { my $mangled = shift; $mangled =~ s/_t$//; $mangled =~ s/([^_]+)/ucfirst $1/ge; $mangled =~ s/_//g; return $mangled; } sub reference { my $ref = shift; $ref =~ s/_t$//; $ref .= '_reference'; return $ref; } sub name { $_[0] =~ /cairo_(\w+)_t/; return $1; } # ------------------------------------------------------------------- # print HEADER "\n/* objects */\n\n"; foreach (keys %objects) { /^(.+) \*/; my $type = $1; my $mangled = mangle ($type); my $ref = reference ($type); if (exists $backend_guards{$type}) { print HEADER "#ifdef $backend_guards{$type}\n"; } print HEADER <<"EOS"; typedef $type ${type}_noinc; typedef $type ${type}_ornull; #define Sv$mangled(sv) (($type *) cairo_object_from_sv (sv, "$objects{$_}")) #define Sv${mangled}_ornull(sv) (((sv) && SvOK (sv)) ? Sv$mangled(sv) : NULL) #define newSV$mangled(object) (cairo_object_to_sv (($type *) $ref (object), "$objects{$_}")) #define newSV${mangled}_noinc(object) (cairo_object_to_sv (($type *) object, "$objects{$_}")) #define newSV${mangled}_ornull(object) (((object) == NULL) ? &PL_sv_undef : newSV$mangled(object)) EOS if (exists $backend_guards{$type}) { print HEADER "#endif /* $backend_guards{$type} */\n"; } } # ------------------------------------------------------------------- # print HEADER "\n/* structs */\n\n"; foreach (keys %structs) { /^(.+) \*/; my $type = $1; my $mangled = mangle ($type); print HEADER <<"EOS"; typedef $type ${type}_ornull; #define Sv$mangled(sv) (($type *) cairo_struct_from_sv (sv, "$structs{$_}")) #define Sv${mangled}_ornull(sv) (((sv) && SvOK (sv)) ? Sv$mangled(sv) : NULL) #define newSV$mangled(struct) (cairo_struct_to_sv (($type *) struct, "$structs{$_}")) #define newSV${mangled}_ornull(struct) (((struct) == NULL) ? &PL_sv_undef : newSV$mangled(struct)) EOS } # ------------------------------------------------------------------- # print HEADER "\n/* enums */\n\n"; foreach my $type (keys %enums) { my $mangled = mangle ($type); my $name = name ($type); next unless @@{$enums{$type}}; if (exists $enum_guards{$type}) { print HEADER "#ifdef $enum_guards{$type}\n"; } print HEADER <<"EOS"; $type cairo_${name}_from_sv (SV * $name); SV * cairo_${name}_to_sv ($type val); #define Sv$mangled(sv) (cairo_${name}_from_sv (sv)) #define newSV$mangled(val) (cairo_${name}_to_sv (val)) EOS if (exists $enum_guards{$type}) { print HEADER "#endif /* $enum_guards{$type} */\n"; } } close HEADER; return ($cairo_perl); } # --------------------------------------------------------------------------- # sub do_enums { my %enums = %{shift ()}; my %guards = %{shift ()}; my $cairo_enums = 'cairo-perl-enums.c'; open ENUMS, '>', $cairo_enums or die "unable to open ($cairo_enums) for output"; print ENUMS " /* * This file was automatically generated. Do not edit. */ #include "; sub canonicalize { my ($name, $prefix) = @@_; $name =~ s/$prefix//; $name =~ tr/_/-/; $name = lc ($name); return $name; } sub if_tree_from { my @@enums = @@_; my $prefix = shift @@enums; my $full = shift @@enums; my $name = canonicalize($full, $prefix); # +1 so that strncmp also looks at the trailing \0, and discerns # 'color' and 'color-alpha', for example. my $len = length ($name) + 1; my $str = <<"EOS"; if (strncmp (str, "$name", $len) == 0) return $full; EOS foreach $full (@@enums) { my $name = canonicalize($full, $prefix); $len = length ($name); $str .= <<"EOS"; else if (strncmp (str, "$name", $len) == 0) return $full; EOS } $str; } sub if_tree_to { my @@enums = @@_; my $prefix = shift @@enums; my $full = shift @@enums; my $name = canonicalize($full, $prefix); my $str = <<"EOS"; if (val == $full) return newSVpv ("$name", 0); EOS foreach $full (@@enums) { my $name = canonicalize($full, $prefix); $str .= <<"EOS"; else if (val == $full) return newSVpv ("$name", 0); EOS } $str; } foreach my $type (keys %enums) { my $name = name($type); my @@enum_values = @@{$enums{$type}}; next unless @@enum_values; my $value_list = join ", ", map { canonicalize($_, $enum_values[0]) } @@enum_values[1..$#enum_values]; my $tree_from = if_tree_from (@@enum_values); my $tree_to = if_tree_to (@@enum_values); if (exists $guards{$type}) { print ENUMS "#ifdef $guards{$type}\n\n"; } print ENUMS <<"EOS"; $type cairo_${name}_from_sv (SV * $name) { char * str = SvPV_nolen ($name); $tree_from croak ("`%s' is not a valid $type value; valid values are: $value_list", str); return 0; } SV * cairo_${name}_to_sv ($type val) { $tree_to warn ("unknown $type value %d encountered", val); return &PL_sv_undef; } EOS if (exists $guards{$type}) { print ENUMS "#endif /* $guards{$type} */\n"; } } close ENUMS; } 1; @ 1.12 log @In preparation of the move to SVN, use the Id keyword in place of Header. @ text @d5 1 a5 1 # $Id: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.11 2006/12/30 19:16:31 tsch Exp $ d256 2 a257 2 int cairo_${name}_from_sv (SV * $name); SV * cairo_${name}_to_sv (int val); d374 1 a374 1 int d386 1 a386 1 cairo_${name}_to_sv (int val) @ 1.11 log @ * MakeHelper.pm: Fix the valid-value lists in enum error messages. @ text @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.10 2006/11/09 18:44:49 tsch Exp $ @ 1.10 log @ * MakeHelper.pm, CairoSurface.t: When comparing enum values, look at length+1, not just length, bytes to discern string pairs like 'color' and 'color-alpha'. Duh! Many thanks to Martijn van Beers for finding this bug. @ text @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.9 2006/08/20 18:33:22 tsch Exp $ d365 1 a365 1 my $value_list = join ", ", map { canonicalize($type, $enum_values[0]) } @@enum_values[1..$#enum_values]; @ 1.10.2.1 log @ * MakeHelper.pm: Fix the valid-value lists in enum error messages. @ text @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.10 2006/11/09 18:44:49 tsch Exp $ d365 1 a365 1 my $value_list = join ", ", map { canonicalize($_, $enum_values[0]) } @@enum_values[1..$#enum_values]; @ 1.9 log @ * MakeHelper.pm: Revert the last commit which used real enum types instead of int; it broke compilation. Also alter the way unknown enum types are dealt with: don't declare and implement stub converters, just omit them. Still declare typemaps for them though, to make xsubpp happy. @ text @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.8 2006/08/20 18:09:47 tsch Exp $ d309 4 a312 1 my $len = length ($name); @ 1.8 log @ * MakeHelper.pm: Add the infrastructure necessary to support protecting the enum related things with #ifdef, if needed. Also use the real enum types for the enum converters, instead of just int. @ text @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.7 2006/08/10 17:34:40 tsch Exp $ d249 2 d256 2 a257 2 $type cairo_${name}_from_sv (SV * $name); SV * cairo_${name}_to_sv ($type val); d360 1 a360 21 # Create stub converters to make xsubpp happy even if the # current cairo doesn't have this type unless (@@enum_values) { print ENUMS <<"EOS"; int cairo_${name}_from_sv (SV * $name) { return 0; } SV * cairo_${name}_to_sv (int val) { return &PL_sv_undef; } EOS # Skip to next enum value next; } d371 1 a371 1 $type d383 1 a383 1 cairo_${name}_to_sv ($type val) @ 1.7 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 @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.6 2006/06/03 14:21:09 tsch Exp $ d74 2 a75 1 my %backend_macros = %{shift ()}; d202 2 a203 2 if (exists $backend_macros{$type}) { print HEADER "#ifdef $backend_macros{$type}\n"; d216 2 a217 2 if (exists $backend_macros{$type}) { print HEADER "#endif /* $backend_macros{$type} */\n"; d244 1 a244 1 foreach (keys %enums) a245 1 my $type = $_; d249 4 d254 2 a255 2 int cairo_${name}_from_sv (SV * $name); SV * cairo_${name}_to_sv (int val); d259 4 d275 1 d353 1 a353 1 foreach (keys %enums) d355 2 a356 2 my $name = name($_); my @@enum_values = @@{$enums{$_}}; d380 1 a380 1 my $value_list = join ", ", map { canonicalize($_, $enum_values[0]) } @@enum_values[1..$#enum_values]; d384 4 d389 1 a389 1 int d395 1 a395 1 croak ("`%s' is not a valid $_ value; valid values are: $value_list", str); d401 1 a401 1 cairo_${name}_to_sv (int val) d404 1 a404 1 warn ("unknown $_ value %d encountered", val); d409 4 @ 1.6 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 @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.5 2006/05/07 14:17:39 tsch Exp $ d348 23 a371 1 @ 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 @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.4 2006/01/08 17:06:29 tsch Exp $ d360 1 a360 1 croak ("`%s' is not a valid $_ value; valid values are: $value_list\\n", str); @ 1.4 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 @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.3 2005/08/31 22:00:15 tsch Exp $ d281 9 d297 1 a297 4 my $name = $full; $name =~ s/$prefix//; $name =~ tr/_/-/; $name = lc ($name); d300 2 a301 1 my $str = " if (strncmp (str, \"$name\", $len) == 0) d303 1 a303 1 "; d307 1 a307 4 $name = $full; $name =~ s/$prefix//; $name =~ tr/_/-/; $name = lc ($name); d310 2 a311 1 $str .= " else if (strncmp (str, \"$name\", $len) == 0) d313 1 a313 1 "; d325 1 a325 4 my $name = $full; $name =~ s/$prefix//; $name =~ tr/_/-/; $name = lc ($name); d327 4 a330 3 my $str = " if (val == $full) return newSVpv (\"$name\", 0); "; d334 5 a338 7 $name = $full; $name =~ s/$prefix//; $name =~ tr/_/-/; $name = lc ($name); $str .= " else if (val == $full) return newSVpv (\"$name\", 0); "; d346 10 a355 4 my $name = name ($_); print ENUMS 'int cairo_'.$name.'_from_sv (SV * '.$name.') d357 1 a357 1 char * str = SvPV_nolen ('.$name.'); d359 2 a360 2 '.if_tree_from (@@{$enums{$_}}).' croak ("bad value for '.$name.' (%s)\n", str); a361 1 free (str); d366 1 a366 1 cairo_'.$name.'_to_sv (int val) d368 3 a370 2 '.if_tree_to (@@{$enums{$_}}).' return newSVpv ("unknown/invalid", 0); d373 1 a373 1 '; @ 1.3 log @ * MakeHelper.pm, Makefile.PL: Surround our _noinc typedefs for the PS and PDF backends with appropriate ifdefs to fix compilation when these backends were not installed with cairo. @ text @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.2 2005/07/12 20:29:47 tsch Exp $ d17 2 d67 2 d74 1 a74 1 my %backend_macros = %{shift()}; d105 1 a105 2 print TYPEMAP "$_\t".type_id ($_)."\n"; print TYPEMAP "const $_\t".type_id ($_)."\n"; d108 1 a108 1 foreach (keys %objects) d113 3 a115 1 print TYPEMAP "${trunk}_noinc *\t".type_id ($_)."_NOINC\n"; a117 2 print TYPEMAP "\nINPUT\n\n"; d120 2 a121 7 print TYPEMAP type_id ($_).' if (sv_derived_from($arg, \"'.$objects{$_}.'\")) { IV tmp = SvIV((SV*)SvRV($arg)); $var = INT2PTR($type,tmp); } else Perl_croak(aTHX_ \"$var is not of type '.$objects{$_}.'\") d123 1 a123 1 '; d126 10 a135 9 foreach (keys %structs) { print TYPEMAP type_id ($_).' if (sv_derived_from($arg, \"'.$structs{$_}.'\")) { IV tmp = SvIV((SV*)SvRV($arg)); $var = INT2PTR($type,tmp); } else Perl_croak(aTHX_ \"$var is not of type '.$structs{$_}.'\") d137 1 a137 2 '; } d139 1 a139 4 foreach (keys %enums) { print TYPEMAP type_id ($_).' $var = cairo_'.func_name ($_).'_from_sv ($arg); d141 2 a142 2 '; } d144 1 a144 1 print TYPEMAP "\nOUTPUT\n\n"; d146 3 a148 8 my $ref; foreach (keys %objects) { /^(.*)_t \*/; $ref = $1.'_reference'; print TYPEMAP type_id ($_)." $ref (".'$var); sv_setref_pv($arg, \"'.$objects{$_}.'\", (void*)$var); d150 1 a150 3 '; print TYPEMAP type_id ($_).'_NOINC sv_setref_pv($arg, \"'.$objects{$_}.'\", (void*)$var); d152 1 a152 20 '; } foreach (keys %structs) { print TYPEMAP type_id ($_).' sv_setref_pv($arg, \"'.$structs{$_}.'\", (void*)$var); '; } foreach (keys %enums) { print TYPEMAP type_id ($_).' $arg = cairo_'.func_name ($_).'_to_sv ($var); '; } close TYPEMAP; d165 1 d167 26 a192 1 EOS d196 7 a202 3 /^(.*) \*/; if (exists $backend_macros{$1}) { print HEADER "#ifdef $backend_macros{$1}\n"; d204 13 a216 3 print HEADER "typedef $1 ${1}_noinc;\n"; if (exists $backend_macros{$1}) { print HEADER "#endif\n"; d220 37 d262 2 a271 6 sub name { $_[0] =~ /cairo_(\w+)_t/; $1; } a342 9 open HDR, '>', "$autogen_dir/cairo-perl-enums.h"; print HDR "/* * This file was automatically generated. Do not edit. */ #ifndef _CAIRO_PERL_ENUMS_H_ #define _CAIRO_PERL_ENUMS_H_ "; a346 5 print HDR " int cairo_".$name."_from_sv (SV * $name); SV * cairo_".$name."_to_sv (int val); "; a368 4 print HDR " #endif /* _CAIRO_PERL_ENUMS_H_ */\n"; close HDR; @ 1.2 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 @d5 1 a5 1 # $Header: /cvs/cairo/cairo-perl/MakeHelper.pm,v 1.1 2004/11/28 18:27:10 rwmcfa1 Exp $ d70 1 d202 3 d206 3 @ 1.1 log @ * Makefile.PL, MakeHelper.pm: initial import of MakeHelper, mess of code moved out of Makefile.PL into it. beginning of cleaning all that up. File::Spec now used. * examples/png/*: initial import of port of cairo-demo/png examples, except text. * META.yml: unknown version * MANIFEST, MANIFEST.SKIP: updates @ text @d5 1 a5 1 # $Header:$ d22 1 a22 1 filename => File::Spec->catdir ($autogen_dir, d30 1 a30 1 or die "Cannot write $opts{filename}: $!"; d49 1 a49 1 d73 1 a73 1 open TYPEMAP, '>'.$cairo_perl d76 8 a83 1 print TYPEMAP "#\n#\n#\n\nTYPEMAP\n\n"; d97 1 a97 1 d100 10 a109 1 print TYPEMAP $_."\t".type_id ($_)."\n"; d147 1 a147 1 d160 4 d183 23 a205 1 d213 2 a214 2 my $cairo_enums = 'CairoEnums.xs'; open ENUMS, '>'.$cairo_enums d225 1 a225 1 * d241 2 d253 2 d273 2 d284 2 d294 1 a294 1 open HDR, ">$autogen_dir/cairo-perl-enums.h"; d296 1 a296 1 * d311 1 a311 1 a336 4 print ENUMS "MODULE = Cairo::Enums PACKAGE = Cairo::Enums PREFIX = cairo_enums_ "; a338 1 return ($cairo_enums); @