1 #############################################################################
2 ## Name: XS/Accelerators.xs
3 ## Purpose: XS for Wx::AcceleratorTable, Wx::AcceleratorEntry
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Accelerators.xs 2057 2007-06-18 23:03:00Z mbarbon $
8 ## Copyright: (c) 2001-2002, 2004, 2006-2007 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 #############################################################################
15 MODULE=Wx PACKAGE=Wx::AcceleratorEntry
18 wxAcceleratorEntry::new( flags, code, cmd )
23 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
29 RETVAL = wxAcceleratorEntry::Create( str );
35 wxAcceleratorEntry::CLONE()
37 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
41 wxAcceleratorEntry::DESTROY()
43 wxPli_thread_sv_unregister( aTHX_ "Wx::AcceleratorEntry", THIS, ST(0) );
47 wxAcceleratorEntry::GetCommand()
50 wxAcceleratorEntry::GetFlags()
54 wxAcceleratorEntry::GetKeyCode()
57 wxAcceleratorEntry::Set( flags, code, cmd )
62 MODULE=Wx PACKAGE=Wx::AcceleratorTable
65 wxAcceleratorTable::new( ... )
69 RETVAL = new wxAcceleratorTable;
74 wxAcceleratorEntry* entries = new wxAcceleratorEntry[ num ];
76 for( int i = 0; i < num; ++i )
82 if( sv_derived_from( rv, CHAR_P "Wx::AcceleratorEntry" ) )
84 entries[i] = *(wxAcceleratorEntry*)
85 wxPli_sv_2_object( aTHX_ rv,
86 "Wx::AcceleratorEntry" );
88 else if( SvTYPE( SvRV( rv ) ) == SVt_PVAV )
90 AV* av = (AV*) SvRV( rv );
91 I32 len = av_len( av ) + 1;
96 croak( "the %d-th value does not have three"
100 entries[i].Set( SvIV( *av_fetch( av, 0, 0 ) ),
101 wxPli_sv_2_keycode( aTHX_
102 *av_fetch( av, 1, 0 ) ),
103 SvIV( *av_fetch( av, 2, 0 ) ) );
108 croak( "the %d-th value is not an object"
109 " or array reference", i + 1 );
115 croak( "the %d-th value is not an object"
116 " or array reference", i + 1 );
120 RETVAL = new wxAcceleratorTable( num, entries );
127 wxAcceleratorTable::CLONE()
129 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
133 wxAcceleratorTable::DESTROY()
135 wxPli_thread_sv_unregister( aTHX_ "Wx::AcceleratorTable", THIS, ST(0) );
139 wxAcceleratorTable::Ok()
141 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
144 wxAcceleratorTable::IsOk()