microui  14.1.0
microui
ui_drawing_stub.h
1 /*
2  * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be found with this software.
4  */
5 
6 #ifndef UI_DRAWING_STUB_H
7 #define UI_DRAWING_STUB_H
8 
9 #ifdef __cplusplus
10 extern "C"
11 {
12 #endif
13 
14 /*
15  * @file
16  * @brief Implementation of all drawing functions of ui_drawing.h (MicroUI and Drawing libraries).
17  * These are stubbed implementations, there is no error but the drawings are not performed. Useful to
18  * stub a drawing on a custom destination (custom GraphicsContext format not supported by the Graphics
19  * Engine).
20  * @author MicroEJ Developer Team
21  * @version 14.1.0
22  */
23 
24 // --------------------------------------------------------------------------------
25 // Includes
26 // --------------------------------------------------------------------------------
27 
28 #include "ui_drawing.h"
29 
30 // --------------------------------------------------------------------------------
31 // Public API
32 // --------------------------------------------------------------------------------
33 
34 /*
35  * @brief Stubbed implementation of writePixel. See ui_drawing.h
36  */
37 DRAWING_Status UI_DRAWING_STUB_writePixel(MICROUI_GraphicsContext *gc, jint x, jint y);
38 
39 /*
40  * @brief Stubbed implementation of drawLine. See ui_drawing.h
41  */
42 DRAWING_Status UI_DRAWING_STUB_drawLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX, jint endY);
43 
44 /*
45  * @brief Stubbed implementation of drawHorizontalLine. See ui_drawing.h
46  */
47 DRAWING_Status UI_DRAWING_STUB_drawHorizontalLine(MICROUI_GraphicsContext *gc, jint x1, jint x2, jint y);
48 
49 /*
50  * @brief Stubbed implementation of drawVerticalLine. See ui_drawing.h
51  */
52 DRAWING_Status UI_DRAWING_STUB_drawVerticalLine(MICROUI_GraphicsContext *gc, jint x, jint y1, jint y2);
53 
54 /*
55  * @brief Stubbed implementation of drawRectangle. See ui_drawing.h
56  */
57 DRAWING_Status UI_DRAWING_STUB_drawRectangle(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
58 
59 /*
60  * @brief Stubbed implementation of fillRectangle. See ui_drawing.h
61  */
62 DRAWING_Status UI_DRAWING_STUB_fillRectangle(MICROUI_GraphicsContext *gc, jint x1, jint y1, jint x2, jint y2);
63 
64 /*
65  * @brief Stubbed implementation of drawRoundedRectangle. See ui_drawing.h
66  */
67 DRAWING_Status UI_DRAWING_STUB_drawRoundedRectangle(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
68  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
69 
70 /*
71  * @brief Stubbed implementation of fillRoundedRectangle. See ui_drawing.h
72  */
73 DRAWING_Status UI_DRAWING_STUB_fillRoundedRectangle(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
74  jint height, jint cornerEllipseWidth, jint cornerEllipseHeight);
75 
76 /*
77  * @brief Stubbed implementation of drawCircleArc. See ui_drawing.h
78  */
79 DRAWING_Status UI_DRAWING_STUB_drawCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
80  jfloat startAngle, jfloat arcAngle);
81 
82 /*
83  * @brief Stubbed implementation of drawEllipseArc. See ui_drawing.h
84  */
85 DRAWING_Status UI_DRAWING_STUB_drawEllipseArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
86  jfloat startAngle, jfloat arcAngle);
87 
88 /*
89  * @brief Stubbed implementation of fillCircleArc. See ui_drawing.h
90  */
91 DRAWING_Status UI_DRAWING_STUB_fillCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
92  jfloat startAngle, jfloat arcAngle);
93 
94 /*
95  * @brief Stubbed implementation of fillEllipseArc. See ui_drawing.h
96  */
97 DRAWING_Status UI_DRAWING_STUB_fillEllipseArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
98  jfloat startAngle, jfloat arcAngle);
99 
100 /*
101  * @brief Stubbed implementation of drawEllipse. See ui_drawing.h
102  */
103 DRAWING_Status UI_DRAWING_STUB_drawEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
104 
105 /*
106  * @brief Stubbed implementation of fillEllipse. See ui_drawing.h
107  */
108 DRAWING_Status UI_DRAWING_STUB_fillEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height);
109 
110 /*
111  * @brief Stubbed implementation of drawCircle. See ui_drawing.h
112  */
113 DRAWING_Status UI_DRAWING_STUB_drawCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
114 
115 /*
116  * @brief Stubbed implementation of fillCircle. See ui_drawing.h
117  */
118 DRAWING_Status UI_DRAWING_STUB_fillCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter);
119 
123 DRAWING_Status UI_DRAWING_STUB_drawString(MICROUI_GraphicsContext *gc, jchar *chars, jint length, MICROUI_Font *font,
124  jint x, jint y);
125 
129 jint UI_DRAWING_STUB_stringWidth(jchar *chars, jint length, MICROUI_Font *font);
130 
134 jint UI_DRAWING_STUB_initializeRenderableStringSNIContext(jchar *chars, jint length, MICROUI_Font *font,
135  MICROUI_RenderableString *renderableString);
136 
140 DRAWING_Status UI_DRAWING_STUB_drawRenderableString(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
141  MICROUI_Font *font, jint width,
142  MICROUI_RenderableString *renderableString, jint x, jint y);
143 
144 /*
145  * @brief Stubbed implementation of drawImage. See ui_drawing.h
146  */
147 DRAWING_Status UI_DRAWING_STUB_drawImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX, jint regionY,
148  jint width, jint height, jint x, jint y, jint alpha);
149 
150 /*
151  * @brief Stubbed implementation of copyImage. See ui_drawing.h
152  */
153 DRAWING_Status UI_DRAWING_STUB_copyImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX, jint regionY,
154  jint width, jint height, jint x, jint y);
155 
156 /*
157  * @brief Stubbed implementation of drawRegion. See ui_drawing.h
158  */
159 DRAWING_Status UI_DRAWING_STUB_drawRegion(MICROUI_GraphicsContext *gc, jint regionX, jint regionY, jint width,
160  jint height, jint x, jint y, jint alpha);
161 
162 /*
163  * @brief Stubbed implementation of drawThickFadedPoint. See ui_drawing.h
164  */
165 DRAWING_Status UI_DRAWING_STUB_drawThickFadedPoint(MICROUI_GraphicsContext *gc, jint x, jint y, jint thickness,
166  jint fade);
167 
168 /*
169  * @brief Stubbed implementation of drawThickFadedLine. See ui_drawing.h
170  */
171 DRAWING_Status UI_DRAWING_STUB_drawThickFadedLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
172  jint endY, jint thickness, jint fade, DRAWING_Cap startCap,
173  DRAWING_Cap endCap);
174 
175 /*
176  * @brief Stubbed implementation of drawThickFadedCircle. See ui_drawing.h
177  */
178 DRAWING_Status UI_DRAWING_STUB_drawThickFadedCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
179  jint thickness, jint fade);
180 
181 /*
182  * @brief Stubbed implementation of drawThickFadedCircleArc. See ui_drawing.h
183  */
184 DRAWING_Status UI_DRAWING_STUB_drawThickFadedCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
185  jfloat startAngle, jfloat arcAngle, jint thickness, jint fade,
186  DRAWING_Cap start, DRAWING_Cap end);
187 
188 /*
189  * @brief Stubbed implementation of drawThickFadedEllipse. See ui_drawing.h
190  */
191 DRAWING_Status UI_DRAWING_STUB_drawThickFadedEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width,
192  jint height, jint thickness, jint fade);
193 
194 /*
195  * @brief Stubbed implementation of drawThickLine. See ui_drawing.h
196  */
197 DRAWING_Status UI_DRAWING_STUB_drawThickLine(MICROUI_GraphicsContext *gc, jint startX, jint startY, jint endX,
198  jint endY, jint thickness);
199 
200 /*
201  * @brief Stubbed implementation of drawThickCircle. See ui_drawing.h
202  */
203 DRAWING_Status UI_DRAWING_STUB_drawThickCircle(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
204  jint thickness);
205 
206 /*
207  * @brief Stubbed implementation of drawThickEllipse. See ui_drawing.h
208  */
209 DRAWING_Status UI_DRAWING_STUB_drawThickEllipse(MICROUI_GraphicsContext *gc, jint x, jint y, jint width, jint height,
210  jint thickness);
211 
212 /*
213  * @brief Stubbed implementation of drawThickCircleArc. See ui_drawing.h
214  */
215 DRAWING_Status UI_DRAWING_STUB_drawThickCircleArc(MICROUI_GraphicsContext *gc, jint x, jint y, jint diameter,
216  jfloat startAngle, jfloat arcAngle, jint thickness);
217 
218 /*
219  * @brief Stubbed implementation of drawFlippedImage. See ui_drawing.h
220  */
221 DRAWING_Status UI_DRAWING_STUB_drawFlippedImage(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint regionX,
222  jint regionY, jint width, jint height, jint x, jint y,
223  DRAWING_Flip transformation, jint alpha);
224 
225 /*
226  * @brief Stubbed implementation of drawRotatedImageNearestNeighbor. See ui_drawing.h
227  */
228 DRAWING_Status UI_DRAWING_STUB_drawRotatedImageNearestNeighbor(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
229  jint y, jint rotationX, jint rotationY, jfloat angle,
230  jint alpha);
231 
232 /*
233  * @brief Stubbed implementation of drawRotatedImageBilinear. See ui_drawing.h
234  */
235 DRAWING_Status UI_DRAWING_STUB_drawRotatedImageBilinear(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
236  jint rotationX, jint rotationY, jfloat angle, jint alpha);
237 
238 /*
239  * @brief Stubbed implementation of drawScaledImageNearestNeighbor. See ui_drawing.h
240  */
241 DRAWING_Status UI_DRAWING_STUB_drawScaledImageNearestNeighbor(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x,
242  jint y, jfloat factorX, jfloat factorY, jint alpha);
243 
244 /*
245  * @brief Stubbed implementation of drawScaledImageBilinear. See ui_drawing.h
246  */
247 DRAWING_Status UI_DRAWING_STUB_drawScaledImageBilinear(MICROUI_GraphicsContext *gc, MICROUI_Image *img, jint x, jint y,
248  jfloat factorX, jfloat factorY, jint alpha);
249 
250 /*
251  * @brief Stubbed implementation of drawScaledStringBilinear. See ui_drawing.h
252  */
253 DRAWING_Status UI_DRAWING_STUB_drawScaledStringBilinear(MICROUI_GraphicsContext *gc, jchar *chars, jint length,
254  MICROUI_Font *font, jint x, jint y, jfloat xRatio,
255  jfloat yRatio);
256 
257 /*
258  * @brief Stubbed implementation of drawScaledRenderableStringBilinear. See ui_drawing.h
259  */
260 DRAWING_Status UI_DRAWING_STUB_drawScaledRenderableStringBilinear(MICROUI_GraphicsContext *gc, jchar *chars,
261  jint length, MICROUI_Font *font, jint width,
262  MICROUI_RenderableString *renderableString, jint x,
263  jint y, jfloat xRatio, jfloat yRatio);
264 
265 /*
266  * @brief Stubbed implementation of drawCharWithRotationBilinear. See ui_drawing.h
267  */
268 DRAWING_Status UI_DRAWING_STUB_drawCharWithRotationBilinear(MICROUI_GraphicsContext *gc, jchar c, MICROUI_Font *font,
269  jint x, jint y, jint xRotation, jint yRotation,
270  jfloat angle, jint alpha);
271 
272 /*
273  * @brief Stubbed implementation of drawCharWithRotationNearestNeighbor. See ui_drawing.h
274  */
275 DRAWING_Status UI_DRAWING_STUB_drawCharWithRotationNearestNeighbor(MICROUI_GraphicsContext *gc, jchar c,
276  MICROUI_Font *font, jint x, jint y, jint xRotation,
277  jint yRotation, jfloat angle, jint alpha);
278 
279 // --------------------------------------------------------------------------------
280 // EOF
281 // --------------------------------------------------------------------------------
282 
283 #ifdef __cplusplus
284 }
285 #endif
286 
287 #endif // UI_DRAWING_STUB_H