Change color_t to gColor

remotes/origin_old/release/v2.9
inmarket 2018-07-08 11:19:43 +10:00
parent cfb1b2a488
commit f9c848e985
81 changed files with 263 additions and 261 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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 | \

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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; }

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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();

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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 */

View File

@ -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) {

View File

@ -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) {

View File

@ -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);
}

View File

@ -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<const QImage*>(g->priv);
if (!qimage) {
return 0;
}
return static_cast<color_t>(qimage->pixel(g->p.x, g->p.y));
return static_cast<gColor>(qimage->pixel(g->p.x, g->p.y));
}

View File

@ -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
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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;

View File

@ -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) {

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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))

View File

@ -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))

View File

@ -792,7 +792,7 @@ void gdispGFlush(GDisplay *g) {
// Don't release the mutex as gdispStreamEnd() will do that.
}
void gdispGStreamColor(GDisplay *g, color_t color) {
void gdispGStreamColor(GDisplay *g, gColor color) {
#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
gCoord sx1, sy1;
#endif
@ -978,7 +978,7 @@ void gdispGFlush(GDisplay *g) {
}
#endif
void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, gColor color) {
MUTEX_ENTER(g);
g->p.x = x;
g->p.y = y;
@ -988,7 +988,7 @@ void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
MUTEX_EXIT(g);
}
void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color) {
void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gColor color) {
MUTEX_ENTER(g);
g->p.x = x0;
g->p.y = y0;
@ -1000,7 +1000,7 @@ void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, col
MUTEX_EXIT(g);
}
void gdispGClear(GDisplay *g, color_t color) {
void gdispGClear(GDisplay *g, gColor color) {
// Note - clear() ignores the clipping area. It clears the screen.
MUTEX_ENTER(g);
@ -1083,7 +1083,7 @@ void gdispGClear(GDisplay *g, color_t color) {
#endif
}
void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) {
MUTEX_ENTER(g);
g->p.x = x;
g->p.y = y;
@ -1271,7 +1271,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_CIRCLE
void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@ -1313,7 +1313,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_CIRCLE
void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@ -1357,7 +1357,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
g->p.x = x+r2+1; g->p.x1 = x+r1; g->p.color = color1; hline_clip(g)
#define DRAW_SINGLELINE(yval, r) g->p.y = yval; g->p.x = x-r; g->p.x1 = x+r; hline_clip(g)
void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2) {
void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, gColor color1, gCoord radius2, gColor color2) {
gCoord a, b1, b2, p1, p2;
MUTEX_ENTER(g);
@ -1426,7 +1426,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ELLIPSE
void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) {
gCoord dx, dy;
int32_t a2, b2;
int32_t err, e2;
@ -1465,7 +1465,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ELLIPSE
void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, gColor color) {
gCoord dx, dy;
int32_t a2, b2;
int32_t err, e2;
@ -1502,7 +1502,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARCSECTORS
void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@ -1546,7 +1546,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARCSECTORS
void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, gColor color) {
gCoord a, b, P;
MUTEX_ENTER(g);
@ -1731,7 +1731,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#include <math.h>
#endif
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) {
gCoord a, b, P, sedge, eedge;
uint8_t full, sbit, ebit, tbit;
@ -1917,7 +1917,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#include <math.h>
#endif
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, color_t color) {
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, gColor color) {
gCoord x, y, d, r;
gCoord startTan, endTan, curangle;
gCoord precision = 512;
@ -2032,7 +2032,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARC
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, gColor color) {
gCoord a, b, P;
gCoord sy, ey;
fixed sxa, sxb, sxd, exa, exb, exd;
@ -2534,7 +2534,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) {
if (2*radius > cx || 2*radius > cy) {
gdispGDrawBox(g, x, y, cx, cy, color);
return;
@ -2559,7 +2559,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, gColor color) {
gCoord radius2;
radius2 = radius*2;
@ -2585,8 +2585,8 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_PIXELREAD
color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
color_t c;
gColor gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
gColor c;
/* Always synchronous as it must return a value */
MUTEX_ENTER(g);
@ -2632,7 +2632,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
#endif
#if GDISP_NEED_SCROLL
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor) {
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, gColor bgcolor) {
gCoord abslines;
#if GDISP_HARDWARE_SCROLL != GFXON
gCoord fy, dy, ix, fx, i, j;
@ -2955,7 +2955,7 @@ void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoor
/* High Level Driver Routines. */
/*===========================================================================*/
void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor color) {
if (cx <= 0 || cy <= 0) return;
cx = x+cx-1; cy = y+cy-1; // cx, cy are now the end point.
@ -2985,7 +2985,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
}
#if GDISP_NEED_CONVEX_POLYGON
void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, gColor color) {
const gPoint *epnt, *p;
epnt = &pntarray[cnt-1];
@ -3001,7 +3001,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_
MUTEX_EXIT(g);
}
void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color<