1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/apptbase.h
3 // Purpose: declaration of wxAppTraits for Unix systems
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIX_APPTBASE_H_
13 #define _WX_UNIX_APPTBASE_H_
15 struct wxEndProcessData
;
18 class wxEventLoopSourcesManagerBase
;
20 // ----------------------------------------------------------------------------
21 // wxAppTraits: the Unix version adds extra hooks needed by Unix code
22 // ----------------------------------------------------------------------------
24 class WXDLLIMPEXP_BASE wxAppTraits
: public wxAppTraitsBase
27 // wxExecute() support methods
28 // ---------------------------
30 // wait for the process termination, return whatever wxExecute() must
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
);
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
42 // the default implementation uses wxFDIODispatcher and so is suitable for
43 // the console applications or ports which don't have any specific event
45 virtual int AddProcessCallback(wxEndProcessData
*data
, int fd
);
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)
53 // this object may be different for the console and GUI applications
55 // the pointer is not deleted by the caller as normally it points to a
57 virtual wxFDIOManager
*GetFDIOManager();
58 #endif // wxUSE_SOCKETS
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();
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
);
71 #endif // _WX_UNIX_APPTBASE_H_