apptbase.h 2.4 KB

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