xref: /haiku/src/servers/app/VirtualScreen.h (revision 1214ef1b2100f2b3299fc9d8d6142e46f70a4c3f)
1 /*
2  * Copyright 2005-2007, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Axel Dörfler, axeld@pinc-software.de
7  */
8 #ifndef VIRTUAL_SCREEN_H
9 #define VIRTUAL_SCREEN_H
10 
11 
12 #include "ScreenManager.h"
13 
14 #include <Message.h>
15 
16 class Desktop;
17 class DrawingEngine;
18 class HWInterface;
19 
20 
21 class VirtualScreen {
22 	public:
23 		VirtualScreen();
24 		~VirtualScreen();
25 
26 		::DrawingEngine*	DrawingEngine() const
27 								{ return fDrawingEngine; }
28 		// TODO: can we have a multiplexing HWInterface as well?
29 		//	If not, this would need to be hidden, and only made
30 		//	available for the Screen class
31 		::HWInterface*		HWInterface() const
32 								{ return fHWInterface; }
33 
34 		status_t			RestoreConfiguration(Desktop& desktop,
35 								const BMessage* settings);
36 		status_t			StoreConfiguration(BMessage& settings);
37 
38 		status_t			AddScreen(Screen* screen);
39 		status_t			RemoveScreen(Screen* screen);
40 
41 		void				UpdateFrame();
42 		BRect				Frame() const;
43 
44 		// TODO: we need to play with a real multi-screen configuration to
45 		//	figure out the specifics here - possibly in the test environment?
46 		void				SetScreenFrame(int32 index, BRect frame);
47 
48 		Screen*				ScreenAt(int32 index) const;
49 		BRect				ScreenFrameAt(int32 index) const;
50 		int32				CountScreens() const;
51 
52 	private:
53 		status_t			_GetConfiguration(Screen* screen,
54 								BMessage& settings);
55 		void				_Reset();
56 
57 		struct screen_item {
58 			Screen*	screen;
59 			BRect	frame;
60 			// TODO: do we want to have a different color per screen as well?
61 		};
62 
63 		BMessage			fSettings;
64 		BRect				fFrame;
65 		BObjectList<screen_item> fScreenList;
66 		::DrawingEngine*	fDrawingEngine;
67 		::HWInterface*		fHWInterface;
68 };
69 
70 #endif	/* VIRTUAL_SCREEN_H */
71