X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c31ad41d80a54677b6a3100b77b9747f6bad7d65..81c9effa8462662263c3b4eac2cfae1ef5caae2c:/src/common/appcmn.cpp diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 49c21fe469..314a7654eb 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -40,6 +40,12 @@ #include "wx/cmdline.h" #include "wx/thread.h" #include "wx/confbase.h" +#include "wx/tokenzr.h" +#include "wx/utils.h" + +#if wxUSE_GUI + #include "wx/artprov.h" +#endif // wxUSE_GUI #if !defined(__WXMSW__) || defined(__WXMICROWIN__) #include // for SIGTRAP used by wxTrap() @@ -49,6 +55,10 @@ #include "wx/msw/private.h" // includes windows.h for MessageBox() #endif +#if defined(__WXMAC__) + #include "wx/mac/private.h" // includes mac headers +#endif + // =========================================================================== // implementation // =========================================================================== @@ -57,12 +67,26 @@ // initialization and termination // ---------------------------------------------------------------------------- +#ifdef __WXDEBUG__ +static void LINKAGEMODE SetTraceMasks() +{ + wxString mask; + if ( wxGetEnv(wxT("WXTRACE"), &mask) ) + { + wxStringTokenizer tkn(mask, wxT(",")); + while ( tkn.HasMoreTokens() ) + wxLog::AddTraceMask(tkn.GetNextToken()); + } +} +#endif + wxAppBase::wxAppBase() { wxTheApp = (wxApp *)this; - // VZ: what's this? is it obsolete? +#if WXWIN_COMPATIBILITY_2_2 m_wantDebugOutput = FALSE; +#endif // WXWIN_COMPATIBILITY_2_2 #if wxUSE_GUI m_topWindow = (wxWindow *)NULL; @@ -70,6 +94,15 @@ wxAppBase::wxAppBase() m_exitOnFrameDelete = TRUE; m_isActive = TRUE; #endif // wxUSE_GUI + +#ifdef __WXDEBUG__ + SetTraceMasks(); +#endif +} + +wxAppBase::~wxAppBase() +{ + // this destructor is required for Darwin } #if wxUSE_GUI @@ -78,6 +111,9 @@ bool wxAppBase::OnInitGui() #ifdef __WXUNIVERSAL__ if ( !wxTheme::Get() && !wxTheme::CreateDefault() ) return FALSE; + wxArtProvider *art = wxTheme::Get()->GetArtProvider(); + if ( art ) + wxArtProvider::PushProvider(art); #endif // __WXUNIVERSAL__ return TRUE; @@ -166,7 +202,7 @@ bool wxAppBase::OnInit() OnInitCmdLine(parser); bool cont; - switch ( parser.Parse() ) + switch ( parser.Parse(FALSE /* don't show usage */) ) { case -1: cont = OnCmdLineHelp(parser); @@ -284,10 +320,10 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) return FALSE; } - if ( !SetDisplayMode(wxDisplayModeInfo(wxSize(w, h), bpp)) ) + if ( !SetDisplayMode(wxDisplayModeInfo(w, h, bpp)) ) return FALSE; } -#endif +#endif // __WXMGL__ return TRUE; }