* This fixes the coding style violations Michael recently introduced.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2008, Haiku, Inc.
|
* Copyright 2001-2009, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "HWInterface.h"
|
#include "HWInterface.h"
|
||||||
|
|
||||||
|
|
||||||
class BPoint;
|
class BPoint;
|
||||||
class BRect;
|
class BRect;
|
||||||
class BRegion;
|
class BRegion;
|
||||||
@@ -34,163 +35,162 @@ class ServerFont;
|
|||||||
class DrawingEngine : public HWInterfaceListener {
|
class DrawingEngine : public HWInterfaceListener {
|
||||||
public:
|
public:
|
||||||
DrawingEngine(HWInterface* interface = NULL);
|
DrawingEngine(HWInterface* interface = NULL);
|
||||||
virtual ~DrawingEngine();
|
virtual ~DrawingEngine();
|
||||||
|
|
||||||
// HWInterfaceListener interface
|
// HWInterfaceListener interface
|
||||||
virtual void FrameBufferChanged();
|
virtual void FrameBufferChanged();
|
||||||
|
|
||||||
// for "changing" hardware
|
// for "changing" hardware
|
||||||
void SetHWInterface(HWInterface* interface);
|
void SetHWInterface(HWInterface* interface);
|
||||||
|
|
||||||
virtual void SetCopyToFrontEnabled(bool enable);
|
virtual void SetCopyToFrontEnabled(bool enable);
|
||||||
bool CopyToFrontEnabled() const
|
bool CopyToFrontEnabled() const
|
||||||
{ return fCopyToFront; }
|
{ return fCopyToFront; }
|
||||||
virtual void CopyToFront(/*const*/ BRegion& region);
|
virtual void CopyToFront(/*const*/ BRegion& region);
|
||||||
|
|
||||||
// locking
|
// locking
|
||||||
bool LockParallelAccess();
|
bool LockParallelAccess();
|
||||||
bool IsParallelAccessLocked();
|
bool IsParallelAccessLocked();
|
||||||
void UnlockParallelAccess();
|
void UnlockParallelAccess();
|
||||||
|
|
||||||
bool LockExclusiveAccess();
|
bool LockExclusiveAccess();
|
||||||
bool IsExclusiveAccessLocked();
|
bool IsExclusiveAccessLocked();
|
||||||
void UnlockExclusiveAccess();
|
void UnlockExclusiveAccess();
|
||||||
|
|
||||||
// for screen shots
|
// for screen shots
|
||||||
ServerBitmap* DumpToBitmap();
|
ServerBitmap* DumpToBitmap();
|
||||||
virtual status_t ReadBitmap(ServerBitmap *bitmap, bool drawCursor,
|
virtual status_t ReadBitmap(ServerBitmap *bitmap, bool drawCursor,
|
||||||
BRect bounds);
|
BRect bounds);
|
||||||
|
|
||||||
// clipping for all drawing functions, passing a NULL region
|
// clipping for all drawing functions, passing a NULL region
|
||||||
// will remove any clipping (drawing allowed everywhere)
|
// will remove any clipping (drawing allowed everywhere)
|
||||||
virtual void ConstrainClippingRegion(const BRegion* region);
|
virtual void ConstrainClippingRegion(const BRegion* region);
|
||||||
|
|
||||||
virtual void SetDrawState(const DrawState* state,
|
virtual void SetDrawState(const DrawState* state,
|
||||||
int32 xOffset = 0, int32 yOffset = 0);
|
int32 xOffset = 0, int32 yOffset = 0);
|
||||||
|
|
||||||
virtual void SetHighColor(const rgb_color& color);
|
virtual void SetHighColor(const rgb_color& color);
|
||||||
virtual void SetLowColor(const rgb_color& color);
|
virtual void SetLowColor(const rgb_color& color);
|
||||||
virtual void SetPenSize(float size);
|
virtual void SetPenSize(float size);
|
||||||
virtual void SetStrokeMode(cap_mode lineCap, join_mode joinMode,
|
virtual void SetStrokeMode(cap_mode lineCap, join_mode joinMode,
|
||||||
float miterLimit);
|
float miterLimit);
|
||||||
virtual void SetPattern(const struct pattern& pattern);
|
virtual void SetPattern(const struct pattern& pattern);
|
||||||
virtual void SetDrawingMode(drawing_mode mode);
|
virtual void SetDrawingMode(drawing_mode mode);
|
||||||
virtual void SetDrawingMode(drawing_mode mode,
|
virtual void SetDrawingMode(drawing_mode mode,
|
||||||
drawing_mode& oldMode);
|
drawing_mode& oldMode);
|
||||||
virtual void SetBlendingMode(source_alpha srcAlpha,
|
virtual void SetBlendingMode(source_alpha srcAlpha,
|
||||||
alpha_function alphaFunc);
|
alpha_function alphaFunc);
|
||||||
virtual void SetFont(const ServerFont& font);
|
virtual void SetFont(const ServerFont& font);
|
||||||
virtual void SetFont(const DrawState* state);
|
virtual void SetFont(const DrawState* state);
|
||||||
|
|
||||||
void SuspendAutoSync();
|
void SuspendAutoSync();
|
||||||
void Sync();
|
void Sync();
|
||||||
|
|
||||||
// drawing functions
|
// drawing functions
|
||||||
virtual void CopyRegion(/*const*/ BRegion* region,
|
virtual void CopyRegion(/*const*/ BRegion* region,
|
||||||
int32 xOffset, int32 yOffset);
|
int32 xOffset, int32 yOffset);
|
||||||
|
|
||||||
virtual void InvertRect(BRect r);
|
virtual void InvertRect(BRect r);
|
||||||
|
|
||||||
virtual void DrawBitmap(ServerBitmap* bitmap,
|
virtual void DrawBitmap(ServerBitmap* bitmap,
|
||||||
const BRect& bitmapRect, const BRect& viewRect,
|
const BRect& bitmapRect, const BRect& viewRect,
|
||||||
uint32 options = 0);
|
uint32 options = 0);
|
||||||
// drawing primitives
|
// drawing primitives
|
||||||
|
virtual void DrawArc(BRect r, const float& angle,
|
||||||
virtual void DrawArc(BRect r, const float& angle,
|
|
||||||
const float& span, bool filled);
|
const float& span, bool filled);
|
||||||
virtual void FillArc(BRect r, const float& angle,
|
virtual void FillArc(BRect r, const float& angle,
|
||||||
const float& span, const BGradient& gradient);
|
const float& span, const BGradient& gradient);
|
||||||
|
|
||||||
virtual void DrawBezier(BPoint* pts, bool filled);
|
virtual void DrawBezier(BPoint* pts, bool filled);
|
||||||
virtual void FillBezier(BPoint* pts, const BGradient& gradient);
|
virtual void FillBezier(BPoint* pts, const BGradient& gradient);
|
||||||
|
|
||||||
virtual void DrawEllipse(BRect r, bool filled);
|
virtual void DrawEllipse(BRect r, bool filled);
|
||||||
virtual void FillEllipse(BRect r, const BGradient& gradient);
|
virtual void FillEllipse(BRect r, const BGradient& gradient);
|
||||||
|
|
||||||
virtual void DrawPolygon(BPoint* ptlist, int32 numpts,
|
virtual void DrawPolygon(BPoint* ptlist, int32 numpts,
|
||||||
BRect bounds, bool filled, bool closed);
|
BRect bounds, bool filled, bool closed);
|
||||||
virtual void FillPolygon(BPoint* ptlist, int32 numpts,
|
virtual void FillPolygon(BPoint* ptlist, int32 numpts,
|
||||||
BRect bounds, const BGradient& gradient,
|
BRect bounds, const BGradient& gradient,
|
||||||
bool closed);
|
bool closed);
|
||||||
|
|
||||||
// these rgb_color versions are used internally by the server
|
// these rgb_color versions are used internally by the server
|
||||||
virtual void StrokePoint(const BPoint& point,
|
virtual void StrokePoint(const BPoint& point,
|
||||||
const rgb_color& color);
|
const rgb_color& color);
|
||||||
virtual void StrokeRect(BRect rect, const rgb_color &color);
|
virtual void StrokeRect(BRect rect, const rgb_color &color);
|
||||||
virtual void FillRect(BRect rect, const rgb_color &color);
|
virtual void FillRect(BRect rect, const rgb_color &color);
|
||||||
virtual void FillRegion(BRegion& region, const rgb_color& color);
|
virtual void FillRegion(BRegion& region, const rgb_color& color);
|
||||||
|
|
||||||
virtual void StrokeRect(BRect rect);
|
virtual void StrokeRect(BRect rect);
|
||||||
virtual void FillRect(BRect rect);
|
virtual void FillRect(BRect rect);
|
||||||
virtual void FillRect(BRect rect, const BGradient& gradient);
|
virtual void FillRect(BRect rect, const BGradient& gradient);
|
||||||
|
|
||||||
virtual void FillRegion(BRegion& region);
|
virtual void FillRegion(BRegion& region);
|
||||||
virtual void FillRegion(BRegion& region,
|
virtual void FillRegion(BRegion& region,
|
||||||
const BGradient& gradient);
|
const BGradient& gradient);
|
||||||
|
|
||||||
virtual void DrawRoundRect(BRect rect, float xrad,
|
virtual void DrawRoundRect(BRect rect, float xrad,
|
||||||
float yrad, bool filled);
|
float yrad, bool filled);
|
||||||
virtual void FillRoundRect(BRect rect, float xrad,
|
virtual void FillRoundRect(BRect rect, float xrad,
|
||||||
float yrad, const BGradient& gradient);
|
float yrad, const BGradient& gradient);
|
||||||
|
|
||||||
virtual void DrawShape(const BRect& bounds,
|
virtual void DrawShape(const BRect& bounds,
|
||||||
int32 opcount, const uint32* oplist,
|
int32 opcount, const uint32* oplist,
|
||||||
int32 ptcount, const BPoint* ptlist,
|
int32 ptcount, const BPoint* ptlist,
|
||||||
bool filled);
|
bool filled);
|
||||||
virtual void FillShape(const BRect& bounds,
|
virtual void FillShape(const BRect& bounds,
|
||||||
int32 opcount, const uint32* oplist,
|
int32 opcount, const uint32* oplist,
|
||||||
int32 ptcount, const BPoint* ptlist,
|
int32 ptcount, const BPoint* ptlist,
|
||||||
const BGradient& gradient);
|
const BGradient& gradient);
|
||||||
|
|
||||||
virtual void DrawTriangle(BPoint* points, const BRect& bounds,
|
virtual void DrawTriangle(BPoint* points, const BRect& bounds,
|
||||||
bool filled);
|
bool filled);
|
||||||
virtual void FillTriangle(BPoint* points, const BRect& bounds,
|
virtual void FillTriangle(BPoint* points, const BRect& bounds,
|
||||||
const BGradient& gradient);
|
const BGradient& gradient);
|
||||||
|
|
||||||
// these versions are used by the Decorator
|
// these versions are used by the Decorator
|
||||||
virtual void StrokeLine(const BPoint& start,
|
virtual void StrokeLine(const BPoint& start,
|
||||||
const BPoint& end, const rgb_color& color);
|
const BPoint& end, const rgb_color& color);
|
||||||
|
|
||||||
virtual void StrokeLine(const BPoint& start,
|
virtual void StrokeLine(const BPoint& start,
|
||||||
const BPoint& end);
|
const BPoint& end);
|
||||||
|
|
||||||
virtual void StrokeLineArray(int32 numlines,
|
virtual void StrokeLineArray(int32 numlines,
|
||||||
const ViewLineArrayInfo* data);
|
const ViewLineArrayInfo* data);
|
||||||
|
|
||||||
// -------- text related calls
|
// -------- text related calls
|
||||||
|
|
||||||
// returns the pen position behind the (virtually) drawn
|
// returns the pen position behind the (virtually) drawn
|
||||||
// string
|
// string
|
||||||
virtual BPoint DrawString(const char* string, int32 length,
|
virtual BPoint DrawString(const char* string, int32 length,
|
||||||
const BPoint& pt,
|
const BPoint& pt,
|
||||||
escapement_delta* delta = NULL);
|
escapement_delta* delta = NULL);
|
||||||
|
|
||||||
float StringWidth(const char* string, int32 length,
|
float StringWidth(const char* string, int32 length,
|
||||||
escapement_delta* delta = NULL);
|
escapement_delta* delta = NULL);
|
||||||
|
|
||||||
// convenience function which is independent of graphics
|
// convenience function which is independent of graphics
|
||||||
// state (to be used by Decorator or ServerApp etc)
|
// state (to be used by Decorator or ServerApp etc)
|
||||||
float StringWidth(const char* string,
|
float StringWidth(const char* string,
|
||||||
int32 length, const ServerFont& font,
|
int32 length, const ServerFont& font,
|
||||||
escapement_delta* delta = NULL);
|
escapement_delta* delta = NULL);
|
||||||
|
|
||||||
// software rendering backend invoked by CopyRegion() for the sorted
|
// software rendering backend invoked by CopyRegion() for the sorted
|
||||||
// individual rects
|
// individual rects
|
||||||
virtual BRect CopyRect(BRect rect, int32 xOffset,
|
virtual BRect CopyRect(BRect rect, int32 xOffset,
|
||||||
int32 yOffset) const;
|
int32 yOffset) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _CopyRect(uint8* bits, uint32 width,
|
void _CopyRect(uint8* bits, uint32 width,
|
||||||
uint32 height, uint32 bytesPerRow,
|
uint32 height, uint32 bytesPerRow,
|
||||||
int32 xOffset, int32 yOffset) const;
|
int32 xOffset, int32 yOffset) const;
|
||||||
|
|
||||||
inline void _CopyToFront(const BRect& frame);
|
inline void _CopyToFront(const BRect& frame);
|
||||||
|
|
||||||
Painter* fPainter;
|
Painter* fPainter;
|
||||||
HWInterface* fGraphicsCard;
|
HWInterface* fGraphicsCard;
|
||||||
uint32 fAvailableHWAccleration;
|
uint32 fAvailableHWAccleration;
|
||||||
int32 fSuspendSyncLevel;
|
int32 fSuspendSyncLevel;
|
||||||
bool fCopyToFront;
|
bool fCopyToFront;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DRAWING_ENGINE_H_
|
#endif // DRAWING_ENGINE_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user