1 #############################################################################
2 ## Name: XS/ArtProvider.xsp
3 ## Purpose: XS++ for wxArtProvider class
4 ## Author: Matthew "Cheetah" Gabeler-Lee
7 ## RCS-ID: $Id: ArtProvider.xsp 2499 2008-11-05 19:47:18Z mbarbon $
8 ## Copyright: (c) 2005-2008 Matthew Gabeler-Lee
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
15 %typemap{wxPlArtProvider*}{simple};
21 #include "cpp/v_cback.h"
23 #define DEC_V_CBACK_WXBITMAP__WXARTID_WXARTCLIENT_WXSIZE_pure( METHOD ) \
24 wxBitmap METHOD( const wxArtID& id, const wxArtClient& client, const wxSize& size )
26 #define DEF_V_CBACK_WXBITMAP__WXARTID_WXARTCLIENT_WXSIZE_pure( CLASS, BASE, METHOD ) \
27 wxBitmap CLASS::METHOD( const wxArtID& id, const wxArtClient& client, \
28 const wxSize& size ) \
31 if( wxPliVirtualCallback_FindCallback( aTHX_ &m_callback, #METHOD ) ) \
33 wxAutoSV ret( aTHX_ wxPliCCback( aTHX_ &m_callback, \
34 G_SCALAR, "PPo", &id, &client, new wxSize( size ) ) );\
35 return *(wxBitmap*)wxPli_sv_2_object( aTHX_ ret, "Wx::Bitmap" ); \
37 return wxNullBitmap; \
40 #define DEC_V_CBACK_WXICONBUNDLE__WXARTID_WXARTCLIENT_pure( METHOD ) \
41 wxIconBundle METHOD( const wxArtID& id, const wxArtClient& client )
43 #define DEF_V_CBACK_WXICONBUNDLE__WXARTID_WXARTCLIENT_pure( CLASS, BASE, METHOD ) \
44 wxIconBundle CLASS::METHOD( const wxArtID& id, const wxArtClient& client ) \
47 if( wxPliVirtualCallback_FindCallback( aTHX_ &m_callback, #METHOD ) ) \
49 wxAutoSV ret( aTHX_ wxPliCCback( aTHX_ &m_callback, \
50 G_SCALAR, "PP", &id, &client ) ); \
51 return *(wxIconBundle*)wxPli_sv_2_object( aTHX_ ret, "Wx::IconBundle" ); \
53 return wxNullIconBundle; \
56 class wxPlArtProvider : public wxArtProvider
58 WXPLI_DECLARE_DYNAMIC_CLASS( wxPlArtProvider );
59 WXPLI_DECLARE_V_CBACK();
61 wxPlArtProvider( const char* package )
62 : m_callback( "Wx::ArtProvider" )
64 m_callback.SetSelf( wxPli_make_object( this, package ), true );
67 DEC_V_CBACK_WXBITMAP__WXARTID_WXARTCLIENT_WXSIZE_pure( CreateBitmap );
68 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
69 DEC_V_CBACK_WXICONBUNDLE__WXARTID_WXARTCLIENT_pure( CreateIconBundle );
73 DEF_V_CBACK_WXBITMAP__WXARTID_WXARTCLIENT_WXSIZE_pure( wxPlArtProvider,
74 wxArtProvider, CreateBitmap );
75 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
76 DEF_V_CBACK_WXICONBUNDLE__WXARTID_WXARTCLIENT_pure( wxPlArtProvider,
77 wxArtProvider, CreateIconBundle );
80 #if WXPERL_W_VERSION_GE( 2, 5, 1 )
81 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPlArtProvider, wxArtProvider );
83 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPlArtProvider, wxObject );
92 #if WXPERL_W_VERSION_GE( 2, 5, 2 )
94 #include <wx/artprov.h>
95 #include "cpp/artprov.h"
97 MODULE=Wx PACKAGE=Wx::ArtProvider
100 #!sub CreateIconBundle
103 GetBitmap( id, client = wxART_OTHER, size = wxDefaultSize )
108 RETVAL = new wxBitmap( wxArtProvider::GetBitmap( id, client, size ) );
112 GetIcon( id, client = wxART_OTHER, size = wxDefaultSize )
117 RETVAL = new wxIcon( wxArtProvider::GetIcon( id, client, size ) );
120 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
123 GetIconBundle( id, client = wxART_OTHER )
127 RETVAL = new wxIconBundle( wxArtProvider::GetIconBundle( id, client ) );
135 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
136 RETVAL = wxArtProvider::Pop();
138 RETVAL = wxArtProvider::PopProvider();
143 PushProvider( provider )
144 wxArtProvider* provider
146 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
147 wxArtProvider::Push( provider);
149 wxArtProvider::PushProvider( provider);
152 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
155 InsertProvider( provider )
156 wxArtProvider* provider
158 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
159 wxArtProvider::PushBack( provider);
161 wxArtProvider::Insert( provider);
167 RemoveProvider( provider )
168 wxArtProvider* provider
170 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
171 RETVAL = wxArtProvider::Remove( provider );
173 RETVAL = wxArtProvider::RemoveProvider( provider );
177 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
180 DeleteProvider( provider )
181 wxArtProvider* provider
183 RETVAL = wxArtProvider::Delete( provider );
188 MODULE=Wx PACKAGE=Wx::PlArtProvider
191 wxPlArtProvider::new()
193 RETVAL = new wxPlArtProvider( CLASS );
198 %name{Wx::PlArtProvider} class wxPlArtProvider
200 wxBitmap CreateBitmap( const wxArtID& id, const wxArtClient& client,
201 const wxSize& size );