haiku/src/servers/app/ServerScreen.h
Axel Dörfler 4191a211aa * Started accelerant extension to be able to get the preferred mode from
the accelerant, as well as its EDID info. B_GET_PREFERRED_DISPLAY_MODE and
  B_GET_EDID_INFO are both optional. The preferred mode will be taken from the
  EDID info if only the latter hook is implemented, or the former returned an
  error.
* Currently, the app_server should correctly set the preferred mode on start,
  but no accelerant supports that yet, so it's not really tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22520 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 16:50:24 +00:00

72 lines
1.7 KiB
C++

/*
* Copyright (c) 2001-2006, Haiku, Inc.
* 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>
*/
#ifndef SCREEN_H
#define SCREEN_H
#include <Accelerant.h>
#include <GraphicsDefs.h>
#include <Point.h>
class DrawingEngine;
class HWInterface;
class Screen {
public:
Screen(::HWInterface *interface, int32 id);
Screen();
virtual ~Screen();
status_t Initialize();
void Shutdown();
int32 ID() const { return fID; }
status_t SetMode(const display_mode& mode, bool makeDefault);
status_t SetMode(uint16 width, uint16 height,
uint32 colorspace, float frequency,
bool makeDefault);
status_t SetPreferredMode();
void GetMode(display_mode* mode) const;
void GetMode(uint16 &width,
uint16 &height,
uint32 &colorspace,
float &frequency) const;
BRect Frame() const;
color_space ColorSpace() const;
bool IsDefaultMode() const { return fIsDefault; }
inline DrawingEngine* GetDrawingEngine() const
{ return fDriver; }
inline ::HWInterface* HWInterface() const
{ return fHWInterface; }
private:
status_t _FindMode(uint16 width,
uint16 height,
uint32 colorspace,
float frequency,
display_mode* mode) const;
int32 _FindMode(const display_mode* modeList,
uint32 count, uint16 width, uint16 height,
uint32 colorspace, float frequency) const;
int32 fID;
DrawingEngine* fDriver;
::HWInterface* fHWInterface;
bool fIsDefault;
};
#endif /* SCREEN_H */