1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/apptrait.h
3 // Purpose: standard implementations of wxAppTraits for Unix
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIX_APPTRAIT_H_
13 #define _WX_UNIX_APPTRAIT_H_
15 // ----------------------------------------------------------------------------
16 // wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_BASE wxConsoleAppTraits
: public wxConsoleAppTraitsBase
22 #if wxUSE_CONSOLE_EVENTLOOP
23 virtual wxEventLoopBase
*CreateEventLoop();
24 #endif // wxUSE_CONSOLE_EVENTLOOP
26 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
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
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
38 // by wxX11, should we continue to use GTK/Motif- specific stuff?
39 #if defined(__WXGTK__) || defined(__WXMOTIF__)
40 #define wxHAS_GUI_PROCESS_CALLBACKS
41 #define wxHAS_GUI_SOCKET_MANAGER
45 #define wxHAS_GUI_PROCESS_CALLBACKS
48 class WXDLLIMPEXP_CORE wxGUIAppTraits
: public wxGUIAppTraitsBase
51 virtual wxEventLoopBase
*CreateEventLoop();
52 virtual int WaitForChild(wxExecuteData
& execData
);
53 #ifdef wxHAS_GUI_PROCESS_CALLBACKS
54 virtual int AddProcessCallback(wxEndProcessData
*data
, int fd
);
57 virtual wxTimerImpl
*CreateTimerImpl(wxTimer
*timer
);
59 #if wxUSE_THREADS && defined(__WXGTK20__)
60 virtual void MutexGuiEnter();
61 virtual void MutexGuiLeave();
64 #if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS
65 virtual wxStandardPaths
& GetStandardPaths();
67 virtual wxPortId
GetToolkitVersion(int *majVer
= NULL
, int *minVer
= NULL
) const;
69 #if defined(__WXGTK__) && wxUSE_INTL
70 virtual void SetLocale();
74 virtual wxString
GetDesktopEnvironment() const;
75 virtual wxString
GetStandardCmdLineOptions(wxArrayString
& names
,
76 wxArrayString
& desc
) const;
77 #endif // __WXGTK20____
79 #if defined(__WXGTK20__)
80 virtual bool ShowAssertDialog(const wxString
& msg
);
83 #if wxUSE_SOCKETS && defined(wxHAS_GUI_SOCKET_MANAGER)
84 virtual wxSocketManager
*GetSocketManager();
90 #endif // _WX_UNIX_APPTRAIT_H_