Finished review of Application Initialization and Termination category of functions and macros.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2008-03-18 01:34:57 +00:00
parent 9215c73eaf
commit 8cd06fb5a2
3 changed files with 67 additions and 32 deletions

View File

@@ -608,14 +608,6 @@ public:
// Global functions/macros // Global functions/macros
// ============================================================================ // ============================================================================
/**
The global pointer to the singleton wxApp object.
@see wxApp::GetInstance()
*/
wxApp *wxTheApp;
/** @ingroup group_funcmacro_rtti */ /** @ingroup group_funcmacro_rtti */
//@{ //@{
@@ -656,41 +648,49 @@ wxApp *wxTheApp;
/**
The global pointer to the singleton wxApp object.
@see wxApp::GetInstance()
*/
wxApp *wxTheApp;
/** @ingroup group_funcmacro_appinitterm */ /** @ingroup group_funcmacro_appinitterm */
//@{ //@{
/** /**
This function doesn't exist in wxWidgets but it is created by using This function doesn't exist in wxWidgets but it is created by using the
the IMPLEMENT_APP() macro. IMPLEMENT_APP() macro.
Thus, before using it anywhere but in the same module where this macro is Thus, before using it anywhere but in the same module where this macro is
used, you must make it available using DECLARE_APP(). used, you must make it available using DECLARE_APP().
The advantage of using this function compared to directly using the global The advantage of using this function compared to directly using the global
wxTheApp pointer is that the latter is of type wxApp* and so wouldn't ::wxTheApp pointer is that the latter is of type wxApp* and so wouldn't
allow you to access the functions specific to your application class but not allow you to access the functions specific to your application class but
present in wxApp while wxGetApp() returns the object of the right type. not present in wxApp while wxGetApp() returns the object of the right type.
*/ */
wxAppDerivedClass wxGetApp(); wxAppDerivedClass& wxGetApp();
/** /**
If @a doIt is @true, the fatal exceptions (also known as general protection If @a doIt is @true, the fatal exceptions (also known as general protection
faults under Windows or segmentation violations in the Unix world) will be faults under Windows or segmentation violations in the Unix world) will be
caught and passed to wxApp::OnFatalException. caught and passed to wxApp::OnFatalException.
By default, i.e. before this function is called, they will be handled in the By default, i.e. before this function is called, they will be handled in
normal way which usually just means that the application will be terminated. the normal way which usually just means that the application will be
Calling wxHandleFatalExceptions() with @a doIt equal to @false will restore terminated. Calling wxHandleFatalExceptions() with @a doIt equal to @false
this default behaviour. will restore this default behaviour.
Notice that this function is only available if @c wxUSE_ON_FATAL_EXCEPTION is 1 Notice that this function is only available if @c wxUSE_ON_FATAL_EXCEPTION
and under Windows platform this requires a compiler with support for SEH is 1 and under Windows platform this requires a compiler with support for
(structured exception handling) which currently means only Microsoft Visual C++ SEH (structured exception handling) which currently means only Microsoft
or a recent Borland C++ version. Visual C++ or a recent Borland C++ version.
*/ */
bool wxHandleFatalExceptions(bool doIt = true); bool wxHandleFatalExceptions(bool doIt = true);
/** /**
This function is used in wxBase only and only if you don't create This function is used in wxBase only and only if you don't create
wxApp object at all. In this case you must call it from your wxApp object at all. In this case you must call it from your
@@ -711,6 +711,16 @@ bool wxInitialize();
*/ */
void wxUninitialize(); void wxUninitialize();
/**
This function wakes up the (internal and platform dependent) idle system,
i.e. it will force the system to send an idle event even if the system
currently @e is idle and thus would not send any idle event until after
some other event would get sent. This is also useful for sending events
between two threads and is used by the corresponding functions
wxPostEvent() and wxEvtHandler::AddPendingEvent().
*/
void wxWakeUpIdle();
/** /**
Calls wxApp::Yield. Calls wxApp::Yield.

View File

@@ -1467,6 +1467,9 @@ public:
// Global functions/macros // Global functions/macros
// ============================================================================ // ============================================================================
/** @ingroup group_funcmacro_appinitterm */
//@{
/** /**
Initializes all available image handlers. For a list of available handlers, Initializes all available image handlers. For a list of available handlers,
see wxImage. see wxImage.
@@ -1475,3 +1478,5 @@ public:
*/ */
void wxInitAllImageHandlers(); void wxInitAllImageHandlers();
//@}

View File

@@ -6,22 +6,42 @@
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/** /** @ingroup group_funcmacro_appinitterm */
Free resources allocated by a successful call to wxEntryStart().
*/
void wxEntryCleanup();
//@{ //@{
/** /**
(notice that under Windows CE platform, and only there, the type of This function can be used to perform the initialization of wxWidgets if you
@a pCmdLine is @c wchar_t *, otherwise it is @c char *, even in can't use the default initialization code for any reason.
Unicode build).
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.
Notice that parameters @c argc and @c argv may be modified by this
function.
*/ */
bool wxEntryStart(int& argc, wxChar** argv); bool wxEntryStart(int& argc, wxChar** argv);
/**
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.
*/
bool wxEntryStart(HINSTANCE hInstance, bool wxEntryStart(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL, HINSTANCE hPrevInstance = NULL,
char* pCmdLine = NULL, char* pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL); int nCmdShow = SW_SHOWNORMAL);
/**
Free resources allocated by a successful call to wxEntryStart().
*/
void wxEntryCleanup();
//@} //@}