X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0acfb5bd66009d319f0d8e02c5d0d02460af200f..49a63afbad7646668df343d29edd88458bc7e0a9:/include/wx/init.h?ds=sidebyside diff --git a/include/wx/init.h b/include/wx/init.h index 72c93e471e..90304ef918 100644 --- a/include/wx/init.h +++ b/include/wx/init.h @@ -1,25 +1,26 @@ /////////////////////////////////////////////////////////////////////////////// // Name: wx/init.h -// Purpose: wxWindows initialization and finalization functions +// Purpose: wxWidgets initialization and finalization functions // Author: Vadim Zeitlin // Modified by: // Created: 29.06.2003 // RCS-ID: $Id$ -// Copyright: (c) 2003 Vadim Zeitlin +// Copyright: (c) 2003 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_INIT_H_ #define _WX_INIT_H_ -#include "wx/wxchar.h" +#include "wx/defs.h" +#include "wx/chartype.h" // ---------------------------------------------------------------------------- // wxEntry helper functions which allow to have more fine grained control // ---------------------------------------------------------------------------- // do common initialization, return true if ok (in this case wxEntryCleanup -// must be called later), otherwise the program can't use wxWindows at all +// must be called later), otherwise the program can't use wxWidgets at all // // this function also creates wxTheApp as a side effect, if IMPLEMENT_APP // hadn't been used a dummy default application object is created @@ -47,20 +48,24 @@ extern int WXDLLIMPEXP_BASE wxEntry(int& argc, wxChar **argv); // we overload wxEntry[Start]() to take "char **" pointers too #if wxUSE_UNICODE -extern bool wxEntryStart(int& argc, char **argv); -extern int wxEntry(int& argc, char **argv); +extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, char **argv); +extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv); #endif// wxUSE_UNICODE // ---------------------------------------------------------------------------- // Using the library without (explicit) application object: you may avoid using -// DECLARE_APP and IMPLEMENT_APP macros and call the functions below instead at +// wxDECLARE_APP and wxIMPLEMENT_APP macros and call the functions below instead at // the program startup and termination // ---------------------------------------------------------------------------- // initialize the library (may be called as many times as needed, but each // call to wxInitialize() must be matched by wxUninitialize()) -extern bool WXDLLIMPEXP_BASE wxInitialize(int argc = 0, wxChar **argv = NULL); +extern bool WXDLLIMPEXP_BASE wxInitialize(); +extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, wxChar **argv); +#if wxUSE_UNICODE +extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, char **argv); +#endif // clean up -- the library can't be used any more after the last call to // wxUninitialize() @@ -72,7 +77,22 @@ class WXDLLIMPEXP_BASE wxInitializer { public: // initialize the library - wxInitializer() { m_ok = wxInitialize(); } + wxInitializer() + { + m_ok = wxInitialize(); + } + + wxInitializer(int argc, wxChar **argv) + { + m_ok = wxInitialize(argc, argv); + } + +#if wxUSE_UNICODE + wxInitializer(int argc, char **argv) + { + m_ok = wxInitialize(argc, argv); + } +#endif // wxUSE_UNICODE // has the initialization been successful? (explicit test) bool IsOk() const { return m_ok; }