2 * Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _WINDOW_SCREEN_H
6 #define _WINDOW_SCREEN_H
9 #include <Accelerant.h>
10 #include <GraphicsCard.h>
12 #include <SupportDefs.h>
14 #include <kernel/image.h>
17 void set_mouse_position(int32 x
, int32 y
);
18 // Controls the mouse cursor position on screen
22 B_ENABLE_VIEW_DRAWING
= 0x0001,
23 B_ENABLE_DEBUGGER
= 0x0002
26 class BWindowScreen
: public BWindow
{
28 BWindowScreen(const char* title
, uint32 space
,
29 status_t
* _error
, bool debugMode
= false);
30 BWindowScreen(const char* title
, uint32 space
,
31 uint32 attributes
, status_t
* _error
);
32 virtual ~BWindowScreen();
35 virtual void ScreenConnected(bool active
);
38 virtual void WindowActivated(bool active
);
39 virtual void WorkspaceActivated(int32 workspace
, bool active
);
40 virtual void ScreenChanged(BRect screenSize
, color_space depth
);
45 void SetColorList(rgb_color
* list
, int32 firstIndex
= 0,
46 int32 lastIndex
= 255);
47 status_t
SetSpace(uint32 space
);
49 bool CanControlFrameBuffer();
50 status_t
SetFrameBuffer(int32 width
, int32 height
);
51 status_t
MoveDisplayArea(int32 x
, int32 y
);
53 rgb_color
* ColorList();
54 frame_buffer_info
* FrameBufferInfo();
55 graphics_card_hook
CardHookAt(int32 index
);
56 graphics_card_info
* CardInfo();
58 void RegisterThread(thread_id thread
);
59 virtual void SuspensionHook(bool active
);
60 void Suspend(char* label
);
63 virtual status_t
Perform(perform_code d
, void* arg
);
67 // deprecated API, always returns NULL
70 virtual void _ReservedWindowScreen1();
71 virtual void _ReservedWindowScreen2();
72 virtual void _ReservedWindowScreen3();
73 virtual void _ReservedWindowScreen4();
77 BWindowScreen(BWindowScreen
& other
);
78 BWindowScreen
&operator=(BWindowScreen
& other
);
80 status_t
_InitData(uint32 space
, uint32 attributes
);
83 status_t
_LockScreen(bool lock
);
85 status_t
_Deactivate();
87 status_t
_SetupAccelerantHooks();
88 void _ResetAccelerantHooks();
90 status_t
_GetCardInfo();
93 status_t
_GetModeFromSpace(uint32 space
, display_mode
* mode
);
94 status_t
_InitClone();
95 status_t
_AssertDisplayMode(display_mode
* mode
);
103 int32 fWorkspaceIndex
;
105 display_mode
* fOriginalDisplayMode
;
106 display_mode
* fDisplayMode
;
108 image_id fAddonImage
;
111 rgb_color fPalette
[256];
113 graphics_card_info fCardInfo
;
114 frame_buffer_info fFrameBufferInfo
;
116 char* fDebugFrameBuffer
;
119 int32 fDebugWorkspace
;
120 int32 fDebugThreadCount
;
121 thread_id
* fDebugThreads
;
124 display_mode
* fModeList
;
126 GetAccelerantHook fGetAccelerantHook
;
127 wait_engine_idle fWaitEngineIdle
;
129 uint32 _reserved
[163];
132 #endif // _WINDOW_SCREEN_H