version 2.8
gwin.c
Go to the documentation of this file.
1 /*
2  * This file is subject to the terms of the GFX License. If a copy of
3  * the license was not distributed with this file, you can obtain one at:
4  *
5  * http://ugfx.org/license.html
6  */
7 
8 /**
9  * @file src/gwin/gwin.c
10  * @brief GWIN sub-system code
11  */
12 
13 #include "../../gfx.h"
14 
15 #if GFX_USE_GWIN
16 
17 #include "gwin_class.h"
18 
19 #include <string.h>
20 
21 /*-----------------------------------------------
22  * Data
23  *-----------------------------------------------*/
24 
25 static const gwinVMT basegwinVMT = {
26  "GWIN", // The classname
27  sizeof(GWindowObject), // The object size
28  0, // The destroy routine
29  0, // The redraw routine
30  0, // The after-clear routine
31 };
32 
33 static color_t defaultFgColor = White;
34 static color_t defaultBgColor = Black;
35 #if GDISP_NEED_TEXT
36  static font_t defaultFont;
37 #endif
38 
39 /* These init functions are defined by each module but not published */
40 extern void _gwmInit(void);
41 extern void _gwmDeinit(void);
42 #if GWIN_NEED_WIDGET
43  extern void _gwidgetInit(void);
44  extern void _gwidgetDeinit(void);
45 #endif
46 #if GWIN_NEED_CONTAINERS
47  extern void _gcontainerInit(void);
48  extern void _gcontainerDeinit(void);
49 #endif
50 
51 /*-----------------------------------------------
52  * Helper Routines
53  *-----------------------------------------------*/
54 
55 /*-----------------------------------------------
56  * Class Routines
57  *-----------------------------------------------*/
58 
59 void _gwinInit(void)
60 {
61  _gwmInit();
62 
63  #if GWIN_NEED_WIDGET
64  _gwidgetInit();
65  #endif
66 
67  #if GWIN_NEED_CONTAINERS
68  _gcontainerInit();
69  #endif
70 }
71 
72 void _gwinDeinit(void)
73 {
74  #if GWIN_NEED_CONTAINERS
75  _gcontainerDeinit();
76  #endif
77 
78  #if GWIN_NEED_WIDGET
79  _gwidgetDeinit();
80  #endif
81 
82  _gwmDeinit();
83 }
84 
85 // Internal routine for use by GWIN components only
86 // Initialise a window creating it dynamically if required.
87 GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint32_t flags) {
88  // Allocate the structure if necessary
89  if (!pgw) {
90  if (!(pgw = gfxAlloc(vmt->size)))
91  return 0;
92  pgw->flags = flags|GWIN_FLG_DYNAMIC;
93  } else
94  pgw->flags = flags;
95 
96  // Initialise all basic fields
97  pgw->display = g;
98  pgw->vmt = vmt;
99  pgw->color = defaultFgColor;
100  pgw->bgcolor = defaultBgColor;
101  #if GDISP_NEED_TEXT
102  pgw->font = defaultFont;
103  #endif
104 
105  // Make sure we don't create nasty problems for ourselves
106  if (vmt->size > sizeof(GWindowObject))
107  memset(pgw+1, 0, vmt->size - sizeof(GWindowObject));
108 
109  if (!_gwinWMAdd(pgw, pInit)) {
110  if ((pgw->flags & GWIN_FLG_DYNAMIC))
111  gfxFree(pgw);
112  return 0;
113  }
114 
115  return (GHandle)pgw;
116 }
117 
118 // Internal routine for use by GWIN components only
119 void _gwinDestroy(GHandle gh, GRedrawMethod how) {
120  if (!gh)
121  return;
122 
123  // Make the window invisible
124  gwinSetVisible(gh, FALSE);
125 
126  // Make sure it is flushed first - must be REDRAW_WAIT or REDRAW_INSESSION
127  _gwinFlushRedraws(how);
128 
129  #if GWIN_NEED_CONTAINERS
130  // Notify the parent it is about to be deleted
131  if (gh->parent && ((gcontainerVMT *)gh->parent->vmt)->NotifyDelete)
132  ((gcontainerVMT *)gh->parent->vmt)->NotifyDelete(gh->parent, gh);
133  #endif
134 
135  // Remove from the window manager
136  #if GWIN_NEED_WINDOWMANAGER
137  _GWINwm->vmt->Delete(gh);
138  #endif
139 
140  // Class destroy routine
141  if (gh->vmt->Destroy)
142  gh->vmt->Destroy(gh);
143 
144  // Clean up the structure
145  if (gh->flags & GWIN_FLG_DYNAMIC) {
146  gh->flags = 0; // To be sure, to be sure
147  gfxFree((void *)gh);
148  } else
149  gh->flags = 0; // To be sure, to be sure
150 }
151 
152 /*-----------------------------------------------
153  * Routines that affect all windows
154  *-----------------------------------------------*/
155 
156 void gwinClearInit(GWindowInit *pwi) {
157  char *p;
158  unsigned len;
159 
160  for(p = (char *)pwi, len = sizeof(GWindowInit); len; len--)
161  *p++ = 0;
162 }
163 
164 void gwinSetDefaultColor(color_t clr) {
165  defaultFgColor = clr;
166 }
167 
169  return defaultFgColor;
170 }
171 
172 void gwinSetDefaultBgColor(color_t bgclr) {
173  defaultBgColor = bgclr;
174 }
175 
177  return defaultBgColor;
178 }
179 
180 #if GDISP_NEED_TEXT
181  void gwinSetDefaultFont(font_t font) {
182  defaultFont = font;
183  }
184 
185  font_t gwinGetDefaultFont(void) {
186  return defaultFont;
187  }
188 #endif
189 
190 /*-----------------------------------------------
191  * The GWindow Routines
192  *-----------------------------------------------*/
193 
194 GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit) {
195  if (!(pgw = _gwindowCreate(g, pgw, pInit, &basegwinVMT, 0)))
196  return 0;
197 
198  gwinSetVisible(pgw, pInit->show);
199  _gwinFlushRedraws(REDRAW_WAIT);
200 
201  return pgw;
202 }
203 
204 void gwinDestroy(GHandle gh) {
205  _gwinDestroy(gh, REDRAW_WAIT);
206 }
207 
208 const char *gwinGetClassName(GHandle gh) {
209  return gh->vmt->classname;
210 }
211 
212 bool_t gwinGetVisible(GHandle gh) {
213  return (gh->flags & GWIN_FLG_SYSVISIBLE) ? TRUE : FALSE;
214 }
215 
216 bool_t gwinGetEnabled(GHandle gh) {
217  return (gh->flags & GWIN_FLG_SYSENABLED) ? TRUE : FALSE;
218 }
219 
220 #if GDISP_NEED_TEXT
221  void gwinSetFont(GHandle gh, font_t font) {
222  gh->font = font;
223  }
224 #endif
225 
226 void gwinClear(GHandle gh) {
227  /*
228  * Don't render anything when the window is not visible but
229  * still call the AfterClear() routine as some widgets will
230  * need this to clear internal buffers or similar
231  */
232  if (_gwinDrawStart(gh)) {
233  gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
234  _gwinDrawEnd(gh);
235  }
236  if (gh->vmt->AfterClear)
237  gh->vmt->AfterClear(gh);
238 }
239 
240 void gwinDrawPixel(GHandle gh, coord_t x, coord_t y) {
241  if (!_gwinDrawStart(gh)) return;
242  gdispGDrawPixel(gh->display, gh->x+x, gh->y+y, gh->color);
243  _gwinDrawEnd(gh);
244 }
245 
246 void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
247  if (!_gwinDrawStart(gh)) return;
248  gdispGDrawLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color);
249  _gwinDrawEnd(gh);
250 }
251 
252 void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
253  if (!_gwinDrawStart(gh)) return;
254  gdispGDrawBox(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
255  _gwinDrawEnd(gh);
256 }
257 
258 void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
259  if (!_gwinDrawStart(gh)) return;
260  gdispGFillArea(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
261  _gwinDrawEnd(gh);
262 }
263 
264 void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
265  if (!_gwinDrawStart(gh)) return;
266  gdispGBlitArea(gh->display, gh->x+x, gh->y+y, cx, cy, srcx, srcy, srccx, buffer);
267  _gwinDrawEnd(gh);
268 }
269 
270 #if GDISP_NEED_CIRCLE
271  void gwinDrawCircle(GHandle gh, coord_t x, coord_t y, coord_t radius) {
272  if (!_gwinDrawStart(gh)) return;
273  gdispGDrawCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
274  _gwinDrawEnd(gh);
275  }
276 
277  void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius) {
278  if (!_gwinDrawStart(gh)) return;
279  gdispGFillCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
280  _gwinDrawEnd(gh);
281  }
282 #endif
283 
284 #if GDISP_NEED_DUALCIRCLE
285  void gwinFillDualCircle(GHandle gh, coord_t x, coord_t y, coord_t radius1, coord_t radius2) {
286  if (!_gwinDrawStart(gh)) return;
287  gdispGFillDualCircle(gh->display, gh->x+x, gh->y+y, radius1, gh->bgcolor, radius2, gh->color);
288  _gwinDrawEnd(gh);
289  }
290 #endif
291 
292 #if GDISP_NEED_ELLIPSE
293  void gwinDrawEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b) {
294  if (!_gwinDrawStart(gh)) return;
295  gdispGDrawEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
296  _gwinDrawEnd(gh);
297  }
298 
299  void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b) {
300  if (!_gwinDrawStart(gh)) return;
301  gdispGFillEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
302  _gwinDrawEnd(gh);
303  }
304 #endif
305 
306 #if GDISP_NEED_ARC
307  void gwinDrawArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle) {
308  if (!_gwinDrawStart(gh)) return;
309  gdispGDrawArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
310  _gwinDrawEnd(gh);
311  }
312 
313  void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle) {
314  if (!_gwinDrawStart(gh)) return;
315  gdispGFillArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
316  _gwinDrawEnd(gh);
317  }
318 
319  void gwinDrawThickArc(GHandle gh, coord_t x, coord_t y, coord_t startradius, coord_t endradius, coord_t startangle, coord_t endangle) {
320  if (!_gwinDrawStart(gh)) return;
321  gdispGDrawThickArc(gh->display, gh->x+x, gh->y+y, startradius, endradius, startangle, endangle, gh->color);
322  _gwinDrawEnd(gh);
323  }
324 #endif
325 
326 #if GDISP_NEED_ARCSECTORS
327  void gwinDrawArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors) {
328  if (!_gwinDrawStart(gh)) return;
329  gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
330  _gwinDrawEnd(gh);
331  }
332 
333  void gwinFillArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors) {
334  if (!_gwinDrawStart(gh)) return;
335  gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
336  _gwinDrawEnd(gh);
337  }
338 #endif
339 
340 #if GDISP_NEED_PIXELREAD
342  if (!_gwinDrawStart(gh)) return (color_t)0;
343  return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
344  _gwinDrawEnd(gh);
345  }
346 #endif
347 
348 #if GDISP_NEED_TEXT
349  void gwinDrawChar(GHandle gh, coord_t x, coord_t y, char c) {
350  if (!gh->font || !_gwinDrawStart(gh)) return;
351  gdispGDrawChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color);
352  _gwinDrawEnd(gh);
353  }
354 
355  void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c) {
356  if (!gh->font || !_gwinDrawStart(gh)) return;
357  gdispGFillChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color, gh->bgcolor);
358  _gwinDrawEnd(gh);
359  }
360 
361  void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str) {
362  if (!gh->font || !_gwinDrawStart(gh)) return;
363  gdispGDrawString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color);
364  _gwinDrawEnd(gh);
365  }
366 
367  void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str) {
368  if (!gh->font || !_gwinDrawStart(gh)) return;
369  gdispGFillString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color, gh->bgcolor);
370  _gwinDrawEnd(gh);
371  }
372 
373  void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
374  if (!gh->font || !_gwinDrawStart(gh)) return;
375  gdispGDrawStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, justify);
376  _gwinDrawEnd(gh);
377  }
378 
379  void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
380  if (!gh->font || !_gwinDrawStart(gh)) return;
381  gdispGFillStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, gh->bgcolor, justify);
382  _gwinDrawEnd(gh);
383  }
384 #endif
385 
386 #if GDISP_NEED_CONVEX_POLYGON
387  void gwinDrawPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt) {
388  if (!_gwinDrawStart(gh)) return;
389  gdispGDrawPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
390  _gwinDrawEnd(gh);
391  }
392 
393  void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt) {
394  if (!_gwinDrawStart(gh)) return;
395  gdispGFillConvexPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
396  _gwinDrawEnd(gh);
397  }
398  void gwinDrawThickLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1, coord_t width, bool_t round) {
399  if (!_gwinDrawStart(gh)) return;
400  gdispGDrawThickLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color, width, round);
401  _gwinDrawEnd(gh);
402  }
403 #endif
404 
405 #if GDISP_NEED_IMAGE
407  gdispImageError ret;
408 
409  if (!_gwinDrawStart(gh)) return GDISP_IMAGE_ERR_OK;
410  ret = gdispGImageDraw(gh->display, img, gh->x+x, gh->y+y, cx, cy, sx, sy);
411  _gwinDrawEnd(gh);
412  return ret;
413  }
414 #endif
415 
416 #endif /* GFX_USE_GWIN */
417 /** @} */
418 
void gdispGFillStringBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char *str, font_t font, color_t color, color_t bgColor, justify_t justify)
Draw a text string vertically centered within the specified box. The box background is filled with th...
void gwinDrawPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt)
Draw an enclosed polygon (convex, non-convex or complex).
const struct mf_font_s * font_t
The type of a font.
Definition: gdisp.h:93
void gdispGDrawEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color)
Draw an ellipse.
size_t size
Definition: gwin_class.h:57
const struct gwinVMT * vmt
Definition: gwin.h:45
void gwinClear(GHandle gh)
Clear the window.
The structure to initialise a GWIN.
Definition: gwin.h:75
void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer)
Fill an area in the window using the supplied bitmap.
uint32_t flags
Definition: gwin.h:53
void gdispGFillArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color)
Draw a filled arc.
int16_t coord_t
The type for a coordinate or length on the screen.
Definition: gdisp.h:39
void gdispGDrawArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color)
Draw an arc.
void gdispGFillConvexPoly(GDisplay *g, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color)
Fill a convex polygon.
void gdispGFillArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color)
Fill a selection of 45 degree arcs of a circle.
gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy)
Draw the image.
The Virtual Method Table for a container.
Definition: gwin_class.h:132
void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b)
Draw an filled ellipse.
bool_t gwinGetEnabled(GHandle gh)
Gets the enabled state of a window.
void gwinSetDefaultColor(color_t clr)
Set the default foreground color for all new GWIN windows.
color_t gwinGetDefaultColor(void)
Get the default foreground color for all new GWIN windows.
coord_t y
Definition: gwin.h:48
coord_t x
Definition: gwin.h:47
struct GWindowObject GWindowObject
A window object structure.
color_t gdispGGetPixelColor(GDisplay *g, coord_t x, coord_t y)
Get the color of a pixel.
const char * classname
Definition: gwin_class.h:56
void gdispGDrawPoly(GDisplay *g, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color)
Draw an enclosed polygon (convex, non-convex or complex).
void gwinSetFont(GHandle gh, font_t font)
Set the current font for this window.
void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color)
Set a pixel in the specified color.
void(* Destroy)(GWindowObject *gh)
Definition: gwin_class.h:58
font_t gwinGetDefaultFont(void)
Get the current default font.
void gwinDrawChar(GHandle gh, coord_t x, coord_t y, char c)
Draw a text character at the specified position in the window.
void gwinClearInit(GWindowInit *pwi)
Clear a GWindowInit structure to all zero&#39;s.
void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str)
Draw a text string with a filled background in the window.
#define FALSE
Generic &#39;false&#39; boolean constant.
Definition: gfx.h:31
void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1)
Draw a line in the window.
void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char *str, justify_t justify)
Draw a text string verticly centered within the specified box.
justify
Type for the text justification.
Definition: gdisp.h:60
void gdispGFillEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color)
Draw a filled ellipse.
void(* AfterClear)(GWindowObject *gh)
Definition: gwin_class.h:60
void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy)
Fill an rectangular area in the window.
void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c)
Draw a text character with a filled background at the specified position in the window.
void gdispGDrawCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color)
Draw a circle.
void * gfxAlloc(size_t sz)
Allocate memory.
void gdispGFillChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor)
Draw a text character with a filled background.
void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color)
Draw a line.
void gwinDestroy(GHandle gh)
Destroy a window (of any type). Releases any dynamically allocated memory.
void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius)
Draw a filled circle in the window.
void gwinDrawPixel(GHandle gh, coord_t x, coord_t y)
Set a pixel in the window.
void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color)
Fill an area with a color.
void gdispGDrawArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color)
Draw a selection of 45 degree arcs of a circle.
void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy)
Draw a box in the window.
void gwinSetVisible(GHandle gh, bool_t visible)
Sets whether a window is visible or not.
color_t gwinGetDefaultBgColor(void)
Get the default background color for all new GWIN windows.
void gwinDrawCircle(GHandle gh, coord_t x, coord_t y, coord_t radius)
Draw a circle in the window.
void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char *str, justify_t justify)
Draw a text string verticly centered within the specified filled box.
void gwinSetDefaultFont(font_t font)
Set the default font for all new GWIN windows.
void gwinDrawThickLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1, coord_t width, bool_t round)
Draw a thick line in the window.
bool_t show
Definition: gwin.h:80
void gdispGFillCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color)
Draw a filled circle.
color_t bgcolor
Definition: gwin.h:52
GDisplay * display
Definition: gwin.h:46
void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str)
Draw a text string in the window.
void gdispGDrawStringBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char *str, font_t font, color_t color, justify_t justify)
Draw a text string vertically centered within the specified box.
bool_t gwinGetVisible(GHandle gh)
Gets the visibility of a window.
void gdispGDrawThickArc(GDisplay *g, coord_t xc, coord_t yc, coord_t startradius, coord_t endradius, coord_t startangle, coord_t endangle, color_t color)
Draw a thick arc.
coord_t height
Definition: gwin.h:50
void gwinFillDualCircle(GHandle gh, coord_t x, coord_t y, coord_t radius1, coord_t radius2)
Draw two filled circles with the same centre in the window.
void gfxFree(void *ptr)
Free memory.
void gdispGDrawChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color)
Draw a text character.
Type for a 2D point on the screen.
Definition: gdisp.h:51
void gdispGDrawString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color)
Draw a text string.
coord_t width
Definition: gwin.h:49
gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy)
Draw the image.
GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit)
Create a basic window.
void gwinDrawEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b)
Draw an ellipse.
void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color)
Draw a rectangular box.
The structure for an image.
Definition: gdisp_image.h:59
void gdispGFillDualCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius1, color_t color1, coord_t radius2, color_t color2)
Draw two filled circles with the same centre.
The Virtual Method Table for a GWIN window.
Definition: gwin_class.h:55
A window object structure.
Definition: gwin.h:40
COLOR_TYPE color_t
The color type definition.
Definition: gdisp_colors.h:412
void gdispGDrawThickLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color, coord_t width, bool_t round)
Draw a line with a specified thickness.
void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer)
Fill an area using the supplied bitmap.
color_t color
Definition: gwin.h:51
void gdispGFillString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor)
Draw a text string.
const char * gwinGetClassName(GHandle gh)
Get the real class name of the GHandle.
uint16_t gdispImageError
An image error code.
Definition: gdisp_image.h:37
#define TRUE
Generic &#39;true&#39; boolean constant.
Definition: gfx.h:38
void gwinSetDefaultBgColor(color_t bgclr)
Set the default background color for all new GWIN windows.
color_t gwinGetPixelColor(GHandle gh, coord_t x, coord_t y)
Get the color of a pixel in the window.
color_t pixel_t
The pixel format.
Definition: gdisp.h:226
void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt)
Fill a convex polygon.