]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/unix/apptbase.h | |
3 | // Purpose: declaration of wxAppTraits for Unix systems | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 23.06.2003 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_UNIX_APPTBASE_H_ | |
13 | #define _WX_UNIX_APPTBASE_H_ | |
14 | ||
15 | #include "wx/evtloop.h" | |
16 | #include "wx/evtloopsrc.h" | |
17 | ||
18 | class wxExecuteData; | |
19 | class wxFDIOManager; | |
20 | class wxEventLoopSourcesManagerBase; | |
21 | ||
22 | // ---------------------------------------------------------------------------- | |
23 | // wxAppTraits: the Unix version adds extra hooks needed by Unix code | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
26 | class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase | |
27 | { | |
28 | public: | |
29 | // wxExecute() support methods | |
30 | // --------------------------- | |
31 | ||
32 | // Wait for the process termination and return its exit code or -1 on error. | |
33 | // | |
34 | // Notice that this is only used when execData.flags contains wxEXEC_SYNC | |
35 | // and does not contain wxEXEC_NOEVENTS, i.e. when we need to really wait | |
36 | // until the child process exit and dispatch the events while doing it. | |
37 | virtual int WaitForChild(wxExecuteData& execData); | |
38 | ||
39 | #if wxUSE_SOCKETS | |
40 | // return a pointer to the object which should be used to integrate | |
41 | // monitoring of the file descriptors to the event loop (currently this is | |
42 | // used for the sockets only but should be used for arbitrary event loop | |
43 | // sources in the future) | |
44 | // | |
45 | // this object may be different for the console and GUI applications | |
46 | // | |
47 | // the pointer is not deleted by the caller as normally it points to a | |
48 | // static variable | |
49 | virtual wxFDIOManager *GetFDIOManager(); | |
50 | #endif // wxUSE_SOCKETS | |
51 | ||
52 | // Return a non-NULL pointer to the object responsible for managing the | |
53 | // event loop sources in this kind of application. | |
54 | virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager(); | |
55 | ||
56 | protected: | |
57 | // Wait for the process termination by running the given event loop until | |
58 | // this happens. | |
59 | // | |
60 | // This is used by the public WaitForChild() after creating the event loop | |
61 | // of the appropriate kind. | |
62 | int RunLoopUntilChildExit(wxExecuteData& execData, wxEventLoopBase& loop); | |
63 | }; | |
64 | ||
65 | #endif // _WX_UNIX_APPTBASE_H_ | |
66 |