xref: /haiku/src/servers/app/WorkspacePrivate.h (revision 220d04022750f40f8bac8f01fa551211e28d04f2)
1 /*
2  * Copyright 2005-2009, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  */
8 #ifndef WORKSPACE_PRIVATE_H
9 #define WORKSPACE_PRIVATE_H
10 
11 
12 #include "ScreenConfigurations.h"
13 #include "WindowList.h"
14 #include "Workspace.h"
15 
16 #include <Accelerant.h>
17 #include <ObjectList.h>
18 #include <String.h>
19 
20 
21 struct display_info {
22 	BString			identifier;
23 	BPoint			origin;
24 	display_mode	mode;
25 };
26 
27 
28 class Workspace::Private {
29 public:
30 								Private();
31 								~Private();
32 
33 			int32				Index() const { return fWindows.Index(); }
34 
35 			WindowList&			Windows() { return fWindows; }
36 
37 			// displays
38 
39 			void				SetDisplaysFromDesktop(Desktop* desktop);
40 
41 			int32				CountDisplays() const
42 									{ return fDisplays.CountItems(); }
43 			const display_info*	DisplayAt(int32 index) const
44 									{ return fDisplays.ItemAt(index); }
45 
46 			// configuration
47 
48 			const rgb_color&	Color() const { return fColor; }
49 			void				SetColor(const rgb_color& color);
50 
51 			ScreenConfigurations& CurrentScreenConfiguration()
52 									{ return fCurrentScreenConfiguration; }
53 			ScreenConfigurations& StoredScreenConfiguration()
54 									{ return fStoredScreenConfiguration; }
55 
56 			void				RestoreConfiguration(const BMessage& settings);
57 			void				StoreConfiguration(BMessage& settings);
58 
59 private:
60 			void				_SetDefaults();
61 
62 			WindowList			fWindows;
63 
64 			BObjectList<display_info> fDisplays;
65 
66 			ScreenConfigurations fStoredScreenConfiguration;
67 			ScreenConfigurations fCurrentScreenConfiguration;
68 			rgb_color			fColor;
69 };
70 
71 #endif	/* WORKSPACE_PRIVATE_H */
72