1 #############################################################################
3 ## Purpose: XS for Wx::Point, Wx::Size, Wx::Rect, Wx::Region
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Geom.xs 2527 2009-02-07 17:44:57Z mbarbon $
8 ## Copyright: (c) 2000-2003, 2006-2009 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 MODULE=Wx PACKAGE=Wx::Size
16 wxSize::new( width = 0, height = 0 )
23 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
29 wxPli_thread_sv_unregister( aTHX_ "Wx::Size", THIS, ST(0) );
36 THIS->x = SvIV( ST(1) );
45 THIS->y = SvIV( ST(1) );
57 wxSize::Set( width, height )
62 wxSize::SetHeight( height )
66 wxSize::SetWidth( width )
77 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
80 wxSize::Scale( xscale, yscale )
84 THIS->Scale( xscale, yscale );
91 wxSize::IsFullySpecified()
94 wxSize::SetDefaults( size )
97 MODULE=Wx PACKAGE=Wx::Point
100 wxPoint::new( x = 0, y = 0 )
107 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
113 wxPli_thread_sv_unregister( aTHX_ "Wx::Point", THIS, ST(0) );
120 THIS->x = SvIV( ST(1) );
129 THIS->y = SvIV( ST(1) );
134 MODULE=Wx PACKAGE=Wx::Rect
140 MATCH_REDISP( wxPliOvl_n_n_n_n, newXYWH )
141 MATCH_REDISP( wxPliOvl_wpoi_wsiz, newPS )
142 MATCH_REDISP( wxPliOvl_wpoi_wpoi, newPP )
143 END_OVERLOAD( Wx::Rect::new )
146 newXYWH( CLASS, x, y, width, height )
153 RETVAL = new wxRect( x, y, width, height );
158 newPP( CLASS, tl, br )
163 RETVAL = new wxRect( tl, br );
168 newPS( CLASS, pos, size )
173 RETVAL = new wxRect( pos, size );
180 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
186 wxPli_thread_sv_unregister( aTHX_ "Wx::Rect", THIS, ST(0) );
193 THIS->x = SvIV( ST(1) );
202 THIS->y = SvIV( ST(1) );
211 THIS->width = SvIV( ST(1) );
212 RETVAL = THIS->width;
217 wxRect::height( ... )
220 THIS->height = SvIV( ST(1) );
221 RETVAL = THIS->height;
235 wxRect::GetPosition()
237 RETVAL = new wxPoint( THIS->GetPosition() );
244 RETVAL = new wxPoint( THIS->GetTopLeft() );
249 wxRect::GetBottomRight()
251 RETVAL = new wxPoint( THIS->GetBottomRight() );
255 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
258 wxRect::GetBottomLeft()
260 RETVAL = new wxPoint( THIS->GetBottomLeft() );
265 wxRect::GetTopRight()
267 RETVAL = new wxPoint( THIS->GetTopRight() );
275 wxRect::Union( wxRect* rec )
277 RETVAL = new wxRect( THIS->Union( *rec ) );
289 RETVAL = new wxSize( THIS->GetSize() );
306 wxRect::Deflate( x, y )
314 THIS->Deflate( x, y );
317 wxRect::Inflate( x, y )
325 THIS->Inflate( x, y );
328 wxRect::Intersect( rect )
331 RETVAL = new wxRect( THIS->Intersect( *rect ) );
335 wxRect::Intersects( wxRect* rec )
337 RETVAL = THIS->Intersects( *rec );
341 wxRect::SetHeight( height )
345 wxRect::SetWidth( width )
357 wxRect::SetPosition( pos )
361 wxRect::SetSize( size )
365 wxRect::Offset( x, y )
372 wxRect::Contains( ... )
375 MATCH_REDISP( wxPliOvl_n_n, ContainsXY )
376 MATCH_REDISP( wxPliOvl_wpoi, ContainsPoint )
377 MATCH_REDISP( wxPliOvl_wrec, ContainsRect )
378 END_OVERLOAD( Wx::Rect::Contains )
381 wxRect::Inside( ... )
384 MATCH_REDISP( wxPliOvl_n_n, ContainsXY )
385 MATCH_REDISP( wxPliOvl_wpoi, ContainsPoint )
386 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
387 MATCH_REDISP( wxPliOvl_wrec, ContainsRect )
389 END_OVERLOAD( Wx::Rect::Inside )
392 wxRect::ContainsXY( int x, int y )
394 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
395 RETVAL = THIS->Contains( x, y );
397 RETVAL = THIS->Inside( x, y );
402 wxRect::ContainsPoint( wxPoint pt )
404 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
405 RETVAL = THIS->Contains( pt );
407 RETVAL = THIS->Inside( pt );
411 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
414 wxRect::ContainsRect( wxRect* rec )
416 RETVAL = THIS->Contains( *rec );
420 wxRect::CentreIn ( wxRect* rec, int dir = wxBOTH )
422 RETVAL = new wxRect( THIS->CentreIn( *rec, dir ) );
428 MODULE=Wx PACKAGE=Wx::Region
434 RETVAL = new wxRegion();
439 newXYWH( CLASS, x, y, width, height )
446 RETVAL = new wxRegion( x, y, width, height );
451 newPP( CLASS, topLeft, bottomRight )
456 RETVAL = new wxRegion( topLeft, bottomRight );
461 newRect( CLASS, rect )
465 RETVAL = new wxRegion( *rect );
469 #if !defined( __WXMAC__ ) && !defined( __WXMOTIF__ )
472 newPolygon( CLASS, list, fillStyle = wxODDEVEN_RULE )
475 wxPolygonFillMode fillStyle
480 n = wxPli_av_2_pointarray( aTHX_ list, &points );
481 RETVAL = new wxRegion( n, points, fillStyle );
487 #if !defined( __WXOSX_COCOA__ )
490 newBitmap( CLASS, bitmap, colour, tolerance = 0 )
496 RETVAL = new wxRegion( *bitmap, colour, tolerance );
500 newBitmapOnly( CLASS, bitmap )
504 RETVAL = new wxRegion( *bitmap );
513 MATCH_VOIDM_REDISP( newEmpty )
514 MATCH_REDISP( wxPliOvl_n_n_n_n, newXYWH )
515 MATCH_REDISP( wxPliOvl_wpoi_wpoi, newPP )
516 MATCH_REDISP( wxPliOvl_wrec, newRect )
517 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wbmp_wcol_n, newBitmap, 2 )
518 MATCH_REDISP( wxPliOvl_wbmp, newBitmapOnly )
519 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_arr, newPolygon, 1 )
520 END_OVERLOAD( Wx::Region::new )
525 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
531 wxPli_thread_sv_unregister( aTHX_ "Wx::Region", THIS, ST(0) );
538 wxRegion::ContainsXY( x, y )
542 RETVAL = THIS->Contains( x, y );
547 wxRegion::ContainsPoint( point )
550 RETVAL = THIS->Contains( point );
555 wxRegion::ContainsXYWH( x, y, w, h )
561 RETVAL = THIS->Contains( x, y, w, h );
566 wxRegion::ContainsRect( rect )
569 RETVAL = THIS->Contains( *rect );
574 wxRegion::Contains( ... )
577 MATCH_REDISP( wxPliOvl_n_n_n_n, ContainsXYWH )
578 MATCH_REDISP( wxPliOvl_n_n, ContainsXY )
579 MATCH_REDISP( wxPliOvl_wpoi, ContainsPoint )
580 MATCH_REDISP( wxPliOvl_wrec, ContainsRect )
581 END_OVERLOAD( Wx::Region::Contains )
584 wxRegion::ConvertToBitmap()
586 RETVAL = new wxBitmap( THIS->ConvertToBitmap() );
592 RETVAL = new wxRect( THIS->GetBox() );
597 wxRegion::GetBoxXYWH()
604 THIS->GetBox( x, y, w, h );
606 PUSHs( sv_2mortal( newSViv( (IV) x ) ) );
607 PUSHs( sv_2mortal( newSViv( (IV) y ) ) );
608 PUSHs( sv_2mortal( newSViv( (IV) w ) ) );
609 PUSHs( sv_2mortal( newSViv( (IV) h ) ) );
612 wxRegion::IntersectXYWH( x, y, w, h )
618 RETVAL = THIS->Intersect( x, y, w, h );
623 wxRegion::IntersectRect( rect )
626 RETVAL = THIS->Intersect( *rect );
631 wxRegion::IntersectRegion( region )
634 RETVAL = THIS->Intersect( *region );
639 wxRegion::Intersect( ... )
642 MATCH_REDISP( wxPliOvl_n_n_n_n, IntersectXYWH )
643 MATCH_REDISP( wxPliOvl_wrec, IntersectRect )
644 MATCH_REDISP( wxPliOvl_wreg, IntersectRegion )
645 END_OVERLOAD( Wx::Region::Intersect )
650 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
653 wxRegion::IsEqual( region )
660 wxRegion::SubtractRect( rect )
663 RETVAL = THIS->Subtract( *rect );
667 #if !defined(__WXMOTIF__) && !defined(__WXMAC__)
670 wxRegion::Offset( x, y )
677 wxRegion::SubtractRegion( region )
680 RETVAL = THIS->Subtract( *region );
685 wxRegion::Subtract( ... )
688 MATCH_REDISP( wxPliOvl_wrec, SubtractRect )
689 MATCH_REDISP( wxPliOvl_wreg, SubtractRegion )
690 END_OVERLOAD( Wx::Region::Subtract )
693 wxRegion::UnionXYWH( x, y, w, h )
699 RETVAL = THIS->Union( x, y, w, h );
703 wxRegion::UnionRect( rect )
706 RETVAL = THIS->Union( *rect );
710 wxRegion::UnionRegion( region )
713 RETVAL = THIS->Union( *region );
717 wxRegion::UnionBitmapOnly( bitmap )
720 RETVAL = THIS->Union( *bitmap );
724 wxRegion::UnionBitmap( bitmap, colour, tolerance = 0 )
729 RETVAL = THIS->Union( *bitmap, colour, tolerance );
733 wxRegion::Union( ... )
736 MATCH_REDISP( wxPliOvl_n_n_n_n, UnionXYWH )
737 MATCH_REDISP( wxPliOvl_wrec, UnionRect )
738 MATCH_REDISP( wxPliOvl_wreg, UnionRegion )
739 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wbmp_wcol_n, UnionBitmap, 2 )
740 MATCH_REDISP( wxPliOvl_wbmp, UnionBitmapOnly )
741 END_OVERLOAD( Wx::Region::Union )
744 wxRegion::XorXYWH( x, y, w, h )
750 RETVAL = THIS->Xor( x, y, w, h );
755 wxRegion::XorRect( rect )
758 RETVAL = THIS->Xor( *rect );
763 wxRegion::XorRegion( region )
766 RETVAL = THIS->Xor( *region );
774 MATCH_REDISP( wxPliOvl_n_n_n_n, XorXYWH )
775 MATCH_REDISP( wxPliOvl_wrec, XorRect )
776 MATCH_REDISP( wxPliOvl_wreg, XorRegion )
777 END_OVERLOAD( Wx::Region::Xor )
779 MODULE=Wx PACKAGE=Wx::Position
781 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
783 #include <wx/position.h>
786 wxPosition::new( row = 0, column = 0 )
793 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
797 wxPosition::DESTROY()
799 wxPli_thread_sv_unregister( aTHX_ "Wx::Position", THIS, ST(0) );
803 wxPosition::row( ... )
806 THIS->SetRow( SvIV( ST(1) ) );
807 RETVAL = THIS->GetRow();
812 wxPosition::col( ... )
815 THIS->SetCol( SvIV( ST(1) ) );
816 RETVAL = THIS->GetCol();
821 wxPosition::column( ... )
824 THIS->SetColumn( SvIV( ST(1) ) );
825 RETVAL = THIS->GetColumn();
836 wxPosition::GetColumn()
839 wxPosition::SetRow( height )
843 wxPosition::SetCol( width )
847 wxPosition::SetColumn( width )