xref: /haiku/src/add-ons/control_look/FlatControlLook/FlatControlLook.h (revision 610f99c838cb661ff85377789ffd3ad4ff672a08)
1 /*
2  * Copyright 2009-2020 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		François Revol, revol@free.fr
7  *		Nahuel Tello, ntello@unarix.com.ar
8  */
9 #ifndef FLAT_CONTROL_LOOK_H
10 #define FLAT_CONTROL_LOOK_H
11 
12 
13 #include <ControlLook.h>
14 
15 #include "HaikuControlLook.h"
16 
17 
18 class BBitmap;
19 class BControl;
20 class BGradientLinear;
21 class BView;
22 
23 namespace BPrivate {
24 
25 using BPrivate::HaikuControlLook;
26 
27 class FlatControlLook : public HaikuControlLook {
28 public:
29 								FlatControlLook();
30 	virtual						~FlatControlLook();
31 
32 
33 	virtual	void				DrawMenuBarBackground(BView* view, BRect& rect,
34 									const BRect& updateRect,
35 									const rgb_color& base,
36 									uint32 flags,
37 									uint32 borders = B_ALL_BORDERS);
38 	virtual	void				DrawMenuItemBackground(BView* view,
39 									BRect& rect, const BRect& updateRect,
40 									const rgb_color& base, uint32 flags = 0,
41 									uint32 borders = B_ALL_BORDERS);
42 	virtual	void				DrawMenuFieldFrame(BView* view, BRect& rect,
43 									const BRect& updateRect, const rgb_color& base,
44 									const rgb_color& background, uint32 flags, uint32 borders);
45 	virtual	void				DrawMenuFieldFrame(BView* view, BRect& rect,
46 									const BRect& updateRect, float radius, const rgb_color& base,
47 									const rgb_color& background, uint32 flags, uint32 borders);
48 	virtual void				DrawMenuFieldFrame(BView* view, BRect& rect,
49 									const BRect& updateRect, float leftTopRadius,
50 									float rightTopRadius, float leftBottomRadius,
51 									float rightBottomRadius, const rgb_color& base,
52 									const rgb_color& background, uint32 flags, uint32 borders);
53 
54 
55 	virtual	void				DrawButtonBackground(BView* view, BRect& rect,
56 									const BRect& updateRect,
57 									const rgb_color& base,
58 									uint32 flags = 0,
59 									uint32 borders = B_ALL_BORDERS,
60 									orientation orientation = B_HORIZONTAL);
61 	virtual	void				DrawButtonBackground(BView* view, BRect& rect,
62 									const BRect& updateRect,
63 									float radius,
64 									const rgb_color& base,
65 									uint32 flags = 0,
66 									uint32 borders = B_ALL_BORDERS,
67 									orientation orientation = B_HORIZONTAL);
68 	virtual	void				DrawButtonBackground(BView* view, BRect& rect,
69 									const BRect& updateRect,
70 									float leftTopRadius,
71 									float rightTopRadius,
72 									float leftBottomRadius,
73 									float rightBottomRadius,
74 									const rgb_color& base,
75 									uint32 flags = 0,
76 									uint32 borders = B_ALL_BORDERS,
77 									orientation orientation = B_HORIZONTAL);
78 
79 	void						_DrawButtonBackground(BView* view, BRect& rect,
80 									const BRect& updateRect,
81 									float leftTopRadius,
82 									float rightTopRadius,
83 									float leftBottomRadius,
84 									float rightBottomRadius,
85 									const rgb_color& base,
86 									bool popupIndicator = false,
87 									uint32 flags = 0,
88 									uint32 borders = B_ALL_BORDERS,
89 									orientation orientation = B_HORIZONTAL);
90 	void						_DrawNonFlatButtonBackground(BView* view, BRect& rect,
91 									const BRect& updateRect,
92 									BRegion& clipping,
93 									float leftTopRadius,
94 									float rightTopRadius,
95 									float leftBottomRadius,
96 									float rightBottomRadius,
97 									const rgb_color& base,
98 									bool popupIndicator,
99 									uint32 flags,
100 									uint32 borders,
101 									orientation orientation);
102 
103 	virtual	void				DrawButtonWithPopUpBackground(BView* view,
104 									BRect& rect, const BRect& updateRect,
105 									const rgb_color& base,
106 									uint32 flags = 0,
107 									uint32 borders = B_ALL_BORDERS,
108 									orientation orientation = B_HORIZONTAL);
109 	virtual	void				DrawButtonWithPopUpBackground(BView* view,
110 									BRect& rect, const BRect& updateRect,
111 									float radius,
112 									const rgb_color& base,
113 									uint32 flags = 0,
114 									uint32 borders = B_ALL_BORDERS,
115 									orientation orientation = B_HORIZONTAL);
116 	virtual	void				DrawButtonWithPopUpBackground(BView* view,
117 									BRect& rect, const BRect& updateRect,
118 									float leftTopRadius,
119 									float rightTopRadius,
120 									float leftBottomRadius,
121 									float rightBottomRadius,
122 									const rgb_color& base,
123 									uint32 flags = 0,
124 									uint32 borders = B_ALL_BORDERS,
125 									orientation orientation = B_HORIZONTAL);
126 
127 	virtual	void				DrawMenuFieldBackground(BView* view, BRect& rect,
128 									const BRect& updateRect, const rgb_color& base,
129 									bool popupIndicator, uint32 flags);
130 	virtual	void				DrawMenuFieldBackground(BView* view, BRect& rect,
131 									const BRect& updateRect, const rgb_color& base,
132 									uint32 flags, uint32 borders);
133 	virtual	void				DrawMenuFieldBackground(BView* view, BRect& rect,
134 									const BRect& updateRect, float radius, const rgb_color& base,
135 									bool popupIndicator, uint32 flags);
136 	virtual	void				DrawMenuFieldBackground(BView* view, BRect& rect,
137 									const BRect& updateRect, float leftTopRadius,
138 									float rightTopRadius, float leftBottomRadius,
139 									float rightBottomRadius, const rgb_color& base,
140 									bool popupIndicator, uint32 flags);
141 	virtual	void				DrawSplitter(BView* view, BRect& rect, const BRect& updateRect,
142 									const rgb_color& base, orientation orientation, uint32 flags,
143 									uint32 borders);
144 	void 						_DrawMenuFieldBackgroundInside(BView* view, BRect& rect,
145 									const BRect& updateRect, float leftTopRadius,
146 									float rightTopRadius, float leftBottomRadius,
147 									float rightBottomRadius, const rgb_color& base,
148 									uint32 flags, uint32 borders);
149 	void						_DrawMenuFieldBackgroundOutside(BView* view, BRect& rect,
150 									const BRect& updateRect, float leftTopRadius,
151 									float rightTopRadius, float leftBottomRadius,
152 									float rightBottomRadius, const rgb_color& base,
153 									bool popupIndicator, uint32 flags);
154 	virtual void				DrawRaisedBorder(BView* view, BRect& rect,
155 									const BRect& updateRect, const rgb_color& base, uint32 flags,
156 									uint32 borders);
157 	virtual void				_DrawOuterResessedFrame(BView* view, BRect& rect,
158 									const rgb_color& base, float contrast, float brightness,
159 									uint32 flags, uint32 borders);
160 	virtual void				DrawScrollBarThumb(BView* view, BRect& rect,
161 									const BRect& updateRect, const rgb_color& base, uint32 flags,
162 									orientation orientation, uint32 knobStyle);
163 	virtual void				DrawBorder(BView* view, BRect& rect, const BRect& updateRect,
164 									const rgb_color& base, border_style borderStyle, uint32 flags,
165 									uint32 borders);
166 	rgb_color					_EdgeLightColor(const rgb_color& base, float contrast,
167 									float brightness, uint32 flags);
168 	rgb_color					_EdgeShadowColor(const rgb_color& base, float contrast,
169 									float brightness, uint32 flags);
170 };
171 
172 }// bprivate
173 
174 #endif	// FLAT_CONTROL_LOOK_H
175