X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/910426ee7bbd9f5959b4d5d075b35f0e8e3b52a9..2bb1e1f47634c40bd4282962a2c5c40b618bc65b:/src/common/appbase.cpp?ds=sidebyside diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 40e4147114..c2528ec5c9 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -36,6 +36,9 @@ #include "wx/apptrait.h" #include "wx/cmdline.h" #include "wx/confbase.h" +#if wxUSE_FILENAME + #include "wx/filename.h" +#endif // wxUSE_FILENAME #if wxUSE_FONTMAP #include "wx/fontmap.h" #endif // wxUSE_FONTMAP @@ -51,8 +54,15 @@ #endif #if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif + // VZ: MacTypes.h is enough under Mac OS X (where I could test it) but + // I don't know which headers are needed under earlier systems so + // include everything when in doubt + #ifdef __DARWIN__ + #include "MacTypes.h" + #else + #include "wx/mac/private.h" // includes mac headers + #endif +#endif // __WXMAC__ // ---------------------------------------------------------------------------- // private functions prototypes @@ -107,6 +117,33 @@ wxAppConsole::~wxAppConsole() delete m_traits; } +// ---------------------------------------------------------------------------- +// initilization/cleanup +// ---------------------------------------------------------------------------- + +bool wxAppConsole::Initialize(int& argc, wxChar **argv) +{ + // remember the command line arguments + this->argc = argc; + this->argv = argv; + + if ( m_appName.empty() && argv ) + { + // the application name is, by default, the name of its executable file +#if wxUSE_FILENAME + wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL); +#else // !wxUSE_FILENAME + m_appName = argv[0]; +#endif // wxUSE_FILENAME/!wxUSE_FILENAME + } + + return true; +} + +void wxAppConsole::CleanUp() +{ +} + // ---------------------------------------------------------------------------- // OnXXX() callbacks // ---------------------------------------------------------------------------- @@ -171,7 +208,7 @@ void wxAppConsole::Exit() wxAppTraits *wxAppConsole::CreateTraits() { - return wxAppTraits::CreateConsole(); + return new wxConsoleAppTraits; } wxAppTraits *wxAppConsole::GetTraits() @@ -509,11 +546,6 @@ bool wxAppTraitsBase::ShowAssertDialog(const wxString& msg) #endif // __WXDEBUG__ -wxAppTraits *wxAppTraitsBase::CreateConsole() -{ - return new wxConsoleAppTraits; -} - // ============================================================================ // global functions implementation // ============================================================================