1 #############################################################################
2 ## Name: XS/ImageList.xs
3 ## Purpose: XS for Wx::ImageList
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: ImageList.xs 2057 2007-06-18 23:03:00Z mbarbon $
8 ## Copyright: (c) 2000-2006 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 #############################################################################
14 #include <wx/imaglist.h>
16 #define wxNullBitmapPtr (wxBitmap*) &wxNullBitmap
21 %name{Wx::ImageList} class wxImageList
23 wxImageList( int width, int height, bool mask = true,
24 int initialCount = 1 );
26 %name{AddBitmap} int Add( const wxBitmap& bitmap,
27 const wxBitmap& mask = wxNullBitmapPtr );
28 %name{AddWithColourMask} int Add( const wxBitmap& bitmap,
29 const wxColour& colour );
30 %name{AddIcon} int Add( const wxIcon& icon );
31 bool Draw( int index, const wxDC& dc, int x, int y,
32 int flags = wxIMAGELIST_DRAW_NORMAL,
33 bool solidBackground = false );
35 bool Remove( int index );
38 #if defined( __WXMSW__ )
39 %name{ReplaceBitmap} bool Replace( int index, const wxBitmap& bitmap,
40 const wxBitmap&mask = wxNullBitmapPtr );
42 %name{ReplaceBitmap} bool Replace( int index, const wxBitmap& bitmap );
44 %name{ReplaceIcon} bool Replace( int index, const wxIcon& icon );
45 #if WXPERL_W_VERSION_GE( 2, 5, 4 )
46 wxBitmap GetBitmap( int index );
47 wxIcon GetIcon( int index );
53 MODULE=Wx PACKAGE=Wx::ImageList
58 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
65 wxPli_thread_sv_unregister( aTHX_ "Wx::ImageList", THIS, ST(0) );
66 if( wxPli_object_is_deleteable( aTHX_ ST(0) ) )
70 wxImageList::Add( ... )
73 MATCH_REDISP( wxPliOvl_wbmp_wcol, AddWithColourMask )
74 MATCH_REDISP( wxPliOvl_wico, AddIcon )
75 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_wbmp_wbmp, AddBitmap, 1 )
76 END_OVERLOAD( Wx::ImageList::Add )
79 wxImageList::GetSize( index )
86 result = THIS->GetSize( index, width, height );
88 PUSHs( sv_2mortal( newSViv( result ) ) );
89 PUSHs( sv_2mortal( newSViv( width ) ) );
90 PUSHs( sv_2mortal( newSViv( height ) ) );
93 wxImageList::Replace( ... )
96 MATCH_REDISP( wxPliOvl_n_wico, ReplaceIcon )
97 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_n_wbmp_wbmp, ReplaceBitmap, 2 )
98 END_OVERLOAD( Wx::ImageList::Replace )