 |
MPLABĀ® Harmony Graphics Suite
|
Go to the documentation of this file.
46 #ifndef LEGATO_LISTWHEELWIDGET_H
47 #define LEGATO_LISTWHEELWIDGET_H
51 #if LE_LISTWHEEL_WIDGET_ENABLED == 1
58 typedef struct leListWheelWidget leListWheelWidget;
71 typedef void (*leListWheelWidget_SelectedItemChangedEvent)(leListWheelWidget*,
91 typedef enum leListWheelIndicatorFill
93 LE_LISTWHEEL_INDICATOR_FILL_NONE,
94 LE_LISTWHEEL_INDICATOR_FILL_SOLID,
95 LE_LISTWHEEL_INDICATOR_FILL_GRADIENT,
96 } leListWheelIndicatorFill;
109 typedef enum leListWheelZoomEffects
111 LE_LISTWHEEL_ZOOM_EFFECT_NONE,
112 LE_LISTWHEEL_ZOOM_EFFECT_VSCALE,
113 LE_LISTWHEEL_ZOOM_EFFECT_FULL_SCALE,
114 LE_LISTWHEEL_ZOOM_EFFECT_FIXED_SCALE,
115 } leListWheelZoomEffects;
134 typedef struct leListWheelItem
145 typedef struct leListWheelWidget leListWheelWidget;
147 #define LE_LISTWHEELWIDGET_VTABLE(THIS_TYPE) \
148 LE_WIDGET_VTABLE(THIS_TYPE) \
150 uint32_t (*getVisibleItemCount)(const THIS_TYPE* _this); \
151 leResult (*setVisibleItemCount)(THIS_TYPE* _this, uint32_t cnt); \
152 leRelativePosition (*getIconPosition)(const THIS_TYPE* _this); \
153 leResult (*setIconPosition)(THIS_TYPE* _this, leRelativePosition pos); \
154 uint32_t (*getIconMargin)(const THIS_TYPE* _this); \
155 leResult (*setIconMargin)(THIS_TYPE* _this, uint32_t mg); \
156 leBool (*getShowIndicators)(const THIS_TYPE* _this); \
157 leResult (*setShowIndicators)(THIS_TYPE* _this, leBool b); \
158 uint32_t (*getIndicatorArea)(const THIS_TYPE* _this); \
159 leResult (*setIndicatorArea)(THIS_TYPE* _this, uint32_t area); \
160 leBool (*getShaded)(const THIS_TYPE* _this); \
161 leResult (*setShaded)(THIS_TYPE* _this, leBool b); \
162 uint32_t (*getFlickInitSpeed)(const THIS_TYPE* _this); \
163 leResult (*setFlickInitSpeed)(THIS_TYPE* _this, uint32_t sp); \
164 uint32_t (*getMaxMomentum)(const THIS_TYPE* _this); \
165 leResult (*setMaxMomentum)(THIS_TYPE* _this, uint32_t max); \
166 uint32_t (*getMomentumFalloffRate)(const THIS_TYPE* _this); \
167 leResult (*setMomentumFalloffRate)(THIS_TYPE* _this, uint32_t percent); \
168 uint32_t (*getRotationUpdateRate)(const THIS_TYPE* _this); \
169 leResult (*setRotationUpdateRate)(THIS_TYPE* _this, uint32_t ms); \
170 uint32_t (*getItemCount)(const THIS_TYPE* _this); \
171 int32_t (*appendItem)(THIS_TYPE* _this); \
172 int32_t (*insertItem)(THIS_TYPE* _this, int32_t idx); \
173 leResult (*removeItem)(THIS_TYPE* _this, int32_t idx); \
174 leResult (*removeAllItems)(THIS_TYPE* _this); \
175 int32_t (*getSelectedItem)(const THIS_TYPE* _this); \
176 leResult (*setSelectedItem)(THIS_TYPE* _this, int32_t idx); \
177 leResult (*selectPreviousItem)(THIS_TYPE* _this); \
178 leResult (*selectNextItem)(THIS_TYPE* _this); \
179 leString* (*getItemString)(const THIS_TYPE* _this, int32_t idx); \
180 leResult (*setItemString)(THIS_TYPE* _this, int32_t idx, const leString* str); \
181 leImage* (*getItemIcon)(const THIS_TYPE* _this, int32_t idx); \
182 leResult (*setItemIcon)(THIS_TYPE* _this, int32_t idx, const leImage* img); \
183 leListWheelWidget_SelectedItemChangedEvent (*getSelectedItemChangedEventCallback)(const THIS_TYPE* _this); \
184 leResult (*setSelectedItemChangedEventCallback)(THIS_TYPE* _this, leListWheelWidget_SelectedItemChangedEvent cb); \
185 leListWheelIndicatorFill (*getIndicatorFill)(const THIS_TYPE* _this); \
186 leResult (*setIndicatorFill)(THIS_TYPE* _this, leListWheelIndicatorFill fill); \
187 leListWheelZoomEffects (*getZoomEffects)(const THIS_TYPE* _this); \
188 leResult (*setZoomEffects)(THIS_TYPE* _this, leListWheelZoomEffects zfx); \
189 leBool (*getAutoHideWheel)(const THIS_TYPE* _this); \
190 leResult (*setAutoHideWheel)(THIS_TYPE* _this, leBool b); \
192 typedef struct leListWheelWidgetVTable
194 LE_LISTWHEELWIDGET_VTABLE(leListWheelWidget)
195 } leListWheelWidgetVTable;
209 typedef struct leListWheelWidget
213 const leListWheelWidgetVTable* fn;
216 int32_t selectedItem;
217 int32_t visibleItems;
226 uint32_t indicatorArea;
231 int32_t cycleDistance;
241 int32_t minFlickDelta;
246 int32_t momentumFalloff;
248 int32_t rotationCounter;
249 int32_t rotationTick;
253 leListWheelIndicatorFill indicatorFill;
254 leListWheelZoomEffects zoomEffects;
266 leListWheelWidget_SelectedItemChangedEvent cb;
289 LIB_EXPORT leListWheelWidget* leListWheelWidget_New();
301 LIB_EXPORT
void leListWheelWidget_Constructor(leListWheelWidget* wgt);
305 #define THIS_TYPE struct leWidget
360 virtual leResult setVisibleItemCount(leListWheelWidget* _this,
418 virtual leResult setIconPosition(leListWheelWidget* _this,
475 virtual leResult setIconMargin(leListWheelWidget* _this,
508 virtual leBool getShowIndicators(
const leListWheelWidget* _this);
544 virtual leResult setShowIndicators(leListWheelWidget* _this,
601 virtual leResult setIndicatorArea(leListWheelWidget* _this,
634 virtual leBool getShaded(
const leListWheelWidget* _this);
670 virtual leResult setShaded(leListWheelWidget* _this,
703 virtual uint32_t getFlickInitSpeed(
const leListWheelWidget* _this);
739 virtual leResult setFlickInitSpeed(leListWheelWidget* _this,
771 virtual uint32_t getMaxMomentum(
const leListWheelWidget* _this);
807 virtual leResult setMaxMomentum(leListWheelWidget* _this,
839 virtual uint32_t getMomentumFalloffRate(
const leListWheelWidget* _this);
875 virtual leResult setMomentumFalloffRate(leListWheelWidget* _this,
907 virtual uint32_t getRotationUpdateRate(
const leListWheelWidget* _this);
943 virtual leResult setRotationUpdateRate(leListWheelWidget* _this,
975 virtual uint32_t getItemCount(
const leListWheelWidget* _this);
1006 virtual int32_t appendItem(
const leListWheelWidget* _this);
1064 virtual leResult removeItem(leListWheelWidget* _this,
1097 virtual leResult removeAllItems(leListWheelWidget* _this);
1128 virtual int32_t getSelectedItem(
const leListWheelWidget* _this);
1164 virtual leResult setSelectedItem(leListWheelWidget* _this,
1197 virtual leResult selectPreviousItem(leListWheelWidget* _this);
1228 virtual leResult selectNextItem(leListWheelWidget* _this);
1263 virtual leString* getItemString(
const leListWheelWidget* _this,
1303 virtual leResult setItemString(leListWheelWidget* _this,
1340 virtual leImage* getItemIcon(
const leListWheelWidget* _this,
1381 virtual leResult setItemIcon(leListWheelWidget* _this,
1396 virtual leListWheelWidget_SelectedItemChangedEvent getSelectedItemChangedEventCallback
1397 (
const leListWheelWidget* _this);
1412 virtual leResult setSelectedItemChangedEventCallback(leListWheelWidget* _this,
1413 leListWheelWidget_SelectedItemChangedEvent cb);
1447 virtual leListWheelIndicatorFill getIndicatorFill(
const leListWheelWidget* _this);
1483 virtual leResult setIndicatorFill(leListWheelWidget* _this,
1484 leListWheelIndicatorFill fill);
1517 virtual leListWheelZoomEffects getZoomEffects(
const leListWheelWidget* _this);
1553 virtual leResult setZoomEffects(leListWheelWidget* _this,
1554 leListWheelZoomEffects zfx);
1585 virtual leBool getAutoHideWheel(
const leListWheelWidget* _this);
1621 virtual leResult setAutoHideWheel(leListWheelWidget* _this,
1628 #endif // LE_LISTWHEEL_WIDGET_ENABLED
Defines common math functions for general use.
Error functions, macros and definitions.
leResult
This enum represents function call results.
Definition: legato_common.h:134
leResult leArray_RemoveAt(leArray *arr, uint32_t idx)
Remove value at index.
Definition: legato_array.c:197
This struct represents a rectangle.
Definition: legato_common.h:405
LIB_EXPORT void lePercentOfDec(uint32_t num, uint32_t percent, uint32_t *whl, uint32_t *dec)
Calculate percent of a decimal.
Definition: legato_math.c:231
Image functions and defintions.
Memory functions and definitions.
leResult leArray_PushBack(leArray *arr, void *val)
Push value on back.
Definition: legato_array.c:147
Definition: legato_image.h:180
@ LE_VALIGN_MIDDLE
Definition: legato_common.h:183
LIB_EXPORT leBool leRectIntersects(const leRect *l_rect, const leRect *r_rect)
Determines if two rectangles are intersecting.
Definition: legato_rect.c:51
@ LE_HALIGN_CENTER
Definition: legato_common.h:208
This struct represents a array.
Definition: legato_array.h:61
leResult leArray_Create(leArray *arr)
Create a new array.
Definition: legato_array.c:73
This struct represents a string.
Definition: legato_string.h:108
leResult leArray_InsertAt(leArray *arr, uint32_t idx, void *val)
Insert value at index.
Definition: legato_array.c:174
leBool
This enum represents booleans.
Definition: legato_common.h:157
LIB_EXPORT leRect leRectClipAdj(const leRect *l_rect, const leRect *r_rect, leRect *adj)
Clips a rectangle to the space of another rectangle.
Definition: legato_rect.c:75
@ LE_FALSE
Definition: legato_common.h:158
General internal utilities for the library.
LIB_EXPORT leResult leImage_Draw(const leImage *img, const leRect *sourceRect, int32_t x, int32_t y, uint32_t a)
Draw an Image.
Definition: legato_image.c:131
Fixed string functions and definitions.
leResult leArray_Clear(leArray *arr)
Clear array.
Definition: legato_array.c:279
@ LE_RELATIVE_POSITION_RIGHTOF
Definition: legato_common.h:317
void leUtils_RectToScreenSpace(const leWidget *widget, leRect *rect)
Convert rectangle from widget local space to screen space.
Definition: legato_utils.c:151
The header file joins all header files used in the graphics object library.
LIB_EXPORT void leRectClip(const leRect *l_rect, const leRect *r_rect, leRect *result)
Clips a rectangle to the space of another rectangle.
Definition: legato_rect.c:122
LIB_EXPORT uint32_t leAbsoluteValue(int32_t val)
Calculates the absolute value of a signed integer.
Definition: legato_math.c:280
@ LE_RELATIVE_POSITION_LEFTOF
Definition: legato_common.h:314
leColor leScheme_GetRenderColor(const leScheme *schm, leSchemeColor clr)
Gets a scheme render color for the current layer color mode.
Definition: legato_scheme.c:68
leRelativePosition
This enum represents the relative position modes for objects.
Definition: legato_common.h:313
@ LE_TRUE
Definition: legato_common.h:159
Common macros and definitions used by Legato.
const leStringVTable * fn
Definition: legato_string.h:109
void leUtils_ArrangeRectangle(leRect *sub, leRect obj, leRect bounds, leHAlignment hAlignment, leVAlignment vAlignment, leRelativePosition position, uint8_t leftMargin, uint8_t topMargin, uint8_t rightMargin, uint8_t bottomMargin, uint16_t rectMargin)
Calculates the position of a rectangle within the given bound.
Definition: legato_utils.c:213
virtual void destructor(leString *_this)
Destruct string.
LIB_EXPORT int32_t leDivideRounding(int32_t num, int32_t denom)
Performs a linear interpolation of an integer based on a percentage between two signed points.
Definition: legato_math.c:328
void leUtils_ArrangeRectangleRelative(leRect *sub, leRect obj, leRect bounds, leHAlignment hAlignment, leVAlignment vAlignment, leRelativePosition position, uint8_t leftMargin, uint8_t topMargin, uint8_t rightMargin, uint8_t bottomMargin, uint16_t rectMargin)
Calculates the position of a rectangle within the given bounds.
Definition: legato_utils.c:286