 |
MPLABĀ® Harmony Graphics Suite
|
Go to the documentation of this file.
46 #ifndef LEGATO_WIDGET_CIRCULAR_SLIDER_H
47 #define LEGATO_WIDGET_CIRCULAR_SLIDER_H
51 #if LE_CIRCULARSLIDER_WIDGET_ENABLED == 1
79 typedef enum leCircularSliderButtonState
81 LE_CIRCULAR_SLIDER_STATE_UP,
82 LE_CIRCULAR_SLIDER_STATE_DOWN,
83 } leCircularSliderButtonState;
103 typedef enum leCircularSliderWidgetArcType
105 OUTSIDE_CIRCLE_BORDER,
106 INSIDE_CIRCLE_BORDER,
110 } leCircularSliderWidgetArcType;
130 typedef struct leCircularSliderArc
136 } leCircularSliderArc;
138 typedef struct leCircularSliderWidget leCircularSliderWidget;
152 typedef void (*leCircularSliderWidget_PressedEvent)(leCircularSliderWidget *, int32_t);
166 typedef void (*leCircularSliderWidget_ValueChangedEvent)(leCircularSliderWidget *, int32_t);
180 typedef void (*leCircularSliderWidget_ReleasedEvent)(leCircularSliderWidget *, int32_t);
187 #define LE_CIRCULARSLIDERWIDGET_VTABLE(THIS_TYPE) \
188 LE_WIDGET_VTABLE(THIS_TYPE) \
190 uint32_t (*getRadius)(const THIS_TYPE* _this); \
191 leResult (*setRadius)(THIS_TYPE* _this, uint32_t rad); \
192 int32_t (*getStartAngle)(const THIS_TYPE* _this); \
193 leResult (*setStartAngle)(THIS_TYPE* _this, int32_t ang); \
194 int32_t (*getSpanAngle)(const THIS_TYPE* _this); \
195 leResult (*setSpanAngle)(THIS_TYPE* _this, int32_t ang); \
196 uint32_t (*getArcThickness)(const THIS_TYPE* _this, leCircularSliderWidgetArcType type); \
197 leResult (*setArcThickness)(THIS_TYPE* _this, leCircularSliderWidgetArcType type, uint32_t thck); \
198 uint32_t (*getArcRadius)(const THIS_TYPE* _this, leCircularSliderWidgetArcType type); \
199 leResult (*setArcRadius)(THIS_TYPE* _this, leCircularSliderWidgetArcType type, uint32_t rad); \
200 leScheme* (*getArcScheme)(const THIS_TYPE* _this, leCircularSliderWidgetArcType type); \
201 leResult (*setArcScheme)(THIS_TYPE* _this, leCircularSliderWidgetArcType type, const leScheme* schm); \
202 leBool (*getArcVisible)(const THIS_TYPE* _this, leCircularSliderWidgetArcType type); \
203 leResult (*setArcVisible)(THIS_TYPE* _this, leCircularSliderWidgetArcType type, leBool vis); \
204 uint32_t (*getValue)(const THIS_TYPE* _this); \
205 leResult (*setValue)(THIS_TYPE* _this, uint32_t val); \
206 leBool (*getRoundEdges)(const THIS_TYPE* _this); \
207 leResult (*setRoundEdges)(THIS_TYPE* _this, leBool rnd); \
208 leBool (*getStickyButton)(const THIS_TYPE* _this); \
209 leResult (*setStickyButton)(THIS_TYPE* _this, leBool stk); \
210 uint32_t (*getSnapDivisions)(const THIS_TYPE* _this); \
211 leResult (*setSnapDivisions)(THIS_TYPE* _this, uint32_t div); \
212 leBool (*getTouchOnButtonOnly)(const THIS_TYPE* _this); \
213 leResult (*setTouchOnButtonOnly)(THIS_TYPE* _this, leBool tch); \
214 leRotationDirection (*getDirection)(const THIS_TYPE* _this); \
215 leResult (*setDirection)(THIS_TYPE* _this, leRotationDirection dir); \
216 leResult (*setPressedEventCallback)(THIS_TYPE* _this, leCircularSliderWidget_PressedEvent cb); \
217 leResult (*setValueChangedEventCallback)(THIS_TYPE* _this, leCircularSliderWidget_ValueChangedEvent cb); \
218 leResult (*setReleasedEventCallback)(THIS_TYPE* _this, leCircularSliderWidget_ReleasedEvent cb); \
220 typedef struct leCircularSliderWidgetVTable
222 LE_CIRCULARSLIDERWIDGET_VTABLE(leCircularSliderWidget)
223 } leCircularSliderWidgetVTable;
247 typedef struct leCircularSliderWidget
251 const leCircularSliderWidgetVTable* fn;
262 uint32_t snapDivisions;
267 leCircularSliderArc activeArc;
268 leCircularSliderArc inActiveArc;
269 leCircularSliderArc outsideBorderArc;
270 leCircularSliderArc insideBorderArc;
271 leCircularSliderArc circleButtonArc;
273 leCircularSliderButtonState btnState;
275 leCircularSliderWidget_PressedEvent pressedCallback;
276 leCircularSliderWidget_ValueChangedEvent valueChangedCallback;
277 leCircularSliderWidget_ReleasedEvent releasedCallback;
278 } leCircularSliderWidget;
297 LIB_EXPORT leCircularSliderWidget* leCircularSliderWidget_New();
309 LIB_EXPORT
void leCircularSliderWidget_Constructor(leCircularSliderWidget* wgt);
312 #define THIS_TYPE struct leWidget
325 virtual uint32_t
getRadius(
const leCircularSliderWidget* _this);
357 virtual uint32_t
getStartAngle(
const leCircularSliderWidget* _this);
390 virtual uint32_t getArcThickness(
const leCircularSliderWidget* _this,
391 leCircularSliderWidgetArcType type);
411 virtual leResult setArcThickness(leCircularSliderWidget* _this,
412 leCircularSliderWidgetArcType type,
415 / *****************************************************************************
428 virtual uint32_t getArcRadius(
const leCircularSliderWidget* _this,
429 leCircularSliderWidgetArcType type);
447 virtual leResult setArcRadius(leCircularSliderWidget* _this,
448 leCircularSliderWidgetArcType type,
464 virtual leScheme* getArcScheme(
const leCircularSliderWidget* _this,
465 leCircularSliderWidgetArcType type);
483 leResult setArcScheme(leCircularSliderWidget* _this,
484 leCircularSliderWidgetArcType type,
487 * @brief Get arc visibility
488 * @details Gets arc visilibilty
for <span
class=
"param">type</span>
using
489 * <span
class=
"param">_this</span>.
491 * leCircularSliderWidget* _this;
492 * leCircularSliderWidgetArcType type;
493 *
leBool visible = _this->fn->getArcVisible(_this, axis);
495 * @param _this is the widget to query.
496 * @param type the type to query.
499 virtual leBool getArcVisible(
const leCircularSliderWidget* _this,
500 leCircularSliderWidgetArcType type);
516 virtual leBool setArcVisible(
const leCircularSliderWidget* _this,
517 leCircularSliderWidgetArcType type);
530 virtual uint32_t getStartValue(
const leCircularSliderWidget* _this);
547 virtual leResult setStartValue(leCircularSliderWidget* _this,
550 / *****************************************************************************
561 virtual uint32_t getEndValue(
const leCircularSliderWidget* _this);
578 virtual leResult setEndValue(leCircularSliderWidget* _this,
592 virtual leBool getRoundEdges(
const leCircularSliderWidget* _this);
609 virtual leResult setRoundEdges(leCircularSliderWidget* _this,
624 virtual leBool getStickyButton(
const leCircularSliderWidget* _this);
641 virtual leResult setStickyButton(leCircularSliderWidget* _this,
655 virtual leBool getTouchOnButtonOnly(
const leCircularSliderWidget* _this);
672 virtual leResult setTouchOnButtonOnly(leCircularSliderWidget* _this,
704 virtual leResult setDirection(leCircularSliderWidget* _this,
721 virtual leResult setPressedEventCallback(leCircularSliderWidget* _this,
722 leCircularSliderWidget_PressedEvent cb);
738 leResult setValueChangedEventCallback(leCircularSliderWidget* _this,
739 leCircularSliderWidget_ValueChangedEvent cb)
755 virtual leResult setReleasedEventCallback(leCircularSliderWidget* _this,
756 leCircularSliderWidget_ReleasedEvent cb);
761 #endif // LE_CIRCULARSLIDER_WIDGET_ENABLED
void leUtils_PointScreenToLocalSpace(const leWidget *widget, lePoint *pnt)
Convert point from layer space into the local space of a widget.
Definition: legato_utils.c:90
Defines common math functions for general use.
Error functions, macros and definitions.
leResult
This enum represents function call results.
Definition: legato_common.h:134
LIB_EXPORT uint32_t lePercentWholeRounded(uint32_t l, uint32_t r)
Calculate percent whole rounded.
Definition: legato_math.c:204
This struct represents a rectangle.
Definition: legato_common.h:405
Memory functions and definitions.
LIB_EXPORT uint32_t lePercentOf(uint32_t num, uint32_t percent)
Calculate percent of a number.
Definition: legato_math.c:218
LIB_EXPORT void leFixedString_Constructor(leFixedString *str, leChar *buf, uint32_t size)
Consructs a fixed string.
Definition: legato_fixedstring.c:42
@ LE_COUNTER_CLOCKWISE
Definition: legato_common.h:290
@ LE_HALIGN_CENTER
Definition: legato_common.h:208
This struct represents a font object.
Definition: legato_font.h:136
leBool
This enum represents booleans.
Definition: legato_common.h:157
virtual uint32_t length(const leString *_this)
Get length of the string.
void leUtils_PointToScreenSpace(const leWidget *widget, lePoint *pnt)
Converts a point from widget space into screen space.
Definition: legato_utils.c:75
@ LE_FALSE
Definition: legato_common.h:158
General internal utilities for the library.
Fixed string functions and definitions.
leRotationDirection
This enum represents the two rotation direction modes for objects.
Definition: legato_common.h:289
LIB_EXPORT leResult lePolarToXY(int32_t r, int32_t a, lePoint *p)
Generate points in an arc.
Definition: legato_math.c:124
String utility functions and definitions.
The header file joins all header files used in the graphics object library.
Definition: legato_scheme.h:154
This struct represents a fixed string.
Definition: legato_fixedstring.h:57
void * leArray_Get(const leArray *arr, uint32_t idx)
Get entry at index.
Definition: legato_array.c:224
uint16_t leChar
This typedef represents Legato character.
Definition: legato_common.h:424
leColor leScheme_GetRenderColor(const leScheme *schm, leSchemeColor clr)
Gets a scheme render color for the current layer color mode.
Definition: legato_scheme.c:68
@ LE_TRUE
Definition: legato_common.h:159
Common macros and definitions used by Legato.
This structure represents a integer Cartesian point.
Definition: legato_common.h:357