1/*
2 * Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
3 * This file may be used under the terms of the MIT License.
4 */
5#ifndef SCREEN_CONFIGURATIONS_H
6#define SCREEN_CONFIGURATIONS_H
7
8
9#include <Accelerant.h>
10#include <Rect.h>
11
12#include <ObjectList.h>
13
14
15class BMessage;
16
17
18struct screen_configuration {
19 int32 id;
20 monitor_info info;
21 BRect frame;
22 display_mode mode;
23 float brightness;
24 bool has_info;
25 bool is_current;
26};
27
28
29class ScreenConfigurations {
30public:
31 ScreenConfigurations();
32 ~ScreenConfigurations();
33
34 screen_configuration* CurrentByID(int32 id) const;
35 screen_configuration* BestFit(int32 id, const monitor_info* info,
36 bool* _exactMatch = NULL) const;
37
38 status_t Set(int32 id, const monitor_info* info,
39 const BRect& frame,
40 const display_mode& mode);
41 void SetBrightness(int32 id, float brightness);
42 float Brightness(int32 id);
43 void Remove(screen_configuration* configuration);
44
45 status_t Store(BMessage& settings) const;
46 status_t Restore(const BMessage& settings);
47
48private:
49 typedef BObjectList<screen_configuration> ConfigurationList;
50
51 ConfigurationList fConfigurations;
52};
53
54
55#endif // SCREEN_CONFIGURATIONS_H
56