2005-11-18 15:26:20 +03:00
|
|
|
/*
|
2007-10-16 00:13:55 +04:00
|
|
|
* Copyright (c) 2001-2007, Haiku, Inc.
|
2005-11-18 15:26:20 +03:00
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Adi Oanca <adioanca@myrealbox.com>
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
|
|
|
* Stephan Aßmus, <superstippi@gmx.de>
|
|
|
|
*/
|
2006-02-06 16:36:46 +03:00
|
|
|
#ifndef SCREEN_H
|
|
|
|
#define SCREEN_H
|
2004-01-12 01:12:55 +03:00
|
|
|
|
2005-11-18 15:26:20 +03:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
#include <Accelerant.h>
|
2005-11-26 19:55:23 +03:00
|
|
|
#include <GraphicsDefs.h>
|
2004-01-12 01:12:55 +03:00
|
|
|
#include <Point.h>
|
2005-05-26 13:21:51 +04:00
|
|
|
|
2005-11-18 15:26:20 +03:00
|
|
|
|
2005-11-04 18:23:54 +03:00
|
|
|
class DrawingEngine;
|
2005-06-24 03:46:17 +04:00
|
|
|
class HWInterface;
|
2004-01-12 01:12:55 +03:00
|
|
|
|
2005-05-26 13:21:51 +04:00
|
|
|
class Screen {
|
2005-06-24 03:46:17 +04:00
|
|
|
public:
|
2005-11-18 15:26:20 +03:00
|
|
|
Screen(::HWInterface *interface, int32 id);
|
2005-06-24 03:46:17 +04:00
|
|
|
Screen();
|
|
|
|
virtual ~Screen();
|
|
|
|
|
|
|
|
status_t Initialize();
|
|
|
|
void Shutdown();
|
|
|
|
|
2006-02-06 16:36:46 +03:00
|
|
|
int32 ID() const { return fID; }
|
2007-10-19 20:47:06 +04:00
|
|
|
status_t GetMonitorInfo(monitor_info& info) const;
|
2006-02-06 16:36:46 +03:00
|
|
|
|
2007-10-19 20:47:06 +04:00
|
|
|
status_t SetMode(const display_mode& mode,
|
|
|
|
bool makeDefault);
|
2006-02-06 16:36:46 +03:00
|
|
|
status_t SetMode(uint16 width, uint16 height,
|
|
|
|
uint32 colorspace, float frequency,
|
|
|
|
bool makeDefault);
|
2007-10-19 20:47:06 +04:00
|
|
|
status_t SetMode(uint16 width, uint16 height,
|
|
|
|
uint32 colorspace,
|
|
|
|
const display_timing& timing,
|
|
|
|
bool makeDefault);
|
2007-10-12 20:50:24 +04:00
|
|
|
status_t SetPreferredMode();
|
2005-06-24 03:46:17 +04:00
|
|
|
|
|
|
|
void GetMode(display_mode* mode) const;
|
2007-10-19 20:47:06 +04:00
|
|
|
void GetMode(uint16 &width, uint16 &height,
|
|
|
|
uint32 &colorspace, float &frequency) const;
|
2005-07-15 16:45:23 +04:00
|
|
|
BRect Frame() const;
|
2005-11-26 19:55:23 +03:00
|
|
|
color_space ColorSpace() const;
|
2005-07-15 16:45:23 +04:00
|
|
|
|
2006-02-06 16:36:46 +03:00
|
|
|
bool IsDefaultMode() const { return fIsDefault; }
|
2005-06-24 03:46:17 +04:00
|
|
|
|
2005-11-04 18:23:54 +03:00
|
|
|
inline DrawingEngine* GetDrawingEngine() const
|
2005-06-24 03:46:17 +04:00
|
|
|
{ return fDriver; }
|
2005-11-18 15:26:20 +03:00
|
|
|
inline ::HWInterface* HWInterface() const
|
2005-06-24 03:46:17 +04:00
|
|
|
{ return fHWInterface; }
|
|
|
|
|
|
|
|
private:
|
2007-10-19 20:47:06 +04:00
|
|
|
status_t _FindMode(uint16 width, uint16 height,
|
|
|
|
uint32 colorspace, float frequency,
|
|
|
|
display_mode* mode) const;
|
2005-06-24 03:46:17 +04:00
|
|
|
|
2005-07-17 02:50:17 +04:00
|
|
|
int32 _FindMode(const display_mode* modeList,
|
2007-10-19 20:47:06 +04:00
|
|
|
uint32 count, uint16 width, uint16 height,
|
|
|
|
uint32 colorspace, float frequency) const;
|
2005-07-17 02:50:17 +04:00
|
|
|
|
2005-06-24 03:46:17 +04:00
|
|
|
int32 fID;
|
2005-11-04 18:23:54 +03:00
|
|
|
DrawingEngine* fDriver;
|
2005-11-18 15:26:20 +03:00
|
|
|
::HWInterface* fHWInterface;
|
2006-02-06 16:36:46 +03:00
|
|
|
bool fIsDefault;
|
2004-01-12 01:12:55 +03:00
|
|
|
};
|
|
|
|
|
2006-02-06 16:36:46 +03:00
|
|
|
#endif /* SCREEN_H */
|