apptrait.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/unix/apptrait.h
  3. // Purpose: standard implementations of wxAppTraits for Unix
  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_APPTRAIT_H_
  11. #define _WX_UNIX_APPTRAIT_H_
  12. // ----------------------------------------------------------------------------
  13. // wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase
  14. // ----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase
  16. {
  17. public:
  18. #if wxUSE_CONSOLE_EVENTLOOP
  19. virtual wxEventLoopBase *CreateEventLoop();
  20. #endif // wxUSE_CONSOLE_EVENTLOOP
  21. #if wxUSE_TIMER
  22. virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
  23. #endif
  24. };
  25. #if wxUSE_GUI
  26. // GTK+ and Motif integrate sockets and child processes monitoring directly in
  27. // their main loop, the other Unix ports do it at wxEventLoop level and so use
  28. // the non-GUI traits and don't need anything here
  29. //
  30. // TODO: Should we use XtAddInput() for wxX11 too? Or, vice versa, if there is
  31. // no advantage in doing this compared to the generic way currently used
  32. // by wxX11, should we continue to use GTK/Motif-specific stuff?
  33. #if defined(__WXGTK__) || defined(__WXMOTIF__)
  34. #define wxHAS_GUI_FDIOMANAGER
  35. #define wxHAS_GUI_PROCESS_CALLBACKS
  36. #endif // ports using wxFDIOManager
  37. #if defined(__WXMAC__)
  38. #define wxHAS_GUI_PROCESS_CALLBACKS
  39. #define wxHAS_GUI_SOCKET_MANAGER
  40. #endif
  41. class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
  42. {
  43. public:
  44. virtual wxEventLoopBase *CreateEventLoop();
  45. virtual int WaitForChild(wxExecuteData& execData);
  46. #if wxUSE_TIMER
  47. virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
  48. #endif
  49. #if wxUSE_THREADS && defined(__WXGTK20__)
  50. virtual void MutexGuiEnter();
  51. virtual void MutexGuiLeave();
  52. #endif
  53. #if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS
  54. virtual wxStandardPaths& GetStandardPaths();
  55. #endif
  56. virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const;
  57. #ifdef __WXGTK20__
  58. virtual wxString GetDesktopEnvironment() const;
  59. virtual wxString GetStandardCmdLineOptions(wxArrayString& names,
  60. wxArrayString& desc) const;
  61. #endif // __WXGTK20____
  62. #if defined(__WXGTK20__)
  63. virtual bool ShowAssertDialog(const wxString& msg);
  64. #endif
  65. #if wxUSE_SOCKETS
  66. #ifdef wxHAS_GUI_SOCKET_MANAGER
  67. virtual wxSocketManager *GetSocketManager();
  68. #endif
  69. #ifdef wxHAS_GUI_FDIOMANAGER
  70. virtual wxFDIOManager *GetFDIOManager();
  71. #endif
  72. #endif // wxUSE_SOCKETS
  73. virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager();
  74. };
  75. #endif // wxUSE_GUI
  76. #endif // _WX_UNIX_APPTRAIT_H_