aboutsummaryrefslogtreecommitdiffstats
path: root/demos/applications
diff options
context:
space:
mode:
Diffstat (limited to 'demos/applications')
-rw-r--r--demos/applications/combo/bounce.c10
-rw-r--r--demos/applications/combo/gfxconf.h114
-rw-r--r--demos/applications/combo/main.c6
-rw-r--r--demos/applications/mandelbrot/gfxconf.h12
-rw-r--r--demos/applications/notepad/gfxconf.h34
-rw-r--r--demos/applications/notepad/main.c40
6 files changed, 108 insertions, 108 deletions
diff --git a/demos/applications/combo/bounce.c b/demos/applications/combo/bounce.c
index f0b78266..c669eff2 100644
--- a/demos/applications/combo/bounce.c
+++ b/demos/applications/combo/bounce.c
@@ -48,15 +48,15 @@ static gfxThreadHandle thread;
* your processor.
*
* You can modify the implementation of invsqrt() by firstly defining
- * #define GMISC_INVSQRT_MIXED_ENDIAN TRUE
+ * #define GMISC_INVSQRT_MIXED_ENDIAN GFXON
* in your gfxconf.h file.
*
* If it still doesn't work then instead define
- * #define GMISC_INVSQRT_REAL_SLOW TRUE
+ * #define GMISC_INVSQRT_REAL_SLOW GFXON
* in your gfxconf.h file. This should always work although it will probably be slow.
*/
-#define BALLCOLOR1 Red
-#define BALLCOLOR2 Yellow
+#define BALLCOLOR1 GFX_RED
+#define BALLCOLOR2 GFX_YELLOW
#define WALLCOLOR HTML2COLOR(0x303030)
#define BACKCOLOR HTML2COLOR(0xC0C0C0)
#define FLOORCOLOR HTML2COLOR(0x606060)
@@ -117,7 +117,7 @@ static DECLARE_THREAD_FUNCTION(task, param) {
// The ball shadow is darker
if (g*(g+.4)+h*(h+.1) < 1)
- colour = gdispBlendColor(colour, Black, SHADOWALPHA);
+ colour = gdispBlendColor(colour, GFX_BLACK, SHADOWALPHA);
}
gdispStreamColor(colour); /* pixel to the LCD */
}
diff --git a/demos/applications/combo/gfxconf.h b/demos/applications/combo/gfxconf.h
index aec48783..cf218206 100644
--- a/demos/applications/combo/gfxconf.h
+++ b/demos/applications/combo/gfxconf.h
@@ -19,109 +19,109 @@
#define _GFXCONF_H
/* The operating system to use. One of these must be defined - preferably in your Makefile */
-//#define GFX_USE_OS_CHIBIOS TRUE
-//#define GFX_USE_OS_WIN32 TRUE
-//#define GFX_USE_OS_LINUX TRUE
-//#define GFX_USE_OS_OSX TRUE
+//#define GFX_USE_OS_CHIBIOS GFXON
+//#define GFX_USE_OS_WIN32 GFXON
+//#define GFX_USE_OS_LINUX GFXON
+//#define GFX_USE_OS_OSX GFXON
///////////////////////////////////////////////////////////////////////////
// GDISP //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GDISP TRUE
+#define GFX_USE_GDISP GFXON
-#define GDISP_NEED_VALIDATION TRUE
-#define GDISP_NEED_CLIP TRUE
-#define GDISP_NEED_CIRCLE TRUE
-#define GDISP_NEED_CONVEX_POLYGON TRUE
-//#define GDISP_NEED_SCROLL TRUE
-#define GDISP_NEED_CONTROL TRUE
-#define GDISP_NEED_TEXT TRUE
- #define GDISP_INCLUDE_FONT_UI2 TRUE
-#define GDISP_NEED_STREAMING TRUE
+#define GDISP_NEED_VALIDATION GFXON
+#define GDISP_NEED_CLIP GFXON
+#define GDISP_NEED_CIRCLE GFXON
+#define GDISP_NEED_CONVEX_POLYGON GFXON
+//#define GDISP_NEED_SCROLL GFXON
+#define GDISP_NEED_CONTROL GFXON
+#define GDISP_NEED_TEXT GFXON
+ #define GDISP_INCLUDE_FONT_UI2 GFXON
+#define GDISP_NEED_STREAMING GFXON
-#define GDISP_NEED_IMAGE TRUE
- #define GDISP_NEED_IMAGE_BMP TRUE
- #define GDISP_NEED_IMAGE_GIF TRUE
+#define GDISP_NEED_IMAGE GFXON
+ #define GDISP_NEED_IMAGE_BMP GFXON
+ #define GDISP_NEED_IMAGE_GIF GFXON
#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE
-#define GDISP_NEED_MULTITHREAD TRUE
+#define GDISP_NEED_MULTITHREAD GFXON
///////////////////////////////////////////////////////////////////////////
// GWIN //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GWIN TRUE
+#define GFX_USE_GWIN GFXON
-#define GWIN_NEED_WINDOWMANAGER TRUE
- #define GWIN_NEED_FLASHING TRUE
+#define GWIN_NEED_WINDOWMANAGER GFXON
+ #define GWIN_NEED_FLASHING GFXON
-#define GWIN_NEED_CONSOLE TRUE
- #define GWIN_CONSOLE_USE_HISTORY TRUE
- #define GWIN_CONSOLE_HISTORY_AVERAGING TRUE
- #define GWIN_CONSOLE_HISTORY_ATCREATE TRUE
-#define GWIN_NEED_GRAPH TRUE
+#define GWIN_NEED_CONSOLE GFXON
+ #define GWIN_CONSOLE_USE_HISTORY GFXON
+ #define GWIN_CONSOLE_HISTORY_AVERAGING GFXON
+ #define GWIN_CONSOLE_HISTORY_ATCREATE GFXON
+#define GWIN_NEED_GRAPH GFXON
-#define GWIN_NEED_WIDGET TRUE
- #define GWIN_NEED_LABEL TRUE
- #define GWIN_LABEL_ATTRIBUTE TRUE
- #define GWIN_NEED_BUTTON TRUE
-// #define GWIN_BUTTON_LAZY_RELEASE TRUE
- #define GWIN_NEED_SLIDER TRUE
- #define GWIN_NEED_CHECKBOX TRUE
- #define GWIN_NEED_IMAGE TRUE
- #define GWIN_NEED_RADIO TRUE
- #define GWIN_NEED_LIST TRUE
- #define GWIN_NEED_LIST_IMAGES TRUE
- #define GWIN_NEED_PROGRESSBAR TRUE
- #define GWIN_PROGRESSBAR_AUTO TRUE
+#define GWIN_NEED_WIDGET GFXON
+ #define GWIN_NEED_LABEL GFXON
+ #define GWIN_LABEL_ATTRIBUTE GFXON
+ #define GWIN_NEED_BUTTON GFXON
+// #define GWIN_BUTTON_LAZY_RELEASE GFXON
+ #define GWIN_NEED_SLIDER GFXON
+ #define GWIN_NEED_CHECKBOX GFXON
+ #define GWIN_NEED_IMAGE GFXON
+ #define GWIN_NEED_RADIO GFXON
+ #define GWIN_NEED_LIST GFXON
+ #define GWIN_NEED_LIST_IMAGES GFXON
+ #define GWIN_NEED_PROGRESSBAR GFXON
+ #define GWIN_PROGRESSBAR_AUTO GFXON
-#define GWIN_NEED_CONTAINERS TRUE
- #define GWIN_NEED_CONTAINER TRUE
+#define GWIN_NEED_CONTAINERS GFXON
+ #define GWIN_NEED_CONTAINER GFXON
-#define GWIN_NEED_TABSET TRUE
+#define GWIN_NEED_TABSET GFXON
///////////////////////////////////////////////////////////////////////////
// GEVENT //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GEVENT TRUE
+#define GFX_USE_GEVENT GFXON
///////////////////////////////////////////////////////////////////////////
// GTIMER //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GTIMER TRUE
+#define GFX_USE_GTIMER GFXON
///////////////////////////////////////////////////////////////////////////
// GQUEUE //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GQUEUE TRUE
+#define GFX_USE_GQUEUE GFXON
-#define GQUEUE_NEED_ASYNC TRUE
+#define GQUEUE_NEED_ASYNC GFXON
///////////////////////////////////////////////////////////////////////////
// GINPUT //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GINPUT TRUE
+#define GFX_USE_GINPUT GFXON
-#define GINPUT_NEED_MOUSE TRUE
-//#define GINPUT_NEED_TOGGLE TRUE
-//#define GINPUT_NEED_DIAL TRUE
+#define GINPUT_NEED_MOUSE GFXON
+//#define GINPUT_NEED_TOGGLE GFXON
+//#define GINPUT_NEED_DIAL GFXON
///////////////////////////////////////////////////////////////////////////
// GFILE //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GFILE TRUE
+#define GFX_USE_GFILE GFXON
-#define GFILE_NEED_PRINTG TRUE
-#define GFILE_NEED_STRINGS TRUE
+#define GFILE_NEED_PRINTG GFXON
+#define GFILE_NEED_STRINGS GFXON
-#define GFILE_NEED_ROMFS TRUE
-//#define GFILE_NEED_NATIVEFS TRUE
+#define GFILE_NEED_ROMFS GFXON
+//#define GFILE_NEED_NATIVEFS GFXON
///////////////////////////////////////////////////////////////////////////
// GMISC //
///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GMISC TRUE
-#define GMISC_NEED_INVSQRT TRUE
+#define GFX_USE_GMISC GFXON
+#define GMISC_NEED_INVSQRT GFXON
#endif /* _GFXCONF_H */
diff --git a/demos/applications/combo/main.c b/demos/applications/combo/main.c
index 449572d9..4585a74e 100644
--- a/demos/applications/combo/main.c
+++ b/demos/applications/combo/main.c
@@ -41,7 +41,7 @@
/* Our custom yellow style */
static const GWidgetStyle YellowWidgetStyle = {
- Yellow, // window background
+ GFX_YELLOW, // window background
HTML2COLOR(0x800000), // focus - for text edit.
// enabled color set
@@ -168,7 +168,7 @@ static void createWidgets(void) {
wi.g.x = pagewidth;
wi.g.width = pagewidth;
ghConsole = gwinConsoleCreate(0, &wi.g);
- gwinSetColor(ghConsole, Black);
+ gwinSetColor(ghConsole, GFX_BLACK);
gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0));
// Buttons
@@ -405,7 +405,7 @@ int main(void) {
font = gdispOpenFont("*"); // Get the first defined font.
gwinSetDefaultFont(font);
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
- gdispClear(White);
+ gdispClear(GFX_WHITE);
// Create the gwin windows/widgets
createWidgets();
diff --git a/demos/applications/mandelbrot/gfxconf.h b/demos/applications/mandelbrot/gfxconf.h
index 99a04b5c..17c45142 100644
--- a/demos/applications/mandelbrot/gfxconf.h
+++ b/demos/applications/mandelbrot/gfxconf.h
@@ -31,15 +31,15 @@
#define _GFXCONF_H
/* The operating system to use. One of these must be defined - preferably in your Makefile */
-//#define GFX_USE_OS_CHIBIOS FALSE
-//#define GFX_USE_OS_WIN32 FALSE
-//#define GFX_USE_OS_LINUX FALSE
-//#define GFX_USE_OS_OSX FALSE
+//#define GFX_USE_OS_CHIBIOS GFXOFF
+//#define GFX_USE_OS_WIN32 GFXOFF
+//#define GFX_USE_OS_LINUX GFXOFF
+//#define GFX_USE_OS_OSX GFXOFF
/* GFX sub-systems to turn on */
-#define GFX_USE_GDISP TRUE
+#define GFX_USE_GDISP GFXON
/* Features for the GDISP sub-system. */
-#define GDISP_NEED_VALIDATION TRUE
+#define GDISP_NEED_VALIDATION GFXON
#endif /* _GFXCONF_H */
diff --git a/demos/applications/notepad/gfxconf.h b/demos/applications/notepad/gfxconf.h
index b3920119..9110d6e8 100644
--- a/demos/applications/notepad/gfxconf.h
+++ b/demos/applications/notepad/gfxconf.h
@@ -31,30 +31,30 @@
#define _GFXCONF_H
/* The operating system to use. One of these must be defined - preferably in your Makefile */
-//#define GFX_USE_OS_CHIBIOS FALSE
-//#define GFX_USE_OS_WIN32 FALSE
-//#define GFX_USE_OS_LINUX FALSE
-//#define GFX_USE_OS_OSX FALSE
+//#define GFX_USE_OS_CHIBIOS GFXOFF
+//#define GFX_USE_OS_WIN32 GFXOFF
+//#define GFX_USE_OS_LINUX GFXOFF
+//#define GFX_USE_OS_OSX GFXOFF
/* GFX sub-systems to turn on */
-#define GFX_USE_GDISP TRUE
-#define GFX_USE_GEVENT TRUE
-#define GFX_USE_GTIMER TRUE
-#define GFX_USE_GINPUT TRUE
+#define GFX_USE_GDISP GFXON
+#define GFX_USE_GEVENT GFXON
+#define GFX_USE_GTIMER GFXON
+#define GFX_USE_GINPUT GFXON
/* Features for the GDISP sub-system. */
-#define GDISP_NEED_VALIDATION TRUE
-#define GDISP_NEED_CLIP TRUE
-#define GDISP_NEED_TEXT TRUE
-#define GDISP_NEED_CIRCLE TRUE
-#define GDISP_NEED_MULTITHREAD TRUE
+#define GDISP_NEED_VALIDATION GFXON
+#define GDISP_NEED_CLIP GFXON
+#define GDISP_NEED_TEXT GFXON
+#define GDISP_NEED_CIRCLE GFXON
+#define GDISP_NEED_MULTITHREAD GFXON
/* Builtin Fonts */
-#define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA TRUE
-#define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA TRUE
-#define GDISP_NEED_ANTIALIAS TRUE
+#define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA GFXON
+#define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA GFXON
+#define GDISP_NEED_ANTIALIAS GFXON
/* Features for the GINPUT sub-system. */
-#define GINPUT_NEED_MOUSE TRUE
+#define GINPUT_NEED_MOUSE GFXON
#endif /* _GFXCONF_H */
diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c
index 16120edd..de24f227 100644
--- a/demos/applications/notepad/main.c
+++ b/demos/applications/notepad/main.c
@@ -49,23 +49,23 @@ void drawScreen(void) {
font1 = gdispOpenFont("DejaVuSans24*");
font2 = gdispOpenFont("DejaVuSans12*");
- gdispClear(White);
- gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, Black);
+ gdispClear(GFX_WHITE);
+ gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, GFX_BLACK);
/* colors */
- gdispFillArea(0 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* Black */
- gdispFillArea(1 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Red); /* Red */
- gdispFillArea(2 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Yellow); /* Yellow */
- gdispFillArea(3 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Green); /* Green */
- gdispFillArea(4 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Blue); /* Blue */
- gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* White */
+ gdispFillArea(0 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_BLACK); /* Black */
+ gdispFillArea(1 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_RED); /* Red */
+ gdispFillArea(2 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_YELLOW); /* Yellow */
+ gdispFillArea(3 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_GREEN); /* Green */
+ gdispFillArea(4 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_BLUE); /* Blue */
+ gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_WHITE); /* White */
/* pens */
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", 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, GFX_WHITE, GFX_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, GFX_WHITE, GFX_BLACK, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispCloseFont(font1);
gdispCloseFont(font2);
@@ -74,7 +74,7 @@ void drawScreen(void) {
GEventMouse ev;
int main(void) {
- color_t color = Black;
+ color_t color = GFX_BLACK;
uint16_t pen = 0;
gfxInit();
@@ -89,12 +89,12 @@ int main(void) {
/* inside color box ? */
if(ev.y >= OFFSET && ev.y <= COLOR_SIZE) {
- if(GET_COLOR(0)) color = Black;
- else if(GET_COLOR(1)) color = Red;
- else if(GET_COLOR(2)) color = Yellow;
- else if(GET_COLOR(3)) color = Green;
- else if(GET_COLOR(4)) color = Blue;
- else if(GET_COLOR(5)) color = White;
+ if(GET_COLOR(0)) color = GFX_BLACK;
+ else if(GET_COLOR(1)) color = GFX_RED;
+ else if(GET_COLOR(2)) color = GFX_YELLOW;
+ else if(GET_COLOR(3)) color = GFX_GREEN;
+ else if(GET_COLOR(4)) color = GFX_BLUE;
+ else if(GET_COLOR(5)) color = GFX_WHITE;
/* inside pen box ? */
} else if(ev.x >= OFFSET && ev.x <= PEN_SIZE) {