MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget_circle.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_circle.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements circle drawing widget functions.
38 *******************************************************************************/
39 
46 #ifndef LEGATO_CIRCLE_H
47 #define LEGATO_CIRCLE_H
48 
50 
51 #if LE_CIRCLE_WIDGET_ENABLED == 1
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
58 
59 // *****************************************************************************
60 // *****************************************************************************
61 // Section: Data Types and Constants
62 // *****************************************************************************
63 // *****************************************************************************
64 
65 /* internal use only */typedef struct leCircleWidget leCircleWidget;
70 
71 #define LE_CIRCLEWIDGET_VTABLE(THIS_TYPE) \
72  LE_WIDGET_VTABLE(THIS_TYPE) \
73  \
74  leResult (*getOrigin)(const THIS_TYPE* _this, lePoint* pnt); \
75  leResult (*setOrigin)(THIS_TYPE* _this, const lePoint org); \
76  int32_t (*getOriginX)(const THIS_TYPE* _this); \
77  leResult (*setOriginX)(THIS_TYPE* _this, const int32_t x); \
78  int32_t (*getOriginY)(const THIS_TYPE* _this); \
79  leResult (*setOriginY)(THIS_TYPE* _this, const int32_t y); \
80  uint32_t (*getRadius)(const THIS_TYPE* _this); \
81  leResult (*setRadius)(THIS_TYPE* _this, uint32_t rad); \
82  uint32_t (*getThickness)(const THIS_TYPE* _this); \
83  leResult (*setThickness)(THIS_TYPE* _this, uint32_t thk); \
84  leBool (*getFilled)(const THIS_TYPE* _this); \
85  leResult (*setFilled)(THIS_TYPE* _this, leBool fill); \
86 
87 typedef struct leCircleWidgetVTable
88 {
89  LE_CIRCLEWIDGET_VTABLE(leCircleWidget)
90 } leCircleWidgetVTable;
91 
97 // *****************************************************************************
98 /* Structure:
99  leCircleWidget
100 
101  Summary:
102  Implementation of a circle widget.
103 
104  Description:
105  A circle widget draws a circle of the specified origin and radius inside
106  the widget bounds. All coordinates are expressed in local widget space.
107 
108  The color of the circle is determined by the widget scheme's 'foreground'
109  color.
110 
111  Remarks:
112  None.
113 */
114 typedef struct leCircleWidget
115 {
116  leWidget widget; // base widget header
117 
118  const leCircleWidgetVTable* fn;
119 
120  int32_t x; // the origin x cooridnate
121  int32_t y; // the origin y coordinate
122  uint32_t radius; // the radius of the circle
123  uint32_t thickness; // the thickness of the circle outline
124  leBool filled; // fills the circle area
125 } leCircleWidget;
126 
127 // *****************************************************************************
128 // *****************************************************************************
129 // Section: Routines
130 // *****************************************************************************
131 // *****************************************************************************
132 
144 leCircleWidget* leCircleWidget_New(void);
145 
156 void leCircleWidget_Constructor(leCircleWidget* cir);
157 
158 #ifdef _DOXYGEN_
159 #define THIS_TYPE struct leWidget
160 
161 
162 // *****************************************************************************
173 virtual lePoint getOrigin(const leCheckBoxWidget* _this);
174 
175 
176 // *****************************************************************************
190 virtual leResult setOrigin(leCircleWidget* _this,
191  const lePoint org);
192 
193 
194 // *****************************************************************************
205 virtual int32_t getOriginX(const leCheckBoxWidget* _this);
206 
207 
208 // *****************************************************************************
222 virtual leResult setOriginY(leCircleWidget* _this,
223  const int32_t x);
224 
225 
226 // *****************************************************************************
237 virtual int32_t getOriginY(const leCircleWidget* _this);
238 
239 // *****************************************************************************
253 virtual leResult setOriginY(leCircleWidget* _this,
254  const int32_t y);
255 
256 
257 // *****************************************************************************
268 virtual uint32_t getRadius(const leCircleWidget* _this);
269 
270 
271 // *****************************************************************************
285 virtual leResult setRadius(leCircleWidget* _this,
286  uint32_t rad);
287 
288 
289 // *****************************************************************************
300 virtual uint32_t getThickness(const leCircleWidget* _this);
301 
302 
303 // *****************************************************************************
317 virtual leResult setThickness(leCircleWidget* _this,
318  uint32_t thk);
319 
320 
321 // *****************************************************************************
332 virtual leBool getFilled(const leCircleWidget* _this);
333 
334 // *****************************************************************************
348 virtual leResult setFilled(leCircleWidget* _this,
349  leBool fill);
350 
351 
352 #undef THIS_TYPE
353 #endif
354 
355 #ifdef __cplusplus
356 }
357 #endif
358 
359 #endif // LE_CIRCLE_WIDGET_ENABLED
360 #endif /* LEGATO_CIRCLE_H */
Common macros and definitions used by Legato.
leResult
This enum represents function call results.
Definition: legato_common.h:123
virtual uint32_t getRadius(const leArcWidget *_this)
Get radius of an arc.
Used to define a widget.
Definition: legato_widget.h:624
virtual uint32_t getThickness(const leArcWidget *_this)
Get thickness of an arc.
virtual leResult setRadius(leArcWidget *_this, uint32_t rad)
Set radius of an arc.
This structure represents a integer Cartesian point.
Definition: legato_common.h:346
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
Definition: widget.py:1