1 #############################################################################
2 ## Name: XS/Display.xsp
3 ## Purpose: XS++ for Wx::Display
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Display.xsp 2557 2009-05-11 10:41:11Z mbarbon $
8 ## Copyright: (c) 2007, 2009 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 #include <wx/vidmode.h>
16 #include <wx/display.h>
18 #define wxDefaultVideoModePtr (wxVideoMode*)&wxDefaultVideoMode
20 %typemap{wxDisplay*}{simple};
21 %typemap{wxVideoMode*}{simple};
22 %typemap{const wxVideoMode&}{reference};
24 %name{Wx::VideoMode} class wxVideoMode
26 wxVideoMode( int width = 0, int height = 0, int depth = 0, int freq = 0 );
32 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
36 %code%{ wxPli_thread_sv_unregister( aTHX_ "Wx::VideoMode", THIS, ST(0) );
40 bool Matches( const wxVideoMode& other ) const;
42 int GetHeight() const;
47 %name{Wx::Display} class wxDisplay
49 wxDisplay( unsigned n = 0 );
55 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
59 %code%{ wxPli_thread_sv_unregister( aTHX_ "Wx::Display", THIS, ST(0) );
67 RETVAL = wxDisplay::GetCount();
74 RETVAL = wxDisplay::GetFromPoint( point );
77 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
80 GetFromWindow( window )
83 RETVAL = wxDisplay::GetFromWindow( window );
91 const wxRect& GetGeometry() const;
92 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
93 const wxRect& GetClientArea() const;
95 wxString GetName() const;
96 bool IsPrimary() const;
101 wxDisplay::GetModes( videoMode = wxDefaultVideoModePtr )
102 wxVideoMode* videoMode
104 wxArrayVideoModes modes = THIS->GetModes( *videoMode );
105 size_t mx = modes.GetCount();
106 EXTEND( SP, int(mx) );
107 for( size_t i = 0; i < mx; ++i )
109 wxVideoMode* mode = new wxVideoMode( modes[i] );
110 PUSHs( wxPli_non_object_2_sv( aTHX_ sv_newmortal(),
111 mode, "Wx::VideoMode" ) );
114 const wxVideoMode& GetCurrentMode() const;
115 bool ChangeMode( const wxVideoMode& mode = wxDefaultVideoModePtr );
117 #endif // wxUSE_DISPLAY