1 /* 2 * Copyright 2006, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 #ifndef OVERLAY_H 9 #define OVERLAY_H 10 11 12 #include "RGBColor.h" 13 14 #include <video_overlay.h> 15 16 //#include <GraphicsDefs.h> 17 //#include <Rect.h> 18 //#include <OS.h> 19 20 21 class HWInterface; 22 struct overlay_client_data; 23 24 25 class Overlay { 26 public: 27 Overlay(HWInterface& interface); 28 ~Overlay(); 29 30 status_t InitCheck() const; 31 32 void SetOverlayData(const overlay_buffer* overlayBuffer, 33 overlay_token token, overlay_client_data* clientData); 34 void TakeOverToken(Overlay* other); 35 36 const overlay_buffer* OverlayBuffer() const; 37 overlay_client_data* ClientData() const; 38 overlay_token OverlayToken() const; 39 40 sem_id Semaphore() const 41 { return fSemaphore; } 42 43 const RGBColor& Color() const 44 { return fColor; } 45 46 void SetVisible(bool visible) 47 { fVisible = visible; } 48 bool IsVisible() const 49 { return fVisible; } 50 51 void SetView(const BRect& source, const BRect& destination); 52 const BRect& Source() const 53 { return fSource; } 54 const BRect& Destination() const 55 { return fDestination; } 56 57 void Show(); 58 void Hide(); 59 60 private: 61 HWInterface& fHWInterface; 62 const overlay_buffer* fOverlayBuffer; 63 overlay_client_data* fClientData; 64 overlay_token fOverlayToken; 65 sem_id fSemaphore; 66 RGBColor fColor; 67 BRect fSource; 68 BRect fDestination; 69 bool fVisible; 70 }; 71 72 #endif // OVERLAY_H 73