1 #############################################################################
3 ## Purpose: XS for Wx::Pen
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Pen.xs 2340 2008-03-25 22:25:07Z mbarbon $
8 ## Copyright: (c) 2000-2003, 2004, 2006-2008 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
13 #include <wx/colour.h>
16 MODULE=Wx PACKAGE=Wx::Pen
22 MATCH_REDISP( wxPliOvl_wcol_n_n, newColour )
23 MATCH_REDISP( wxPliOvl_wbmp_n, newBitmap )
24 MATCH_REDISP( wxPliOvl_s_n_n, newString )
25 END_OVERLOAD( Wx::Pen::new )
28 newColour( CLASS, colour, width, style )
34 RETVAL = new wxPen( *colour, width, style );
39 newString( CLASS, name, width, style )
45 RETVAL = new wxPen( name, width, style );
49 #if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )
52 newBitmap( CLASS, stipple, width )
57 RETVAL = new wxPen( *stipple, width );
64 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
70 wxPli_thread_sv_unregister( aTHX_ "Wx::Pen", THIS, ST(0) );
79 RETVAL = new wxColour( THIS->GetColour() );
89 n = THIS->GetDashes( &array );
91 for( i = 0; i < n; ++i )
93 PUSHs( sv_2mortal( newSViv( array[i] ) ) );
99 #if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )
104 RETVAL = new wxBitmap( *THIS->GetStipple() );
119 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
127 wxPen::SetCap( capStyle )
131 wxPen::SetColour( ... )
134 MATCH_REDISP( wxPliOvl_wcol, SetColourColour )
135 MATCH_REDISP( wxPliOvl_n_n_n, SetColourRGB )
136 MATCH_REDISP( wxPliOvl_s, SetColourName )
137 END_OVERLOAD( Wx::Pen::SetColour )
140 wxPen::SetColourColour( colour )
143 THIS->SetColour( *colour );
146 wxPen::SetColourName( name )
149 THIS->SetColour( name );
152 wxPen::SetColourRGB( r, g, b )
157 THIS->SetColour( r, g, b );
160 wxPen::SetDashes( ds )
167 THIS->GetDashes( &olddashes );
175 ( SvTYPE( (SV*) ( av = (AV*) SvRV( ds ) ) ) != SVt_PVAV ) )
177 croak( "the value is not an array reference" );
181 n = av_len( av ) + 1;
182 dashes = new wxDash[ n ];
184 for( i = 0; i < n; ++i )
186 t = *av_fetch( av, i, 0 );
187 dashes[i] = SvIV( t );
190 THIS->SetDashes( n, dashes );
194 wxPen::SetJoin( join_style )
197 #if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )
200 wxPen::SetStipple( stipple )
203 THIS->SetStipple( *stipple );
208 wxPen::SetStyle( style )
212 wxPen::SetWidth( width )