MPLABĀ® Harmony Graphics Suite
legato_widget_pie_chart.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
24 /*******************************************************************************
25  Module for Microchip Graphics Library - Legato User Interface Library
26 
27  Company:
28  Microchip Technology Inc.
29 
30  File Name:
31  legato_widget_pie_chart.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements pie chart drawing widget functions.
38 *******************************************************************************/
45 #ifndef LEGATO_WIDGET_PIE_CHART_H
46 #define LEGATO_WIDGET_PIE_CHART_H
47 
49 
50 #if LE_PIECHART_WIDGET_ENABLED == 1
51 
54 
55 // *****************************************************************************
56 // *****************************************************************************
57 // Section: Data Types and Constants
58 // *****************************************************************************
59 // *****************************************************************************
64 typedef struct lePieChartPie
65 {
66  uint32_t value;
67  uint32_t radius;
68  uint32_t offset;
69  const leScheme* scheme;
70  uint32_t startAngle;
71  uint32_t spanAngle;
72  uint32_t percentOffset;
73  uint32_t percentValue;
74 } lePieChartPie;
75 
76 typedef struct lePieChartWidget lePieChartWidget;
77 
78 // *****************************************************************************
79 /* Function Pointer:
80  lePieChartWidget_PressedEvent
81 
82  Summary:
83  Chart pressed event function callback type
84 */
89 typedef void (*lePieChartWidget_PressedEvent)(lePieChartWidget*, uint32_t);
90 
91 
92 /* internal use only */
97 typedef struct lePieChartWidget lePieChartWidget;
98 
99 #define LE_PIECHARTWIDGET_VTABLE(THIS_TYPE) \
100  LE_WIDGET_VTABLE(THIS_TYPE) \
101  \
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); \
124 
125 typedef struct lePieChartWidgetVTable
126 {
127  LE_PIECHARTWIDGET_VTABLE(lePieChartWidget)
128 } lePieChartWidgetVTable;
129 
135 // *****************************************************************************
142 typedef struct lePieChartWidget
143 {
144  leWidget widget; // base widget header
145 
146  const lePieChartWidgetVTable* fn;
147 
148  uint32_t startAngle; //the start angle of the chart
149  int32_t centerAngle; //the center angle of the chart
150 
151  leArray pieArray; //list of pie/data
152 
153  //Label properties
154  leBool labelsVisible; // are labels visible
155  uint32_t labelsOffset; // offset of labels from center of pie
156  const leFont* labelFont; // label
157 
158  lePieChartWidget_PressedEvent pressedCallback;
159 } lePieChartWidget;
160 
161 // *****************************************************************************
162 // *****************************************************************************
163 // Section: Routines
164 // *****************************************************************************
165 // *****************************************************************************
166 
178 LIB_EXPORT lePieChartWidget* lePieChartWidget_New();
179 
190 LIB_EXPORT void lePieChartWidget_Constructor(lePieChartWidget* wgt);
191 
192 
193 #ifdef _DOXYGEN_
194 #define THIS_TYPE struct leWidget
195 
196 // *****************************************************************************
197 /* Virtual Member Function:
198  int32_t getStartAngle(const lePieChartWidget* _this)
199 
200  Summary:
201  Gets the start angle
202 
203  Description:
204  Gets the start angle
205 
206  Parameters:
207  const lePieChartWidget* _this - The pie chart widget to operate on
208 
209  Remarks:
210  Usage - _this->fn->getStartAngle(_this);
211 
212  Returns:
213  int32_t - the angle value
214 */
225 virtual int32_t getStartAngle(const lePieChartWidget* _this);
226 
227 
228 // *****************************************************************************
229 /* Virtual Member Function:
230  leResult setStartAngle(lePieChartWidget* _this,
231  int32_t ang)
232 
233  Summary:
234  Sets the start angle
235 
236  Description:
237  Sets the start angle
238 
239  Parameters:
240  lePieChartWidget* _this - The pie chart widget to operate on
241  int32_t ang - the angle value
242 
243  Remarks:
244  Usage - _this->fn->setStartAngle(_this, ang);
245 
246  Returns:
247  leResult - the result of the operation
248 */
261 virtual leResult setVisibleItemCount(lePieChartWidget* _this,
262  uint32_t cnt);
263 
264 
265 // *****************************************************************************
266 /* Virtual Member Function:
267  int32_t getCenterAngle(const lePieChartWidget* _this)
268 
269  Summary:
270  Gets the center angle
271 
272  Description:
273  Gets the center angle
274 
275  Parameters:
276  const lePieChartWidget* _this - The pie chart widget to operate on
277 
278  Remarks:
279  Usage - _this->fn->getCenterAngle(_this);
280 
281  Returns:
282  int32_t - the angle value
283 */
294 virtual int32_t getCenterAngle(const lePieChartWidget* _this);
295 
296 // *****************************************************************************
297 /* Virtual Member Function:
298  leResult setCenterAngle(lePieChartWidget* _this,
299  int32_t ang)
300 
301  Summary:
302  Sets the start angle
303 
304  Description:
305  Sets the start angle
306 
307  Parameters:
308  lePieChartWidget* _this - The pie chart widget to operate on
309  int32_t ang - the angle value
310 
311  Remarks:
312  Usage - _this->fn->setCenterAngle(_this, ang);
313 
314  Returns:
315  leResult - the result of the operation
316 */
329 virtual leResult setVisibleItemCount(lePieChartWidget* _this,
330  uint32_t cnt);
331 
332 // *****************************************************************************
333 /* Virtual Member Function:
334  int32_t addEntry(lePieChartWidget* _this)
335 
336  Summary:
337  Adds a pie entry
338 
339  Description:
340  Adds a pie entry
341 
342  Parameters:
343  lePieChartWidget* _this - The pie chart widget to operate on
344 
345  Remarks:
346  Usage - _this->fn->addEntry(_this);
347 
348  Returns:
349  int32_t - the index of the new entry
350 */
361 virtual int32_t getCenterAngle(const lePieChartWidget* _this);
362 
363 // *****************************************************************************
364 /* Virtual Member Function:
365  leResult clear(lePieChartWidget* _this)
366 
367  Summary:
368  Clears all pie entries
369 
370  Description:
371  Clears all pie entries
372 
373  Parameters:
374  lePieChartWidget* _this - The pie chart widget to operate on
375 
376  Remarks:
377  Usage - _this->fn->clear(_this);
378 
379  Returns:
380  leResult - the result of the operation
381 */
392 virtual leResult clear(lePieChartWidget* _this);
393 
394 // *****************************************************************************
395 /* Virtual Member Function:
396  uint32_t getEntryValue(const lePieChartWidget* _this,
397  int32_t idx)
398 
399  Summary:
400  Gets an entry value
401 
402  Description:
403  Gets an entry value
404 
405  Parameters:
406  const lePieChartWidget* _this - The pie chart widget to operate on
407  int32_t idx - the index
408 
409  Remarks:
410  Usage - _this->fn->getEntryValue(_this, idx);
411 
412  Returns:
413  uint32_t - the value
414 */
426 virtual uint32_t getEntryValue(const lePieChartWidget* _this,
427  int32_t idx);
428 
429 // *****************************************************************************
430 /* Virtual Member Function:
431  leResult setEntryValue(lePieChartWidget* _this,
432  int32_t idx,
433  uint32_t val)
434 
435  Summary:
436  Sets an entry value
437 
438  Description:
439  Sets an entry value
440 
441  Parameters:
442  lePieChartWidget* _this - The pie chart widget to operate on
443  int32_t idx - the index
444  uint32_t val - the value
445 
446  Remarks:
447  Usage - _this->fn->setEntryValue(_this, idx, val);
448 
449  Returns:
450  leResult - the result of the operation
451 */
465 virtual leResult setEntryValue(lePieChartWidget* _this,
466  int32_t idx,
467  uint32_t val);
468 
469 // *****************************************************************************
470 /* Virtual Member Function:
471  uint32_t getEntryRadius(const lePieChartWidget* _this,
472  int32_t idx)
473 
474  Summary:
475  Gets an entry radius
476 
477  Description:
478  Gets an entry radius
479 
480  Parameters:
481  const lePieChartWidget* _this - The pie chart widget to operate on
482  int32_t idx - the index
483 
484  Remarks:
485  Usage - _this->fn->getEntryRadius(_this, idx);
486 
487  Returns:
488  uint32_t - the radius value
489 */
501 virtual uint32_t getEntryRadius(const lePieChartWidget* _this,
502  int32_t idx);
503 
504 // *****************************************************************************
505 /* Virtual Member Function:
506  leResult setEntryRadius(lePieChartWidget* _this,
507  int32_t idx,
508  uint32_t rad)
509 
510  Summary:
511  Sets an entry radius
512 
513  Description:
514  Sets an entry radius
515 
516  Parameters:
517  lePieChartWidget* _this - The pie chart widget to operate on
518  int32_t idx - the index
519  uint32_t rad - the radius value
520 
521  Remarks:
522  Usage - _this->fn->setEntryRadius(_this, idx, rad);
523 
524  Returns:
525  leResult - the result of the operation
526 */
540 virtual leResult setEntryRadius(lePieChartWidget* _this,
541  int32_t idx,
542  uint32_t rad);
543 
544 // *****************************************************************************
545 /* Virtual Member Function:
546  uint32_t getEntryOffset(const lePieChartWidget* _this,
547  int32_t idx)
548 
549  Summary:
550  Gets an entry offset
551 
552  Description:
553  Gets an entry offset
554 
555  Parameters:
556  const lePieChartWidget* _this - The pie chart widget to operate on
557  int32_t idx - the index
558 
559  Remarks:
560  Usage - _this->fn->getEntryOffset(_this, idx);
561 
562  Returns:
563  uint32_t - the offset value
564 */
577 virtual uint32_t getEntryOffset(const lePieChartWidget* _this,
578  int32_t idx);
579 
580 // *****************************************************************************
581 /* Virtual Member Function:
582  leResult setEntryOffset(lePieChartWidget* _this,
583  int32_t idx,
584  uint32_t offs)
585 
586  Summary:
587  Sets an entry offset
588 
589  Description:
590  Sets an entry offset
591 
592  Parameters:
593  lePieChartWidget* _this - The pie chart widget to operate on
594  int32_t idx - the index
595  uint32_t offs - the offset value
596 
597  Remarks:
598  Usage - _this->fn->setEntryOffset(_this, idx, offs);
599 
600  Returns:
601  leResult - the result of the operation
602 */
616 virtual leResult setEntryOffset(lePieChartWidget* _this,
617  int32_t idx,
618  uint32_t offs);
619 
620 // *****************************************************************************
621 /* Virtual Member Function:
622  leScheme* getEntryScheme(const lePieChartWidget* _this,
623  int32_t idx)
624 
625  Summary:
626  Gets an entry scheme
627 
628  Description:
629  Gets an entry scheme
630 
631  Parameters:
632  const lePieChartWidget* _this - The pie chart widget to operate on
633  int32_t idx - the index
634 
635  Remarks:
636  Usage - _this->fn->getEntryScheme(_this, idx);
637 
638  Returns:
639  leScheme* - the scheme pointer
640 */
653 virtual leScheme* getEntryScheme(const lePieChartWidget* _this,
654  int32_t idx);
655 
656 // *****************************************************************************
657 /* Virtual Member Function:
658  leResult setEntryScheme(lePieChartWidget* _this,
659  int32_t idx,
660  const leScheme* schm)
661 
662  Summary:
663  Sets an entry scheme
664 
665  Description:
666  Sets an entry scheme
667 
668  Parameters:
669  lePieChartWidget* _this - The pie chart widget to operate on
670  int32_t idx - the index
671  const leScheme* schm - the scheme pointer
672 
673  Remarks:
674  Usage - _this->fn->setEntryScheme(_this, idx, schm);
675 
676  Returns:
677  leResult - the result of the operation
678 */
694 virtual leResult setEntryScheme(lePieChartWidget* _this,
695  int32_t idx,
696  const leScheme* schm);
697 
698 // *****************************************************************************
699 /* Virtual Member Function:
700  leFont* getLabelFont(const lePieChartWidget* _this)
701 
702  Summary:
703  Gets the label font
704 
705  Description:
706  Gets the label font
707 
708  Parameters:
709  const lePieChartWidget* _this - The pie chart widget to operate on
710 
711  Remarks:
712  Usage - _this->fn->getLabelFont(_this);
713 
714  Returns:
715  leFont* - the font pointer
716 */
727 virtual leFont* getLabelFont(const lePieChartWidget* _this);
728 
729 // *****************************************************************************
730 /* Virtual Member Function:
731  leResult setLabelFont(lePieChartWidget* _this,
732  const leFont* fnt)
733 
734  Summary:
735  Sets the label font
736 
737  Description:
738  Sets the label font
739 
740  Parameters:
741  lePieChartWidget* _this - The pie chart widget to operate on
742  const leFont* fnt - the font pointer
743 
744  Remarks:
745  Usage - _this->fn->setLabelFont(_this, fnt);
746 
747  Returns:
748  leResult - the result of the operation
749 */
764 virtual leResult setLabelFont(lePieChartWidget* _this,
765  const leFont* fnt);
766 
767 // *****************************************************************************
768 /* Virtual Member Function:
769  leBool getLabelsVisible(const lePieChartWidget* _this)
770 
771  Summary:
772  Gets the label visible setting value
773 
774  Description:
775  Gets the label visible setting value
776 
777  Parameters:
778  const lePieChartWidget* _this - The pie chart widget to operate on
779 
780  Remarks:
781  Usage - _this->fn->getLabelsVisible(_this);
782 
783  Returns:
784  leBool - the visibility setting
785 */
796 virtual leBool getLabelsVisible(const lePieChartWidget* _this);
797 
798 // *****************************************************************************
799 /* Virtual Member Function:
800  leResult setLabelsVisible(lePieChartWidget* _this,
801  leBool vis)
802 
803  Summary:
804  Sets the label visible setting value
805 
806  Description:
807  Sets the label visible setting value
808 
809  Parameters:
810  lePieChartWidget* _this - The pie chart widget to operate on
811  leBool vis - the visibility setting
812 
813  Remarks:
814  Usage - _this->fn->setLabelsVisible(_this, vis);
815 
816  Returns:
817  leResult - the result of the operation
818 */
832 virtual leResult setLabelsVisible(lePieChartWidget* _this,
833  leBool vis);
834 
835 // *****************************************************************************
836 /* Virtual Member Function:
837  uint32_t getLabelsOffset(const lePieChartWidget* _this)
838 
839  Summary:
840  Gets the label offset value
841 
842  Description:
843  Gets the label offset value
844 
845  Parameters:
846  const lePieChartWidget* _this - The pie chart widget to operate on
847 
848  Remarks:
849  Usage - _this->fn->getLabelsOffset(_this);
850 
851  Returns:
852  uint32_t - the offset value
853 */
864 virtual uint32_t getLabelsOffset(const lePieChartWidget* _this);
865 
866 // *****************************************************************************
867 /* Virtual Member Function:
868  leResult setLabelsOffset(lePieChartWidget* _this,
869  uint32_t offs)
870 
871  Summary:
872  Sets the label offset value
873 
874  Description:
875  Sets the label offset value
876 
877  Parameters:
878  lePieChartWidget* _this - The pie chart widget to operate on
879  uint32_t offs - the offset value
880 
881  Remarks:
882  Usage - _this->fn->setLabelsOffset(_this, offs);
883 
884  Returns:
885  leResult - the result of the operation
886 */
900 virtual leResult setLabelsOffset(lePieChartWidget* _this,
901  uint32_t offs);
902 
913 virtual lePieChartWidget_PressedEvent getPressedEventCallback
914  (const lePieChartWidget* _this);
915 
929 virtual leResult setPressedEventCallback(lePieChartWidget* _this,
930  lePieChartWidget_PressedEvent cb);
931 
932 #undef THIS_TYPE
933 #endif
934 
935 #endif // LE_PIECHART_WIDGET_ENABLED
936 #endif /* LEGATO_WIDGET_PIE_CHART_H */
_leWidget_SetAlphaAmount
leResult _leWidget_SetAlphaAmount(leWidget *_this, uint32_t alpha)
Set alpha amount.
Definition: legato_widget.c:570
getStartAngle
virtual int32_t getStartAngle(const leArcWidget *_this)
Get start angle of the arc.
leUtils_PointScreenToLocalSpace
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
legato_math.h
Defines common math functions for general use.
legato_widget_listwheel.h
List wheel functions and definitions.
legato_error.h
Error functions, macros and definitions.
_leWidget_GetType
leWidgetType _leWidget_GetType(const leWidget *_this)
Get widget type.
Definition: legato_widget.c:176
_leWidget_GetScheme
leScheme * _leWidget_GetScheme(const leWidget *_this)
Get widget scheme.
Definition: legato_widget.c:938
leResult
leResult
This enum represents function call results.
Definition: legato_common.h:134
lePercentWholeRounded
LIB_EXPORT uint32_t lePercentWholeRounded(uint32_t l, uint32_t r)
Calculate percent whole rounded.
Definition: legato_math.c:204
_leWidget_RectToScreenSpace
leRect _leWidget_RectToScreenSpace(const leWidget *_this)
Get widget rectangle.
Definition: legato_widget.c:701
leRect
This struct represents a rectangle.
Definition: legato_common.h:405
_leWidget_IsOpaque
leBool _leWidget_IsOpaque(const leWidget *_this)
Determine is widget is opaque.
Definition: legato_widget.c:594
_leWidget_SetBorderType
leResult _leWidget_SetBorderType(leWidget *_this, leBorderType type)
Set widget scheme.
Definition: legato_widget.c:967
_leWidget_RemoveAllChildren
void _leWidget_RemoveAllChildren(leWidget *_this)
Remove all children from widget.
Definition: legato_widget.c:823
_leWidget_SetParent
leResult _leWidget_SetParent(leWidget *_this, leWidget *parent)
Set parent widget.
Definition: legato_widget.c:862
_leWidget_InvalidateContents
void _leWidget_InvalidateContents(const leWidget *_this)
Invalidate widget contents.
Definition: legato_widget.c:1210
_leWidget_SetCornerRadius
leResult _leWidget_SetCornerRadius(leWidget *_this, uint32_t radius)
Set widget scheme.
Definition: legato_widget.c:1091
_leWidget_InstallEventFilter
leResult _leWidget_InstallEventFilter(leWidget *_this, leWidgetEventFilter fltr)
Install event filter.
Definition: legato_widget.c:1215
getCenterAngle
virtual int32_t getCenterAngle(const leArcWidget *_this)
Get thickness of an arc.
_leWidget_SetX
leResult _leWidget_SetX(leWidget *_this, int32_t x)
Set widget x position.
Definition: legato_widget.c:190
_leWidget_SetSize
leResult _leWidget_SetSize(leWidget *_this, uint32_t width, uint32_t height)
Set widget height.
Definition: legato_widget.c:381
_leWidget_HasFocus
leBool _leWidget_HasFocus(const leWidget *_this)
Determines the focus status.
Definition: legato_widget.c:1110
legato_memory.h
Memory functions and definitions.
_leWidget_Resize
leResult _leWidget_Resize(leWidget *_this, int32_t width, int32_t height)
Resize widget.
Definition: legato_widget.c:426
_leWidget_SetAlphaEnabled
leResult _leWidget_SetAlphaEnabled(leWidget *_this, leBool enable)
Set cumulative alpha enable status.
Definition: legato_widget.c:501
setCenterAngle
virtual leResult setCenterAngle(THIS_TYPE *_this, int32_t angle)
Set center angle of an arc.
leArray_PushBack
leResult leArray_PushBack(leArray *arr, void *val)
Push value on back.
Definition: legato_array.c:147
leWidgetEvent_TouchDown
Used to define widget touch down event.
Definition: legato_widget.h:377
_leWidget_ContainsDescendant
leBool _leWidget_ContainsDescendant(const leWidget *_this, const leWidget *wgt)
Determine widget exists.
Definition: legato_widget.c:910
_leWidget_SetBackgroundType
leResult _leWidget_SetBackgroundType(leWidget *_this, leBackgroundType type)
Set widget scheme.
Definition: legato_widget.c:989
_leWidget_GetWidth
uint32_t _leWidget_GetWidth(const leWidget *_this)
Get widget width.
Definition: legato_widget.c:317
leImage
Definition: legato_image.h:180
LE_VALIGN_MIDDLE
@ LE_VALIGN_MIDDLE
Definition: legato_common.h:183
_leWidget_GetCumulativeAlphaEnabled
leBool _leWidget_GetCumulativeAlphaEnabled(const leWidget *_this)
Get cumulative alpha enable status.
Definition: legato_widget.c:484
_leWidget_RectToParentSpace
leRect _leWidget_RectToParentSpace(const leWidget *_this)
Get widget rectangle.
Definition: legato_widget.c:684
_leWidget_Translate
leResult _leWidget_Translate(leWidget *_this, int32_t x, int32_t y)
Translate widget x and y position.
Definition: legato_widget.c:282
legato_renderer.h
leSize::width
int32_t width
Definition: legato_common.h:382
_leWidget_SetHeight
leResult _leWidget_SetHeight(leWidget *_this, uint32_t height)
Set widget height.
Definition: legato_widget.c:356
_leWidget_SetWidth
leResult _leWidget_SetWidth(leWidget *_this, uint32_t width)
Set the widget width.
Definition: legato_widget.c:324
LE_WIDGET_BACKGROUND_FILL
@ LE_WIDGET_BACKGROUND_FILL
Definition: legato_widget.h:226
_leWidget_SetVisible
leResult _leWidget_SetVisible(leWidget *_this, leBool visible)
Set widget visible status.
Definition: legato_widget.c:649
_leWidget_GetRootWidget
leWidget * _leWidget_GetRootWidget(const leWidget *_this)
Get root widget.
Definition: legato_widget.c:843
leRectIntersects
LIB_EXPORT leBool leRectIntersects(const leRect *l_rect, const leRect *r_rect)
Determines if two rectangles are intersecting.
Definition: legato_rect.c:51
_leWidget_Update
void _leWidget_Update(leWidget *_this, uint32_t dt)
Update widget.
Definition: legato_widget.c:1491
leArray
This struct represents a array.
Definition: legato_array.h:61
legato_widget.h
Legato widget definitions.
leFont
This struct represents a font object.
Definition: legato_font.h:136
leArray_Create
leResult leArray_Create(leArray *arr)
Create a new array.
Definition: legato_array.c:73
_leWidget_GetHAlignment
leHAlignment _leWidget_GetHAlignment(const leWidget *_this)
Get widget horizontal alignment.
Definition: legato_widget.c:1003
_leWidget_GetHeight
uint32_t _leWidget_GetHeight(const leWidget *_this)
Get widget height.
Definition: legato_widget.c:349
_leWidget_LocalRect
leRect _leWidget_LocalRect(const leWidget *_this)
Get widget rectangle.
Definition: legato_widget.c:670
leBool
leBool
This enum represents booleans.
Definition: legato_common.h:157
_leWidget_GetBackgroundType
leBackgroundType _leWidget_GetBackgroundType(const leWidget *_this)
Get widget background type.
Definition: legato_widget.c:982
_leWidget_SetScheme
leResult _leWidget_SetScheme(leWidget *_this, const leScheme *scheme)
Set widget scheme.
Definition: legato_widget.c:945
_leWidget_SetHAlignment
leResult _leWidget_SetHAlignment(leWidget *_this, leHAlignment align)
Set widget scheme.
Definition: legato_widget.c:1010
_leWidget_GetEnabled
leBool _leWidget_GetEnabled(const leWidget *_this)
Get widget enabled flag.
Definition: legato_widget.c:615
leRectClipAdj
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
_leWidget_SetFocus
leResult _leWidget_SetFocus(leWidget *_this)
Set widget scheme.
Definition: legato_widget.c:1117
LE_FALSE
@ LE_FALSE
Definition: legato_common.h:158
_leWidget_GetAlphaEnabled
leBool _leWidget_GetAlphaEnabled(const leWidget *_this)
Get alpha enable status.
Definition: legato_widget.c:473
_leWidget_GetChildAtIndex
leWidget * _leWidget_GetChildAtIndex(const leWidget *_this, uint32_t idx)
Get child at index.
Definition: legato_widget.c:888
setStartAngle
virtual leResult setStartAngle(leArcWidget *_this, int32_t angle)
Set start angle of an arc.
legato_widget_pie_chart.h
Pie chart functions and definitions.
leWidgetEvent
Used to define widget event.
Definition: legato_widget.h:352
_leWidget_GetCumulativeAlphaAmount
uint32_t _leWidget_GetCumulativeAlphaAmount(const leWidget *_this)
Get cumulative alpha amount.
Definition: legato_widget.c:538
_leWidget_SetY
leResult _leWidget_SetY(leWidget *_this, int32_t y)
Set widget y position.
Definition: legato_widget.c:222
_leWidget_GetBorderType
leBorderType _leWidget_GetBorderType(const leWidget *_this)
Get widget bordertype.
Definition: legato_widget.c:960
_leWidget_SetMargins
leResult _leWidget_SetMargins(leWidget *_this, uint32_t l, uint32_t t, uint32_t r, uint32_t b)
Set widget margins.
Definition: legato_widget.c:1058
legato_utils.h
General internal utilities for the library.
_leWidget_GetVAlignment
leVAlignment _leWidget_GetVAlignment(const leWidget *_this)
Get widget vertical alignment.
Definition: legato_widget.c:1027
leImage_Draw
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
legato_string.h
Fixed string functions and definitions.
leArray_Clear
leResult leArray_Clear(leArray *arr)
Clear array.
Definition: legato_array.c:279
LE_WIDGET_BACKGROUND_NONE
@ LE_WIDGET_BACKGROUND_NONE
Definition: legato_widget.h:225
leWidget
Used to define a widget.
Definition: legato_widget.h:623
lePolarToXY
LIB_EXPORT leResult lePolarToXY(int32_t r, int32_t a, lePoint *p)
Generate points in an arc.
Definition: legato_math.c:124
leUtils_RectToScreenSpace
void leUtils_RectToScreenSpace(const leWidget *widget, leRect *rect)
Convert rectangle from widget local space to screen space.
Definition: legato_utils.c:151
_leWidget_GetX
int32_t _leWidget_GetX(const leWidget *_this)
Get widget x position.
Definition: legato_widget.c:183
leRectClip
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
_leWidget_SetVAlignment
leResult _leWidget_SetVAlignment(leWidget *_this, leVAlignment align)
Set widget vertical alignment.
Definition: legato_widget.c:1034
_leWidget_GetVisible
leBool _leWidget_GetVisible(const leWidget *_this)
Get widget visible status.
Definition: legato_widget.c:642
leColorConvert
LIB_EXPORT leColor leColorConvert(leColorMode mode_in, leColorMode mode_out, leColor color)
Convert to color value.
Definition: legato_color_convert.c:579
leScheme
Definition: legato_scheme.h:154
_leWidget_AddChild
leResult _leWidget_AddChild(leWidget *_this, leWidget *child)
Add child to widget.
Definition: legato_widget.c:734
_leWidget_GetIndexOfChild
uint32_t _leWidget_GetIndexOfChild(const leWidget *_this, const leWidget *child)
Get index of child.
Definition: legato_widget.c:899
leArray_Get
void * leArray_Get(const leArray *arr, uint32_t idx)
Get entry at index.
Definition: legato_array.c:224
_leWidget_GetChildCount
uint32_t _leWidget_GetChildCount(const leWidget *_this)
Get child count.
Definition: legato_widget.c:881
_leWidget_GetMargins
leMargin _leWidget_GetMargins(const leWidget *_this)
Get widget margins.
Definition: legato_widget.c:1051
legato_fixedstring.h
Fixed string functions and definitions.
leWidget_Constructor
LIB_EXPORT void leWidget_Constructor(leWidget *wgt)
Initialize widget.
Definition: legato_widget.c:67
leScheme_GetRenderColor
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
@ LE_TRUE
Definition: legato_common.h:159
legato_font.h
Font functions and definitions.
_leWidget_GetAlphaAmount
uint32_t _leWidget_GetAlphaAmount(const leWidget *_this)
Get alpha amount.
Definition: legato_widget.c:527
_leWidget_GetCornerRadius
uint32_t _leWidget_GetCornerRadius(const leWidget *_this)
Get widget corner radius.
Definition: legato_widget.c:1084
lePixelBufferCreate
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
clear
virtual void clear(leString *_this)
Clear string.
legato_common.h
Common macros and definitions used by Legato.
_leWidget_RemoveEventFilter
leResult _leWidget_RemoveEventFilter(leWidget *_this, leWidgetEventFilter fltr)
Remove event filter.
Definition: legato_widget.c:1238
legato_state.h
leUtils_ArrangeRectangle
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
_leWidget_RemoveChild
leResult _leWidget_RemoveChild(leWidget *_this, leWidget *child)
Remove child from widget.
Definition: legato_widget.c:785
destructor
virtual void destructor(leString *_this)
Destruct string.
leSize::height
int32_t height
Definition: legato_common.h:383
_leWidget_SetEnabled
leResult _leWidget_SetEnabled(leWidget *_this, leBool enable)
Set widget enabled flag.
Definition: legato_widget.c:620
leDivideRounding
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
_leWidget_SetPosition
leResult _leWidget_SetPosition(leWidget *_this, int32_t x, int32_t y)
Set widget x and y position.
Definition: legato_widget.c:247
leUtils_ArrangeRectangleRelative
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
_leWidget_Invalidate
void _leWidget_Invalidate(const leWidget *_this)
Invalidate widget.
Definition: legato_widget.c:1142
lePoint
This structure represents a integer Cartesian point.
Definition: legato_common.h:357
_leWidget_GetY
int32_t _leWidget_GetY(const leWidget *_this)
Get widget y position.
Definition: legato_widget.c:215
lePixelBuffer
Definition: legato_pixelbuffer.h:91