1 /* 2 * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _WINDOW_SCREEN_H 6 #define _WINDOW_SCREEN_H 7 8 9 #include <Accelerant.h> 10 #include <GraphicsCard.h> 11 #include <OS.h> 12 #include <SupportDefs.h> 13 #include <Window.h> 14 #include <kernel/image.h> 15 16 17 void set_mouse_position(int32 x, int32 y); 18 // Controls the mouse cursor position on screen 19 20 21 enum { 22 B_ENABLE_VIEW_DRAWING = 0x0001, 23 B_ENABLE_DEBUGGER = 0x0002 24 }; 25 26 class BWindowScreen : public BWindow { 27 public: 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(); 33 34 virtual void Quit(); 35 virtual void ScreenConnected(bool active); 36 void Disconnect(); 37 38 virtual void WindowActivated(bool active); 39 virtual void WorkspaceActivated(int32 workspace, bool active); 40 virtual void ScreenChanged(BRect screenSize, color_space depth); 41 42 virtual void Hide(); 43 virtual void Show(); 44 45 void SetColorList(rgb_color* list, int32 firstIndex = 0, 46 int32 lastIndex = 255); 47 status_t SetSpace(uint32 space); 48 49 bool CanControlFrameBuffer(); 50 status_t SetFrameBuffer(int32 width, int32 height); 51 status_t MoveDisplayArea(int32 x, int32 y); 52 53 rgb_color* ColorList(); 54 frame_buffer_info* FrameBufferInfo(); 55 graphics_card_hook CardHookAt(int32 index); 56 graphics_card_info* CardInfo(); 57 58 void RegisterThread(thread_id thread); 59 virtual void SuspensionHook(bool active); 60 void Suspend(char* label); 61 62 private: 63 virtual status_t Perform(perform_code d, void* arg); 64 65 #if 0 66 void* IOBase(); 67 // deprecated API, always returns NULL 68 #endif 69 70 virtual void _ReservedWindowScreen1(); 71 virtual void _ReservedWindowScreen2(); 72 virtual void _ReservedWindowScreen3(); 73 virtual void _ReservedWindowScreen4(); 74 75 // not implemented: 76 BWindowScreen(); 77 BWindowScreen(BWindowScreen& other); 78 BWindowScreen &operator=(BWindowScreen& other); 79 80 status_t _InitData(uint32 space, uint32 attributes); 81 void _DisposeData(); 82 83 status_t _Activate(); 84 status_t _Deactivate(); 85 86 status_t _SetupAccelerantHooks(bool enable); 87 status_t _GetCardInfo(); 88 void _Suspend(); 89 void _Resume(); 90 status_t _GetModeFromSpace(uint32 space, display_mode* mode); 91 status_t _InitClone(); 92 status_t _AssertDisplayMode(display_mode* mode); 93 94 uint16 _reserved0; 95 bool _reserved1; 96 bool fWorkState; 97 bool fWindowState; 98 bool fActivateState; 99 int32 fLockState; 100 int32 fWorkspaceIndex; 101 102 display_mode* fOriginalDisplayMode; 103 display_mode* fDisplayMode; 104 sem_id fActivateSem; 105 sem_id fDebugSem; 106 image_id fAddonImage; 107 uint32 fAttributes; 108 109 rgb_color fPalette[256]; 110 111 graphics_card_info fCardInfo; 112 frame_buffer_info fFrameBufferInfo; 113 114 char* fDebugFrameBuffer; 115 bool fDebugState; 116 bool fDebugFirst; 117 int32 fDebugWorkspace; 118 int32 fDebugThreadCount; 119 thread_id* fDebugThreads; 120 121 uint32 fModeCount; 122 display_mode* fModeList; 123 124 GetAccelerantHook fGetAccelerantHook; 125 wait_engine_idle fWaitEngineIdle; 126 127 uint32 _reserved[162]; 128 }; 129 130 #endif // _WINDOW_SCREEN_H 131