aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-07-08 11:19:43 +1000
committerinmarket <andrewh@inmarket.com.au>2018-07-08 11:19:43 +1000
commitf9c848e9851713d7a33962b9b4768c0a0d1751f1 (patch)
tree2b2caf1949078428ca3fd3cd47547d0485efa407 /src
parentcfb1b2a488d5b1a9e14c889b80e5324d16f63f1b (diff)
downloaduGFX-f9c848e9851713d7a33962b9b4768c0a0d1751f1.tar.gz
uGFX-f9c848e9851713d7a33962b9b4768c0a0d1751f1.tar.bz2
uGFX-f9c848e9851713d7a33962b9b4768c0a0d1751f1.zip
Change color_t to gColor
Diffstat (limited to 'src')
-rw-r--r--src/gdisp/gdisp.c68
-rw-r--r--src/gdisp/gdisp.h65
-rw-r--r--src/gdisp/gdisp_colors.h8
-rw-r--r--src/gdisp/gdisp_driver.h20
-rw-r--r--src/gdisp/gdisp_image.c14
-rw-r--r--src/gdisp/gdisp_image.h8
-rw-r--r--src/gdisp/gdisp_image_bmp.c52
-rw-r--r--src/gdisp/gdisp_image_gif.c28
-rw-r--r--src/gdisp/gdisp_image_png.c4
-rw-r--r--src/gdisp/gdisp_pixmap.c6
-rw-r--r--src/gwin/gwin.c16
-rw-r--r--src/gwin/gwin.h14
-rw-r--r--src/gwin/gwin_button.c2
-rw-r--r--src/gwin/gwin_checkbox.c2
-rw-r--r--src/gwin/gwin_console.c2
-rw-r--r--src/gwin/gwin_frame.c4
-rw-r--r--src/gwin/gwin_gl3d.c2
-rw-r--r--src/gwin/gwin_graph.h6
-rw-r--r--src/gwin/gwin_image.c2
-rw-r--r--src/gwin/gwin_label.c2
-rw-r--r--src/gwin/gwin_list.c2
-rw-r--r--src/gwin/gwin_radio.c4
-rw-r--r--src/gwin/gwin_tabset.c4
-rw-r--r--src/gwin/gwin_widget.h12
24 files changed, 174 insertions, 173 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 60c54b4f..5b58bb90 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -792,7 +792,7 @@ void gdispGFlush(GDisplay *g) {
// Don't release the mutex as gdispStreamEnd() will do that.
}
- void gdispGStreamColor(GDisplay *g, color_t color) {
+ void gdispGStreamColor(GDisplay *g, gColor color) {
#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
gCoord sx1, sy1;
#endif
@@ -978,7 +978,7 @@ void gdispGFlush(GDisplay *g) {
}
#endif
-void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
+void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, gColor color) {
MUTEX_ENTER(g);
g->p.x = x;
g->p.y = y;
@@ -988,7 +988,7 @@ void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
MUTEX_EXIT(g);
}
-void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color) {
+void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color) {
MUTEX_ENTER(g);
g->p.x = x0;
g->p.y = y0;
@@ -1000,7 +1000,7 @@ void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, col
MUTEX_EXIT(g);
}
-void gdispGClear(GDisplay *g, color_t color) {
+void gdispGClear(GDisplay *g, gColor color) {
// Note - clear() ignores the clipping area. It clears the screen.
MUTEX_ENTER(g);
@@ -1083,7 +1083,7 @@ void gdispGClear(GDisplay *g, color_t color) {
#endif
}
-void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
+void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) {
MUTEX_ENTER(g);
g->p.x = x;
g->p.y = y;
@@ -1271,7 +1271,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_CIRCLE
- void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
+ void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1313,7 +1313,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_CIRCLE
- void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
+ void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1357,7 +1357,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
g->p.x = x+r2+1; g->p.x1 = x+r1; g->p.color = color1; hline_clip(g)
#define DRAW_SINGLELINE(yval, r) g->p.y = yval; g->p.x = x-r; g->p.x1 = x+r; hline_clip(g)
- void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2) {
+ void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, gColor color1, gCoord radius2, gColor color2) {
gCoord a, b1, b2, p1, p2;
MUTEX_ENTER(g);
@@ -1426,7 +1426,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ELLIPSE
- void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
+ void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) {
gCoord dx, dy;
int32_t a2, b2;
int32_t err, e2;
@@ -1465,7 +1465,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ELLIPSE
- void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
+ void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) {
gCoord dx, dy;
int32_t a2, b2;
int32_t err, e2;
@@ -1502,7 +1502,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARCSECTORS
- void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
+ void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1546,7 +1546,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARCSECTORS
- void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
+ void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1731,7 +1731,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#include <math.h>
#endif
- void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
+ void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) {
gCoord a, b, P, sedge, eedge;
uint8_t full, sbit, ebit, tbit;
@@ -1917,7 +1917,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#include <math.h>
#endif
- void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, color_t color) {
+ void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, gColor color) {
gCoord x, y, d, r;
gCoord startTan, endTan, curangle;
gCoord precision = 512;
@@ -2032,7 +2032,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARC
- void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
+ void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) {
gCoord a, b, P;
gCoord sy, ey;
fixed sxa, sxb, sxd, exa, exb, exd;
@@ -2534,7 +2534,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
- void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
+ void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) {
if (2*radius > cx || 2*radius > cy) {
gdispGDrawBox(g, x, y, cx, cy, color);
return;
@@ -2559,7 +2559,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
- void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
+ void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) {
gCoord radius2;
radius2 = radius*2;
@@ -2585,8 +2585,8 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_PIXELREAD
- color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
- color_t c;
+ gColor gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
+ gColor c;
/* Always synchronous as it must return a value */
MUTEX_ENTER(g);
@@ -2632,7 +2632,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_SCROLL
- void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor) {
+ void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, gColor bgcolor) {
gCoord abslines;
#if GDISP_HARDWARE_SCROLL != GFXON
gCoord fy, dy, ix, fx, i, j;
@@ -2955,7 +2955,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
/* High Level Driver Routines. */
/*===========================================================================*/
-void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
+void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) {
if (cx <= 0 || cy <= 0) return;
cx = x+cx-1; cy = y+cy-1; // cx, cy are now the end point.
@@ -2985,7 +2985,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
}
#if GDISP_NEED_CONVEX_POLYGON
- void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
+ void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) {
const gPoint *epnt, *p;
epnt = &pntarray[cnt-1];
@@ -3001,7 +3001,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
- void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
+ void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) {
const gPoint *lpnt, *rpnt, *epnts;
fixed lx, rx, lk, rk;
gCoord y, ymax, lxc, rxc;
@@ -3150,7 +3150,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
return;
}
- void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round) {
+ void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color, gCoord width, gBool round) {
gCoord dx, dy, nx = 0, ny = 0;
/* Compute the direction vector for the line */
@@ -3363,7 +3363,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
}
#endif
- void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color) {
+ void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, gColor color) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3378,7 +3378,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
- void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color, color_t bgcolor) {
+ void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, gColor color, gColor bgcolor) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3400,7 +3400,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
- void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color) {
+ void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, gColor color) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3416,7 +3416,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
- void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color, color_t bgcolor) {
+ void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, gColor color, gColor bgcolor) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3439,7 +3439,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
- void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify) {
+ void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, gColor color, justify_t justify) {
gCoord totalHeight;
if (!font)
@@ -3517,7 +3517,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
- void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, color_t bgcolor, justify_t justify) {
+ void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, gColor color, gColor bgcolor, justify_t justify) {
gCoord totalHeight;
if (!font)
@@ -3652,7 +3652,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
#if GDISP_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888
// Special alpha hacked version.
// Note: this will still work with real RGB888
- color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha)
+ gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha)
{
uint32_t ratio;
uint32_t a1, r1, g1, b1;
@@ -3699,7 +3699,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
return ARGB2COLOR(a1, r1, g1, b1);
}
#else
- color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha)
+ gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha)
{
uint16_t fg_ratio = alpha + 1;
uint16_t bg_ratio = 256 - alpha;
@@ -3721,7 +3721,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
}
#endif
-color_t gdispContrastColor(color_t color) {
+gColor gdispContrastColor(gColor color) {
uint16_t r, g, b;
r = RED_OF(color) > 128 ? 0 : 255;
@@ -3732,7 +3732,7 @@ color_t gdispContrastColor(color_t color) {
}
#if (!defined(gdispPackPixels) && !defined(GDISP_PIXELFORMAT_CUSTOM))
- void gdispPackPixels(gPixel *buf, gCoord cx, gCoord x, gCoord y, color_t color) {
+ void gdispPackPixels(gPixel *buf, gCoord cx, gCoord x, gCoord y, gColor color) {
/* No mutex required as we only read static data */
#if defined(GDISP_PIXELFORMAT_RGB888)
#error "GDISP: Packed pixels not supported yet"
diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h
index 1af38afe..a808c7df 100644
--- a/src/gdisp/gdisp.h
+++ b/src/gdisp/gdisp.h
@@ -223,7 +223,7 @@ extern GDisplay *GDISP;
/**
* @brief The type of a pixel.
*/
-typedef color_t gPixel;
+typedef gColor gPixel;
/* Color Utility Functions */
@@ -237,7 +237,7 @@ typedef color_t gPixel;
*
* @api
*/
-color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha);
+gColor gdispBlendColor(gColor fg, gColor bg, uint8_t alpha);
/**
* @brief Find a contrasting color
@@ -247,7 +247,7 @@ color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha);
*
* @api
*/
-color_t gdispContrastColor(color_t color);
+gColor gdispContrastColor(gColor color);
/* Base Functions */
@@ -392,7 +392,7 @@ void gdispGFlush(GDisplay *g);
*
* @api
*/
-void gdispGClear(GDisplay *g, color_t color);
+void gdispGClear(GDisplay *g, gColor color);
#define gdispClear(c) gdispGClear(GDISP, c)
/**
@@ -404,7 +404,7 @@ void gdispGClear(GDisplay *g, color_t color);
*
* @api
*/
-void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color);
+void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, gColor color);
#define gdispDrawPixel(x,y,c) gdispGDrawPixel(GDISP,x,y,c)
/**
@@ -417,7 +417,7 @@ void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color);
*
* @api
*/
-void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color);
+void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color);
#define gdispDrawLine(x0,y0,x1,y1,c) gdispGDrawLine(GDISP,x0,y0,x1,y1,c)
/**
@@ -430,7 +430,7 @@ void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, col
*
* @api
*/
-void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color);
+void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color);
#define gdispFillArea(x,y,cx,cy,c) gdispGFillArea(GDISP,x,y,cx,cy,c)
/**
@@ -465,7 +465,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
*
* @api
*/
-void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color);
+void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color);
#define gdispDrawBox(x,y,cx,cy,c) gdispGDrawBox(GDISP,x,y,cx,cy,c)
/* Streaming Functions */
@@ -511,7 +511,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGStreamColor(GDisplay *g, color_t color);
+ void gdispGStreamColor(GDisplay *g, gColor color);
#define gdispStreamColor(c) gdispGStreamColor(GDISP,c)
/**
@@ -561,7 +561,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color);
+ void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color);
#define gdispDrawCircle(x,y,r,c) gdispGDrawCircle(GDISP,x,y,r,c)
/**
@@ -575,7 +575,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color);
+ void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color);
#define gdispFillCircle(x,y,r,c) gdispGFillCircle(GDISP,x,y,r,c)
#endif
@@ -593,7 +593,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2);
+ void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, gColor color1, gCoord radius2, gColor color2);
#define gdispFillDualCircle(x,y,r1,c1,r2,c2) gdispGFillDualCircle(GDISP,x,y,r1,c1,r2,c2)
#endif
@@ -611,7 +611,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color);
+ void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color);
#define gdispDrawEllipse(x,y,a,b,c) gdispGDrawEllipse(GDISP,x,y,a,b,c)
/**
@@ -625,7 +625,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color);
+ void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color);
#define gdispFillEllipse(x,y,a,b,c) gdispGFillEllipse(GDISP,x,y,a,b,c)
#endif
@@ -657,7 +657,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color);
+ void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color);
#define gdispDrawArcSectors(x,y,r,s,c) gdispGDrawArcSectors(GDISP,x,y,r,s,c)
/**
@@ -686,7 +686,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color);
+ void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color);
#define gdispFillArcSectors(x,y,r,s,c) gdispGFillArcSectors(GDISP,x,y,r,s,c)
#endif
@@ -713,7 +713,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color);
+ void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, gColor color);
#define gdispDrawArc(x,y,r,s,e,c) gdispGDrawArc(GDISP,x,y,r,s,e,c)
/**
@@ -738,7 +738,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, color_t color);
+ void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, gColor color);
#define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c)
/**
@@ -763,7 +763,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color);
+ void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, gColor color);
#define gdispFillArc(x,y,r,s,e,c) gdispGFillArc(GDISP,x,y,r,s,e,c)
#endif
@@ -780,7 +780,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y);
+ gColor gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y);
#define gdispGetPixelColor(x,y) gdispGGetPixelColor(GDISP,x,y)
#endif
@@ -801,7 +801,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor);
+ void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, gColor bgcolor);
#define gdispVerticalScroll(x,y,cx,cy,l,b) gdispGVerticalScroll(GDISP,x,y,cx,cy,l,b)
#endif
@@ -855,7 +855,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color);
+ void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color);
#define gdispDrawPoly(x,y,p,i,c) gdispGDrawPoly(GDISP,x,y,p,i,c)
/**
@@ -879,7 +879,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color);
+ void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color);
#define gdispFillConvexPoly(x,y,p,i,c) gdispGFillConvexPoly(GDISP,x,y,p,i,c)
/**
@@ -898,7 +898,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round);
+ void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color, gCoord width, gBool round);
#define gdispDrawThickLine(x0,y0,x1,y1,c,w,r) gdispGDrawThickLine(GDISP,x0,y0,x1,y1,c,w,r)
#endif
@@ -917,7 +917,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color);
+ void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, gColor color);
#define gdispDrawChar(x,y,s,f,c) gdispGDrawChar(GDISP,x,y,s,f,c)
/**
@@ -933,7 +933,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color, color_t bgcolor);
+ void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, gColor color, gColor bgcolor);
#define gdispFillChar(x,y,s,f,c,b) gdispGFillChar(GDISP,x,y,s,f,c,b)
/**
@@ -948,7 +948,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color);
+ void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, gColor color);
#define gdispDrawString(x,y,s,f,c) gdispGDrawString(GDISP,x,y,s,f,c)
/**
@@ -964,7 +964,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color, color_t bgcolor);
+ void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, gColor color, gColor bgcolor);
#define gdispFillString(x,y,s,f,c,b) gdispGFillString(GDISP,x,y,s,f,c,b)
/**
@@ -981,7 +981,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify);
+ void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, gColor color, justify_t justify);
#define gdispDrawStringBox(x,y,cx,cy,s,f,c,j) gdispGDrawStringBox(GDISP,x,y,cx,cy,s,f,c,j)
/**
@@ -1000,7 +1000,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, color_t bgColor, justify_t justify);
+ void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, gColor color, gColor bgColor, justify_t justify);
#define gdispFillStringBox(x,y,cx,cy,s,f,c,b,j) gdispGFillStringBox(GDISP,x,y,cx,cy,s,f,c,b,j)
/**
@@ -1130,7 +1130,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color);
+ void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color);
#define gdispDrawRoundedBox(x,y,cx,cy,r,c) gdispGDrawRoundedBox(GDISP,x,y,cx,cy,r,c)
/**
@@ -1145,7 +1145,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
*
* @api
*/
- void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color);
+ void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color);
#define gdispFillRoundedBox(x,y,cx,cy,r,c) gdispGFillRoundedBox(GDISP,x,y,cx,cy,r,c)
#endif
@@ -1230,6 +1230,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
/* V2 compatibility */
#if GFX_COMPAT_V2
+ typedef gColor color_t;
typedef gPixel pixel_t;
typedef gCoord coord_t;
typedef gPoint point, point_t;
diff --git a/src/gdisp/gdisp_colors.h b/src/gdisp/gdisp_colors.h
index 323303e0..db859234 100644
--- a/src/gdisp/gdisp_colors.h
+++ b/src/gdisp/gdisp_colors.h
@@ -188,17 +188,17 @@ typedef uint16_t colorformat;
* tv luminance (0.26126R + 0.7152G + 0.0722B), digital tv luminance of (0.299R + 0.587G + 0.114B), or
* @p LUMA_OF() which uses (0.25R + 0.5G + 0.25B).
*/
- #define LUMA2COLOR(l) ((color_t)((((l) & 0xF8)<<8) | (((l) & 0xFC)<<3) | (((l) & 0xF8)>>3)))
+ #define LUMA2COLOR(l) ((gColor)((((l) & 0xF8)<<8) | (((l) & 0xFC)<<3) | (((l) & 0xF8)>>3)))
/**
* @brief Convert red, green, blue (each 0 to 255) into a color value.
*/
- #define RGB2COLOR(r,g,b) ((color_t)((((r) & 0xF8)<<8) | (((g) & 0xFC)<<3) | (((b) & 0xF8)>>3)))
+ #define RGB2COLOR(r,g,b) ((gColor)((((r) & 0xF8)<<8) | (((g) & 0xFC)<<3) | (((b) & 0xF8)>>3)))
/**
* @brief Convert a 6 digit HTML code (hex) into a color value.
*/
- #define HTML2COLOR(h) ((color_t)((((h) & 0xF80000)>>8) | (((h) & 0x00FC00)>>5) | (((h) & 0x0000F8)>>3)))
+ #define HTML2COLOR(h) ((gColor)((((h) & 0xF80000)>>8) | (((h) & 0x00FC00)>>5) | (((h) & 0x0000F8)>>3)))
/**
* @name Extraction macros (quick)
@@ -434,7 +434,7 @@ typedef uint16_t colorformat;
/**
* @brief The color type definition
*/
-typedef COLOR_TYPE color_t;
+typedef COLOR_TYPE gColor;
#endif /* GFX_USE_GDISP */
diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h
index 863d4c0c..11af847d 100644
--- a/src/gdisp/gdisp_driver.h
+++ b/src/gdisp/gdisp_driver.h
@@ -284,7 +284,7 @@
/* Verify information for packed pixels and define a non-packed pixel macro */
#if !GDISP_PACKED_PIXELS
- #define gdispPackPixels(buf,cx,x,y,c) { ((color_t *)(buf))[(y)*(cx)+(x)] = (c); }
+ #define gdispPackPixels(buf,cx,x,y,c) { ((gColor *)(buf))[(y)*(cx)+(x)] = (c); }
#elif !GDISP_HARDWARE_BITFILLS
#error "GDISP: packed pixel formats are only supported for hardware accelerated drivers."
#elif GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB888 \
@@ -308,7 +308,7 @@
*
* @api
*/
- void gdispPackPixels(const gPixel *buf, gCoord cx, gCoord x, gCoord y, color_t color);
+ void gdispPackPixels(const gPixel *buf, gCoord cx, gCoord x, gCoord y, gColor color);
#endif
//------------------------------------------------------------------------------------------------------------
@@ -353,7 +353,7 @@ struct GDisplay {
gCoord cx, cy;
gCoord x1, y1;
gCoord x2, y2;
- color_t color;
+ gColor color;
void *ptr;
} p;
@@ -363,8 +363,8 @@ struct GDisplay {
// Text rendering parameters
struct {
font_t font;
- color_t color;
- color_t bgcolor;
+ gColor color;
+ gColor bgcolor;
gCoord clipx0, clipy0;
gCoord clipx1, clipy1;
#if GDISP_NEED_TEXT_WORDWRAP
@@ -375,7 +375,7 @@ struct GDisplay {
#endif
#if GDISP_LINEBUF_SIZE != 0 && ((GDISP_NEED_SCROLL && !GDISP_HARDWARE_SCROLL) || (!GDISP_HARDWARE_STREAM_WRITE && GDISP_HARDWARE_BITFILLS))
// A pixel line buffer
- color_t linebuf[GDISP_LINEBUF_SIZE];
+ gColor linebuf[GDISP_LINEBUF_SIZE];
#endif
};
@@ -390,13 +390,13 @@ typedef struct GDISPVMT {
void (*writecolor)(GDisplay *g); // Uses p.color
void (*writestop)(GDisplay *g); // Uses no parameters
void (*readstart)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy
- color_t (*readcolor)(GDisplay *g); // Uses no parameters
+ gColor (*readcolor)(GDisplay *g); // Uses no parameters
void (*readstop)(GDisplay *g); // Uses no parameters
void (*pixel)(GDisplay *g); // Uses p.x,p.y p.color
void (*clear)(GDisplay *g); // Uses p.color
void (*fill)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy p.color
void (*blit)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy p.x1,p.y1 (=srcx,srcy) p.x2 (=srccx), p.ptr (=buffer)
- color_t (*get)(GDisplay *g); // Uses p.x,p.y
+ gColor (*get)(GDisplay *g); // Uses p.x,p.y
void (*vscroll)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy, p.y1 (=lines) p.color
void (*control)(GDisplay *g); // Uses p.x (=what) p.ptr (=value)
void *(*query)(GDisplay *g); // Uses p.x (=what);
@@ -526,7 +526,7 @@ typedef struct GDISPVMT {
*
* @note The parameter variables must not be altered by the driver.
*/
- LLDSPEC color_t gdisp_lld_read_color(GDisplay *g);
+ LLDSPEC gColor gdisp_lld_read_color(GDisplay *g);
/**
* @brief End the current streaming operation
@@ -609,7 +609,7 @@ typedef struct GDISPVMT {
*
* @note The parameter variables must not be altered by the driver.
*/
- LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g);
+ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g);
#endif
#if (GDISP_HARDWARE_SCROLL && GDISP_NEED_SCROLL) || defined(__DOXYGEN__)
diff --git a/src/gdisp/gdisp_image.c b/src/gdisp/gdisp_image.c
index 3e202b18..03f3523e 100644
--- a/src/gdisp/gdisp_image.c
+++ b/src/gdisp/gdisp_image.c
@@ -34,8 +34,8 @@
extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern delaytime_t gdispImageNext_BMP(gdispImage *img);
extern uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img);
- extern color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index);
- extern gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, color_t newColor);
+ extern gColor gdispImageGetPalette_BMP(gdispImage *img, uint16_t index);
+ extern gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, gColor newColor);
#endif
#if GDISP_NEED_IMAGE_JPG
@@ -66,8 +66,8 @@ typedef struct gdispImageHandlers {
gCoord sx, gCoord sy); /* The draw function */
delaytime_t (*next)(gdispImage *img); /* The next frame function */
uint16_t (*getPaletteSize)(gdispImage *img); /* Retrieve the size of the palette (number of entries) */
- color_t (*getPalette)(gdispImage *img, uint16_t index); /* Retrieve a specific color value of the palette */
- gBool (*adjustPalette)(gdispImage *img, uint16_t index, color_t newColor); /* Replace a color value in the palette */
+ gColor (*getPalette)(gdispImage *img, uint16_t index); /* Retrieve a specific color value of the palette */
+ gBool (*adjustPalette)(gdispImage *img, uint16_t index, gColor newColor); /* Replace a color value in the palette */
} gdispImageHandlers;
static gdispImageHandlers ImageHandlers[] = {
@@ -158,7 +158,7 @@ gBool gdispImageIsOpen(gdispImage *img) {
return img && img->type != GDISP_IMAGE_TYPE_UNKNOWN && img->fns != 0;
}
-void gdispImageSetBgColor(gdispImage *img, color_t bgcolor) {
+void gdispImageSetBgColor(gdispImage *img, gColor bgcolor) {
if (!img)
return;
img->bgcolor = bgcolor;
@@ -198,13 +198,13 @@ uint16_t gdispImageGetPaletteSize(gdispImage *img) {
return img->fns->getPaletteSize(img);
}
-color_t gdispImageGetPalette(gdispImage *img, uint16_t index) {
+gColor gdispImageGetPalette(gdispImage *img, uint16_t index) {
if (!img || !img->fns) return 0;
if (!img->fns->getPalette) return 0;
return img->fns->getPalette(img, index);
}
-gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, color_t newColor) {
+gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor) {
if (!img || !img->fns) return gFalse;
if (!img->fns->adjustPalette) return gFalse;
return img->fns->adjustPalette(img, index, newColor);
diff --git a/src/gdisp/gdisp_image.h b/src/gdisp/gdisp_image.h
index 864c0a20..cf0ada32 100644
--- a/src/gdisp/gdisp_image.h
+++ b/src/gdisp/gdisp_image.h
@@ -59,7 +59,7 @@ typedef uint16_t gdispImageFlags;
typedef struct gdispImage {
gdispImageType type; /* @< The image type */
gdispImageFlags flags; /* @< The image flags */
- color_t bgcolor; /* @< The default background color */
+ gColor bgcolor; /* @< The default background color */
gCoord width, height; /* @< The image dimensions */
GFILE * f; /* @< The underlying GFILE */
#if GDISP_NEED_IMAGE_ACCOUNTING
@@ -182,7 +182,7 @@ gBool gdispImageIsOpen(gdispImage *img);
* @note This color is only used when an image has to restore part of the background before
* continuing with drawing that includes transparency eg some GIF animations.
*/
-void gdispImageSetBgColor(gdispImage *img, color_t bgcolor);
+void gdispImageSetBgColor(gdispImage *img, gColor bgcolor);
/**
* @brief Cache the image
@@ -266,7 +266,7 @@ uint16_t gdispImageGetPaletteSize(gdispImage *img);
*
* @note This function will return 0 if the index is out of bounds or if the image doesn't use a color palette.
*/
-color_t gdispImageGetPalette(gdispImage *img, uint16_t index);
+gColor gdispImageGetPalette(gdispImage *img, uint16_t index);
/**
* @brief Modify an entry in the color palette.
@@ -279,7 +279,7 @@ color_t gdispImageGetPalette(gdispImage *img, uint16_t index);
* @pre gdispImageOpen() must have returned successfully.
* @note This function will return @p gFalse if the index is out of bounds or if the image doesn't use a color palette.
*/
-gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, color_t newColor);
+gBool gdispImageAdjustPalette(gdispImage *img, uint16_t index, gColor newColor);
#endif /* GFX_USE_GDISP && GDISP_NEED_IMAGE */
#endif /* _GDISP_IMAGE_H */
diff --git a/src/gdisp/gdisp_image_bmp.c b/src/gdisp/gdisp_image_bmp.c
index 7c26cc22..61b801ad 100644
--- a/src/gdisp/gdisp_image_bmp.c
+++ b/src/gdisp/gdisp_image_bmp.c
@@ -52,7 +52,7 @@ void gdispImageClose_BMP(gdispImage *img) {
if (priv) {
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_4_RLE || GDISP_NEED_IMAGE_BMP_8 || GDISP_NEED_IMAGE_BMP_8_RLE
if (priv->palette)
- gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(color_t));
+ gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(gColor));
#endif
if (priv->frame0cache)
gdispImageFree(img, (void *)priv->frame0cache, img->width*img->height*sizeof(gPixel));
@@ -262,7 +262,7 @@ gdispImageError gdispImageOpen_BMP(gdispImage *img) {
if (priv->bmpflags & BMP_PALETTE) {
gfileSetPos(img->f, offsetColorTable);
- if (!(priv->palette = (color_t *)gdispImageAlloc(img, priv->palsize*sizeof(color_t))))
+ if (!(priv->palette = (gColor *)gdispImageAlloc(img, priv->palsize*sizeof(gColor))))
return GDISP_IMAGE_ERR_NOMEMORY;
if (priv->bmpflags & BMP_V2) {
for(aword = 0; aword < priv->palsize; aword++) {
@@ -354,7 +354,7 @@ unsupportedcleanup:
static gCoord getPixels(gdispImage *img, gCoord x) {
gdispImagePrivate_BMP * priv;
- color_t * pc;
+ gColor * pc;
gCoord len;
priv = (gdispImagePrivate_BMP *)img->priv;
@@ -591,7 +591,7 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
case 16:
{
uint16_t w[2];
- color_t r, g, b;
+ gColor r, g, b;
while(x < img->width && len <= GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE-2) {
if (gfileRead(img->f, &w, 4) != 4)
@@ -599,29 +599,29 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
gdispImageMakeLE16(w[0]);
gdispImageMakeLE16(w[1]);
if (priv->shiftred < 0)
- r = (color_t)((w[0] & priv->maskred) << -priv->shiftred);
+ r = (gColor)((w[0] & priv->maskred) << -priv->shiftred);
else
- r = (color_t)((w[0] & priv->maskred) >> priv->shiftred);
+ r = (gColor)((w[0] & priv->maskred) >> priv->shiftred);
if (priv->shiftgreen < 0)
- g = (color_t)((w[0] & priv->maskgreen) << -priv->shiftgreen);
+ g = (gColor)((w[0] & priv->maskgreen) << -priv->shiftgreen);
else
- g = (color_t)((w[0] & priv->maskgreen) >> priv->shiftgreen);
+ g = (gColor)((w[0] & priv->maskgreen) >> priv->shiftgreen);
if (priv->shiftblue < 0)
- b = (color_t)((w[0] & priv->maskblue) << -priv->shiftblue);
+ b = (gColor)((w[0] & priv->maskblue) << -priv->shiftblue);
else
- b = (color_t)((w[0] & priv->maskblue) >> priv->shiftblue);
+ b = (gColor)((w[0] & priv->maskblue) >> priv->shiftblue);
/* We don't support alpha yet */
*pc++ = RGB2COLOR(r, g, b);
if (priv->shiftred < 0)
- r = (color_t)((w[1] & priv->maskred) << -priv->shiftred);
+ r = (gColor)((w[1] & priv->maskred) << -priv->shiftred);
else
- r = (color_t)((w[1] & priv->maskred) >> priv->shiftred);
+ r = (gColor)((w[1] & priv->maskred) >> priv->shiftred);
if (priv->shiftgreen < 0)
- g = (color_t)((w[1] & priv->maskgreen) << -priv->shiftgreen);
+ g = (gColor)((w[1] & priv->maskgreen) << -priv->shiftgreen);
else
- g = (color_t)((w[1] & priv->maskgreen) >> priv->shiftgreen);
+ g = (gColor)((w[1] & priv->maskgreen) >> priv->shiftgreen);
if (priv->shiftblue < 0)
- b = (color_t)((w[1] & priv->maskblue) << -priv->shiftblue);
+ b = (gColor)((w[1] & priv->maskblue) << -priv->shiftblue);
else
b = (uint8_t)((w[1] & priv->maskblue) >> priv->shiftblue);
/* We don't support alpha yet */
@@ -659,24 +659,24 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
case 32:
{
uint32_t dw;
- color_t r, g, b;
+ gColor r, g, b;
while(x < img->width && len < GDISP_IMAGE_BMP_BLIT_BUFFER_SIZE) {
if (gfileRead(img->f, &dw, 4) != 4)
return 0;
gdispImageMakeLE32(dw);
if (priv->shiftred < 0)
- r = (color_t)((dw & priv->maskred) << -priv->shiftred);
+ r = (gColor)((dw & priv->maskred) << -priv->shiftred);
else
- r = (color_t)((dw & priv->maskred) >> priv->shiftred);
+ r = (gColor)((dw & priv->maskred) >> priv->shiftred);
if (priv->shiftgreen < 0)
- g = (color_t)((dw & priv->maskgreen) << -priv->shiftgreen);
+ g = (gColor)((dw & priv->maskgreen) << -priv->shiftgreen);
else
- g = (color_t)((dw & priv->maskgreen) >> priv->shiftgreen);
+ g = (gColor)((dw & priv->maskgreen) >> priv->shiftgreen);
if (priv->shiftblue < 0)
- b = (color_t)((dw & priv->maskblue) << -priv->shiftblue);
+ b = (gColor)((dw & priv->maskblue) << -priv->shiftblue);
else
- b = (color_t)((dw & priv->maskblue) >> priv->shiftblue);
+ b = (gColor)((dw & priv->maskblue) >> priv->shiftblue);
/* We don't support alpha yet */
*pc++ = RGB2COLOR(r, g, b);
x++;
@@ -693,8 +693,8 @@ static gCoord getPixels(gdispImage *img, gCoord x) {
gdispImageError gdispImageCache_BMP(gdispImage *img) {
gdispImagePrivate_BMP * priv;
- color_t * pcs;
- color_t * pcd;
+ gColor * pcs;
+ gColor * pcd;
gCoord pos, x, y;
size_t len;
@@ -839,7 +839,7 @@ uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img) {
#endif
}
-color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) {
+gColor gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) {
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
gdispImagePrivate_BMP *priv;
@@ -860,7 +860,7 @@ color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index) {
#endif
}
-gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, color_t newColor) {
+gBool gdispImageAdjustPalette_BMP(gdispImage *img, uint16_t index, gColor newColor) {
#if GDISP_NEED_IMAGE_BMP_1 || GDISP_NEED_IMAGE_BMP_4 || GDISP_NEED_IMAGE_BMP_8
gdispImagePrivate_BMP *priv;
diff --git a/src/gdisp/gdisp_image_gif.c b/src/gdisp/gdisp_image_gif.c
index 57af7fd9..edfa30c2 100644
--- a/src/gdisp/gdisp_image_gif.c
+++ b/src/gdisp/gdisp_image_gif.c
@@ -43,7 +43,7 @@ typedef struct gifimgdecode {
uint16_t code_max;
uint16_t code_last;
uint32_t shiftdata;
- color_t * palette;
+ gColor * palette;
uint8_t buf[GDISP_IMAGE_GIF_BLIT_BUFFER_SIZE]; // Buffer for decoded pixels
uint16_t prefix[1<<GIF_MAX_CODE_BITS]; // The LZW table
uint8_t suffix[1<<GIF_MAX_CODE_BITS]; // So we can trace the codes
@@ -71,7 +71,7 @@ typedef struct gifimgframe {
// The data for a cache
typedef struct gifimgcache {
gifimgframe frame;
- color_t * palette; // Local palette
+ gColor * palette; // Local palette
uint8_t * imagebits; // Image bits - only saved when caching
struct gifimgcache *next; // Next cached frame
} gifimgcache;
@@ -114,7 +114,7 @@ static gdispImageError startDecodeGif(gdispImage *img) {
priv = (gdispImagePrivate_GIF *)img->priv;
// We need the decode ram, and possibly a palette
- if (!(decode = (gifimgdecode *)gdispImageAlloc(img, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(color_t))))
+ if (!(decode = (gifimgdecode *)gdispImageAlloc(img, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(gColor))))
return GDISP_IMAGE_ERR_NOMEMORY;
// We currently have not read any image data block
@@ -124,7 +124,7 @@ static gdispImageError startDecodeGif(gdispImage *img) {
if (priv->frame.palsize) {
// Local palette
decode->maxpixel = priv->frame.palsize-1;
- decode->palette = (color_t *)(decode+1);
+ decode->palette = (gColor *)(decode+1);
gfileSetPos(img->f, priv->frame.pospal);
for(cnt = 0; cnt < priv->frame.palsize; cnt++) {
if (gfileRead(img->f, &decode->buf, 3) != 3)
@@ -161,7 +161,7 @@ static gdispImageError startDecodeGif(gdispImage *img) {
return GDISP_IMAGE_ERR_OK;
baddatacleanup:
- gdispImageFree(img, decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(color_t));
+ gdispImageFree(img, decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(gColor));
return GDISP_IMAGE_ERR_BADDATA;
}
@@ -177,7 +177,7 @@ static void stopDecodeGif(gdispImage *img) {
// Free the decode data
if (priv->decode) {
- gdispImageFree(img, (void *)priv->decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(color_t));
+ gdispImageFree(img, (void *)priv->decode, sizeof(gifimgdecode)+priv->frame.palsize*sizeof(gColor));
priv->decode = 0;
}
}
@@ -504,11 +504,11 @@ void gdispImageClose_GIF(gdispImage *img) {
cache = priv->cache;
while(cache) {
ncache = cache->next;
- gdispImageFree(img, (void *)cache, sizeof(gifimgcache)+cache->frame.width*cache->frame.height+cache->frame.palsize*sizeof(color_t));
+ gdispImageFree(img, (void *)cache, sizeof(gifimgcache)+cache->frame.width*cache->frame.height+cache->frame.palsize*sizeof(gColor));
cache = ncache;
}
if (priv->palette)
- gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(color_t));
+ gdispImageFree(img, (void *)priv->palette, priv->palsize*sizeof(gColor));
gdispImageFree(img, (void *)priv, sizeof(gdispImagePrivate_GIF));
img->priv = 0;
}
@@ -559,7 +559,7 @@ gdispImageError gdispImageOpen_GIF(gdispImage *img) {
// Global color table
priv->palsize = 2 << (((uint8_t *)priv->buf)[4] & 0x07);
// Allocate the global palette
- if (!(priv->palette = (color_t *)gdispImageAlloc(img, priv->palsize*sizeof(color_t))))
+ if (!(priv->palette = (gColor *)gdispImageAlloc(img, priv->palsize*sizeof(gColor))))
goto nomemcleanup;
// Read the global palette
for(aword = 0; aword < priv->palsize; aword++) {
@@ -610,13 +610,13 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
return GDISP_IMAGE_ERR_OK;
/* We need to allocate the frame, the palette and bits for the image */
- if (!(cache = (gifimgcache *)gdispImageAlloc(img, sizeof(gifimgcache) + priv->frame.palsize*sizeof(color_t) + priv->frame.width*priv->frame.height)))
+ if (!(cache = (gifimgcache *)gdispImageAlloc(img, sizeof(gifimgcache) + priv->frame.palsize*sizeof(gColor) + priv->frame.width*priv->frame.height)))
return GDISP_IMAGE_ERR_NOMEMORY;
/* Initialise the cache */
decode = 0;
cache->frame = priv->frame;
- cache->imagebits = (uint8_t *)(cache+1) + cache->frame.palsize*sizeof(color_t);
+ cache->imagebits = (uint8_t *)(cache+1) + cache->frame.palsize*sizeof(gColor);
cache->next = 0;
/* Start the decode */
@@ -630,7 +630,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
// Save the palette
if (cache->frame.palsize) {
- cache->palette = (color_t *)(cache+1);
+ cache->palette = (gColor *)(cache+1);
/* Copy the local palette into the cache */
for(cnt = 0; cnt < cache->frame.palsize; cnt++)
@@ -757,12 +757,12 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
nomemcleanup:
stopDecodeGif(img);
- gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(color_t) + priv->frame.width*priv->frame.height);
+ gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(gColor) + priv->frame.width*priv->frame.height);
return GDISP_IMAGE_ERR_NOMEMORY;
baddatacleanup:
stopDecodeGif(img);
- gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(color_t) + priv->frame.width*priv->frame.height);
+ gdispImageFree(img, cache, sizeof(gifimgcache) + priv->frame.palsize*sizeof(gColor) + priv->frame.width*priv->frame.height);
return GDISP_IMAGE_ERR_BADDATA;
}
diff --git a/src/gdisp/gdisp_image_png.c b/src/gdisp/gdisp_image_png.c
index cd7e3234..782db31f 100644
--- a/src/gdisp/gdisp_image_png.c
+++ b/src/gdisp/gdisp_image_png.c
@@ -39,7 +39,7 @@ typedef struct PNG_info {
void (*out)(struct PNG_decode *); // The scan line output function
#if GDISP_NEED_IMAGE_PNG_BACKGROUND
- color_t bg; // The background color
+ gColor bg; // The background color
#endif
#if GDISP_NEED_IMAGE_PNG_TRANSPARENCY
uint16_t trans_r; // Red/grayscale component of the transparent color (PNG_COLORMODE_GRAY and PNG_COLORMODE_RGB only)
@@ -231,7 +231,7 @@ static gBool PNG_oStartY(PNG_output *o, gCoord y) {
}
// Feed a pixel color to the display buffer
-static void PNG_oColor(PNG_output *o, color_t c) {
+static void PNG_oColor(PNG_output *o, gColor c) {
// Is it in the window
if (o->ix+(gCoord)o->cnt < o->sx || o->ix+(gCoord)o->cnt >= o->sx+o->cx) {
// No - just skip the pixel
diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c
index 9f59ce40..8fbccad4 100644
--- a/src/gdisp/gdisp_pixmap.c
+++ b/src/gdisp/gdisp_pixmap.c
@@ -46,7 +46,7 @@ typedef struct pixmap {
#if GDISP_NEED_PIXMAP_IMAGE
uint8_t imghdr[8]; // This field must come just before the data member.
#endif
- color_t pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard.
+ gColor pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard.
} pixmap;
GDisplay *gdispPixmapCreate(gCoord width, gCoord height) {
@@ -55,7 +55,7 @@ GDisplay *gdispPixmapCreate(gCoord width, gCoord height) {
unsigned i;
// Calculate the size of the display surface in bytes
- i = width*height*sizeof(color_t);
+ i = width*height*sizeof(gColor);
if (i < 2*sizeof(gCoord))
i = 2*sizeof(gCoord);
@@ -159,7 +159,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
((pixmap *)(g)->priv)->pixels[pos] = g->p.color;
}
-LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
+LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) {
unsigned pos;
#if GDISP_NEED_CONTROL
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c
index 00b2557d..7ddb2b8d 100644
--- a/src/gwin/gwin.c
+++ b/src/gwin/gwin.c
@@ -30,8 +30,8 @@ static const gwinVMT basegwinVMT = {
0, // The after-clear routine
};
-static color_t defaultFgColor = GFX_WHITE;
-static color_t defaultBgColor = GFX_BLACK;
+static gColor defaultFgColor = GFX_WHITE;
+static gColor defaultBgColor = GFX_BLACK;
#if GDISP_NEED_TEXT
static font_t defaultFont;
#endif
@@ -161,19 +161,19 @@ void gwinClearInit(GWindowInit *pwi) {
*p++ = 0;
}
-void gwinSetDefaultColor(color_t clr) {
+void gwinSetDefaultColor(gColor clr) {
defaultFgColor = clr;
}
-color_t gwinGetDefaultColor(void) {
+gColor gwinGetDefaultColor(void) {
return defaultFgColor;
}
-void gwinSetDefaultBgColor(color_t bgclr) {
+void gwinSetDefaultBgColor(gColor bgclr) {
defaultBgColor = bgclr;
}
-color_t gwinGetDefaultBgColor(void) {
+gColor gwinGetDefaultBgColor(void) {
return defaultBgColor;
}
@@ -338,8 +338,8 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s
#endif
#if GDISP_NEED_PIXELREAD
- color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y) {
- if (!_gwinDrawStart(gh)) return (color_t)0;
+ gColor gwinGetPixelColor(GHandle gh, gCoord x, gCoord y) {
+ if (!_gwinDrawStart(gh)) return (gColor)0;
return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
_gwinDrawEnd(gh);
}
diff --git a/src/gwin/gwin.h b/src/gwin/gwin.h
index 2ab50fd9..67bc2e42 100644
--- a/src/gwin/gwin.h
+++ b/src/gwin/gwin.h
@@ -48,8 +48,8 @@ typedef struct GWindowObject {
gCoord y; /**< The position relative to the screen */
gCoord width; /**< The width of this window */
gCoord height; /**< The height of this window */
- color_t color; /**< The current foreground drawing color */
- color_t bgcolor; /**< The current background drawing color */
+ gColor color; /**< The current foreground drawing color */
+ gColor bgcolor; /**< The current background drawing color */
uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */
#if GDISP_NEED_TEXT
font_t font; /**< The current font */
@@ -137,7 +137,7 @@ void gwinClearInit(GWindowInit *pwi);
*
* @api
*/
-void gwinSetDefaultColor(color_t clr);
+void gwinSetDefaultColor(gColor clr);
/**
* @brief Get the default foreground color for all new GWIN windows
@@ -146,7 +146,7 @@ void gwinSetDefaultColor(color_t clr);
*
* @api
*/
-color_t gwinGetDefaultColor(void);
+gColor gwinGetDefaultColor(void);
/**
* @brief Set the default background color for all new GWIN windows
@@ -155,7 +155,7 @@ color_t gwinGetDefaultColor(void);
*
* @api
*/
-void gwinSetDefaultBgColor(color_t bgclr);
+void gwinSetDefaultBgColor(gColor bgclr);
/**
* @brief Get the default background color for all new GWIN windows
@@ -164,7 +164,7 @@ void gwinSetDefaultBgColor(color_t bgclr);
*
* @api
*/
-color_t gwinGetDefaultBgColor(void);
+gColor gwinGetDefaultBgColor(void);
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
/**
@@ -871,7 +871,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s
*
* @api
*/
- color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y);
+ gColor gwinGetPixelColor(GHandle gh, gCoord x, gCoord y);
#endif
/*-------------------------------------------------
diff --git a/src/gwin/gwin_button.c b/src/gwin/gwin_button.c
index 2e637140..38115ae5 100644
--- a/src/gwin/gwin_button.c
+++ b/src/gwin/gwin_button.c
@@ -184,7 +184,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
fixed alpha;
fixed dalpha;
gCoord i;
- color_t tcol, bcol;
+ gColor tcol, bcol;
(void) param;
diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c
index 42734626..5e6806fd 100644
--- a/src/gwin/gwin_checkbox.c
+++ b/src/gwin/gwin_checkbox.c
@@ -255,7 +255,7 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
fixed alpha;
fixed dalpha;
gCoord i;
- color_t tcol, bcol;
+ gColor tcol, bcol;
(void) param;
if (gw->g.vmt != (gwinVMT *)&checkboxVMT) return;
diff --git a/src/gwin/gwin_console.c b/src/gwin/gwin_console.c
index d2b55f5d..c5db3da8 100644
--- a/src/gwin/gwin_console.c
+++ b/src/gwin/gwin_console.c
@@ -113,7 +113,7 @@
return gTrue;
}
- static color_t ESCPrintColor(GConsoleObject *gcw) {
+ static gColor ESCPrintColor(GConsoleObject *gcw) {
switch(gcw->currattr & (ESC_REDBIT|ESC_GREENBIT|ESC_BLUEBIT|ESC_USECOLOR)) {
case (ESC_USECOLOR):
return GFX_BLACK;
diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c
index c79e813d..45bc4bc2 100644
--- a/src/gwin/gwin_frame.c
+++ b/src/gwin/gwin_frame.c
@@ -230,8 +230,8 @@ GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint
void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
const GColorSet *pcol;
gCoord pos;
- color_t contrast;
- color_t btn;
+ gColor contrast;
+ gColor btn;
(void)param;
if (gw->g.vmt != (gwinVMT *)&frameVMT)
diff --git a/src/gwin/gwin_gl3d.c b/src/gwin/gwin_gl3d.c
index 2c2861e2..5719f811 100644
--- a/src/gwin/gwin_gl3d.c
+++ b/src/gwin/gwin_gl3d.c
@@ -86,7 +86,7 @@ static void gl3dRedraw(GWindowObject *gh) {
ZBuffer * zb;
zb = ((GGL3DObject *)gh)->glcxt->zb;
- gdispGBlitArea(gh->display, gh->x, gh->y, zb->xsize, zb->ysize, 0, 0, zb->linesize/sizeof(color_t), (const gPixel *)zb->pbuf);
+ gdispGBlitArea(gh->display, gh->x, gh->y, zb->xsize, zb->ysize, 0, 0, zb->linesize/sizeof(gColor), (const gPixel *)zb->pbuf);
}
static int gl3dResizeGLViewport(GLContext *c, int *xsize_ptr, int *ysize_ptr) {
diff --git a/src/gwin/gwin_graph.h b/src/gwin/gwin_graph.h
index eaaa82ab..c16c0d9b 100644
--- a/src/gwin/gwin_graph.h
+++ b/src/gwin/gwin_graph.h
@@ -34,7 +34,7 @@ typedef enum GGraphPointType_e {
typedef struct GGraphPointStyle_t {
GGraphPointType type;
gCoord size;
- color_t color;
+ gColor color;
} GGraphPointStyle;
typedef enum GGraphLineType_e {
@@ -44,13 +44,13 @@ typedef enum GGraphLineType_e {
typedef struct GGraphLineStyle_t {
GGraphLineType type;
gCoord size;
- color_t color;
+ gColor color;
} GGraphLineStyle;
typedef struct GGraphGridStyle_t {
GGraphLineType type;
gCoord size;
- color_t color;
+ gColor color;
gCoord spacing;
} GGraphGridStyle;
diff --git a/src/gwin/gwin_image.c b/src/gwin/gwin_image.c
index 73db206e..547145ae 100644
--- a/src/gwin/gwin_image.c
+++ b/src/gwin/gwin_image.c
@@ -35,7 +35,7 @@ static void ImageDestroy(GWindowObject *gh) {
static void ImageRedraw(GHandle gh) {
gCoord x, y, w, h, dx, dy;
- color_t bg;
+ gColor bg;
#if GWIN_NEED_IMAGE_ANIMATION
delaytime_t delay;
#endif
diff --git a/src/gwin/gwin_label.c b/src/gwin/gwin_label.c
index d8ca1512..a067953a 100644
--- a/src/gwin/gwin_label.c
+++ b/src/gwin/gwin_label.c
@@ -131,7 +131,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border) {
static void gwinLabelDraw(GWidgetObject *gw, justify_t justify) {
gCoord w, h;
- color_t c;
+ gColor c;
// is it a valid handle?
if (gw->g.vmt != (gwinVMT *)&labelVMT)
diff --git a/src/gwin/gwin_list.c b/src/gwin/gwin_list.c
index 49caefe1..c3a2b879 100644
--- a/src/gwin/gwin_list.c
+++ b/src/gwin/gwin_list.c
@@ -704,7 +704,7 @@ void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
const gfxQueueASyncItem* qi;
int i;
gCoord x, y, iheight, iwidth;
- color_t fill;
+ gColor fill;
const GColorSet * ps;
#if GWIN_NEED_LIST_IMAGES
gCoord sy;
diff --git a/src/gwin/gwin_radio.c b/src/gwin/gwin_radio.c
index 53ca494b..d4ce2faf 100644
--- a/src/gwin/gwin_radio.c
+++ b/src/gwin/gwin_radio.c
@@ -264,7 +264,7 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
fixed alpha;
fixed dalpha;
gCoord i;
- color_t tcol, bcol;
+ gColor tcol, bcol;
(void) param;
if (gw->g.vmt != (gwinVMT *)&radioVMT) return;
@@ -289,7 +289,7 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
fixed alpha;
fixed dalpha;
gCoord i;
- color_t tcol, bcol;
+ gColor tcol, bcol;
(void) param;
if (gw->g.vmt != (gwinVMT *)&radioVMT) return;
diff --git a/src/gwin/gwin_tabset.c b/src/gwin/gwin_tabset.c
index f3e07eea..185d92b2 100644
--- a/src/gwin/gwin_tabset.c
+++ b/src/gwin/gwin_tabset.c
@@ -423,7 +423,7 @@ void gwinTabsetSetTab(GHandle gh) {
#else
static void fgarea(GWidgetObject *gw, const char *text, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
- color_t tcol;
+ gColor tcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->pressed : &gw->pstyle->disabled;
@@ -439,7 +439,7 @@ void gwinTabsetSetTab(GHandle gh) {
const GColorSet * pcol;
fixed alpha;
gCoord i;
- color_t tcol, bcol;
+ gColor tcol, bcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled;
diff --git a/src/gwin/gwin_widget.h b/src/gwin/gwin_widget.h
index c74eb877..309b62ec 100644
--- a/src/gwin/gwin_widget.h
+++ b/src/gwin/gwin_widget.h
@@ -35,10 +35,10 @@ struct GWidgetObject;
* @{
*/
typedef struct GColorSet {
- color_t text; /**< The text color */
- color_t edge; /**< The edge color */
- color_t fill; /**< The fill color */
- color_t progress; /**< The color of progress bars */
+ gColor text; /**< The text color */
+ gColor edge; /**< The edge color */
+ gColor fill; /**< The fill color */
+ gColor progress; /**< The color of progress bars */
} GColorSet;
/** @} */
@@ -50,8 +50,8 @@ typedef struct GColorSet {
* @{
*/
typedef struct GWidgetStyle {
- color_t background; /**< The window background color */
- color_t focus; /**< The color when a widget is focused */
+ gColor background; /**< The window background color */
+ gColor focus; /**< The color when a widget is focused */
GColorSet enabled; /**< The colors when enabled */
GColorSet disabled; /**< The colors when disabled */
GColorSet pressed; /**< The colors when pressed */