docs/ikteam: Delete most files.
[haiku.git] / src / preferences / screen / ScreenMode.h
bloba22981e3f24d49345710051bfef1bc3f3ed1e3ee
1 /*
2 * Copyright 2005-2011, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 */
8 #ifndef SCREEN_MODE_H
9 #define SCREEN_MODE_H
12 #include <Screen.h>
15 typedef enum {
16 kCombineDisable,
17 kCombineHorizontally,
18 kCombineVertically
19 } combine_mode;
21 struct screen_mode {
22 int32 width; // these reflect the corrected width/height,
23 int32 height; // taking the combine mode into account
24 color_space space;
25 float refresh;
26 combine_mode combine;
27 bool swap_displays;
28 bool use_laptop_panel;
29 uint32 tv_standard;
31 void SetTo(display_mode& mode);
32 int32 BitsPerPixel() const;
34 bool operator==(const screen_mode &otherMode) const;
35 bool operator!=(const screen_mode &otherMode) const;
39 class ScreenMode {
40 public:
41 ScreenMode(BWindow* window);
42 ~ScreenMode();
44 status_t Set(const screen_mode& mode,
45 int32 workspace = ~0);
46 status_t Get(screen_mode& mode,
47 int32 workspace = ~0) const;
48 status_t GetOriginalMode(screen_mode &mode,
49 int32 workspace = ~0) const;
51 status_t Set(const display_mode& mode,
52 int32 workspace = ~0);
53 status_t Get(display_mode& mode,
54 int32 workspace = ~0) const;
56 status_t Revert();
57 void UpdateOriginalModes();
59 bool SupportsColorSpace(const screen_mode& mode,
60 color_space space);
61 status_t GetRefreshLimits(const screen_mode& mode,
62 float& min, float& max);
63 status_t GetMonitorInfo(monitor_info& info,
64 float* _diagonalInches = NULL);
66 status_t GetDeviceInfo(accelerant_device_info& info);
68 screen_mode ModeAt(int32 index);
69 const display_mode& DisplayModeAt(int32 index);
70 int32 CountModes();
72 private:
73 bool _GetDisplayMode(const screen_mode& mode,
74 display_mode& displayMode);
76 private:
77 BWindow* fWindow;
78 display_mode* fModeList;
79 uint32 fModeCount;
81 bool fUpdatedModes;
82 display_mode fOriginalDisplayMode[32];
83 screen_mode fOriginal[32];
87 #endif /* SCREEN_MODE_H */