1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/apptrait.h
3 // Purpose: class implementing wxAppTraits for MSW
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_APPTRAIT_H_
12 #define _WX_MSW_APPTRAIT_H_
14 // ----------------------------------------------------------------------------
15 // wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_BASE wxConsoleAppTraits
: public wxConsoleAppTraitsBase
21 virtual wxEventLoopBase
*CreateEventLoop();
22 virtual void *BeforeChildWaitLoop();
23 virtual void AfterChildWaitLoop(void *data
);
25 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
28 virtual bool DoMessageFromThreadWait();
29 virtual WXDWORD
WaitForThread(WXHANDLE hThread
, int flags
);
30 #endif // wxUSE_THREADS
32 virtual bool CanUseStderr() { return true; }
33 virtual bool WriteToStderr(const wxString
& text
);
34 #endif // !__WXWINCE__
39 #if defined(__WXMSW__)
41 class WXDLLIMPEXP_CORE wxGUIAppTraits
: public wxGUIAppTraitsBase
44 virtual wxEventLoopBase
*CreateEventLoop();
45 virtual void *BeforeChildWaitLoop();
46 virtual void AfterChildWaitLoop(void *data
);
48 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
51 virtual bool DoMessageFromThreadWait();
52 virtual WXDWORD
WaitForThread(WXHANDLE hThread
, int flags
);
53 #endif // wxUSE_THREADS
54 virtual wxPortId
GetToolkitVersion(int *majVer
= NULL
, int *minVer
= NULL
) const;
57 virtual bool CanUseStderr();
58 virtual bool WriteToStderr(const wxString
& text
);
59 #endif // !__WXWINCE__
62 #elif defined(__WXGTK__)
64 class WXDLLIMPEXP_CORE wxGUIAppTraits
: public wxGUIAppTraitsBase
67 virtual wxEventLoopBase
*CreateEventLoop();
68 virtual void *BeforeChildWaitLoop() { return NULL
; }
69 virtual void AfterChildWaitLoop(void *WXUNUSED(data
)) { }
71 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
74 #if wxUSE_THREADS && defined(__WXGTK20__)
75 virtual void MutexGuiEnter();
76 virtual void MutexGuiLeave();
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;
87 virtual bool CanUseStderr() { return false; }
88 virtual bool WriteToStderr(const wxString
& WXUNUSED(text
)) { return false; }
89 #endif // !__WXWINCE__
96 #endif // _WX_MSW_APPTRAIT_H_