]> git.saurik.com Git - wxWidgets.git/blob - src/x11/settings.cpp
fix crash in wxWindowGTK::GTKHandleUnrealize(), closes #14752
[wxWidgets.git] / src / x11 / settings.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/x11/settings.cpp
3 // Purpose: wxSettings
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // for compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 // TODO: these settings should probably be configurable from some central or
16 // per-user file, which can be edited using a Windows-control-panel clone.
17 // Also they should be documented better. Some are very MS Windows-ish.
18
19 #include "wx/settings.h"
20
21 #ifndef WX_PRECOMP
22 #include "wx/gdicmn.h"
23 #endif
24
25 #include "wx/x11/private.h"
26
27 wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
28 {
29 switch (index)
30 {
31 case wxSYS_COLOUR_APPWORKSPACE:
32 return wxColour( 0xc0c0c0 );
33
34 default:
35 break;
36 }
37
38 // Overridden mostly by wxSystemSettings::GetColour in wxUniversal
39 return *wxWHITE;
40 }
41
42 wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
43 {
44 switch (index)
45 {
46 case wxSYS_SYSTEM_FIXED_FONT:
47 {
48 return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, FALSE);
49 break;
50 }
51 case wxSYS_DEVICE_DEFAULT_FONT:
52 case wxSYS_SYSTEM_FONT:
53 case wxSYS_DEFAULT_GUI_FONT:
54 default:
55 {
56 return wxFont(12, wxSWISS, wxNORMAL, wxNORMAL, FALSE);
57 break;
58 }
59 }
60
61 return wxFont();
62 }
63
64 // Get a system metric, e.g. scrollbar size
65 int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
66 {
67 switch ( index)
68 {
69 // TODO case wxSYS_MOUSE_BUTTONS:
70 // TODO case wxSYS_BORDER_X:
71 // TODO case wxSYS_BORDER_Y:
72 // TODO case wxSYS_CURSOR_X:
73 // TODO case wxSYS_CURSOR_Y:
74 // TODO case wxSYS_DCLICK_X:
75 // TODO case wxSYS_DCLICK_Y:
76 // TODO case wxSYS_DRAG_X:
77 // TODO case wxSYS_DRAG_Y:
78 // TODO case wxSYS_EDGE_X:
79 // TODO case wxSYS_EDGE_Y:
80 // TODO case wxSYS_HSCROLL_ARROW_X:
81 // TODO case wxSYS_HSCROLL_ARROW_Y:
82 // TODO case wxSYS_HTHUMB_X:
83 // TODO case wxSYS_ICON_X:
84 // TODO case wxSYS_ICON_Y:
85 // TODO case wxSYS_ICONSPACING_X:
86 // TODO case wxSYS_ICONSPACING_Y:
87 // TODO case wxSYS_WINDOWMIN_X:
88 // TODO case wxSYS_WINDOWMIN_Y:
89
90 case wxSYS_SCREEN_X:
91 return DisplayWidth( wxGlobalDisplay(), 0 );
92
93 case wxSYS_SCREEN_Y:
94 return DisplayHeight( wxGlobalDisplay(), 0 );
95
96 // TODO case wxSYS_FRAMESIZE_X:
97 // TODO case wxSYS_FRAMESIZE_Y:
98 // TODO case wxSYS_SMALLICON_X:
99 // TODO case wxSYS_SMALLICON_Y:
100 // TODO case wxSYS_HSCROLL_Y:
101 // TODO case wxSYS_VSCROLL_X:
102 // TODO case wxSYS_VSCROLL_ARROW_X:
103 // TODO case wxSYS_VSCROLL_ARROW_Y:
104 // TODO case wxSYS_VTHUMB_Y:
105 // TODO case wxSYS_CAPTION_Y:
106 // TODO case wxSYS_MENU_Y:
107 // TODO case wxSYS_NETWORK_PRESENT:
108 // TODO case wxSYS_PENWINDOWS_PRESENT:
109 // TODO case wxSYS_SHOW_SOUNDS:
110 // TODO case wxSYS_SWAP_BUTTONS:
111
112 default:
113 return -1; // unsupported metric
114 }
115 }
116
117 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
118 {
119 switch (index)
120 {
121 case wxSYS_CAN_ICONIZE_FRAME:
122 case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
123 return true;
124
125 default:
126 return false;
127 }
128 }