usb_ecm: Use the current configuration instead of a fixed one.
[haiku.git] / src / servers / app / ScreenConfigurations.h
blob2a9d4523b97b46a5a1f04fe7f429dad0270c19de
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
9 #include <Accelerant.h>
10 #include <Rect.h>
12 #include <ObjectList.h>
15 class BMessage;
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;
28 class ScreenConfigurations {
29 public:
30 ScreenConfigurations();
31 ~ScreenConfigurations();
33 screen_configuration* CurrentByID(int32 id) const;
34 screen_configuration* BestFit(int32 id, const monitor_info* info,
35 bool* _exactMatch = NULL) const;
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);
42 status_t Store(BMessage& settings) const;
43 status_t Restore(const BMessage& settings);
45 private:
46 typedef BObjectList<screen_configuration> ConfigurationList;
48 ConfigurationList fConfigurations;
52 #endif // SCREEN_CONFIGURATIONS_H