xref: /haiku/src/servers/app/drawing/interface/virtual/ViewHWInterface.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*
2  * Copyright 2005-2009, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 #ifndef VIEW_GRAPHICS_CARD_H
9 #define VIEW_GRAPHICS_CARD_H
10 
11 
12 #include "HWInterface.h"
13 
14 #include <AutoDeleter.h>
15 
16 class BBitmap;
17 class BBitmapBuffer;
18 class CardWindow;
19 class UpdateQueue;
20 
21 
22 class ViewHWInterface : public HWInterface {
23 public:
24 								ViewHWInterface();
25 	virtual						~ViewHWInterface();
26 
27 	virtual	status_t			Initialize();
28 	virtual	status_t			Shutdown();
29 
30 	virtual	status_t			SetMode(const display_mode& mode);
31 	virtual	void				GetMode(display_mode* mode);
32 
33 	virtual status_t			GetDeviceInfo(accelerant_device_info* info);
34 	virtual status_t			GetFrameBufferConfig(
35 									frame_buffer_config& config);
36 
37 	virtual status_t			GetModeList(display_mode** _modeList,
38 									uint32* _count);
39 	virtual status_t			GetPixelClockLimits(display_mode* mode,
40 									uint32* _low, uint32* _high);
41 	virtual status_t			GetTimingConstraints(display_timing_constraints*
42 									constraints);
43 	virtual status_t			ProposeMode(display_mode* candidate,
44 									const display_mode* low,
45 									const display_mode* high);
46 
47 	virtual sem_id				RetraceSemaphore();
48 	virtual status_t			WaitForRetrace(
49 									bigtime_t timeout = B_INFINITE_TIMEOUT);
50 
51 	virtual status_t			SetDPMSMode(uint32 state);
52 	virtual uint32				DPMSMode();
53 	virtual uint32				DPMSCapabilities();
54 
55 	virtual status_t			SetBrightness(float);
56 	virtual status_t			GetBrightness(float*);
57 
58 	// frame buffer access
59 	virtual	RenderingBuffer*	FrontBuffer() const;
60 	virtual	RenderingBuffer*	BackBuffer() const;
61 	virtual	bool				IsDoubleBuffered() const;
62 
63 	virtual	status_t			Invalidate(const BRect& frame);
64 	virtual	status_t			CopyBackToFront(const BRect& frame);
65 
66 private:
67 			ObjectDeleter<BBitmapBuffer>
68 								fBackBuffer;
69 			ObjectDeleter<BBitmapBuffer>
70 								fFrontBuffer;
71 
72 			CardWindow*			fWindow;
73 
74 			display_mode		fDisplayMode;
75 };
76 
77 #endif // VIEW_GRAPHICS_CARD_H
78