45 #ifndef LEGATO_WIDGET_CIRCULAR_GAUGE_H 46 #define LEGATO_WIDGET_CIRCULAR_GAUGE_H 50 #if LE_CIRCULARGAUGE_WIDGET_ENABLED == 1 68 typedef struct leCircularGaugeWidget leCircularGaugeWidget;
82 typedef void (* leCircularGaugeWidget_ValueChangedEvent)(leCircularGaugeWidget*,
91 #define LE_CIRCULARGAUGEWIDGET_VTABLE(THIS_TYPE) \ 92 LE_WIDGET_VTABLE(THIS_TYPE) \ 94 uint32_t (*getRadius)(const THIS_TYPE* _this); \ 95 leResult (*setRadius)(THIS_TYPE* _this, uint32_t rad); \ 96 int32_t (*getStartAngle)(const THIS_TYPE* _this); \ 97 leResult (*setStartAngle)(THIS_TYPE* _this, int32_t ang); \ 98 int32_t (*getCenterAngle)(const THIS_TYPE* _this); \ 99 leResult (*setCenterAngle)(THIS_TYPE* _this, int32_t ang); \ 100 uint32_t (*getValue)(const THIS_TYPE* _this); \ 101 leResult (*setValue)(THIS_TYPE* _this, uint32_t val); \ 103 int32_t (*addArc)(THIS_TYPE* _this, uint32_t startAngle, uint32_t endAngle, int32_t offset, const leScheme* schm, uint32_t thk); \ 104 leResult (*deleteArc)(THIS_TYPE* _this, uint32_t idx); \ 105 leResult (*deleteAllArcs)(THIS_TYPE* _this); \ 106 uint32_t (*arcCount)(const THIS_TYPE* _this); \ 107 leBool (*getArcEnabled)(const THIS_TYPE* _this, uint32_t idx); \ 108 leResult (*setArcEnabled)(THIS_TYPE* _this, uint32_t idx, leBool b); \ 109 uint32_t (*getArcStartAngle)(const THIS_TYPE* _this, uint32_t idx); \ 110 leResult (*setArcStartAngle)(THIS_TYPE* _this, uint32_t idx, uint32_t val); \ 111 uint32_t (*getArcEndAngle)(const THIS_TYPE* _this, uint32_t idx); \ 112 leResult (*setArcEndAngle)(THIS_TYPE* _this, uint32_t idx, uint32_t val); \ 113 int32_t (*getArcOffset)(const THIS_TYPE* _this, uint32_t idx); \ 114 leResult (*setArcOffset)(THIS_TYPE* _this, uint32_t idx, int32_t offs); \ 115 const leScheme* (*getArcScheme)(const THIS_TYPE* _this, uint32_t idx); \ 116 leResult (*setArcScheme)(THIS_TYPE* _this, uint32_t idx, const leScheme* schm); \ 117 uint32_t (*getArcThickness)(const THIS_TYPE* _this, uint32_t idx); \ 118 leResult (*setArcThickness)(THIS_TYPE* _this, uint32_t idx, uint32_t thk); \ 120 int32_t (*addTickRange)(THIS_TYPE* _this, uint32_t startAngle, uint32_t endAngle, int32_t offset, const leScheme* schm, uint32_t thk, uint32_t div); \ 121 leResult (*deleteTickRange)(THIS_TYPE* _this, uint32_t idx); \ 122 leResult (*deleteAllTickRanges)(THIS_TYPE* _this); \ 123 uint32_t (*tickRangeCount)(const THIS_TYPE* _this); \ 124 leBool (*getTickRangeEnabled)(const THIS_TYPE* _this, uint32_t idx); \ 125 leResult (*setTickRangeEnabled)(THIS_TYPE* _this, uint32_t idx, leBool b); \ 126 uint32_t (*getTickRangeStartAngle)(const THIS_TYPE* _this, uint32_t idx); \ 127 leResult (*setTickRangeStartAngle)(THIS_TYPE* _this, uint32_t idx, uint32_t val); \ 128 uint32_t (*getTickRangeEndAngle)(const THIS_TYPE* _this, uint32_t idx); \ 129 leResult (*setTickRangeEndAngle)(THIS_TYPE* _this, uint32_t idx, uint32_t val); \ 130 int32_t (*getTickRangeOffset)(const THIS_TYPE* _this, uint32_t idx); \ 131 leResult (*setTickRangeOffset)(THIS_TYPE* _this, uint32_t idx, int32_t offs); \ 132 const leScheme* (*getTickRangeScheme)(const THIS_TYPE* _this, uint32_t idx); \ 133 leResult (*setTickRangeScheme)(THIS_TYPE* _this, uint32_t idx, const leScheme* schm); \ 134 uint32_t (*getTickRangeThickness)(const THIS_TYPE* _this, uint32_t idx); \ 135 leResult (*setTickRangeThickness)(THIS_TYPE* _this, uint32_t idx, uint32_t thk); \ 136 uint32_t (*getTickRangeDivisions)(const THIS_TYPE* _this, uint32_t idx); \ 137 leResult (*setTickRangeDivisions)(THIS_TYPE* _this, uint32_t idx, uint32_t div); \ 139 int32_t (*addLabelRange)(THIS_TYPE* _this, uint32_t startVal, uint32_t endVal, int32_t offset, const leScheme* schm, const leFont* fnt, uint32_t div); \ 140 leResult (*deleteLabelRange)(THIS_TYPE* _this, uint32_t idx); \ 141 leResult (*deleteAllLabelRanges)(THIS_TYPE* _this); \ 142 uint32_t (*labelRangeCount)(const THIS_TYPE* _this); \ 143 leBool (*getLabelRangeEnabled)(const THIS_TYPE* _this, uint32_t idx); \ 144 leResult (*setLabelRangeEnabled)(THIS_TYPE* _this, uint32_t idx, leBool b); \ 145 uint32_t (*getLabelRangeStartAngle)(const THIS_TYPE* _this, uint32_t idx); \ 146 leResult (*setLabelRangeStartAngle)(THIS_TYPE* _this, uint32_t idx, uint32_t val); \ 147 uint32_t (*getLabelRangeEndAngle)(const THIS_TYPE* _this, uint32_t idx); \ 148 leResult (*setLabelRangeEndAngle)(THIS_TYPE* _this, uint32_t idx, uint32_t val); \ 149 int32_t (*getLabelRangeOffset)(const THIS_TYPE* _this, uint32_t idx); \ 150 leResult (*setLabelRangeOffset)(THIS_TYPE* _this, uint32_t idx, int32_t offs); \ 151 const leScheme* (*getLabelRangeScheme)(const THIS_TYPE* _this, uint32_t idx); \ 152 leResult (*setLabelRangeScheme)(THIS_TYPE* _this, uint32_t idx, const leScheme* schm); \ 153 const leFont* (*getLabelRangeFont)(const THIS_TYPE* _this, uint32_t idx); \ 154 leResult (*setLabelRangeFont)(THIS_TYPE* _this, uint32_t idx, const leFont* font); \ 155 uint32_t (*getLabelRangeDivisions)(const THIS_TYPE* _this, uint32_t idx); \ 156 leResult (*setLabelRangeDivisions)(THIS_TYPE* _this, uint32_t idx, uint32_t div); \ 158 leBool (*getHandVisible)(const THIS_TYPE* _this); \ 159 leResult (*setHandVisible)(THIS_TYPE* _this, leBool vis); \ 160 uint32_t (*getHandRadius)(const THIS_TYPE* _this); \ 161 leResult (*setHandRadius)(THIS_TYPE* _this, uint32_t rad); \ 162 leBool (*getCenterCircleVisible)(const THIS_TYPE* _this); \ 163 leResult (*setCenterCircleVisible)(THIS_TYPE* _this, leBool vis); \ 164 uint32_t (*getCenterCircleRadius)(const THIS_TYPE* _this); \ 165 leResult (*setCenterCircleRadius)(THIS_TYPE* _this, uint32_t rad); \ 166 uint32_t (*getCenterCircleThickness)(const THIS_TYPE* _this); \ 167 leResult (*setCenterCircleThickness)(THIS_TYPE* _this, uint32_t thk); \ 168 leResult (*setValueChangedEventCallback)(THIS_TYPE* _this, leCircularGaugeWidget_ValueChangedEvent cb); \ 170 typedef struct leCircularGaugeWidgetVTable
172 LE_CIRCULARGAUGEWIDGET_VTABLE(leCircularGaugeWidget)
173 } leCircularGaugeWidgetVTable;
200 typedef struct leCircularGaugeWidget
204 const leCircularGaugeWidgetVTable* fn;
215 leBool centerCircleVisible;
216 uint32_t centerCircleRadius;
217 uint32_t centerCircleThickness;
224 leCircularGaugeWidget_ValueChangedEvent cb;
225 } leCircularGaugeWidget;
245 typedef struct leCircularGaugeArc
253 } leCircularGaugeArc;
273 typedef struct leCircularGaugeTickRange
282 } leCircularGaugeTickRange;
302 typedef struct leCircularGaugeLabelRange
311 } leCircularGaugeLabelRange;
330 leCircularGaugeWidget* leCircularGaugeWidget_New(
void);
342 void leCircularGaugeWidget_Constructor(leCircularGaugeWidget* gauge);
345 #define THIS_TYPE struct leWidget 358 virtual uint32_t
getRadius(
const leCircularGaugeWidget* _this);
409 virtual int32_t
getStartAngle(
const leCircularGaugeWidget* _this);
440 virtual int32_t
getCenterAngle(
const leCircularGaugeWidget* _this);
473 virtual leBool getHandVisible(
const leCircularGaugeWidget* _this);
489 virtual leResult setTickLabelsVisible(leCircularGaugeWidget* _this,
503 virtual leBool getHandVisible(
const leCircularGaugeWidget* _this);
519 virtual leResult setHandVisible(leCircularGaugeWidget* _this,
533 virtual uint32_t getHandRadius(
const leCircularGaugeWidget* _this);
549 virtual leResult setHandRadius(leCircularGaugeWidget* _this,
564 virtual leBool getCenterCircleVisible(
const leCircularGaugeWidget* _this);
581 virtual leResult setCenterCircleVisible(leCircularGaugeWidget* _this,
595 virtual uint32_t getCenterCircleRadius(
const leCircularGaugeWidget* _this);
612 virtual leResult setCenterCircleRadius(leCircularGaugeWidget* _this,
627 virtual uint32_t getCenterCircleThickness(
const leCircularGaugeWidget* _this);
644 virtual leResult setCenterCircleThickness(leCircularGaugeWidget* _this,
660 virtual leResult setValueChangedEventCallback(leCircularGaugeWidget* _this,
661 leCircularGaugeWidget_ValueChangedEvent cb);
670 #endif // LE_CIRCULARGAUGE_WIDGET_ENABLED Common macros and definitions used by Legato.
This struct represents a font object.
Definition: legato_font.h:156
leResult
This enum represents function call results.
Definition: legato_common.h:123
Dynamic string functions and definitions.
This struct represents a array.
Definition: legato_array.h:64
An array implementation for storing pointers.
leBool
This enum represents booleans.
Definition: legato_common.h:146
Definition: legato_scheme.h:154
Schemes support various properties that make it possible to customize the color of widgets...