2009-02-15 18:23:19 +00:00
|
|
|
/*
|
2020-03-04 05:03:47 -05:00
|
|
|
* Copyright 2009-2020 Haiku, Inc. All rights reserved.
|
2009-02-15 18:23:19 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef _CONTROL_LOOK_H
|
|
|
|
|
#define _CONTROL_LOOK_H
|
|
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
#include <Alignment.h>
|
|
|
|
|
#include <Font.h>
|
|
|
|
|
#include <Rect.h>
|
|
|
|
|
#include <Slider.h>
|
|
|
|
|
|
|
|
|
|
|
2013-12-22 02:01:13 +01:00
|
|
|
class BBitmap;
|
2009-02-15 18:23:19 +00:00
|
|
|
class BControl;
|
|
|
|
|
class BGradientLinear;
|
|
|
|
|
class BView;
|
|
|
|
|
|
|
|
|
|
|
2009-08-27 11:12:41 +00:00
|
|
|
// WARNING! This is experimental API and may change! Be prepared to
|
|
|
|
|
// recompile your software in a next version of haiku.
|
|
|
|
|
|
|
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BControlLook {
|
|
|
|
|
public:
|
|
|
|
|
BControlLook();
|
|
|
|
|
virtual ~BControlLook();
|
|
|
|
|
|
2010-04-08 10:03:43 +00:00
|
|
|
// TODO: Probably more convenient to pull these enums into global
|
|
|
|
|
// namespace and rename them to e.g. "B_CONTROL_LOOK_FOCUSED" instead of
|
|
|
|
|
// "BControlLook::B_FOCUSED".
|
|
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
enum frame_type {
|
|
|
|
|
B_BUTTON_FRAME,
|
2013-12-22 01:57:36 +01:00
|
|
|
B_GROUP_FRAME,
|
|
|
|
|
B_MENU_FIELD_FRAME,
|
|
|
|
|
B_SCROLL_VIEW_FRAME,
|
|
|
|
|
B_TEXT_CONTROL_FRAME,
|
2009-02-15 18:23:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum background_type {
|
|
|
|
|
B_BUTTON_BACKGROUND,
|
2013-12-30 04:42:52 +01:00
|
|
|
B_BUTTON_WITH_POP_UP_BACKGROUND,
|
2009-02-15 18:23:19 +00:00
|
|
|
B_MENU_BACKGROUND,
|
2013-12-22 01:57:36 +01:00
|
|
|
B_MENU_BAR_BACKGROUND,
|
|
|
|
|
B_MENU_FIELD_BACKGROUND,
|
|
|
|
|
B_MENU_ITEM_BACKGROUND,
|
|
|
|
|
B_HORIZONTAL_SCROLL_BAR_BACKGROUND,
|
|
|
|
|
B_VERTICAL_SCROLL_BAR_BACKGROUND,
|
2009-02-15 18:23:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
B_LEFT_BORDER = 1 << 0,
|
|
|
|
|
B_RIGHT_BORDER = 1 << 1,
|
|
|
|
|
B_TOP_BORDER = 1 << 2,
|
|
|
|
|
B_BOTTOM_BORDER = 1 << 3,
|
|
|
|
|
|
|
|
|
|
B_ALL_BORDERS = B_LEFT_BORDER | B_RIGHT_BORDER
|
|
|
|
|
| B_TOP_BORDER | B_BOTTOM_BORDER
|
|
|
|
|
};
|
|
|
|
|
|
2009-03-21 17:22:56 +00:00
|
|
|
enum {
|
|
|
|
|
B_LEFT_ARROW = 0,
|
|
|
|
|
B_RIGHT_ARROW = 1,
|
|
|
|
|
B_UP_ARROW = 2,
|
2013-04-07 00:34:13 -04:00
|
|
|
B_DOWN_ARROW = 3,
|
|
|
|
|
B_LEFT_UP_ARROW = 4,
|
|
|
|
|
B_RIGHT_UP_ARROW = 5,
|
|
|
|
|
B_RIGHT_DOWN_ARROW = 6,
|
|
|
|
|
B_LEFT_DOWN_ARROW = 7
|
2009-03-21 17:22:56 +00:00
|
|
|
};
|
|
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
enum {
|
2013-12-21 02:06:59 +01:00
|
|
|
B_FOCUSED = 1 << 0,
|
|
|
|
|
B_CLICKED = 1 << 1, // some controls activate on mouse up
|
|
|
|
|
B_ACTIVATED = 1 << 2,
|
|
|
|
|
B_HOVER = 1 << 3,
|
|
|
|
|
B_DISABLED = 1 << 4,
|
|
|
|
|
B_DEFAULT_BUTTON = 1 << 5,
|
|
|
|
|
B_IGNORE_OUTLINE = 1 << 6,
|
|
|
|
|
B_PARTIALLY_ACTIVATED = 1 << 7, // like B_ACTIVATED, but for tri-state
|
2013-12-29 00:02:35 +01:00
|
|
|
B_FLAT = 1 << 8, // flat look (e.g. button background)
|
2014-10-01 12:09:27 +02:00
|
|
|
B_INVALID = 1 << 9, // invalid value, use B_FAILURE_COLOR
|
2015-12-10 12:52:48 -06:00
|
|
|
B_IS_CONTROL = 1 << 10, // use control colors
|
2009-03-28 19:37:43 +00:00
|
|
|
|
2014-10-01 12:09:27 +02:00
|
|
|
B_BLEND_FRAME = 1 << 16,
|
2009-02-15 18:23:19 +00:00
|
|
|
};
|
|
|
|
|
|
2020-03-04 05:03:47 -05:00
|
|
|
enum {
|
|
|
|
|
B_KNOB_NONE = 0,
|
|
|
|
|
B_KNOB_DOTS,
|
|
|
|
|
B_KNOB_LINES
|
|
|
|
|
};
|
|
|
|
|
|
2017-09-10 22:15:07 -04:00
|
|
|
virtual BAlignment DefaultLabelAlignment() const = 0;
|
|
|
|
|
virtual float DefaultLabelSpacing() const = 0;
|
2009-10-17 17:01:22 +00:00
|
|
|
|
2017-09-10 22:15:07 -04:00
|
|
|
virtual float DefaultItemSpacing() const = 0;
|
2011-06-07 20:40:56 +00:00
|
|
|
|
|
|
|
|
static float ComposeSpacing(float spacing);
|
2009-10-17 17:01:22 +00:00
|
|
|
|
2017-09-10 22:15:07 -04:00
|
|
|
virtual uint32 Flags(BControl* control) const = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2009-02-16 13:57:31 +00:00
|
|
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2009-03-25 23:34:19 +00:00
|
|
|
const rgb_color& background,
|
2009-02-15 18:23:19 +00:00
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
2012-03-19 20:30:22 -04:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
float radius,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
const rgb_color& background,
|
|
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawButtonFrame(BView* view, BRect& rect,
|
2012-03-19 20:30:22 -04:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
float leftTopRadius,
|
|
|
|
|
float rightTopRadius,
|
|
|
|
|
float leftBottomRadius,
|
|
|
|
|
float rightBottomRadius,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
const rgb_color& background,
|
|
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
uint32 flags = 0,
|
|
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation = B_HORIZONTAL) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
2012-03-19 20:30:22 -04:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
float radius,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
uint32 flags = 0,
|
|
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation = B_HORIZONTAL) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawButtonBackground(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
2012-03-19 20:30:22 -04:00
|
|
|
float leftTopRadius,
|
|
|
|
|
float rightTopRadius,
|
|
|
|
|
float leftBottomRadius,
|
|
|
|
|
float rightBottomRadius,
|
2009-02-15 18:23:19 +00:00
|
|
|
const rgb_color& base,
|
|
|
|
|
uint32 flags = 0,
|
|
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation = B_HORIZONTAL) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawMenuBarBackground(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2009-03-18 17:18:06 +00:00
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2009-02-16 13:57:31 +00:00
|
|
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2009-03-25 23:34:19 +00:00
|
|
|
const rgb_color& background,
|
2009-02-16 13:57:31 +00:00
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
2012-03-19 20:30:22 -04:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
float radius,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
const rgb_color& background,
|
|
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawMenuFieldFrame(BView* view, BRect& rect,
|
2012-03-19 20:30:22 -04:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
float leftTopRadius,
|
|
|
|
|
float rightTopRadius,
|
|
|
|
|
float leftBottomRadius,
|
|
|
|
|
float rightBottomRadius,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
const rgb_color& background,
|
|
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-16 13:57:31 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawMenuFieldBackground(BView* view,
|
2009-02-15 18:23:19 +00:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, bool popupIndicator,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 flags = 0) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawMenuFieldBackground(BView* view,
|
2012-03-19 20:30:22 -04:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
float radius, const rgb_color& base,
|
2017-09-10 22:15:07 -04:00
|
|
|
bool popupIndicator, uint32 flags = 0) = 0;
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawMenuFieldBackground(BView* view,
|
2012-03-19 20:30:22 -04:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
float leftTopRadius,
|
|
|
|
|
float rightTopRadius,
|
|
|
|
|
float leftBottomRadius,
|
|
|
|
|
float rightBottomRadius,
|
|
|
|
|
const rgb_color& base,
|
2017-09-10 22:15:07 -04:00
|
|
|
bool popupIndicator, uint32 flags = 0) = 0;
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawMenuFieldBackground(BView* view,
|
2009-02-15 18:23:19 +00:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawMenuBackground(BView* view,
|
2009-02-15 18:23:19 +00:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawMenuItemBackground(BView* view,
|
2009-02-15 18:23:19 +00:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawStatusBar(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
const rgb_color& barColor,
|
2017-09-10 22:15:07 -04:00
|
|
|
float progressPosition) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawCheckBox(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 flags = 0) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawRadioButton(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 flags = 0) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2018-07-22 18:24:47 +00:00
|
|
|
virtual void DrawScrollBarBackground(BView* view,
|
|
|
|
|
BRect& rect1, BRect& rect2,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
2018-07-22 18:24:47 +00:00
|
|
|
orientation orientation) = 0;
|
|
|
|
|
virtual void DrawScrollBarBackground(BView* view,
|
|
|
|
|
BRect& rect, const BRect& updateRect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const rgb_color& base, uint32 flags,
|
2018-07-22 18:24:47 +00:00
|
|
|
orientation orientation) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawScrollViewFrame(BView* view,
|
2009-03-23 11:19:31 +00:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
BRect verticalScrollBarFrame,
|
|
|
|
|
BRect horizontalScrollBarFrame,
|
|
|
|
|
const rgb_color& base,
|
2016-04-29 13:57:50 -07:00
|
|
|
border_style borderStyle,
|
2009-03-23 11:19:31 +00:00
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-03-23 11:19:31 +00:00
|
|
|
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawArrowShape(BView* view,
|
2009-03-21 17:22:56 +00:00
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 direction,
|
|
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
float tint = B_DARKEN_MAX_TINT) = 0;
|
2009-03-21 17:22:56 +00:00
|
|
|
|
2017-09-10 22:15:07 -04:00
|
|
|
virtual rgb_color SliderBarColor(const rgb_color& base) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawSliderBar(BView* view, BRect rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
rgb_color leftFillColor,
|
|
|
|
|
rgb_color rightFillColor,
|
|
|
|
|
float sliderScale, uint32 flags,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
virtual void DrawSliderBar(BView* view, BRect rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, rgb_color fillColor,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 flags, orientation orientation) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
|
|
|
|
virtual void DrawSliderThumb(BView* view, BRect& rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation) = 0;
|
2009-02-24 11:09:27 +00:00
|
|
|
virtual void DrawSliderTriangle(BView* view, BRect& rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
const rgb_color& fill, uint32 flags,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
|
|
|
|
virtual void DrawSliderHashMarks(BView* view, BRect& rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, int32 count,
|
|
|
|
|
hash_mark_location location,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 flags, orientation orientation) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawActiveTab(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-01-21 17:22:16 +01:00
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 side = B_TOP_BORDER) = 0;
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawInactiveTab(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-01-21 17:22:16 +01:00
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 side = B_TOP_BORDER) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawSplitter(BView* view, BRect& rect,
|
2009-06-20 15:03:33 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2013-07-08 18:27:55 -04:00
|
|
|
orientation orientation,
|
2009-06-20 15:03:33 +00:00
|
|
|
uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-06-20 15:03:33 +00:00
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
// various borders
|
|
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawBorder(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2016-04-29 13:57:50 -07:00
|
|
|
border_style borderStyle, uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawRaisedBorder(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawGroupFrame(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawTextControlBorder(BView* view, BRect& rect,
|
2009-02-15 18:23:19 +00:00
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
2017-09-10 22:15:07 -04:00
|
|
|
uint32 borders = B_ALL_BORDERS) = 0;
|
2009-02-15 18:23:19 +00:00
|
|
|
|
|
|
|
|
// aligned labels
|
|
|
|
|
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawLabel(BView* view, const char* label,
|
2009-02-15 18:23:19 +00:00
|
|
|
BRect rect, const BRect& updateRect,
|
2015-12-10 12:52:48 -06:00
|
|
|
const rgb_color& base, uint32 flags,
|
2017-09-10 22:15:07 -04:00
|
|
|
const rgb_color* textColor = NULL) = 0;
|
2012-03-19 20:30:22 -04:00
|
|
|
virtual void DrawLabel(BView* view, const char* label,
|
2009-02-15 18:23:19 +00:00
|
|
|
BRect rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
2015-12-10 12:52:48 -06:00
|
|
|
const BAlignment& alignment,
|
2017-09-10 22:15:07 -04:00
|
|
|
const rgb_color* textColor = NULL) = 0;
|
2010-01-23 12:48:18 +00:00
|
|
|
// 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.
|
2017-09-10 15:22:29 -04:00
|
|
|
virtual void DrawLabel(BView* view, const char* label,
|
2010-01-23 12:48:18 +00:00
|
|
|
const rgb_color& base, uint32 flags,
|
2015-12-10 12:52:48 -06:00
|
|
|
const BPoint& where,
|
2017-09-10 22:15:07 -04:00
|
|
|
const rgb_color* textColor = NULL) = 0;
|
2010-01-23 12:48:18 +00:00
|
|
|
|
2013-12-22 02:01:13 +01:00
|
|
|
void DrawLabel(BView* view, const char* label,
|
|
|
|
|
const BBitmap* icon, BRect rect,
|
|
|
|
|
const BRect& updateRect,
|
2015-12-10 12:52:48 -06:00
|
|
|
const rgb_color& base, uint32 flags,
|
|
|
|
|
const rgb_color* textColor = NULL);
|
2013-12-22 02:01:13 +01:00
|
|
|
virtual void DrawLabel(BView* view, const char* label,
|
|
|
|
|
const BBitmap* icon, BRect rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
2015-12-10 12:52:48 -06:00
|
|
|
const BAlignment& alignment,
|
2017-09-10 22:15:07 -04:00
|
|
|
const rgb_color* textColor = NULL) = 0;
|
2013-12-22 02:01:13 +01:00
|
|
|
|
2013-12-22 01:57:36 +01:00
|
|
|
virtual void GetFrameInsets(frame_type frameType,
|
|
|
|
|
uint32 flags, float& _left, float& _top,
|
2017-09-10 22:15:07 -04:00
|
|
|
float& _right, float& _bottom) = 0;
|
2013-12-22 01:57:36 +01:00
|
|
|
virtual void GetBackgroundInsets(
|
|
|
|
|
background_type backgroundType,
|
|
|
|
|
uint32 flags, float& _left, float& _top,
|
2017-09-10 22:15:07 -04:00
|
|
|
float& _right, float& _bottom) = 0;
|
2013-12-22 01:57:36 +01:00
|
|
|
void GetInsets(frame_type frameType,
|
|
|
|
|
background_type backgroundType,
|
|
|
|
|
uint32 flags, float& _left, float& _top,
|
|
|
|
|
float& _right, float& _bottom);
|
|
|
|
|
|
2013-12-30 04:42:52 +01:00
|
|
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
|
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
uint32 flags = 0,
|
|
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation = B_HORIZONTAL) = 0;
|
2013-12-30 04:42:52 +01:00
|
|
|
virtual void DrawButtonWithPopUpBackground(BView* view,
|
|
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
float radius,
|
|
|
|
|
const rgb_color& base,
|
|
|
|
|
uint32 flags = 0,
|
|
|
|
|
uint32 borders = B_ALL_BORDERS,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation = B_HORIZONTAL) = 0;
|
2013-12-30 04:42:52 +01:00
|
|
|
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,
|
2017-09-10 22:15:07 -04:00
|
|
|
orientation orientation = B_HORIZONTAL) = 0;
|
2013-12-30 04:42:52 +01:00
|
|
|
|
2012-02-26 14:58:52 +01:00
|
|
|
void SetBackgroundInfo(
|
|
|
|
|
const BMessage& backgroundInfo);
|
2012-02-22 19:06:22 -05:00
|
|
|
|
2019-08-14 19:31:13 -07:00
|
|
|
virtual void DrawTabFrame(BView* view, BRect& rect,
|
|
|
|
|
const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags = 0,
|
|
|
|
|
uint32 borders = B_ALL_BORDERS,
|
|
|
|
|
border_style borderStyle = B_FANCY_BORDER,
|
|
|
|
|
uint32 side = B_TOP_BORDER) = 0;
|
2020-03-04 05:03:47 -05:00
|
|
|
|
|
|
|
|
virtual void DrawScrollBarButton(BView* view,
|
|
|
|
|
BRect rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
|
|
|
|
int32 direction, orientation orientation,
|
|
|
|
|
bool down = false) = 0;
|
|
|
|
|
virtual void DrawScrollBarThumb(BView* view,
|
|
|
|
|
BRect& rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
|
|
|
|
orientation orientation,
|
|
|
|
|
uint32 knobStyle = B_KNOB_NONE) = 0;
|
|
|
|
|
virtual void DrawScrollBarBorder(BView* view,
|
|
|
|
|
BRect rect, const BRect& updateRect,
|
|
|
|
|
const rgb_color& base, uint32 flags,
|
|
|
|
|
orientation orientation) = 0;
|
|
|
|
|
|
2018-08-14 13:38:18 -04:00
|
|
|
private:
|
|
|
|
|
// FBC padding
|
|
|
|
|
virtual void _ReservedControlLook5();
|
|
|
|
|
virtual void _ReservedControlLook6();
|
|
|
|
|
virtual void _ReservedControlLook7();
|
|
|
|
|
virtual void _ReservedControlLook8();
|
|
|
|
|
virtual void _ReservedControlLook9();
|
|
|
|
|
virtual void _ReservedControlLook10();
|
|
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
protected:
|
2012-02-22 19:06:22 -05:00
|
|
|
int32 fCachedWorkspace;
|
|
|
|
|
BMessage fBackgroundInfo;
|
2012-02-26 14:58:52 +01:00
|
|
|
|
|
|
|
|
uint32 _reserved[20];
|
2009-02-15 18:23:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern BControlLook* be_control_look;
|
|
|
|
|
|
2019-05-02 02:45:48 +02:00
|
|
|
extern "C" _EXPORT BControlLook *instantiate_control_look(image_id id);
|
|
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
|
|
using BPrivate::BControlLook;
|
|
|
|
|
using BPrivate::be_control_look;
|
|
|
|
|
|
2012-03-19 20:30:22 -04:00
|
|
|
|
2009-02-15 18:23:19 +00:00
|
|
|
#endif // _CONTROL_LOOK_H
|