Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / XS / App.xs
1 #############################################################################
2 ## Name:        XS/App.xs
3 ## Purpose:     XS for Wx::_App and Wx::App
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     29/10/2000
7 ## RCS-ID:      $Id: App.xs 2303 2007-12-24 17:25:05Z mbarbon $
8 ## Copyright:   (c) 2000-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 #############################################################################
12
13 #include <wx/app.h>
14 ##include "cpp/app.h"
15
16 #include <wx/artprov.h>
17
18 MODULE=Wx PACKAGE=Wx PREFIX=wx
19
20 void
21 wxPostEvent( evthnd, event )
22     wxEvtHandler* evthnd
23     wxEvent* event
24   CODE:
25     wxPostEvent( evthnd, *event );
26
27 void
28 wxWakeUpIdle()
29
30 MODULE=Wx PACKAGE=Wx::_App
31
32 int
33 Start( app, sub )
34     wxApp* app 
35     SV* sub
36   CODE:
37     // for Wx::Perl::SplashFast
38     if( !SvROK( sub ) || SvTYPE( SvRV( sub ) ) != SVt_PVCV )
39       croak( "sub must be a CODE reference" );
40 #if WXPERL_W_VERSION_LE( 2, 5, 1 )
41     app->argc = wxPli_get_args_argc_argv( (void***) &app->argv, 1 );
42 #endif
43 #ifdef __WXMOTIF__
44     app->SetClassName( app->argv[0] );
45     app->SetAppName( app->argv[0] );
46 #endif
47 #if WXPERL_W_VERSION_LE( 2, 5, 0 )
48     if( !wxPerlAppCreated )
49         wxEntryInitGui();
50 #endif
51
52     PUTBACK;
53     RETVAL = call_oninit( aTHX_ ST(0), sub );
54     SPAGAIN;
55   OUTPUT:
56     RETVAL
57
58 wxApp*
59 wxApp::new()
60   CODE:
61     if( !wxTheApp )
62 #if WXPERL_W_VERSION_LT( 2, 5, 1 )
63         wxTheApp = new wxPliApp();
64 #else
65         wxAppConsole::SetInstance( new wxPliApp() );
66 #endif
67     RETVAL = wxTheApp;
68   OUTPUT:
69     RETVAL
70
71 MODULE=Wx PACKAGE=Wx::App
72
73 # unimplemented
74 # virtual void OnFatalException() # too low level
75
76 void
77 wxApp::Dispatch()
78
79 wxString
80 wxApp::GetAppName()
81
82 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
83
84 wxString
85 wxApp::GetAppDisplayName()
86
87 #endif
88
89 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 1 )
90
91 bool
92 wxApp::GetAuto3D()
93
94 #endif
95
96 wxString
97 wxApp::GetClassName()
98
99 bool
100 wxApp::GetExitOnFrameDelete()
101
102 wxIcon*
103 wxApp::GetStdIcon( which )
104     int which
105   CODE:
106     wxString id;
107     switch( which )
108     {
109     case wxICON_EXCLAMATION:
110         id = wxART_WARNING;
111         break;
112     case wxICON_HAND:
113         id = wxART_ERROR; 
114         break;
115     case wxICON_QUESTION:
116         id = wxART_QUESTION;
117         break;
118     case wxICON_INFORMATION:
119         id = wxART_INFORMATION;
120         break;
121     };
122
123     RETVAL = new wxIcon( wxArtProvider::GetIcon( id, wxART_MESSAGE_BOX ) );
124   OUTPUT:
125     RETVAL
126
127 wxWindow*
128 wxApp::GetTopWindow()
129
130 bool
131 wxApp::GetUseBestVisual()
132
133 wxString
134 wxApp::GetVendorName()
135
136 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
137
138 wxString
139 wxApp::GetVendorDisplayName()
140
141 #endif
142
143 void
144 wxApp::ExitMainLoop()
145
146 #if WXPERL_W_VERSION_LT( 2, 7, 0 )
147
148 bool
149 wxApp::Initialized()
150
151 #endif
152
153 int
154 wxApp::MainLoop()
155   CODE:
156     RETVAL = THIS->MainLoop();
157     // hack for embedded case...
158 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 0 )
159     wxPliApp::SetKeepGoing( (wxPliApp*) THIS, true );
160 #endif
161     wxPliApp::DeletePendingObjects( THIS );
162   OUTPUT: RETVAL
163
164 bool
165 wxApp::Pending()
166
167 void
168 wxApp::ProcessPendingEvents()
169
170 void
171 wxApp::SetAppName( name )
172     wxString name
173
174 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
175
176 void
177 wxApp::SetAppDisplayName( name )
178     wxString name
179
180 #endif
181
182 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 0 )
183
184 void
185 wxApp::SetAuto3D( auto3d )
186     bool auto3d
187
188 #endif
189
190 void
191 wxApp::SetClassName( name )
192     wxString name
193
194 void
195 wxApp::SetExitOnFrameDelete( flag )
196     bool flag
197
198 void
199 wxApp::SetTopWindow( window )
200     wxWindow* window
201
202 void
203 wxApp::SetVendorName( name )
204     wxString name
205
206 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
207
208 void
209 wxApp::SetVendorDisplayName( name )
210     wxString name
211
212 #endif
213
214 void
215 wxApp::SetUseBestVisual( flag )
216     bool flag
217
218 void
219 wxApp::Yield()
220   CODE:
221     THIS->wxApp::Yield();
222
223 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_GE( 2, 5, 0 )
224
225 int
226 GetComCtl32Version()
227   CODE:
228     RETVAL = wxApp::GetComCtl32Version();
229   OUTPUT:
230     RETVAL
231
232 #endif
233
234 #if WXPERL_W_VERSION_GE( 2, 5, 2 )
235
236 void
237 wxApp::Exit()
238
239 bool
240 wxApp::ProcessIdle()
241
242 bool
243 wxApp::SendIdleEvents( window, event )
244     wxWindow* window
245     wxIdleEvent* event
246   C_ARGS: window, *event
247
248 bool
249 wxApp::IsActive()
250
251 #endif
252
253 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
254
255 wxLayoutDirection
256 wxApp::GetLayoutDirection()
257
258 #endif
259
260 wxApp*
261 GetInstance()
262   CODE:
263     RETVAL = (wxApp*)wxApp::GetInstance();
264   OUTPUT: RETVAL
265
266 void
267 SetInstance( app )
268     wxApp* app
269   CODE:
270     wxApp::SetInstance( app );
271
272 bool
273 wxApp::IsMainLoopRunning()