Make UEFI boot-platform build again
[haiku.git] / src / servers / app / DesktopSettings.h
blob48677fb2278c0834bc29bf29d47151c1668fc512
1 /*
2 * Copyright 2001-2015, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 * Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk>
8 * Joseph Groover <looncraz@looncraz.net>
9 */
10 #ifndef DESKTOP_SETTINGS_H
11 #define DESKTOP_SETTINGS_H
14 #include <InterfaceDefs.h>
15 #include <Menu.h>
16 #include <Message.h>
18 #include <ServerProtocolStructs.h>
21 class Desktop;
22 class DesktopSettingsPrivate;
23 class ServerFont;
26 static const int32 kMaxWorkspaces = 32;
28 enum {
29 kAllSettings = 0xff,
30 kWorkspacesSettings = 0x01,
31 kFontSettings = 0x02,
32 kAppearanceSettings = 0x04,
33 kMouseSettings = 0x08,
34 kDraggerSettings = 0x10,
38 class DesktopSettings {
39 public:
40 DesktopSettings(Desktop* desktop);
42 status_t Save(uint32 mask = kAllSettings);
44 void GetDefaultPlainFont(ServerFont& font) const;
45 void GetDefaultBoldFont(ServerFont& font) const;
46 void GetDefaultFixedFont(ServerFont& font) const;
48 void GetScrollBarInfo(scroll_bar_info& info) const;
49 void GetMenuInfo(menu_info& info) const;
51 mode_mouse MouseMode() const;
52 mode_focus_follows_mouse FocusFollowsMouseMode() const;
54 bool NormalMouse() const
55 { return MouseMode() == B_NORMAL_MOUSE; }
56 bool FocusFollowsMouse() const
57 { return MouseMode()
58 == B_FOCUS_FOLLOWS_MOUSE; }
59 bool ClickToFocusMouse() const
60 { return MouseMode()
61 == B_CLICK_TO_FOCUS_MOUSE; }
63 bool AcceptFirstClick() const;
65 bool ShowAllDraggers() const;
67 int32 WorkspacesCount() const;
68 int32 WorkspacesColumns() const;
69 int32 WorkspacesRows() const;
70 const BMessage* WorkspacesMessage(int32 index) const;
72 rgb_color UIColor(color_which which) const;
74 bool SubpixelAntialiasing() const;
75 uint8 Hinting() const;
76 uint8 SubpixelAverageWeight() const;
77 bool IsSubpixelOrderingRegular() const;
79 protected:
80 DesktopSettingsPrivate* fSettings;
84 class LockedDesktopSettings : public DesktopSettings {
85 public:
86 LockedDesktopSettings(Desktop* desktop);
87 ~LockedDesktopSettings();
89 void SetDefaultPlainFont(const ServerFont& font);
90 void SetDefaultBoldFont(const ServerFont& font);
91 void SetDefaultFixedFont(const ServerFont& font);
93 void SetScrollBarInfo(const scroll_bar_info& info);
94 void SetMenuInfo(const menu_info& info);
96 void SetMouseMode(mode_mouse mode);
97 void SetFocusFollowsMouseMode(
98 mode_focus_follows_mouse mode);
99 void SetAcceptFirstClick(bool acceptFirstClick);
101 void SetShowAllDraggers(bool show);
103 void SetUIColors(const BMessage& colors,
104 bool* changed = NULL);
106 void SetSubpixelAntialiasing(bool subpix);
107 void SetHinting(uint8 hinting);
108 void SetSubpixelAverageWeight(uint8 averageWeight);
109 void SetSubpixelOrderingRegular(
110 bool subpixelOrdering);
112 private:
113 Desktop* fDesktop;
117 #endif /* DESKTOP_SETTINGS_H */