]> git.saurik.com Git - wxWidgets.git/blob - include/wx/sysopt.h
fix getting tooltip colors for GTK 2.11
[wxWidgets.git] / include / wx / sysopt.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: sysopt.h
3 // Purpose: wxSystemOptions
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2001-07-10
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_SYSOPT_H_
13 #define _WX_SYSOPT_H_
14
15 #include "wx/object.h"
16
17 // ----------------------------------------------------------------------------
18 // Enables an application to influence the wxWidgets implementation
19 // ----------------------------------------------------------------------------
20
21 class
22 #if wxUSE_SYSTEM_OPTIONS
23 WXDLLIMPEXP_BASE
24 #endif
25 wxSystemOptions : public wxObject
26 {
27 public:
28 wxSystemOptions() { }
29
30 // User-customizable hints to wxWidgets or associated libraries
31 // These could also be used to influence GetSystem... calls, indeed
32 // to implement SetSystemColour/Font/Metric
33
34 #if wxUSE_SYSTEM_OPTIONS
35 static void SetOption(const wxString& name, const wxString& value);
36 static void SetOption(const wxString& name, int value);
37 #endif // wxUSE_SYSTEM_OPTIONS
38 static wxString GetOption(const wxString& name);
39 static int GetOptionInt(const wxString& name);
40 static bool HasOption(const wxString& name);
41
42 static bool IsFalse(const wxString& name)
43 {
44 return HasOption(name) && GetOptionInt(name) == 0;
45 }
46 };
47
48 #if !wxUSE_SYSTEM_OPTIONS
49
50 // define inline stubs for accessors to make it possible to use wxSystemOptions
51 // in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time
52
53 /* static */ inline
54 wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name))
55 {
56 return wxEmptyString;
57 }
58
59 /* static */ inline
60 int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name))
61 {
62 return 0;
63 }
64
65 /* static */ inline
66 bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name))
67 {
68 return false;
69 }
70
71 #endif // !wxUSE_SYSTEM_OPTIONS
72
73 #endif
74 // _WX_SYSOPT_H_
75