diff options
author | inmarket <andrewh@inmarket.com.au> | 2018-03-10 20:36:12 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2018-03-10 20:36:12 +1000 |
commit | 94f1cc2f0a4db0c6f1483e6d648068e031bcc094 (patch) | |
tree | 97f50372239108ec9e6e75a3d56e808e479cb7be /demos/modules | |
parent | f265924396167729e8d9fb36a0383263f36c1270 (diff) | |
download | uGFX-94f1cc2f0a4db0c6f1483e6d648068e031bcc094.tar.gz uGFX-94f1cc2f0a4db0c6f1483e6d648068e031bcc094.tar.bz2 uGFX-94f1cc2f0a4db0c6f1483e6d648068e031bcc094.zip |
Change new colors to GFX_RED instead of GFXRED. Use the new color defs
Diffstat (limited to 'demos/modules')
39 files changed, 137 insertions, 137 deletions
diff --git a/demos/modules/gadc/main.c b/demos/modules/gadc/main.c index ae508278..ee54a118 100644 --- a/demos/modules/gadc/main.c +++ b/demos/modules/gadc/main.c @@ -160,8 +160,8 @@ int main(void) { wi.height = sheight; ghText = gwinConsoleCreate(&gTextWindow, &wi); } - gwinSetBgColor(ghText, Black); - gwinSetColor(ghText, Yellow); + gwinSetBgColor(ghText, GFX_BLACK); + gwinSetColor(ghText, GFX_YELLOW); gwinClear(ghText); /* Start our timer for reading the dial */ @@ -195,8 +195,8 @@ int main(void) { wi.height = SCOPE_CY; ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_MIC_DEVICE, MY_MIC_FREQUENCY); } - gwinSetBgColor(ghScope, White); - gwinSetColor(ghScope, Red); + gwinSetBgColor(ghScope, GFX_WHITE); + gwinSetColor(ghScope, GFX_RED); gwinClear(ghScope); /* Just keep displaying the scope traces */ diff --git a/demos/modules/gaudio/oscilloscope/main.c b/demos/modules/gaudio/oscilloscope/main.c index b544016e..335b2cee 100644 --- a/demos/modules/gaudio/oscilloscope/main.c +++ b/demos/modules/gaudio/oscilloscope/main.c @@ -79,8 +79,8 @@ int main(void) { wi.width = swidth; wi.height = sheight; ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_AUDIO_CHANNEL, MY_AUDIO_FREQUENCY, MY_AUDIO_FORMAT); } - gwinSetBgColor(ghScope, White); - gwinSetColor(ghScope, Red); + gwinSetBgColor(ghScope, GFX_WHITE); + gwinSetColor(ghScope, GFX_RED); gwinClear(ghScope); /* Just keep displaying the scope traces */ diff --git a/demos/modules/gaudio/play-vs1053/main.c b/demos/modules/gaudio/play-vs1053/main.c index e0204cba..66ac5f8d 100644 --- a/demos/modules/gaudio/play-vs1053/main.c +++ b/demos/modules/gaudio/play-vs1053/main.c @@ -79,7 +79,7 @@ repeatplay: } // Play the file - gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, Yellow); + gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, GFX_YELLOW); toplay = gfileGetSize(f); while(toplay) { // Get a buffer to put the data into @@ -102,17 +102,17 @@ repeatplay: // Wait for the play to finish gaudioPlayWait(TIME_INFINITE); - gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, Green); + gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, GFX_GREEN); // Repeat the whole thing gfxSleepMilliseconds(1500); - gdispClear(Black); + gdispClear(GFX_BLACK); goto repeatplay; // The end theend: if (errmsg) - gdispDrawString(0, gdispGetHeight()/2, errmsg, font, Red); + gdispDrawString(0, gdispGetHeight()/2, errmsg, font, GFX_RED); while(TRUE) gfxSleepMilliseconds(1000); diff --git a/demos/modules/gaudio/play-wave/main.c b/demos/modules/gaudio/play-wave/main.c index 888e4c8e..af3df7d1 100644 --- a/demos/modules/gaudio/play-wave/main.c +++ b/demos/modules/gaudio/play-wave/main.c @@ -162,7 +162,7 @@ repeatplay: } // Play the file - gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, Yellow); + gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, GFX_YELLOW); while(toplay) { // Get a buffer to put the data into pd = gfxBufferGet(TIME_INFINITE); // This should never fail as we are waiting forever @@ -184,17 +184,17 @@ repeatplay: // Wait for the play to finish gaudioPlayWait(TIME_INFINITE); - gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, Green); + gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, GFX_GREEN); // Repeat the whole thing gfxSleepMilliseconds(1500); - gdispClear(Black); + gdispClear(GFX_BLACK); goto repeatplay; // The end theend: if (errmsg) - gdispDrawString(0, gdispGetHeight()/2, errmsg, font, Red); + gdispDrawString(0, gdispGetHeight()/2, errmsg, font, GFX_RED); while(TRUE) gfxSleepMilliseconds(1000); diff --git a/demos/modules/gdisp/arcsectors/main.c b/demos/modules/gdisp/arcsectors/main.c index 9908523f..7c73201c 100644 --- a/demos/modules/gdisp/arcsectors/main.c +++ b/demos/modules/gdisp/arcsectors/main.c @@ -49,9 +49,9 @@ int main(void) { while(1) { // Draw the arc sectors - gdispClear(White); - gdispDrawArcSectors(cx, cy, r1, sectors, Blue); - gdispFillArcSectors(cx, cy, r2, sectors, Red); + gdispClear(GFX_WHITE); + gdispDrawArcSectors(cx, cy, r1, sectors, GFX_BLUE); + gdispFillArcSectors(cx, cy, r2, sectors, GFX_RED); // Increase the sectors counter sectors++; diff --git a/demos/modules/gdisp/basics/main.c b/demos/modules/gdisp/basics/main.c index 48d4a652..ccf98d22 100644 --- a/demos/modules/gdisp/basics/main.c +++ b/demos/modules/gdisp/basics/main.c @@ -41,12 +41,12 @@ int main(void) { height = gdispGetHeight();
// Code Here
- gdispDrawBox(10, 10, width/2, height/2, Yellow);
- gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue);
- gdispDrawLine(5, 30, width-50, height-40, Red);
+ gdispDrawBox(10, 10, width/2, height/2, GFX_YELLOW);
+ gdispFillArea(width/2, height/2, width/2-10, height/2-10, GFX_BLUE);
+ gdispDrawLine(5, 30, width-50, height-40, GFX_RED);
for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20)
- gdispDrawPixel(i, j, White);
+ gdispDrawPixel(i, j, GFX_WHITE);
while(TRUE) {
gfxSleepMilliseconds(500);
diff --git a/demos/modules/gdisp/circles/main.c b/demos/modules/gdisp/circles/main.c index 9253439d..4efb896a 100644 --- a/demos/modules/gdisp/circles/main.c +++ b/demos/modules/gdisp/circles/main.c @@ -40,12 +40,12 @@ int main(void) { height = gdispGetHeight();
// Code Here
- gdispFillArc(width/2, height/2, width/4, -10, -45, White);
- gdispDrawCircle(width/2+width/8, height/2-height/8, 13, Green);
- gdispFillCircle (width/2+width/8, height/2-height/8, 10, Red);
- gdispDrawArc(width/2+width/8, height/2-height/8, 20, 25, 115, Gray);
- gdispFillEllipse (width-width/6, height-height/6, width/8, height/16, Blue);
- gdispDrawEllipse (width-width/6, height-height/6, width/16, height/8, Yellow);
+ gdispFillArc(width/2, height/2, width/4, -10, -45, GFX_WHITE);
+ gdispDrawCircle(width/2+width/8, height/2-height/8, 13, GFX_GREEN);
+ gdispFillCircle (width/2+width/8, height/2-height/8, 10, GFX_RED);
+ gdispDrawArc(width/2+width/8, height/2-height/8, 20, 25, 115, GFX_GRAY);
+ gdispFillEllipse (width-width/6, height-height/6, width/8, height/16, GFX_BLUE);
+ gdispDrawEllipse (width-width/6, height-height/6, width/16, height/8, GFX_YELLOW);
while(TRUE) {
gfxSleepMilliseconds(500);
diff --git a/demos/modules/gdisp/fonts/main.c b/demos/modules/gdisp/fonts/main.c index b43e32dc..73d7c54e 100644 --- a/demos/modules/gdisp/fonts/main.c +++ b/demos/modules/gdisp/fonts/main.c @@ -60,21 +60,21 @@ int main(void) { line2 = "0123456789~!@#$%^&*_-+=(){}[]<>|/\\:;,.?'\"`"; // Font 1 - gdispFillStringBox(0, y, width, fheight1, line1, font1, Black, White, justifyCenter); + gdispFillStringBox(0, y, width, fheight1, line1, font1, GFX_BLACK, GFX_WHITE, justifyCenter); y += fheight1+1; - gdispFillStringBox(0, y, width, fheight1, line2, font1, Black, White, justifyCenter); + gdispFillStringBox(0, y, width, fheight1, line2, font1, GFX_BLACK, GFX_WHITE, justifyCenter); y += fheight1+1; // Font 2 - gdispFillStringBox(0, y, width, fheight2, line1, font2, Black, White, justifyCenter); + gdispFillStringBox(0, y, width, fheight2, line1, font2, GFX_BLACK, GFX_WHITE, justifyCenter); y += fheight2+1; - gdispFillStringBox(0, y, width, fheight2, line2, font2, Black, White, justifyCenter); + gdispFillStringBox(0, y, width, fheight2, line2, font2, GFX_BLACK, GFX_WHITE, justifyCenter); y += fheight2+1; // Font 1 drawing White on the (black) background - gdispDrawStringBox(0, y, width, fheight1, line1, font1, White, justifyCenter); + gdispDrawStringBox(0, y, width, fheight1, line1, font1, GFX_WHITE, justifyCenter); y += fheight1+1; - gdispDrawStringBox(0, y, width, fheight1, line2, font1, White, justifyCenter); + gdispDrawStringBox(0, y, width, fheight1, line2, font1, GFX_WHITE, justifyCenter); y += fheight1+1; // Show Sizes @@ -85,7 +85,7 @@ int main(void) { buf[4] = (fheight2-2)/10 + '0'; buf[5] = (fheight2-2)%10 + '0'; buf[6] = 0; - gdispFillStringBox(0, y, width, fheight1, buf, font1, Red, White, justifyCenter); + gdispFillStringBox(0, y, width, fheight1, buf, font1, GFX_RED, GFX_WHITE, justifyCenter); // Wait forever while(TRUE) { diff --git a/demos/modules/gdisp/fonts_cyrillic/main.c b/demos/modules/gdisp/fonts_cyrillic/main.c index bd504722..b65801a1 100644 --- a/demos/modules/gdisp/fonts_cyrillic/main.c +++ b/demos/modules/gdisp/fonts_cyrillic/main.c @@ -39,7 +39,7 @@ int main(void) { font1 = gdispOpenFont("Archangelsk Regular 12");
// Demonstrate our other fonts
- gdispDrawString(10, 10, "привет мир", font1, Yellow);
+ gdispDrawString(10, 10, "привет мир", font1, GFX_YELLOW);
// Wait forever
while(TRUE) {
diff --git a/demos/modules/gdisp/images_animated/main.c b/demos/modules/gdisp/images_animated/main.c index 5f24c0fc..a50e593f 100644 --- a/demos/modules/gdisp/images_animated/main.c +++ b/demos/modules/gdisp/images_animated/main.c @@ -85,21 +85,21 @@ int main(void) { gdispImageCache(&myImage); #endif if (gdispImageDraw(&myImage, 0, 0, myImage.width, myImage.height, 0, 0) != GDISP_IMAGE_ERR_OK) { - SHOW_ERROR(Orange); + SHOW_ERROR(GFX_ORANGE); break; } delay = gdispImageNext(&myImage); if (delay == TIME_INFINITE) { - SHOW_ERROR(Green); + SHOW_ERROR(GFX_GREEN); break; } - SHOW_ERROR(Yellow); + SHOW_ERROR(GFX_YELLOW); if (delay != TIME_IMMEDIATE) gfxSleepMilliseconds(delay); } gdispImageClose(&myImage); } else - SHOW_ERROR(Red); + SHOW_ERROR(GFX_RED); while(1) { gfxSleepMilliseconds(1000); diff --git a/demos/modules/gdisp/images_palettes/main.c b/demos/modules/gdisp/images_palettes/main.c index ceb9534f..b9327e52 100644 --- a/demos/modules/gdisp/images_palettes/main.c +++ b/demos/modules/gdisp/images_palettes/main.c @@ -48,7 +48,7 @@ int main(void) // Initialize everything gfxInit(); - gdispClear(Silver); + gdispClear(GFX_SILVER); // Open the image file gdispImageOpenFile(&_imgHome, "icon_home.bmp"); @@ -56,7 +56,7 @@ int main(void) // Retrieve the color palette size and dump it - just for fun. paletteSize = gdispImageGetPaletteSize(&_imgHome); if (paletteSize != 2) { // With this image we expect the palette to have only two entries! - gdispClear(Red); + gdispClear(GFX_RED); while (1); } @@ -64,33 +64,33 @@ int main(void) gdispImageDraw(&_imgHome, 10, 10, gdispGetWidth(), gdispGetHeight(), 0, 0); // Modify the palette & redraw at a different location - gdispImageAdjustPalette(&_imgHome, 0, Blue); - gdispImageAdjustPalette(&_imgHome, 1, Red); + gdispImageAdjustPalette(&_imgHome, 0, GFX_BLUE); + gdispImageAdjustPalette(&_imgHome, 1, GFX_RED); gdispImageDraw(&_imgHome, 10, 60, gdispGetWidth(), gdispGetHeight(), 0, 0); // Modify the palette & redraw at a different location - gdispImageAdjustPalette(&_imgHome, 0, White); - gdispImageAdjustPalette(&_imgHome, 1, Black); + gdispImageAdjustPalette(&_imgHome, 0, GFX_WHITE); + gdispImageAdjustPalette(&_imgHome, 1, GFX_BLACK); gdispImageDraw(&_imgHome, 10, 110, gdispGetWidth(), gdispGetHeight(), 0, 0); // Modify the palette & redraw at a different location - gdispImageAdjustPalette(&_imgHome, 0, Lime); - gdispImageAdjustPalette(&_imgHome, 1, Navy); + gdispImageAdjustPalette(&_imgHome, 0, GFX_LIME); + gdispImageAdjustPalette(&_imgHome, 1, GFX_NAVY); gdispImageDraw(&_imgHome, 10, 160, gdispGetWidth(), gdispGetHeight(), 0, 0); // Modify the palette & redraw at a different location - gdispImageAdjustPalette(&_imgHome, 0, Gray); - gdispImageAdjustPalette(&_imgHome, 1, Yellow); + gdispImageAdjustPalette(&_imgHome, 0, GFX_GRAY); + gdispImageAdjustPalette(&_imgHome, 1, GFX_YELLOW); gdispImageDraw(&_imgHome, 60, 60, gdispGetWidth(), gdispGetHeight(), 0, 0); // Modify the palette & redraw at a different location - gdispImageAdjustPalette(&_imgHome, 0, Green); - gdispImageAdjustPalette(&_imgHome, 1, Black); + gdispImageAdjustPalette(&_imgHome, 0, GFX_GREEN); + gdispImageAdjustPalette(&_imgHome, 1, GFX_BLACK); gdispImageDraw(&_imgHome, 60, 110, gdispGetWidth(), gdispGetHeight(), 0, 0); // Modify the palette & redraw at a different location - gdispImageAdjustPalette(&_imgHome, 0, Lime); - gdispImageAdjustPalette(&_imgHome, 1, Teal); + gdispImageAdjustPalette(&_imgHome, 0, GFX_LIME); + gdispImageAdjustPalette(&_imgHome, 1, GFX_TEAL); gdispImageDraw(&_imgHome, 60, 160, gdispGetWidth(), gdispGetHeight(), 0, 0); // We're done. Clean up. diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c index 8c590f6d..8b38a22a 100644 --- a/demos/modules/gdisp/multiple_displays/main.c +++ b/demos/modules/gdisp/multiple_displays/main.c @@ -71,16 +71,16 @@ /* Draw draw draw */ sprintg(buf, "Display %u", display); if (width < 128) { - gdispGDrawBox(g, 0, 0, width/2, height/2, Yellow); - gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, Black, Blue, justifyCenter); + gdispGDrawBox(g, 0, 0, width/2, height/2, GFX_YELLOW); + gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, justifyCenter); } else { - gdispGDrawBox(g, 10, 10, width/2, height/2, Yellow); - gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); + gdispGDrawBox(g, 10, 10, width/2, height/2, GFX_YELLOW); + gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, GFX_WHITE, GFX_BLUE, justifyCenter); } - gdispGDrawLine(g, 5, 30, width-50, height-40, Red); + gdispGDrawLine(g, 5, 30, width-50, height-40, GFX_RED); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) - gdispGDrawPixel(g, i, j, White); + gdispGDrawPixel(g, i, j, GFX_WHITE); } while(TRUE) { @@ -114,16 +114,16 @@ /* Draw draw draw */ sprintg(buf, "Display %u", display); if (width < 128) { - gdispDrawBox(0, 0, width/2, height/2, Yellow); - gdispFillStringBox(0, height/2, width, height/2, buf, f, Black, Blue, justifyCenter); + gdispDrawBox(0, 0, width/2, height/2, GFX_YELLOW); + gdispFillStringBox(0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, justifyCenter); } else { - gdispDrawBox(10, 10, width/2, height/2, Yellow); - gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); + gdispDrawBox(10, 10, width/2, height/2, GFX_YELLOW); + gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, GFX_WHITE, GFX_BLUE, justifyCenter); } - gdispDrawLine(5, 30, width-50, height-40, Red); + gdispDrawLine(5, 30, width-50, height-40, GFX_RED); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) - gdispDrawPixel(i, j, White); + gdispDrawPixel(i, j, GFX_WHITE); } while(TRUE) { diff --git a/demos/modules/gdisp/pixmap/main.c b/demos/modules/gdisp/pixmap/main.c index c1cb9b55..a6791ec9 100644 --- a/demos/modules/gdisp/pixmap/main.c +++ b/demos/modules/gdisp/pixmap/main.c @@ -59,12 +59,12 @@ int main(void) { surface[j*PIXMAP_WIDTH + i] = RGB2COLOR(0, 255-i*(256/PIXMAP_WIDTH), j*(256/PIXMAP_HEIGHT)); // Secondly, show drawing a line on it like a virtual display - gdispGDrawLine(pixmap, 0, 0, gdispGGetWidth(pixmap)-1, gdispGGetHeight(pixmap)-1, White); + gdispGDrawLine(pixmap, 0, 0, gdispGGetWidth(pixmap)-1, gdispGGetHeight(pixmap)-1, GFX_WHITE); i = j = 0; while(TRUE) { // Clear the old position - gdispFillArea(i, j, PIXMAP_WIDTH, PIXMAP_HEIGHT, Black); + gdispFillArea(i, j, PIXMAP_WIDTH, PIXMAP_HEIGHT, GFX_BLACK); // Change the position i += PIXMAP_WIDTH/2; diff --git a/demos/modules/gdisp/polygons/main.c b/demos/modules/gdisp/polygons/main.c index f71505d9..8a4f7df3 100644 --- a/demos/modules/gdisp/polygons/main.c +++ b/demos/modules/gdisp/polygons/main.c @@ -81,7 +81,7 @@ int main(void) { // Initialize and clear the display gfxInit(); - gdispClear(White); + gdispClear(GFX_WHITE); // Get the screen size width = gdispGetWidth(); @@ -136,16 +136,16 @@ int main(void) { #endif // Clear the old shape - gdispDrawPoly(0, 0, oldresult, NUM_POINTS, White); - gdispFillConvexPoly(0, 0, oldresult, NUM_POINTS, White); + gdispDrawPoly(0, 0, oldresult, NUM_POINTS, GFX_WHITE); + gdispFillConvexPoly(0, 0, oldresult, NUM_POINTS, GFX_WHITE); // Play the new shape position // NOTE: Because our shape is not a true convex polygon, we get some frames // where the line outline and the filled shape don't match. This is // expected due to the shapes non-convex nature and was left in the // demo to demonstrate this exact point. - gdispFillConvexPoly(0, 0, result, NUM_POINTS, Red); - gdispDrawPoly(0, 0, result, NUM_POINTS, Blue); + gdispFillConvexPoly(0, 0, result, NUM_POINTS, GFX_RED); + gdispDrawPoly(0, 0, result, NUM_POINTS, GFX_BLUE); // Make sure the display is updated gdispFlush(); diff --git a/demos/modules/gdisp/streaming/main.c b/demos/modules/gdisp/streaming/main.c index be94608f..a360ecc2 100644 --- a/demos/modules/gdisp/streaming/main.c +++ b/demos/modules/gdisp/streaming/main.c @@ -49,8 +49,8 @@ * #define GMISC_INVSQRT_REAL_SLOW GFXON * in your gfxconf.h file. This should always work although it will probably be slow. */ -#define BALLCOLOR1 Red -#define BALLCOLOR2 Yellow +#define BALLCOLOR1 GFX_RED +#define BALLCOLOR2 GFX_YELLOW #define WALLCOLOR HTML2COLOR(0x303030) #define BACKCOLOR HTML2COLOR(0xC0C0C0) #define FLOORCOLOR HTML2COLOR(0x606060) @@ -110,7 +110,7 @@ int main(void) { // The ball shadow is darker if (g*(g+.4)+h*(h+.1) < 1) - colour = gdispBlendColor(colour, Black, SHADOWALPHA); + colour = gdispBlendColor(colour, GFX_BLACK, SHADOWALPHA); } gdispStreamColor(colour); /* pixel to the LCD */ } diff --git a/demos/modules/gdisp/thickarcs/main.c b/demos/modules/gdisp/thickarcs/main.c index 5ddd38c7..adf42810 100644 --- a/demos/modules/gdisp/thickarcs/main.c +++ b/demos/modules/gdisp/thickarcs/main.c @@ -32,8 +32,8 @@ // This function draws a thick arc and a non-thick arc together static void _drawCombinedArc(int x, int y, int angle1, int angle2) { - gdispDrawThickArc(x, y, 40, 60, angle1, angle2, Red); - gdispDrawArc(x, y, 50, angle1, angle2, White); + gdispDrawThickArc(x, y, 40, 60, angle1, angle2, GFX_RED); + gdispDrawArc(x, y, 50, angle1, angle2, GFX_WHITE); } int main(void) @@ -45,7 +45,7 @@ int main(void) while(TRUE) { // Clear the entire screen - gdispClear(Black); + gdispClear(GFX_BLACK); // Draw some thick arcs with an outline _drawCombinedArc(150, 150, (i / 360) * 15 + 55, 55+i); diff --git a/demos/modules/ginput/keyboard/main.c b/demos/modules/ginput/keyboard/main.c index 32c7652f..dec93125 100644 --- a/demos/modules/ginput/keyboard/main.c +++ b/demos/modules/ginput/keyboard/main.c @@ -59,8 +59,8 @@ int main(void) { GW = gwinConsoleCreate(0, &wi); /* Set the fore- and background colors for the console */ - gwinSetColor(GW, Yellow); - gwinSetBgColor(GW, Black); + gwinSetColor(GW, GFX_YELLOW); + gwinSetBgColor(GW, GFX_BLACK); gwinClear(GW); } diff --git a/demos/modules/gtrans/basic/main.c b/demos/modules/gtrans/basic/main.c index e15b3f6a..77430a46 100644 --- a/demos/modules/gtrans/basic/main.c +++ b/demos/modules/gtrans/basic/main.c @@ -30,8 +30,8 @@ #include <stdio.h> #include "gfx.h" -#define COLOR_BACKGROUND Silver -#define COLOR_TEXT Black +#define COLOR_BACKGROUND GFX_SILVER +#define COLOR_TEXT GFX_BLACK font_t font; diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c index fca150c9..e5b66f17 100644 --- a/demos/modules/gwin/basic/main.c +++ b/demos/modules/gwin/basic/main.c @@ -37,7 +37,7 @@ int main(void) { /* Initialize and clear the display */ gfxInit(); - gdispClear(White); + gdispClear(GFX_WHITE); /* Create two windows */ { @@ -51,10 +51,10 @@ int main(void) { } /* Set fore- and background colors for both windows */ - gwinSetColor(GW1, Black); - gwinSetBgColor(GW1, White); - gwinSetColor(GW2, White); - gwinSetBgColor(GW2, Blue); + gwinSetColor(GW1, GFX_BLACK); + gwinSetBgColor(GW1, GFX_WHITE); + gwinSetColor(GW2, GFX_WHITE); + gwinSetBgColor(GW2, GFX_BLUE); /* Clear both windows - to set background color */ gwinClear(GW1); diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 1d8aa2e6..29a5641f 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -65,7 +65,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); @@ -89,7 +89,7 @@ int main(void) { // GWIN windows. In this case however we know that the button is in the top-left // corner which should translate safely into any orientation. gdispSetOrientation(orients[which]); - gdispClear(White); + gdispClear(GFX_WHITE); gwinRedrawDisplay(GDISP, FALSE); } break; diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index 22963e40..00f3ebdb 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -59,7 +59,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c index 0e9000b5..248aeedf 100644 --- a/demos/modules/gwin/console/main.c +++ b/demos/modules/gwin/console/main.c @@ -62,12 +62,12 @@ int main(void) { gwinSetFont(GW1, font2); /* Set the fore- and background colors for each console */ - gwinSetColor(GW1, Green); - gwinSetBgColor(GW1, Black); - gwinSetColor(GW2, White); - gwinSetBgColor(GW2, Blue); - gwinSetColor(GW3, Black); - gwinSetBgColor(GW3, Red); + gwinSetColor(GW1, GFX_GREEN); + gwinSetBgColor(GW1, GFX_BLACK); + gwinSetColor(GW2, GFX_WHITE); + gwinSetBgColor(GW2, GFX_BLUE); + gwinSetColor(GW3, GFX_BLACK); + gwinSetBgColor(GW3, GFX_RED); /* clear all console windows - to set background */ gwinClear(GW1); diff --git a/demos/modules/gwin/container/main.c b/demos/modules/gwin/container/main.c index 75e3f78b..af2e8b1f 100644 --- a/demos/modules/gwin/container/main.c +++ b/demos/modules/gwin/container/main.c @@ -40,7 +40,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // Create the widget createWidgets(); diff --git a/demos/modules/gwin/container_nested/main.c b/demos/modules/gwin/container_nested/main.c index 5cd5e793..0e5a2634 100644 --- a/demos/modules/gwin/container_nested/main.c +++ b/demos/modules/gwin/container_nested/main.c @@ -118,7 +118,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // Create the widget createWidgets(); diff --git a/demos/modules/gwin/frame/main.c b/demos/modules/gwin/frame/main.c index 6668ddbb..aae4cfac 100644 --- a/demos/modules/gwin/frame/main.c +++ b/demos/modules/gwin/frame/main.c @@ -120,7 +120,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget _createWidgets(); diff --git a/demos/modules/gwin/gl3d-gears/main.c b/demos/modules/gwin/gl3d-gears/main.c index 2bc4ed84..2b450799 100644 --- a/demos/modules/gwin/gl3d-gears/main.c +++ b/demos/modules/gwin/gl3d-gears/main.c @@ -263,7 +263,7 @@ static void init( void ) int main(void) { /* Initialize and clear the display */ gfxInit(); - gdispClear(White); + gdispClear(GFX_WHITE); /* Create the 3D window */ { diff --git a/demos/modules/gwin/gl3d-spin/main.c b/demos/modules/gwin/gl3d-spin/main.c index 2b80994f..4da6b053 100644 --- a/demos/modules/gwin/gl3d-spin/main.c +++ b/demos/modules/gwin/gl3d-spin/main.c @@ -134,7 +134,7 @@ static void spin( void ) int main(void) { /* Initialize and clear the display */ gfxInit(); - gdispClear(White); + gdispClear(GFX_WHITE); /* Create the 3D window */ { diff --git a/demos/modules/gwin/graph/main.c b/demos/modules/gwin/graph/main.c index 23a6a564..2ca4d1a6 100644 --- a/demos/modules/gwin/graph/main.c +++ b/demos/modules/gwin/graph/main.c @@ -41,23 +41,23 @@ static const point data[5] = { // A graph styling static GGraphStyle GraphStyle1 = { - { GGRAPH_POINT_DOT, 0, Blue }, // Point - { GGRAPH_LINE_NONE, 2, Gray }, // Line - { GGRAPH_LINE_SOLID, 0, White }, // X axis - { GGRAPH_LINE_SOLID, 0, White }, // Y axis - { GGRAPH_LINE_DASH, 5, Gray, 50 }, // X grid - { GGRAPH_LINE_DOT, 7, Yellow, 50 }, // Y grid + { GGRAPH_POINT_DOT, 0, GFX_BLUE }, // Point + { GGRAPH_LINE_NONE, 2, GFX_GRAY }, // Line + { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // X axis + { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // Y axis + { GGRAPH_LINE_DASH, 5, GFX_GRAY, 50 }, // X grid + { GGRAPH_LINE_DOT, 7, GFX_YELLOW, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; // Another graph styling static const GGraphStyle GraphStyle2 = { - { GGRAPH_POINT_SQUARE, 5, Red }, // Point - { GGRAPH_LINE_DOT, 2, Pink }, // Line - { GGRAPH_LINE_SOLID, 0, White }, // X axis - { GGRAPH_LINE_SOLID, 0, White }, // Y axis - { GGRAPH_LINE_DASH, 5, Gray, 50 }, // X grid - { GGRAPH_LINE_DOT, 7, Yellow, 50 }, // Y grid + { GGRAPH_POINT_SQUARE, 5, GFX_RED }, // Point + { GGRAPH_LINE_DOT, 2, GFX_PINK }, // Line + { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // X axis + { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // Y axis + { GGRAPH_LINE_DASH, 5, GFX_GRAY, 50 }, // X grid + { GGRAPH_LINE_DOT, 7, GFX_YELLOW, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; @@ -90,7 +90,7 @@ int main(void) { // Modify the style gwinGraphStartSet(gh); - GraphStyle1.point.color = Green; + GraphStyle1.point.color = GFX_GREEN; gwinGraphSetStyle(gh, &GraphStyle1); // Draw a different sine wave diff --git a/demos/modules/gwin/imagebox/main.c b/demos/modules/gwin/imagebox/main.c index 4b864f00..c4f70df2 100644 --- a/demos/modules/gwin/imagebox/main.c +++ b/demos/modules/gwin/imagebox/main.c @@ -53,7 +53,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); diff --git a/demos/modules/gwin/keyboard/main.c b/demos/modules/gwin/keyboard/main.c index 47a10fc0..d81ac6a3 100644 --- a/demos/modules/gwin/keyboard/main.c +++ b/demos/modules/gwin/keyboard/main.c @@ -47,7 +47,7 @@ static void createWidgets(void) { wi.g.x = 0; wi.g.y = 0; wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight()/2; ghConsole = gwinConsoleCreate(0, &wi.g); - gwinSetColor(ghConsole, Black); + gwinSetColor(ghConsole, GFX_BLACK); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); gwinShow(ghConsole); gwinClear(ghConsole); @@ -71,7 +71,7 @@ int main(void) { font = gdispOpenFont("*"); // Get the first defined font. gwinSetDefaultFont(font); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // Create the gwin windows/widgets createWidgets(); diff --git a/demos/modules/gwin/label/main.c b/demos/modules/gwin/label/main.c index 425436ea..f1fb6b92 100644 --- a/demos/modules/gwin/label/main.c +++ b/demos/modules/gwin/label/main.c @@ -61,7 +61,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index 0102f276..22a2074e 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -77,7 +77,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); diff --git a/demos/modules/gwin/progressbar/main.c b/demos/modules/gwin/progressbar/main.c index 8e9e8352..374728cf 100644 --- a/demos/modules/gwin/progressbar/main.c +++ b/demos/modules/gwin/progressbar/main.c @@ -17,7 +17,7 @@ int main(void) { gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); _createWidget(); diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index 59b86983..18c34e4c 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -81,7 +81,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index 66cd7a1b..5e90c554 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -70,12 +70,12 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); - gwinSetColor(ghConsole, Green); - gwinSetBgColor(ghConsole, White); + gwinSetColor(ghConsole, GFX_GREEN); + gwinSetBgColor(ghConsole, GFX_WHITE); gwinClear(ghConsole); // We want to listen for widget events diff --git a/demos/modules/gwin/tabset/main.c b/demos/modules/gwin/tabset/main.c index f70ab909..c4472c39 100644 --- a/demos/modules/gwin/tabset/main.c +++ b/demos/modules/gwin/tabset/main.c @@ -76,7 +76,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // create the widget createWidgets(); diff --git a/demos/modules/gwin/textedit/main.c b/demos/modules/gwin/textedit/main.c index 4072f983..b3fafcf0 100644 --- a/demos/modules/gwin/textedit/main.c +++ b/demos/modules/gwin/textedit/main.c @@ -50,8 +50,8 @@ static void guiCreate(void) wi.g.width = gdispGetWidth()/2; wi.g.height = gdispGetHeight(); ghConsole = gwinConsoleCreate(0, &wi.g); - gwinSetColor(ghConsole, Yellow); - gwinSetBgColor(ghConsole, Black); + gwinSetColor(ghConsole, GFX_YELLOW); + gwinSetBgColor(ghConsole, GFX_BLACK); gwinSetFont(ghConsole, gdispOpenFont("UI2")); gwinClear(ghConsole); @@ -102,11 +102,11 @@ int main(void) { gfxInit(); - gdispClear(Silver); + gdispClear(GFX_SILVER); gwinSetDefaultFont(gdispOpenFont("DejaVuSans16")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gwinSetDefaultColor(Black); - gwinSetDefaultBgColor(White); + gwinSetDefaultColor(GFX_BLACK); + gwinSetDefaultBgColor(GFX_WHITE); geventListenerInit(&gl); geventAttachSource(&gl, ginputGetKeyboard(0), GLISTEN_KEYTRANSITIONS|GLISTEN_KEYUP); diff --git a/demos/modules/gwin/textedit_virtual_keyboard/main.c b/demos/modules/gwin/textedit_virtual_keyboard/main.c index 7b89423f..6bc29a57 100644 --- a/demos/modules/gwin/textedit_virtual_keyboard/main.c +++ b/demos/modules/gwin/textedit_virtual_keyboard/main.c @@ -80,11 +80,11 @@ int main(void) { gfxInit(); - gdispClear(Silver); + gdispClear(GFX_SILVER); gwinSetDefaultFont(gdispOpenFont("DejaVuSans16")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gwinSetDefaultColor(Black); - gwinSetDefaultBgColor(White); + gwinSetDefaultColor(GFX_BLACK); + gwinSetDefaultBgColor(GFX_WHITE); geventListenerInit(&gl); geventAttachSource(&gl, ginputGetKeyboard(0), 0); diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index 8252002b..5f98387e 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -48,7 +48,7 @@ /* Our custom yellow style */ static const GWidgetStyle YellowWidgetStyle = { - Yellow, // window background + GFX_YELLOW, // window background HTML2COLOR(0x800000), // focus // enabled color set @@ -225,7 +225,7 @@ static void createWidgets(void) { wi.g.x = pagewidth; wi.g.width = pagewidth; ghConsole = gwinConsoleCreate(0, &wi.g); - gwinSetColor(ghConsole, Black); + gwinSetColor(ghConsole, GFX_BLACK); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); #else @@ -268,7 +268,7 @@ static void createWidgets(void) { wi.g.x = ScrWidth/2+border; wi.g.width = ScrWidth/2 - 2*border; ghConsole = gwinConsoleCreate(0, &wi.g); - gwinSetColor(ghConsole, Black); + gwinSetColor(ghConsole, GFX_BLACK); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); pagewidth = gwinGetInnerWidth(ghPgButtons); @@ -504,7 +504,7 @@ int main(void) { font = gdispOpenFont("*"); // Get the first defined font. gwinSetDefaultFont(font); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(White); + gdispClear(GFX_WHITE); // Create the gwin windows/widgets createWidgets(); |