MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget_label.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_label.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements label (text) widget functions.
38 *******************************************************************************/
39 
46 #ifndef LEGATO_LABEL_H
47 #define LEGATO_LABEL_H
48 
50 
51 #if LE_LABEL_WIDGET_ENABLED == 1
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
59 
60 // *****************************************************************************
61 // *****************************************************************************
62 // Section: Data Types and Constants
63 // *****************************************************************************
64 // *****************************************************************************
65 
66 /* internal use only */
71 typedef struct leLabelWidget leLabelWidget;
72 
73 #define LE_LABELWIDGET_VTABLE(THIS_TYPE) \
74  LE_WIDGET_VTABLE(THIS_TYPE) \
75  \
76  leString* (*getString)(const THIS_TYPE* _this); \
77  leResult (*setString)(THIS_TYPE* _this, leString* str); \
78 
79 typedef struct leLabelWidgetVTable
80 {
81  LE_LABELWIDGET_VTABLE(leLabelWidget)
82 } leLabelWidgetVTable;
83 
89 // *****************************************************************************
94 typedef struct leLabelWidget
95 {
96  leWidget widget; // widget base class
97 
98  const leLabelWidgetVTable* fn;
99 
100  const leString* string; // string to draw
101 } leLabelWidget;
102 
103 
104 // *****************************************************************************
105 // *****************************************************************************
106 // Section: Routines
107 // *****************************************************************************
108 // *****************************************************************************
109 
121 leLabelWidget* leLabelWidget_New(void);
122 
133 void leLabelWidget_Constructor(leLabelWidget* wgt);
134 
135 #ifdef _DOXYGEN_
136 #define THIS_TYPE struct leWidget
137 
148 virtual leString* getString(const leLabelWidget* _this);
149 
150 
164 virtual leResult setString(leLabelWidget* _this,
165  const leString* str);
166 
167 #undef THIS_TYPE
168 #endif
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif // LE_LABEL_WIDGET_ENABLED
175 #endif /* LEGATO_LABEL_H */
Common macros and definitions used by Legato.
This struct represents a string.
Definition: legato_string.h:107
leResult
This enum represents function call results.
Definition: legato_common.h:123
Used to define a widget.
Definition: legato_widget.h:624
Legato widget definitions.
Definition: widget.py:1
Fixed string functions and definitions.