]>
Commit | Line | Data |
---|---|---|
e2478fde VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/msw/apptrait.h | |
3 | // Purpose: class implementing wxAppTraits for MSW | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 21.06.2003 | |
77ffb593 | 7 | // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> |
65571936 | 8 | // Licence: wxWindows licence |
e2478fde VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_MSW_APPTRAIT_H_ | |
12 | #define _WX_MSW_APPTRAIT_H_ | |
13 | ||
14 | // ---------------------------------------------------------------------------- | |
15 | // wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
bb24c68f | 18 | class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase |
e2478fde VZ |
19 | { |
20 | public: | |
2ddff00c | 21 | virtual wxEventLoopBase *CreateEventLoop(); |
e2478fde | 22 | virtual void *BeforeChildWaitLoop(); |
e2478fde | 23 | virtual void AfterChildWaitLoop(void *data); |
c2ca375c VZ |
24 | #if wxUSE_TIMER |
25 | virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer); | |
dd1af40c VZ |
26 | #endif // wxUSE_TIMER |
27 | #if wxUSE_THREADS | |
e2478fde | 28 | virtual bool DoMessageFromThreadWait(); |
b95a7c31 | 29 | virtual WXDWORD WaitForThread(WXHANDLE hThread, int flags); |
dd1af40c | 30 | #endif // wxUSE_THREADS |
784ee7d5 VZ |
31 | #ifndef __WXWINCE__ |
32 | virtual bool CanUseStderr() { return true; } | |
33 | virtual bool WriteToStderr(const wxString& text); | |
34 | #endif // !__WXWINCE__ | |
e2478fde VZ |
35 | }; |
36 | ||
37 | #if wxUSE_GUI | |
38 | ||
7d17efb1 VZ |
39 | #if defined(__WXMSW__) |
40 | ||
bb24c68f | 41 | class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase |
e2478fde VZ |
42 | { |
43 | public: | |
2ddff00c | 44 | virtual wxEventLoopBase *CreateEventLoop(); |
e2478fde | 45 | virtual void *BeforeChildWaitLoop(); |
e2478fde | 46 | virtual void AfterChildWaitLoop(void *data); |
c2ca375c VZ |
47 | #if wxUSE_TIMER |
48 | virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer); | |
dd1af40c VZ |
49 | #endif // wxUSE_TIMER |
50 | #if wxUSE_THREADS | |
e2478fde | 51 | virtual bool DoMessageFromThreadWait(); |
b95a7c31 | 52 | virtual WXDWORD WaitForThread(WXHANDLE hThread, int flags); |
dd1af40c VZ |
53 | #endif // wxUSE_THREADS |
54 | virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const; | |
784ee7d5 VZ |
55 | |
56 | #ifndef __WXWINCE__ | |
57 | virtual bool CanUseStderr(); | |
58 | virtual bool WriteToStderr(const wxString& text); | |
59 | #endif // !__WXWINCE__ | |
e2478fde VZ |
60 | }; |
61 | ||
7d17efb1 VZ |
62 | #elif defined(__WXGTK__) |
63 | ||
64 | class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase | |
65 | { | |
66 | public: | |
67 | virtual wxEventLoopBase *CreateEventLoop(); | |
68 | virtual void *BeforeChildWaitLoop() { return NULL; } | |
69 | virtual void AfterChildWaitLoop(void *WXUNUSED(data)) { } | |
70 | #if wxUSE_TIMER | |
71 | virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer); | |
72 | #endif | |
73 | ||
74 | #if wxUSE_THREADS && defined(__WXGTK20__) | |
75 | virtual void MutexGuiEnter(); | |
76 | virtual void MutexGuiLeave(); | |
77 | #endif | |
78 | ||
79 | #if wxUSE_THREADS | |
80 | virtual bool DoMessageFromThreadWait() { return true; } | |
81 | virtual WXDWORD WaitForThread(WXHANDLE hThread, int WXUNUSED(flags)) | |
82 | { return DoSimpleWaitForThread(hThread); } | |
83 | #endif // wxUSE_THREADS | |
84 | virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const; | |
85 | ||
86 | #ifndef __WXWINCE__ | |
87 | virtual bool CanUseStderr() { return false; } | |
88 | virtual bool WriteToStderr(const wxString& WXUNUSED(text)) { return false; } | |
89 | #endif // !__WXWINCE__ | |
90 | }; | |
91 | ||
92 | #endif | |
93 | ||
e2478fde VZ |
94 | #endif // wxUSE_GUI |
95 | ||
96 | #endif // _WX_MSW_APPTRAIT_H_ |