Some cleanup, mostly GetHWInterface() to HWInterface().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15016 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-11-18 12:26:20 +00:00
parent b43c728310
commit 8d8f5950d0
8 changed files with 49 additions and 60 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ class Desktop : public MessageLooper, public ScreenOwner {
const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; } const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; }
inline DrawingEngine* GetDrawingEngine() const inline DrawingEngine* GetDrawingEngine() const
{ return fVirtualScreen.DrawingEngine(); } { return fVirtualScreen.DrawingEngine(); }
inline HWInterface* GetHWInterface() const inline ::HWInterface* HWInterface() const
{ return fVirtualScreen.HWInterface(); } { return fVirtualScreen.HWInterface(); }
// Methods for layer(WinBorder) manipulation. // Methods for layer(WinBorder) manipulation.
-5
View File
@@ -6,12 +6,7 @@
* DarkWyrm <[email protected]> * DarkWyrm <[email protected]>
* Adi Oanca <[email protected]> * Adi Oanca <[email protected]>
* Stephan Aßmus <[email protected]> * Stephan Aßmus <[email protected]>
*
* Description:
* Class used for tracking drawing context and screen clipping.
* One Layer per client BWindow (WindowBorder) and each BView therein.
*/ */
#ifndef _LAYER_H_ #ifndef _LAYER_H_
#define _LAYER_H_ #define _LAYER_H_
-3
View File
@@ -147,9 +147,6 @@ friend class Desktop;
void _ProcessMouseMovedEvent(BMessage *msg); void _ProcessMouseMovedEvent(BMessage *msg);
inline HWInterface* GetHWInterface() const
{ return fDesktop->GetHWInterface(); }
Desktop* fDesktop; Desktop* fDesktop;
BMessage* fDragMessage; BMessage* fDragMessage;
Layer* fLastLayerUnderMouse; Layer* fLastLayerUnderMouse;
+18 -21
View File
@@ -298,10 +298,10 @@ ServerApp::Activate(bool value)
//! Sets the cursor to the application cursor, if any. //! Sets the cursor to the application cursor, if any.
void void
ServerApp::SetAppCursor(void) ServerApp::SetAppCursor()
{ {
if (fAppCursor) if (fAppCursor)
fDesktop->GetHWInterface()->SetCursor(fAppCursor); fDesktop->HWInterface()->SetCursor(fAppCursor);
} }
@@ -412,11 +412,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
// TODO: this should be done using notifications (so that an abandoned // TODO: this should be done using notifications (so that an abandoned
// stream will get noticed directly) // stream will get noticed directly)
if (fDesktop->EventDispatcher().InitCheck() != B_OK) { if (fDesktop->EventDispatcher().InitCheck() != B_OK)
fDesktop->EventDispatcher().SetTo(gInputManager->GetStream()); fDesktop->EventDispatcher().SetTo(gInputManager->GetStream());
fDesktop->EventDispatcher().SetHWInterface(fDesktop->GetHWInterface());
fDesktop->GetHWInterface()->SetCursorVisible(true);
}
break; break;
} }
case AS_CREATE_WINDOW: case AS_CREATE_WINDOW:
@@ -881,7 +878,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
{ {
STRACE(("ServerApp %s: Show Cursor\n", Signature())); STRACE(("ServerApp %s: Show Cursor\n", Signature()));
// TODO: support nested showing/hiding // TODO: support nested showing/hiding
fDesktop->GetHWInterface()->SetCursorVisible(true); fDesktop->HWInterface()->SetCursorVisible(true);
fCursorHidden = false; fCursorHidden = false;
break; break;
} }
@@ -889,7 +886,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
{ {
STRACE(("ServerApp %s: Hide Cursor\n", Signature())); STRACE(("ServerApp %s: Hide Cursor\n", Signature()));
// TODO: support nested showing/hiding // TODO: support nested showing/hiding
fDesktop->GetHWInterface()->SetCursorVisible(false); fDesktop->HWInterface()->SetCursorVisible(false);
fCursorHidden = true; fCursorHidden = true;
break; break;
} }
@@ -897,7 +894,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
{ {
STRACE(("ServerApp %s: Obscure Cursor\n", Signature())); STRACE(("ServerApp %s: Obscure Cursor\n", Signature()));
// ToDo: Enable ObscureCursor // ToDo: Enable ObscureCursor
//fDesktop->GetHWInterface()->ObscureCursor(); //fDesktop->HWInterface()->ObscureCursor();
break; break;
} }
case AS_QUERY_CURSOR_HIDDEN: case AS_QUERY_CURSOR_HIDDEN:
@@ -928,7 +925,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
// ToDo: These two should probably both be done in Desktop directly // ToDo: These two should probably both be done in Desktop directly
fDesktop->GetCursorManager().AddCursor(fAppCursor); fDesktop->GetCursorManager().AddCursor(fAppCursor);
fDesktop->GetHWInterface()->SetCursor(fAppCursor); fDesktop->HWInterface()->SetCursor(fAppCursor);
break; break;
} }
case AS_SET_CURSOR_BCURSOR: case AS_SET_CURSOR_BCURSOR:
@@ -946,7 +943,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
ServerCursor *cursor = fDesktop->GetCursorManager().FindCursor(ctoken); ServerCursor *cursor = fDesktop->GetCursorManager().FindCursor(ctoken);
if (cursor) if (cursor)
fDesktop->GetHWInterface()->SetCursor(cursor); fDesktop->HWInterface()->SetCursor(cursor);
if (sync) { if (sync) {
// the application is expecting a reply, but plans to do literally nothing // the application is expecting a reply, but plans to do literally nothing
@@ -2128,7 +2125,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
link.Read<display_mode>(&target); link.Read<display_mode>(&target);
link.Read<display_mode>(&low); link.Read<display_mode>(&low);
link.Read<display_mode>(&high); link.Read<display_mode>(&high);
status_t status = fDesktop->GetHWInterface()->ProposeMode(&target, &low, &high); status_t status = fDesktop->HWInterface()->ProposeMode(&target, &low, &high);
// ProposeMode() returns B_BAD_VALUE to hint that the candidate is // ProposeMode() returns B_BAD_VALUE to hint that the candidate is
// not within the given limits (but is supported) // not within the given limits (but is supported)
@@ -2151,7 +2148,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
display_mode* modeList; display_mode* modeList;
uint32 count; uint32 count;
status_t status = fDesktop->GetHWInterface()->GetModeList(&modeList, &count); status_t status = fDesktop->HWInterface()->GetModeList(&modeList, &count);
if (status == B_OK) { if (status == B_OK) {
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
fLink.Attach<uint32>(count); fLink.Attach<uint32>(count);
@@ -2225,7 +2222,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
accelerant_device_info accelerantInfo; accelerant_device_info accelerantInfo;
// TODO: I wonder if there should be a "desktop" lock... // TODO: I wonder if there should be a "desktop" lock...
status_t status = fDesktop->GetHWInterface()->GetDeviceInfo(&accelerantInfo); status_t status = fDesktop->HWInterface()->GetDeviceInfo(&accelerantInfo);
if (status == B_OK) { if (status == B_OK) {
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
fLink.Attach<accelerant_device_info>(accelerantInfo); fLink.Attach<accelerant_device_info>(accelerantInfo);
@@ -2246,7 +2243,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
frame_buffer_config config; frame_buffer_config config;
// TODO: I wonder if there should be a "desktop" lock... // TODO: I wonder if there should be a "desktop" lock...
status_t status = fDesktop->GetHWInterface()->GetFrameBufferConfig(config); status_t status = fDesktop->HWInterface()->GetFrameBufferConfig(config);
if (status == B_OK) { if (status == B_OK) {
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
fLink.Attach<frame_buffer_config>(config); fLink.Attach<frame_buffer_config>(config);
@@ -2265,7 +2262,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
screen_id id; screen_id id;
link.Read<screen_id>(&id); link.Read<screen_id>(&id);
sem_id semaphore = fDesktop->GetHWInterface()->RetraceSemaphore(); sem_id semaphore = fDesktop->HWInterface()->RetraceSemaphore();
fLink.StartMessage(semaphore); fLink.StartMessage(semaphore);
fLink.Flush(); fLink.Flush();
break; break;
@@ -2279,7 +2276,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
link.Read<screen_id>(&id); link.Read<screen_id>(&id);
display_timing_constraints constraints; display_timing_constraints constraints;
status_t status = fDesktop->GetHWInterface()->GetTimingConstraints( status_t status = fDesktop->HWInterface()->GetTimingConstraints(
&constraints); &constraints);
if (status == B_OK) { if (status == B_OK) {
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
@@ -2301,7 +2298,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
link.Read<display_mode>(&mode); link.Read<display_mode>(&mode);
uint32 low, high; uint32 low, high;
status_t status = fDesktop->GetHWInterface()->GetPixelClockLimits(&mode, status_t status = fDesktop->HWInterface()->GetPixelClockLimits(&mode,
&low, &high); &low, &high);
if (status == B_OK) { if (status == B_OK) {
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
@@ -2323,7 +2320,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
uint32 mode; uint32 mode;
link.Read<uint32>(&mode); link.Read<uint32>(&mode);
status_t status = fDesktop->GetHWInterface()->SetDPMSMode(mode); status_t status = fDesktop->HWInterface()->SetDPMSMode(mode);
fLink.StartMessage(status); fLink.StartMessage(status);
fLink.Flush(); fLink.Flush();
@@ -2337,7 +2334,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
screen_id id; screen_id id;
link.Read<screen_id>(&id); link.Read<screen_id>(&id);
uint32 state = fDesktop->GetHWInterface()->DPMSMode(); uint32 state = fDesktop->HWInterface()->DPMSMode();
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
fLink.Attach<uint32>(state); fLink.Attach<uint32>(state);
fLink.Flush(); fLink.Flush();
@@ -2350,7 +2347,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
screen_id id; screen_id id;
link.Read<screen_id>(&id); link.Read<screen_id>(&id);
uint32 capabilities = fDesktop->GetHWInterface()->DPMSCapabilities(); uint32 capabilities = fDesktop->HWInterface()->DPMSCapabilities();
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
fLink.Attach<uint32>(capabilities); fLink.Attach<uint32>(capabilities);
fLink.Flush(); fLink.Flush();
+13 -13
View File
@@ -1,14 +1,13 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2005, Haiku, Inc. All rights reserved. * Copyright (c) 2001-2005, Haiku, Inc.
// Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
// *
// File Name: ServerScreen.cpp * Authors:
// Author: Adi Oanca <[email protected]> * Adi Oanca <adioanca@myrealbox.com>
// Axel Dörfler, [email protected] * Axel Dörfler, axeld@pinc-software.de
// Stephan Aßmus, <[email protected]> * Stephan Aßmus, <superstippi@gmx.de>
// Description: Handles individual screens */
//
//------------------------------------------------------------------------------
#include <Accelerant.h> #include <Accelerant.h>
#include <Point.h> #include <Point.h>
@@ -23,13 +22,14 @@
#include "ServerScreen.h" #include "ServerScreen.h"
Screen::Screen(HWInterface *interface, int32 id) Screen::Screen(::HWInterface *interface, int32 id)
: fID(id), : fID(id),
fDriver(interface ? new DrawingEngine(interface) : NULL), fDriver(interface ? new DrawingEngine(interface) : NULL),
fHWInterface(interface) fHWInterface(interface)
{ {
} }
Screen::Screen() Screen::Screen()
: fID(-1), : fID(-1),
fDriver(NULL), fDriver(NULL),
@@ -180,7 +180,7 @@ Screen::_FindMode(uint16 width, uint16 height, uint32 colorspace,
return B_OK; return B_OK;
} }
// _FindMode
int32 int32
Screen::_FindMode(const display_mode* dm, uint32 count, Screen::_FindMode(const display_mode* dm, uint32 count,
uint16 width, uint16 height, uint32 colorspace, uint16 width, uint16 height, uint32 colorspace,
+14 -14
View File
@@ -1,26 +1,26 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2005, Haiku, Inc. All rights reserved. * Copyright (c) 2001-2005, Haiku, Inc.
// Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
// *
// File Name: ServerScreen.h * Authors:
// Author: Adi Oanca <[email protected]> * Adi Oanca <adioanca@myrealbox.com>
// Axel Dörfler, [email protected] * Axel Dörfler, axeld@pinc-software.de
// Stephan Aßmus, <[email protected]> * Stephan Aßmus, <superstippi@gmx.de>
// Description: Handles individual screens */
//
//------------------------------------------------------------------------------
#ifndef _SCREEN_H_ #ifndef _SCREEN_H_
#define _SCREEN_H_ #define _SCREEN_H_
#include <Accelerant.h> #include <Accelerant.h>
#include <Point.h> #include <Point.h>
class DrawingEngine; class DrawingEngine;
class HWInterface; class HWInterface;
class Screen { class Screen {
public: public:
Screen(HWInterface *interface, int32 id); Screen(::HWInterface *interface, int32 id);
Screen(); Screen();
virtual ~Screen(); virtual ~Screen();
@@ -47,7 +47,7 @@ class Screen {
inline DrawingEngine* GetDrawingEngine() const inline DrawingEngine* GetDrawingEngine() const
{ return fDriver; } { return fDriver; }
inline HWInterface* GetHWInterface() const inline ::HWInterface* HWInterface() const
{ return fHWInterface; } { return fHWInterface; }
private: private:
@@ -64,7 +64,7 @@ class Screen {
int32 fID; int32 fID;
DrawingEngine* fDriver; DrawingEngine* fDriver;
HWInterface* fHWInterface; ::HWInterface* fHWInterface;
}; };
#endif /* _SCREEN_H_ */ #endif /* _SCREEN_H_ */
+2 -2
View File
@@ -1583,7 +1583,7 @@ if (myRootLayer)
// 1) BPoint mouse location // 1) BPoint mouse location
// 2) int32 button state // 2) int32 button state
fLink.Attach<BPoint>(fDesktop->GetHWInterface()->GetCursorPosition()); fLink.Attach<BPoint>(fDesktop->HWInterface()->GetCursorPosition());
fLink.Attach<int32>(fDesktop->ActiveRootLayer()->Buttons()); fLink.Attach<int32>(fDesktop->ActiveRootLayer()->Buttons());
fLink.Flush(); fLink.Flush();
@@ -2156,7 +2156,7 @@ ServerWindow::HandleDirectConnection(int bufferState, int driverState)
if ((bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) { if ((bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) {
// TODO: Locking ? // TODO: Locking ?
RenderingBuffer *buffer = fDesktop->GetHWInterface()->FrontBuffer(); RenderingBuffer *buffer = fDesktop->HWInterface()->FrontBuffer();
fDirectWindowData->direct_info->bits = buffer->Bits(); fDirectWindowData->direct_info->bits = buffer->Bits();
fDirectWindowData->direct_info->pci_bits = NULL; // TODO fDirectWindowData->direct_info->pci_bits = NULL; // TODO
fDirectWindowData->direct_info->bytes_per_row = buffer->BytesPerRow(); fDirectWindowData->direct_info->bytes_per_row = buffer->BytesPerRow();
+1 -1
View File
@@ -105,7 +105,7 @@ VirtualScreen::AddScreen(Screen* screen)
// TODO: this works only for single screen configurations // TODO: this works only for single screen configurations
fDrawingEngine = screen->GetDrawingEngine(); fDrawingEngine = screen->GetDrawingEngine();
fHWInterface = screen->GetHWInterface(); fHWInterface = screen->HWInterface();
fFrame = screen->Frame(); fFrame = screen->Frame();
fScreenList.AddItem(item); fScreenList.AddItem(item);