1 /* 2 * Copyright 2005-2013, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 * Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk> 8 */ 9 #ifndef DESKTOP_SETTINGS_PRIVATE_H 10 #define DESKTOP_SETTINGS_PRIVATE_H 11 12 13 #include "DesktopSettings.h" 14 15 #include <Locker.h> 16 17 #include "ServerFont.h" 18 19 20 struct server_read_only_memory; 21 22 23 class DesktopSettingsPrivate { 24 public: 25 DesktopSettingsPrivate( 26 server_read_only_memory* shared); 27 ~DesktopSettingsPrivate(); 28 29 status_t Save(uint32 mask = kAllSettings); 30 31 void SetDefaultPlainFont(const ServerFont& font); 32 const ServerFont& DefaultPlainFont() const; 33 34 void SetDefaultBoldFont(const ServerFont& font); 35 const ServerFont& DefaultBoldFont() const; 36 37 void SetDefaultFixedFont(const ServerFont& font); 38 const ServerFont& DefaultFixedFont() const; 39 40 void SetScrollBarInfo(const scroll_bar_info &info); 41 const scroll_bar_info& ScrollBarInfo() const; 42 43 void SetMenuInfo(const menu_info &info); 44 const menu_info& MenuInfo() const; 45 46 void SetMouseMode(mode_mouse mode); 47 mode_mouse MouseMode() const; 48 void SetFocusFollowsMouseMode( 49 mode_focus_follows_mouse mode); 50 mode_focus_follows_mouse FocusFollowsMouseMode() const; 51 bool NormalMouse() const 52 { return MouseMode() == B_NORMAL_MOUSE; } 53 bool FocusFollowsMouse() const 54 { return MouseMode() 55 == B_FOCUS_FOLLOWS_MOUSE; } 56 bool ClickToFocusMouse() const 57 { return MouseMode() 58 == B_CLICK_TO_FOCUS_MOUSE; } 59 void SetAcceptFirstClick(bool acceptFirstClick); 60 bool AcceptFirstClick() const; 61 62 void SetShowAllDraggers(bool show); 63 bool ShowAllDraggers() const; 64 65 void SetWorkspacesLayout(int32 columns, int32 rows); 66 int32 WorkspacesCount() const; 67 int32 WorkspacesColumns() const; 68 int32 WorkspacesRows() const; 69 70 void SetWorkspacesMessage(int32 index, 71 BMessage& message); 72 const BMessage* WorkspacesMessage(int32 index) const; 73 74 void SetUIColor(color_which which, 75 const rgb_color color); 76 rgb_color UIColor(color_which which) const; 77 78 void SetSubpixelAntialiasing(bool subpix); 79 bool SubpixelAntialiasing() const; 80 void SetHinting(uint8 hinting); 81 uint8 Hinting() const; 82 void SetSubpixelAverageWeight(uint8 averageWeight); 83 uint8 SubpixelAverageWeight() const; 84 void SetSubpixelOrderingRegular( 85 bool subpixelOrdering); 86 bool IsSubpixelOrderingRegular() const; 87 88 private: 89 void _SetDefaults(); 90 status_t _Load(); 91 status_t _GetPath(BPath& path); 92 void _ValidateWorkspacesLayout(int32& columns, 93 int32& rows) const; 94 95 ServerFont fPlainFont; 96 ServerFont fBoldFont; 97 ServerFont fFixedFont; 98 99 scroll_bar_info fScrollBarInfo; 100 menu_info fMenuInfo; 101 mode_mouse fMouseMode; 102 mode_focus_follows_mouse fFocusFollowsMouseMode; 103 bool fAcceptFirstClick; 104 bool fShowAllDraggers; 105 int32 fWorkspacesColumns; 106 int32 fWorkspacesRows; 107 BMessage fWorkspaceMessages[kMaxWorkspaces]; 108 109 server_read_only_memory& fShared; 110 }; 111 112 #endif /* DESKTOP_SETTINGS_PRIVATE_H */ 113