]> git.saurik.com Git - wxWidgets.git/blame - include/wx/unix/apptrait.h
define wxHAS_ATOMIC_OPS only if native implementation is available; use fewer loop...
[wxWidgets.git] / include / wx / unix / apptrait.h
CommitLineData
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 19class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase
e2478fde
VZ
20{
21public:
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
38// by wxX11, should we continue to use GTK/Motif- specific stuff?
a0f4d368
VZ
39#if defined(__WXGTK__) || defined(__WXMOTIF__)
40 #define wxHAS_GUI_PROCESS_CALLBACKS
41 #define wxHAS_GUI_SOCKET_MANAGER
42#endif
43
44#ifdef __DARWIN__
2404ce8d 45 #define wxHAS_GUI_PROCESS_CALLBACKS
13d4419b
VZ
46#endif
47
53a2db12 48class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
e2478fde
VZ
49{
50public:
2ddff00c 51 virtual wxEventLoopBase *CreateEventLoop();
e2478fde 52 virtual int WaitForChild(wxExecuteData& execData);
a0f4d368 53#ifdef wxHAS_GUI_PROCESS_CALLBACKS
1d043598 54 virtual int AddProcessCallback(wxEndProcessData *data, int fd);
f0511417 55#endif
c2ca375c
VZ
56#if wxUSE_TIMER
57 virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
58#endif
d254213e
PC
59#if wxUSE_THREADS && defined(__WXGTK20__)
60 virtual void MutexGuiEnter();
61 virtual void MutexGuiLeave();
62#endif
e2478fde 63
6ae3ead6 64#if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS
fc480dc1
DE
65 virtual wxStandardPathsBase& GetStandardPaths();
66#endif
1f5c6629 67 virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const;
db9febdf 68
b46b1d59 69#if defined(__WXGTK__) && wxUSE_INTL
d774f916 70 virtual void SetLocale();
b46b1d59
VZ
71#endif // __WXGTK__
72
73#ifdef __WXGTK20__
88bbc332 74 virtual wxString GetDesktopEnvironment() const;
d3a0a0ee
VZ
75 virtual wxString GetStandardCmdLineOptions(wxArrayString& names,
76 wxArrayString& desc) const;
b46b1d59 77#endif // __WXGTK20____
5807e60c
RR
78
79#if defined(__WXDEBUG__) && defined(__WXGTK20__)
80 virtual bool ShowAssertDialog(const wxString& msg);
88bbc332 81#endif
2804f77d 82
a0f4d368 83#if wxUSE_SOCKETS && defined(wxHAS_GUI_SOCKET_MANAGER)
2804f77d
VZ
84 virtual GSocketManager *GetSocketManager();
85#endif
e2478fde
VZ
86};
87
88#endif // wxUSE_GUI
89
90#endif // _WX_UNIX_APPTRAIT_H_
91