2005-07-17 20:25:48 +04:00
|
|
|
/*
|
2007-02-21 10:57:21 +03:00
|
|
|
* Copyright 2001-2007, Haiku.
|
2005-07-17 20:25:48 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
2008-07-10 12:29:50 +04:00
|
|
|
* Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk>
|
2005-07-17 20:25:48 +04:00
|
|
|
*/
|
|
|
|
#ifndef DESKTOP_SETTINGS_H
|
|
|
|
#define DESKTOP_SETTINGS_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <InterfaceDefs.h>
|
|
|
|
#include <Menu.h>
|
|
|
|
#include <Message.h>
|
|
|
|
|
|
|
|
class Desktop;
|
2006-08-26 19:13:08 +04:00
|
|
|
class DesktopSettingsPrivate;
|
2005-11-03 20:03:36 +03:00
|
|
|
class ServerFont;
|
2005-07-17 20:25:48 +04:00
|
|
|
|
|
|
|
|
|
|
|
static const int32 kMaxWorkspaces = 32;
|
|
|
|
|
2006-02-06 16:36:46 +03:00
|
|
|
enum {
|
|
|
|
kAllSettings = 0xff,
|
|
|
|
kWorkspacesSettings = 0x01,
|
|
|
|
kFontSettings = 0x02,
|
2006-05-31 23:23:26 +04:00
|
|
|
kAppearanceSettings = 0x04,
|
|
|
|
kMouseSettings = 0x08,
|
2007-02-21 10:57:21 +03:00
|
|
|
kDraggerSettings = 0x10,
|
2006-02-06 16:36:46 +03:00
|
|
|
};
|
2005-07-17 20:25:48 +04:00
|
|
|
|
|
|
|
class DesktopSettings {
|
|
|
|
public:
|
|
|
|
DesktopSettings(Desktop* desktop);
|
|
|
|
|
2006-02-06 16:36:46 +03:00
|
|
|
status_t Save(uint32 mask = kAllSettings);
|
2005-07-17 20:25:48 +04:00
|
|
|
|
2005-11-03 20:03:36 +03:00
|
|
|
void GetDefaultPlainFont(ServerFont& font) const;
|
|
|
|
void GetDefaultBoldFont(ServerFont& font) const;
|
|
|
|
void GetDefaultFixedFont(ServerFont& font) const;
|
|
|
|
|
2005-07-17 20:25:48 +04:00
|
|
|
void GetScrollBarInfo(scroll_bar_info& info) const;
|
|
|
|
void GetMenuInfo(menu_info& info) const;
|
|
|
|
|
|
|
|
mode_mouse MouseMode() const;
|
|
|
|
bool FocusFollowsMouse() const;
|
|
|
|
|
2007-02-21 10:57:21 +03:00
|
|
|
bool ShowAllDraggers() const;
|
|
|
|
|
2005-07-17 20:25:48 +04:00
|
|
|
int32 WorkspacesCount() const;
|
|
|
|
const BMessage* WorkspacesMessage(int32 index) const;
|
|
|
|
|
2007-11-30 04:21:19 +03:00
|
|
|
rgb_color UIColor(color_which which) const;
|
|
|
|
|
2008-08-03 17:40:41 +04:00
|
|
|
bool SubpixelAntialiasing() const;
|
2008-07-10 12:29:50 +04:00
|
|
|
bool Hinting() const;
|
2008-08-03 17:40:41 +04:00
|
|
|
uint8 SubpixelAverageWeight() const;
|
|
|
|
bool IsSubpixelOrderingRegular() const;
|
2008-07-10 12:29:50 +04:00
|
|
|
|
2007-02-21 10:57:21 +03:00
|
|
|
protected:
|
2006-08-26 19:13:08 +04:00
|
|
|
DesktopSettingsPrivate* fSettings;
|
|
|
|
};
|
|
|
|
|
2007-02-21 10:57:21 +03:00
|
|
|
class LockedDesktopSettings : public DesktopSettings {
|
2006-08-26 19:13:08 +04:00
|
|
|
public:
|
|
|
|
LockedDesktopSettings(Desktop* desktop);
|
|
|
|
~LockedDesktopSettings();
|
|
|
|
|
|
|
|
void SetDefaultPlainFont(const ServerFont& font);
|
|
|
|
void SetDefaultBoldFont(const ServerFont& font);
|
|
|
|
void SetDefaultFixedFont(const ServerFont& font);
|
|
|
|
|
|
|
|
void SetScrollBarInfo(const scroll_bar_info& info);
|
|
|
|
void SetMenuInfo(const menu_info& info);
|
|
|
|
|
|
|
|
void SetMouseMode(mode_mouse mode);
|
|
|
|
|
2007-02-21 10:57:21 +03:00
|
|
|
void SetShowAllDraggers(bool show);
|
2005-07-17 20:25:48 +04:00
|
|
|
|
2007-11-30 04:21:19 +03:00
|
|
|
void SetUIColor(color_which which, const rgb_color color);
|
|
|
|
|
2008-08-03 17:40:41 +04:00
|
|
|
void SetSubpixelAntialiasing(bool subpix);
|
2008-07-10 12:29:50 +04:00
|
|
|
void SetHinting(bool hinting);
|
2008-08-03 17:40:41 +04:00
|
|
|
void SetSubpixelAverageWeight(uint8 averageWeight);
|
|
|
|
void SetSubpixelOrderingRegular(bool subpixelOrdering);
|
2008-07-10 12:29:50 +04:00
|
|
|
|
2007-02-21 10:57:21 +03:00
|
|
|
private:
|
2006-08-26 19:13:08 +04:00
|
|
|
Desktop* fDesktop;
|
2005-07-17 20:25:48 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DESKTOP_SETTINGS_H */
|