1 #############################################################################
3 ## Purpose: XS for some utility classes
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Utils.xs 2315 2008-01-18 21:47:17Z mbarbon $
8 ## Copyright: (c) 2001-2003, 2005-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 #############################################################################
13 #include <wx/busyinfo.h>
14 #include <wx/settings.h>
16 #include <wx/snglinst.h>
17 #include <wx/splash.h>
20 #include <wx/tipdlg.h>
21 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
22 #include <wx/sysopt.h>
24 #if WXPERL_W_VERSION_GE( 2, 5, 3 )
26 #define __WXGTK20__DEFINED
29 #include <wx/stockitem.h>
30 #ifdef __WXGTK20__DEFINED
34 #include "cpp/tipprovider.h"
36 MODULE=Wx PACKAGE=Wx::CaretSuspend
39 wxCaretSuspend::new( window )
43 wxCaretSuspend::CLONE()
45 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
49 wxCaretSuspend::DESTROY()
51 wxPli_thread_sv_unregister( aTHX_ "Wx::CaretSuspend", THIS, ST(0) );
54 MODULE=Wx PACKAGE=Wx::SplashScreen
56 #ifndef wxFRAME_FLOAT_ON_PARENT
57 #define wxFRAME_FLOAT_ON_PARENT 0
60 #ifndef wxFRAME_TOOL_WINDOW
61 #define wxFRAME_TOOL_WINDOW 0
65 wxSplashScreen::new( bitmap, splashStyle, milliseconds, parent, id = wxID_ANY, pos = wxDefaultPosition, size = wxDefaultSize, style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP )
75 RETVAL = new wxSplashScreen( *bitmap, splashStyle, milliseconds, parent,
76 id, pos, size, style );
81 wxSplashScreen::GetSplashStyle()
84 wxSplashScreen::GetSplashWindow()
87 wxSplashScreen::GetTimeout()
89 MODULE=Wx PACKAGE=Wx::WindowDisabler
92 wxWindowDisabler::new( skip = 0 )
96 wxWindowDisabler::CLONE()
98 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
102 wxWindowDisabler::DESTROY()
104 wxPli_thread_sv_unregister( aTHX_ "Wx::WindowDisabler", THIS, ST(0) );
107 MODULE=Wx PACKAGE=Wx::BusyCursor
109 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
112 wxBusyCursor::new( cursor = wxHOURGLASS_CURSOR )
113 const wxCursor* cursor
118 wxBusyCursor::new( cursor = wxHOURGLASS_CURSOR )
124 wxBusyCursor::CLONE()
126 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
130 wxBusyCursor::DESTROY()
132 wxPli_thread_sv_unregister( aTHX_ "Wx::BusyCursor", THIS, ST(0) );
135 MODULE=Wx PACKAGE=Wx::BusyInfo
138 wxBusyInfo::new( message )
144 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
148 wxBusyInfo::DESTROY()
150 wxPli_thread_sv_unregister( aTHX_ "Wx::BusyInfo", THIS, ST(0) );
153 MODULE=Wx PACKAGE=Wx::StopWatch
165 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
169 wxStopWatch::DESTROY()
171 wxPli_thread_sv_unregister( aTHX_ "Wx::StopWatch", THIS, ST(0) );
178 wxStopWatch::Start( milliseconds = 0 )
182 wxStopWatch::Resume()
187 MODULE=Wx PACKAGE=Wx::SingleInstanceChecker
189 #if wxUSE_SNGLINST_CHECKER
191 wxSingleInstanceChecker*
192 wxSingleInstanceChecker::new()
195 wxSingleInstanceChecker::CLONE()
197 wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
201 wxSingleInstanceChecker::DESTROY()
203 wxPli_thread_sv_unregister( aTHX_ "Wx::SingleInstanceChecker", THIS, ST(0) );
207 wxSingleInstanceChecker::Create( name, path = wxEmptyString )
212 wxSingleInstanceChecker::IsAnotherRunning()
216 #if WXPERL_W_VERSION_GE( 2, 8, 0 )
218 MODULE=Wx PACKAGE=Wx::SystemOptions
220 #define wxSystemOptions_SetOption wxSystemOptions::SetOption
221 #define wxSystemOptions_GetOption wxSystemOptions::GetOption
222 #define wxSystemOptions_GetOptionInt wxSystemOptions::GetOptionInt
223 #define wxSystemOptions_HasOption wxSystemOptions::HasOption
224 #define wxSystemOptions_IsFalse wxSystemOptions::IsFalse
227 SetOption( name, value )
231 wxSystemOptions_SetOption( name, value);
234 SetOptionInt( name, value )
238 wxSystemOptions_SetOption( name, value);
244 RETVAL = wxSystemOptions_GetOption( name );
251 RETVAL = wxSystemOptions_GetOptionInt( name );
258 RETVAL = wxSystemOptions_HasOption( name );
265 RETVAL = wxSystemOptions_IsFalse( name );
270 MODULE=Wx PACKAGE=Wx::SystemSettings
272 #if WXPERL_W_VERSION_GE( 2, 5, 2 )
273 #define wxSystemSettings_GetSystemColour wxSystemSettings::GetColour
274 #define wxSystemSettings_GetSystemFont wxSystemSettings::GetFont
275 #define wxSystemSettings_GetSystemMetric wxSystemSettings::GetMetric
277 #define wxSystemSettings_GetSystemColour wxSystemSettings::GetSystemColour
278 #define wxSystemSettings_GetSystemFont wxSystemSettings::GetSystemFont
279 #define wxSystemSettings_GetSystemMetric wxSystemSettings::GetSystemMetric
286 RETVAL = new wxColour( wxSystemSettings_GetSystemColour( index ) );
290 GetSystemColour( index )
293 RETVAL = new wxColour( wxSystemSettings_GetSystemColour( index ) );
300 RETVAL = new wxFont( wxSystemSettings_GetSystemFont( index ) );
304 GetSystemFont( index )
307 RETVAL = new wxFont( wxSystemSettings_GetSystemFont( index ) );
314 RETVAL = wxSystemSettings_GetSystemMetric( index );
318 GetSystemMetric( index )
321 RETVAL = wxSystemSettings_GetSystemMetric( index );
327 RETVAL = wxSystemSettings::GetScreenType();
330 MODULE=Wx PACKAGE=Wx::TipProvider
333 wxTipProvider::new( currentTip )
336 RETVAL = new wxPliTipProvider( CLASS, currentTip );
341 wxTipProvider::Destroy()
346 wxTipProvider::GetCurrentTip()
349 wxTipProvider::GetTip()
352 wxTipProvider::PreprocessTip( tip )
356 wxTipProvider::SetCurrentTip( number )
359 ((wxPliTipProvider*)THIS)->SetCurrentTip( number );
361 MODULE=Wx PACKAGE=Wx::Thread
365 #include <wx/thread.h>
370 RETVAL = wxThread::IsMain();
376 MODULE=Wx PACKAGE=Wx PREFIX=wx
378 #if WXPERL_W_VERSION_GE( 2, 5, 3 )
381 wxIsStockID( wxWindowID id )
384 wxIsStockLabel( wxWindowID id, wxString label )
386 #if WXPERL_W_VERSION_GE( 2, 6, 3 )
388 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
391 wxGetStockLabel( wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC )
396 wxGetStockLabel( wxWindowID id, bool withCodes = true, wxString accelerator = wxEmptyString )
403 wxGetStockLabel( wxWindowID id )
409 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
412 wxGetStockAccelerator( wxWindowID id )
414 RETVAL = new wxAcceleratorEntry( wxGetStockAccelerator( id ) );
418 wxGetStockHelpString( wxWindowID id, wxStockHelpStringClient client = wxSTOCK_MENU )
422 #if WXPERL_W_VERSION_GE( 2, 7, 0 )
425 wxLaunchDefaultBrowser( url, flags = 0 )
430 #if WXPERL_W_VERSION_GE( 2, 6, 1 )
433 wxLaunchDefaultBrowser( url )
440 wxShowTip( parent, tipProvider, showAtStartup = true )
442 wxTipProvider* tipProvider
446 wxCreateFileTipProvider( filename, currentTip )
454 #if WXPERL_W_VERSION_LE( 2, 5, 2 )
460 #if WXPERL_W_VERSION_GE( 2, 5, 3 )
472 #if WXPERL_W_VERSION_LE( 2, 5, 2 )
486 wxSafeYield( window = 0, onlyIfNeeded = false )
516 wxShell( command = wxEmptyString )
519 #if WXPERL_W_VERSION_GE( 2, 6, 0 )