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