]>
Commit | Line | Data |
---|---|---|
e2478fde VZ |
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$ | |
77ffb593 | 8 | // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> |
65571936 | 9 | // Licence: wxWindows licence |
e2478fde VZ |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_UNIX_APPTBASE_H_ | |
13 | #define _WX_UNIX_APPTBASE_H_ | |
14 | ||
1d043598 | 15 | struct wxEndProcessData; |
5a9b5934 | 16 | struct wxExecuteData; |
e2478fde VZ |
17 | class wxPipe; |
18 | ||
19 | // ---------------------------------------------------------------------------- | |
20 | // wxAppTraits: the Unix version adds extra hooks needed by Unix code | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
163b3ad7 | 23 | class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase |
e2478fde VZ |
24 | { |
25 | public: | |
26 | // wxExecute() support methods | |
27 | // --------------------------- | |
28 | ||
29 | // called before starting the child process and creates the pipe used for | |
30 | // detecting the process termination asynchronously in GUI, does nothing in | |
31 | // wxBase | |
32 | // | |
33 | // if it returns false, we should return from wxExecute() with an error | |
9243700f | 34 | virtual bool CreateEndProcessPipe(wxExecuteData& execData); |
e2478fde VZ |
35 | |
36 | // test if the given descriptor is the end of the pipe create by the | |
37 | // function above | |
9243700f | 38 | virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd); |
e2478fde VZ |
39 | |
40 | // ensure that the write end of the pipe is not closed by wxPipe dtor | |
9243700f | 41 | virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData); |
e2478fde VZ |
42 | |
43 | // wait for the process termination, return whatever wxExecute() must | |
44 | // return | |
1d043598 VZ |
45 | // |
46 | // base class implementation handles all cases except wxEXEC_SYNC without | |
47 | // wxEXEC_NOEVENTS one which is implemented at the GUI level | |
48 | virtual int WaitForChild(wxExecuteData& execData); | |
49 | ||
50 | // integrate the monitoring of the given fd with the port-specific event | |
51 | // loop: when this fd, which corresponds to a dummy pipe opened between the | |
52 | // parent and child processes, is closed by the child, the parent is | |
53 | // notified about this via a call to wxHandleProcessTermination() function | |
54 | // | |
55 | // the default implementation uses wxFDIODispatcher and so is suitable for | |
56 | // the console applications or ports which don't have any specific event | |
57 | // loop | |
58 | virtual int AddProcessCallback(wxEndProcessData *data, int fd); | |
e2478fde VZ |
59 | |
60 | ||
61 | // wxThread helpers | |
62 | // ---------------- | |
63 | ||
64 | // TODO | |
2804f77d VZ |
65 | |
66 | #if wxUSE_SOCKETS | |
67 | // returns the select()-based socket manager for console applications which | |
68 | // is also used by some ports (wxX11, wxDFB) in the GUI build (hence it is | |
69 | // here and not in wxConsoleAppTraits) | |
70 | virtual GSocketManager *GetSocketManager(); | |
71 | #endif | |
e2478fde VZ |
72 | }; |
73 | ||
74 | #endif // _WX_UNIX_APPTBASE_H_ | |
75 |