Interface Kit: Make BControlLook a proper pure-virtual base class.
All of its prior functionality has been moved into HaikuControlLook. This paves the way for customizeable control looks, which I intend to implement in the future as part of decorators. This is being pushed now because libbe ABI was already broken due to the Notifications changes, so this is riding that so we only have to do a mass rebuild once.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2015, Haiku, Inc. All rights reserved.
|
* Copyright 2009-2017, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _CONTROL_LOOK_H
|
#ifndef _CONTROL_LOOK_H
|
||||||
@@ -90,28 +90,28 @@ public:
|
|||||||
B_BLEND_FRAME = 1 << 16,
|
B_BLEND_FRAME = 1 << 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual BAlignment DefaultLabelAlignment() const;
|
virtual BAlignment DefaultLabelAlignment() const = 0;
|
||||||
virtual float DefaultLabelSpacing() const;
|
virtual float DefaultLabelSpacing() const = 0;
|
||||||
|
|
||||||
virtual float DefaultItemSpacing() const;
|
virtual float DefaultItemSpacing() const = 0;
|
||||||
|
|
||||||
static float ComposeSpacing(float spacing);
|
static float ComposeSpacing(float spacing);
|
||||||
|
|
||||||
virtual uint32 Flags(BControl* control) const;
|
virtual uint32 Flags(BControl* control) const = 0;
|
||||||
|
|
||||||
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& background,
|
const rgb_color& background,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
float radius,
|
float radius,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& background,
|
const rgb_color& background,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
float leftTopRadius,
|
float leftTopRadius,
|
||||||
@@ -121,21 +121,21 @@ public:
|
|||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& background,
|
const rgb_color& background,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
orientation orientation = B_HORIZONTAL);
|
orientation orientation = B_HORIZONTAL) = 0;
|
||||||
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
float radius,
|
float radius,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
orientation orientation = B_HORIZONTAL);
|
orientation orientation = B_HORIZONTAL) = 0;
|
||||||
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
float leftTopRadius,
|
float leftTopRadius,
|
||||||
@@ -145,27 +145,27 @@ public:
|
|||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
orientation orientation = B_HORIZONTAL);
|
orientation orientation = B_HORIZONTAL) = 0;
|
||||||
|
|
||||||
virtual void DrawMenuBarBackground(BView* view, BRect& rect,
|
virtual void DrawMenuBarBackground(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& background,
|
const rgb_color& background,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
float radius,
|
float radius,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& background,
|
const rgb_color& background,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
float leftTopRadius,
|
float leftTopRadius,
|
||||||
@@ -175,16 +175,16 @@ public:
|
|||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& background,
|
const rgb_color& background,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawMenuFieldBackground(BView* view,
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
const rgb_color& base, bool popupIndicator,
|
const rgb_color& base, bool popupIndicator,
|
||||||
uint32 flags = 0);
|
uint32 flags = 0) = 0;
|
||||||
virtual void DrawMenuFieldBackground(BView* view,
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
float radius, const rgb_color& base,
|
float radius, const rgb_color& base,
|
||||||
bool popupIndicator, uint32 flags = 0);
|
bool popupIndicator, uint32 flags = 0) = 0;
|
||||||
virtual void DrawMenuFieldBackground(BView* view,
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
float leftTopRadius,
|
float leftTopRadius,
|
||||||
@@ -192,47 +192,47 @@ public:
|
|||||||
float leftBottomRadius,
|
float leftBottomRadius,
|
||||||
float rightBottomRadius,
|
float rightBottomRadius,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
bool popupIndicator, uint32 flags = 0);
|
bool popupIndicator, uint32 flags = 0) = 0;
|
||||||
virtual void DrawMenuFieldBackground(BView* view,
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawMenuBackground(BView* view,
|
virtual void DrawMenuBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawMenuItemBackground(BView* view,
|
virtual void DrawMenuItemBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawStatusBar(BView* view, BRect& rect,
|
virtual void DrawStatusBar(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& barColor,
|
const rgb_color& barColor,
|
||||||
float progressPosition);
|
float progressPosition) = 0;
|
||||||
|
|
||||||
virtual void DrawCheckBox(BView* view, BRect& rect,
|
virtual void DrawCheckBox(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0);
|
uint32 flags = 0) = 0;
|
||||||
|
|
||||||
virtual void DrawRadioButton(BView* view, BRect& rect,
|
virtual void DrawRadioButton(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0);
|
uint32 flags = 0) = 0;
|
||||||
|
|
||||||
virtual void DrawScrollBarBackground(BView* view,
|
virtual void DrawScrollBarBackground(BView* view,
|
||||||
BRect& rect1, BRect& rect2,
|
BRect& rect1, BRect& rect2,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
orientation orientation);
|
orientation orientation) = 0;
|
||||||
virtual void DrawScrollBarBackground(BView* view,
|
virtual void DrawScrollBarBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
orientation orientation);
|
orientation orientation) = 0;
|
||||||
|
|
||||||
virtual void DrawScrollViewFrame(BView* view,
|
virtual void DrawScrollViewFrame(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
@@ -241,15 +241,15 @@ public:
|
|||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
border_style borderStyle,
|
border_style borderStyle,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawArrowShape(BView* view,
|
virtual void DrawArrowShape(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 direction,
|
const rgb_color& base, uint32 direction,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
float tint = B_DARKEN_MAX_TINT);
|
float tint = B_DARKEN_MAX_TINT) = 0;
|
||||||
|
|
||||||
virtual rgb_color SliderBarColor(const rgb_color& base);
|
virtual rgb_color SliderBarColor(const rgb_color& base) = 0;
|
||||||
|
|
||||||
virtual void DrawSliderBar(BView* view, BRect rect,
|
virtual void DrawSliderBar(BView* view, BRect rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
@@ -257,51 +257,51 @@ public:
|
|||||||
rgb_color leftFillColor,
|
rgb_color leftFillColor,
|
||||||
rgb_color rightFillColor,
|
rgb_color rightFillColor,
|
||||||
float sliderScale, uint32 flags,
|
float sliderScale, uint32 flags,
|
||||||
orientation orientation);
|
orientation orientation) = 0;
|
||||||
virtual void DrawSliderBar(BView* view, BRect rect,
|
virtual void DrawSliderBar(BView* view, BRect rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, rgb_color fillColor,
|
const rgb_color& base, rgb_color fillColor,
|
||||||
uint32 flags, orientation orientation);
|
uint32 flags, orientation orientation) = 0;
|
||||||
|
|
||||||
virtual void DrawSliderThumb(BView* view, BRect& rect,
|
virtual void DrawSliderThumb(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
orientation orientation);
|
orientation orientation) = 0;
|
||||||
|
|
||||||
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
orientation orientation);
|
orientation orientation) = 0;
|
||||||
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
const rgb_color& fill, uint32 flags,
|
const rgb_color& fill, uint32 flags,
|
||||||
orientation orientation);
|
orientation orientation) = 0;
|
||||||
|
|
||||||
virtual void DrawSliderHashMarks(BView* view, BRect& rect,
|
virtual void DrawSliderHashMarks(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, int32 count,
|
const rgb_color& base, int32 count,
|
||||||
hash_mark_location location,
|
hash_mark_location location,
|
||||||
uint32 flags, orientation orientation);
|
uint32 flags, orientation orientation) = 0;
|
||||||
|
|
||||||
virtual void DrawActiveTab(BView* view, BRect& rect,
|
virtual void DrawActiveTab(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
uint32 side = B_TOP_BORDER);
|
uint32 side = B_TOP_BORDER) = 0;
|
||||||
|
|
||||||
virtual void DrawInactiveTab(BView* view, BRect& rect,
|
virtual void DrawInactiveTab(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
uint32 side = B_TOP_BORDER);
|
uint32 side = B_TOP_BORDER) = 0;
|
||||||
|
|
||||||
virtual void DrawSplitter(BView* view, BRect& rect,
|
virtual void DrawSplitter(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
orientation orientation,
|
orientation orientation,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
// various borders
|
// various borders
|
||||||
|
|
||||||
@@ -309,41 +309,41 @@ public:
|
|||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
border_style borderStyle, uint32 flags = 0,
|
border_style borderStyle, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawRaisedBorder(BView* view, BRect& rect,
|
virtual void DrawRaisedBorder(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawGroupFrame(BView* view, BRect& rect,
|
virtual void DrawGroupFrame(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
virtual void DrawTextControlBorder(BView* view, BRect& rect,
|
virtual void DrawTextControlBorder(BView* view, BRect& rect,
|
||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags = 0,
|
const rgb_color& base, uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS);
|
uint32 borders = B_ALL_BORDERS) = 0;
|
||||||
|
|
||||||
// aligned labels
|
// aligned labels
|
||||||
|
|
||||||
virtual void DrawLabel(BView* view, const char* label,
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
BRect rect, const BRect& updateRect,
|
BRect rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
const rgb_color* textColor = NULL);
|
const rgb_color* textColor = NULL) = 0;
|
||||||
virtual void DrawLabel(BView* view, const char* label,
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
BRect rect, const BRect& updateRect,
|
BRect rect, const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
const BAlignment& alignment,
|
const BAlignment& alignment,
|
||||||
const rgb_color* textColor = NULL);
|
const rgb_color* textColor = NULL) = 0;
|
||||||
// TODO: Would be nice to have a (non-virtual) version of this method
|
// TODO: Would be nice to have a (non-virtual) version of this method
|
||||||
// which takes an array of labels and locations. That would save some
|
// which takes an array of labels and locations. That would save some
|
||||||
// setup with the view graphics state.
|
// setup with the view graphics state.
|
||||||
virtual void DrawLabel(BView* view, const char* label,
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
const BPoint& where,
|
const BPoint& where,
|
||||||
const rgb_color* textColor = NULL);
|
const rgb_color* textColor = NULL) = 0;
|
||||||
|
|
||||||
void DrawLabel(BView* view, const char* label,
|
void DrawLabel(BView* view, const char* label,
|
||||||
const BBitmap* icon, BRect rect,
|
const BBitmap* icon, BRect rect,
|
||||||
@@ -355,15 +355,15 @@ public:
|
|||||||
const BRect& updateRect,
|
const BRect& updateRect,
|
||||||
const rgb_color& base, uint32 flags,
|
const rgb_color& base, uint32 flags,
|
||||||
const BAlignment& alignment,
|
const BAlignment& alignment,
|
||||||
const rgb_color* textColor = NULL);
|
const rgb_color* textColor = NULL) = 0;
|
||||||
|
|
||||||
virtual void GetFrameInsets(frame_type frameType,
|
virtual void GetFrameInsets(frame_type frameType,
|
||||||
uint32 flags, float& _left, float& _top,
|
uint32 flags, float& _left, float& _top,
|
||||||
float& _right, float& _bottom);
|
float& _right, float& _bottom) = 0;
|
||||||
virtual void GetBackgroundInsets(
|
virtual void GetBackgroundInsets(
|
||||||
background_type backgroundType,
|
background_type backgroundType,
|
||||||
uint32 flags, float& _left, float& _top,
|
uint32 flags, float& _left, float& _top,
|
||||||
float& _right, float& _bottom);
|
float& _right, float& _bottom) = 0;
|
||||||
void GetInsets(frame_type frameType,
|
void GetInsets(frame_type frameType,
|
||||||
background_type backgroundType,
|
background_type backgroundType,
|
||||||
uint32 flags, float& _left, float& _top,
|
uint32 flags, float& _left, float& _top,
|
||||||
@@ -374,14 +374,14 @@ public:
|
|||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
orientation orientation = B_HORIZONTAL);
|
orientation orientation = B_HORIZONTAL) = 0;
|
||||||
virtual void DrawButtonWithPopUpBackground(BView* view,
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
float radius,
|
float radius,
|
||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
orientation orientation = B_HORIZONTAL);
|
orientation orientation = B_HORIZONTAL) = 0;
|
||||||
virtual void DrawButtonWithPopUpBackground(BView* view,
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
||||||
BRect& rect, const BRect& updateRect,
|
BRect& rect, const BRect& updateRect,
|
||||||
float leftTopRadius,
|
float leftTopRadius,
|
||||||
@@ -391,255 +391,12 @@ public:
|
|||||||
const rgb_color& base,
|
const rgb_color& base,
|
||||||
uint32 flags = 0,
|
uint32 flags = 0,
|
||||||
uint32 borders = B_ALL_BORDERS,
|
uint32 borders = B_ALL_BORDERS,
|
||||||
orientation orientation = B_HORIZONTAL);
|
orientation orientation = B_HORIZONTAL) = 0;
|
||||||
|
|
||||||
void SetBackgroundInfo(
|
void SetBackgroundInfo(
|
||||||
const BMessage& backgroundInfo);
|
const BMessage& backgroundInfo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _DrawButtonFrame(BView* view, BRect& rect,
|
|
||||||
const BRect& updateRect,
|
|
||||||
float leftTopRadius,
|
|
||||||
float rightTopRadius,
|
|
||||||
float leftBottomRadius,
|
|
||||||
float rightBottomRadius,
|
|
||||||
const rgb_color& base,
|
|
||||||
const rgb_color& background,
|
|
||||||
float contrast, float brightness = 1.0,
|
|
||||||
uint32 flags = 0,
|
|
||||||
uint32 borders = B_ALL_BORDERS);
|
|
||||||
|
|
||||||
void _DrawOuterResessedFrame(BView* view,
|
|
||||||
BRect& rect, const rgb_color& base,
|
|
||||||
float contrast = 1.0f,
|
|
||||||
float brightness = 1.0f,
|
|
||||||
uint32 flags = 0,
|
|
||||||
uint32 borders = B_ALL_BORDERS);
|
|
||||||
|
|
||||||
void _DrawFrame(BView* view, BRect& rect,
|
|
||||||
const rgb_color& left,
|
|
||||||
const rgb_color& top,
|
|
||||||
const rgb_color& right,
|
|
||||||
const rgb_color& bottom,
|
|
||||||
uint32 borders = B_ALL_BORDERS);
|
|
||||||
void _DrawFrame(BView* view, BRect& rect,
|
|
||||||
const rgb_color& left,
|
|
||||||
const rgb_color& top,
|
|
||||||
const rgb_color& right,
|
|
||||||
const rgb_color& bottom,
|
|
||||||
const rgb_color& rightTop,
|
|
||||||
const rgb_color& leftBottom,
|
|
||||||
uint32 borders = B_ALL_BORDERS);
|
|
||||||
|
|
||||||
void _DrawButtonBackground(BView* view, BRect& rect,
|
|
||||||
const BRect& updateRect,
|
|
||||||
float leftTopRadius,
|
|
||||||
float rightTopRadius,
|
|
||||||
float leftBottomRadius,
|
|
||||||
float rightBottomRadius,
|
|
||||||
const rgb_color& base,
|
|
||||||
bool popupIndicator = false,
|
|
||||||
uint32 flags = 0,
|
|
||||||
uint32 borders = B_ALL_BORDERS,
|
|
||||||
orientation orientation = B_HORIZONTAL);
|
|
||||||
void _DrawFlatButtonBackground(BView* view,
|
|
||||||
BRect& rect, const BRect& updateRect,
|
|
||||||
const rgb_color& base,
|
|
||||||
bool popupIndicator = false,
|
|
||||||
uint32 flags = 0,
|
|
||||||
uint32 borders = B_ALL_BORDERS,
|
|
||||||
orientation orientation = B_HORIZONTAL);
|
|
||||||
void _DrawNonFlatButtonBackground(BView* view,
|
|
||||||
BRect& rect, const BRect& updateRect,
|
|
||||||
BRegion& clipping,
|
|
||||||
float leftTopRadius,
|
|
||||||
float rightTopRadius,
|
|
||||||
float leftBottomRadius,
|
|
||||||
float rightBottomRadius,
|
|
||||||
const rgb_color& base,
|
|
||||||
bool popupIndicator = false,
|
|
||||||
uint32 flags = 0,
|
|
||||||
uint32 borders = B_ALL_BORDERS,
|
|
||||||
orientation orientation = B_HORIZONTAL);
|
|
||||||
|
|
||||||
void _DrawPopUpMarker(BView* view, const BRect& rect,
|
|
||||||
const rgb_color& base, uint32 flags);
|
|
||||||
|
|
||||||
void _DrawMenuFieldBackgroundOutside(BView* view,
|
|
||||||
BRect& rect, const BRect& updateRect,
|
|
||||||
float leftTopRadius,
|
|
||||||
float rightTopRadius,
|
|
||||||
float leftBottomRadius,
|
|
||||||
float rightBottomRadius,
|
|
||||||
const rgb_color& base,
|
|
||||||
bool popupIndicator = false,
|
|
||||||
uint32 flags = 0);
|
|
||||||
|
|
||||||
void _DrawMenuFieldBackgroundInside(BView* view,
|
|
||||||
BRect& rect, const BRect& updateRect,
|
|
||||||
float leftTopRadius,
|
|
||||||
float rightTopRadius,
|
|
||||||
float leftBottomRadius,
|
|
||||||
float rightBottomRadius,
|
|
||||||
const rgb_color& base, uint32 flags = 0,
|
|
||||||
uint32 borders = B_ALL_BORDERS);
|
|
||||||
|
|
||||||
// Rounded corner methods
|
|
||||||
void _DrawRoundCornerLeftTop(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeColor,
|
|
||||||
const rgb_color& frameColor,
|
|
||||||
const rgb_color& bevelColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerFrameLeftTop(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeColor,
|
|
||||||
const rgb_color& frameColor);
|
|
||||||
|
|
||||||
void _DrawRoundCornerBackgroundLeftTop(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& bevelColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerRightTop(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeTopColor,
|
|
||||||
const rgb_color& edgeRightColor,
|
|
||||||
const rgb_color& frameTopColor,
|
|
||||||
const rgb_color& frameRightColor,
|
|
||||||
const rgb_color& bevelTopColor,
|
|
||||||
const rgb_color& bevelRightColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerFrameRightTop(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeTopColor,
|
|
||||||
const rgb_color& edgeRightColor,
|
|
||||||
const rgb_color& frameTopColor,
|
|
||||||
const rgb_color& frameRightColor);
|
|
||||||
|
|
||||||
void _DrawRoundCornerBackgroundRightTop(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& bevelTopColor,
|
|
||||||
const rgb_color& bevelRightColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerLeftBottom(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeLeftColor,
|
|
||||||
const rgb_color& edgeBottomColor,
|
|
||||||
const rgb_color& frameLeftColor,
|
|
||||||
const rgb_color& frameBottomColor,
|
|
||||||
const rgb_color& bevelLeftColor,
|
|
||||||
const rgb_color& bevelBottomColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerFrameLeftBottom(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeLeftColor,
|
|
||||||
const rgb_color& edgeBottomColor,
|
|
||||||
const rgb_color& frameLeftColor,
|
|
||||||
const rgb_color& frameBottomColor);
|
|
||||||
|
|
||||||
void _DrawRoundCornerBackgroundLeftBottom(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& bevelLeftColor,
|
|
||||||
const rgb_color& bevelBottomColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerRightBottom(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeColor,
|
|
||||||
const rgb_color& frameColor,
|
|
||||||
const rgb_color& bevelColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundCornerFrameRightBottom(BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& background,
|
|
||||||
const rgb_color& edgeColor,
|
|
||||||
const rgb_color& frameColor);
|
|
||||||
|
|
||||||
void _DrawRoundCornerBackgroundRightBottom(
|
|
||||||
BView* view,
|
|
||||||
BRect& cornerRect, const BRect& updateRect,
|
|
||||||
const rgb_color& bevelColor,
|
|
||||||
const BGradientLinear& fillGradient);
|
|
||||||
|
|
||||||
void _DrawRoundBarCorner(BView* view, BRect& rect,
|
|
||||||
const BRect& updateRect,
|
|
||||||
const rgb_color& edgeLightColor,
|
|
||||||
const rgb_color& edgeShadowColor,
|
|
||||||
const rgb_color& frameLightColor,
|
|
||||||
const rgb_color& frameShadowColor,
|
|
||||||
const rgb_color& fillLightColor,
|
|
||||||
const rgb_color& fillShadowColor,
|
|
||||||
float leftInset, float topInset,
|
|
||||||
float rightInset, float bottomInset,
|
|
||||||
orientation orientation);
|
|
||||||
|
|
||||||
// Border color methods
|
|
||||||
rgb_color _EdgeLightColor(const rgb_color& base,
|
|
||||||
float contrast, float brightness,
|
|
||||||
uint32 flags);
|
|
||||||
|
|
||||||
rgb_color _EdgeShadowColor(const rgb_color& base,
|
|
||||||
float contrast, float brightness,
|
|
||||||
uint32 flags);
|
|
||||||
|
|
||||||
rgb_color _FrameLightColor(const rgb_color& base,
|
|
||||||
uint32 flags);
|
|
||||||
|
|
||||||
rgb_color _FrameShadowColor(const rgb_color& base,
|
|
||||||
uint32 flags);
|
|
||||||
|
|
||||||
rgb_color _BevelLightColor(const rgb_color& base,
|
|
||||||
uint32 flags);
|
|
||||||
|
|
||||||
rgb_color _BevelShadowColor(const rgb_color& base,
|
|
||||||
uint32 flags);
|
|
||||||
|
|
||||||
// Background gradient methods
|
|
||||||
void _FillGradient(BView* view, const BRect& rect,
|
|
||||||
const rgb_color& base, float topTint,
|
|
||||||
float bottomTint,
|
|
||||||
orientation orientation = B_HORIZONTAL);
|
|
||||||
|
|
||||||
void _FillGlossyGradient(BView* view,
|
|
||||||
const BRect& rect, const rgb_color& base,
|
|
||||||
float topTint, float middle1Tint,
|
|
||||||
float middle2Tint, float bottomTint,
|
|
||||||
orientation orientation = B_HORIZONTAL);
|
|
||||||
|
|
||||||
void _MakeGradient(BGradientLinear& gradient,
|
|
||||||
const BRect& rect, const rgb_color& base,
|
|
||||||
float topTint, float bottomTint,
|
|
||||||
orientation orientation = B_HORIZONTAL) const;
|
|
||||||
|
|
||||||
void _MakeGlossyGradient(BGradientLinear& gradient,
|
|
||||||
const BRect& rect, const rgb_color& base,
|
|
||||||
float topTint, float middle1Tint,
|
|
||||||
float middle2Tint, float bottomTint,
|
|
||||||
orientation orientation = B_HORIZONTAL) const;
|
|
||||||
|
|
||||||
void _MakeButtonGradient(BGradientLinear& gradient,
|
|
||||||
BRect& rect, const rgb_color& base,
|
|
||||||
uint32 flags, orientation orientation = B_HORIZONTAL) const;
|
|
||||||
|
|
||||||
bool _RadioButtonAndCheckBoxMarkColor(
|
|
||||||
const rgb_color& base, rgb_color& color,
|
|
||||||
uint32 flags) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool fCachedOutline;
|
|
||||||
int32 fCachedWorkspace;
|
int32 fCachedWorkspace;
|
||||||
BMessage fBackgroundInfo;
|
BMessage fBackgroundInfo;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,569 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009-2017, Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _HAIKU_CONTROL_LOOK_H
|
||||||
|
#define _HAIKU_CONTROL_LOOK_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <ControlLook.h>
|
||||||
|
|
||||||
|
|
||||||
|
class BBitmap;
|
||||||
|
class BControl;
|
||||||
|
class BGradientLinear;
|
||||||
|
class BView;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BPrivate {
|
||||||
|
|
||||||
|
|
||||||
|
class HaikuControlLook : public BControlLook {
|
||||||
|
public:
|
||||||
|
HaikuControlLook();
|
||||||
|
virtual ~HaikuControlLook();
|
||||||
|
|
||||||
|
virtual BAlignment DefaultLabelAlignment() const;
|
||||||
|
virtual float DefaultLabelSpacing() const;
|
||||||
|
|
||||||
|
virtual float DefaultItemSpacing() const;
|
||||||
|
|
||||||
|
static float ComposeSpacing(float spacing);
|
||||||
|
|
||||||
|
virtual uint32 Flags(BControl* control) const;
|
||||||
|
|
||||||
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float radius,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float radius,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
|
||||||
|
virtual void DrawMenuBarBackground(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float radius,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, bool popupIndicator,
|
||||||
|
uint32 flags = 0);
|
||||||
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
float radius, const rgb_color& base,
|
||||||
|
bool popupIndicator, uint32 flags = 0);
|
||||||
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
bool popupIndicator, uint32 flags = 0);
|
||||||
|
virtual void DrawMenuFieldBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawMenuBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawMenuItemBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawStatusBar(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& barColor,
|
||||||
|
float progressPosition);
|
||||||
|
|
||||||
|
virtual void DrawCheckBox(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawRadioButton(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0);
|
||||||
|
|
||||||
|
virtual void DrawScrollBarBackground(BView* view,
|
||||||
|
BRect& rect1, BRect& rect2,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
orientation orientation);
|
||||||
|
virtual void DrawScrollBarBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
orientation orientation);
|
||||||
|
|
||||||
|
virtual void DrawScrollViewFrame(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
BRect verticalScrollBarFrame,
|
||||||
|
BRect horizontalScrollBarFrame,
|
||||||
|
const rgb_color& base,
|
||||||
|
border_style borderStyle,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawArrowShape(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 direction,
|
||||||
|
uint32 flags = 0,
|
||||||
|
float tint = B_DARKEN_MAX_TINT);
|
||||||
|
|
||||||
|
virtual rgb_color SliderBarColor(const rgb_color& base);
|
||||||
|
|
||||||
|
virtual void DrawSliderBar(BView* view, BRect rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
rgb_color leftFillColor,
|
||||||
|
rgb_color rightFillColor,
|
||||||
|
float sliderScale, uint32 flags,
|
||||||
|
orientation orientation);
|
||||||
|
virtual void DrawSliderBar(BView* view, BRect rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, rgb_color fillColor,
|
||||||
|
uint32 flags, orientation orientation);
|
||||||
|
|
||||||
|
virtual void DrawSliderThumb(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
orientation orientation);
|
||||||
|
|
||||||
|
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
orientation orientation);
|
||||||
|
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& fill, uint32 flags,
|
||||||
|
orientation orientation);
|
||||||
|
|
||||||
|
virtual void DrawSliderHashMarks(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, int32 count,
|
||||||
|
hash_mark_location location,
|
||||||
|
uint32 flags, orientation orientation);
|
||||||
|
|
||||||
|
virtual void DrawActiveTab(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
uint32 side = B_TOP_BORDER);
|
||||||
|
|
||||||
|
virtual void DrawInactiveTab(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
uint32 side = B_TOP_BORDER);
|
||||||
|
|
||||||
|
virtual void DrawSplitter(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
orientation orientation,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
// various borders
|
||||||
|
|
||||||
|
virtual void DrawBorder(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
border_style borderStyle, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawRaisedBorder(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawGroupFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
virtual void DrawTextControlBorder(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
// aligned labels
|
||||||
|
|
||||||
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
|
BRect rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
const rgb_color* textColor = NULL);
|
||||||
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
|
BRect rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
const BAlignment& alignment,
|
||||||
|
const rgb_color* textColor = NULL);
|
||||||
|
// TODO: Would be nice to have a (non-virtual) version of this method
|
||||||
|
// which takes an array of labels and locations. That would save some
|
||||||
|
// setup with the view graphics state.
|
||||||
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
const BPoint& where,
|
||||||
|
const rgb_color* textColor = NULL);
|
||||||
|
|
||||||
|
virtual void DrawLabel(BView* view, const char* label,
|
||||||
|
const BBitmap* icon, BRect rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& base, uint32 flags,
|
||||||
|
const BAlignment& alignment,
|
||||||
|
const rgb_color* textColor = NULL);
|
||||||
|
|
||||||
|
virtual void GetFrameInsets(frame_type frameType,
|
||||||
|
uint32 flags, float& _left, float& _top,
|
||||||
|
float& _right, float& _bottom);
|
||||||
|
virtual void GetBackgroundInsets(
|
||||||
|
background_type backgroundType,
|
||||||
|
uint32 flags, float& _left, float& _top,
|
||||||
|
float& _right, float& _bottom);
|
||||||
|
|
||||||
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
float radius,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void _DrawButtonFrame(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
const rgb_color& background,
|
||||||
|
float contrast, float brightness = 1.0,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
void _DrawOuterResessedFrame(BView* view,
|
||||||
|
BRect& rect, const rgb_color& base,
|
||||||
|
float contrast = 1.0f,
|
||||||
|
float brightness = 1.0f,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
void _DrawFrame(BView* view, BRect& rect,
|
||||||
|
const rgb_color& left,
|
||||||
|
const rgb_color& top,
|
||||||
|
const rgb_color& right,
|
||||||
|
const rgb_color& bottom,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
void _DrawFrame(BView* view, BRect& rect,
|
||||||
|
const rgb_color& left,
|
||||||
|
const rgb_color& top,
|
||||||
|
const rgb_color& right,
|
||||||
|
const rgb_color& bottom,
|
||||||
|
const rgb_color& rightTop,
|
||||||
|
const rgb_color& leftBottom,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
void _DrawButtonBackground(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
bool popupIndicator = false,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
void _DrawFlatButtonBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
const rgb_color& base,
|
||||||
|
bool popupIndicator = false,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
void _DrawNonFlatButtonBackground(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
BRegion& clipping,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
bool popupIndicator = false,
|
||||||
|
uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
|
||||||
|
void _DrawPopUpMarker(BView* view, const BRect& rect,
|
||||||
|
const rgb_color& base, uint32 flags);
|
||||||
|
|
||||||
|
void _DrawMenuFieldBackgroundOutside(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base,
|
||||||
|
bool popupIndicator = false,
|
||||||
|
uint32 flags = 0);
|
||||||
|
|
||||||
|
void _DrawMenuFieldBackgroundInside(BView* view,
|
||||||
|
BRect& rect, const BRect& updateRect,
|
||||||
|
float leftTopRadius,
|
||||||
|
float rightTopRadius,
|
||||||
|
float leftBottomRadius,
|
||||||
|
float rightBottomRadius,
|
||||||
|
const rgb_color& base, uint32 flags = 0,
|
||||||
|
uint32 borders = B_ALL_BORDERS);
|
||||||
|
|
||||||
|
// Rounded corner methods
|
||||||
|
void _DrawRoundCornerLeftTop(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeColor,
|
||||||
|
const rgb_color& frameColor,
|
||||||
|
const rgb_color& bevelColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerFrameLeftTop(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeColor,
|
||||||
|
const rgb_color& frameColor);
|
||||||
|
|
||||||
|
void _DrawRoundCornerBackgroundLeftTop(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& bevelColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerRightTop(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeTopColor,
|
||||||
|
const rgb_color& edgeRightColor,
|
||||||
|
const rgb_color& frameTopColor,
|
||||||
|
const rgb_color& frameRightColor,
|
||||||
|
const rgb_color& bevelTopColor,
|
||||||
|
const rgb_color& bevelRightColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerFrameRightTop(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeTopColor,
|
||||||
|
const rgb_color& edgeRightColor,
|
||||||
|
const rgb_color& frameTopColor,
|
||||||
|
const rgb_color& frameRightColor);
|
||||||
|
|
||||||
|
void _DrawRoundCornerBackgroundRightTop(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& bevelTopColor,
|
||||||
|
const rgb_color& bevelRightColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerLeftBottom(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeLeftColor,
|
||||||
|
const rgb_color& edgeBottomColor,
|
||||||
|
const rgb_color& frameLeftColor,
|
||||||
|
const rgb_color& frameBottomColor,
|
||||||
|
const rgb_color& bevelLeftColor,
|
||||||
|
const rgb_color& bevelBottomColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerFrameLeftBottom(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeLeftColor,
|
||||||
|
const rgb_color& edgeBottomColor,
|
||||||
|
const rgb_color& frameLeftColor,
|
||||||
|
const rgb_color& frameBottomColor);
|
||||||
|
|
||||||
|
void _DrawRoundCornerBackgroundLeftBottom(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& bevelLeftColor,
|
||||||
|
const rgb_color& bevelBottomColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerRightBottom(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeColor,
|
||||||
|
const rgb_color& frameColor,
|
||||||
|
const rgb_color& bevelColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundCornerFrameRightBottom(BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& background,
|
||||||
|
const rgb_color& edgeColor,
|
||||||
|
const rgb_color& frameColor);
|
||||||
|
|
||||||
|
void _DrawRoundCornerBackgroundRightBottom(
|
||||||
|
BView* view,
|
||||||
|
BRect& cornerRect, const BRect& updateRect,
|
||||||
|
const rgb_color& bevelColor,
|
||||||
|
const BGradientLinear& fillGradient);
|
||||||
|
|
||||||
|
void _DrawRoundBarCorner(BView* view, BRect& rect,
|
||||||
|
const BRect& updateRect,
|
||||||
|
const rgb_color& edgeLightColor,
|
||||||
|
const rgb_color& edgeShadowColor,
|
||||||
|
const rgb_color& frameLightColor,
|
||||||
|
const rgb_color& frameShadowColor,
|
||||||
|
const rgb_color& fillLightColor,
|
||||||
|
const rgb_color& fillShadowColor,
|
||||||
|
float leftInset, float topInset,
|
||||||
|
float rightInset, float bottomInset,
|
||||||
|
orientation orientation);
|
||||||
|
|
||||||
|
// Border color methods
|
||||||
|
rgb_color _EdgeLightColor(const rgb_color& base,
|
||||||
|
float contrast, float brightness,
|
||||||
|
uint32 flags);
|
||||||
|
|
||||||
|
rgb_color _EdgeShadowColor(const rgb_color& base,
|
||||||
|
float contrast, float brightness,
|
||||||
|
uint32 flags);
|
||||||
|
|
||||||
|
rgb_color _FrameLightColor(const rgb_color& base,
|
||||||
|
uint32 flags);
|
||||||
|
|
||||||
|
rgb_color _FrameShadowColor(const rgb_color& base,
|
||||||
|
uint32 flags);
|
||||||
|
|
||||||
|
rgb_color _BevelLightColor(const rgb_color& base,
|
||||||
|
uint32 flags);
|
||||||
|
|
||||||
|
rgb_color _BevelShadowColor(const rgb_color& base,
|
||||||
|
uint32 flags);
|
||||||
|
|
||||||
|
// Background gradient methods
|
||||||
|
void _FillGradient(BView* view, const BRect& rect,
|
||||||
|
const rgb_color& base, float topTint,
|
||||||
|
float bottomTint,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
|
||||||
|
void _FillGlossyGradient(BView* view,
|
||||||
|
const BRect& rect, const rgb_color& base,
|
||||||
|
float topTint, float middle1Tint,
|
||||||
|
float middle2Tint, float bottomTint,
|
||||||
|
orientation orientation = B_HORIZONTAL);
|
||||||
|
|
||||||
|
void _MakeGradient(BGradientLinear& gradient,
|
||||||
|
const BRect& rect, const rgb_color& base,
|
||||||
|
float topTint, float bottomTint,
|
||||||
|
orientation orientation = B_HORIZONTAL) const;
|
||||||
|
|
||||||
|
void _MakeGlossyGradient(BGradientLinear& gradient,
|
||||||
|
const BRect& rect, const rgb_color& base,
|
||||||
|
float topTint, float middle1Tint,
|
||||||
|
float middle2Tint, float bottomTint,
|
||||||
|
orientation orientation = B_HORIZONTAL) const;
|
||||||
|
|
||||||
|
void _MakeButtonGradient(BGradientLinear& gradient,
|
||||||
|
BRect& rect, const rgb_color& base,
|
||||||
|
uint32 flags, orientation orientation = B_HORIZONTAL) const;
|
||||||
|
|
||||||
|
bool _RadioButtonAndCheckBoxMarkColor(
|
||||||
|
const rgb_color& base, rgb_color& color,
|
||||||
|
uint32 flags) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool fCachedOutline;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
#endif // _HAIKU_CONTROL_LOOK_H
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -41,6 +41,7 @@
|
|||||||
#include <DecorInfo.h>
|
#include <DecorInfo.h>
|
||||||
#include <DefaultColors.h>
|
#include <DefaultColors.h>
|
||||||
#include <DesktopLink.h>
|
#include <DesktopLink.h>
|
||||||
|
#include <HaikuControlLook.h>
|
||||||
#include <InputServerTypes.h>
|
#include <InputServerTypes.h>
|
||||||
#include <input_globals.h>
|
#include <input_globals.h>
|
||||||
#include <InterfacePrivate.h>
|
#include <InterfacePrivate.h>
|
||||||
@@ -1286,7 +1287,7 @@ _init_interface_kit_()
|
|||||||
be_clipboard = new BClipboard(NULL);
|
be_clipboard = new BClipboard(NULL);
|
||||||
|
|
||||||
// TODO: Could support different themes here in the future.
|
// TODO: Could support different themes here in the future.
|
||||||
be_control_look = new BControlLook();
|
be_control_look = new HaikuControlLook();
|
||||||
|
|
||||||
_init_global_fonts_();
|
_init_global_fonts_();
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
|||||||
GroupLayout.cpp
|
GroupLayout.cpp
|
||||||
GroupLayoutBuilder.cpp
|
GroupLayoutBuilder.cpp
|
||||||
GroupView.cpp
|
GroupView.cpp
|
||||||
|
HaikuControlLook.cpp
|
||||||
Icon.cpp
|
Icon.cpp
|
||||||
Input.cpp
|
Input.cpp
|
||||||
InterfaceDefs.cpp
|
InterfaceDefs.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user