Remove tests
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / ImageList.xs
1 #############################################################################
2 ## Name:        XS/ImageList.xs
3 ## Purpose:     XS for Wx::ImageList
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     29/10/2000
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 #############################################################################
12
13 %{
14 #include <wx/imaglist.h>
15
16 #define wxNullBitmapPtr (wxBitmap*) &wxNullBitmap
17 %}
18
19 %module{Wx};
20
21 %name{Wx::ImageList} class wxImageList
22 {
23     wxImageList( int width, int height, bool mask = true,
24                  int initialCount = 1 );
25
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 );
34     int GetImageCount();
35     bool Remove( int index );
36     bool RemoveAll();
37
38 #if defined( __WXMSW__ )
39     %name{ReplaceBitmap} bool Replace( int index, const wxBitmap& bitmap,
40                                        const wxBitmap&mask = wxNullBitmapPtr );
41 #else
42     %name{ReplaceBitmap} bool Replace( int index, const wxBitmap& bitmap );
43 #endif
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 );
48 #endif
49 };
50
51 %{
52
53 MODULE=Wx PACKAGE=Wx::ImageList
54
55 static void
56 wxImageList::CLONE()
57   CODE:
58     wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
59
60 ## // thread OK
61 void
62 DESTROY( THIS )
63     wxImageList* THIS
64   CODE:
65     wxPli_thread_sv_unregister( aTHX_ "Wx::ImageList", THIS, ST(0) );
66     if( wxPli_object_is_deleteable( aTHX_ ST(0) ) )
67         delete THIS;
68
69 void
70 wxImageList::Add( ... )
71   PPCODE:
72     BEGIN_OVERLOAD()
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 )
77
78 void
79 wxImageList::GetSize( index )
80     int index
81   PREINIT:
82     int width;
83     int height;
84     bool result;
85   PPCODE:
86     result = THIS->GetSize( index, width, height );
87     EXTEND( SP, 3 );
88     PUSHs( sv_2mortal( newSViv( result ) ) );
89     PUSHs( sv_2mortal( newSViv( width ) ) );
90     PUSHs( sv_2mortal( newSViv( height ) ) );
91
92 void
93 wxImageList::Replace( ... )
94   PPCODE:
95     BEGIN_OVERLOAD()
96         MATCH_REDISP( wxPliOvl_n_wico, ReplaceIcon )
97         MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_n_wbmp_wbmp, ReplaceBitmap, 2 )
98     END_OVERLOAD( Wx::ImageList::Replace )
99
100 %}