Lines Matching full:control

16 // Abstract base class for all components that a control panel must have
17 class Control : public SkRefCnt { class
19 Control(SkString name) in Control() function in Control
24 // Use this to propagate a click's position down to a control. Gets modulated by the component's
32 // Use this to draw the control and its appropriate children. Gets modulated by the component's
41 /* Returns true when click position argumend lands over a control region in this control. Click
110 // Overriden by sub-classes with controls. Should return true if clickPos lands inside a control
114 // The position of the control relative to it's parent
118 class ParentControl : public Control { // Interface for all controls that have children
123 virtual void add(sk_sp<Control> control) = 0;
125 // Returns the control's width. Used to propagate width down to components that don't specify it
129 typedef Control INHERITED;
156 void add(sk_sp<Control> control) override { in add() argument
158 fControls.push_back(control); in add()
159 control->setParent(this, SkPoint::Make(0.0f, fHeight)); in add()
160 fHeight += control->height(); in add()
171 // Propagate click release to selected control, deselect control
191 // Holds a vertical shelf of controls. Only control that can be hooked from outside the
198 // Returns true if control panel has mouse captured, false when it is ready to release
202 if (fSelectedControl == -1) { // If no child control selected, check every child in onClick()
211 if (fSelectedControl >= 0) { // If child control selected, propagate click in onClick()
231 // Check all children's control regions
246 SkTArray<sk_sp<Control>> fControls;
250 class DiscreteSliderControl : public Control {
264 * @params name The name of the control, displayed in the label
269 static sk_sp<Control> Make(SkString name, int* output, int min, int max) { in Make()
270 return sk_sp<Control>(new DiscreteSliderControl(name, output, min, max)); in Make()
330 typedef Control INHERITED;
336 void add(sk_sp<Control> control) override { in add() argument
338 fControls.push_back(control); in add()
339 control->setParent(this, SkPoint::Make(0.0f, kSelectorHeight)); in add()
340 fHeight = SkMaxScalar(fHeight, control->height()); // Setting height to max child height. in add()
349 // Propagate onClickRelease to control that currently captures mouse
362 // Finalize control selector in onSetParent()
374 /* A set of a selector and a list of controls. Displays the control from the list of controls
384 // Draw selector and currently selected control
390 // Returns true if control panel has mouse captured, false when it is ready to release
407 // Is in control region of selector or currently selected control
428 sk_sp<Control> fControlSelector;
430 SkTArray<sk_sp<Control>> fControls;
433 Control* fCtrlOnClick;
440 class ContinuousSliderControl : public Control {
454 * @params name The name of the control, displayed in the label
459 static sk_sp<Control> Make(const SkString& name, SkScalar* output, SkScalar min, SkScalar max) { in Make()
460 return sk_sp<Control>(new ContinuousSliderControl(name, output, min, max)); in Make()
513 typedef Control INHERITED;
516 class RadialDirectionControl : public Control {
524 * @params name The name of the control, displayed in the label
527 static sk_sp<Control> Make(const SkString& name, SkVector* output) { in Make()
528 return sk_sp<Control>(new RadialDirectionControl(name, output)); in Make()
588 typedef Control INHERITED;
591 class ColorDisplay: public Control {
605 static sk_sp<Control> Make(SkColor3f* input) { in Make()
606 return sk_sp<Control>(new ColorDisplay(SkString("ColorDisplay"), input)); in Make()
629 typedef Control INHERITED;
741 canvas->resetMatrix(); // Force static control panel position in onDrawContent()
773 // Control panel mouse handling in onClick()
776 if (fControlPanelSelected) { // Control modification in onClick()