diff --git a/headers/private/servers/app/DisplayDriver.h b/headers/private/servers/app/DisplayDriver.h deleted file mode 100644 index 17f2b9f355..0000000000 --- a/headers/private/servers/app/DisplayDriver.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2001-2005, Haiku, Inc. - * Distributed under the terms of the MIT License. - * - * Authors: - * DarkWyrm - * Gabe Yoder - * Stephan Aßmus - */ -#ifndef _DISPLAY_DRIVER_H_ -#define _DISPLAY_DRIVER_H_ - - -#include -#include -#include -#include - -class BPoint; -class BRect; -class BRegion; - -class DrawState; -class HWInterface; -class RGBColor; -class ServerBitmap; -class ServerCursor; -class ServerFont; - -/*! - \brief Data structure for passing cursor information to hardware drivers. -*/ -/*typedef struct -{ - uchar *xormask, *andmask; - int32 width, height; - int32 hotx, hoty; - -} cursor_data;*/ - -typedef struct -{ - BPoint pt1; - BPoint pt2; - rgb_color color; - -} LineArrayData; - -class DisplayDriver { -public: - DisplayDriver(); - virtual ~DisplayDriver(); - - // when implementing, be sure to call the inherited version - virtual status_t Initialize(); - virtual void Shutdown(); - - // call this on mode changes! - virtual void Update() = 0; - - virtual void SetHWInterface(HWInterface* interface) = 0; - - // clipping for all drawing functions - virtual void ConstrainClippingRegion(BRegion* region) = 0; - - // Graphics calls implemented in DisplayDriver - virtual void CopyRegion( /*const*/ BRegion* region, - int32 xOffset, - int32 yOffset) = 0; - - virtual void CopyRegionList( BList* list, - BList* pList, - int32 rCount, - BRegion* clipReg) = 0; - - virtual void InvertRect( BRect r) = 0; - - virtual void DrawBitmap( ServerBitmap *bitmap, - const BRect &source, - const BRect &dest, - const DrawState *d) = 0; - - virtual void FillArc( BRect r, - const float &angle, - const float &span, - const DrawState *d) = 0; - - virtual void FillBezier( BPoint *pts, - const DrawState *d) = 0; - - virtual void FillEllipse( BRect r, - const DrawState *d) = 0; - - virtual void FillPolygon( BPoint *ptlist, - int32 numpts, - BRect bounds, - const DrawState *d) = 0; - - virtual void FillRect( BRect r, - const RGBColor &color) = 0; - - virtual void FillRect( BRect r, - const DrawState *d) = 0; - - virtual void FillRegion( BRegion &r, - const DrawState *d) = 0; - - virtual void FillRoundRect( BRect r, - const float &xrad, - const float &yrad, - const DrawState *d) = 0; - - virtual void FillShape( const BRect &bounds, - const int32 &opcount, - const int32 *oplist, - const int32 &ptcount, - const BPoint *ptlist, - const DrawState *d) = 0; - - virtual void FillTriangle( BPoint *pts, - BRect bounds, - const DrawState *d) = 0; - - virtual void StrokeArc( BRect r, - const float &angle, - const float &span, - const DrawState *d) = 0; - - virtual void StrokeBezier( BPoint *pts, - const DrawState *d) = 0; - - virtual void StrokeEllipse( BRect r, - const DrawState *d) = 0; - - // this version used by Decorator - virtual void StrokeLine( const BPoint &start, - const BPoint &end, - const RGBColor &color) = 0; - - virtual void StrokeLine( const BPoint &start, - const BPoint &end, - DrawState *d) = 0; - - virtual void StrokeLineArray(const int32 &numlines, - const LineArrayData *data, - const DrawState *d) = 0; - - // this version used by Decorator - virtual void StrokePoint( const BPoint &pt, - const RGBColor &color) = 0; - - virtual void StrokePoint( const BPoint &pt, - DrawState *d) = 0; - - virtual void StrokePolygon( BPoint *ptlist, - int32 numpts, - BRect bounds, - const DrawState *d, - bool is_closed=true) = 0; - - // this version used by Decorator - virtual void StrokeRect( BRect r, - const RGBColor &color) = 0; - - virtual void StrokeRect( BRect r, - const DrawState *d) = 0; - - virtual void StrokeRegion( BRegion &r, - const DrawState *d) = 0; - - virtual void StrokeRoundRect(BRect r, - const float &xrad, - const float &yrad, - const DrawState *d) = 0; - - virtual void StrokeShape( const BRect &bounds, - const int32 &opcount, - const int32 *oplist, - const int32 &ptcount, - const BPoint *ptlist, - const DrawState *d) = 0; - - virtual void StrokeTriangle( BPoint *pts, - const BRect &bounds, - const DrawState *d) = 0; - - // Font-related calls - - // DrawState is NOT const because this call updates the pen position in the passed DrawState - virtual void DrawString( const char* string, - int32 length, - const BPoint& pt, - DrawState* d, - escapement_delta *delta = NULL) = 0; - -/* virtual void DrawString( const char *string, - const int32 &length, - const BPoint &pt, - const RGBColor &color, - escapement_delta *delta = NULL) = 0;*/ - - virtual float StringWidth( const char* string, - int32 length, - const DrawState* d, - escapement_delta *delta = NULL) = 0; - - virtual float StringWidth( const char* string, - int32 length, - const ServerFont& font, - escapement_delta *delta = NULL) = 0; - - virtual float StringHeight( const char *string, - int32 length, - const DrawState *d) = 0; - - virtual bool Lock() = 0; - virtual void Unlock() = 0; - - virtual bool DumpToFile(const char *path) = 0; - virtual ServerBitmap* DumpToBitmap() = 0; - -}; - -#endif diff --git a/headers/private/servers/app/DisplayDriverPainter.h b/headers/private/servers/app/DrawingEngine.h similarity index 98% rename from headers/private/servers/app/DisplayDriverPainter.h rename to headers/private/servers/app/DrawingEngine.h index 12079830d2..9960f0ede6 100644 --- a/headers/private/servers/app/DisplayDriverPainter.h +++ b/headers/private/servers/app/DrawingEngine.h @@ -7,8 +7,8 @@ * Gabe Yoder * Stephan Aßmus */ -#ifndef _DISPLAY_DRIVER_H_ -#define _DISPLAY_DRIVER_H_ +#ifndef DRAWING_ENGINE_H_ +#define DRAWING_ENGINE_H_ #include @@ -229,4 +229,4 @@ public: uint32 fAvailableHWAccleration; }; -#endif // _DISPLAY_DRIVER_PAINTER_H_ +#endif // DRAWING_ENGINE_H_ diff --git a/src/servers/app/Decorator.cpp b/src/servers/app/Decorator.cpp index 83dedff225..b6947dae17 100644 --- a/src/servers/app/Decorator.cpp +++ b/src/servers/app/Decorator.cpp @@ -11,7 +11,7 @@ #include "ColorSet.h" #include "Decorator.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include diff --git a/src/servers/app/DefaultDecorator.cpp b/src/servers/app/DefaultDecorator.cpp index 8e2835f3a9..eb96477301 100644 --- a/src/servers/app/DefaultDecorator.cpp +++ b/src/servers/app/DefaultDecorator.cpp @@ -14,7 +14,7 @@ #include "ColorUtils.h" #include "DesktopSettings.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "DrawState.h" #include "FontManager.h" #include "PatternHandler.h" diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index dc22d429cb..b72d94e2c0 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -20,7 +20,7 @@ #include #include "AppServer.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "Globals.h" #include "Layer.h" #include "RootLayer.h" diff --git a/src/servers/app/Jamfile b/src/servers/app/Jamfile index ce571d309a..3a75d46212 100644 --- a/src/servers/app/Jamfile +++ b/src/servers/app/Jamfile @@ -42,7 +42,6 @@ SharedLibrary libappserver.so : # drawing PatternHandler.cpp - DisplayDriver.cpp # libraries : libroot.so libbe.so libfreetype.so libtextencoding.so @@ -69,11 +68,11 @@ Server app_server : ServerApp.cpp ServerWindow.cpp - # DisplayDriver Classes + # DrawingEngine Classes AccelerantBuffer.cpp AccelerantHWInterface.cpp BitmapBuffer.cpp - DisplayDriverPainter.cpp + DrawingEngine.cpp MallocBuffer.cpp UpdateQueue.cpp diff --git a/src/servers/app/Layer.cpp b/src/servers/app/Layer.cpp index 733571b803..633c14cead 100644 --- a/src/servers/app/Layer.cpp +++ b/src/servers/app/Layer.cpp @@ -37,7 +37,7 @@ #include #include "DebugInfoManager.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "DrawState.h" #include "PortLink.h" #include "RootLayer.h" diff --git a/src/servers/app/OffscreenWinBorder.cpp b/src/servers/app/OffscreenWinBorder.cpp index 50437c23ef..db39367c54 100644 --- a/src/servers/app/OffscreenWinBorder.cpp +++ b/src/servers/app/OffscreenWinBorder.cpp @@ -11,7 +11,7 @@ #include "DebugInfoManager.h" #include "BitmapHWInterface.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "ServerBitmap.h" #include "OffscreenWinBorder.h" diff --git a/src/servers/app/PicturePlayer.cpp b/src/servers/app/PicturePlayer.cpp index ef7eec787b..79e6a7b322 100644 --- a/src/servers/app/PicturePlayer.cpp +++ b/src/servers/app/PicturePlayer.cpp @@ -32,13 +32,13 @@ #include "ServerBitmap.h" -#include "DisplayDriver.h" +#include "DrawingEngine.h" #include "PictureProtocol.h" #include "Utils.h" #include "PicturePlayer.h" -PicturePlayer::PicturePlayer(DisplayDriver *d,void *data, int32 size) +PicturePlayer::PicturePlayer(DrawingEngine *d,void *data, int32 size) : fData(data, size) { fdriver=d; diff --git a/src/servers/app/PicturePlayer.h b/src/servers/app/PicturePlayer.h index c16034d719..51c6a48f64 100644 --- a/src/servers/app/PicturePlayer.h +++ b/src/servers/app/PicturePlayer.h @@ -35,12 +35,12 @@ #include "DrawState.h" #include "PatternHandler.h" // for pattern_union -class DisplayDriver; +class DrawingEngine; class PicturePlayer { public: - PicturePlayer(DisplayDriver *driver,void *data, int32 size); + PicturePlayer(DrawingEngine *driver,void *data, int32 size); virtual ~PicturePlayer(); int16 GetOp(); @@ -87,7 +87,7 @@ public: private: BMemoryIO fData; int32 fSize; - DisplayDriver *fdriver; + DrawingEngine *fdriver; DrawState fldata; BPoint forigin; Pattern stipplepat; diff --git a/src/servers/app/RootLayer.cpp b/src/servers/app/RootLayer.cpp index a71397ce95..1eef43cfc8 100644 --- a/src/servers/app/RootLayer.cpp +++ b/src/servers/app/RootLayer.cpp @@ -23,7 +23,7 @@ #include #include "Decorator.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "Globals.h" #include "HWInterface.h" #include "Layer.h" diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 07c99cd3ea..0a7055a515 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -35,7 +35,7 @@ #include "CursorSet.h" #include "Desktop.h" #include "DecorManager.h" -#include "DisplayDriver.h" +#include "DrawingEngine.h" #include "FontManager.h" #include "HWInterface.h" //#include "DrawState.h" @@ -454,7 +454,7 @@ ServerApp::_MessageLooper() STRACE(("ServerApp %s:Server shutdown notification received\n", Signature())); // If we are using the real, accelerated version of the - // DisplayDriver, we do NOT want the user to be able shut down + // DrawingEngine, we do NOT want the user to be able shut down // the server. The results would NOT be pretty #if TEST_MODE BMessage pleaseQuit(B_QUIT_REQUESTED); @@ -1331,7 +1331,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link) if (!stringArray[i] || lengthArray[i] <= 0) widthArray[i] = 0.0; else { - //widthArray[i] = fDesktop->GetDisplayDriver()->StringWidth(stringArray[i], lengthArray[i], font); + //widthArray[i] = fDesktop->GetDrawingEngine()->StringWidth(stringArray[i], lengthArray[i], font); // NOTE: The line below will return the exact same thing. However, // the line above uses the AGG rendering backend, for which glyph caching // actually works. It is about 20 times faster! diff --git a/src/servers/app/ServerScreen.cpp b/src/servers/app/ServerScreen.cpp index 5517ac25ac..fe3dbc1de8 100644 --- a/src/servers/app/ServerScreen.cpp +++ b/src/servers/app/ServerScreen.cpp @@ -17,7 +17,7 @@ #include #include -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "HWInterface.h" #include "ServerScreen.h" diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 47e11c94cd..b7c36f9853 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -39,7 +39,7 @@ #include "BGet++.h" #include "DebugInfoManager.h" #include "Desktop.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" #include "HWInterface.h" #include "Layer.h" #include "MessagePrivate.h" diff --git a/src/servers/app/VirtualScreen.cpp b/src/servers/app/VirtualScreen.cpp index 23b6b6dfe7..3bafb2c693 100644 --- a/src/servers/app/VirtualScreen.cpp +++ b/src/servers/app/VirtualScreen.cpp @@ -9,7 +9,6 @@ #include "VirtualScreen.h" -#include #include "HWInterface.h" #include "Desktop.h" diff --git a/src/servers/app/WorkspacesLayer.cpp b/src/servers/app/WorkspacesLayer.cpp index ece20ec77d..24624f47d3 100644 --- a/src/servers/app/WorkspacesLayer.cpp +++ b/src/servers/app/WorkspacesLayer.cpp @@ -4,19 +4,20 @@ * * Authors: * Axel Dörfler, axeld@pinc-software.de + * Stephan Aßmus */ -#include "WorkspacesLayer.h" -#include "Workspace.h" -#include "RootLayer.h" -#include "DisplayDriverPainter.h" -#include "AppServer.h" -#include "WinBorder.h" - #include #include +#include "AppServer.h" +#include "DrawingEngine.h" +#include "RootLayer.h" +#include "WinBorder.h" +#include "Workspace.h" + +#include "WorkspacesLayer.h" WorkspacesLayer::WorkspacesLayer(BRect frame, const char* name, int32 token, uint32 resizeMode, uint32 flags, DrawingEngine* driver) diff --git a/src/servers/app/drawing/DisplayDriver.cpp b/src/servers/app/drawing/DisplayDriver.cpp deleted file mode 100644 index dbf45ec5d3..0000000000 --- a/src/servers/app/drawing/DisplayDriver.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2005, Haiku, Inc. All rights reserved -// Distributed under the terms of the MIT license. -// -// File Name: DisplayDriver.cpp -// Authors: DarkWyrm -// Gabe Yoder -// Stephan Aßmus -// -// Description: Abstract class which handles all graphics output -// for the server -// -//------------------------------------------------------------------------------ -#include -#include - - -#include "DisplayDriver.h" - -DisplayDriver::DisplayDriver() -{ -} - -DisplayDriver::~DisplayDriver() -{ -} - -/*! - \brief Initializes the driver object. - \return true if successful, false if not - - Derived versions should set up the driver for display, - including the initial clearing of the screen. If things - do not go as they should, false should be returned. -*/ -status_t -DisplayDriver::Initialize() -{ - return B_OK; -} - -/*! - \brief Shuts down the driver's video subsystem - - Any work done by Initialize() should be undone here. Note that Shutdown() is - called even if Initialize() was unsuccessful. -*/ -void -DisplayDriver::Shutdown() -{ -} - diff --git a/src/servers/app/drawing/DisplayDriverPainter.cpp b/src/servers/app/drawing/DrawingEngine.cpp similarity index 99% rename from src/servers/app/drawing/DisplayDriverPainter.cpp rename to src/servers/app/drawing/DrawingEngine.cpp index 1f83a180fd..696c0d2558 100644 --- a/src/servers/app/drawing/DisplayDriverPainter.cpp +++ b/src/servers/app/drawing/DrawingEngine.cpp @@ -16,7 +16,7 @@ #include "PNGDump.h" #include "RenderingBuffer.h" -#include "DisplayDriverPainter.h" +#include "DrawingEngine.h" // make_rect_valid