2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2008-03-08 09:43:31 -05:00
|
|
|
// Name: init.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of global functions
|
2008-03-08 09:43:31 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 09:43:31 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-12-12 10:56:19 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxInitializer
|
|
|
|
|
|
|
|
Create an object of this class on the stack to initialize/cleanup the library
|
|
|
|
automatically.
|
|
|
|
|
2008-12-12 11:10:08 -05:00
|
|
|
@library{wxbase}
|
2008-12-12 10:56:19 -05:00
|
|
|
@category{appmanagement}
|
|
|
|
|
|
|
|
@see wxGLContext
|
|
|
|
*/
|
|
|
|
class wxInitializer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Initializes the library.
|
|
|
|
Calls wxInitialize().
|
|
|
|
*/
|
|
|
|
wxInitializer(int argc = 0, wxChar **argv = NULL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Has the initialization been successful? (explicit test)
|
|
|
|
*/
|
|
|
|
bool IsOk() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
This dtor only does clean up if we initialized the library properly.
|
|
|
|
Calls wxUninitialize().
|
|
|
|
*/
|
|
|
|
~wxInitializer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-05 15:48:06 -05:00
|
|
|
/** @addtogroup group_funcmacro_appinitterm */
|
2008-03-17 21:34:57 -04:00
|
|
|
//@{
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
/**
|
2008-03-17 21:34:57 -04:00
|
|
|
This function can be used to perform the initialization of wxWidgets if you
|
|
|
|
can't use the default initialization code for any reason.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-17 21:34:57 -04:00
|
|
|
If the function returns true, the initialization was successful and the
|
|
|
|
global wxApp object ::wxTheApp has been created. Moreover, wxEntryCleanup()
|
|
|
|
must be called afterwards. If the function returns false, a catastrophic
|
2012-02-23 08:56:10 -05:00
|
|
|
initialization error occurred and (at least the GUI part of) the library
|
2008-03-17 21:34:57 -04:00
|
|
|
can't be used at all.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-17 21:34:57 -04:00
|
|
|
Notice that parameters @c argc and @c argv may be modified by this
|
|
|
|
function.
|
2008-03-17 21:39:37 -04:00
|
|
|
|
|
|
|
@header{wx/init.h}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool wxEntryStart(int& argc, wxChar** argv);
|
2008-03-17 21:34:57 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
See wxEntryStart(int&,wxChar**) for more info about this function.
|
|
|
|
|
|
|
|
This is an additional overload of wxEntryStart() provided under MSW only.
|
|
|
|
It is meant to be called with the parameters passed to WinMain().
|
|
|
|
|
|
|
|
@note Under Windows CE platform, and only there, the type of @a pCmdLine is
|
|
|
|
@c wchar_t *, otherwise it is @c char *, even in Unicode build.
|
2008-03-17 21:39:37 -04:00
|
|
|
|
2008-12-12 10:56:19 -05:00
|
|
|
@onlyfor{wxmsw}
|
|
|
|
|
2008-03-17 21:39:37 -04:00
|
|
|
@header{wx/init.h}
|
2008-03-17 21:34:57 -04:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
bool wxEntryStart(HINSTANCE hInstance,
|
2008-03-09 08:33:59 -04:00
|
|
|
HINSTANCE hPrevInstance = NULL,
|
|
|
|
char* pCmdLine = NULL,
|
2008-03-08 09:43:31 -05:00
|
|
|
int nCmdShow = SW_SHOWNORMAL);
|
2008-03-17 21:34:57 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Free resources allocated by a successful call to wxEntryStart().
|
2008-03-17 21:39:37 -04:00
|
|
|
|
|
|
|
@header{wx/init.h}
|
2008-03-17 21:34:57 -04:00
|
|
|
*/
|
|
|
|
void wxEntryCleanup();
|
|
|
|
|
2008-12-12 10:56:19 -05:00
|
|
|
/**
|
|
|
|
Initialize the library (may be called as many times as needed, but each
|
|
|
|
call to wxInitialize() must be matched by wxUninitialize()).
|
|
|
|
|
2010-06-09 09:23:13 -04:00
|
|
|
With this function you may avoid wxDECLARE_APP() and wxIMPLEMENT_APP() macros
|
2008-12-12 10:56:19 -05:00
|
|
|
and use wxInitialize() and wxUninitialize() dynamically in the
|
|
|
|
program startup and termination.
|
|
|
|
|
|
|
|
@header{wx/init.h}
|
|
|
|
*/
|
|
|
|
bool wxInitialize(int argc = 0, wxChar **argv = NULL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Clean up; the library can't be used any more after the last call to
|
|
|
|
wxUninitialize().
|
|
|
|
|
|
|
|
See wxInitialize() for more info.
|
|
|
|
|
|
|
|
@header{wx/init.h}
|
|
|
|
*/
|
|
|
|
void wxUninitialize();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|