Change new colors to GFX_RED instead of GFXRED. Use the new color defs

release/v2.9
inmarket 2018-03-10 20:36:12 +10:00
parent f265924396
commit 94f1cc2f0a
108 changed files with 450 additions and 416 deletions

View File

@ -17,12 +17,12 @@ void setup() {
height = gdispGetHeight(); height = gdispGetHeight();
// Code Here // Code Here
gdispDrawBox(10, 10, width / 2, height / 2, Yellow); gdispDrawBox(10, 10, width / 2, height / 2, GFX_YELLOW);
gdispFillArea(width / 2, height / 2, width / 2 - 10, height / 2 - 10, Blue); gdispFillArea(width / 2, height / 2, width / 2 - 10, height / 2 - 10, GFX_BLUE);
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) for (i = 5, j = 0; i < width && j < height; i += 7, j += i / 20)
gdispDrawPixel(i, j, White); gdispDrawPixel(i, j, GFX_WHITE);
#endif #endif
} }

View File

@ -9,9 +9,11 @@
#define _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H
// Avoid naming collisions with CubeHAL // Avoid naming collisions with CubeHAL
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
// Include CubeHAL // Include CubeHAL
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"

View File

@ -15,9 +15,11 @@
#define _GINPUT_LLD_MOUSE_BOARD_H #define _GINPUT_LLD_MOUSE_BOARD_H
// Avoid naming collisions with CubeHAL // Avoid naming collisions with CubeHAL
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
// Include CubeHAL // Include CubeHAL
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"

View File

@ -78,9 +78,11 @@
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm324x9i_eval_sdram.h" #include "stm324x9i_eval_sdram.h"
/** @addtogroup BSP /** @addtogroup BSP

View File

@ -40,9 +40,11 @@
#ifndef __STM324x9I_EVAL_SDRAM_H #ifndef __STM324x9I_EVAL_SDRAM_H
#define __STM324x9I_EVAL_SDRAM_H #define __STM324x9I_EVAL_SDRAM_H
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -38,9 +38,11 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f4xx_hal_conf.h" #include "stm32f4xx_hal_conf.h"
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"

View File

@ -62,9 +62,11 @@
/** @addtogroup STM32F4xx_System_Private_Includes /** @addtogroup STM32F4xx_System_Private_Includes
* @{ * @{
*/ */
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f4xx.h" #include "stm32f4xx.h"

View File

@ -1,8 +1,10 @@
#include "../../../gfx.h" #include "../../../gfx.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"

View File

@ -9,9 +9,11 @@
#define _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H
/* Avoid naming collisions with CubeHAL. */ /* Avoid naming collisions with CubeHAL. */
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
/* HAL drivers needed for configuration. */ /* HAL drivers needed for configuration. */
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"

View File

@ -1,7 +1,9 @@
#include "../../../gfx.h" #include "../../../gfx.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f4xx.h" #include "stm32f4xx.h"
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"

View File

@ -1,7 +1,9 @@
#include "../../../gfx.h" #include "../../../gfx.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f746g_discovery_sdram.h" #include "stm32f746g_discovery_sdram.h"
#include "stm32f7xx_hal_rcc.h" #include "stm32f7xx_hal_rcc.h"
#include "stm32f7xx_hal_dma.h" #include "stm32f7xx_hal_dma.h"

View File

@ -1,7 +1,9 @@
#include "../../../gfx.h" #include "../../../gfx.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f7xx_hal.h" #include "stm32f7xx_hal.h"
#if GFX_USE_OS_CHIBIOS #if GFX_USE_OS_CHIBIOS

View File

@ -1,7 +1,9 @@
#include "gfx.h" #include "gfx.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#include "stm32f7_i2c.h" #include "stm32f7_i2c.h"
/* /*

View File

@ -13,7 +13,7 @@ FIX: Fixed drawing of 3x3 pixel boxes
FIX: Fixed issue in RTX5/CMSIS2 port which resulted in hanging delays/threads FIX: Fixed issue in RTX5/CMSIS2 port which resulted in hanging delays/threads
FEATURE: Added GFX_COMPAT_V2 to maintain source compatibility with V2.x programs. It is turned on by default. FEATURE: Added GFX_COMPAT_V2 to maintain source compatibility with V2.x programs. It is turned on by default.
FEATURE: Added GFX_COMPAT_OLDCOLORS to allow V2.x Red, Green, Blue color names. It is turned on by default. FEATURE: Added GFX_COMPAT_OLDCOLORS to allow V2.x Red, Green, Blue color names. It is turned on by default.
CHANGE: Added GFXRED, GFXBLUE, GFXGREEN etc to replace V2.x Red, Gree, Blue color names CHANGE: Added GFX_RED, GFX_BLUE, GFX_GREEN etc to replace V2.x Red, Gree, Blue color names
CHANGE: Added GFXON/GFXOFF to replace V2.x TRUE/FALSE for configuration options. CHANGE: Added GFXON/GFXOFF to replace V2.x TRUE/FALSE for configuration options.

View File

@ -38,7 +38,7 @@
const NColorScheme schemeDefault = { const NColorScheme schemeDefault = {
.titleBarColor = HTML2COLOR(0x3064D8), .titleBarColor = HTML2COLOR(0x3064D8),
.titleTextColor = White, .titleTextColor = GFX_WHITE,
.winBgColor = HTML2COLOR(0xFFECB0), .winBgColor = HTML2COLOR(0xFFECB0),
.drawingWinBorder = HTML2COLOR(0xCEBA77), .drawingWinBorder = HTML2COLOR(0xCEBA77),
@ -53,7 +53,7 @@ const NColorScheme schemeDefault = {
const NColorScheme schemeDefault2 = { const NColorScheme schemeDefault2 = {
.titleBarColor = HTML2COLOR(0x3064D8), .titleBarColor = HTML2COLOR(0x3064D8),
.titleTextColor = White, .titleTextColor = GFX_WHITE,
.winBgColor = HTML2COLOR(0xC8D8F8), .winBgColor = HTML2COLOR(0xC8D8F8),
.drawingWinBorder = HTML2COLOR(0x8098E0), .drawingWinBorder = HTML2COLOR(0x8098E0),
@ -91,9 +91,9 @@ int main(void) {
gfxThreadWait(nLaunchNotepadApp()); gfxThreadWait(nLaunchNotepadApp());
gdispSetClip(0, 0, gdispGetWidth(), gdispGetHeight()); gdispSetClip(0, 0, gdispGetWidth(), gdispGetHeight());
gdispClear(Black); gdispClear(GFX_BLACK);
gdispDrawString(3, 3, "Notepad Terminated.", font, White); gdispDrawString(3, 3, "Notepad Terminated.", font, GFX_WHITE);
gdispDrawString(3, 20, "Relaunching Notepad App...", font, White); gdispDrawString(3, 20, "Relaunching Notepad App...", font, GFX_WHITE);
gfxSleepMilliseconds(1000); gfxSleepMilliseconds(1000);
} }

View File

@ -63,9 +63,9 @@ static GButtonObject btnClose;
// Image object // Image object
static gdispImage toolbarImageFilmstrip; static gdispImage toolbarImageFilmstrip;
static color_t myColors[] = { Black, Red, Green, Blue, Cyan, Magenta, Yellow, White }; static color_t myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE };
static color_t selColor = Black; static color_t selColor = GFX_BLACK;
static int selColorIndex = 0, selPenWidth = 1, tbMode = 1; static int selColorIndex = 0, selPenWidth = 1, tbMode = 1;
static NColorScheme nCurColorScheme; static NColorScheme nCurColorScheme;
@ -383,13 +383,13 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) {
0); 0);
gwinSetBgColor(ghc, nCurColorScheme.winBgColor); gwinSetBgColor(ghc, nCurColorScheme.winBgColor);
gwinSetColor(ghc, Black); gwinSetColor(ghc, GFX_BLACK);
gstatusConsole = ghc; gstatusConsole = ghc;
/* draw the buttons */ /* draw the buttons */
gwinSetColor(nDrawingArea, Black); gwinSetColor(nDrawingArea, GFX_BLACK);
gwinSetBgColor(nDrawingArea, White); gwinSetBgColor(nDrawingArea, GFX_WHITE);
gwinClear(nDrawingArea); gwinClear(nDrawingArea);
gwinClear(ghc); gwinClear(ghc);
@ -414,8 +414,8 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) {
selPenWidth = 0; selPenWidth = 0;
ncoreSetMode(NCORE_MODE_DRAW); ncoreSetMode(NCORE_MODE_DRAW);
gwinSetColor(nDrawingArea, Black); gwinSetColor(nDrawingArea, GFX_BLACK);
gwinSetBgColor(nDrawingArea, White); gwinSetBgColor(nDrawingArea, GFX_WHITE);
// Refresh the buttons // Refresh the buttons
drawButtons(); drawButtons();

View File

@ -55,8 +55,8 @@ static gfxThreadHandle thread;
* #define GMISC_INVSQRT_REAL_SLOW GFXON * #define GMISC_INVSQRT_REAL_SLOW GFXON
* in your gfxconf.h file. This should always work although it will probably be slow. * in your gfxconf.h file. This should always work although it will probably be slow.
*/ */
#define BALLCOLOR1 Red #define BALLCOLOR1 GFX_RED
#define BALLCOLOR2 Yellow #define BALLCOLOR2 GFX_YELLOW
#define WALLCOLOR HTML2COLOR(0x303030) #define WALLCOLOR HTML2COLOR(0x303030)
#define BACKCOLOR HTML2COLOR(0xC0C0C0) #define BACKCOLOR HTML2COLOR(0xC0C0C0)
#define FLOORCOLOR HTML2COLOR(0x606060) #define FLOORCOLOR HTML2COLOR(0x606060)
@ -117,7 +117,7 @@ static DECLARE_THREAD_FUNCTION(task, param) {
// The ball shadow is darker // The ball shadow is darker
if (g*(g+.4)+h*(h+.1) < 1) 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 */ gdispStreamColor(colour); /* pixel to the LCD */
} }

View File

@ -41,7 +41,7 @@
/* Our custom yellow style */ /* Our custom yellow style */
static const GWidgetStyle YellowWidgetStyle = { static const GWidgetStyle YellowWidgetStyle = {
Yellow, // window background GFX_YELLOW, // window background
HTML2COLOR(0x800000), // focus - for text edit. HTML2COLOR(0x800000), // focus - for text edit.
// enabled color set // enabled color set
@ -168,7 +168,7 @@ static void createWidgets(void) {
wi.g.x = pagewidth; wi.g.x = pagewidth;
wi.g.width = pagewidth; wi.g.width = pagewidth;
ghConsole = gwinConsoleCreate(0, &wi.g); ghConsole = gwinConsoleCreate(0, &wi.g);
gwinSetColor(ghConsole, Black); gwinSetColor(ghConsole, GFX_BLACK);
gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0));
// Buttons // Buttons
@ -405,7 +405,7 @@ int main(void) {
font = gdispOpenFont("*"); // Get the first defined font. font = gdispOpenFont("*"); // Get the first defined font.
gwinSetDefaultFont(font); gwinSetDefaultFont(font);
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// Create the gwin windows/widgets // Create the gwin windows/widgets
createWidgets(); createWidgets();

View File

@ -49,23 +49,23 @@ void drawScreen(void) {
font1 = gdispOpenFont("DejaVuSans24*"); font1 = gdispOpenFont("DejaVuSans24*");
font2 = gdispOpenFont("DejaVuSans12*"); font2 = gdispOpenFont("DejaVuSans12*");
gdispClear(White); gdispClear(GFX_WHITE);
gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, Black); gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, GFX_BLACK);
/* colors */ /* colors */
gdispFillArea(0 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* Black */ gdispFillArea(0 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_BLACK); /* Black */
gdispFillArea(1 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Red); /* Red */ gdispFillArea(1 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_RED); /* Red */
gdispFillArea(2 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Yellow); /* Yellow */ gdispFillArea(2 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_YELLOW); /* Yellow */
gdispFillArea(3 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Green); /* Green */ gdispFillArea(3 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_GREEN); /* Green */
gdispFillArea(4 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Blue); /* Blue */ gdispFillArea(4 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_BLUE); /* Blue */
gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* White */ gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_WHITE); /* White */
/* pens */ /* pens */
gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, White, Black, justifyCenter); gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, White, Black, justifyCenter); gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, White, Black, justifyCenter); gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, White, Black, justifyCenter); gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, White, Black, justifyCenter); gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispCloseFont(font1); gdispCloseFont(font1);
gdispCloseFont(font2); gdispCloseFont(font2);
@ -74,7 +74,7 @@ void drawScreen(void) {
GEventMouse ev; GEventMouse ev;
int main(void) { int main(void) {
color_t color = Black; color_t color = GFX_BLACK;
uint16_t pen = 0; uint16_t pen = 0;
gfxInit(); gfxInit();
@ -89,12 +89,12 @@ int main(void) {
/* inside color box ? */ /* inside color box ? */
if(ev.y >= OFFSET && ev.y <= COLOR_SIZE) { if(ev.y >= OFFSET && ev.y <= COLOR_SIZE) {
if(GET_COLOR(0)) color = Black; if(GET_COLOR(0)) color = GFX_BLACK;
else if(GET_COLOR(1)) color = Red; else if(GET_COLOR(1)) color = GFX_RED;
else if(GET_COLOR(2)) color = Yellow; else if(GET_COLOR(2)) color = GFX_YELLOW;
else if(GET_COLOR(3)) color = Green; else if(GET_COLOR(3)) color = GFX_GREEN;
else if(GET_COLOR(4)) color = Blue; else if(GET_COLOR(4)) color = GFX_BLUE;
else if(GET_COLOR(5)) color = White; else if(GET_COLOR(5)) color = GFX_WHITE;
/* inside pen box ? */ /* inside pen box ? */
} else if(ev.x >= OFFSET && ev.x <= PEN_SIZE) { } else if(ev.x >= OFFSET && ev.x <= PEN_SIZE) {

View File

@ -98,10 +98,10 @@ void benchmark(void) {
height = gdispGetHeight(); height = gdispGetHeight();
font = gdispOpenFont("UI2 Double"); font = gdispOpenFont("UI2 Double");
gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, White, justifyCenter); gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, GFX_WHITE, justifyCenter);
font = gdispOpenFont("UI2"); font = gdispOpenFont("UI2");
gdispDrawStringBox(0, height/2, width, 30, "5000 random rectangles", font, White, justifyCenter); gdispDrawStringBox(0, height/2, width, 30, "5000 random rectangles", font, GFX_WHITE, justifyCenter);
gfxSleepMilliseconds(3000); gfxSleepMilliseconds(3000);
@ -130,10 +130,10 @@ void benchmark(void) {
strcat(pps_str, " Pixels/s"); strcat(pps_str, " Pixels/s");
font = gdispOpenFont("UI2 Double"); font = gdispOpenFont("UI2 Double");
gdispClear(Black); gdispClear(GFX_BLACK);
gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, White, justifyCenter); gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, GFX_WHITE, justifyCenter);
gdispDrawStringBox(0, height/2, width, 30, pps_str, font, White, justifyCenter); gdispDrawStringBox(0, height/2, width, 30, pps_str, font, GFX_WHITE, justifyCenter);
//gdispDrawString(20, height/2, pps_str, font, White); //gdispDrawString(20, height/2, pps_str, font, GFX_WHITE);
} }
int main(void) { int main(void) {

View File

@ -209,18 +209,18 @@ static bool_t checkForPossibleMove(void) {
} }
static void printGameOver(void) { static void printGameOver(void) {
gdispFillArea(JG10_TOTAL_FIELD_WIDTH, (gdispGetHeight()/2)-10, gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH, 80, Black); gdispFillArea(JG10_TOTAL_FIELD_WIDTH, (gdispGetHeight()/2)-10, gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH, 80, GFX_BLACK);
if (jg10GameOver) { if (jg10GameOver) {
gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth("Game Over", font)/2), gdispGetHeight()/2, "Game Over", font, White); gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth("Game Over", font)/2), gdispGetHeight()/2, "Game Over", font, GFX_WHITE);
} }
} }
static void printCongrats(void) { static void printCongrats(void) {
char pps_str[3]; char pps_str[3];
gdispFillArea(JG10_TOTAL_FIELD_WIDTH, (gdispGetHeight()/2)-10, gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH, 80, Black); gdispFillArea(JG10_TOTAL_FIELD_WIDTH, (gdispGetHeight()/2)-10, gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH, 80, GFX_BLACK);
gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth("Congrats, now try to get", font)/2), gdispGetHeight()/2, "Congrats, now try to get", font, White); gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth("Congrats, now try to get", font)/2), gdispGetHeight()/2, "Congrats, now try to get", font, GFX_WHITE);
uitoa(jg10MaxVal+1, pps_str, sizeof(pps_str)); uitoa(jg10MaxVal+1, pps_str, sizeof(pps_str));
gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth(pps_str, font)/2), (gdispGetHeight()/2)+20, pps_str, font, Red); gdispDrawString(JG10_TOTAL_FIELD_WIDTH+((gdispGetWidth()-JG10_TOTAL_FIELD_WIDTH)/2)-(gdispGetStringWidth(pps_str, font)/2), (gdispGetHeight()/2)+20, pps_str, font, GFX_RED);
} }
static DECLARE_THREAD_FUNCTION(thdJg10, msg) { static DECLARE_THREAD_FUNCTION(thdJg10, msg) {
@ -456,7 +456,7 @@ void guiCreate(void) {
void jg10Start(void) { void jg10Start(void) {
#if JG10_SHOW_SPLASH #if JG10_SHOW_SPLASH
gtimerStop(&jg10SplashBlink); gtimerStop(&jg10SplashBlink);
gdispClear(Black); gdispClear(GFX_BLACK);
#endif #endif
initField(); initField();
guiCreate(); guiCreate();

View File

@ -7,7 +7,7 @@
#define JG10_FIELD_HEIGHT 5 #define JG10_FIELD_HEIGHT 5
#define JG10_TOTAL_FIELD_WIDTH (JG10_FIELD_WIDTH*JG10_CELL_WIDTH) #define JG10_TOTAL_FIELD_WIDTH (JG10_FIELD_WIDTH*JG10_CELL_WIDTH)
#define JG10_TOTAL_FIELD_HEIGHT (JG10_FIELD_HEIGHT*JG10_CELL_HEIGHT) #define JG10_TOTAL_FIELD_HEIGHT (JG10_FIELD_HEIGHT*JG10_CELL_HEIGHT)
#define JG10_SEL_COLOR Yellow #define JG10_SEL_COLOR GFX_YELLOW
#define JG10_MAX_COUNT 21 // Max number you can get +1, so if max number would be 20, then this number should be 21 (+ background) #define JG10_MAX_COUNT 21 // Max number you can get +1, so if max number would be 20, then this number should be 21 (+ background)
void jg10Init(void); void jg10Init(void);

View File

@ -17,7 +17,7 @@ int main(void)
jg10ShowSplash(); jg10ShowSplash();
#else #else
font = gdispOpenFont("DejaVuSans16_aa"); font = gdispOpenFont("DejaVuSans16_aa");
gdispDrawString((gdispGetWidth()/2)-(gdispGetStringWidth("Touch to start!", font)/2), gdispGetHeight()/2, "Touch to start!", font, White); gdispDrawString((gdispGetWidth()/2)-(gdispGetStringWidth("Touch to start!", font)/2), gdispGetHeight()/2, "Touch to start!", font, GFX_WHITE);
gdispCloseFont(font); gdispCloseFont(font);
#endif #endif
@ -30,7 +30,7 @@ int main(void)
#if !JG10_SHOW_SPLASH #if !JG10_SHOW_SPLASH
font = gdispOpenFont("DejaVuSans16"); font = gdispOpenFont("DejaVuSans16");
gdispFillArea((gdispGetWidth()/2)-(gdispGetStringWidth("Touch to start!", font)/2), gdispGetHeight()/2, gdispGetWidth()/2, 17, Black); gdispFillArea((gdispGetWidth()/2)-(gdispGetStringWidth("Touch to start!", font)/2), gdispGetHeight()/2, gdispGetWidth()/2, 17, GFX_BLACK);
gdispCloseFont(font); gdispCloseFont(font);
#endif #endif

View File

@ -51,7 +51,7 @@ int main(void)
minesShowSplash(); minesShowSplash();
#else #else
font = gdispOpenFont("DejaVuSans16"); font = gdispOpenFont("DejaVuSans16");
gdispDrawString((gdispGetWidth()-gdispGetStringWidth("Touch to start!", font))/2, gdispGetHeight()-25, "Touch to start!", font, White); gdispDrawString((gdispGetWidth()-gdispGetStringWidth("Touch to start!", font))/2, gdispGetHeight()-25, "Touch to start!", font, GFX_WHITE);
gdispCloseFont(font); gdispCloseFont(font);
#endif #endif

View File

@ -95,11 +95,11 @@ static void printStats(void)
font_t font = gdispOpenFont("fixed_5x8"); font_t font = gdispOpenFont("fixed_5x8");
uitoa(MINES_MINE_COUNT, pps_str, sizeof(pps_str)); uitoa(MINES_MINE_COUNT, pps_str, sizeof(pps_str));
gdispFillString(minesStatusIconWidth+8, gdispGetHeight()-11, " ", font, Black, Black); gdispFillString(minesStatusIconWidth+8, gdispGetHeight()-11, " ", font, GFX_BLACK, GFX_BLACK);
gdispDrawString(minesStatusIconWidth+8, gdispGetHeight()-11, pps_str, font, White); gdispDrawString(minesStatusIconWidth+8, gdispGetHeight()-11, pps_str, font, GFX_WHITE);
uitoa(minesFlags, pps_str, sizeof(pps_str)); uitoa(minesFlags, pps_str, sizeof(pps_str));
gdispFillString(8+(minesStatusIconWidth*2)+gdispGetStringWidth("99999", font), gdispGetHeight()-11, " ", font, Black, Black); gdispFillString(8+(minesStatusIconWidth*2)+gdispGetStringWidth("99999", font), gdispGetHeight()-11, " ", font, GFX_BLACK, GFX_BLACK);
gdispDrawString(8+(minesStatusIconWidth*2)+gdispGetStringWidth("99999", font), gdispGetHeight()-11, pps_str, font, White); gdispDrawString(8+(minesStatusIconWidth*2)+gdispGetStringWidth("99999", font), gdispGetHeight()-11, pps_str, font, GFX_WHITE);
gdispCloseFont(font); gdispCloseFont(font);
} }
@ -112,8 +112,8 @@ static void minesUpdateTime(void)
font_t font = gdispOpenFont("digital_7__mono_20"); font_t font = gdispOpenFont("digital_7__mono_20");
uitoa(minesTime, pps_str, sizeof(pps_str)); uitoa(minesTime, pps_str, sizeof(pps_str));
gdispFillArea((MINES_FIELD_WIDTH*MINES_CELL_WIDTH)-gdispGetStringWidth("9999", font), gdispGetHeight()-15, gdispGetWidth(), 15, Black); gdispFillArea((MINES_FIELD_WIDTH*MINES_CELL_WIDTH)-gdispGetStringWidth("9999", font), gdispGetHeight()-15, gdispGetWidth(), 15, GFX_BLACK);
gdispDrawString((MINES_FIELD_WIDTH*MINES_CELL_WIDTH)-gdispGetStringWidth(pps_str, font), gdispGetHeight()-15, pps_str, font, Lime); gdispDrawString((MINES_FIELD_WIDTH*MINES_CELL_WIDTH)-gdispGetStringWidth(pps_str, font), gdispGetHeight()-15, pps_str, font, GFX_LIME);
gdispCloseFont(font); gdispCloseFont(font);
} }
@ -141,7 +141,7 @@ static void showOne(int16_t x, int16_t y)
minesFlags--; minesFlags--;
} }
gdispFillArea((x*MINES_CELL_WIDTH)+1, (y*MINES_CELL_HEIGHT)+1, MINES_CELL_WIDTH-1, MINES_CELL_HEIGHT-1, Black); gdispFillArea((x*MINES_CELL_WIDTH)+1, (y*MINES_CELL_HEIGHT)+1, MINES_CELL_WIDTH-1, MINES_CELL_HEIGHT-1, GFX_BLACK);
if ((minesField[x][y].num > 0) && (minesField[x][y].num < 9)) { if ((minesField[x][y].num > 0) && (minesField[x][y].num < 9)) {
gdispImageOpenFile(&minesImage, minesGraph[minesField[x][y].num-1]); gdispImageOpenFile(&minesImage, minesGraph[minesField[x][y].num-1]);
@ -253,13 +253,13 @@ static void printGameOver(void)
if (minesGameOver) { if (minesGameOver) {
font_t font = gdispOpenFont("DejaVuSans16"); font_t font = gdispOpenFont("DejaVuSans16");
if (minesGameWinner) { if (minesGameWinner) {
gdispDrawString((gdispGetWidth()-gdispGetStringWidth("You LIVE!", font))/2, gdispGetHeight()-15, "You LIVE!", font, White); gdispDrawString((gdispGetWidth()-gdispGetStringWidth("You LIVE!", font))/2, gdispGetHeight()-15, "You LIVE!", font, GFX_WHITE);
} else { } else {
gdispDrawString((gdispGetWidth()-gdispGetStringWidth("You DIED!", font))/2, gdispGetHeight()-15, "You DIED!", font, White); gdispDrawString((gdispGetWidth()-gdispGetStringWidth("You DIED!", font))/2, gdispGetHeight()-15, "You DIED!", font, GFX_WHITE);
} }
gdispCloseFont(font); gdispCloseFont(font);
} else { } else {
gdispFillArea(0, gdispGetHeight()-25, gdispGetWidth(), 25, Black); gdispFillArea(0, gdispGetHeight()-25, gdispGetWidth(), 25, GFX_BLACK);
} }
} }
@ -317,7 +317,7 @@ static void initField(void)
for (y = 0; y < MINES_FIELD_HEIGHT; y++) { for (y = 0; y < MINES_FIELD_HEIGHT; y++) {
i = minesField[x][y].fieldNum/MINES_FIELD_HEIGHT; i = minesField[x][y].fieldNum/MINES_FIELD_HEIGHT;
j = minesField[x][y].fieldNum-(i*MINES_FIELD_HEIGHT); j = minesField[x][y].fieldNum-(i*MINES_FIELD_HEIGHT);
gdispFillArea((i*MINES_CELL_WIDTH)+1, (j*MINES_CELL_HEIGHT)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, Black); gdispFillArea((i*MINES_CELL_WIDTH)+1, (j*MINES_CELL_HEIGHT)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, GFX_BLACK);
gfxSleepMilliseconds(2); gfxSleepMilliseconds(2);
} }
} }
@ -378,7 +378,7 @@ void minesStart(void)
#if MINES_SHOW_SPLASH #if MINES_SHOW_SPLASH
gtimerStop(&minesSplashBlink); gtimerStop(&minesSplashBlink);
gdispClear(Black); gdispClear(GFX_BLACK);
#endif #endif
initField(); initField();
@ -442,5 +442,5 @@ void minesInit(void)
{ {
initRng(); initRng();
gdispClear(Black); gdispClear(GFX_BLACK);
} }

View File

@ -63,7 +63,7 @@ E C
D 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 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] = {Black, HTML2COLOR(0x009000), Red, Blue, Magenta, SkyBlue, Orange, HTML2COLOR(0xBBBB00), White}; // shape colors 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
// default tetris shapes // default tetris shapes
const int tetrisShapes[TETRIS_SHAPE_COUNT][4][2] = { const int tetrisShapes[TETRIS_SHAPE_COUNT][4][2] = {
{{4, 17},{4, 16},{5, 16},{4, 15}}, {{4, 17},{4, 16},{5, 16},{4, 15}},
@ -209,16 +209,16 @@ static void tellScore(uint8_t color) {
uitoa(tetrisScore, pps_str, sizeof(pps_str)); uitoa(tetrisScore, pps_str, sizeof(pps_str));
gdispFillArea(0, 0, gdispGetWidth(), gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-6, tetrisShapeColors[0]); gdispFillArea(0, 0, gdispGetWidth(), gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-6, tetrisShapeColors[0]);
for (i = 0; i < strlen(pps_str); i++) { for (i = 0; i < strlen(pps_str); i++) {
if (pps_str[i] == '0') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[0], Lime); if (pps_str[i] == '0') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[0], GFX_LIME);
if (pps_str[i] == '1') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[1], Lime); if (pps_str[i] == '1') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[1], GFX_LIME);
if (pps_str[i] == '2') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[2], Lime); if (pps_str[i] == '2') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[2], GFX_LIME);
if (pps_str[i] == '3') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[3], Lime); if (pps_str[i] == '3') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[3], GFX_LIME);
if (pps_str[i] == '4') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[4], Lime); if (pps_str[i] == '4') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[4], GFX_LIME);
if (pps_str[i] == '5') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[5], Lime); if (pps_str[i] == '5') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[5], GFX_LIME);
if (pps_str[i] == '6') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[6], Lime); if (pps_str[i] == '6') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[6], GFX_LIME);
if (pps_str[i] == '7') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[7], Lime); if (pps_str[i] == '7') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[7], GFX_LIME);
if (pps_str[i] == '8') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[8], Lime); if (pps_str[i] == '8') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[8], GFX_LIME);
if (pps_str[i] == '9') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[9], Lime); if (pps_str[i] == '9') sevenSegDraw(TETRIS_SEVEN_SEG_SCORE_X, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-SEVEN_SEG_CHAR_HEIGHT-7, sevenSegNumbers[9], GFX_LIME);
} }
} }
@ -262,16 +262,16 @@ static void printGameOver(void) {
} }
static void printTouchAreas(void) { static void printTouchAreas(void) {
gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetFontMetric(font16, fontHeight), "Touch Area's", font16, White, justifyCenter); gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetFontMetric(font16, fontHeight), "Touch Area's", font16, GFX_WHITE, justifyCenter);
gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight()/4, "Pause", font16, Grey, justifyCenter); gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight()/4, "Pause", font16, GFX_GRAY, justifyCenter);
gdispDrawStringBox(0, gdispGetHeight()/4, gdispGetWidth(), gdispGetHeight()/2, "Rotate", font16, Grey, justifyCenter); gdispDrawStringBox(0, gdispGetHeight()/4, gdispGetWidth(), gdispGetHeight()/2, "Rotate", font16, GFX_GRAY, justifyCenter);
gdispDrawStringBox(0, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Left", font16, Grey, justifyCenter); gdispDrawStringBox(0, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Left", font16, GFX_GRAY, justifyCenter);
gdispDrawStringBox(gdispGetWidth()/4, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/2, gdispGetHeight()/4, "Down", font16, Grey, justifyCenter); gdispDrawStringBox(gdispGetWidth()/4, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/2, gdispGetHeight()/4, "Down", font16, GFX_GRAY, justifyCenter);
gdispDrawStringBox(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Right", font16, Grey, justifyCenter); gdispDrawStringBox(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Right", font16, GFX_GRAY, justifyCenter);
gdispDrawLine(0, gdispGetHeight()/4, gdispGetWidth()-1, gdispGetHeight()/4, Grey); gdispDrawLine(0, gdispGetHeight()/4, gdispGetWidth()-1, gdispGetHeight()/4, GFX_GRAY);
gdispDrawLine(0, gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-1, gdispGetHeight()-gdispGetHeight()/4, Grey); gdispDrawLine(0, gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-1, gdispGetHeight()-gdispGetHeight()/4, GFX_GRAY);
gdispDrawLine(gdispGetWidth()/4, gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()/4, gdispGetHeight()-1, Grey); gdispDrawLine(gdispGetWidth()/4, gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()/4, gdispGetHeight()-1, GFX_GRAY);
gdispDrawLine(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-1, Grey); gdispDrawLine(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-1, GFX_GRAY);
} }
static bool_t stay(bool_t down) { static bool_t stay(bool_t down) {
@ -484,13 +484,13 @@ static void tetrisDeinit(void) {
void tetrisStart(void) { void tetrisStart(void) {
// Show the help first // Show the help first
gdispClear(Black); gdispClear(GFX_BLACK);
printTouchAreas(); printTouchAreas();
gfxSleepMilliseconds(3000); gfxSleepMilliseconds(3000);
// Draw the board // Draw the board
gdispClear(Black); gdispClear(GFX_BLACK);
gdispDrawBox(0, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-5, (TETRIS_FIELD_WIDTH*TETRIS_CELL_WIDTH)+3, (TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)+3, White); gdispDrawBox(0, gdispGetHeight()-(TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)-5, (TETRIS_FIELD_WIDTH*TETRIS_CELL_WIDTH)+3, (TETRIS_FIELD_HEIGHT*TETRIS_CELL_HEIGHT)+3, GFX_WHITE);
printText(8); printText(8);
// Away we go // Away we go

View File

@ -160,8 +160,8 @@ int main(void) {
wi.height = sheight; wi.height = sheight;
ghText = gwinConsoleCreate(&gTextWindow, &wi); ghText = gwinConsoleCreate(&gTextWindow, &wi);
} }
gwinSetBgColor(ghText, Black); gwinSetBgColor(ghText, GFX_BLACK);
gwinSetColor(ghText, Yellow); gwinSetColor(ghText, GFX_YELLOW);
gwinClear(ghText); gwinClear(ghText);
/* Start our timer for reading the dial */ /* Start our timer for reading the dial */
@ -195,8 +195,8 @@ int main(void) {
wi.height = SCOPE_CY; wi.height = SCOPE_CY;
ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_MIC_DEVICE, MY_MIC_FREQUENCY); ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_MIC_DEVICE, MY_MIC_FREQUENCY);
} }
gwinSetBgColor(ghScope, White); gwinSetBgColor(ghScope, GFX_WHITE);
gwinSetColor(ghScope, Red); gwinSetColor(ghScope, GFX_RED);
gwinClear(ghScope); gwinClear(ghScope);
/* Just keep displaying the scope traces */ /* Just keep displaying the scope traces */

View File

@ -79,8 +79,8 @@ int main(void) {
wi.width = swidth; wi.height = sheight; wi.width = swidth; wi.height = sheight;
ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_AUDIO_CHANNEL, MY_AUDIO_FREQUENCY, MY_AUDIO_FORMAT); ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_AUDIO_CHANNEL, MY_AUDIO_FREQUENCY, MY_AUDIO_FORMAT);
} }
gwinSetBgColor(ghScope, White); gwinSetBgColor(ghScope, GFX_WHITE);
gwinSetColor(ghScope, Red); gwinSetColor(ghScope, GFX_RED);
gwinClear(ghScope); gwinClear(ghScope);
/* Just keep displaying the scope traces */ /* Just keep displaying the scope traces */

View File

@ -79,7 +79,7 @@ repeatplay:
} }
// Play the file // Play the file
gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, Yellow); gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, GFX_YELLOW);
toplay = gfileGetSize(f); toplay = gfileGetSize(f);
while(toplay) { while(toplay) {
// Get a buffer to put the data into // Get a buffer to put the data into
@ -102,17 +102,17 @@ repeatplay:
// Wait for the play to finish // Wait for the play to finish
gaudioPlayWait(TIME_INFINITE); gaudioPlayWait(TIME_INFINITE);
gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, Green); gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, GFX_GREEN);
// Repeat the whole thing // Repeat the whole thing
gfxSleepMilliseconds(1500); gfxSleepMilliseconds(1500);
gdispClear(Black); gdispClear(GFX_BLACK);
goto repeatplay; goto repeatplay;
// The end // The end
theend: theend:
if (errmsg) if (errmsg)
gdispDrawString(0, gdispGetHeight()/2, errmsg, font, Red); gdispDrawString(0, gdispGetHeight()/2, errmsg, font, GFX_RED);
while(TRUE) while(TRUE)
gfxSleepMilliseconds(1000); gfxSleepMilliseconds(1000);

View File

@ -162,7 +162,7 @@ repeatplay:
} }
// Play the file // Play the file
gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, Yellow); gdispDrawString(0, gdispGetHeight()/2, "Playing...", font, GFX_YELLOW);
while(toplay) { while(toplay) {
// Get a buffer to put the data into // Get a buffer to put the data into
pd = gfxBufferGet(TIME_INFINITE); // This should never fail as we are waiting forever pd = gfxBufferGet(TIME_INFINITE); // This should never fail as we are waiting forever
@ -184,17 +184,17 @@ repeatplay:
// Wait for the play to finish // Wait for the play to finish
gaudioPlayWait(TIME_INFINITE); gaudioPlayWait(TIME_INFINITE);
gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, Green); gdispDrawString(0, gdispGetHeight()/2+10, "Done", font, GFX_GREEN);
// Repeat the whole thing // Repeat the whole thing
gfxSleepMilliseconds(1500); gfxSleepMilliseconds(1500);
gdispClear(Black); gdispClear(GFX_BLACK);
goto repeatplay; goto repeatplay;
// The end // The end
theend: theend:
if (errmsg) if (errmsg)
gdispDrawString(0, gdispGetHeight()/2, errmsg, font, Red); gdispDrawString(0, gdispGetHeight()/2, errmsg, font, GFX_RED);
while(TRUE) while(TRUE)
gfxSleepMilliseconds(1000); gfxSleepMilliseconds(1000);

View File

@ -49,9 +49,9 @@ int main(void) {
while(1) { while(1) {
// Draw the arc sectors // Draw the arc sectors
gdispClear(White); gdispClear(GFX_WHITE);
gdispDrawArcSectors(cx, cy, r1, sectors, Blue); gdispDrawArcSectors(cx, cy, r1, sectors, GFX_BLUE);
gdispFillArcSectors(cx, cy, r2, sectors, Red); gdispFillArcSectors(cx, cy, r2, sectors, GFX_RED);
// Increase the sectors counter // Increase the sectors counter
sectors++; sectors++;

View File

@ -41,12 +41,12 @@ int main(void) {
height = gdispGetHeight(); height = gdispGetHeight();
// Code Here // Code Here
gdispDrawBox(10, 10, width/2, height/2, Yellow); gdispDrawBox(10, 10, width/2, height/2, GFX_YELLOW);
gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue); gdispFillArea(width/2, height/2, width/2-10, height/2-10, GFX_BLUE);
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) 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) { while(TRUE) {
gfxSleepMilliseconds(500); gfxSleepMilliseconds(500);

View File

@ -40,12 +40,12 @@ int main(void) {
height = gdispGetHeight(); height = gdispGetHeight();
// Code Here // Code Here
gdispFillArc(width/2, height/2, width/4, -10, -45, White); gdispFillArc(width/2, height/2, width/4, -10, -45, GFX_WHITE);
gdispDrawCircle(width/2+width/8, height/2-height/8, 13, Green); gdispDrawCircle(width/2+width/8, height/2-height/8, 13, GFX_GREEN);
gdispFillCircle (width/2+width/8, height/2-height/8, 10, Red); gdispFillCircle (width/2+width/8, height/2-height/8, 10, GFX_RED);
gdispDrawArc(width/2+width/8, height/2-height/8, 20, 25, 115, Gray); 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, Blue); gdispFillEllipse (width-width/6, height-height/6, width/8, height/16, GFX_BLUE);
gdispDrawEllipse (width-width/6, height-height/6, width/16, height/8, Yellow); gdispDrawEllipse (width-width/6, height-height/6, width/16, height/8, GFX_YELLOW);
while(TRUE) { while(TRUE) {
gfxSleepMilliseconds(500); gfxSleepMilliseconds(500);

View File

@ -60,21 +60,21 @@ int main(void) {
line2 = "0123456789~!@#$%^&*_-+=(){}[]<>|/\\:;,.?'\"`"; line2 = "0123456789~!@#$%^&*_-+=(){}[]<>|/\\:;,.?'\"`";
// Font 1 // 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; 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; y += fheight1+1;
// Font 2 // 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; 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; y += fheight2+1;
// Font 1 drawing White on the (black) background // 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; 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; y += fheight1+1;
// Show Sizes // Show Sizes
@ -85,7 +85,7 @@ int main(void) {
buf[4] = (fheight2-2)/10 + '0'; buf[4] = (fheight2-2)/10 + '0';
buf[5] = (fheight2-2)%10 + '0'; buf[5] = (fheight2-2)%10 + '0';
buf[6] = 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 // Wait forever
while(TRUE) { while(TRUE) {

View File

@ -39,7 +39,7 @@ int main(void) {
font1 = gdispOpenFont("Archangelsk Regular 12"); font1 = gdispOpenFont("Archangelsk Regular 12");
// Demonstrate our other fonts // Demonstrate our other fonts
gdispDrawString(10, 10, "привет мир", font1, Yellow); gdispDrawString(10, 10, "привет мир", font1, GFX_YELLOW);
// Wait forever // Wait forever
while(TRUE) { while(TRUE) {

View File

@ -85,21 +85,21 @@ int main(void) {
gdispImageCache(&myImage); gdispImageCache(&myImage);
#endif #endif
if (gdispImageDraw(&myImage, 0, 0, myImage.width, myImage.height, 0, 0) != GDISP_IMAGE_ERR_OK) { if (gdispImageDraw(&myImage, 0, 0, myImage.width, myImage.height, 0, 0) != GDISP_IMAGE_ERR_OK) {
SHOW_ERROR(Orange); SHOW_ERROR(GFX_ORANGE);
break; break;
} }
delay = gdispImageNext(&myImage); delay = gdispImageNext(&myImage);
if (delay == TIME_INFINITE) { if (delay == TIME_INFINITE) {
SHOW_ERROR(Green); SHOW_ERROR(GFX_GREEN);
break; break;
} }
SHOW_ERROR(Yellow); SHOW_ERROR(GFX_YELLOW);
if (delay != TIME_IMMEDIATE) if (delay != TIME_IMMEDIATE)
gfxSleepMilliseconds(delay); gfxSleepMilliseconds(delay);
} }
gdispImageClose(&myImage); gdispImageClose(&myImage);
} else } else
SHOW_ERROR(Red); SHOW_ERROR(GFX_RED);
while(1) { while(1) {
gfxSleepMilliseconds(1000); gfxSleepMilliseconds(1000);

View File

@ -48,7 +48,7 @@ int main(void)
// Initialize everything // Initialize everything
gfxInit(); gfxInit();
gdispClear(Silver); gdispClear(GFX_SILVER);
// Open the image file // Open the image file
gdispImageOpenFile(&_imgHome, "icon_home.bmp"); gdispImageOpenFile(&_imgHome, "icon_home.bmp");
@ -56,7 +56,7 @@ int main(void)
// Retrieve the color palette size and dump it - just for fun. // Retrieve the color palette size and dump it - just for fun.
paletteSize = gdispImageGetPaletteSize(&_imgHome); paletteSize = gdispImageGetPaletteSize(&_imgHome);
if (paletteSize != 2) { // With this image we expect the palette to have only two entries! if (paletteSize != 2) { // With this image we expect the palette to have only two entries!
gdispClear(Red); gdispClear(GFX_RED);
while (1); while (1);
} }
@ -64,33 +64,33 @@ int main(void)
gdispImageDraw(&_imgHome, 10, 10, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 10, 10, gdispGetWidth(), gdispGetHeight(), 0, 0);
// Modify the palette & redraw at a different location // Modify the palette & redraw at a different location
gdispImageAdjustPalette(&_imgHome, 0, Blue); gdispImageAdjustPalette(&_imgHome, 0, GFX_BLUE);
gdispImageAdjustPalette(&_imgHome, 1, Red); gdispImageAdjustPalette(&_imgHome, 1, GFX_RED);
gdispImageDraw(&_imgHome, 10, 60, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 10, 60, gdispGetWidth(), gdispGetHeight(), 0, 0);
// Modify the palette & redraw at a different location // Modify the palette & redraw at a different location
gdispImageAdjustPalette(&_imgHome, 0, White); gdispImageAdjustPalette(&_imgHome, 0, GFX_WHITE);
gdispImageAdjustPalette(&_imgHome, 1, Black); gdispImageAdjustPalette(&_imgHome, 1, GFX_BLACK);
gdispImageDraw(&_imgHome, 10, 110, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 10, 110, gdispGetWidth(), gdispGetHeight(), 0, 0);
// Modify the palette & redraw at a different location // Modify the palette & redraw at a different location
gdispImageAdjustPalette(&_imgHome, 0, Lime); gdispImageAdjustPalette(&_imgHome, 0, GFX_LIME);
gdispImageAdjustPalette(&_imgHome, 1, Navy); gdispImageAdjustPalette(&_imgHome, 1, GFX_NAVY);
gdispImageDraw(&_imgHome, 10, 160, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 10, 160, gdispGetWidth(), gdispGetHeight(), 0, 0);
// Modify the palette & redraw at a different location // Modify the palette & redraw at a different location
gdispImageAdjustPalette(&_imgHome, 0, Gray); gdispImageAdjustPalette(&_imgHome, 0, GFX_GRAY);
gdispImageAdjustPalette(&_imgHome, 1, Yellow); gdispImageAdjustPalette(&_imgHome, 1, GFX_YELLOW);
gdispImageDraw(&_imgHome, 60, 60, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 60, 60, gdispGetWidth(), gdispGetHeight(), 0, 0);
// Modify the palette & redraw at a different location // Modify the palette & redraw at a different location
gdispImageAdjustPalette(&_imgHome, 0, Green); gdispImageAdjustPalette(&_imgHome, 0, GFX_GREEN);
gdispImageAdjustPalette(&_imgHome, 1, Black); gdispImageAdjustPalette(&_imgHome, 1, GFX_BLACK);
gdispImageDraw(&_imgHome, 60, 110, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 60, 110, gdispGetWidth(), gdispGetHeight(), 0, 0);
// Modify the palette & redraw at a different location // Modify the palette & redraw at a different location
gdispImageAdjustPalette(&_imgHome, 0, Lime); gdispImageAdjustPalette(&_imgHome, 0, GFX_LIME);
gdispImageAdjustPalette(&_imgHome, 1, Teal); gdispImageAdjustPalette(&_imgHome, 1, GFX_TEAL);
gdispImageDraw(&_imgHome, 60, 160, gdispGetWidth(), gdispGetHeight(), 0, 0); gdispImageDraw(&_imgHome, 60, 160, gdispGetWidth(), gdispGetHeight(), 0, 0);
// We're done. Clean up. // We're done. Clean up.

View File

@ -71,16 +71,16 @@
/* Draw draw draw */ /* Draw draw draw */
sprintg(buf, "Display %u", display); sprintg(buf, "Display %u", display);
if (width < 128) { if (width < 128) {
gdispGDrawBox(g, 0, 0, width/2, height/2, Yellow); gdispGDrawBox(g, 0, 0, width/2, height/2, GFX_YELLOW);
gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, Black, Blue, justifyCenter); gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, justifyCenter);
} else { } else {
gdispGDrawBox(g, 10, 10, width/2, height/2, Yellow); gdispGDrawBox(g, 10, 10, width/2, height/2, GFX_YELLOW);
gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); 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) 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) { while(TRUE) {
@ -114,16 +114,16 @@
/* Draw draw draw */ /* Draw draw draw */
sprintg(buf, "Display %u", display); sprintg(buf, "Display %u", display);
if (width < 128) { if (width < 128) {
gdispDrawBox(0, 0, width/2, height/2, Yellow); gdispDrawBox(0, 0, width/2, height/2, GFX_YELLOW);
gdispFillStringBox(0, height/2, width, height/2, buf, f, Black, Blue, justifyCenter); gdispFillStringBox(0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, justifyCenter);
} else { } else {
gdispDrawBox(10, 10, width/2, height/2, Yellow); gdispDrawBox(10, 10, width/2, height/2, GFX_YELLOW);
gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); 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) 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) { while(TRUE) {

View File

@ -59,12 +59,12 @@ int main(void) {
surface[j*PIXMAP_WIDTH + i] = RGB2COLOR(0, 255-i*(256/PIXMAP_WIDTH), j*(256/PIXMAP_HEIGHT)); 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 // 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; i = j = 0;
while(TRUE) { while(TRUE) {
// Clear the old position // Clear the old position
gdispFillArea(i, j, PIXMAP_WIDTH, PIXMAP_HEIGHT, Black); gdispFillArea(i, j, PIXMAP_WIDTH, PIXMAP_HEIGHT, GFX_BLACK);
// Change the position // Change the position
i += PIXMAP_WIDTH/2; i += PIXMAP_WIDTH/2;

View File

@ -81,7 +81,7 @@ int main(void) {
// Initialize and clear the display // Initialize and clear the display
gfxInit(); gfxInit();
gdispClear(White); gdispClear(GFX_WHITE);
// Get the screen size // Get the screen size
width = gdispGetWidth(); width = gdispGetWidth();
@ -136,16 +136,16 @@ int main(void) {
#endif #endif
// Clear the old shape // Clear the old shape
gdispDrawPoly(0, 0, oldresult, NUM_POINTS, White); gdispDrawPoly(0, 0, oldresult, NUM_POINTS, GFX_WHITE);
gdispFillConvexPoly(0, 0, oldresult, NUM_POINTS, White); gdispFillConvexPoly(0, 0, oldresult, NUM_POINTS, GFX_WHITE);
// Play the new shape position // Play the new shape position
// NOTE: Because our shape is not a true convex polygon, we get some frames // 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 // 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 // expected due to the shapes non-convex nature and was left in the
// demo to demonstrate this exact point. // demo to demonstrate this exact point.
gdispFillConvexPoly(0, 0, result, NUM_POINTS, Red); gdispFillConvexPoly(0, 0, result, NUM_POINTS, GFX_RED);
gdispDrawPoly(0, 0, result, NUM_POINTS, Blue); gdispDrawPoly(0, 0, result, NUM_POINTS, GFX_BLUE);
// Make sure the display is updated // Make sure the display is updated
gdispFlush(); gdispFlush();

View File

@ -49,8 +49,8 @@
* #define GMISC_INVSQRT_REAL_SLOW GFXON * #define GMISC_INVSQRT_REAL_SLOW GFXON
* in your gfxconf.h file. This should always work although it will probably be slow. * in your gfxconf.h file. This should always work although it will probably be slow.
*/ */
#define BALLCOLOR1 Red #define BALLCOLOR1 GFX_RED
#define BALLCOLOR2 Yellow #define BALLCOLOR2 GFX_YELLOW
#define WALLCOLOR HTML2COLOR(0x303030) #define WALLCOLOR HTML2COLOR(0x303030)
#define BACKCOLOR HTML2COLOR(0xC0C0C0) #define BACKCOLOR HTML2COLOR(0xC0C0C0)
#define FLOORCOLOR HTML2COLOR(0x606060) #define FLOORCOLOR HTML2COLOR(0x606060)
@ -110,7 +110,7 @@ int main(void) {
// The ball shadow is darker // The ball shadow is darker
if (g*(g+.4)+h*(h+.1) < 1) 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 */ gdispStreamColor(colour); /* pixel to the LCD */
} }

View File

@ -32,8 +32,8 @@
// This function draws a thick arc and a non-thick arc together // This function draws a thick arc and a non-thick arc together
static void _drawCombinedArc(int x, int y, int angle1, int angle2) static void _drawCombinedArc(int x, int y, int angle1, int angle2)
{ {
gdispDrawThickArc(x, y, 40, 60, angle1, angle2, Red); gdispDrawThickArc(x, y, 40, 60, angle1, angle2, GFX_RED);
gdispDrawArc(x, y, 50, angle1, angle2, White); gdispDrawArc(x, y, 50, angle1, angle2, GFX_WHITE);
} }
int main(void) int main(void)
@ -45,7 +45,7 @@ int main(void)
while(TRUE) { while(TRUE) {
// Clear the entire screen // Clear the entire screen
gdispClear(Black); gdispClear(GFX_BLACK);
// Draw some thick arcs with an outline // Draw some thick arcs with an outline
_drawCombinedArc(150, 150, (i / 360) * 15 + 55, 55+i); _drawCombinedArc(150, 150, (i / 360) * 15 + 55, 55+i);

View File

@ -59,8 +59,8 @@ int main(void) {
GW = gwinConsoleCreate(0, &wi); GW = gwinConsoleCreate(0, &wi);
/* Set the fore- and background colors for the console */ /* Set the fore- and background colors for the console */
gwinSetColor(GW, Yellow); gwinSetColor(GW, GFX_YELLOW);
gwinSetBgColor(GW, Black); gwinSetBgColor(GW, GFX_BLACK);
gwinClear(GW); gwinClear(GW);
} }

View File

@ -30,8 +30,8 @@
#include <stdio.h> #include <stdio.h>
#include "gfx.h" #include "gfx.h"
#define COLOR_BACKGROUND Silver #define COLOR_BACKGROUND GFX_SILVER
#define COLOR_TEXT Black #define COLOR_TEXT GFX_BLACK
font_t font; font_t font;

View File

@ -37,7 +37,7 @@ int main(void) {
/* Initialize and clear the display */ /* Initialize and clear the display */
gfxInit(); gfxInit();
gdispClear(White); gdispClear(GFX_WHITE);
/* Create two windows */ /* Create two windows */
{ {
@ -51,10 +51,10 @@ int main(void) {
} }
/* Set fore- and background colors for both windows */ /* Set fore- and background colors for both windows */
gwinSetColor(GW1, Black); gwinSetColor(GW1, GFX_BLACK);
gwinSetBgColor(GW1, White); gwinSetBgColor(GW1, GFX_WHITE);
gwinSetColor(GW2, White); gwinSetColor(GW2, GFX_WHITE);
gwinSetBgColor(GW2, Blue); gwinSetBgColor(GW2, GFX_BLUE);
/* Clear both windows - to set background color */ /* Clear both windows - to set background color */
gwinClear(GW1); gwinClear(GW1);

View File

@ -65,7 +65,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();
@ -89,7 +89,7 @@ int main(void) {
// GWIN windows. In this case however we know that the button is in the top-left // GWIN windows. In this case however we know that the button is in the top-left
// corner which should translate safely into any orientation. // corner which should translate safely into any orientation.
gdispSetOrientation(orients[which]); gdispSetOrientation(orients[which]);
gdispClear(White); gdispClear(GFX_WHITE);
gwinRedrawDisplay(GDISP, FALSE); gwinRedrawDisplay(GDISP, FALSE);
} }
break; break;

View File

@ -59,7 +59,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();

View File

@ -62,12 +62,12 @@ int main(void) {
gwinSetFont(GW1, font2); gwinSetFont(GW1, font2);
/* Set the fore- and background colors for each console */ /* Set the fore- and background colors for each console */
gwinSetColor(GW1, Green); gwinSetColor(GW1, GFX_GREEN);
gwinSetBgColor(GW1, Black); gwinSetBgColor(GW1, GFX_BLACK);
gwinSetColor(GW2, White); gwinSetColor(GW2, GFX_WHITE);
gwinSetBgColor(GW2, Blue); gwinSetBgColor(GW2, GFX_BLUE);
gwinSetColor(GW3, Black); gwinSetColor(GW3, GFX_BLACK);
gwinSetBgColor(GW3, Red); gwinSetBgColor(GW3, GFX_RED);
/* clear all console windows - to set background */ /* clear all console windows - to set background */
gwinClear(GW1); gwinClear(GW1);

View File

@ -40,7 +40,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultFont(gdispOpenFont("*"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// Create the widget // Create the widget
createWidgets(); createWidgets();

View File

@ -118,7 +118,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultFont(gdispOpenFont("*"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// Create the widget // Create the widget
createWidgets(); createWidgets();

View File

@ -120,7 +120,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultFont(gdispOpenFont("*"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
_createWidgets(); _createWidgets();

View File

@ -263,7 +263,7 @@ static void init( void )
int main(void) { int main(void) {
/* Initialize and clear the display */ /* Initialize and clear the display */
gfxInit(); gfxInit();
gdispClear(White); gdispClear(GFX_WHITE);
/* Create the 3D window */ /* Create the 3D window */
{ {

View File

@ -134,7 +134,7 @@ static void spin( void )
int main(void) { int main(void) {
/* Initialize and clear the display */ /* Initialize and clear the display */
gfxInit(); gfxInit();
gdispClear(White); gdispClear(GFX_WHITE);
/* Create the 3D window */ /* Create the 3D window */
{ {

View File

@ -41,23 +41,23 @@ static const point data[5] = {
// A graph styling // A graph styling
static GGraphStyle GraphStyle1 = { static GGraphStyle GraphStyle1 = {
{ GGRAPH_POINT_DOT, 0, Blue }, // Point { GGRAPH_POINT_DOT, 0, GFX_BLUE }, // Point
{ GGRAPH_LINE_NONE, 2, Gray }, // Line { GGRAPH_LINE_NONE, 2, GFX_GRAY }, // Line
{ GGRAPH_LINE_SOLID, 0, White }, // X axis { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // X axis
{ GGRAPH_LINE_SOLID, 0, White }, // Y axis { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // Y axis
{ GGRAPH_LINE_DASH, 5, Gray, 50 }, // X grid { GGRAPH_LINE_DASH, 5, GFX_GRAY, 50 }, // X grid
{ GGRAPH_LINE_DOT, 7, Yellow, 50 }, // Y grid { GGRAPH_LINE_DOT, 7, GFX_YELLOW, 50 }, // Y grid
GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags
}; };
// Another graph styling // Another graph styling
static const GGraphStyle GraphStyle2 = { static const GGraphStyle GraphStyle2 = {
{ GGRAPH_POINT_SQUARE, 5, Red }, // Point { GGRAPH_POINT_SQUARE, 5, GFX_RED }, // Point
{ GGRAPH_LINE_DOT, 2, Pink }, // Line { GGRAPH_LINE_DOT, 2, GFX_PINK }, // Line
{ GGRAPH_LINE_SOLID, 0, White }, // X axis { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // X axis
{ GGRAPH_LINE_SOLID, 0, White }, // Y axis { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // Y axis
{ GGRAPH_LINE_DASH, 5, Gray, 50 }, // X grid { GGRAPH_LINE_DASH, 5, GFX_GRAY, 50 }, // X grid
{ GGRAPH_LINE_DOT, 7, Yellow, 50 }, // Y grid { GGRAPH_LINE_DOT, 7, GFX_YELLOW, 50 }, // Y grid
GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags
}; };
@ -90,7 +90,7 @@ int main(void) {
// Modify the style // Modify the style
gwinGraphStartSet(gh); gwinGraphStartSet(gh);
GraphStyle1.point.color = Green; GraphStyle1.point.color = GFX_GREEN;
gwinGraphSetStyle(gh, &GraphStyle1); gwinGraphSetStyle(gh, &GraphStyle1);
// Draw a different sine wave // Draw a different sine wave

View File

@ -53,7 +53,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();

View File

@ -47,7 +47,7 @@ static void createWidgets(void) {
wi.g.x = 0; wi.g.y = 0; wi.g.x = 0; wi.g.y = 0;
wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight()/2; wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight()/2;
ghConsole = gwinConsoleCreate(0, &wi.g); ghConsole = gwinConsoleCreate(0, &wi.g);
gwinSetColor(ghConsole, Black); gwinSetColor(ghConsole, GFX_BLACK);
gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0));
gwinShow(ghConsole); gwinShow(ghConsole);
gwinClear(ghConsole); gwinClear(ghConsole);
@ -71,7 +71,7 @@ int main(void) {
font = gdispOpenFont("*"); // Get the first defined font. font = gdispOpenFont("*"); // Get the first defined font.
gwinSetDefaultFont(font); gwinSetDefaultFont(font);
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// Create the gwin windows/widgets // Create the gwin windows/widgets
createWidgets(); createWidgets();

View File

@ -61,7 +61,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultFont(gdispOpenFont("*"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();

View File

@ -77,7 +77,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();

View File

@ -17,7 +17,7 @@ int main(void) {
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
_createWidget(); _createWidget();

View File

@ -81,7 +81,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();

View File

@ -70,12 +70,12 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();
gwinSetColor(ghConsole, Green); gwinSetColor(ghConsole, GFX_GREEN);
gwinSetBgColor(ghConsole, White); gwinSetBgColor(ghConsole, GFX_WHITE);
gwinClear(ghConsole); gwinClear(ghConsole);
// We want to listen for widget events // We want to listen for widget events

View File

@ -76,7 +76,7 @@ int main(void) {
// Set the widget defaults // Set the widget defaults
gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultFont(gdispOpenFont("UI2"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// create the widget // create the widget
createWidgets(); createWidgets();

View File

@ -50,8 +50,8 @@ static void guiCreate(void)
wi.g.width = gdispGetWidth()/2; wi.g.width = gdispGetWidth()/2;
wi.g.height = gdispGetHeight(); wi.g.height = gdispGetHeight();
ghConsole = gwinConsoleCreate(0, &wi.g); ghConsole = gwinConsoleCreate(0, &wi.g);
gwinSetColor(ghConsole, Yellow); gwinSetColor(ghConsole, GFX_YELLOW);
gwinSetBgColor(ghConsole, Black); gwinSetBgColor(ghConsole, GFX_BLACK);
gwinSetFont(ghConsole, gdispOpenFont("UI2")); gwinSetFont(ghConsole, gdispOpenFont("UI2"));
gwinClear(ghConsole); gwinClear(ghConsole);
@ -102,11 +102,11 @@ int main(void) {
gfxInit(); gfxInit();
gdispClear(Silver); gdispClear(GFX_SILVER);
gwinSetDefaultFont(gdispOpenFont("DejaVuSans16")); gwinSetDefaultFont(gdispOpenFont("DejaVuSans16"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gwinSetDefaultColor(Black); gwinSetDefaultColor(GFX_BLACK);
gwinSetDefaultBgColor(White); gwinSetDefaultBgColor(GFX_WHITE);
geventListenerInit(&gl); geventListenerInit(&gl);
geventAttachSource(&gl, ginputGetKeyboard(0), GLISTEN_KEYTRANSITIONS|GLISTEN_KEYUP); geventAttachSource(&gl, ginputGetKeyboard(0), GLISTEN_KEYTRANSITIONS|GLISTEN_KEYUP);

View File

@ -80,11 +80,11 @@ int main(void)
{ {
gfxInit(); gfxInit();
gdispClear(Silver); gdispClear(GFX_SILVER);
gwinSetDefaultFont(gdispOpenFont("DejaVuSans16")); gwinSetDefaultFont(gdispOpenFont("DejaVuSans16"));
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gwinSetDefaultColor(Black); gwinSetDefaultColor(GFX_BLACK);
gwinSetDefaultBgColor(White); gwinSetDefaultBgColor(GFX_WHITE);
geventListenerInit(&gl); geventListenerInit(&gl);
geventAttachSource(&gl, ginputGetKeyboard(0), 0); geventAttachSource(&gl, ginputGetKeyboard(0), 0);

View File

@ -48,7 +48,7 @@
/* Our custom yellow style */ /* Our custom yellow style */
static const GWidgetStyle YellowWidgetStyle = { static const GWidgetStyle YellowWidgetStyle = {
Yellow, // window background GFX_YELLOW, // window background
HTML2COLOR(0x800000), // focus HTML2COLOR(0x800000), // focus
// enabled color set // enabled color set
@ -225,7 +225,7 @@ static void createWidgets(void) {
wi.g.x = pagewidth; wi.g.x = pagewidth;
wi.g.width = pagewidth; wi.g.width = pagewidth;
ghConsole = gwinConsoleCreate(0, &wi.g); ghConsole = gwinConsoleCreate(0, &wi.g);
gwinSetColor(ghConsole, Black); gwinSetColor(ghConsole, GFX_BLACK);
gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0));
#else #else
@ -268,7 +268,7 @@ static void createWidgets(void) {
wi.g.x = ScrWidth/2+border; wi.g.x = ScrWidth/2+border;
wi.g.width = ScrWidth/2 - 2*border; wi.g.width = ScrWidth/2 - 2*border;
ghConsole = gwinConsoleCreate(0, &wi.g); ghConsole = gwinConsoleCreate(0, &wi.g);
gwinSetColor(ghConsole, Black); gwinSetColor(ghConsole, GFX_BLACK);
gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0));
pagewidth = gwinGetInnerWidth(ghPgButtons); pagewidth = gwinGetInnerWidth(ghPgButtons);
@ -504,7 +504,7 @@ int main(void) {
font = gdispOpenFont("*"); // Get the first defined font. font = gdispOpenFont("*"); // Get the first defined font.
gwinSetDefaultFont(font); gwinSetDefaultFont(font);
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
gdispClear(White); gdispClear(GFX_WHITE);
// Create the gwin windows/widgets // Create the gwin windows/widgets
createWidgets(); createWidgets();

View File

@ -56,7 +56,7 @@ int main(void) {
font = gdispOpenFont("UI2"); font = gdispOpenFont("UI2");
gwinSetDefaultFont(font); gwinSetDefaultFont(font);
bHeight = gdispGetFontMetric(font, fontHeight)+4; bHeight = gdispGetFontMetric(font, fontHeight)+4;
gdispFillStringBox(0, 0, swidth, bHeight, "Touchscreen Calibration Grabber", font, Red, White, justifyCenter); gdispFillStringBox(0, 0, swidth, bHeight, "Touchscreen Calibration Grabber", font, GFX_RED, GFX_WHITE, justifyCenter);
// Create our main display writing window // Create our main display writing window
{ {

View File

@ -46,19 +46,19 @@ static void DrawHeader(const char *title, bool_t btnNext, bool_t btnPrev, bool_t
#if GDISP_NEED_CLIP #if GDISP_NEED_CLIP
gdispSetClip(0, 0, swidth, sheight); gdispSetClip(0, 0, swidth, sheight);
#endif #endif
gdispFillStringBox(0, 0, swidth, bHeight, "Touch Calibration", font, Red, White, justifyLeft); gdispFillStringBox(0, 0, swidth, bHeight, "Touch Calibration", font, GFX_RED, GFX_WHITE, justifyLeft);
if (btnNext) if (btnNext)
gdispFillStringBox(swidth-1*bWidth, 0, bWidth , bHeight, "Next", font, Black, Gray, justifyCenter); gdispFillStringBox(swidth-1*bWidth, 0, bWidth , bHeight, "Next", font, GFX_BLACK, GFX_GRAY, justifyCenter);
if (btnPrev) if (btnPrev)
gdispFillStringBox(swidth-2*bWidth, 0, bWidth-1, bHeight, "Prev", font, Black, Gray, justifyCenter); gdispFillStringBox(swidth-2*bWidth, 0, bWidth-1, bHeight, "Prev", font, GFX_BLACK, GFX_GRAY, justifyCenter);
if (btnPlusMinus) { if (btnPlusMinus) {
gdispFillStringBox(swidth-2*bWidth-1*bWidth2, 0, bWidth2-1, bHeight, "+", font, Black, Gray, justifyCenter); gdispFillStringBox(swidth-2*bWidth-1*bWidth2, 0, bWidth2-1, bHeight, "+", font, GFX_BLACK, GFX_GRAY, justifyCenter);
gdispFillStringBox(swidth-2*bWidth-2*bWidth2, 0, bWidth2-1, bHeight, "-", font, Black, Gray, justifyCenter); gdispFillStringBox(swidth-2*bWidth-2*bWidth2, 0, bWidth2-1, bHeight, "-", font, GFX_BLACK, GFX_GRAY, justifyCenter);
} }
gwinClear(ghc); gwinClear(ghc);
gwinSetColor(ghc, Yellow); gwinSetColor(ghc, GFX_YELLOW);
gwinPrintf(ghc, "\n%s\n\n", title); gwinPrintf(ghc, "\n%s\n\n", title);
gwinSetColor(ghc, White); gwinSetColor(ghc, GFX_WHITE);
} }
#define BTN_NONE 0 #define BTN_NONE 0
@ -385,10 +385,10 @@ StepMovementJitter:
StepClickJitter: StepClickJitter:
gwinClear(ghc); gwinClear(ghc);
gwinSetColor(ghc, Yellow); gwinSetColor(ghc, GFX_YELLOW);
gwinPrintf(ghc, "\n6. Click Jitter\n\n"); gwinPrintf(ghc, "\n6. Click Jitter\n\n");
gwinSetColor(ghc, White); gwinSetColor(ghc, GFX_WHITE);
if (isTouch) if (isTouch)
gwinPrintf(ghc, "Press and release the touch surface to \"click\".\nTry both short and long presses.\n"); gwinPrintf(ghc, "Press and release the touch surface to \"click\".\nTry both short and long presses.\n");
else else
@ -416,11 +416,11 @@ StepClickJitter:
continue; continue;
default: default:
if ((pem->buttons & GMETA_MOUSE_CLICK)) { if ((pem->buttons & GMETA_MOUSE_CLICK)) {
gwinSetColor(ghc, Yellow); gwinSetColor(ghc, GFX_YELLOW);
gwinPrintf(ghc, "-"); gwinPrintf(ghc, "-");
} }
if ((pem->buttons & GMETA_MOUSE_CXTCLICK)) { if ((pem->buttons & GMETA_MOUSE_CXTCLICK)) {
gwinSetColor(ghc, Red); gwinSetColor(ghc, GFX_RED);
gwinPrintf(ghc, "x"); gwinPrintf(ghc, "x");
} }
continue; continue;
@ -434,10 +434,10 @@ StepClickJitter:
StepDrawing: StepDrawing:
gwinClear(ghc); gwinClear(ghc);
gwinSetColor(ghc, Yellow); gwinSetColor(ghc, GFX_YELLOW);
gwinPrintf(ghc, "\n7. Drawing\n\n"); gwinPrintf(ghc, "\n7. Drawing\n\n");
gwinSetColor(ghc, White); gwinSetColor(ghc, GFX_WHITE);
gwinPrintf(ghc, "Press firmly on the surface (or press and hold the mouse button) and move around as if to draw.\n\n"); gwinPrintf(ghc, "Press firmly on the surface (or press and hold the mouse button) and move around as if to draw.\n\n");
gwinPrintf(ghc, "A green line will follow your %s.\n\n", deviceText); gwinPrintf(ghc, "A green line will follow your %s.\n\n", deviceText);
gwinPrintf(ghc, "Pressing Next will start the tests again but with the option of changing pen/finger mode.\n\n"); gwinPrintf(ghc, "Pressing Next will start the tests again but with the option of changing pen/finger mode.\n\n");
@ -452,7 +452,7 @@ StepDrawing:
goto StepClickJitter; goto StepClickJitter;
} }
} }
gdispDrawPixel(pem->x, pem->y, Green); gdispDrawPixel(pem->x, pem->y, GFX_GREEN);
} }
// Can't let this really exit // Can't let this really exit

View File

@ -61,7 +61,7 @@ int main(void) {
font = gdispOpenFont("UI2"); font = gdispOpenFont("UI2");
gwinSetDefaultFont(font); gwinSetDefaultFont(font);
bHeight = gdispGetFontMetric(font, fontHeight)+4; bHeight = gdispGetFontMetric(font, fontHeight)+4;
gdispFillStringBox(0, 0, swidth, bHeight, "Raw Touch Readings", font, Red, White, justifyCenter); gdispFillStringBox(0, 0, swidth, bHeight, "Raw Touch Readings", font, GFX_RED, GFX_WHITE, justifyCenter);
// Create our main display writing window // Create our main display writing window
{ {

View File

@ -336,12 +336,12 @@ int main(proto_args) {
font = gdispOpenFont("UI2"); font = gdispOpenFont("UI2");
// Open the connection // Open the connection
gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight(), "Connecting to host...", font, White, justifyCenter); gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight(), "Connecting to host...", font, GFX_WHITE, justifyCenter);
StartSockets(); StartSockets();
netfd = doConnect(cmd_args); netfd = doConnect(cmd_args);
if (netfd == (SOCKET_TYPE)-1) if (netfd == (SOCKET_TYPE)-1)
gfxHalt("Could not connect to the specified server"); gfxHalt("Could not connect to the specified server");
gdispClear(Black); gdispClear(GFX_BLACK);
// Get the initial packet from the host // Get the initial packet from the host
if (!getpkt(cmd, 2)) goto alldone; if (!getpkt(cmd, 2)) goto alldone;
@ -395,7 +395,7 @@ int main(proto_args) {
#if GDISP_NEED_SCROLL #if GDISP_NEED_SCROLL
case GNETCODE_SCROLL: case GNETCODE_SCROLL:
if (!getpkt(cmd, 5)) goto alldone; // cmd[] = x, y, cx, cy, lines if (!getpkt(cmd, 5)) goto alldone; // cmd[] = x, y, cx, cy, lines
gdispVerticalScroll(cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], Black); gdispVerticalScroll(cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], GFX_BLACK);
break; break;
#endif #endif
case GNETCODE_CONTROL: case GNETCODE_CONTROL:

View File

@ -15,9 +15,11 @@
/* Include the driver defines */ /* Include the driver defines */
#include "../../../src/gaudio/gaudio_driver_play.h" #include "../../../src/gaudio/gaudio_driver_play.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>

View File

@ -15,9 +15,11 @@
/* Include the driver defines */ /* Include the driver defines */
#include "../../../src/gaudio/gaudio_driver_record.h" #include "../../../src/gaudio/gaudio_driver_record.h"
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>

View File

@ -520,7 +520,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
bitpos = (6 - 2 * (dx % EINK_PPB)); bitpos = (6 - 2 * (dx % EINK_PPB));
byte = block->data[dy][dx / EINK_PPB]; byte = block->data[dy][dx / EINK_PPB];
byte &= ~(PIXELMASK << bitpos); byte &= ~(PIXELMASK << bitpos);
if (gdispColor2Native(g->p.color) != Black) if (gdispColor2Native(g->p.color) != GFX_BLACK)
byte |= PIXEL_WHITE << bitpos; byte |= PIXEL_WHITE << bitpos;
else else
byte |= PIXEL_BLACK << bitpos; byte |= PIXEL_BLACK << bitpos;

View File

@ -159,7 +159,7 @@ LLDSPEC void gdisp_lld_write_color(GDisplay *g) {
uint16_t data; uint16_t data;
data = (g->p.x >> 6) << 8; // Set the chip data = (g->p.x >> 6) << 8; // Set the chip
if (g->p.color != White) if (g->p.color != GFX_WHITE)
data |= 0x01; // set dot data |= 0x01; // set dot
write_data(g, data); write_data(g, data);
} }
@ -206,7 +206,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
uint8_t data, j; uint8_t data, j;
set_viewport(g); set_viewport(g);
if (g->p.color != White) { if (g->p.color != GFX_WHITE) {
data = 0xFF; // set dot data = 0xFF; // set dot
} }
else { else {

View File

@ -144,7 +144,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.y; y = g->p.y;
#endif #endif
if (g->p.color != Black) { if (g->p.color != GFX_BLACK) {
RAM(g)[xyaddr(x, y)] |= xybit(y); RAM(g)[xyaddr(x, y)] |= xybit(y);
} else { } else {
RAM(g)[xyaddr(x, y)] &= ~xybit(y); RAM(g)[xyaddr(x, y)] &= ~xybit(y);
@ -177,7 +177,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -154,7 +154,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.y; y = g->p.y;
#endif #endif
if (gdispColor2Native(g->p.color) != Black) { if (gdispColor2Native(g->p.color) != GFX_BLACK) {
RAM(g)[xyaddr(x, y)] |= xybit(y); RAM(g)[xyaddr(x, y)] |= xybit(y);
} else { } else {
RAM(g)[xyaddr(x, y)] &= ~xybit(y); RAM(g)[xyaddr(x, y)] &= ~xybit(y);
@ -187,7 +187,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -234,7 +234,7 @@ LLDSPEC void gdisp_lld_write_color(GDisplay *g) {
temp = RAM(g)[POS]; temp = RAM(g)[POS];
#endif #endif
if (g->p.color != White) { if (g->p.color != GFX_WHITE) {
temp |= (1 << (RA6963_FONT_WIDTH - 1 - ((g->p.x) % RA6963_FONT_WIDTH))); temp |= (1 << (RA6963_FONT_WIDTH - 1 - ((g->p.x) % RA6963_FONT_WIDTH)));
} }
else { else {
@ -292,7 +292,7 @@ LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
uint8_t data, j; uint8_t data, j;
set_viewport(g); set_viewport(g);
if (g->p.color != White) { if (g->p.color != GFX_WHITE) {
data = 0xFF; // set dot data = 0xFF; // set dot
} }
else { else {

View File

@ -209,7 +209,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
mask = 0xff << (sy&7); mask = 0xff << (sy&7);
zpages = (ey / 8) - spage; zpages = (ey / 8) - spage;
if (gdispColor2Native(g->p.color) == gdispColor2Native(Black)) { if (gdispColor2Native(g->p.color) == gdispColor2Native(GFX_BLACK)) {
while (zpages--) { while (zpages--) {
for (col = sx; col <= ex; col++) for (col = sx; col <= ex; col++)
base[col] &= ~mask; base[col] &= ~mask;
@ -257,7 +257,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
if (gdispColor2Native(g->p.color) != gdispColor2Native(Black)) if (gdispColor2Native(g->p.color) != gdispColor2Native(GFX_BLACK))
RAM(g)[xyaddr(x, y)] |= xybit(y); RAM(g)[xyaddr(x, y)] |= xybit(y);
else else
RAM(g)[xyaddr(x, y)] &= ~xybit(y); RAM(g)[xyaddr(x, y)] &= ~xybit(y);
@ -288,7 +288,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -161,7 +161,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
acquire_bus(g); acquire_bus(g);
if (g->p.color == Black) { if (g->p.color == GFX_BLACK) {
// Use clear window command // Use clear window command
write_cmd(g, SSD1331_DRAW_CLEAR); write_cmd(g, SSD1331_DRAW_CLEAR);
write_cmd(g, g->p.x); write_cmd(g, g->p.x);

View File

@ -425,7 +425,7 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
y = g->p.x; y = g->p.x;
break; break;
} }
if (gdispColor2Native (g->p.color) != gdispColor2Native (Black)) if (gdispColor2Native (g->p.color) != gdispColor2Native (GFX_BLACK))
RAM (g)[xyaddr (x, y)] |= xybit (y); RAM (g)[xyaddr (x, y)] |= xybit (y);
else else
RAM (g)[xyaddr (x, y)] &= ~xybit(y); RAM (g)[xyaddr (x, y)] &= ~xybit(y);
@ -461,7 +461,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g)
y = g->p.x; y = g->p.x;
break; break;
} }
return (RAM (g)[xyaddr (x, y)] & xybit (y)) ? White : Black; return (RAM (g)[xyaddr (x, y)] & xybit (y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -187,7 +187,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
if (gdispColor2Native(g->p.color) != Black) if (gdispColor2Native(g->p.color) != GFX_BLACK)
RAM(g)[xyaddr(x, y)] |= xybit(y); RAM(g)[xyaddr(x, y)] |= xybit(y);
else else
RAM(g)[xyaddr(x, y)] &= ~xybit(y); RAM(g)[xyaddr(x, y)] &= ~xybit(y);
@ -218,7 +218,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
x = g->p.x; x = g->p.x;
break; break;
} }
return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -160,7 +160,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.y; y = g->p.y;
#endif #endif
if (g->p.color != Black) { if (g->p.color != GFX_BLACK) {
RAM(g)[xyaddr(x, y)] |= xybit(y); RAM(g)[xyaddr(x, y)] |= xybit(y);
} else { } else {
RAM(g)[xyaddr(x, y)] &= ~xybit(y); RAM(g)[xyaddr(x, y)] &= ~xybit(y);
@ -193,7 +193,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -165,7 +165,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.y; y = g->p.y;
#endif #endif
if (gdispColor2Native(g->p.color) != Black) { if (gdispColor2Native(g->p.color) != GFX_BLACK) {
RAM(g)[xyaddr(x, y)] |= xybit(y); RAM(g)[xyaddr(x, y)] |= xybit(y);
} else { } else {
RAM(g)[xyaddr(x, y)] &= ~xybit(y); RAM(g)[xyaddr(x, y)] &= ~xybit(y);
@ -198,7 +198,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
y = g->p.x; y = g->p.x;
break; break;
} }
return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? GFX_WHITE : GFX_BLACK;
} }
#endif #endif

View File

@ -61,9 +61,11 @@
#define DISPLAY_Y_OFFSET 50 #define DISPLAY_Y_OFFSET 50
// Oops - name clashes with Win32 symbols // Oops - name clashes with Win32 symbols
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <stdio.h> #include <stdio.h>

View File

@ -159,7 +159,7 @@
//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used. //#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used.
//#define GDISP_LINEBUF_SIZE 128 //#define GDISP_LINEBUF_SIZE 128
//#define GDISP_STARTUP_COLOR Black //#define GDISP_STARTUP_COLOR GFX_BLACK
//#define GDISP_NEED_STARTUP_LOGO GFXON //#define GDISP_NEED_STARTUP_LOGO GFXON
//#define GDISP_TOTAL_DISPLAYS 1 //#define GDISP_TOTAL_DISPLAYS 1

View File

@ -15,7 +15,7 @@
// Number of milliseconds for the startup logo - 0 means disabled. // Number of milliseconds for the startup logo - 0 means disabled.
#if GDISP_NEED_STARTUP_LOGO #if GDISP_NEED_STARTUP_LOGO
#define GDISP_STARTUP_LOGO_TIMEOUT 1000 #define GDISP_STARTUP_LOGO_TIMEOUT 1000
#define GDISP_STARTUP_LOGO_COLOR White #define GDISP_STARTUP_LOGO_COLOR GFX_WHITE
#else #else
#define GDISP_STARTUP_LOGO_TIMEOUT 0 #define GDISP_STARTUP_LOGO_TIMEOUT 0
#endif #endif

View File

@ -80,53 +80,53 @@ typedef uint16_t colorformat;
* @name Some basic colors * @name Some basic colors
* @{ * @{
*/ */
#define GFXWHITE HTML2COLOR(0xFFFFFF) #define GFX_WHITE HTML2COLOR(0xFFFFFF)
#define GFXBLACK HTML2COLOR(0x000000) #define GFX_BLACK HTML2COLOR(0x000000)
#define GFXGRAY HTML2COLOR(0x808080) #define GFX_GRAY HTML2COLOR(0x808080)
#define GFXGREY GFXGRAY #define GFX_GREY GFXGRAY
#define GFXBLUE HTML2COLOR(0x0000FF) #define GFX_BLUE HTML2COLOR(0x0000FF)
#define GFXRED HTML2COLOR(0xFF0000) #define GFX_RED HTML2COLOR(0xFF0000)
#define GFXFUCHSIA HTML2COLOR(0xFF00FF) #define GFX_FUCHSIA HTML2COLOR(0xFF00FF)
#define GFXMAGENTA GFXFUCHSIA #define GFX_MAGENTA GFXFUCHSIA
#define GFXGREEN HTML2COLOR(0x008000) #define GFX_GREEN HTML2COLOR(0x008000)
#define GFXYELLOW HTML2COLOR(0xFFFF00) #define GFX_YELLOW HTML2COLOR(0xFFFF00)
#define GFXAQUA HTML2COLOR(0x00FFFF) #define GFX_AQUA HTML2COLOR(0x00FFFF)
#define GFXCYAN GFXAQUA #define GFX_CYAN GFXAQUA
#define GFXLIME HTML2COLOR(0x00FF00) #define GFX_LIME HTML2COLOR(0x00FF00)
#define GFXMAROON HTML2COLOR(0x800000) #define GFX_MAROON HTML2COLOR(0x800000)
#define GFXNAVY HTML2COLOR(0x000080) #define GFX_NAVY HTML2COLOR(0x000080)
#define GFXOLIVE HTML2COLOR(0x808000) #define GFX_OLIVE HTML2COLOR(0x808000)
#define GFXPURPLE HTML2COLOR(0x800080) #define GFX_PURPLE HTML2COLOR(0x800080)
#define GFXSILVER HTML2COLOR(0xC0C0C0) #define GFX_SILVER HTML2COLOR(0xC0C0C0)
#define GFXTEAL HTML2COLOR(0x008080) #define GFX_TEAL HTML2COLOR(0x008080)
#define GFXORANGE HTML2COLOR(0xFFA500) #define GFX_ORANGE HTML2COLOR(0xFFA500)
#define GFXPINK HTML2COLOR(0xFFC0CB) #define GFX_PINK HTML2COLOR(0xFFC0CB)
#define GFXSKYBLUE HTML2COLOR(0x87CEEB) #define GFX_SKYBLUE HTML2COLOR(0x87CEEB)
/** @} */ /** @} */
#if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#define White GFXWHITE #define White GFX_WHITE
#define Black GFXBLACK #define Black GFX_BLACK
#define Gray GFXGRAY #define Gray GFX_GRAY
#define Grey GFXGREY #define Grey GFX_GREY
#define Blue GFXBLUE #define Blue GFX_BLUE
#define Red GFXRED #define Red GFX_RED
#define Fuchsia GFXFUCHSIA #define Fuchsia GFX_FUCHSIA
#define Magenta GFXMAGENTA #define Magenta GFX_MAGENTA
#define Green GFXGREEN #define Green GFX_GREEN
#define Yellow GFXYELLOW #define Yellow GFX_YELLOW
#define Aqua GFXAQUA #define Aqua GFX_AQUA
#define Cyan GFXCYAN #define Cyan GFX_CYAN
#define Lime GFXLIME #define Lime GFX_LIME
#define Maroon GFXMAROON #define Maroon GFX_MAROON
#define Navy GFXNAVY #define Navy GFX_NAVY
#define Olive GFXOLIVE #define Olive GFX_OLIVE
#define Purple GFXPURPLE #define Purple GFX_PURPLE
#define Silver GFXSILVER #define Silver GFX_SILVER
#define Teal GFXTEAL #define Teal GFX_TEAL
#define Orange GFXORANGE #define Orange GFX_ORANGE
#define Pink GFXPINK #define Pink GFX_PINK
#define SkyBlue GFXSKYBLUE #define SkyBlue GFX_SKYBLUE
#endif #endif
#if defined(__DOXYGEN__) #if defined(__DOXYGEN__)

View File

@ -115,7 +115,7 @@ gdispImageError gdispImageOpenGFile(gdispImage *img, GFILE *f) {
if (!f) if (!f)
return GDISP_IMAGE_ERR_NOSUCHFILE; return GDISP_IMAGE_ERR_NOSUCHFILE;
img->f = f; img->f = f;
img->bgcolor = White; img->bgcolor = GFX_WHITE;
for(img->fns = ImageHandlers; img->fns < ImageHandlers+sizeof(ImageHandlers)/sizeof(ImageHandlers[0]); img->fns++) { for(img->fns = ImageHandlers; img->fns < ImageHandlers+sizeof(ImageHandlers)/sizeof(ImageHandlers[0]); img->fns++) {
err = img->fns->open(img); err = img->fns->open(img);
if (err != GDISP_IMAGE_ERR_BADFORMAT) { if (err != GDISP_IMAGE_ERR_BADFORMAT) {

View File

@ -223,7 +223,7 @@
* @brief Define the initial background color for all displays in the system. * @brief Define the initial background color for all displays in the system.
*/ */
#ifndef GDISP_STARTUP_COLOR #ifndef GDISP_STARTUP_COLOR
#define GDISP_STARTUP_COLOR Black #define GDISP_STARTUP_COLOR GFX_BLACK
#endif #endif
/** /**
* @brief Define the default orientation for all displays in the system. * @brief Define the default orientation for all displays in the system.

View File

@ -33,9 +33,9 @@
#else #else
#define CALIBRATION_FONT2 "* Narrow" #define CALIBRATION_FONT2 "* Narrow"
#endif #endif
#define CALIBRATION_BACKGROUND Blue #define CALIBRATION_BACKGROUND GFX_BLUE
#define CALIBRATION_CROSS_COLOR1 White #define CALIBRATION_CROSS_COLOR1 GFX_WHITE
#define CALIBRATION_CROSS_COLOR2 RGB2COLOR(184,158,131) #define CALIBRATION_CROSS_COLOR2 RGB2COLOR(184,158,131)
#define CALIBRATION_CROSS_INNERGAP 2 #define CALIBRATION_CROSS_INNERGAP 2
#define CALIBRATION_CROSS_RADIUS 15 #define CALIBRATION_CROSS_RADIUS 15
@ -47,8 +47,8 @@
#endif #endif
#define CALIBRATION_TITLE_Y 5 #define CALIBRATION_TITLE_Y 5
#define CALIBRATION_TITLE_HEIGHT 30 #define CALIBRATION_TITLE_HEIGHT 30
#define CALIBRATION_TITLE_COLOR White #define CALIBRATION_TITLE_COLOR GFX_WHITE
#define CALIBRATION_TITLE_BACKGROUND Blue #define CALIBRATION_TITLE_BACKGROUND GFX_BLUE
#ifdef GINPUT_TOUCH_CALIBRATION_ERROR #ifdef GINPUT_TOUCH_CALIBRATION_ERROR
#define CALIBRATION_ERROR_TEXT GINPUT_TOUCH_CALIBRATION_ERROR #define CALIBRATION_ERROR_TEXT GINPUT_TOUCH_CALIBRATION_ERROR
@ -56,8 +56,8 @@
#define CALIBRATION_ERROR_TEXT "Calibration Failed!" #define CALIBRATION_ERROR_TEXT "Calibration Failed!"
#endif #endif
#define CALIBRATION_ERROR_DELAY 3000 #define CALIBRATION_ERROR_DELAY 3000
#define CALIBRATION_ERROR_COLOR Red #define CALIBRATION_ERROR_COLOR GFX_RED
#define CALIBRATION_ERROR_BACKGROUND Yellow #define CALIBRATION_ERROR_BACKGROUND GFX_YELLOW
#define CALIBRATION_ERROR_Y 35 #define CALIBRATION_ERROR_Y 35
#define CALIBRATION_ERROR_HEIGHT 40 #define CALIBRATION_ERROR_HEIGHT 40
@ -500,7 +500,7 @@ static void MousePoll(void *param) {
} }
// Set up the calibration display // Set up the calibration display
gdispGClear(m->display, Blue); gdispGClear(m->display, GFX_BLUE);
#if GDISP_NEED_TEXT #if GDISP_NEED_TEXT
gdispGFillStringBox(m->display, gdispGFillStringBox(m->display,
0, CALIBRATION_TITLE_Y, w, CALIBRATION_TITLE_HEIGHT, 0, CALIBRATION_TITLE_Y, w, CALIBRATION_TITLE_HEIGHT,

View File

@ -59,15 +59,19 @@ void _gosDeinit(void)
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 // Windows XP and up #define _WIN32_WINNT 0x0501 // Windows XP and up
#endif #endif
#undef Red #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#undef Green #undef Red
#undef Blue #undef Green
#undef Blue
#endif
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#undef WIN32_LEAN_AND_MEAN #undef WIN32_LEAN_AND_MEAN
#define Blue HTML2COLOR(0x0000FF) #if GFX_COMPAT_V2 && GFX_COMPAT_OLDCOLORS
#define Red HTML2COLOR(0xFF0000) #define Red GFX_RED
#define Green HTML2COLOR(0x008000) #define Green GFX_GREEN
#define Blue GFX_BLUE
#endif
#include <stdio.h> #include <stdio.h>
systemticks_t gfxSystemTicks(void) { return GetTickCount(); } systemticks_t gfxSystemTicks(void) { return GetTickCount(); }

View File

@ -30,8 +30,8 @@ static const gwinVMT basegwinVMT = {
0, // The after-clear routine 0, // The after-clear routine
}; };
static color_t defaultFgColor = White; static color_t defaultFgColor = GFX_WHITE;
static color_t defaultBgColor = Black; static color_t defaultBgColor = GFX_BLACK;
#if GDISP_NEED_TEXT #if GDISP_NEED_TEXT
static font_t defaultFont; static font_t defaultFont;
#endif #endif

View File

@ -203,7 +203,7 @@ extern "C" {
* @param[in] pInit How to initialise the window * @param[in] pInit How to initialise the window
* *
* @note The drawing color and the background color get set to the current defaults. If you haven't called * @note The drawing color and the background color get set to the current defaults. If you haven't called
* @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
* @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
* is no default font and text drawing operations will no nothing. * is no default font and text drawing operations will no nothing.
* @note A basic window does not save the drawing state. It is not automatically redrawn if the window is moved or * @note A basic window does not save the drawing state. It is not automatically redrawn if the window is moved or

View File

@ -192,8 +192,8 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
pcol = getButtonColors(gw); pcol = getButtonColors(gw);
/* Fill the box blended from variants of the fill color */ /* Fill the box blended from variants of the fill color */
tcol = gdispBlendColor(White, pcol->fill, BTN_TOP_FADE); tcol = gdispBlendColor(GFX_WHITE, pcol->fill, BTN_TOP_FADE);
bcol = gdispBlendColor(Black, pcol->fill, BTN_BOTTOM_FADE); bcol = gdispBlendColor(GFX_BLACK, pcol->fill, BTN_BOTTOM_FADE);
dalpha = FIXED(255)/gw->g.height; dalpha = FIXED(255)/gw->g.height;
for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha) for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha)
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha))); gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha)));

View File

@ -71,7 +71,7 @@ extern "C" {
* @param[in] pInit The initialisation parameters * @param[in] pInit The initialisation parameters
* *
* @note The drawing color and the background color get set to the current defaults. If you haven't called * @note The drawing color and the background color get set to the current defaults. If you haven't called
* @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
* @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
* is no default font and text drawing operations will no nothing. * is no default font and text drawing operations will no nothing.
* @note A button remembers its normal drawing state. If there is a window manager then it is automatically * @note A button remembers its normal drawing state. If there is a window manager then it is automatically

View File

@ -267,8 +267,8 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
#endif #endif
/* Fill the box blended from variants of the fill color */ /* Fill the box blended from variants of the fill color */
tcol = gdispBlendColor(White, pcol->fill, CHK_TOP_FADE); tcol = gdispBlendColor(GFX_WHITE, pcol->fill, CHK_TOP_FADE);
bcol = gdispBlendColor(Black, pcol->fill, CHK_BOTTOM_FADE); bcol = gdispBlendColor(GFX_BLACK, pcol->fill, CHK_BOTTOM_FADE);
dalpha = FIXED(255)/gw->g.height; dalpha = FIXED(255)/gw->g.height;
for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha) for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha)
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha))); gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha)));

View File

@ -74,7 +74,7 @@ extern "C" {
* @param[in] pInit The initialization parameters to use * @param[in] pInit The initialization parameters to use
* *
* @note The drawing color and the background color get set to the current defaults. If you haven't called * @note The drawing color and the background color get set to the current defaults. If you haven't called
* @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
* @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
* is no default font and text drawing operations will no nothing. * is no default font and text drawing operations will no nothing.
* @note A checkbox remembers its normal drawing state. If there is a window manager then it is automatically * @note A checkbox remembers its normal drawing state. If there is a window manager then it is automatically

View File

@ -116,21 +116,21 @@
static color_t ESCPrintColor(GConsoleObject *gcw) { static color_t ESCPrintColor(GConsoleObject *gcw) {
switch(gcw->currattr & (ESC_REDBIT|ESC_GREENBIT|ESC_BLUEBIT|ESC_USECOLOR)) { switch(gcw->currattr & (ESC_REDBIT|ESC_GREENBIT|ESC_BLUEBIT|ESC_USECOLOR)) {
case (ESC_USECOLOR): case (ESC_USECOLOR):
return Black; return GFX_BLACK;
case (ESC_USECOLOR|ESC_REDBIT): case (ESC_USECOLOR|ESC_REDBIT):
return Red; return GFX_RED;
case (ESC_USECOLOR|ESC_GREENBIT): case (ESC_USECOLOR|ESC_GREENBIT):
return Green; return GFX_GREEN;
case (ESC_USECOLOR|ESC_REDBIT|ESC_GREENBIT): case (ESC_USECOLOR|ESC_REDBIT|ESC_GREENBIT):
return Yellow; return GFX_YELLOW;
case (ESC_USECOLOR|ESC_BLUEBIT): case (ESC_USECOLOR|ESC_BLUEBIT):
return Blue; return GFX_BLUE;
case (ESC_USECOLOR|ESC_REDBIT|ESC_BLUEBIT): case (ESC_USECOLOR|ESC_REDBIT|ESC_BLUEBIT):
return Magenta; return GFX_MAGENTA;
case (ESC_USECOLOR|ESC_GREENBIT|ESC_BLUEBIT): case (ESC_USECOLOR|ESC_GREENBIT|ESC_BLUEBIT):
return Cyan; return GFX_CYAN;
case (ESC_USECOLOR|ESC_REDBIT|ESC_GREENBIT|ESC_BLUEBIT): case (ESC_USECOLOR|ESC_REDBIT|ESC_GREENBIT|ESC_BLUEBIT):
return White; return GFX_WHITE;
default: default:
return gcw->g.color; return gcw->g.color;
} }

View File

@ -69,7 +69,7 @@ extern "C" {
* @param[in] pInit The initialization parameters to use * @param[in] pInit The initialization parameters to use
* *
* @note The drawing color and the background color get set to the current defaults. If you haven't called * @note The drawing color and the background color get set to the current defaults. If you haven't called
* @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
* @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
* is no default font and text drawing operations will no nothing. * is no default font and text drawing operations will no nothing.
* @note On creation even if the window is visible it is not automatically cleared. * @note On creation even if the window is visible it is not automatically cleared.

View File

@ -51,7 +51,7 @@ extern "C" {
* @param[in] pInit The initialization parameters to use * @param[in] pInit The initialization parameters to use
* *
* @note The drawing color and the background color get set to the current defaults. If you haven't called * @note The drawing color and the background color get set to the current defaults. If you haven't called
* @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
* @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
* is no default font and text drawing operations will no nothing. * is no default font and text drawing operations will no nothing.
* @note The dimensions and position may be changed to fit on the real screen. * @note The dimensions and position may be changed to fit on the real screen.

View File

@ -20,12 +20,12 @@
#define GGRAPH_ARROW_SIZE 5 #define GGRAPH_ARROW_SIZE 5
static const GGraphStyle GGraphDefaultStyle = { static const GGraphStyle GGraphDefaultStyle = {
{ GGRAPH_POINT_DOT, 0, White }, // point { GGRAPH_POINT_DOT, 0, GFX_WHITE }, // point
{ GGRAPH_LINE_DOT, 2, Gray }, // line { GGRAPH_LINE_DOT, 2, GFX_GRAY }, // line
{ GGRAPH_LINE_SOLID, 0, White }, // x axis { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // x axis
{ GGRAPH_LINE_SOLID, 0, White }, // y axis { GGRAPH_LINE_SOLID, 0, GFX_WHITE }, // y axis
{ GGRAPH_LINE_NONE, 0, White, 0 }, // x grid { GGRAPH_LINE_NONE, 0, GFX_WHITE, 0 }, // x grid
{ GGRAPH_LINE_NONE, 0, White, 0 }, // y grid { GGRAPH_LINE_NONE, 0, GFX_WHITE, 0 }, // y grid
GWIN_GRAPH_STYLE_XAXIS_ARROWS|GWIN_GRAPH_STYLE_YAXIS_ARROWS // flags GWIN_GRAPH_STYLE_XAXIS_ARROWS|GWIN_GRAPH_STYLE_YAXIS_ARROWS // flags
}; };

Some files were not shown because too many files have changed in this diff Show More