2 * Copyright 2002-2009, Haiku Inc.
3 * Distributed under the terms of the MIT License.
6 * Stefano Ceccherini (burton666@libero.it)
7 * Axel Dörfler, axeld@pinc-software.de
9 #ifndef _PRIVATE_SCREEN_H_
10 #define _PRIVATE_SCREEN_H_
13 #include <Accelerant.h>
14 #include <GraphicsDefs.h>
15 #include <ObjectList.h>
25 #define B_CURRENT_WORKSPACE_INDEX (~0L)
30 class BPrivateScreen
{
32 // Constructor and destructor are private. Use the static methods
33 // Get() and Put() instead.
35 static BPrivateScreen
* Get(BWindow
* window
);
36 static BPrivateScreen
* Get(int32 id
);
37 static void Put(BPrivateScreen
* screen
);
39 static BPrivateScreen
* GetNext(BPrivateScreen
* screen
);
42 color_space
ColorSpace();
44 int32
ID() const { return fID
; }
45 status_t
GetNextID(int32
& id
);
47 status_t
WaitForRetrace(bigtime_t timeout
);
49 uint8
IndexForColor(uint8 red
, uint8 green
,
50 uint8 blue
, uint8 alpha
);
51 rgb_color
ColorForIndex(const uint8 index
);
52 uint8
InvertIndex(uint8 index
);
54 const color_map
* ColorMap();
56 status_t
GetBitmap(BBitmap
** bitmap
, bool drawCursor
,
58 status_t
ReadBitmap(BBitmap
* bitmap
, bool drawCursor
,
61 rgb_color
DesktopColor(uint32 index
);
62 void SetDesktopColor(rgb_color
, uint32
, bool);
64 status_t
ProposeMode(display_mode
* target
,
65 const display_mode
* low
,
66 const display_mode
* high
);
68 status_t
GetModeList(display_mode
** _modeList
,
70 status_t
GetMode(uint32 workspace
, display_mode
* mode
);
71 status_t
SetMode(uint32 workspace
, display_mode
* mode
,
74 status_t
GetDeviceInfo(accelerant_device_info
* info
);
75 status_t
GetMonitorInfo(monitor_info
* info
);
76 status_t
GetPixelClockLimits(display_mode
* mode
,
77 uint32
* _low
, uint32
* _high
);
78 status_t
GetTimingConstraints(
79 display_timing_constraints
* constraints
);
81 status_t
SetDPMS(uint32 dpmsState
);
83 uint32
DPMSCapabilites();
85 status_t
GetBrightness(float*);
86 status_t
SetBrightness(float);
92 friend class BObjectList
<BPrivateScreen
>;
94 BPrivateScreen(int32 id
);
100 sem_id
_RetraceSemaphore();
101 status_t
_GetFrameBufferConfig(
102 frame_buffer_config
& config
);
104 static BPrivateScreen
* _Get(int32 id
, bool check
);
105 static bool _IsValid(int32 id
);
109 int32 fReferenceCount
;
110 color_map
* fColorMap
;
112 bool fRetraceSemValid
;
115 bigtime_t fLastUpdate
;
118 } // namespace BPrivate
120 #endif // _PRIVATE_SCREEN_H_