2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2008-03-08 14:43:31 +00:00
|
|
|
// Name: init.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of global functions
|
2008-03-08 14:43:31 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-12-12 15:56:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxInitializer
|
|
|
|
|
|
|
|
Create an object of this class on the stack to initialize/cleanup the library
|
|
|
|
automatically.
|
|
|
|
|
2008-12-12 16:10:08 +00:00
|
|
|
@library{wxbase}
|
2008-12-12 15:56:19 +00: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 20:48:06 +00:00
|
|
|
/** @addtogroup group_funcmacro_appinitterm */
|
2008-03-18 01:34:57 +00:00
|
|
|
//@{
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
/**
|
2008-03-18 01:34:57 +00: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 13:52:38 +00:00
|
|
|
|
2008-03-18 01:34:57 +00: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
|
|
|
|
initialization error occured and (at least the GUI part of) the library
|
|
|
|
can't be used at all.
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2008-03-18 01:34:57 +00:00
|
|
|
Notice that parameters @c argc and @c argv may be modified by this
|
|
|
|
function.
|
2008-03-18 01:39:37 +00:00
|
|
|
|
|
|
|
@header{wx/init.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
bool wxEntryStart(int& argc, wxChar** argv);
|
2008-03-18 01:34:57 +00: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-18 01:39:37 +00:00
|
|
|
|
2008-12-12 15:56:19 +00:00
|
|
|
@onlyfor{wxmsw}
|
|
|
|
|
2008-03-18 01:39:37 +00:00
|
|
|
@header{wx/init.h}
|
2008-03-18 01:34:57 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
bool wxEntryStart(HINSTANCE hInstance,
|
2008-03-09 12:33:59 +00:00
|
|
|
HINSTANCE hPrevInstance = NULL,
|
|
|
|
char* pCmdLine = NULL,
|
2008-03-08 14:43:31 +00:00
|
|
|
int nCmdShow = SW_SHOWNORMAL);
|
2008-03-18 01:34:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Free resources allocated by a successful call to wxEntryStart().
|
2008-03-18 01:39:37 +00:00
|
|
|
|
|
|
|
@header{wx/init.h}
|
2008-03-18 01:34:57 +00:00
|
|
|
*/
|
|
|
|
void wxEntryCleanup();
|
|
|
|
|
2008-12-12 15:56:19 +00:00
|
|
|
/**
|
|
|
|
Initialize the library (may be called as many times as needed, but each
|
|
|
|
call to wxInitialize() must be matched by wxUninitialize()).
|
|
|
|
|
|
|
|
With this function you may avoid DECLARE_APP() and IMPLEMENT_APP() macros
|
|
|
|
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 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|