]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/init.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / interface / wx / init.h
CommitLineData
23324ae1 1/////////////////////////////////////////////////////////////////////////////
7c913512 2// Name: init.h
e54c96f1 3// Purpose: interface of global functions
7c913512 4// Author: wxWidgets team
526954c5 5// Licence: wxWindows licence
7c913512
FM
6/////////////////////////////////////////////////////////////////////////////
7
fa7e10a4
FM
8
9/**
10 @class wxInitializer
11
12 Create an object of this class on the stack to initialize/cleanup the library
13 automatically.
14
e2c4ccaf 15 @library{wxbase}
fa7e10a4
FM
16 @category{appmanagement}
17
18 @see wxGLContext
19*/
20class wxInitializer
21{
22public:
23 /**
24 Initializes the library.
25 Calls wxInitialize().
26 */
27 wxInitializer(int argc = 0, wxChar **argv = NULL);
28
29 /**
30 Has the initialization been successful? (explicit test)
31 */
32 bool IsOk() const;
33
34 /**
35 This dtor only does clean up if we initialized the library properly.
36 Calls wxUninitialize().
37 */
38 ~wxInitializer();
39};
40
41
42
b21126db 43/** @addtogroup group_funcmacro_appinitterm */
8cd06fb5
BP
44//@{
45
7c913512 46/**
8cd06fb5
BP
47 This function can be used to perform the initialization of wxWidgets if you
48 can't use the default initialization code for any reason.
23324ae1 49
8cd06fb5
BP
50 If the function returns true, the initialization was successful and the
51 global wxApp object ::wxTheApp has been created. Moreover, wxEntryCleanup()
52 must be called afterwards. If the function returns false, a catastrophic
f090e4ef 53 initialization error occurred and (at least the GUI part of) the library
8cd06fb5 54 can't be used at all.
23324ae1 55
8cd06fb5
BP
56 Notice that parameters @c argc and @c argv may be modified by this
57 function.
027c1c27
BP
58
59 @header{wx/init.h}
23324ae1 60*/
4cc4bfaf 61bool wxEntryStart(int& argc, wxChar** argv);
8cd06fb5
BP
62
63/**
64 See wxEntryStart(int&,wxChar**) for more info about this function.
65
66 This is an additional overload of wxEntryStart() provided under MSW only.
67 It is meant to be called with the parameters passed to WinMain().
68
69 @note Under Windows CE platform, and only there, the type of @a pCmdLine is
70 @c wchar_t *, otherwise it is @c char *, even in Unicode build.
027c1c27 71
fa7e10a4
FM
72 @onlyfor{wxmsw}
73
027c1c27 74 @header{wx/init.h}
8cd06fb5 75*/
7c913512 76bool wxEntryStart(HINSTANCE hInstance,
4cc4bfaf
FM
77 HINSTANCE hPrevInstance = NULL,
78 char* pCmdLine = NULL,
7c913512 79 int nCmdShow = SW_SHOWNORMAL);
8cd06fb5
BP
80
81/**
82 Free resources allocated by a successful call to wxEntryStart().
027c1c27
BP
83
84 @header{wx/init.h}
8cd06fb5
BP
85*/
86void wxEntryCleanup();
87
fa7e10a4
FM
88/**
89 Initialize the library (may be called as many times as needed, but each
90 call to wxInitialize() must be matched by wxUninitialize()).
91
e4431849 92 With this function you may avoid wxDECLARE_APP() and wxIMPLEMENT_APP() macros
fa7e10a4
FM
93 and use wxInitialize() and wxUninitialize() dynamically in the
94 program startup and termination.
95
96 @header{wx/init.h}
97*/
98bool wxInitialize(int argc = 0, wxChar **argv = NULL);
99
100/**
101 Clean up; the library can't be used any more after the last call to
102 wxUninitialize().
103
104 See wxInitialize() for more info.
105
106 @header{wx/init.h}
107*/
108void wxUninitialize();
109
23324ae1
FM
110//@}
111