MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget_rectangle.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_rectangle.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements rectangle drawing widget functions.
38 *******************************************************************************/
45 #ifndef LEGATO_RECTANGLE_H
46 #define LEGATO_RECTANGLE_H
47 
49 
50 #if LE_RECTANGLE_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 typedef struct leRectangleWidget leRectangleWidget;
65 
66 #define LE_RECTANGLEWIDGET_VTABLE(THIS_TYPE) \
67  LE_WIDGET_VTABLE(THIS_TYPE) \
68  \
69  int32_t (*getThickness)(const THIS_TYPE* _this); \
70  leResult (*setThickness)(THIS_TYPE* _this, int32_t thk); \
71 
72 typedef struct leRectangleWidgetVTable
73 {
74  LE_RECTANGLEWIDGET_VTABLE(leRectangleWidget)
75 } leRectangleWidgetVTable;
76 
77 // *****************************************************************************
83 typedef struct leRectangleWidget
84 {
85  leWidget widget; // widget base class
86 
87  const leRectangleWidgetVTable* fn;
88 
89  int32_t thickness; // rectangle border thickness
90 } leRectangleWidget;
91 
92 // *****************************************************************************
93 // *****************************************************************************
94 // Section: Routines
95 // *****************************************************************************
96 // *****************************************************************************
97 
109 leRectangleWidget* leRectangleWidget_New(void);
110 
121 void leRectangleWidget_Constructor(leRectangleWidget* wgt);
122 
123 #ifdef _DOXYGEN_
124 #define THIS_TYPE struct leWidget
125 
126 // *****************************************************************************
127 /* Virtual Member Function:
128  int32_t getThickness(const leRectangleWidget* _this)
129 
130  Summary:
131  Gets the rectangle border thickness
132 
133  Description:
134  Gets the rectangle border thickness
135 
136  Parameters:
137  const leRectangleWidget* _this - The rectangle widget to operate on
138 
139  Remarks:
140  Usage - _this->fn->getThickness(_this);
141 
142  Returns:
143  int32_t - the thickness value
144 */
155 virtual int32_t getThickness(const leRectangleWidget* _this);
156 
157 // *****************************************************************************
158 /* Virtual Member Function:
159  leResult setThickness(leRectangleWidget* _this,
160  int32_t thk)
161 
162  Summary:
163  Sets the rectangle border thickness
164 
165  Description:
166  Sets the rectangle border thickness
167 
168  Parameters:
169  leRectangleWidget* _this - The rectangle widget to operate on
170  int32_t thk -
171 
172  Remarks:
173  Usage - _this->fn->setThickness(_this, thk);
174 
175  Returns:
176  leResult - the result of the operation
177 */
191 virtual leResult setThickness(leRectangleWidget* _this,
192  int32_t thk);
193 
194 #undef THIS_TYPE
195 #endif
196 
197 #ifdef __cplusplus
198 }
199 #endif
200 
201 #endif // LE_RECTANGLE_WIDGET_ENABLED
202 #endif /* LEGATO_RECTANGLE_H */
Common macros and definitions used by Legato.
leResult
This enum represents function call results.
Definition: legato_common.h:123
Used to define a widget.
Definition: legato_widget.h:624
virtual uint32_t getThickness(const leArcWidget *_this)
Get thickness of an arc.
Legato widget definitions.
virtual leResult setThickness(leArcWidget *_this, uint32_t thickness)
Set thickness of an arc.
Definition: widget.py:1