File: init.h

package info (click to toggle)
wxwidgets3.0 3.0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 120,464 kB
  • sloc: cpp: 896,633; makefile: 52,303; ansic: 21,971; sh: 5,713; python: 2,940; xml: 1,534; perl: 264; javascript: 33
file content (128 lines) | stat: -rw-r--r-- 3,490 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/////////////////////////////////////////////////////////////////////////////
// Name:        init.h
// Purpose:     interface of global functions
// Author:      wxWidgets team
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////


/**
    @class wxInitializer

    Create an object of this class on the stack to initialize/cleanup the library
    automatically.

    @library{wxbase}
    @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();
};



/** @addtogroup group_funcmacro_appinitterm */
//@{

/**
    This function can be used to perform the initialization of wxWidgets if you
    can't use the default initialization code for any reason.

    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 occurred 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.

    @header{wx/init.h}
*/
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.

    @onlyfor{wxmsw}

    @header{wx/init.h}
*/
bool wxEntryStart(HINSTANCE hInstance,
                  HINSTANCE hPrevInstance = NULL,
                  char* pCmdLine = NULL,
                  int nCmdShow = SW_SHOWNORMAL);

/**
    Free resources allocated by a successful call to wxEntryStart().

    @header{wx/init.h}
*/
void wxEntryCleanup();

/**
    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 wxDECLARE_APP() and wxIMPLEMENT_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();

/**
    Prevents wxWidgets from setting HighDPI awareness mode.

    wxEntry calls SetDPIProcessAware() early during initialization on Windows.
    To prevent this (e.g. because wx is embedded in native code and disabling
    DPI awareness in the manifest is not an option), call this function
    *before* wxEntry() is called.

    @onlyfor{wxmsw}

    @header{wx/init.h}

    @since 3.0.3, but only available in 3.0.x, not 3.1+ which doesn't make
           the SetDPIProcessAware() call anymore.
*/
void wxMSWDisableSettingHighDPIAware();

//@}