From 8d8f5950d0c28592beaef5196091ef2a5ce92901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 18 Nov 2005 12:26:20 +0000 Subject: [PATCH] Some cleanup, mostly GetHWInterface() to HWInterface(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15016 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.h | 2 +- src/servers/app/Layer.h | 5 ---- src/servers/app/RootLayer.h | 3 --- src/servers/app/ServerApp.cpp | 39 ++++++++++++++----------------- src/servers/app/ServerScreen.cpp | 26 ++++++++++----------- src/servers/app/ServerScreen.h | 28 +++++++++++----------- src/servers/app/ServerWindow.cpp | 4 ++-- src/servers/app/VirtualScreen.cpp | 2 +- 8 files changed, 49 insertions(+), 60 deletions(-) diff --git a/src/servers/app/Desktop.h b/src/servers/app/Desktop.h index 68f295d54e..f3f04cd197 100644 --- a/src/servers/app/Desktop.h +++ b/src/servers/app/Desktop.h @@ -70,7 +70,7 @@ class Desktop : public MessageLooper, public ScreenOwner { const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; } inline DrawingEngine* GetDrawingEngine() const { return fVirtualScreen.DrawingEngine(); } - inline HWInterface* GetHWInterface() const + inline ::HWInterface* HWInterface() const { return fVirtualScreen.HWInterface(); } // Methods for layer(WinBorder) manipulation. diff --git a/src/servers/app/Layer.h b/src/servers/app/Layer.h index 671cc82cf0..a193136343 100644 --- a/src/servers/app/Layer.h +++ b/src/servers/app/Layer.h @@ -6,12 +6,7 @@ * DarkWyrm * Adi Oanca * Stephan Aßmus - * - * Description: - * Class used for tracking drawing context and screen clipping. - * One Layer per client BWindow (WindowBorder) and each BView therein. */ - #ifndef _LAYER_H_ #define _LAYER_H_ diff --git a/src/servers/app/RootLayer.h b/src/servers/app/RootLayer.h index 73a294de67..ad391a73c8 100644 --- a/src/servers/app/RootLayer.h +++ b/src/servers/app/RootLayer.h @@ -147,9 +147,6 @@ friend class Desktop; void _ProcessMouseMovedEvent(BMessage *msg); - inline HWInterface* GetHWInterface() const - { return fDesktop->GetHWInterface(); } - Desktop* fDesktop; BMessage* fDragMessage; Layer* fLastLayerUnderMouse; diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index d5a2ecf6b3..c8b7517366 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -298,10 +298,10 @@ ServerApp::Activate(bool value) //! Sets the cursor to the application cursor, if any. void -ServerApp::SetAppCursor(void) +ServerApp::SetAppCursor() { 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 // stream will get noticed directly) - if (fDesktop->EventDispatcher().InitCheck() != B_OK) { + if (fDesktop->EventDispatcher().InitCheck() != B_OK) fDesktop->EventDispatcher().SetTo(gInputManager->GetStream()); - fDesktop->EventDispatcher().SetHWInterface(fDesktop->GetHWInterface()); - fDesktop->GetHWInterface()->SetCursorVisible(true); - } break; } case AS_CREATE_WINDOW: @@ -881,7 +878,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) { STRACE(("ServerApp %s: Show Cursor\n", Signature())); // TODO: support nested showing/hiding - fDesktop->GetHWInterface()->SetCursorVisible(true); + fDesktop->HWInterface()->SetCursorVisible(true); fCursorHidden = false; break; } @@ -889,7 +886,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) { STRACE(("ServerApp %s: Hide Cursor\n", Signature())); // TODO: support nested showing/hiding - fDesktop->GetHWInterface()->SetCursorVisible(false); + fDesktop->HWInterface()->SetCursorVisible(false); fCursorHidden = true; break; } @@ -897,7 +894,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) { STRACE(("ServerApp %s: Obscure Cursor\n", Signature())); // ToDo: Enable ObscureCursor - //fDesktop->GetHWInterface()->ObscureCursor(); + //fDesktop->HWInterface()->ObscureCursor(); break; } 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 fDesktop->GetCursorManager().AddCursor(fAppCursor); - fDesktop->GetHWInterface()->SetCursor(fAppCursor); + fDesktop->HWInterface()->SetCursor(fAppCursor); break; } case AS_SET_CURSOR_BCURSOR: @@ -946,7 +943,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) ServerCursor *cursor = fDesktop->GetCursorManager().FindCursor(ctoken); if (cursor) - fDesktop->GetHWInterface()->SetCursor(cursor); + fDesktop->HWInterface()->SetCursor(cursor); if (sync) { // 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(&target); link.Read(&low); link.Read(&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 // not within the given limits (but is supported) @@ -2151,7 +2148,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) display_mode* modeList; uint32 count; - status_t status = fDesktop->GetHWInterface()->GetModeList(&modeList, &count); + status_t status = fDesktop->HWInterface()->GetModeList(&modeList, &count); if (status == B_OK) { fLink.StartMessage(B_OK); fLink.Attach(count); @@ -2225,7 +2222,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) accelerant_device_info accelerantInfo; // 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) { fLink.StartMessage(B_OK); fLink.Attach(accelerantInfo); @@ -2246,7 +2243,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) frame_buffer_config config; // 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) { fLink.StartMessage(B_OK); fLink.Attach(config); @@ -2265,7 +2262,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) screen_id id; link.Read(&id); - sem_id semaphore = fDesktop->GetHWInterface()->RetraceSemaphore(); + sem_id semaphore = fDesktop->HWInterface()->RetraceSemaphore(); fLink.StartMessage(semaphore); fLink.Flush(); break; @@ -2279,7 +2276,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) link.Read(&id); display_timing_constraints constraints; - status_t status = fDesktop->GetHWInterface()->GetTimingConstraints( + status_t status = fDesktop->HWInterface()->GetTimingConstraints( &constraints); if (status == B_OK) { fLink.StartMessage(B_OK); @@ -2301,7 +2298,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) link.Read(&mode); uint32 low, high; - status_t status = fDesktop->GetHWInterface()->GetPixelClockLimits(&mode, + status_t status = fDesktop->HWInterface()->GetPixelClockLimits(&mode, &low, &high); if (status == B_OK) { fLink.StartMessage(B_OK); @@ -2323,7 +2320,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) uint32 mode; link.Read(&mode); - status_t status = fDesktop->GetHWInterface()->SetDPMSMode(mode); + status_t status = fDesktop->HWInterface()->SetDPMSMode(mode); fLink.StartMessage(status); fLink.Flush(); @@ -2337,7 +2334,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) screen_id id; link.Read(&id); - uint32 state = fDesktop->GetHWInterface()->DPMSMode(); + uint32 state = fDesktop->HWInterface()->DPMSMode(); fLink.StartMessage(B_OK); fLink.Attach(state); fLink.Flush(); @@ -2350,7 +2347,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) screen_id id; link.Read(&id); - uint32 capabilities = fDesktop->GetHWInterface()->DPMSCapabilities(); + uint32 capabilities = fDesktop->HWInterface()->DPMSCapabilities(); fLink.StartMessage(B_OK); fLink.Attach(capabilities); fLink.Flush(); diff --git a/src/servers/app/ServerScreen.cpp b/src/servers/app/ServerScreen.cpp index fe3dbc1de8..71e3a31a5a 100644 --- a/src/servers/app/ServerScreen.cpp +++ b/src/servers/app/ServerScreen.cpp @@ -1,14 +1,13 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2005, Haiku, Inc. All rights reserved. -// Distributed under the terms of the MIT license. -// -// File Name: ServerScreen.cpp -// Author: Adi Oanca -// Axel Dörfler, axeld@pinc-software.de -// Stephan Aßmus, -// Description: Handles individual screens -// -//------------------------------------------------------------------------------ +/* + * Copyright (c) 2001-2005, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Authors: + * Adi Oanca + * Axel Dörfler, axeld@pinc-software.de + * Stephan Aßmus, + */ + #include #include @@ -23,13 +22,14 @@ #include "ServerScreen.h" -Screen::Screen(HWInterface *interface, int32 id) +Screen::Screen(::HWInterface *interface, int32 id) : fID(id), fDriver(interface ? new DrawingEngine(interface) : NULL), fHWInterface(interface) { } + Screen::Screen() : fID(-1), fDriver(NULL), @@ -180,7 +180,7 @@ Screen::_FindMode(uint16 width, uint16 height, uint32 colorspace, return B_OK; } -// _FindMode + int32 Screen::_FindMode(const display_mode* dm, uint32 count, uint16 width, uint16 height, uint32 colorspace, diff --git a/src/servers/app/ServerScreen.h b/src/servers/app/ServerScreen.h index 987a24fb8d..81d0e73d6f 100644 --- a/src/servers/app/ServerScreen.h +++ b/src/servers/app/ServerScreen.h @@ -1,26 +1,26 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2005, Haiku, Inc. All rights reserved. -// Distributed under the terms of the MIT license. -// -// File Name: ServerScreen.h -// Author: Adi Oanca -// Axel Dörfler, axeld@pinc-software.de -// Stephan Aßmus, -// Description: Handles individual screens -// -//------------------------------------------------------------------------------ +/* + * Copyright (c) 2001-2005, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Authors: + * Adi Oanca + * Axel Dörfler, axeld@pinc-software.de + * Stephan Aßmus, + */ #ifndef _SCREEN_H_ #define _SCREEN_H_ + #include #include + class DrawingEngine; class HWInterface; class Screen { public: - Screen(HWInterface *interface, int32 id); + Screen(::HWInterface *interface, int32 id); Screen(); virtual ~Screen(); @@ -47,7 +47,7 @@ class Screen { inline DrawingEngine* GetDrawingEngine() const { return fDriver; } - inline HWInterface* GetHWInterface() const + inline ::HWInterface* HWInterface() const { return fHWInterface; } private: @@ -64,7 +64,7 @@ class Screen { int32 fID; DrawingEngine* fDriver; - HWInterface* fHWInterface; + ::HWInterface* fHWInterface; }; #endif /* _SCREEN_H_ */ diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 937a1e7070..9caf70fb41 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -1583,7 +1583,7 @@ if (myRootLayer) // 1) BPoint mouse location // 2) int32 button state - fLink.Attach(fDesktop->GetHWInterface()->GetCursorPosition()); + fLink.Attach(fDesktop->HWInterface()->GetCursorPosition()); fLink.Attach(fDesktop->ActiveRootLayer()->Buttons()); fLink.Flush(); @@ -2156,7 +2156,7 @@ ServerWindow::HandleDirectConnection(int bufferState, int driverState) if ((bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) { // TODO: Locking ? - RenderingBuffer *buffer = fDesktop->GetHWInterface()->FrontBuffer(); + RenderingBuffer *buffer = fDesktop->HWInterface()->FrontBuffer(); fDirectWindowData->direct_info->bits = buffer->Bits(); fDirectWindowData->direct_info->pci_bits = NULL; // TODO fDirectWindowData->direct_info->bytes_per_row = buffer->BytesPerRow(); diff --git a/src/servers/app/VirtualScreen.cpp b/src/servers/app/VirtualScreen.cpp index 27d90ea3f5..b7163aeb7c 100644 --- a/src/servers/app/VirtualScreen.cpp +++ b/src/servers/app/VirtualScreen.cpp @@ -105,7 +105,7 @@ VirtualScreen::AddScreen(Screen* screen) // TODO: this works only for single screen configurations fDrawingEngine = screen->GetDrawingEngine(); - fHWInterface = screen->GetHWInterface(); + fHWInterface = screen->HWInterface(); fFrame = screen->Frame(); fScreenList.AddItem(item);