]> git.saurik.com Git - wxWidgets.git/blob - include/wx/unix/apptrait.h
ca2570d55e26ab8eb7103c06d524927179308397
[wxWidgets.git] / include / wx / unix / apptrait.h
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$
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
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
19 class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase
20 {
21 public:
22 #if wxUSE_CONSOLE_EVENTLOOP
23 virtual wxEventLoopBase *CreateEventLoop();
24 #endif // wxUSE_CONSOLE_EVENTLOOP
25 #if wxUSE_TIMER
26 virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
27 #endif
28 };
29
30 #if wxUSE_GUI
31
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?
39 #if defined(__WXGTK__) || defined(__WXMOTIF__)
40 #define wxHAS_GUI_CALLBACKS
41 #endif
42
43 class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
44 {
45 public:
46 virtual wxEventLoopBase *CreateEventLoop();
47 virtual int WaitForChild(wxExecuteData& execData);
48 #ifdef wxHAS_GUI_CALLBACKS
49 virtual int AddProcessCallback(wxEndProcessData *data, int fd);
50 #if wxUSE_TIMER
51 virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
52 #endif
53 #if wxUSE_THREADS && defined(__WXGTK20__)
54 virtual void MutexGuiEnter();
55 virtual void MutexGuiLeave();
56 #endif
57
58 #if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS
59 virtual wxStandardPathsBase& GetStandardPaths();
60 #endif
61 virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const;
62
63 #if defined(__WXGTK__) && wxUSE_INTL
64 virtual void SetLocale();
65 #endif // __WXGTK__
66
67 #ifdef __WXGTK20__
68 virtual wxString GetDesktopEnvironment() const;
69 virtual wxString GetStandardCmdLineOptions(wxArrayString& names,
70 wxArrayString& desc) const;
71 #endif // __WXGTK20____
72
73 #if defined(__WXDEBUG__) && defined(__WXGTK20__)
74 virtual bool ShowAssertDialog(const wxString& msg);
75 #endif
76
77 #if wxUSE_SOCKETS && defined(wxHAS_GUI_CALLBACKS)
78 virtual GSocketManager *GetSocketManager();
79 #endif
80 };
81
82 #endif // wxUSE_GUI
83
84 #endif // _WX_UNIX_APPTRAIT_H_
85