X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9482617091b084d4ee006679a450176715d465e0..682214d5c6ec3e56dbdfd0c97d70d87e614b38c2:/include/wx/init.h?ds=sidebyside diff --git a/include/wx/init.h b/include/wx/init.h index f973e9b0f3..7cdcda57f8 100644 --- a/include/wx/init.h +++ b/include/wx/init.h @@ -1,11 +1,11 @@ /////////////////////////////////////////////////////////////////////////////// // 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 /////////////////////////////////////////////////////////////////////////////// @@ -19,17 +19,18 @@ // ---------------------------------------------------------------------------- // 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 // -// note that the parameters may be modified -extern bool WXDLLEXPORT wxEntryStart(int argc, wxChar **argv); +// note that the parameters may be modified, this is why we pass them by +// reference! +extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, wxChar **argv); // free the resources allocated by the library in wxEntryStart() and shut it // down (wxEntryStart() may be called again afterwards if necessary) -extern void WXDLLEXPORT wxEntryCleanup(); +extern void WXDLLIMPEXP_BASE wxEntryCleanup(); // ---------------------------------------------------------------------------- @@ -41,8 +42,15 @@ extern void WXDLLEXPORT wxEntryCleanup(); // but this one always exists under all platforms // // returns the program exit code -extern int WXDLLEXPORT wxEntry(int argc, wxChar **argv); +extern int WXDLLIMPEXP_BASE wxEntry(int& argc, wxChar **argv); +// we overload wxEntry[Start]() to take "char **" pointers too +#if wxUSE_UNICODE + +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 @@ -52,19 +60,22 @@ extern int WXDLLEXPORT wxEntry(int argc, wxChar **argv); // initialize the library (may be called as many times as needed, but each // call to wxInitialize() must be matched by wxUninitialize()) -extern bool WXDLLEXPORT wxInitialize(int argc = 0, wxChar **argv = NULL); +extern bool WXDLLIMPEXP_BASE wxInitialize(int argc = 0, wxChar **argv = NULL); // clean up -- the library can't be used any more after the last call to // wxUninitialize() -extern void WXDLLEXPORT wxUninitialize(); +extern void WXDLLIMPEXP_BASE wxUninitialize(); // create an object of this class on stack to initialize/cleanup the library // automatically -class WXDLLEXPORT wxInitializer +class WXDLLIMPEXP_BASE wxInitializer { public: // initialize the library - wxInitializer() { m_ok = wxInitialize(); } + wxInitializer(int argc = 0, wxChar **argv = NULL) + { + m_ok = wxInitialize(argc, argv); + } // has the initialization been successful? (explicit test) bool IsOk() const { return m_ok; }