1 /* 2 * Copyright 2005-2009, 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 FocusFollowsMouse() const; 52 void SetAcceptFirstClick(bool acceptFirstClick); 53 bool AcceptFirstClick() const; 54 55 void SetShowAllDraggers(bool show); 56 bool ShowAllDraggers() const; 57 58 void SetWorkspacesLayout(int32 columns, int32 rows); 59 int32 WorkspacesCount() const; 60 int32 WorkspacesColumns() const; 61 int32 WorkspacesRows() const; 62 63 void SetWorkspacesMessage(int32 index, 64 BMessage& message); 65 const BMessage* WorkspacesMessage(int32 index) const; 66 67 void SetUIColor(color_which which, 68 const rgb_color color); 69 rgb_color UIColor(color_which which) const; 70 71 void SetSubpixelAntialiasing(bool subpix); 72 bool SubpixelAntialiasing() const; 73 void SetHinting(uint8 hinting); 74 uint8 Hinting() const; 75 void SetSubpixelAverageWeight(uint8 averageWeight); 76 uint8 SubpixelAverageWeight() const; 77 void SetSubpixelOrderingRegular( 78 bool subpixelOrdering); 79 bool IsSubpixelOrderingRegular() const; 80 81 private: 82 void _SetDefaults(); 83 status_t _Load(); 84 status_t _GetPath(BPath& path); 85 void _ValidateWorkspacesLayout(int32& columns, 86 int32& rows) const; 87 88 ServerFont fPlainFont; 89 ServerFont fBoldFont; 90 ServerFont fFixedFont; 91 92 scroll_bar_info fScrollBarInfo; 93 menu_info fMenuInfo; 94 mode_mouse fMouseMode; 95 mode_focus_follows_mouse fFocusFollowsMouseMode; 96 bool fAcceptFirstClick; 97 bool fShowAllDraggers; 98 int32 fWorkspacesColumns; 99 int32 fWorkspacesRows; 100 BMessage fWorkspaceMessages[kMaxWorkspaces]; 101 102 server_read_only_memory& fShared; 103 }; 104 105 #endif /* DESKTOP_SETTINGS_PRIVATE_H */ 106