xref: /haiku/src/servers/app/VirtualScreen.h (revision 239222b2369c39dc52df52b0a7cdd6cc0a91bc92)
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 VIRTUAL_SCREEN_H
9 #define VIRTUAL_SCREEN_H
10 
11 
12 #include "ScreenConfigurations.h"
13 #include "ScreenManager.h"
14 
15 #include <Message.h>
16 
17 
18 class Desktop;
19 class DrawingEngine;
20 class HWInterface;
21 
22 
23 class VirtualScreen {
24 public:
25 								VirtualScreen();
26 								~VirtualScreen();
27 
28 			::DrawingEngine*	DrawingEngine() const
29 									{ return fDrawingEngine; }
30 
31 			// TODO: can we have a multiplexing HWInterface as well?
32 			//	If not, this would need to be hidden, and only made
33 			//	available for the Screen class
34 			::HWInterface*		HWInterface() const
35 									{ return fHWInterface; }
36 
37 			status_t			SetConfiguration(Desktop& desktop,
38 									ScreenConfigurations& configurations,
39 									uint32* _changedScreens = NULL);
40 
41 			status_t			AddScreen(Screen* screen,
42 									ScreenConfigurations& configurations);
43 			status_t			RemoveScreen(Screen* screen);
44 
45 			void				UpdateFrame();
46 			BRect				Frame() const;
47 
48 			// TODO: we need to play with a real multi-screen configuration to
49 			//	figure out the specifics here
50 			void				SetScreenFrame(int32 index, BRect frame);
51 
52 			Screen*				ScreenAt(int32 index) const;
53 			Screen*				ScreenByID(int32 id) const;
54 			BRect				ScreenFrameAt(int32 index) const;
55 			int32				CountScreens() const;
56 
57 private:
58 			status_t			_GetMode(Screen* screen,
59 									ScreenConfigurations& configurations,
60 									display_mode& mode) const;
61 			void				_Reset();
62 
63 	struct screen_item {
64 		Screen*	screen;
65 		BRect	frame;
66 		// TODO: do we want to have a different color per screen as well?
67 	};
68 
69 			BRect				fFrame;
70 			BObjectList<screen_item> fScreenList;
71 			::DrawingEngine*	fDrawingEngine;
72 			::HWInterface*		fHWInterface;
73 };
74 
75 #endif	/* VIRTUAL_SCREEN_H */
76