xref: /haiku/src/servers/app/ScreenConfigurations.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
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 
15 class BMessage;
16 
17 
18 struct screen_configuration {
19 	int32			id;
20 	monitor_info	info;
21 	BRect			frame;
22 	display_mode	mode;
23 	bool			has_info;
24 	bool			is_current;
25 };
26 
27 
28 class ScreenConfigurations {
29 public:
30 								ScreenConfigurations();
31 								~ScreenConfigurations();
32 
33 			screen_configuration* CurrentByID(int32 id) const;
34 			screen_configuration* BestFit(int32 id, const monitor_info* info,
35 									bool* _exactMatch = NULL) const;
36 
37 			status_t			Set(int32 id, const monitor_info* info,
38 									const BRect& frame,
39 									const display_mode& mode);
40 			void				Remove(screen_configuration* configuration);
41 
42 			status_t			Store(BMessage& settings) const;
43 			status_t			Restore(const BMessage& settings);
44 
45 private:
46 	typedef BObjectList<screen_configuration> ConfigurationList;
47 
48 			ConfigurationList	fConfigurations;
49 };
50 
51 
52 #endif	// SCREEN_CONFIGURATIONS_H
53 
54