Cleanup only.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26661 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-07-28 16:27:13 +00:00
parent bb94d91d07
commit 1c111165b0
2 changed files with 204 additions and 235 deletions
+112 -141
View File
@@ -166,37 +166,30 @@ public:
virtual void Draw(BRect updateRect); virtual void Draw(BRect updateRect);
virtual void MouseDown(BPoint where); virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint where); virtual void MouseUp(BPoint where);
virtual void MouseMoved(BPoint where, virtual void MouseMoved(BPoint where, uint32 code,
uint32 code, const BMessage* dragMessage);
const BMessage* a_message);
virtual void WindowActivated(bool state); virtual void WindowActivated(bool state);
virtual void KeyDown(const char* bytes, int32 numBytes); virtual void KeyDown(const char* bytes, int32 numBytes);
virtual void KeyUp(const char* bytes, int32 numBytes); virtual void KeyUp(const char* bytes, int32 numBytes);
virtual void Pulse(); virtual void Pulse();
virtual void FrameMoved(BPoint new_position); virtual void FrameMoved(BPoint newPosition);
virtual void FrameResized(float new_width, float new_height); virtual void FrameResized(float newWidth, float newHeight);
virtual void TargetedByScrollView(BScrollView* scroll_view); virtual void TargetedByScrollView(BScrollView* scrollView);
void BeginRectTracking(BRect startRect, void BeginRectTracking(BRect startRect,
uint32 style = B_TRACK_WHOLE_RECT); uint32 style = B_TRACK_WHOLE_RECT);
void EndRectTracking(); void EndRectTracking();
void GetMouse(BPoint* location, void GetMouse(BPoint* location, uint32* buttons,
uint32* buttons,
bool checkMessageQueue = true); bool checkMessageQueue = true);
void DragMessage(BMessage* aMessage, void DragMessage(BMessage* message, BRect dragRect,
BRect dragRect, BHandler* replyTo = NULL);
BHandler* reply_to = NULL); void DragMessage(BMessage* message, BBitmap* bitmap,
void DragMessage(BMessage* aMessage, BPoint offset, BHandler* replyTo = NULL);
BBitmap* anImage, void DragMessage(BMessage* message, BBitmap* bitmap,
BPoint offset, drawing_mode dragMode, BPoint offset,
BHandler* reply_to = NULL); BHandler* replyTo = NULL);
void DragMessage(BMessage* aMessage,
BBitmap* anImage,
drawing_mode dragMode,
BPoint offset,
BHandler* reply_to = NULL);
BView* FindView(const char* name) const; BView* FindView(const char* name) const;
BView* Parent() const; BView* Parent() const;
@@ -223,11 +216,9 @@ public:
void GetClippingRegion(BRegion* region) const; void GetClippingRegion(BRegion* region) const;
virtual void ConstrainClippingRegion(BRegion* region); virtual void ConstrainClippingRegion(BRegion* region);
void ClipToPicture(BPicture* picture, void ClipToPicture(BPicture* picture,
BPoint where = B_ORIGIN, BPoint where = B_ORIGIN, bool sync = true);
bool sync = true);
void ClipToInversePicture(BPicture* picture, void ClipToInversePicture(BPicture* picture,
BPoint where = B_ORIGIN, BPoint where = B_ORIGIN, bool sync = true);
bool sync = true);
virtual void SetDrawingMode(drawing_mode mode); virtual void SetDrawingMode(drawing_mode mode);
drawing_mode DrawingMode() const; drawing_mode DrawingMode() const;
@@ -240,41 +231,49 @@ public:
virtual void SetPenSize(float size); virtual void SetPenSize(float size);
float PenSize() const; float PenSize() const;
void SetViewCursor(const BCursor* cursor, bool sync=true); void SetViewCursor(const BCursor* cursor,
bool sync = true);
virtual void SetViewColor(rgb_color c); virtual void SetViewColor(rgb_color c);
void SetViewColor(uchar r, uchar g, uchar b, uchar a = 255); void SetViewColor(uchar r, uchar g, uchar b,
uchar a = 255);
rgb_color ViewColor() const; rgb_color ViewColor() const;
void SetViewBitmap(const BBitmap* bitmap, void SetViewBitmap(const BBitmap* bitmap,
BRect srcRect, BRect dstRect, BRect srcRect, BRect dstRect,
uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, uint32 followFlags
= B_FOLLOW_TOP | B_FOLLOW_LEFT,
uint32 options = B_TILE_BITMAP); uint32 options = B_TILE_BITMAP);
void SetViewBitmap(const BBitmap* bitmap, void SetViewBitmap(const BBitmap* bitmap,
uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, uint32 followFlags
= B_FOLLOW_TOP | B_FOLLOW_LEFT,
uint32 options = B_TILE_BITMAP); uint32 options = B_TILE_BITMAP);
void ClearViewBitmap(); void ClearViewBitmap();
status_t SetViewOverlay(const BBitmap* overlay, status_t SetViewOverlay(const BBitmap* overlay,
BRect srcRect, BRect dstRect, BRect srcRect, BRect dstRect,
rgb_color* colorKey, rgb_color* colorKey,
uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, uint32 followFlags
= B_FOLLOW_TOP | B_FOLLOW_LEFT,
uint32 options = 0); uint32 options = 0);
status_t SetViewOverlay(const BBitmap* overlay, rgb_color* colorKey, status_t SetViewOverlay(const BBitmap* overlay,
uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, rgb_color* colorKey,
uint32 followFlags
= B_FOLLOW_TOP | B_FOLLOW_LEFT,
uint32 options = 0); uint32 options = 0);
void ClearViewOverlay(); void ClearViewOverlay();
virtual void SetHighColor(rgb_color a_color); virtual void SetHighColor(rgb_color a_color);
void SetHighColor(uchar r, uchar g, uchar b, uchar a = 255); void SetHighColor(uchar r, uchar g, uchar b,
uchar a = 255);
rgb_color HighColor() const; rgb_color HighColor() const;
virtual void SetLowColor(rgb_color a_color); virtual void SetLowColor(rgb_color a_color);
void SetLowColor(uchar r, uchar g, uchar b, uchar a = 255); void SetLowColor(uchar r, uchar g, uchar b,
uchar a = 255);
rgb_color LowColor() const; rgb_color LowColor() const;
void SetLineMode(cap_mode lineCap, void SetLineMode(cap_mode lineCap, join_mode lineJoin,
join_mode lineJoin,
float miterLimit = B_DEFAULT_MITER_LIMIT); float miterLimit = B_DEFAULT_MITER_LIMIT);
join_mode LineJoinMode() const; join_mode LineJoinMode() const;
cap_mode LineCapMode() const; cap_mode LineCapMode() const;
@@ -291,100 +290,63 @@ public:
void MovePenTo(float x, float y); void MovePenTo(float x, float y);
void MovePenBy(float x, float y); void MovePenBy(float x, float y);
BPoint PenLocation() const; BPoint PenLocation() const;
void StrokeLine(BPoint toPt, void StrokeLine(BPoint toPt, pattern p = B_SOLID_HIGH);
pattern p = B_SOLID_HIGH); void StrokeLine(BPoint a, BPoint b,
void StrokeLine(BPoint pt0,
BPoint pt1,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void BeginLineArray(int32 count); void BeginLineArray(int32 count);
void AddLine(BPoint pt0, BPoint pt1, rgb_color col); void AddLine(BPoint a, BPoint b, rgb_color color);
void EndLineArray(); void EndLineArray();
void StrokePolygon(const BPolygon* aPolygon, void StrokePolygon(const BPolygon* polygon,
bool closed = true, bool closed = true, pattern p = B_SOLID_HIGH);
void StrokePolygon(const BPoint* ptArray, int32 numPts,
bool closed = true, pattern p = B_SOLID_HIGH);
void StrokePolygon(const BPoint* ptArray, int32 numPts,
BRect bounds, bool closed = true,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void StrokePolygon(const BPoint* ptArray, void FillPolygon(const BPolygon* polygon,
int32 numPts,
bool closed = true,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void StrokePolygon(const BPoint* ptArray, void FillPolygon(const BPoint* ptArray, int32 numPts,
int32 numPts,
BRect bounds,
bool closed = true,
pattern p = B_SOLID_HIGH);
void FillPolygon(const BPolygon* aPolygon,
pattern p = B_SOLID_HIGH);
void FillPolygon(const BPoint* ptArray,
int32 numPts,
pattern p = B_SOLID_HIGH);
void FillPolygon(const BPoint* ptArray,
int32 numPts,
BRect bounds,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void FillPolygon(const BPoint* ptArray, int32 numPts,
BRect bounds, pattern p = B_SOLID_HIGH);
void StrokeTriangle(BPoint pt1, void StrokeTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
BPoint pt2, BRect bounds, pattern p = B_SOLID_HIGH);
BPoint pt3, void StrokeTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
BRect bounds,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void StrokeTriangle(BPoint pt1, void FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
BPoint pt2,
BPoint pt3,
pattern p = B_SOLID_HIGH);
void FillTriangle(BPoint pt1,
BPoint pt2,
BPoint pt3,
pattern p = B_SOLID_HIGH);
void FillTriangle(BPoint pt1,
BPoint pt2,
BPoint pt3,
BRect bounds,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
BRect bounds, pattern p = B_SOLID_HIGH);
void StrokeRect(BRect r, pattern p = B_SOLID_HIGH); void StrokeRect(BRect r, pattern p = B_SOLID_HIGH);
void FillRect(BRect r, pattern p = B_SOLID_HIGH); void FillRect(BRect r, pattern p = B_SOLID_HIGH);
void FillRegion(BRegion* a_region, pattern p= B_SOLID_HIGH); void FillRegion(BRegion* region,
pattern p = B_SOLID_HIGH);
void InvertRect(BRect r); void InvertRect(BRect r);
void StrokeRoundRect(BRect r, void StrokeRoundRect(BRect r, float xRadius,
float xRadius, float yRadius, pattern p = B_SOLID_HIGH);
float yRadius, void FillRoundRect(BRect r, float xRadius, float yRadius,
pattern p = B_SOLID_HIGH);
void FillRoundRect(BRect r,
float xRadius,
float yRadius,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void StrokeEllipse(BPoint center, void StrokeEllipse(BPoint center, float xRadius,
float xRadius, float yRadius, pattern p = B_SOLID_HIGH);
float yRadius,
pattern p = B_SOLID_HIGH);
void StrokeEllipse(BRect r, pattern p = B_SOLID_HIGH); void StrokeEllipse(BRect r, pattern p = B_SOLID_HIGH);
void FillEllipse(BPoint center, void FillEllipse(BPoint center, float xRadius,
float xRadius, float yRadius, pattern p = B_SOLID_HIGH);
float yRadius,
pattern p = B_SOLID_HIGH);
void FillEllipse(BRect r, pattern p = B_SOLID_HIGH); void FillEllipse(BRect r, pattern p = B_SOLID_HIGH);
void StrokeArc(BPoint center, void StrokeArc(BPoint center, float xRadius,
float xRadius, float yRadius, float startAngle, float arcAngle,
float yRadius,
float start_angle,
float arc_angle,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void StrokeArc(BRect r, void StrokeArc(BRect r, float startAngle,
float start_angle, float arcAngle, pattern p = B_SOLID_HIGH);
float arc_angle, void FillArc(BPoint center, float xRadius, float yRadius,
float startAngle, float arcAngle,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void FillArc(BPoint center, void FillArc(BRect r, float startAngle, float arcAngle,
float xRadius,
float yRadius,
float start_angle,
float arc_angle,
pattern p = B_SOLID_HIGH);
void FillArc(BRect r,
float start_angle,
float arc_angle,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void StrokeBezier(BPoint* controlPoints, void StrokeBezier(BPoint* controlPoints,
@@ -394,22 +356,25 @@ public:
void StrokeShape(BShape* shape, void StrokeShape(BShape* shape,
pattern p = B_SOLID_HIGH); pattern p = B_SOLID_HIGH);
void FillShape(BShape* shape, void FillShape(BShape* shape, pattern p = B_SOLID_HIGH);
pattern p = B_SOLID_HIGH);
void CopyBits(BRect src, BRect dst); void CopyBits(BRect src, BRect dst);
void DrawBitmapAsync(const BBitmap* aBitmap, void DrawBitmapAsync(const BBitmap* aBitmap,
BRect srcRect, BRect bitmapRect, BRect viewRect);
BRect dstRect); void DrawBitmapAsync(const BBitmap* aBitmap,
BRect viewRect);
void DrawBitmapAsync(const BBitmap* aBitmap,
BPoint where);
void DrawBitmapAsync(const BBitmap* aBitmap); void DrawBitmapAsync(const BBitmap* aBitmap);
void DrawBitmapAsync(const BBitmap* aBitmap, BPoint where);
void DrawBitmapAsync(const BBitmap* aBitmap, BRect dstRect);
void DrawBitmap(const BBitmap* aBitmap, void DrawBitmap(const BBitmap* aBitmap,
BRect srcRect, BRect bitmapRect, BRect viewRect);
BRect dstRect); void DrawBitmap(const BBitmap* aBitmap,
BRect viewRect);
void DrawBitmap(const BBitmap* aBitmap,
BPoint where);
void DrawBitmap(const BBitmap* aBitmap); void DrawBitmap(const BBitmap* aBitmap);
void DrawBitmap(const BBitmap* aBitmap, BPoint where);
void DrawBitmap(const BBitmap* aBitmap, BRect dstRect);
void DrawChar(char aChar); void DrawChar(char aChar);
void DrawChar(char aChar, BPoint location); void DrawChar(char aChar, BPoint location);
@@ -419,22 +384,19 @@ public:
escapement_delta* delta = NULL); escapement_delta* delta = NULL);
void DrawString(const char* aString, int32 length, void DrawString(const char* aString, int32 length,
escapement_delta* delta = NULL); escapement_delta* delta = NULL);
void DrawString(const char* aString, void DrawString(const char* aString, int32 length,
int32 length, BPoint location, escapement_delta* delta = 0L);
BPoint location,
escapement_delta* delta = 0L);
virtual void SetFont(const BFont* font, uint32 mask = B_FONT_ALL); virtual void SetFont(const BFont* font,
uint32 mask = B_FONT_ALL);
void GetFont(BFont* font) const; void GetFont(BFont* font) const;
void TruncateString(BString* in_out, void TruncateString(BString* in_out, uint32 mode,
uint32 mode,
float width) const; float width) const;
float StringWidth(const char* string) const; float StringWidth(const char* string) const;
float StringWidth(const char* string, int32 length) const; float StringWidth(const char* string, int32 length) const;
void GetStringWidths(char* stringArray[], void GetStringWidths(char* stringArray[],
int32 lengthArray[], int32 lengthArray[], int32 numStrings,
int32 numStrings,
float widthArray[]) const; float widthArray[]) const;
void SetFontSize(float size); void SetFontSize(float size);
void ForceFontAliasing(bool enable); void ForceFontAliasing(bool enable);
@@ -451,10 +413,13 @@ public:
BPicture* EndPicture(); BPicture* EndPicture();
void DrawPicture(const BPicture* a_picture); void DrawPicture(const BPicture* a_picture);
void DrawPicture(const BPicture* a_picture, BPoint where); void DrawPicture(const BPicture* a_picture,
void DrawPicture(const char* filename, long offset, BPoint where); BPoint where);
void DrawPicture(const char* filename, long offset,
BPoint where);
void DrawPictureAsync(const BPicture* a_picture); void DrawPictureAsync(const BPicture* a_picture);
void DrawPictureAsync(const BPicture* a_picture, BPoint where); void DrawPictureAsync(const BPicture* a_picture,
BPoint where);
void DrawPictureAsync(const char* filename, long offset, void DrawPictureAsync(const char* filename, long offset,
BPoint where); BPoint where);
@@ -491,10 +456,8 @@ public:
BScrollBar* ScrollBar(orientation posture) const; BScrollBar* ScrollBar(orientation posture) const;
virtual BHandler* ResolveSpecifier(BMessage* msg, virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
int32 index, BMessage* specifier, int32 form,
BMessage* specifier,
int32 form,
const char* property); const char* property);
virtual status_t GetSupportedSuites(BMessage* data); virtual status_t GetSupportedSuites(BMessage* data);
@@ -595,10 +558,12 @@ private:
int32 deltaHeight); int32 deltaHeight);
void _ConvertToScreen(BPoint* pt, bool checkLock) const; void _ConvertToScreen(BPoint* pt, bool checkLock) const;
void _ConvertFromScreen(BPoint* pt, bool checkLock) const; void _ConvertFromScreen(BPoint* pt,
bool checkLock) const;
void _ConvertToParent(BPoint* pt, bool checkLock) const; void _ConvertToParent(BPoint* pt, bool checkLock) const;
void _ConvertFromParent(BPoint* pt, bool checkLock) const; void _ConvertFromParent(BPoint* pt,
bool checkLock) const;
void _Activate(bool state); void _Activate(bool state);
@@ -670,8 +635,10 @@ inline void
BView::SetViewColor(uchar r, uchar g, uchar b, uchar a) BView::SetViewColor(uchar r, uchar g, uchar b, uchar a)
{ {
rgb_color color; rgb_color color;
color.red = r; color.green = g; color.red = r;
color.blue = b; color.alpha = a; color.green = g;
color.blue = b;
color.alpha = a;
SetViewColor(color); SetViewColor(color);
} }
@@ -679,8 +646,10 @@ inline void
BView::SetHighColor(uchar r, uchar g, uchar b, uchar a) BView::SetHighColor(uchar r, uchar g, uchar b, uchar a)
{ {
rgb_color color; rgb_color color;
color.red = r; color.green = g; color.red = r;
color.blue = b; color.alpha = a; color.green = g;
color.blue = b;
color.alpha = a;
SetHighColor(color); SetHighColor(color);
} }
@@ -688,8 +657,10 @@ inline void
BView::SetLowColor(uchar r, uchar g, uchar b, uchar a) BView::SetLowColor(uchar r, uchar g, uchar b, uchar a)
{ {
rgb_color color; rgb_color color;
color.red = r; color.green = g; color.red = r;
color.blue = b; color.alpha = a; color.green = g;
color.blue = b;
color.alpha = a;
SetLowColor(color); SetLowColor(color);
} }
+26 -28
View File
@@ -2356,28 +2356,27 @@ BView::ConstrainClippingRegion(BRegion* region)
void void
BView::DrawBitmapAsync(const BBitmap *bitmap, BRect srcRect, BRect dstRect) BView::DrawBitmapAsync(const BBitmap* bitmap, BRect bitmapRect, BRect viewRect)
{ {
if (!bitmap || !srcRect.IsValid() || !dstRect.IsValid()) if (bitmap == NULL || fOwner == NULL
|| !bitmapRect.IsValid() || !viewRect.IsValid())
return; return;
if (fOwner) {
_CheckLockAndSwitchCurrent(); _CheckLockAndSwitchCurrent();
fOwner->fLink->StartMessage(AS_VIEW_DRAW_BITMAP); fOwner->fLink->StartMessage(AS_VIEW_DRAW_BITMAP);
fOwner->fLink->Attach<int32>(bitmap->_ServerToken()); fOwner->fLink->Attach<int32>(bitmap->_ServerToken());
fOwner->fLink->Attach<BRect>(dstRect); fOwner->fLink->Attach<BRect>(viewRect);
fOwner->fLink->Attach<BRect>(srcRect); fOwner->fLink->Attach<BRect>(bitmapRect);
_FlushIfNotInTransaction(); _FlushIfNotInTransaction();
} }
}
void void
BView::DrawBitmapAsync(const BBitmap *bitmap, BRect dstRect) BView::DrawBitmapAsync(const BBitmap* bitmap, BRect viewRect)
{ {
DrawBitmapAsync(bitmap, bitmap->Bounds().OffsetToCopy(B_ORIGIN), dstRect); DrawBitmapAsync(bitmap, bitmap->Bounds().OffsetToCopy(B_ORIGIN), viewRect);
} }
@@ -2391,28 +2390,37 @@ BView::DrawBitmapAsync(const BBitmap *bitmap)
void void
BView::DrawBitmapAsync(const BBitmap* bitmap, BPoint where) BView::DrawBitmapAsync(const BBitmap* bitmap, BPoint where)
{ {
if (bitmap == NULL) if (bitmap == NULL || fOwner == NULL)
return; return;
if (fOwner) {
_CheckLockAndSwitchCurrent(); _CheckLockAndSwitchCurrent();
BRect bitmapRect = bitmap->Bounds().OffsetToCopy(B_ORIGIN);
BRect viewRect = bitmapRect.OffsetToCopy(where);
fOwner->fLink->StartMessage(AS_VIEW_DRAW_BITMAP); fOwner->fLink->StartMessage(AS_VIEW_DRAW_BITMAP);
fOwner->fLink->Attach<int32>(bitmap->_ServerToken()); fOwner->fLink->Attach<int32>(bitmap->_ServerToken());
BRect src = bitmap->Bounds().OffsetToCopy(B_ORIGIN); fOwner->fLink->Attach<BRect>(viewRect);
BRect dst = src.OffsetToCopy(where); fOwner->fLink->Attach<BRect>(bitmapRect);
fOwner->fLink->Attach<BRect>(dst);
fOwner->fLink->Attach<BRect>(src);
_FlushIfNotInTransaction(); _FlushIfNotInTransaction();
} }
void
BView::DrawBitmap(const BBitmap* bitmap, BRect bitmapRect, BRect viewRect)
{
if (fOwner) {
DrawBitmapAsync(bitmap, bitmapRect, viewRect);
Sync();
}
} }
void void
BView::DrawBitmap(const BBitmap *bitmap) BView::DrawBitmap(const BBitmap* bitmap, BRect viewRect)
{ {
DrawBitmap(bitmap, PenLocation()); DrawBitmap(bitmap, bitmap->Bounds().OffsetToCopy(B_ORIGIN), viewRect);
} }
@@ -2427,19 +2435,9 @@ BView::DrawBitmap(const BBitmap *bitmap, BPoint where)
void void
BView::DrawBitmap(const BBitmap *bitmap, BRect dstRect) BView::DrawBitmap(const BBitmap* bitmap)
{ {
DrawBitmap(bitmap, bitmap->Bounds().OffsetToCopy(B_ORIGIN), dstRect); DrawBitmap(bitmap, PenLocation());
}
void
BView::DrawBitmap(const BBitmap *bitmap, BRect srcRect, BRect dstRect)
{
if (fOwner) {
DrawBitmapAsync(bitmap, srcRect, dstRect);
Sync();
}
} }