 |
MPLABĀ® Harmony Graphics Suite
|
Go to the documentation of this file.
45 #ifndef LEGATO_WIDGET_PIE_CHART_H
46 #define LEGATO_WIDGET_PIE_CHART_H
50 #if LE_PIECHART_WIDGET_ENABLED == 1
64 typedef struct lePieChartPie
72 uint32_t percentOffset;
73 uint32_t percentValue;
76 typedef struct lePieChartWidget lePieChartWidget;
89 typedef void (*lePieChartWidget_PressedEvent)(lePieChartWidget*, uint32_t);
97 typedef struct lePieChartWidget lePieChartWidget;
99 #define LE_PIECHARTWIDGET_VTABLE(THIS_TYPE) \
100 LE_WIDGET_VTABLE(THIS_TYPE) \
102 int32_t (*getStartAngle)(const THIS_TYPE* _this); \
103 leResult (*setStartAngle)(THIS_TYPE* _this, int32_t ang); \
104 int32_t (*getCenterAngle)(const THIS_TYPE* _this); \
105 leResult (*setCenterAngle)(THIS_TYPE* _this, int32_t ang); \
106 int32_t (*addEntry)(THIS_TYPE* _this); \
107 leResult (*clear)(THIS_TYPE* _this); \
108 uint32_t (*getEntryValue)(const THIS_TYPE* _this, int32_t idx); \
109 leResult (*setEntryValue)(THIS_TYPE* _this, int32_t idx, uint32_t val); \
110 uint32_t (*getEntryRadius)(const THIS_TYPE* _this, int32_t idx); \
111 leResult (*setEntryRadius)(THIS_TYPE* _this, int32_t idx, uint32_t rad); \
112 uint32_t (*getEntryOffset)(const THIS_TYPE* _this, int32_t idx); \
113 leResult (*setEntryOffset)(THIS_TYPE* _this, int32_t idx, uint32_t offs); \
114 leScheme* (*getEntryScheme)(const THIS_TYPE* _this, int32_t idx); \
115 leResult (*setEntryScheme)(THIS_TYPE* _this, int32_t idx, const leScheme* schm); \
116 lePieChartWidget_PressedEvent (*getPressedEventCallback)(const THIS_TYPE* _this); \
117 leResult (*setPressedEventCallback)(THIS_TYPE* _this, lePieChartWidget_PressedEvent cb); \
118 leFont* (*getLabelFont)(const THIS_TYPE* _this); \
119 leResult (*setLabelFont)(THIS_TYPE* _this, const leFont* fnt); \
120 leBool (*getLabelsVisible)(const THIS_TYPE* _this); \
121 leResult (*setLabelsVisible)(THIS_TYPE* _this, leBool vis); \
122 uint32_t (*getLabelsOffset)(const THIS_TYPE* _this); \
123 leResult (*setLabelsOffset)(THIS_TYPE* _this, uint32_t offs); \
125 typedef struct lePieChartWidgetVTable
127 LE_PIECHARTWIDGET_VTABLE(lePieChartWidget)
128 } lePieChartWidgetVTable;
142 typedef struct lePieChartWidget
146 const lePieChartWidgetVTable* fn;
155 uint32_t labelsOffset;
158 lePieChartWidget_PressedEvent pressedCallback;
178 LIB_EXPORT lePieChartWidget* lePieChartWidget_New();
190 LIB_EXPORT
void lePieChartWidget_Constructor(lePieChartWidget* wgt);
194 #define THIS_TYPE struct leWidget
225 virtual int32_t
getStartAngle(
const lePieChartWidget* _this);
261 virtual leResult setVisibleItemCount(lePieChartWidget* _this,
329 virtual leResult setVisibleItemCount(lePieChartWidget* _this,
426 virtual uint32_t getEntryValue(
const lePieChartWidget* _this,
465 virtual leResult setEntryValue(lePieChartWidget* _this,
501 virtual uint32_t getEntryRadius(
const lePieChartWidget* _this,
540 virtual leResult setEntryRadius(lePieChartWidget* _this,
577 virtual uint32_t getEntryOffset(
const lePieChartWidget* _this,
616 virtual leResult setEntryOffset(lePieChartWidget* _this,
653 virtual leScheme* getEntryScheme(
const lePieChartWidget* _this,
694 virtual leResult setEntryScheme(lePieChartWidget* _this,
727 virtual leFont* getLabelFont(
const lePieChartWidget* _this);
764 virtual leResult setLabelFont(lePieChartWidget* _this,
796 virtual leBool getLabelsVisible(
const lePieChartWidget* _this);
832 virtual leResult setLabelsVisible(lePieChartWidget* _this,
864 virtual uint32_t getLabelsOffset(
const lePieChartWidget* _this);
900 virtual leResult setLabelsOffset(lePieChartWidget* _this,
913 virtual lePieChartWidget_PressedEvent getPressedEventCallback
914 (
const lePieChartWidget* _this);
929 virtual leResult setPressedEventCallback(lePieChartWidget* _this,
930 lePieChartWidget_PressedEvent cb);
935 #endif // LE_PIECHART_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.
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
int32_t width
Definition: legato_common.h:382
LIB_EXPORT leBool leRectIntersects(const leRect *l_rect, const leRect *r_rect)
Determines if two rectangles are intersecting.
Definition: legato_rect.c:51
This struct represents a array.
Definition: legato_array.h:61
This struct represents a font object.
Definition: legato_font.h:136
leResult leArray_Create(leArray *arr)
Create a new array.
Definition: legato_array.c:73
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
LIB_EXPORT leResult lePolarToXY(int32_t r, int32_t a, lePoint *p)
Generate points in an arc.
Definition: legato_math.c:124
void leUtils_RectToScreenSpace(const leWidget *widget, leRect *rect)
Convert rectangle from widget local space to screen space.
Definition: legato_utils.c:151
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 leColor leColorConvert(leColorMode mode_in, leColorMode mode_out, leColor color)
Convert to color value.
Definition: legato_color_convert.c:579
Definition: legato_scheme.h:154
void * leArray_Get(const leArray *arr, uint32_t idx)
Get entry at index.
Definition: legato_array.c:224
Fixed string functions and definitions.
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
Font functions and definitions.
LIB_EXPORT leResult lePixelBufferCreate(const int32_t width, const int32_t height, const leColorMode mode, const void *const address, lePixelBuffer *buffer)
Create a pixelbuffer.
Definition: legato_pixelbuffer.c:184
virtual void clear(leString *_this)
Clear string.
Common macros and definitions used by Legato.
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.
int32_t height
Definition: legato_common.h:383
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
This structure represents a integer Cartesian point.
Definition: legato_common.h:357
Definition: legato_pixelbuffer.h:91