]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/apptbase.h
Convert wxFSW_EVENT_{WARNING,ERROR} to string correctly.
[wxWidgets.git] / include / wx / msw / apptbase.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/apptbase.h
3 // Purpose: declaration of wxAppTraits for MSW
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 22.06.2003
7 // RCS-ID: $Id$
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MSW_APPTBASE_H_
13 #define _WX_MSW_APPTBASE_H_
14
15 // ----------------------------------------------------------------------------
16 // wxAppTraits: the MSW version adds extra hooks needed by MSW-only code
17 // ----------------------------------------------------------------------------
18
19 class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase
20 {
21 public:
22 // wxExecute() support methods
23 // ---------------------------
24
25 // called before starting to wait for the child termination, may return
26 // some opaque data which will be passed later to AfterChildWaitLoop()
27 virtual void *BeforeChildWaitLoop() = 0;
28
29 // called after starting to wait for the child termination, the parameter
30 // is the return value of BeforeChildWaitLoop()
31 virtual void AfterChildWaitLoop(void *data) = 0;
32
33
34 #if wxUSE_THREADS
35 // wxThread helpers
36 // ----------------
37
38 // process a message while waiting for a(nother) thread, should return
39 // false if and only if we have to exit the application
40 virtual bool DoMessageFromThreadWait() = 0;
41
42 // wait for the handle to be signaled, return WAIT_OBJECT_0 if it is or, in
43 // the GUI code, WAIT_OBJECT_0 + 1 if a Windows message arrived
44 virtual WXDWORD WaitForThread(WXHANDLE hThread, int flags) = 0;
45 #endif // wxUSE_THREADS
46
47
48 #ifndef __WXWINCE__
49 // console helpers
50 // ---------------
51
52 // this method can be overridden by a derived class to always return true
53 // or false to force [not] using the console for output to stderr
54 //
55 // by default console applications always return true from here while the
56 // GUI ones only return true if they're being run from console and there is
57 // no other activity happening in this console
58 virtual bool CanUseStderr() = 0;
59
60 // write text to the console, return true if ok or false on error
61 virtual bool WriteToStderr(const wxString& text) = 0;
62 #endif // !__WXWINCE__
63
64 protected:
65 #if wxUSE_THREADS
66 // implementation of WaitForThread() for the console applications which is
67 // also used by the GUI code if it doesn't [yet|already] dispatch events
68 WXDWORD DoSimpleWaitForThread(WXHANDLE hThread);
69 #endif // wxUSE_THREADS
70 };
71
72 #endif // _WX_MSW_APPTBASE_H_
73