From f9c848e9851713d7a33962b9b4768c0a0d1751f1 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 8 Jul 2018 11:19:43 +1000 Subject: Change color_t to gColor --- .../addons/gdisp/board_SSD1289_stm32f4discovery.h | 4 +- boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h | 4 +- boards/base/HY-MiniSTM32V/board_SSD1289.h | 4 +- changelog.txt | 1 + demos/3rdparty/bubbles/main.c | 6 +- demos/3rdparty/notepad-2/notepadApp.c | 8 +-- demos/3rdparty/notepad-2/notepadCore.c | 6 +- demos/3rdparty/notepad-2/notepadCore.h | 4 +- demos/3rdparty/notepad-2/notepadUIDefines.h | 18 +++--- demos/applications/combo/bounce.c | 2 +- demos/applications/mandelbrot/main.c | 2 +- demos/applications/notepad/main.c | 2 +- demos/benchmarks/main.c | 2 +- .../Example_Makefiles/stm32f4/board_SSD1289.h | 4 +- .../stm32f4_chibios_3.x/board_SSD1289.h | 4 +- demos/games/tetris/tetris.c | 4 +- demos/modules/gdisp/streaming/main.c | 2 +- .../gdisp_lld_alteraframereader.c | 4 +- drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c | 2 +- drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c | 2 +- drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 2 +- drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c | 2 +- drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c | 2 +- drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c | 2 +- drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c | 2 +- drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c | 2 +- drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c | 2 +- drivers/gdisp/KS0108/gdisp_lld_KS0108.c | 2 +- drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c | 2 +- .../gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 8 +-- drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c | 2 +- drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c | 2 +- drivers/gdisp/QImage/gdisp_lld_driver.c | 2 +- drivers/gdisp/QImage/gdisp_lld_qimage.cpp | 4 +- drivers/gdisp/QImage/gdisp_lld_qimage.h | 2 +- drivers/gdisp/R61505U/gdisp_lld_R61505U.c | 2 +- drivers/gdisp/RA6963/gdisp_lld_RA6963.c | 2 +- drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c | 2 +- drivers/gdisp/SSD1289/board_SSD1289_template.h | 4 +- drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 2 +- drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 2 +- drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c | 2 +- drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c | 2 +- drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c | 2 +- drivers/gdisp/SSD2119/board_SSD2119_template.h | 4 +- drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c | 2 +- drivers/gdisp/ST7565/gdisp_lld_ST7565.c | 2 +- drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 2 +- drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c | 2 +- drivers/gdisp/TestStub/gdisp_lld_TestStub.c | 2 +- drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c | 2 +- drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c | 2 +- drivers/multiple/SDL/gdisp_lld_SDL.c | 2 +- drivers/multiple/Win32/gdisp_lld_Win32.c | 4 +- drivers/multiple/X/gdisp_lld_X.c | 2 +- drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c | 4 +- .../uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp | 4 +- src/gdisp/gdisp.c | 68 +++++++++++----------- src/gdisp/gdisp.h | 65 +++++++++++---------- src/gdisp/gdisp_colors.h | 8 +-- src/gdisp/gdisp_driver.h | 20 +++---- src/gdisp/gdisp_image.c | 14 ++--- src/gdisp/gdisp_image.h | 8 +-- src/gdisp/gdisp_image_bmp.c | 52 ++++++++--------- src/gdisp/gdisp_image_gif.c | 28 ++++----- src/gdisp/gdisp_image_png.c | 4 +- src/gdisp/gdisp_pixmap.c | 6 +- src/gwin/gwin.c | 16 ++--- src/gwin/gwin.h | 14 ++--- src/gwin/gwin_button.c | 2 +- src/gwin/gwin_checkbox.c | 2 +- src/gwin/gwin_console.c | 2 +- src/gwin/gwin_frame.c | 4 +- src/gwin/gwin_gl3d.c | 2 +- src/gwin/gwin_graph.h | 6 +- src/gwin/gwin_image.c | 2 +- src/gwin/gwin_label.c | 2 +- src/gwin/gwin_list.c | 2 +- src/gwin/gwin_radio.c | 4 +- src/gwin/gwin_tabset.c | 4 +- src/gwin/gwin_widget.h | 12 ++-- 81 files changed, 263 insertions(+), 261 deletions(-) diff --git a/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h b/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h index d7767d30..194022b1 100644 --- a/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h +++ b/boards/addons/gdisp/board_SSD1289_stm32f4discovery.h @@ -153,7 +153,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); @@ -164,7 +164,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); diff --git a/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h b/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h index fe59ba26..28effec1 100644 --- a/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h +++ b/boards/base/Embest-STM32-DMSTF4BB/board_SSD2119.h @@ -145,7 +145,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); @@ -156,7 +156,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); diff --git a/boards/base/HY-MiniSTM32V/board_SSD1289.h b/boards/base/HY-MiniSTM32V/board_SSD1289.h index 7193e466..bceca399 100644 --- a/boards/base/HY-MiniSTM32V/board_SSD1289.h +++ b/boards/base/HY-MiniSTM32V/board_SSD1289.h @@ -169,7 +169,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) -static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { +static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | \ @@ -182,7 +182,7 @@ static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { } } -static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { +static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | \ diff --git a/changelog.txt b/changelog.txt index 09957a0e..713d4925 100644 --- a/changelog.txt +++ b/changelog.txt @@ -22,6 +22,7 @@ FEATURE: Fixed headers to ensure size_t, NULL are always defined. size_t is not CHANGE: Added type gPoint to replace V2.x point and point_t CHANGE: Added type gCoord to replace V2.x coord_t CHANGE: Added type gPixel to replace V2.x pixel_t +CHANGE: Added type gColor to replace V2.x color_t FIX: Added gfxRealloc() to Qt port FIX: Fixed UC1610 driver private area initialisation FIX: Fixed ST7735 driver and added kapacuk changes diff --git a/demos/3rdparty/bubbles/main.c b/demos/3rdparty/bubbles/main.c index f167b536..7ab4da2e 100644 --- a/demos/3rdparty/bubbles/main.c +++ b/demos/3rdparty/bubbles/main.c @@ -44,7 +44,7 @@ void initialize (void) } -void matrix (int16_t xyz[3][N], color_t col[N]) +void matrix (int16_t xyz[3][N], gColor col[N]) { static uint32_t t = 0; int16_t x = -SCALE, y = -SCALE; @@ -106,7 +106,7 @@ void rotate (int16_t xyz[3][N], uint16_t angleX, uint16_t angleY, uint16_t angle } -void draw(int16_t xyz[3][N], color_t col[N]) +void draw(int16_t xyz[3][N], gColor col[N]) { static uint16_t oldProjX[N] = {0}; static uint16_t oldProjY[N] = {0}; @@ -142,7 +142,7 @@ int16_t angleX = 0, angleY = 0, angleZ = 0; int16_t speedX = 0, speedY = 0, speedZ = 0; int16_t xyz[3][N]; -color_t col[N]; +gColor col[N]; int main (void) diff --git a/demos/3rdparty/notepad-2/notepadApp.c b/demos/3rdparty/notepad-2/notepadApp.c index 57d2ad20..722e2c8d 100644 --- a/demos/3rdparty/notepad-2/notepadApp.c +++ b/demos/3rdparty/notepad-2/notepadApp.c @@ -63,9 +63,9 @@ static GButtonObject btnClose; // Image object static gdispImage toolbarImageFilmstrip; -static color_t myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE }; +static gColor myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE }; -static color_t selColor = GFX_BLACK; +static gColor selColor = GFX_BLACK; static int selColorIndex = 0, selPenWidth = 1, tbMode = 1; static NColorScheme nCurColorScheme; @@ -156,7 +156,7 @@ static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const c #define ccs nCurColorScheme int i, j = 0, k; - color_t ca, cb; + gColor ca, cb; GEventMouse ptr; (void)txt; @@ -218,7 +218,7 @@ static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const c static void nToolbarImageButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { (void)txt; (void)pstyle; (void)isenabled; - color_t cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel; + gColor cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel; gdispImageSetBgColor(&toolbarImageFilmstrip, cl); gdispFillArea(gh->x, gh->y, gh->width, gh->height, cl); diff --git a/demos/3rdparty/notepad-2/notepadCore.c b/demos/3rdparty/notepad-2/notepadCore.c index 2a739e12..ffe95d50 100644 --- a/demos/3rdparty/notepad-2/notepadCore.c +++ b/demos/3rdparty/notepad-2/notepadCore.c @@ -56,7 +56,7 @@ static GHandle nStatusConsole = NULL; static volatile gBool doExit; static void draw_point(gCoord x, gCoord y) { - color_t c = ncoreDrawingArea->color; + gColor c = ncoreDrawingArea->color; if (nMode == NCORE_MODE_DRAW) c = ncoreDrawingArea->color; @@ -227,8 +227,8 @@ void ncoreSetPenWidth(uint8_t penWidth) { nPenWidth = penWidth; } uint8_t ncoreGetPenWidth(void) { return nPenWidth; } /* Get and set the drawing color */ -void ncoreSetPenColor(color_t penColor) { gwinSetColor(ncoreDrawingArea, penColor); } -color_t ncoreGetPenColor(void) { return ncoreDrawingArea->color; } +void ncoreSetPenColor(gColor penColor) { gwinSetColor(ncoreDrawingArea, penColor); } +gColor ncoreGetPenColor(void) { return ncoreDrawingArea->color; } /* Set mode */ void ncoreSetMode(uint8_t mode) { nMode = mode; } diff --git a/demos/3rdparty/notepad-2/notepadCore.h b/demos/3rdparty/notepad-2/notepadCore.h index 937a023b..dc75be3e 100644 --- a/demos/3rdparty/notepad-2/notepadCore.h +++ b/demos/3rdparty/notepad-2/notepadCore.h @@ -58,8 +58,8 @@ void ncoreSetPenWidth(uint8_t penWidth); uint8_t ncoreGetPenWidth(void); /* Get and set the drawing color */ -void ncoreSetPenColor(color_t penColor); -color_t ncoreGetPenColor(void); +void ncoreSetPenColor(gColor penColor); +gColor ncoreGetPenColor(void); /* Get and set the pen mode */ void ncoreSetMode(uint8_t mode); diff --git a/demos/3rdparty/notepad-2/notepadUIDefines.h b/demos/3rdparty/notepad-2/notepadUIDefines.h index 4d3aef9b..e1637d87 100644 --- a/demos/3rdparty/notepad-2/notepadUIDefines.h +++ b/demos/3rdparty/notepad-2/notepadUIDefines.h @@ -97,18 +97,18 @@ /* Color scheme definition */ typedef struct colScheme { - color_t titleBarColor; - color_t titleTextColor; + gColor titleBarColor; + gColor titleTextColor; - color_t winBgColor; - color_t drawingWinBorder; + gColor winBgColor; + gColor drawingWinBorder; - color_t toolbarSeparator; - color_t toolbarBgUnsel; - color_t toolbarBgActive; - color_t toolbarBgSel; + gColor toolbarSeparator; + gColor toolbarBgUnsel; + gColor toolbarBgActive; + gColor toolbarBgSel; - color_t statusBarText; + gColor statusBarText; } NColorScheme; diff --git a/demos/applications/combo/bounce.c b/demos/applications/combo/bounce.c index 33bb8394..1ca82d00 100644 --- a/demos/applications/combo/bounce.c +++ b/demos/applications/combo/bounce.c @@ -66,7 +66,7 @@ static DECLARE_THREAD_FUNCTION(task, param) { gCoord width, height, x, y, radius, ballx, bally, dx, floor; gCoord minx, miny, maxx, maxy, winx, winy; gCoord ballcx, ballcy; - color_t colour; + gColor colour; float ii, spin, dy, spinspeed, h, f, g; (void) param; diff --git a/demos/applications/mandelbrot/main.c b/demos/applications/mandelbrot/main.c index 808ef1c2..d5af7720 100644 --- a/demos/applications/mandelbrot/main.c +++ b/demos/applications/mandelbrot/main.c @@ -32,7 +32,7 @@ void mandelbrot(float x1, float y1, float x2, float y2) { unsigned int i,j, width, height; uint16_t iter; - color_t color; + gColor color; float fwidth, fheight; float sy = y2 - y1; diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c index 72fb23e2..877be7fa 100644 --- a/demos/applications/notepad/main.c +++ b/demos/applications/notepad/main.c @@ -74,7 +74,7 @@ void drawScreen(void) { GEventMouse ev; int main(void) { - color_t color = GFX_BLACK; + gColor color = GFX_BLACK; uint16_t pen = 0; gfxInit(); diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c index 65dbd0bc..17058610 100644 --- a/demos/benchmarks/main.c +++ b/demos/benchmarks/main.c @@ -89,7 +89,7 @@ void benchmark(void) { uint32_t i, pixels, ms, pps; char pps_str[25]; gCoord height, width, rx, ry, rcx, rcy; - color_t random_color; + gColor random_color; font_t font; gdispSetOrientation(GDISP_ROTATE_90); diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h index dc3580e6..736840e2 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h @@ -155,7 +155,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); @@ -166,7 +166,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h index 7e2bb05d..f8ddfe51 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h @@ -153,7 +153,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); @@ -164,7 +164,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); diff --git a/demos/games/tetris/tetris.c b/demos/games/tetris/tetris.c index cf73c978..937ca87a 100644 --- a/demos/games/tetris/tetris.c +++ b/demos/games/tetris/tetris.c @@ -63,7 +63,7 @@ E C D */ const uint8_t sevenSegNumbers[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; // 0,1,2,3,4,5,6,7,8,9 -const color_t tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors +const gColor tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors // default tetris shapes const int tetrisShapes[TETRIS_SHAPE_COUNT][4][2] = { {{4, 17},{4, 16},{5, 16},{4, 15}}, @@ -143,7 +143,7 @@ static int uitoa(unsigned int value, char * buf, int max) { return n; } -static void sevenSegDraw(int x, int y, uint8_t number, color_t color) { +static void sevenSegDraw(int x, int y, uint8_t number, gColor color) { if (number & 0x01) gdispFillArea(x+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, y, SEVEN_SEG_WIDTH, SEVEN_SEG_HEIGHT, color); // A if (number & 0x02) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // B if (number & 0x04) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+(SEVEN_SEG_HEIGHT*2)+SEVEN_SEG_WIDTH+(SEVEN_SEG_SIZE*3), SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // C diff --git a/demos/modules/gdisp/streaming/main.c b/demos/modules/gdisp/streaming/main.c index 695b15b6..08067c4d 100644 --- a/demos/modules/gdisp/streaming/main.c +++ b/demos/modules/gdisp/streaming/main.c @@ -60,7 +60,7 @@ int main(void) { gCoord width, height, x, y, radius, ballx, bally, dx, floor; gCoord minx, miny, maxx, maxy; gCoord ballcx, ballcy; - color_t colour; + gColor colour; float ii, spin, dy, spinspeed, h, f, g; gfxInit(); diff --git a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c index 2c03ed59..003c0954 100644 --- a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c +++ b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c @@ -124,7 +124,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g) PIXEL_ADDR(g, pos)[0] = gdispColor2Native(g->p.color); } -LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) +LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { unsigned pos; LLDCOLOR_TYPE color; @@ -255,7 +255,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) // Fill the line buffer with the solid color for (i = 0; i < bytes_per_pixel * g->p.cx; i += 4) { - *((color_t*)(line + i)) = g->p.color; + *((gColor*)(line + i)) = g->p.color; } // Calculate the address of the first pixel of the rectangle (top left corner) diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index a745ab86..1f86affb 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -581,7 +581,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { * =============================== */ #if GDISP_HARDWARE_CLEARS - static void subclear(GDisplay *g, color_t color) { + static void subclear(GDisplay *g, gColor color) { unsigned x, y; uint8_t byte; diff --git a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c index d3aeadfe..f894a071 100644 --- a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c +++ b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c @@ -99,7 +99,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { #endif } -LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { +LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { unsigned pos; uint8_t *p; diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index 7de1490a..acc0a137 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -222,7 +222,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index 6582693d..e787c1c6 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -216,7 +216,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index 87c47114..6e768fbd 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -256,7 +256,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c index 1d645443..e5fdf7e8 100644 --- a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c +++ b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c @@ -260,7 +260,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c index e340dc18..79fcd6a4 100644 --- a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c +++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c @@ -289,7 +289,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index 2201cdbc..1a0a042a 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c index c83695d2..9291898e 100644 --- a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c +++ b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c @@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c index 40712485..e11d0881 100644 --- a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c +++ b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c @@ -188,7 +188,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c index 65ea6d8b..ab29fb45 100644 --- a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c +++ b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c @@ -210,7 +210,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 496a3d91..e594eb8d 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -436,8 +436,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { while (tuples--) { /* Get a pixel */ switch(pnum++ & 1) { - case 0: c1 = (((color_t)p[0]) << 4)|(((color_t)p[1])>>4); break; - case 1: c1 = (((color_t)p[1]&0x0F) << 8)|((color_t)p[1]); p += 3; break; + case 0: c1 = (((gColor)p[0]) << 4)|(((gColor)p[1])>>4); break; + case 1: c1 = (((gColor)p[1]&0x0F) << 8)|((gColor)p[1]); p += 3; break; } /* Check for line or buffer wrapping */ @@ -454,8 +454,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { /* Get the next pixel */ switch(pnum++ & 1) { - case 0: c2 = (((color_t)p[0]) << 4)|(((color_t)p[1])>>4); break; - case 1: c2 = (((color_t)p[1]&0x0F) << 8)|((color_t)p[1]); p += 3; break; + case 0: c2 = (((gColor)p[0]) << 4)|(((gColor)p[1])>>4); break; + case 1: c2 = (((gColor)p[1]&0x0F) << 8)|((gColor)p[1]); p += 3; break; } /* Check for line or buffer wrapping */ diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c index 7f4f2050..cdf7bbe0 100644 --- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c +++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c @@ -155,7 +155,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; switch(g->g.Orientation) { diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c index 0812057f..ee388dcc 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c +++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c @@ -165,7 +165,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; switch(g->g.Orientation) { diff --git a/drivers/gdisp/QImage/gdisp_lld_driver.c b/drivers/gdisp/QImage/gdisp_lld_driver.c index a93d1761..02128bd4 100644 --- a/drivers/gdisp/QImage/gdisp_lld_driver.c +++ b/drivers/gdisp/QImage/gdisp_lld_driver.c @@ -55,7 +55,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) #endif #if GDISP_HARDWARE_PIXELREAD - color_t gdisp_lld_get_pixel_color(GDisplay *g) + gColor gdisp_lld_get_pixel_color(GDisplay *g) { return qimage_getPixel(g); } diff --git a/drivers/gdisp/QImage/gdisp_lld_qimage.cpp b/drivers/gdisp/QImage/gdisp_lld_qimage.cpp index 2d2876f0..f43ba850 100644 --- a/drivers/gdisp/QImage/gdisp_lld_qimage.cpp +++ b/drivers/gdisp/QImage/gdisp_lld_qimage.cpp @@ -27,12 +27,12 @@ void qimage_setPixel(GDisplay* g) qimage->setPixel(g->p.x, g->p.y, rgbVal); } -color_t qimage_getPixel(GDisplay* g) +gColor qimage_getPixel(GDisplay* g) { const QImage* qimage = static_cast(g->priv); if (!qimage) { return 0; } - return static_cast(qimage->pixel(g->p.x, g->p.y)); + return static_cast(qimage->pixel(g->p.x, g->p.y)); } diff --git a/drivers/gdisp/QImage/gdisp_lld_qimage.h b/drivers/gdisp/QImage/gdisp_lld_qimage.h index b8b0d9c9..5e6aea1f 100644 --- a/drivers/gdisp/QImage/gdisp_lld_qimage.h +++ b/drivers/gdisp/QImage/gdisp_lld_qimage.h @@ -9,7 +9,7 @@ extern "C" { gBool qimage_init(GDisplay* g, gCoord width, gCoord height); void qimage_setPixel(GDisplay* g); -color_t qimage_getPixel(GDisplay* g); +gColor qimage_getPixel(GDisplay* g); #ifdef __cplusplus } diff --git a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c index 8b48eee2..36cae0a8 100644 --- a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c +++ b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c @@ -230,7 +230,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c index 42298656..c3ddf13b 100755 --- a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c +++ b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c @@ -274,7 +274,7 @@ LLDSPEC void gdisp_lld_read_start(GDisplay *g) { dummy_read(g); } -LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { +LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index 526426b2..347862e6 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/SSD1289/board_SSD1289_template.h b/drivers/gdisp/SSD1289/board_SSD1289_template.h index 5d9442e9..d255f420 100644 --- a/drivers/gdisp/SSD1289/board_SSD1289_template.h +++ b/drivers/gdisp/SSD1289/board_SSD1289_template.h @@ -65,13 +65,13 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { #if defined(GDISP_USE_DMA) && GDISP_USE_DMA - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; (void) buffer; (void) area; } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; (void) buffer; (void) area; diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index 7a9c4e27..807803a4 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -223,7 +223,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index c91e77a3..c26566ff 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -266,7 +266,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; switch(g->g.Orientation) { diff --git a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c index 9b50f753..caaf01d8 100644 --- a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c +++ b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c @@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; LLDCOLOR_TYPE c; diff --git a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c index 871aa218..6513ba55 100644 --- a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c +++ b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c @@ -170,7 +170,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { setreadmode(g); //dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c index cec6f1df..0fa8c775 100644 --- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c +++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c @@ -434,7 +434,7 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g) #endif #if GDISP_HARDWARE_PIXELREAD -LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g) +LLDSPEC gColor gdisp_lld_get_pixel_color (GDisplay *g) { gCoord x, y; diff --git a/drivers/gdisp/SSD2119/board_SSD2119_template.h b/drivers/gdisp/SSD2119/board_SSD2119_template.h index 5d9442e9..d255f420 100644 --- a/drivers/gdisp/SSD2119/board_SSD2119_template.h +++ b/drivers/gdisp/SSD2119/board_SSD2119_template.h @@ -65,13 +65,13 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { #if defined(GDISP_USE_DMA) && GDISP_USE_DMA - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; (void) buffer; (void) area; } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; (void) buffer; (void) area; diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index c44a262f..7384ef32 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { setreadmode(g); dummy_read(g); } - LLDSPEC color_t gdisp_lld_read_color(GDisplay* g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay* g) { uint16_t data; data = read_data(g); diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index d347c22b..e13cdc35 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -196,7 +196,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; switch(g->g.Orientation) { diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 763c4c29..960da428 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -332,7 +332,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g) { #endif } -LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) { +LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { unsigned pos; LLDCOLOR_TYPE color; diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c index 5d605cd4..60649321 100644 --- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c +++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c @@ -171,7 +171,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; switch(g->g.Orientation) { diff --git a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c index f87b273b..54927ba0 100644 --- a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c +++ b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c @@ -47,7 +47,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - color_t gdisp_lld_get_pixel_color(GDisplay *g) { + gColor gdisp_lld_get_pixel_color(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c index 9da593d6..b3ce6dcc 100644 --- a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c +++ b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c @@ -176,7 +176,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { gCoord x, y; switch(g->g.Orientation) { diff --git a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c index 121787e1..ca0153e7 100644 --- a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c +++ b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c @@ -84,7 +84,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { PIXEL_ADDR(g, pos)[0] = gdispColor2Native(g->p.color); } -LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { +LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { unsigned pos; LLDCOLOR_TYPE color; diff --git a/drivers/multiple/SDL/gdisp_lld_SDL.c b/drivers/multiple/SDL/gdisp_lld_SDL.c index 54830d7f..28dc4f68 100644 --- a/drivers/multiple/SDL/gdisp_lld_SDL.c +++ b/drivers/multiple/SDL/gdisp_lld_SDL.c @@ -425,7 +425,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { if (context) return gdispNative2Color(context->framebuf[(g->p.y*GDISP_SCREEN_WIDTH)+g->p.x]); return 0; diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index 36776d49..4b9a1883 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -1043,7 +1043,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->flags |= GDISP_FLG_WSTREAM; g->flags &= ~GDISP_FLG_WRAPPED; } - LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { winPriv * priv; COLORREF color; @@ -1372,7 +1372,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { winPriv * priv; COLORREF color; diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c index 875b9621..35271a16 100644 --- a/drivers/multiple/X/gdisp_lld_X.c +++ b/drivers/multiple/X/gdisp_lld_X.c @@ -452,7 +452,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { xPriv * priv = (xPriv *)g->priv; XColor color; XImage *img; diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c index ea235668..28a9a778 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c +++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c @@ -574,10 +574,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { netPriv * priv; uint16_t buf[3]; - color_t data; + gColor data; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) diff --git a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp index 42c1df35..4fd26a2f 100644 --- a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp +++ b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp @@ -457,10 +457,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #endif #if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { netPriv * priv; uint16_t buf[3]; - color_t data; + gColor data; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) 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 #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 #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<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 */ -- cgit v1.2.3