Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
widget_painter.hpp
Go to the documentation of this file.
1#pragma once
2
46
47#include <string>
48
51
52namespace pulp::view {
53
54class View;
55
56// ── Shared control state ─────────────────────────────────────────────────────
57
61 bool enabled = true;
62 bool hovered = false;
63 bool pressed = false;
64 bool focused = false;
65};
66
74 float position = 0.0f;
75 float start_angle = 0.0f;
76 float end_angle = 0.0f;
78 double value = 0.0;
79 double value_min = 0.0;
80 double value_max = 1.0;
81};
82
90 bool horizontal = true;
91 float thumb_pos = 0.0f;
92 float track_min = 0.0f;
93 float track_max = 0.0f;
94 float thumb_size = 0.0f;
95 double value = 0.0;
96 double value_min = 0.0;
97 double value_max = 1.0;
98};
99
107
110 bool popup_open = false;
111 std::string text;
113};
114
117
120 std::string text;
121 bool separator = false;
122 bool highlighted = false;
123 bool ticked = false;
124 bool has_submenu = false;
125};
126
129 std::string text;
130};
131
137 bool read_only = false;
138 bool empty = true;
139};
140
147 float width = 1.0f;
148};
149
150// ── The delegate ─────────────────────────────────────────────────────────────
151
159public:
160 virtual ~WidgetPainter() = default;
161
163 View& source) {
164 (void)canvas; (void)state; (void)source;
165 return false;
166 }
167
169 View& source) {
170 (void)canvas; (void)state; (void)source;
171 return false;
172 }
173
175 View& source) {
176 (void)canvas; (void)state; (void)source;
177 return false;
178 }
179
181 View& source) {
182 (void)canvas; (void)state; (void)source;
183 return false;
184 }
185
187 View& source) {
188 (void)canvas; (void)state; (void)source;
189 return false;
190 }
191
193 View& source) {
194 (void)canvas; (void)state; (void)source;
195 return false;
196 }
197
199 View& source) {
200 (void)canvas; (void)state; (void)source;
201 return false;
202 }
203
205 View& source) {
206 (void)canvas; (void)state; (void)source;
207 return false;
208 }
209
211 View& source) {
212 (void)canvas; (void)state; (void)source;
213 return false;
214 }
215
217 const TextFieldPaintState& state, View& source) {
218 (void)canvas; (void)state; (void)source;
219 return false;
220 }
221
223 const TextFieldPaintState& state, View& source) {
224 (void)canvas; (void)state; (void)source;
225 return false;
226 }
227
228 virtual bool paint_caret(canvas::Canvas& canvas, const CaretPaintState& state, View& source) {
229 (void)canvas; (void)state; (void)source;
230 return false;
231 }
232};
233
234} // namespace pulp::view
Definition canvas.hpp:240
Definition view.hpp:73
Install on a View to supply the pixels for the controls in its subtree.
Definition widget_painter.hpp:158
virtual bool paint_text_field_background(canvas::Canvas &canvas, const TextFieldPaintState &state, View &source)
Definition widget_painter.hpp:216
virtual bool paint_button_background(canvas::Canvas &canvas, const ButtonPaintState &state, View &source)
Definition widget_painter.hpp:174
virtual bool paint_menu_item(canvas::Canvas &canvas, const MenuItemPaintState &state, View &source)
Definition widget_painter.hpp:204
virtual bool paint_text_field_outline(canvas::Canvas &canvas, const TextFieldPaintState &state, View &source)
Definition widget_painter.hpp:222
virtual bool paint_menu_section_header(canvas::Canvas &canvas, const MenuHeaderPaintState &state, View &source)
Definition widget_painter.hpp:210
virtual bool paint_menu_background(canvas::Canvas &canvas, const MenuBackgroundPaintState &state, View &source)
Definition widget_painter.hpp:198
virtual bool paint_caret(canvas::Canvas &canvas, const CaretPaintState &state, View &source)
Definition widget_painter.hpp:228
virtual bool paint_button_text(canvas::Canvas &canvas, const ButtonPaintState &state, View &source)
Definition widget_painter.hpp:180
virtual bool paint_combo_box(canvas::Canvas &canvas, const ComboBoxPaintState &state, View &source)
Definition widget_painter.hpp:186
virtual bool paint_scroll_bar(canvas::Canvas &canvas, const LinearPaintState &state, View &source)
Definition widget_painter.hpp:192
virtual bool paint_rotary(canvas::Canvas &canvas, const RotaryPaintState &state, View &source)
Definition widget_painter.hpp:162
virtual bool paint_linear(canvas::Canvas &canvas, const LinearPaintState &state, View &source)
Definition widget_painter.hpp:168
virtual ~WidgetPainter()=default
Definition affine_transform.hpp:24
SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the ...
Definition audio_device_manager.hpp:48
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
Definition canvas.hpp:52
A push / toggle button.
Definition widget_painter.hpp:102
canvas::Color background
Definition widget_painter.hpp:105
bool toggled
Definition widget_painter.hpp:103
std::string text
Definition widget_painter.hpp:104
The text-insertion caret.
Definition widget_painter.hpp:146
float width
Definition widget_painter.hpp:147
A dropdown field (the closed control, not the open list).
Definition widget_painter.hpp:109
std::string text
Definition widget_painter.hpp:111
Rect arrow_zone
the region reserved for the disclosure arrow
Definition widget_painter.hpp:112
bool popup_open
Definition widget_painter.hpp:110
State every control hands to its painter.
Definition widget_painter.hpp:59
bool hovered
pointer is over the control
Definition widget_painter.hpp:62
bool pressed
pointer is down on the control
Definition widget_painter.hpp:63
Rect bounds
paint area, LOCAL to the widget (origin 0,0)
Definition widget_painter.hpp:60
bool focused
control holds keyboard focus
Definition widget_painter.hpp:64
bool enabled
Definition widget_painter.hpp:61
A linear control (fader / slider / scroll thumb).
Definition widget_painter.hpp:89
float track_max
Definition widget_painter.hpp:93
double value_min
Definition widget_painter.hpp:96
double value_max
Definition widget_painter.hpp:97
bool horizontal
Definition widget_painter.hpp:90
float thumb_size
thumb extent along the travel axis, pixels
Definition widget_painter.hpp:94
float thumb_pos
Definition widget_painter.hpp:91
float track_min
Definition widget_painter.hpp:92
double value
Definition widget_painter.hpp:95
A menu panel's backing surface. bounds is the whole panel.
Definition widget_painter.hpp:116
A menu section title row.
Definition widget_painter.hpp:128
std::string text
Definition widget_painter.hpp:129
One menu row. bounds is the row rect within the menu panel.
Definition widget_painter.hpp:119
bool highlighted
pointer/keyboard cursor is on this row
Definition widget_painter.hpp:122
bool has_submenu
Definition widget_painter.hpp:124
bool ticked
Definition widget_painter.hpp:123
bool separator
Definition widget_painter.hpp:121
std::string text
Definition widget_painter.hpp:120
Axis-aligned rectangle in continuous (float) coordinates.
Definition geometry.hpp:52
A rotary control.
Definition widget_painter.hpp:73
float position
Definition widget_painter.hpp:74
float end_angle
Definition widget_painter.hpp:76
double value
Real-world value and range, for skins that print the value.
Definition widget_painter.hpp:78
float start_angle
Definition widget_painter.hpp:75
double value_max
Definition widget_painter.hpp:80
double value_min
Definition widget_painter.hpp:79
A text field's frame.
Definition widget_painter.hpp:136
bool read_only
Definition widget_painter.hpp:137
bool empty
no text (the placeholder is showing)
Definition widget_painter.hpp:138