Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / dnd / XS / DropFiles.xs
1 #############################################################################
2 ## Name:        ext/dnd/XS/DropFiles.xs
3 ## Purpose:     XS for Wx::DropFilesEvent
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     15/08/2001
7 ## RCS-ID:      $Id: DropFiles.xs 2057 2007-06-18 23:03:00Z mbarbon $
8 ## Copyright:   (c) 2001, 2004 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 #include <wx/event.h>
14
15 MODULE=wxEvt PACKAGE=Wx::DropFilesEvent
16
17 void
18 wxDropFilesEvent::GetFiles()
19   PPCODE:
20     wxString* files = THIS->GetFiles();
21     int i, max = THIS->GetNumberOfFiles();
22     EXTEND( SP, max );
23     for( i = 0; i < max; ++i )
24     {
25 #if wxUSE_UNICODE
26       SV* tmp = sv_2mortal( newSVpv( CHAR_P files[i].mb_str(wxConvUTF8), 0 ) );
27       SvUTF8_on( tmp );
28       PUSHs( tmp );
29 #else
30       PUSHs( sv_2mortal( newSVpv( CHAR_P files[i].c_str(), 0 ) ) );
31 #endif
32     }
33
34 int
35 wxDropFilesEvent::GetNumberOfFiles()
36
37 wxPoint*
38 wxDropFilesEvent::GetPosition()
39   CODE:
40     RETVAL = new wxPoint( THIS->GetPosition() );
41   OUTPUT:
42     RETVAL
43