]>
Commit | Line | Data |
---|---|---|
e2478fde VZ |
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 | // 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_APPTRAIT_H_ | |
13 | #define _WX_UNIX_APPTRAIT_H_ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
163b3ad7 | 19 | class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase |
e2478fde VZ |
20 | { |
21 | public: | |
a1873279 | 22 | #if wxUSE_CONSOLE_EVENTLOOP |
2ddff00c | 23 | virtual wxEventLoopBase *CreateEventLoop(); |
a1873279 | 24 | #endif // wxUSE_CONSOLE_EVENTLOOP |
c2ca375c VZ |
25 | #if wxUSE_TIMER |
26 | virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer); | |
27 | #endif | |
e2478fde VZ |
28 | }; |
29 | ||
30 | #if wxUSE_GUI | |
31 | ||
13d4419b VZ |
32 | // GTK+ and Motif integrate sockets and child processes monitoring directly in |
33 | // their main loop, the other Unix ports do it at wxEventLoop level and so use | |
34 | // the non-GUI traits and don't need anything here | |
35 | // | |
36 | // TODO: Should we use XtAddInput() for wxX11 too? Or, vice versa, if there is | |
37 | // no advantage in doing this compared to the generic way currently used | |
5815e959 | 38 | // by wxX11, should we continue to use GTK/Motif-specific stuff? |
6bcc1145 VZ |
39 | #if defined(__WXGTK__) || defined(__WXMOTIF__) |
40 | #define wxHAS_GUI_FDIOMANAGER | |
41 | #define wxHAS_GUI_PROCESS_CALLBACKS | |
42 | #endif // ports using wxFDIOManager | |
43 | ||
44 | #if defined(__WXMAC__) | |
a0f4d368 VZ |
45 | #define wxHAS_GUI_PROCESS_CALLBACKS |
46 | #define wxHAS_GUI_SOCKET_MANAGER | |
47 | #endif | |
48 | ||
53a2db12 | 49 | class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase |
e2478fde VZ |
50 | { |
51 | public: | |
2ddff00c | 52 | virtual wxEventLoopBase *CreateEventLoop(); |
e2478fde | 53 | virtual int WaitForChild(wxExecuteData& execData); |
c2ca375c VZ |
54 | #if wxUSE_TIMER |
55 | virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer); | |
56 | #endif | |
d254213e PC |
57 | #if wxUSE_THREADS && defined(__WXGTK20__) |
58 | virtual void MutexGuiEnter(); | |
59 | virtual void MutexGuiLeave(); | |
60 | #endif | |
e2478fde | 61 | |
6ae3ead6 | 62 | #if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS |
25f49256 | 63 | virtual wxStandardPaths& GetStandardPaths(); |
fc480dc1 | 64 | #endif |
1f5c6629 | 65 | virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const; |
db9febdf | 66 | |
b46b1d59 | 67 | #ifdef __WXGTK20__ |
88bbc332 | 68 | virtual wxString GetDesktopEnvironment() const; |
d3a0a0ee VZ |
69 | virtual wxString GetStandardCmdLineOptions(wxArrayString& names, |
70 | wxArrayString& desc) const; | |
b46b1d59 | 71 | #endif // __WXGTK20____ |
5807e60c | 72 | |
657a8a35 | 73 | #if defined(__WXGTK20__) |
5807e60c | 74 | virtual bool ShowAssertDialog(const wxString& msg); |
88bbc332 | 75 | #endif |
2804f77d | 76 | |
6bcc1145 VZ |
77 | #if wxUSE_SOCKETS |
78 | ||
79 | #ifdef wxHAS_GUI_SOCKET_MANAGER | |
51fe4b60 | 80 | virtual wxSocketManager *GetSocketManager(); |
2804f77d | 81 | #endif |
6bcc1145 VZ |
82 | |
83 | #ifdef wxHAS_GUI_FDIOMANAGER | |
84 | virtual wxFDIOManager *GetFDIOManager(); | |
85 | #endif | |
86 | ||
87 | #endif // wxUSE_SOCKETS | |
71e9885b VZ |
88 | |
89 | virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager(); | |
e2478fde VZ |
90 | }; |
91 | ||
92 | #endif // wxUSE_GUI | |
93 | ||
94 | #endif // _WX_UNIX_APPTRAIT_H_ | |
95 |