xref: /haiku/src/servers/app/VirtualScreen.h (revision 93a78ecaa45114d68952d08c4778f073515102f2)
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, const BMessage* settings);
35 		status_t			StoreConfiguration(BMessage& settings);
36 
37 		status_t			AddScreen(Screen* screen);
38 		status_t			RemoveScreen(Screen* screen);
39 
40 		void				UpdateFrame();
41 		BRect				Frame() const;
42 
43 		// TODO: we need to play with a real multi-screen configuration to
44 		//	figure out the specifics here - possibly in the test environment?
45 		void				SetScreenFrame(int32 index, BRect frame);
46 
47 		Screen*				ScreenAt(int32 index) const;
48 		BRect				ScreenFrameAt(int32 index) const;
49 		int32				CountScreens() const;
50 
51 	private:
52 		status_t			_FindConfiguration(Screen* screen, BMessage& settings);
53 		void				_Reset();
54 
55 		struct screen_item {
56 			Screen*	screen;
57 			BRect	frame;
58 			// TODO: do we want to have a different color per screen as well?
59 		};
60 
61 		BMessage			fSettings;
62 		BRect				fFrame;
63 		BObjectList<screen_item> fScreenList;
64 		::DrawingEngine*	fDrawingEngine;
65 		::HWInterface*		fHWInterface;
66 };
67 
68 #endif	/* VIRTUAL_SCREEN_H */
69