1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/apptrait.h
3 // Purpose: class implementing wxAppTraits for MSW
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_APPTRAIT_H_
13 #define _WX_MSW_APPTRAIT_H_
15 // ----------------------------------------------------------------------------
16 // wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_BASE wxConsoleAppTraits
: public wxConsoleAppTraitsBase
22 virtual wxEventLoopBase
*CreateEventLoop();
23 virtual void *BeforeChildWaitLoop();
24 virtual void AfterChildWaitLoop(void *data
);
26 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
29 virtual bool DoMessageFromThreadWait();
30 virtual WXDWORD
WaitForThread(WXHANDLE hThread
, int flags
);
31 #endif // wxUSE_THREADS
33 virtual bool CanUseStderr() { return true; }
34 virtual bool WriteToStderr(const wxString
& text
);
35 #endif // !__WXWINCE__
40 #if defined(__WXMSW__)
42 class WXDLLIMPEXP_CORE wxGUIAppTraits
: public wxGUIAppTraitsBase
45 virtual wxEventLoopBase
*CreateEventLoop();
46 virtual void *BeforeChildWaitLoop();
47 virtual void AfterChildWaitLoop(void *data
);
49 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
52 virtual bool DoMessageFromThreadWait();
53 virtual WXDWORD
WaitForThread(WXHANDLE hThread
, int flags
);
54 #endif // wxUSE_THREADS
55 virtual wxPortId
GetToolkitVersion(int *majVer
= NULL
, int *minVer
= NULL
) const;
58 virtual bool CanUseStderr();
59 virtual bool WriteToStderr(const wxString
& text
);
60 #endif // !__WXWINCE__
63 #elif defined(__WXGTK__)
65 class WXDLLIMPEXP_CORE wxGUIAppTraits
: public wxGUIAppTraitsBase
68 virtual wxEventLoopBase
*CreateEventLoop();
69 virtual void *BeforeChildWaitLoop() { return NULL
; }
70 virtual void AfterChildWaitLoop(void *WXUNUSED(data
)) { }
72 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
75 #if wxUSE_THREADS && defined(__WXGTK20__)
76 virtual void MutexGuiEnter();
77 virtual void MutexGuiLeave();
81 virtual bool DoMessageFromThreadWait() { return true; }
82 virtual WXDWORD
WaitForThread(WXHANDLE hThread
, int WXUNUSED(flags
))
83 { return DoSimpleWaitForThread(hThread
); }
84 #endif // wxUSE_THREADS
85 virtual wxPortId
GetToolkitVersion(int *majVer
= NULL
, int *minVer
= NULL
) const;
88 virtual bool CanUseStderr() { return false; }
89 virtual bool WriteToStderr(const wxString
& WXUNUSED(text
)) { return false; }
90 #endif // !__WXWINCE__
97 #endif // _WX_MSW_APPTRAIT_H_