1 #############################################################################
3 ## Purpose: XS for Wx::Icon
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Icon.xs 2517 2008-11-30 20:14:22Z mbarbon $
8 ## Copyright: (c) 2000-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 #############################################################################
17 #if !defined( __WXMSW__ )
22 GetWxPerlIcon( get_small = false )
25 #if defined( __WXMSW__ )
26 int sz = get_small ? 16 : 32;
27 RETVAL = new wxIcon( wxT("wxplicon"), wxBITMAP_TYPE_ICO_RESOURCE, -1, -1 );
29 croak( "Unable to load icon" );
31 char** image = (char**)( get_small ? wxpl16_xpm : wxpl32_xpm );
32 RETVAL = new wxIcon( image );
37 MODULE=Wx PACKAGE=Wx::Icon
39 ## DECLARE_OVERLOAD( wilo, Wx::IconLocation )
45 MATCH_VOIDM_REDISP( newNull )
46 MATCH_REDISP( wxPliOvl_wilo, newLocation )
47 MATCH_REDISP_COUNT_ALLOWMORE( wxPliOvl_s_n_n_n, newFile, 2 )
48 END_OVERLOAD( Wx::Icon::new )
54 RETVAL = new wxIcon();
59 newFile( CLASS, name, type, desW = -1, desH = -1 )
66 #if defined( __WXMOTIF__ ) || defined( __WXX11__ ) || defined( __WXGTK__ ) \
67 || WXPERL_W_VERSION_GE( 2, 9, 0 )
68 RETVAL = new wxIcon( name, wxBitmapType(type), desW, desH );
70 RETVAL = new wxIcon( name, type, desW, desH );
75 #if defined( __WXGTK__ ) || defined( __WXPERL_FORCE__ )
78 ##newFromBits( bits, width, height, depth = 1 )
84 ## void* buffer = SvPV_nolen( bits );
86 ## RETVAL = new wxIcon( buffer, width, height, depth );
93 newFromXPM( CLASS, data )
98 size_t i, n = wxPli_av_2_charparray( aTHX_ data, &xpm_data );
100 RETVAL = new wxIcon( xpm_data );
101 for( i = 0; i < n; ++i )
106 #if WXPERL_W_VERSION_GE( 2, 5, 2 )
109 newLocation( CLASS, location )
111 wxIconLocation* location
113 RETVAL = new wxIcon( *location );
121 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
127 wxPli_thread_sv_unregister( aTHX_ "Wx::Icon", THIS, ST(0) );
131 wxIcon::LoadFile( name, type )
135 #if defined( __WXMOTIF__ )
136 #if WXPERL_W_VERSION_GE( 2, 5, 1 )
137 RETVAL = THIS->LoadFile( name, wxBitmapType(type), -1, -1 );
139 RETVAL = THIS->LoadFile( name, type, -1, -1 );
142 #if defined( __WXX11__ ) || defined( __WXMAC__ ) || defined( __WXGTK__ ) \
143 || ( defined(__WXMSW__) && WXPERL_W_VERSION_GE( 2, 9, 0 ) )
144 RETVAL = THIS->LoadFile( name, wxBitmapType(type) );
146 RETVAL = THIS->LoadFile( name, type );
155 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
163 wxIcon::CopyFromBitmap( bitmap )
167 #if defined( __WXMSW__ ) || defined( __WXPERL_FORCE__ )
179 wxIcon::SetDepth( depth )
183 wxIcon::SetHeight( height )
187 wxIcon::SetWidth( width )