MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget_image.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_image.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements image widget functions.
38 *******************************************************************************/
39 
46 #ifndef LEGATO_IMAGE_H
47 #define LEGATO_IMAGE_H
48 
50 
51 #if LE_IMAGE_WIDGET_ENABLED == 1
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
58 
59 typedef struct leImageWidget leImageWidget;
60 typedef struct leImage leImage;
61 
62 // *****************************************************************************
63 // *****************************************************************************
64 // Section: Data Types and Constants
65 // *****************************************************************************
66 // *****************************************************************************
67 
68 /* internal use only */
73 #define LE_IMAGEWIDGET_VTABLE(THIS_TYPE) \
74  LE_WIDGET_VTABLE(THIS_TYPE) \
75  \
76  leImage* (*getImage)(const THIS_TYPE* _this); \
77  leResult (*setImage)(THIS_TYPE* _this, leImage* img); \
78 
79 typedef struct leImageWidgetVTable
80 {
81  LE_IMAGEWIDGET_VTABLE(leImageWidget)
82 } leImageWidgetVTable;
83 
89 // *****************************************************************************
90 /* Enumeration:
91  leImageWidget
92 
93  Summary:
94  Image widget struct definition
95 
96  Description:
97  An image widget displays an image asset.
98 
99  Remarks:
100  None.
101 */
106 typedef struct leImageWidget
107 {
108  leWidget widget; // widget base class
109 
110  const leImageWidgetVTable* fn;
111 
112  const leImage* image; // pointer to image asset
113 } leImageWidget;
114 
115 // *****************************************************************************
116 // *****************************************************************************
117 // Section: Routines
118 // *****************************************************************************
119 // *****************************************************************************
120 
132 leImageWidget* leImageWidget_New(void);
133 
144 void leImageWidget_Constructor(leImageWidget* img);
145 
146 #ifdef _DOXYGEN_
147 #define THIS_TYPE struct leWidget
148 
159 virtual leImage* getImage(const leImageWidget* _this);
160 
161 
175 virtual leResult setImage(leImageWidget* _this,
176  leImage* img);
177 
191 virtual leResult setDebugDrawStartCallback(leImageWidget* _this,
192  leImageWidget_DrawEventCallback cb);
193 
207 virtual void setDebugDrawEndCallback(leImageWidget* _this,
208  leImageWidget_DrawEventCallback cb);
209 
210 #undef THIS_TYPE
211 #endif
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 #endif // LE_IMAGE_WIDGET_ENABLED
218 #endif /* LEGATO_IMAGE_H */
Common macros and definitions used by Legato.
Definition: legato_image.h:181
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