Merged app_server_new_clipping branch changes r15290 to 15418 back into trunk.
Also fixed Jamfile for the test environment. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15419 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -80,16 +80,15 @@ class Decorator {
|
||||
bool GetMinimize();
|
||||
bool GetZoom();
|
||||
|
||||
virtual void GetSizeLimits(float* minWidth, float* minHeight,
|
||||
float* maxWidth, float* maxHeight) const;
|
||||
virtual void GetSizeLimits(int32* minWidth, int32* minHeight,
|
||||
int32* maxWidth, int32* maxHeight) const;
|
||||
|
||||
|
||||
void SetFocus(bool is_active);
|
||||
bool GetFocus()
|
||||
void SetFocus(bool focussed);
|
||||
bool IsFocus()
|
||||
{ return fIsFocused; };
|
||||
ColorSet GetColors()
|
||||
ColorSet Colors()
|
||||
{ return (_colors) ? *_colors : ColorSet(); }
|
||||
|
||||
|
||||
virtual void GetFootprint(BRegion *region);
|
||||
|
||||
virtual click_type Clicked(BPoint pt, int32 buttons,
|
||||
|
||||
@@ -28,8 +28,7 @@ class ServerBitmap;
|
||||
class ServerCursor;
|
||||
class ServerFont;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
BPoint pt1;
|
||||
BPoint pt2;
|
||||
rgb_color color;
|
||||
@@ -38,176 +37,134 @@ typedef struct
|
||||
|
||||
class DrawingEngine {
|
||||
public:
|
||||
DrawingEngine(HWInterface* interface = NULL);
|
||||
virtual ~DrawingEngine();
|
||||
DrawingEngine(HWInterface* interface = NULL);
|
||||
virtual ~DrawingEngine();
|
||||
|
||||
// when implementing, be sure to call the inherited version
|
||||
status_t Initialize();
|
||||
void Shutdown();
|
||||
status_t Initialize();
|
||||
void Shutdown();
|
||||
|
||||
// locking
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
|
||||
bool WriteLock();
|
||||
void WriteUnlock();
|
||||
bool WriteLock();
|
||||
void WriteUnlock();
|
||||
|
||||
// for "changing" hardware
|
||||
void Update();
|
||||
void Update();
|
||||
|
||||
void SetHWInterface(HWInterface* interface);
|
||||
void SetHWInterface(HWInterface* interface);
|
||||
|
||||
// for screen shots
|
||||
bool DumpToFile( const char *path);
|
||||
ServerBitmap* DumpToBitmap();
|
||||
bool DumpToFile(const char *path);
|
||||
ServerBitmap* DumpToBitmap();
|
||||
|
||||
|
||||
// clipping for all drawing functions, passing a NULL region
|
||||
// will remove any clipping (drawing allowed everywhere)
|
||||
void ConstrainClippingRegion(BRegion* region);
|
||||
void ConstrainClippingRegion(const BRegion* region);
|
||||
|
||||
// drawing functions
|
||||
void CopyRegion( /*const*/ BRegion* region,
|
||||
int32 xOffset,
|
||||
int32 yOffset);
|
||||
void CopyRegion(/*const*/ BRegion* region,
|
||||
int32 xOffset, int32 yOffset);
|
||||
|
||||
void CopyRegionList( BList* list,
|
||||
BList* pList,
|
||||
int32 rCount,
|
||||
BRegion* clipReg);
|
||||
void CopyRegionList(BList* list, BList* pList,
|
||||
int32 rCount, BRegion* clipReg);
|
||||
|
||||
void InvertRect( BRect r);
|
||||
void InvertRect(BRect r);
|
||||
|
||||
void DrawBitmap( ServerBitmap *bitmap,
|
||||
const BRect &source,
|
||||
const BRect &dest,
|
||||
const DrawState *d);
|
||||
void DrawBitmap(ServerBitmap *bitmap,
|
||||
const BRect &source, const BRect &dest,
|
||||
const DrawState *d);
|
||||
// drawing primitives
|
||||
|
||||
void DrawArc( BRect r,
|
||||
const float &angle,
|
||||
const float &span,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
void DrawArc(BRect r, const float &angle,
|
||||
const float &span,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
|
||||
void DrawBezier( BPoint *pts,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
void DrawBezier(BPoint *pts, const DrawState *d,
|
||||
bool filled);
|
||||
|
||||
void DrawEllipse( BRect r,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
void DrawEllipse(BRect r, const DrawState *d,
|
||||
bool filled);
|
||||
|
||||
void DrawPolygon( BPoint *ptlist,
|
||||
int32 numpts,
|
||||
BRect bounds,
|
||||
const DrawState *d,
|
||||
bool filled,
|
||||
bool closed);
|
||||
void DrawPolygon(BPoint *ptlist, int32 numpts,
|
||||
BRect bounds, const DrawState *d,
|
||||
bool filled, bool closed);
|
||||
|
||||
// this version used by Decorator
|
||||
void StrokeRect( BRect r,
|
||||
const RGBColor &color);
|
||||
void StrokeRect(BRect r, const RGBColor &color);
|
||||
void FillRect(BRect r, const RGBColor &color);
|
||||
|
||||
void FillRect( BRect r,
|
||||
const RGBColor &color);
|
||||
|
||||
void StrokeRect( BRect r,
|
||||
const DrawState *d);
|
||||
|
||||
void FillRect( BRect r,
|
||||
const DrawState *d);
|
||||
void StrokeRect(BRect r, const DrawState *d);
|
||||
void FillRect(BRect r, const DrawState *d);
|
||||
|
||||
// for debugging purposes?
|
||||
void StrokeRegion( BRegion &r,
|
||||
const DrawState *d);
|
||||
void StrokeRegion(BRegion &r, const DrawState *d);
|
||||
void FillRegion(BRegion &r, const DrawState *d);
|
||||
void FillRegion(BRegion &r, const RGBColor& color);
|
||||
|
||||
void FillRegion( BRegion &r,
|
||||
const DrawState *d);
|
||||
void DrawRoundRect(BRect r, float xrad,
|
||||
float yrad, const DrawState *d,
|
||||
bool filled);
|
||||
|
||||
void DrawRoundRect( BRect r,
|
||||
const float &xrad,
|
||||
const float &yrad,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
void DrawShape(const BRect &bounds,
|
||||
int32 opcount, const uint32 *oplist,
|
||||
int32 ptcount, const BPoint *ptlist,
|
||||
const DrawState *d, bool filled);
|
||||
|
||||
void DrawShape( const BRect &bounds,
|
||||
const int32 &opcount,
|
||||
const uint32 *oplist,
|
||||
const int32 &ptcount,
|
||||
const BPoint *ptlist,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
|
||||
void DrawTriangle( BPoint *pts,
|
||||
const BRect &bounds,
|
||||
const DrawState *d,
|
||||
bool filled);
|
||||
void DrawTriangle(BPoint *pts, const BRect &bounds,
|
||||
const DrawState *d, bool filled);
|
||||
|
||||
// this version used by Decorator
|
||||
void StrokeLine( const BPoint &start,
|
||||
const BPoint &end,
|
||||
const RGBColor &color);
|
||||
void StrokeLine(const BPoint &start,
|
||||
const BPoint &end, const RGBColor &color);
|
||||
|
||||
void StrokeLine( const BPoint &start,
|
||||
const BPoint &end,
|
||||
DrawState *d);
|
||||
void StrokeLine(const BPoint &start,
|
||||
const BPoint &end, DrawState *d);
|
||||
|
||||
void StrokeLineArray(const int32 &numlines,
|
||||
const LineArrayData *data,
|
||||
const DrawState *d);
|
||||
void StrokeLineArray(int32 numlines,
|
||||
const LineArrayData *data,
|
||||
const DrawState *d);
|
||||
|
||||
// this version used by Decorator
|
||||
void StrokePoint( const BPoint &pt,
|
||||
const RGBColor &color);
|
||||
void StrokePoint(const BPoint &pt,
|
||||
const RGBColor &color);
|
||||
|
||||
void StrokePoint( const BPoint &pt,
|
||||
DrawState *d);
|
||||
void StrokePoint(const BPoint &pt,
|
||||
DrawState *d);
|
||||
|
||||
// -------- text related calls
|
||||
|
||||
|
||||
// DrawState is NOT const because this call updates the pen position in the passed DrawState
|
||||
BPoint DrawString( const char* string,
|
||||
int32 length,
|
||||
const BPoint& pt,
|
||||
DrawState* d,
|
||||
escapement_delta* delta = NULL);
|
||||
BPoint DrawString(const char* string, int32 length,
|
||||
const BPoint& pt, DrawState* d,
|
||||
escapement_delta* delta = NULL);
|
||||
|
||||
/* void DrawString( const char *string,
|
||||
const int32 &length,
|
||||
const BPoint &pt,
|
||||
const RGBColor &color,
|
||||
escapement_delta *delta=NULL);*/
|
||||
float StringWidth(const char* string, int32 length,
|
||||
const DrawState* d,
|
||||
escapement_delta* delta = NULL);
|
||||
|
||||
float StringWidth( const char* string,
|
||||
int32 length,
|
||||
const DrawState* d,
|
||||
escapement_delta* delta = NULL);
|
||||
float StringWidth(const char* string,
|
||||
int32 length, const ServerFont& font,
|
||||
escapement_delta* delta = NULL);
|
||||
|
||||
float StringWidth( const char* string,
|
||||
int32 length,
|
||||
const ServerFont& font,
|
||||
escapement_delta* delta = NULL);
|
||||
|
||||
float StringHeight( const char* string,
|
||||
int32 length,
|
||||
const DrawState* d);
|
||||
float StringHeight(const char* string,
|
||||
int32 length, const DrawState* d);
|
||||
|
||||
private:
|
||||
BRect _CopyRect( BRect r,
|
||||
int32 xOffset,
|
||||
int32 yOffset) const;
|
||||
BRect _CopyRect(BRect r, int32 xOffset,
|
||||
int32 yOffset) const;
|
||||
|
||||
void _CopyRect( uint8* bits,
|
||||
uint32 width,
|
||||
uint32 height,
|
||||
uint32 bpr,
|
||||
int32 xOffset,
|
||||
int32 yOffset) const;
|
||||
void _CopyRect(uint8* bits, uint32 width,
|
||||
uint32 height, uint32 bytesPerRow,
|
||||
int32 xOffset, int32 yOffset) const;
|
||||
|
||||
Painter* fPainter;
|
||||
HWInterface* fGraphicsCard;
|
||||
uint32 fAvailableHWAccleration;
|
||||
Painter* fPainter;
|
||||
HWInterface* fGraphicsCard;
|
||||
uint32 fAvailableHWAccleration;
|
||||
};
|
||||
|
||||
#endif // DRAWING_ENGINE_H_
|
||||
|
||||
Reference in New Issue
Block a user