From 8ee0c850de0ac6b5a2dc9f93f928f6684dcb5cec Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Tue, 13 Jan 2004 11:00:22 +0000 Subject: [PATCH] I put all that was found in Screen.h and Screen.cpp because there is another Screen.h on the system. BScren's one! git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6060 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/ServerScreen.cpp | 36 ++++++++++++++----------- src/servers/app/server/ServerScreen.h | 36 ++++++++++++++----------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/src/servers/app/server/ServerScreen.cpp b/src/servers/app/server/ServerScreen.cpp index a9460b6ec3..d721d3ac6b 100644 --- a/src/servers/app/server/ServerScreen.cpp +++ b/src/servers/app/server/ServerScreen.cpp @@ -11,27 +11,31 @@ Screen::Screen(DisplayDriver *dDriver, BPoint res, uint32 colorspace, const int32 &ID) { fID = ID; - fDriver = dDriver; + fDDriver = dDriver; SetResolution(res, colorspace); } -Screen::Screen(void) -{ -} - Screen::~Screen(void){ //printf("~Screen( %ld )\n", fID); } -bool Screen::SupportsResolution(const BPoint &res, const uint32 &colorspace) -{ - display_mode *dm=NULL; +void Screen::SetColorSpace(const uint32 &colorspace){ +// fDDriver->SetColorSpace(colorspace); +} + +uint32 Screen::ColorSpace(void) const{ +// return fDDriver->ColorSpace(); +} + +bool Screen::SupportsResolution(BPoint res, uint32 colorspace){ +// TODO: remove/improve + return true; + display_mode *dm = NULL; uint32 count; - fDriver->GetModeList(&dm, &count); + fDDriver->GetModeList(&dm, &count); - for (uint32 i=0; i < count; i++) - { + for (uint32 i=0; i < count; i++){ if (dm[i].virtual_width == (uint16)res.x && dm[i].virtual_height == (uint16)res.y && dm[i].space == colorspace) @@ -42,8 +46,7 @@ bool Screen::SupportsResolution(const BPoint &res, const uint32 &colorspace) return false; } -bool Screen::SetResolution(const BPoint &res, const uint32 &colorspace) -{ +bool Screen::SetResolution(BPoint res, uint32 colorspace){ if (!SupportsResolution(res, colorspace)) return false; @@ -53,7 +56,7 @@ bool Screen::SetResolution(const BPoint &res, const uint32 &colorspace) mode.virtual_height = (uint16)res.y; mode.space = colorspace; - fDriver->SetMode(mode); +// fDDriver->SetMode(&mode); return true; } @@ -61,7 +64,10 @@ bool Screen::SetResolution(const BPoint &res, const uint32 &colorspace) BPoint Screen::Resolution() const{ display_mode mode; - fDriver->GetMode(&mode); +// fDDriver->GetMode(&mode); +//TODO: remove! + return BPoint(fDDriver->GetWidth(), fDDriver->GetHeight()); +//------------ return BPoint(mode.virtual_width, mode.virtual_height); } diff --git a/src/servers/app/server/ServerScreen.h b/src/servers/app/server/ServerScreen.h index 49724d0a21..e57ea7ecf5 100644 --- a/src/servers/app/server/ServerScreen.h +++ b/src/servers/app/server/ServerScreen.h @@ -1,30 +1,36 @@ -#ifndef _SERVERSCREEN_H_ -#define _SERVERSCREEN_H_ +#ifndef _SCREEN_H_ +#define _SCREEN_H_ #include -#include "DisplayDriver.h" +//#include "DisplayDriver.h" +class DisplayDriver; class Screen{ public: - Screen(DisplayDriver *dDriver, BPoint res, uint32 colorspace, const int32 &ID); - Screen(void); - ~Screen(void); + Screen(DisplayDriver *dDriver, BPoint res, + uint32 colorspace, const int32 &ID); + Screen(){ ; } + ~Screen(void); - void SetID(int32 ID){ fID = ID; } + void SetColorSpace(const uint32 &colorspace); + uint32 ColorSpace(void) const; + + void SetID(int32 ID){ fID = ID; } // TODO: get/set prototype methods for graphic card features - bool SupportsResolution(const BPoint &res, const uint32 &colorspace); - bool SetResolution(const BPoint &res, const uint32 &colorspace); - BPoint Resolution() const; + bool SupportsResolution(BPoint res, uint32 colorspace); + bool SetResolution(BPoint res, uint32 colorspace); + BPoint Resolution() const; - int32 ScreenNumber(void) const; - DisplayDriver* GetDriver(void) const { return fDriver; } + int32 ScreenNumber(void) const; + DisplayDriver* DDriver() const { return fDDriver; } private: - // TODO: add members in which we should store data. - int32 fID; - DisplayDriver *fDriver; + // TODO: members in witch we should store data. + + int32 fID; + DisplayDriver *fDDriver; }; #endif