MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget_arc.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_arc.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements arc drawing widget functions.
38 *******************************************************************************/
45 #ifndef LEGATO_WIDGET_ARC_H
46 #define LEGATO_WIDGET_ARC_H
47 
49 
50 #if LE_ARC_WIDGET_ENABLED == 1
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
57 
58 // *****************************************************************************
59 // *****************************************************************************
60 // Section: Data Types and Constants
61 // *****************************************************************************
62 // *****************************************************************************
63 
64 /* internal use only */
69 typedef struct leArcWidget leArcWidget;
70 
71 #define LE_ARCWIDGET_VTABLE(THIS_TYPE) \
72  LE_WIDGET_VTABLE(THIS_TYPE) \
73  \
74  uint32_t (*getRadius)(const THIS_TYPE* _this); \
75  leResult (*setRadius)(THIS_TYPE* _this, uint32_t rad); \
76  int32_t (*getStartAngle)(const THIS_TYPE* _this); \
77  leResult (*setStartAngle)(THIS_TYPE* _this, int32_t ang); \
78  uint32_t (*getThickness)(const THIS_TYPE* _this); \
79  leResult (*setThickness)(THIS_TYPE* _this, uint32_t val); \
80  int32_t (*getCenterAngle)(const THIS_TYPE* _this); \
81  leResult (*setCenterAngle)(THIS_TYPE* _this, int32_t ang); \
82  leBool (*getRoundEdge)(const THIS_TYPE* _this); \
83  leResult (*setRoundEdge)(THIS_TYPE* _this, leBool rnd); \
84 
85 typedef struct leArcWidgetVTable
86 {
87  LE_ARCWIDGET_VTABLE(leArcWidget)
88 } leArcWidgetVTable;
101 typedef struct leArcWidget
102 {
104  const leArcWidgetVTable* fn;
105  uint32_t radius;
106  int32_t startAngle;
107  int32_t centerAngle;
108  uint32_t endAngle;
109  uint32_t thickness;
111 } leArcWidget;
112 
113 // *****************************************************************************
114 // *****************************************************************************
115 // Section: Routines
116 // *****************************************************************************
117 // *****************************************************************************
118 
131 
143 
144 #ifdef _DOXYGEN_
145 #define THIS_TYPE struct leWidget
146 
157 virtual uint32_t getRadius(const leArcWidget* _this);
158 
171 virtual leResult setRadius(leArcWidget* _this,
172  uint32_t rad);
173 
184 virtual int32_t getStartAngle(const leArcWidget* _this);
185 
199 virtual leResult setStartAngle(leArcWidget* _this,
200  int32_t angle);
201 
212 virtual uint32_t getThickness(const leArcWidget* _this);
213 
226 virtual leResult setThickness(leArcWidget* _this,
227  uint32_t thickness);
228 
239 virtual int32_t getCenterAngle(const leArcWidget* _this);
240 
253 virtual leResult setCenterAngle(THIS_TYPE* _this,
254  int32_t angle);
255 
266 virtual leBool getRoundEdge(const THIS_TYPE* _this);
267 
280 virtual leResult setRoundEdge(THIS_TYPE* _this,
281  leBool round);
282 
283 
284 #undef THIS_TYPE
285 #endif
286 
287 #ifdef __cplusplus
288 }
289 #endif
290 
291 #endif // LE_ARC_WIDGET_ENABLED
292 #endif /* LEGATO_WIDGET_ARC_H */
Common macros and definitions used by Legato.
virtual leBool getRoundEdge(const THIS_TYPE *_this)
Get rounded edge setting.
virtual leResult setCenterAngle(THIS_TYPE *_this, int32_t angle)
Set center angle of an arc.
const leArcWidgetVTable * fn
Definition: legato_widget_arc.h:104
virtual leResult setRoundEdge(THIS_TYPE *_this, leBool round)
Set draw rounded edges.
This struct represents a arc widget.
Definition: legato_widget_arc.h:101
virtual int32_t getCenterAngle(const leArcWidget *_this)
Get thickness of an arc.
leResult
This enum represents function call results.
Definition: legato_common.h:123
virtual leResult setStartAngle(leArcWidget *_this, int32_t angle)
Set start angle of an arc.
uint32_t thickness
Definition: legato_widget_arc.h:109
virtual uint32_t getRadius(const leArcWidget *_this)
Get radius of an arc.
uint32_t radius
Definition: legato_widget_arc.h:105
leWidget widget
Definition: legato_widget_arc.h:103
Used to define a widget.
Definition: legato_widget.h:624
virtual uint32_t getThickness(const leArcWidget *_this)
Get thickness of an arc.
int32_t startAngle
Definition: legato_widget_arc.h:106
virtual leResult setRadius(leArcWidget *_this, uint32_t rad)
Set radius of an arc.
void leArcWidget_Constructor(leArcWidget *wgt)
Initialize widget.
uint32_t endAngle
Definition: legato_widget_arc.h:108
leBool roundEdge
Definition: legato_widget_arc.h:110
Legato widget definitions.
virtual leResult setThickness(leArcWidget *_this, uint32_t thickness)
Set thickness of an arc.
leBool
This enum represents booleans.
Definition: legato_common.h:146
virtual int32_t getStartAngle(const leArcWidget *_this)
Get start angle of the arc.
struct leArcWidget leArcWidget
This struct represents a arc widget.
int32_t centerAngle
Definition: legato_widget_arc.h:107
leArcWidget * leArcWidget_New(void)
Create widget.
Definition: legato_widget_arc.c:95