]> git.saurik.com Git - wxWidgets.git/blob - include/wx/unix/apptbase.h
Make wxEventLoop::AddSourceForFD() static.
[wxWidgets.git] / include / wx / unix / apptbase.h
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 struct wxEndProcessData;
16 struct wxExecuteData;
17 class wxFDIOManager;
18 class wxEventLoopSourcesManagerBase;
19
20 // ----------------------------------------------------------------------------
21 // wxAppTraits: the Unix version adds extra hooks needed by Unix code
22 // ----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase
25 {
26 public:
27 // wxExecute() support methods
28 // ---------------------------
29
30 // wait for the process termination, return whatever wxExecute() must
31 // return
32 //
33 // base class implementation handles all cases except wxEXEC_SYNC without
34 // wxEXEC_NOEVENTS one which is implemented at the GUI level
35 virtual int WaitForChild(wxExecuteData& execData);
36
37 // integrate the monitoring of the given fd with the port-specific event
38 // loop: when this fd, which corresponds to a dummy pipe opened between the
39 // parent and child processes, is closed by the child, the parent is
40 // notified about this via a call to wxHandleProcessTermination() function
41 //
42 // the default implementation uses wxFDIODispatcher and so is suitable for
43 // the console applications or ports which don't have any specific event
44 // loop
45 virtual int AddProcessCallback(wxEndProcessData *data, int fd);
46
47 #if wxUSE_SOCKETS
48 // return a pointer to the object which should be used to integrate
49 // monitoring of the file descriptors to the event loop (currently this is
50 // used for the sockets only but should be used for arbitrary event loop
51 // sources in the future)
52 //
53 // this object may be different for the console and GUI applications
54 //
55 // the pointer is not deleted by the caller as normally it points to a
56 // static variable
57 virtual wxFDIOManager *GetFDIOManager();
58 #endif // wxUSE_SOCKETS
59
60 // Return a non-NULL pointer to the object responsible for managing the
61 // event loop sources in this kind of application.
62 virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager();
63
64 protected:
65 // a helper for the implementation of WaitForChild() in wxGUIAppTraits:
66 // checks the streams used for redirected IO in execData and returns true
67 // if there is any activity in them
68 bool CheckForRedirectedIO(wxExecuteData& execData);
69 };
70
71 #endif // _WX_UNIX_APPTBASE_H_
72