17 #ifndef DGL_EVENT_HANDLERS_HPP_INCLUDED
18 #define DGL_EVENT_HANDLERS_HPP_INCLUDED
41 kButtonStateDefault = 0x0,
42 kButtonStateHover = 0x1,
43 kButtonStateActive = 0x2,
44 kButtonStateActiveHover = kButtonStateActive|kButtonStateHover
51 virtual void buttonClicked(
SubWidget* widget,
int button) = 0;
57 bool isActive() noexcept;
58 void setActive(
bool active,
bool sendCallback) noexcept;
60 bool isChecked() const noexcept;
61 void setChecked(
bool checked,
bool sendCallback) noexcept;
63 bool isCheckable() const noexcept;
64 void setCheckable(
bool checkable) noexcept;
66 Point<
double> getLastClickPosition() const noexcept;
67 Point<
double> getLastMotionPosition() const noexcept;
69 void setCallback(
Callback* callback) noexcept;
71 bool mouseEvent(const
Widget::MouseEvent& ev);
72 bool motionEvent(const
Widget::MotionEvent& ev);
75 State getState() const noexcept;
76 void clearState() noexcept;
78 virtual
void stateChanged(
State state,
State oldState);
80 void setInternalCallback(
Callback* callback) noexcept;
81 void triggerUserCallback(
SubWidget* widget,
int button);
85 PrivateData* const pData;
103 kKnobStateDefault = 0x0,
104 kKnobStateHover = 0x1,
105 kKnobStateDragging = 0x2,
106 kKnobStateDraggingHover = kKnobStateDragging|kKnobStateHover
113 virtual void knobDragStarted(
SubWidget* widget) = 0;
114 virtual void knobDragFinished(
SubWidget* widget) = 0;
115 virtual void knobValueChanged(
SubWidget* widget,
float value) = 0;
116 virtual void knobDoubleClicked(
SubWidget*) {};
125 bool isInteger() const noexcept;
128 float getValue() const noexcept;
131 virtual
bool setValue(
float value,
bool sendCallback = false) noexcept;
134 float getNormalizedValue() const noexcept;
137 void setDefault(
float def) noexcept;
140 void setRange(
float min,
float max) noexcept;
142 void setStep(
float step) noexcept;
144 void setUsingLogScale(
bool yesNo) noexcept;
146 Orientation getOrientation() const noexcept;
147 void setOrientation(Orientation orientation) noexcept;
149 void setCallback(
Callback* callback) noexcept;
152 void setMouseDeceleration(
float accel) noexcept;
154 bool mouseEvent(const
Widget::MouseEvent& ev,
double scaleFactor = 1.0);
155 bool motionEvent(const
Widget::MotionEvent& ev,
double scaleFactor = 1.0);
156 bool scrollEvent(const
Widget::ScrollEvent& ev);
159 State getState() const noexcept;
163 PrivateData* const pData;
166 #ifdef DISTRHO_PROPER_CPP11_SUPPORT
187 PrivateData*
const pData;
Definition: EventHandlers.hpp:110
Definition: EventHandlers.hpp:93
Definition: Geometry.hpp:41
Definition: EventHandlers.hpp:180
Definition: DistrhoDetails.hpp:823