From 41271d632b74f5cf47c30d3b699eb6b2786f2136 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 23 Jun 2018 13:02:07 +1000 Subject: Added new type definitions - moving towards V3.0 --- demos/3rdparty/notepad-2/main.c | 4 +- demos/3rdparty/notepad-2/notepadApp.c | 10 +- demos/3rdparty/notepad-2/notepadCore.c | 6 +- demos/applications/combo/bounce.c | 8 +- demos/applications/combo/main.c | 142 ++++++++++---------- demos/applications/combo/mandelbrot.c | 8 +- demos/applications/combo/tasks.h | 4 +- demos/applications/mandelbrot/main.c | 2 +- demos/applications/notepad/main.c | 2 +- demos/benchmarks/main.c | 2 +- demos/games/justget10/jg10.c | 86 ++++++------ demos/games/justget10/main.c | 2 +- demos/games/minesweeper/main.c | 2 +- demos/games/minesweeper/mines.c | 66 ++++----- .../Example_Makefiles/stm32f4/board_SSD1289.h | 2 +- .../stm32f4/ginput_lld_mouse_board.h | 2 +- .../stm32f4/gmouse_lld_ADS7843_board.h | 8 +- .../stm32f4/gmouse_lld_ADS7843_board.h.old | 8 +- .../stm32f4_chibios_3.x/board_SSD1289.h | 2 +- .../stm32f4_chibios_3.x/ginput_lld_mouse_board.h | 2 +- .../stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h | 8 +- demos/games/tetris/main.c | 2 +- demos/games/tetris/tetris.c | 80 +++++------ demos/modules/gadc/gwinosc.c | 14 +- demos/modules/gadc/main.c | 8 +- demos/modules/gaudio/oscilloscope/gwinosc.c | 14 +- demos/modules/gaudio/oscilloscope/main.c | 4 +- demos/modules/gaudio/play-vs1053/main.c | 2 +- demos/modules/gaudio/play-wave/main.c | 4 +- demos/modules/gdisp/basics/main.c | 2 +- demos/modules/gdisp/circles/main.c | 2 +- demos/modules/gdisp/fonts/main.c | 2 +- demos/modules/gdisp/fonts_cyrillic/main.c | 2 +- demos/modules/gdisp/multiple_displays/main.c | 4 +- demos/modules/gdisp/pixmap/main.c | 2 +- demos/modules/gdisp/polygons/main.c | 2 +- demos/modules/gdisp/thickarcs/main.c | 2 +- demos/modules/ginput/keyboard/main.c | 2 +- demos/modules/gos/threads/main.c | 6 +- demos/modules/gos/threads_advanced/main.c | 18 +-- demos/modules/gtimer/main.c | 6 +- demos/modules/gtrans/basic/main.c | 2 +- demos/modules/gwin/basic/main.c | 6 +- demos/modules/gwin/button/main.c | 6 +- demos/modules/gwin/checkbox/main.c | 4 +- demos/modules/gwin/console/main.c | 8 +- demos/modules/gwin/container/main.c | 6 +- demos/modules/gwin/container_nested/main.c | 12 +- demos/modules/gwin/frame/main.c | 4 +- demos/modules/gwin/gl3d-gears/main.c | 4 +- demos/modules/gwin/gl3d-spin/main.c | 4 +- demos/modules/gwin/graph/main.c | 4 +- demos/modules/gwin/imagebox/main.c | 4 +- demos/modules/gwin/keyboard/main.c | 6 +- demos/modules/gwin/label/main.c | 4 +- demos/modules/gwin/list/main.c | 68 +++++----- demos/modules/gwin/progressbar/main.c | 4 +- demos/modules/gwin/radio/main.c | 4 +- demos/modules/gwin/slider/main.c | 6 +- demos/modules/gwin/tabset/main.c | 10 +- demos/modules/gwin/textedit/main.c | 16 +-- .../modules/gwin/textedit_virtual_keyboard/main.c | 10 +- demos/modules/gwin/widgets/main.c | 148 ++++++++++----------- demos/tools/touch_calibration_grabber/main.c | 2 +- demos/tools/touch_driver_test/main.c | 30 ++--- demos/tools/touch_raw_readings/main.c | 2 +- demos/tools/uGFXnetDisplay/main.c | 12 +- 67 files changed, 470 insertions(+), 470 deletions(-) (limited to 'demos') diff --git a/demos/3rdparty/notepad-2/main.c b/demos/3rdparty/notepad-2/main.c index 05481b18..ec9acd0c 100644 --- a/demos/3rdparty/notepad-2/main.c +++ b/demos/3rdparty/notepad-2/main.c @@ -81,13 +81,13 @@ int main(void) { gfxInit(); /* Calibrate the touchscreen */ - ginputSetMouseCalibrationRoutines(0, NULL, tsCalibRead, FALSE); + ginputSetMouseCalibrationRoutines(0, NULL, tsCalibRead, gFalse); ginputGetMouse(0); // Set the color scheme nSetColorScheme(schemeDefault); - while (TRUE) { + while (1) { gfxThreadWait(nLaunchNotepadApp()); gdispSetClip(0, 0, gdispGetWidth(), gdispGetHeight()); diff --git a/demos/3rdparty/notepad-2/notepadApp.c b/demos/3rdparty/notepad-2/notepadApp.c index 9f61aaa4..0540da2c 100644 --- a/demos/3rdparty/notepad-2/notepadApp.c +++ b/demos/3rdparty/notepad-2/notepadApp.c @@ -73,7 +73,7 @@ static NColorScheme nCurColorScheme; static DECLARE_THREAD_FUNCTION(notepadThread, param); // Custom drawing functions for the buttons -static void nbtnColorBarDraw(GHandle gh, bool_t enabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { +static void nbtnColorBarDraw(GHandle gh, gBool enabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { #define ccs nCurColorScheme int i, j, k; @@ -152,7 +152,7 @@ static void nbtnColorBarDraw(GHandle gh, bool_t enabled, bool_t isdown, const ch #undef ccs } -static void nbtnColorBarSelDraw(GHandle gh, bool_t enabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { +static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { #define ccs nCurColorScheme int i, j = 0, k; @@ -215,7 +215,7 @@ static void nbtnColorBarSelDraw(GHandle gh, bool_t enabled, bool_t isdown, const #undef ccs } -static void nToolbarImageButtonDraw(GHandle gh, bool_t isenabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { +static void nToolbarImageButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { (void)txt; (void)pstyle; (void)isenabled; color_t cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel; @@ -228,7 +228,7 @@ static void nToolbarImageButtonDraw(GHandle gh, bool_t isenabled, bool_t isdown, gdispDrawBox(gh->x, gh->y, gh->width, gh->height, nCurColorScheme.toolbarSeparator); } -static void nCloseButtonDraw(GHandle gh, bool_t isenabled, bool_t isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { +static void nCloseButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { (void) isenabled; (void) isdown; (void) txt; @@ -401,7 +401,7 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) { ncoreSpawnDrawThread(nDrawingArea, gstatusConsole); - while(TRUE) { + while(1) { pem = (GEventMouse *) geventEventWait(&gl, TIME_INFINITE); /* button pressed... */ diff --git a/demos/3rdparty/notepad-2/notepadCore.c b/demos/3rdparty/notepad-2/notepadCore.c index 931ec331..65afc988 100644 --- a/demos/3rdparty/notepad-2/notepadCore.c +++ b/demos/3rdparty/notepad-2/notepadCore.c @@ -53,7 +53,7 @@ static gfxThreadHandle nThd; static GHandle ncoreDrawingArea = NULL; static GHandle nStatusConsole = NULL; -static volatile bool_t doExit; +static volatile gBool doExit; static void draw_point(coord_t x, coord_t y) { color_t c = ncoreDrawingArea->color; @@ -204,7 +204,7 @@ void ncoreSpawnDrawThread(GHandle drawingArea, GHandle statusConsole) { ncoreDrawingArea = drawingArea; nStatusConsole = statusConsole; - doExit = FALSE; + doExit = gFalse; nThd = gfxThreadCreate(waDrawThread, sizeof(waDrawThread), @@ -216,7 +216,7 @@ void ncoreSpawnDrawThread(GHandle drawingArea, GHandle statusConsole) { /* Terminate the core thread, wait for control release */ void ncoreTerminateDrawThread(void) { - doExit = TRUE; + doExit = gTrue; gfxThreadWait(nThd); nThd = 0; } diff --git a/demos/applications/combo/bounce.c b/demos/applications/combo/bounce.c index c669eff2..d3709056 100644 --- a/demos/applications/combo/bounce.c +++ b/demos/applications/combo/bounce.c @@ -33,7 +33,7 @@ #include "tasks.h" -static volatile bool_t run; +static volatile gBool run; static GHandle gh; static gfxThreadHandle thread; @@ -149,13 +149,13 @@ static DECLARE_THREAD_FUNCTION(task, param) { return 0; } -void doBounce(GHandle parent, bool_t start) { +void doBounce(GHandle parent, gBool start) { if (start) { - run = TRUE; + run = gTrue; gh = parent; thread = gfxThreadCreate(0, 0x200, LOW_PRIORITY, task, 0); } else if (run) { - run = FALSE; + run = gFalse; gfxThreadWait(thread); gfxYield(); } diff --git a/demos/applications/combo/main.c b/demos/applications/combo/main.c index 4585a74e..05cdb643 100644 --- a/demos/applications/combo/main.c +++ b/demos/applications/combo/main.c @@ -146,18 +146,18 @@ static void createWidgets(void) { border = ScrWidth < 450 ? 1 : 5; // Create the Tabs - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = border; wi.g.y = 0; wi.g.width = ScrWidth - 2*border; wi.g.height = ScrHeight-wi.g.y-border; ghTabset = gwinTabsetCreate(0, &wi, GWIN_TABSET_BORDER); - ghPgControls = gwinTabsetAddTab(ghTabset, "Controls", FALSE); - ghPgSliders = gwinTabsetAddTab(ghTabset, "Sliders", FALSE); - ghPgRadios = gwinTabsetAddTab(ghTabset, "Radios", FALSE); - ghPgLists = gwinTabsetAddTab(ghTabset, "Lists", FALSE); - ghPgLabels = gwinTabsetAddTab(ghTabset, "Labels", FALSE); - ghPgImages = gwinTabsetAddTab(ghTabset, "Images", FALSE); - ghPgBounce = gwinTabsetAddTab(ghTabset, "Bounce", FALSE); - ghPgMandelbrot = gwinTabsetAddTab(ghTabset, "Mandelbrot", FALSE); + ghPgControls = gwinTabsetAddTab(ghTabset, "Controls", gFalse); + ghPgSliders = gwinTabsetAddTab(ghTabset, "Sliders", gFalse); + ghPgRadios = gwinTabsetAddTab(ghTabset, "Radios", gFalse); + ghPgLists = gwinTabsetAddTab(ghTabset, "Lists", gFalse); + ghPgLabels = gwinTabsetAddTab(ghTabset, "Labels", gFalse); + ghPgImages = gwinTabsetAddTab(ghTabset, "Images", gFalse); + ghPgBounce = gwinTabsetAddTab(ghTabset, "Bounce", gFalse); + ghPgMandelbrot = gwinTabsetAddTab(ghTabset, "Mandelbrot", gFalse); pagewidth = gwinGetInnerWidth(ghTabset)/2; @@ -266,62 +266,62 @@ static void createWidgets(void) { wi.g.parent = ghPgLists; wi.g.width = LIST_WIDTH; wi.g.height = LIST_HEIGHT; wi.g.y = border; wi.g.x = border; wi.text = "L1"; - ghList1 = gwinListCreate(0, &wi, FALSE); - gwinListAddItem(ghList1, "Item 0", FALSE); - gwinListAddItem(ghList1, "Item 1", FALSE); - gwinListAddItem(ghList1, "Item 2", FALSE); - gwinListAddItem(ghList1, "Item 3", FALSE); - gwinListAddItem(ghList1, "Item 4", FALSE); - gwinListAddItem(ghList1, "Item 5", FALSE); - gwinListAddItem(ghList1, "Item 6", FALSE); - gwinListAddItem(ghList1, "Item 7", FALSE); - gwinListAddItem(ghList1, "Item 8", FALSE); - gwinListAddItem(ghList1, "Item 9", FALSE); - gwinListAddItem(ghList1, "Item 10", FALSE); - gwinListAddItem(ghList1, "Item 11", FALSE); - gwinListAddItem(ghList1, "Item 12", FALSE); - gwinListAddItem(ghList1, "Item 13", FALSE); + ghList1 = gwinListCreate(0, &wi, gFalse); + gwinListAddItem(ghList1, "Item 0", gFalse); + gwinListAddItem(ghList1, "Item 1", gFalse); + gwinListAddItem(ghList1, "Item 2", gFalse); + gwinListAddItem(ghList1, "Item 3", gFalse); + gwinListAddItem(ghList1, "Item 4", gFalse); + gwinListAddItem(ghList1, "Item 5", gFalse); + gwinListAddItem(ghList1, "Item 6", gFalse); + gwinListAddItem(ghList1, "Item 7", gFalse); + gwinListAddItem(ghList1, "Item 8", gFalse); + gwinListAddItem(ghList1, "Item 9", gFalse); + gwinListAddItem(ghList1, "Item 10", gFalse); + gwinListAddItem(ghList1, "Item 11", gFalse); + gwinListAddItem(ghList1, "Item 12", gFalse); + gwinListAddItem(ghList1, "Item 13", gFalse); wi.text = "L2"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; } - ghList2 = gwinListCreate(0, &wi, TRUE); - gwinListAddItem(ghList2, "Item 0", FALSE); - gwinListAddItem(ghList2, "Item 1", FALSE); - gwinListAddItem(ghList2, "Item 2", FALSE); - gwinListAddItem(ghList2, "Item 3", FALSE); - gwinListAddItem(ghList2, "Item 4", FALSE); - gwinListAddItem(ghList2, "Item 5", FALSE); - gwinListAddItem(ghList2, "Item 6", FALSE); - gwinListAddItem(ghList2, "Item 7", FALSE); - gwinListAddItem(ghList2, "Item 8", FALSE); - gwinListAddItem(ghList2, "Item 9", FALSE); - gwinListAddItem(ghList2, "Item 10", FALSE); - gwinListAddItem(ghList2, "Item 11", FALSE); - gwinListAddItem(ghList2, "Item 12", FALSE); - gwinListAddItem(ghList2, "Item 13", FALSE); + ghList2 = gwinListCreate(0, &wi, gTrue); + gwinListAddItem(ghList2, "Item 0", gFalse); + gwinListAddItem(ghList2, "Item 1", gFalse); + gwinListAddItem(ghList2, "Item 2", gFalse); + gwinListAddItem(ghList2, "Item 3", gFalse); + gwinListAddItem(ghList2, "Item 4", gFalse); + gwinListAddItem(ghList2, "Item 5", gFalse); + gwinListAddItem(ghList2, "Item 6", gFalse); + gwinListAddItem(ghList2, "Item 7", gFalse); + gwinListAddItem(ghList2, "Item 8", gFalse); + gwinListAddItem(ghList2, "Item 9", gFalse); + gwinListAddItem(ghList2, "Item 10", gFalse); + gwinListAddItem(ghList2, "Item 11", gFalse); + gwinListAddItem(ghList2, "Item 12", gFalse); + gwinListAddItem(ghList2, "Item 13", gFalse); wi.text = "L3"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; } - ghList3 = gwinListCreate(0, &wi, TRUE); - gwinListAddItem(ghList3, "Item 0", FALSE); - gwinListAddItem(ghList3, "Item 1", FALSE); - gwinListAddItem(ghList3, "Item 2", FALSE); - gwinListAddItem(ghList3, "Item 3", FALSE); + ghList3 = gwinListCreate(0, &wi, gTrue); + gwinListAddItem(ghList3, "Item 0", gFalse); + gwinListAddItem(ghList3, "Item 1", gFalse); + gwinListAddItem(ghList3, "Item 2", gFalse); + gwinListAddItem(ghList3, "Item 3", gFalse); gdispImageOpenFile(&imgYesNo, "image_yesno.gif"); gwinListItemSetImage(ghList3, 1, &imgYesNo); gwinListItemSetImage(ghList3, 3, &imgYesNo); wi.text = "L4"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; } - ghList4 = gwinListCreate(0, &wi, TRUE); - gwinListAddItem(ghList4, "Item 0", FALSE); - gwinListAddItem(ghList4, "Item 1", FALSE); - gwinListAddItem(ghList4, "Item 2", FALSE); - gwinListAddItem(ghList4, "Item 3", FALSE); - gwinListAddItem(ghList4, "Item 4", FALSE); - gwinListAddItem(ghList4, "Item 5", FALSE); - gwinListAddItem(ghList4, "Item 6", FALSE); - gwinListAddItem(ghList4, "Item 7", FALSE); - gwinListAddItem(ghList4, "Item 8", FALSE); - gwinListAddItem(ghList4, "Item 9", FALSE); - gwinListAddItem(ghList4, "Item 10", FALSE); - gwinListAddItem(ghList4, "Item 11", FALSE); - gwinListAddItem(ghList4, "Item 12", FALSE); - gwinListAddItem(ghList4, "Item 13", FALSE); + ghList4 = gwinListCreate(0, &wi, gTrue); + gwinListAddItem(ghList4, "Item 0", gFalse); + gwinListAddItem(ghList4, "Item 1", gFalse); + gwinListAddItem(ghList4, "Item 2", gFalse); + gwinListAddItem(ghList4, "Item 3", gFalse); + gwinListAddItem(ghList4, "Item 4", gFalse); + gwinListAddItem(ghList4, "Item 5", gFalse); + gwinListAddItem(ghList4, "Item 6", gFalse); + gwinListAddItem(ghList4, "Item 7", gFalse); + gwinListAddItem(ghList4, "Item 8", gFalse); + gwinListAddItem(ghList4, "Item 9", gFalse); + gwinListAddItem(ghList4, "Item 10", gFalse); + gwinListAddItem(ghList4, "Item 11", gFalse); + gwinListAddItem(ghList4, "Item 12", gFalse); + gwinListAddItem(ghList4, "Item 13", gFalse); gwinListSetScroll(ghList4, scrollSmooth); // Image @@ -339,25 +339,25 @@ static void setLabels(void) { // The sliders snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider1)); - gwinSetText(ghLabelSlider1, tmp, TRUE); + gwinSetText(ghLabelSlider1, tmp, gTrue); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider2)); - gwinSetText(ghLabelSlider2, tmp, TRUE); + gwinSetText(ghLabelSlider2, tmp, gTrue); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider3)); - gwinSetText(ghLabelSlider3, tmp, TRUE); + gwinSetText(ghLabelSlider3, tmp, gTrue); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider4)); - gwinSetText(ghLabelSlider4, tmp, TRUE); + gwinSetText(ghLabelSlider4, tmp, gTrue); // The radio buttons if (gwinRadioIsPressed(ghRadio1)) - gwinSetText(ghLabelRadio1, "Yes", TRUE); + gwinSetText(ghLabelRadio1, "Yes", gTrue); else if (gwinRadioIsPressed(ghRadio2)) - gwinSetText(ghLabelRadio1, "No", TRUE); + gwinSetText(ghLabelRadio1, "No", gTrue); } /** * Control the progress bar auto-increment */ -static void setProgressbar(bool_t onoff) { +static void setProgressbar(gBool onoff) { if (onoff) gwinProgressbarStart(ghProgressbar1, 500); else { @@ -369,7 +369,7 @@ static void setProgressbar(bool_t onoff) { /** * Set the enabled state of every widget (except the tabs etc) */ -static void setEnabled(bool_t ena) { +static void setEnabled(gBool ena) { //gwinSetEnabled(ghPgControls, ena); gwinSetEnabled(ghPgSliders, ena); gwinSetEnabled(ghPgLabels, ena); @@ -386,7 +386,7 @@ static void setEnabled(bool_t ena) { gwinSetEnabled(ghCheckbox1, ena); gwinSetEnabled(ghCheckbox2, ena); gwinSetEnabled(ghCheckbox3, ena); - //gwinSetEnabled(ghCheckDisableAll, TRUE); + //gwinSetEnabled(ghCheckDisableAll, gTrue); } static void FlashOffFn(void *param) { @@ -404,7 +404,7 @@ int main(void) { // Set the widget defaults font = gdispOpenFont("*"); // Get the first defined font. gwinSetDefaultFont(font); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // Create the gwin windows/widgets @@ -458,7 +458,7 @@ int main(void) { // If it is the toggle button checkbox start the flash. } else if (((GEventGWinCheckbox *)pe)->gwin == ghCheckbox3) { gwinFlash(ghCheckbox3); - gtimerStart(&FlashTimer, FlashOffFn, 0, FALSE, 3000); + gtimerStart(&FlashTimer, FlashOffFn, 0, gFalse, 3000); } break; @@ -501,7 +501,7 @@ int main(void) { gdispClear(pstyle->background); // Update the style on all controls - gwinSetDefaultStyle(pstyle, TRUE); + gwinSetDefaultStyle(pstyle, gTrue); } break; } diff --git a/demos/applications/combo/mandelbrot.c b/demos/applications/combo/mandelbrot.c index 68ee1fae..8033957c 100644 --- a/demos/applications/combo/mandelbrot.c +++ b/demos/applications/combo/mandelbrot.c @@ -30,7 +30,7 @@ #include "gfx.h" #include "tasks.h" -static volatile bool_t run; +static volatile gBool run; static GHandle gh; static gfxThreadHandle thread; @@ -85,13 +85,13 @@ static DECLARE_THREAD_FUNCTION(task, param) { return 0; } -void doMandlebrot(GHandle parent, bool_t start) { +void doMandlebrot(GHandle parent, gBool start) { if (start) { - run = TRUE; + run = gTrue; gh = parent; thread = gfxThreadCreate(0, 0x400, LOW_PRIORITY, task, 0); } else if (run) { - run = FALSE; + run = gFalse; gfxThreadWait(thread); } } diff --git a/demos/applications/combo/tasks.h b/demos/applications/combo/tasks.h index 68a32e09..c7a2b7fc 100644 --- a/demos/applications/combo/tasks.h +++ b/demos/applications/combo/tasks.h @@ -1,7 +1,7 @@ #ifndef _TASKS_INCLUDED #define _TASKS_INCLUDED -void doMandlebrot(GHandle parent, bool_t start); -void doBounce(GHandle parent, bool_t start); +void doMandlebrot(GHandle parent, gBool start); +void doBounce(GHandle parent, gBool start); #endif diff --git a/demos/applications/mandelbrot/main.c b/demos/applications/mandelbrot/main.c index 37e0ac5f..808ef1c2 100644 --- a/demos/applications/mandelbrot/main.c +++ b/demos/applications/mandelbrot/main.c @@ -72,7 +72,7 @@ int main(void) { cx = -0.086f; cy = 0.85f; - while(TRUE) { + while(1) { mandelbrot(-2.0f*zoom+cx, -1.5f*zoom+cy, 2.0f*zoom+cx, 1.5f*zoom+cy); zoom *= 0.7f; diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c index de24f227..72fb23e2 100644 --- a/demos/applications/notepad/main.c +++ b/demos/applications/notepad/main.c @@ -82,7 +82,7 @@ int main(void) { drawScreen(); - while (TRUE) { + while (1) { ginputGetMouseStatus(0, &ev); if (!(ev.buttons & GINPUT_MOUSE_BTN_LEFT)) continue; diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c index 12d719ca..d14f3cc6 100644 --- a/demos/benchmarks/main.c +++ b/demos/benchmarks/main.c @@ -141,7 +141,7 @@ int main(void) { benchmark(); - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } diff --git a/demos/games/justget10/jg10.c b/demos/games/justget10/jg10.c index f9974fe1..7d5f8a46 100644 --- a/demos/games/justget10/jg10.c +++ b/demos/games/justget10/jg10.c @@ -17,12 +17,12 @@ GHandle jg10SelectionWidgetGCreate(GDisplay* g, jg10WidgetObject* wo, GWidgetIni typedef struct { // Node properties uint8_t num; // Node number - bool_t check; // Node needs to be checked or not - bool_t sel; // Node selected or not + gBool check; // Node needs to be checked or not + gBool sel; // Node selected or not } nodeProps; nodeProps jg10Field[JG10_FIELD_WIDTH][JG10_FIELD_HEIGHT]; // jg10 field array -bool_t jg10GameOver = FALSE; +gBool jg10GameOver = gFalse; const char *jg10Graph[] = {"background.bmp", "1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bmp","7.bmp","8.bmp", "9.bmp", "10.bmp", "11.bmp", "12.bmp", "13.bmp", "14.bmp", "15.bmp", "16.bmp", "17.bmp", "18.bmp", "19.bmp", "20.bmp"}; // 21 elements (0-20) gdispImage jg10Image[JG10_MAX_COUNT]; #define JG10_ANIM_IMAGES 5 @@ -33,7 +33,7 @@ uint8_t jg10MaxVal=4; // Max v font_t font; #if JG10_SHOW_SPLASH GTimer jg10SplashBlink; -bool_t jg10SplashTxtVisible = FALSE; +gBool jg10SplashTxtVisible = gFalse; gdispImage jg10SplashImage; #endif @@ -86,16 +86,16 @@ static int uitoa(unsigned int value, char * buf, int max) { return n; } -static bool_t inRange(int16_t x, int16_t y) { - if ((x >= 0) && (x < JG10_FIELD_WIDTH) && (y >= 0) && (y < JG10_FIELD_HEIGHT)) return TRUE; else return FALSE; +static gBool inRange(int16_t x, int16_t y) { + if ((x >= 0) && (x < JG10_FIELD_WIDTH) && (y >= 0) && (y < JG10_FIELD_HEIGHT)) return gTrue; else return gFalse; } static void clean_SelCheck(void) { uint16_t i ,j; for (i = 0; i < JG10_FIELD_WIDTH; i++) { for (j = 0; j < JG10_FIELD_HEIGHT; j++) { - jg10Field[i][j].check = FALSE; - jg10Field[i][j].sel = FALSE; + jg10Field[i][j].check = gFalse; + jg10Field[i][j].sel = gFalse; } } } @@ -121,7 +121,7 @@ static void remove_Selected(void) { for (i = 0; i < JG10_FIELD_WIDTH; i++) { for (j = 0; j < JG10_FIELD_HEIGHT; j++) { if (jg10Field[i][j].sel) { - jg10Field[i][j].sel = FALSE; + jg10Field[i][j].sel = gFalse; jg10Field[i][j].num = 0; } } @@ -148,9 +148,9 @@ static uint8_t jg10_randomer(uint8_t max, uint8_t th) { static void movePiecesDown(void) { uint8_t tmp = 0; - bool_t needToCheck = TRUE; + gBool needToCheck = gTrue; while (needToCheck) { - needToCheck = FALSE; + needToCheck = gFalse; for (int8_t y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) { for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) { if (jg10Field[x][y].num == 0) { @@ -164,7 +164,7 @@ static void movePiecesDown(void) { jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num; } jg10Field[x][0].num = 0; - needToCheck = TRUE; + needToCheck = gTrue; } } } @@ -172,9 +172,9 @@ static void movePiecesDown(void) { } gwinRedraw(mainWin); // Add new pieces - needToCheck = TRUE; + needToCheck = gTrue; while (needToCheck) { - needToCheck = FALSE; + needToCheck = gFalse; for (int8_t y = (JG10_FIELD_HEIGHT-1); y >= 0; y--) { for (uint8_t x = 0; x < JG10_FIELD_WIDTH; x++) { if (jg10Field[x][y].num == 0) { @@ -182,7 +182,7 @@ static void movePiecesDown(void) { jg10Field[x][tmpy].num = jg10Field[x][tmpy-1].num; } jg10Field[x][0].num = jg10_randomer(jg10MaxVal, 3); - needToCheck = TRUE; + needToCheck = gTrue; } } } @@ -191,8 +191,8 @@ static void movePiecesDown(void) { } } -static bool_t checkForPossibleMove(void) { - bool_t canMove = FALSE; +static gBool checkForPossibleMove(void) { + gBool canMove = gFalse; uint16_t i ,j; for (i = 0; i < JG10_FIELD_WIDTH; i++) { for (j = 0; j < JG10_FIELD_HEIGHT; j++) { @@ -200,7 +200,7 @@ static bool_t checkForPossibleMove(void) { (inRange(i-1,j) && jg10Field[i-1][j].num == jg10Field[i][j].num) || (inRange(i,j+1) && jg10Field[i][j+1].num == jg10Field[i][j].num) || (inRange(i+1,j) && jg10Field[i+1][j].num == jg10Field[i][j].num)) { - canMove = TRUE; + canMove = gTrue; return canMove; } } @@ -242,10 +242,10 @@ static DECLARE_THREAD_FUNCTION(thdJg10, msg) { (inRange(x-1,y) && jg10Field[x-1][y].num == jg10Field[x][y].num) || (inRange(x,y+1) && jg10Field[x][y+1].num == jg10Field[x][y].num) || (inRange(x+1,y) && jg10Field[x+1][y].num == jg10Field[x][y].num)) { - gwinSetVisible(Jg10SelectWidget, FALSE); + gwinSetVisible(Jg10SelectWidget, gFalse); clean_SelCheck(); - jg10Field[x][y].check = TRUE; - gwinSetVisible(Jg10SelectWidget, TRUE); + jg10Field[x][y].check = gTrue; + gwinSetVisible(Jg10SelectWidget, gTrue); } } else { // already selected section clicked... @@ -254,19 +254,19 @@ static DECLARE_THREAD_FUNCTION(thdJg10, msg) { jg10MaxVal = jg10Field[x][y].num; if (jg10MaxVal >= 10) printCongrats(); if (jg10MaxVal == 20) { // Just in case someone got so far :D I cannot imaginge though - jg10GameOver = TRUE; + jg10GameOver = gTrue; printGameOver(); } } - jg10Field[x][y].sel = FALSE; - gwinSetVisible(Jg10SelectWidget, FALSE); + jg10Field[x][y].sel = gFalse; + gwinSetVisible(Jg10SelectWidget, gFalse); remove_Selected(); movePiecesDown(); if (checkForPossibleMove()) { clean_SelCheck(); //gwinRedraw(mainWin); } else { - jg10GameOver = TRUE; + jg10GameOver = gTrue; printGameOver(); } } @@ -284,11 +284,11 @@ static void initField(void) { //jg10Field[x][y].num = 1; // good for animation testing //jg10Field[x][y].num = x+x+5; // good to get high score fast //jg10Field[x][y].num = x+y+5; // good demo to check out pieces :D - jg10Field[x][y].check = FALSE; - jg10Field[x][y].sel = FALSE; + jg10Field[x][y].check = gFalse; + jg10Field[x][y].sel = gFalse; } } - jg10GameOver = FALSE; + jg10GameOver = gFalse; printGameOver(); } @@ -304,21 +304,21 @@ static void mainWinDraw(GWidgetObject* gw, void* param) { static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) { int16_t x, y; - bool_t needToCheck = TRUE; + gBool needToCheck = gTrue; (void)param; while (needToCheck) { - needToCheck = FALSE; + needToCheck = gFalse; for (x = 0; x < JG10_FIELD_WIDTH; x++) { for (y = 0; y < JG10_FIELD_HEIGHT; y++) { if (jg10Field[x][y].check && !jg10Field[x][y].sel) { - jg10Field[x][y].sel = TRUE; - jg10Field[x][y].check = FALSE; + jg10Field[x][y].sel = gTrue; + jg10Field[x][y].check = gFalse; // Up if (inRange(x, y-1) && !jg10Field[x][y-1].sel && (jg10Field[x][y-1].num == jg10Field[x][y].num)) { - jg10Field[x][y-1].check = TRUE; - needToCheck = TRUE; + jg10Field[x][y-1].check = gTrue; + needToCheck = gTrue; } else if (!inRange(x, y-1) || (inRange(x, y-1) && !jg10Field[x][y-1].sel)) { // We need longer line if this is wide corner inside shape if (inRange(x+1, y) && inRange(x+1, y-1) && (jg10Field[x][y].num == jg10Field[x+1][y].num) && (jg10Field[x][y].num == jg10Field[x+1][y-1].num)) { @@ -329,8 +329,8 @@ static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) { } // Down if (inRange(x, y+1) && !jg10Field[x][y+1].sel && (jg10Field[x][y+1].num == jg10Field[x][y].num)) { - jg10Field[x][y+1].check = TRUE; - needToCheck = TRUE; + jg10Field[x][y+1].check = gTrue; + needToCheck = gTrue; } else if (!inRange(x, y+1) || (inRange(x, y+1) && !jg10Field[x][y+1].sel)) { // We need longer line if this is wide corner inside shape if (inRange(x-1, y) && inRange(x-1, y+1) && (jg10Field[x][y].num == jg10Field[x-1][y].num) && (jg10Field[x][y].num == jg10Field[x-1][y+1].num)) { @@ -341,8 +341,8 @@ static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) { } // Left if (inRange(x-1, y) && !jg10Field[x-1][y].sel && (jg10Field[x-1][y].num == jg10Field[x][y].num)) { - jg10Field[x-1][y].check = TRUE; - needToCheck = TRUE; + jg10Field[x-1][y].check = gTrue; + needToCheck = gTrue; } else if (!inRange(x-1, y) || (inRange(x-1, y) && !jg10Field[x-1][y].sel)) { // We need longer line if this is wide corner inside shape if (inRange(x, y-1) && inRange(x-1, y-1) && (jg10Field[x][y].num == jg10Field[x][y-1].num) && (jg10Field[x][y].num == jg10Field[x-1][y-1].num)) { @@ -353,8 +353,8 @@ static void jg10SelectionWidget_Draw(GWidgetObject* gw, void* param) { } // Right if (inRange(x+1, y) && !jg10Field[x+1][y].sel && (jg10Field[x+1][y].num == jg10Field[x][y].num)) { - jg10Field[x+1][y].check = TRUE; - needToCheck = TRUE; + jg10Field[x+1][y].check = gTrue; + needToCheck = gTrue; } else if (!inRange(x+1, y) || (inRange(x+1, y) && !jg10Field[x+1][y].sel)) { // We need longer line if this is wide corner inside shape if (inRange(x, y+1) && inRange(x+1, y+1) && (jg10Field[x][y].num == jg10Field[x][y+1].num) && (jg10Field[x][y].num == jg10Field[x+1][y+1].num)) { @@ -422,7 +422,7 @@ static void createMainWin(void) { GWidgetInit wi; gwinWidgetClearInit(&wi); // Container - mainWin - wi.g.show = FALSE; + wi.g.show = gFalse; wi.g.x = 0; wi.g.y = 0; wi.g.width = gdispGetWidth(); @@ -435,7 +435,7 @@ static void createMainWin(void) { mainWin = gwinContainerCreate(0, &wi, 0); // create selection widget - wi.g.show = FALSE; + wi.g.show = gFalse; wi.g.x = 0; wi.g.y = 0; wi.g.width = 272; @@ -496,6 +496,6 @@ void jg10ShowSplash(void) { gdispImageOpenFile(&jg10SplashImage, "splash.bmp"); gdispImageDraw(&jg10SplashImage, (gdispGetWidth()/2)-150, (gdispGetHeight()/2)-100, 300, 200, 0, 0); gdispImageClose(&jg10SplashImage); - gtimerStart(&jg10SplashBlink, jg10SplashBlinker, 0, TRUE, 400); + gtimerStart(&jg10SplashBlink, jg10SplashBlinker, 0, gTrue, 400); } #endif \ No newline at end of file diff --git a/demos/games/justget10/main.c b/demos/games/justget10/main.c index 29749686..d4238fed 100644 --- a/demos/games/justget10/main.c +++ b/demos/games/justget10/main.c @@ -21,7 +21,7 @@ int main(void) gdispCloseFont(font); #endif - while (TRUE) { + while (1) { ginputGetMouseStatus(0, &ev); if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { while (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { // Wait until release diff --git a/demos/games/minesweeper/main.c b/demos/games/minesweeper/main.c index e7a105bf..54b79743 100644 --- a/demos/games/minesweeper/main.c +++ b/demos/games/minesweeper/main.c @@ -55,7 +55,7 @@ int main(void) gdispCloseFont(font); #endif - while (TRUE) { + while (1) { ginputGetMouseStatus(0, &ev); if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { while (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { // Wait until release diff --git a/demos/games/minesweeper/mines.c b/demos/games/minesweeper/mines.c index 8b0cd292..1b58fc6b 100644 --- a/demos/games/minesweeper/mines.c +++ b/demos/games/minesweeper/mines.c @@ -4,16 +4,16 @@ typedef struct { // Node properties uint8_t num; // Node number, how many mines around - bool_t open; // Node shown or hidden - bool_t check; // Node needs to be checked or not, used for opening up empty nodes - bool_t flag; // Node is marked with flag by player + gBool open; // Node shown or hidden + gBool check; // Node needs to be checked or not, used for opening up empty nodes + gBool flag; // Node is marked with flag by player uint16_t fieldNum; // Node number, used to randomize gamestart "animation" } nodeProps; static GEventMouse ev; static nodeProps minesField[MINES_FIELD_WIDTH][MINES_FIELD_HEIGHT]; // Mines field array -static bool_t minesGameOver = FALSE; -static bool_t minesGameWinner = FALSE; +static gBool minesGameOver = gFalse; +static gBool minesGameWinner = gFalse; static int16_t minesEmptyNodes; // Empty node counter static int16_t minesFlags; // Flag counter static int16_t minesTime; // Time counter @@ -22,8 +22,8 @@ static const char* minesGraph[] = {"1.bmp","2.bmp","3.bmp","4.bmp","5.bmp","6.bm static gdispImage minesImage; static uint8_t minesStatusIconWidth = 0; static uint8_t minesStatusIconHeight = 0; -static bool_t minesFirstGame = TRUE; // Just don't clear field for the first time, as we have black screen already... :/ -static bool_t minesSplashTxtVisible = FALSE; +static gBool minesFirstGame = gTrue; // Just don't clear field for the first time, as we have black screen already... :/ +static gBool minesSplashTxtVisible = gFalse; #if MINES_SHOW_SPLASH static GTimer minesSplashBlink; #endif @@ -125,19 +125,19 @@ static void minesTimeCounter(void* arg) minesUpdateTime(); } -static bool_t inRange(int16_t x, int16_t y) +static gBool inRange(int16_t x, int16_t y) { if ((x >= 0) && (x < MINES_FIELD_WIDTH) && (y >= 0) && (y < MINES_FIELD_HEIGHT)) - return TRUE; + return gTrue; else - return FALSE; + return gFalse; } static void showOne(int16_t x, int16_t y) { - minesField[x][y].open = TRUE; + minesField[x][y].open = gTrue; if (minesField[x][y].flag) { - minesField[x][y].flag = FALSE; + minesField[x][y].flag = gFalse; minesFlags--; } @@ -149,8 +149,8 @@ static void showOne(int16_t x, int16_t y) gdispImageClose(&minesImage); minesEmptyNodes--; } else if (minesField[x][y].num == 9) { - minesGameOver = TRUE; - minesGameWinner = FALSE; + minesGameOver = gTrue; + minesGameWinner = gFalse; gdispImageOpenFile(&minesImage, minesGraph[10]); gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, 0, 0); gdispImageClose(&minesImage); @@ -160,7 +160,7 @@ static void showOne(int16_t x, int16_t y) gdispImageOpenFile(&minesImage, minesGraph[9]); gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, 0, 0); gdispImageClose(&minesImage); - minesField[x][y].check = TRUE; + minesField[x][y].check = gTrue; minesEmptyNodes--; } } @@ -168,10 +168,10 @@ static void showOne(int16_t x, int16_t y) static void openEmptyNodes(void) { int16_t x, y, i, j; - bool_t needToCheck = TRUE; + gBool needToCheck = gTrue; while (needToCheck) { - needToCheck = FALSE; + needToCheck = gFalse; for (x = 0; x < MINES_FIELD_WIDTH; x++) { for (y = 0; y < MINES_FIELD_HEIGHT; y++) { if (minesField[x][y].check) { @@ -180,12 +180,12 @@ static void openEmptyNodes(void) if ((i != 0) || (j != 0)) { // We don't need to check middle node as it is the one we are checking right now! :D if (inRange(x+i,y+j)) { if (!minesField[x+i][y+j].open) showOne(x+i,y+j); - if (minesField[x+i][y+j].check) needToCheck = TRUE; + if (minesField[x+i][y+j].check) needToCheck = gTrue; } } } } - minesField[x][y].check = FALSE; + minesField[x][y].check = gFalse; } } } @@ -196,15 +196,15 @@ static DECLARE_THREAD_FUNCTION(thdMines, msg) { (void)msg; uint16_t x,y, delay; - bool_t delayed = FALSE; + gBool delayed = gFalse; while (!minesGameOver) { if (minesEmptyNodes == 0) { - minesGameOver = TRUE; - minesGameWinner = TRUE; + minesGameOver = gTrue; + minesGameWinner = gTrue; } initRng(); ginputGetMouseStatus(0, &ev); - delayed = FALSE; + delayed = gFalse; if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { x = ev.x/MINES_CELL_WIDTH; y = ev.y/MINES_CELL_WIDTH; @@ -220,18 +220,18 @@ static DECLARE_THREAD_FUNCTION(thdMines, msg) gdispImageOpenFile(&minesImage, minesGraph[8]); gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH-1, MINES_CELL_HEIGHT-1, 0, 0); gdispImageClose(&minesImage); - minesField[x][y].flag = FALSE; + minesField[x][y].flag = gFalse; minesFlags--; printStats(); } else { gdispImageOpenFile(&minesImage, minesGraph[11]); gdispImageDraw(&minesImage, (x*MINES_CELL_HEIGHT)+1, (y*MINES_CELL_WIDTH)+1, MINES_CELL_WIDTH, MINES_CELL_HEIGHT, 0, 0); gdispImageClose(&minesImage); - minesField[x][y].flag = TRUE; + minesField[x][y].flag = gTrue; minesFlags++; printStats(); } - delayed = TRUE; + delayed = gTrue; } } } @@ -268,7 +268,7 @@ static void initField(void) int16_t x, y, mines, i, j; minesFlags = 0; - minesGameOver = FALSE; + minesGameOver = gFalse; printGameOver(); font_t font = gdispOpenFont("fixed_5x8"); @@ -291,9 +291,9 @@ static void initField(void) for (x = 0; x < MINES_FIELD_WIDTH; x++) { for (y = 0; y < MINES_FIELD_HEIGHT; y++) { minesField[x][y].num = 0; - minesField[x][y].open = FALSE; - minesField[x][y].check = FALSE; - minesField[x][y].flag = FALSE; + minesField[x][y].open = gFalse; + minesField[x][y].check = gFalse; + minesField[x][y].flag = gFalse; minesField[x][y].fieldNum = i; i++; } @@ -322,7 +322,7 @@ static void initField(void) } } } else { - minesFirstGame = FALSE; + minesFirstGame = gFalse; } // Drawing closed nodes randomly @@ -369,7 +369,7 @@ static void initField(void) minesTime = 0; minesUpdateTime(); - gtimerStart(&minesTimeCounterTimer, minesTimeCounter, 0, TRUE, 1000); + gtimerStart(&minesTimeCounterTimer, minesTimeCounter, 0, gTrue, 1000); } void minesStart(void) @@ -434,7 +434,7 @@ void minesStart(void) gdispImageDraw(&minesImage, (gdispGetWidth()/2)-150, (gdispGetHeight()/2)-100, 300, 200, 0, 0); gdispImageClose(&minesImage); - gtimerStart(&minesSplashBlink, minesSplashBlinker, 0, TRUE, 400); + gtimerStart(&minesSplashBlink, minesSplashBlinker, 0, gTrue, 400); } #endif diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h index 833ebdb4..dc3580e6 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h @@ -111,7 +111,7 @@ static GFXINLINE void post_init_board(GDisplay *g) { (void) g; } -static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { +static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) g; (void) state; } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h b/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h index 39538747..0568d4e5 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/ginput_lld_mouse_board.h @@ -26,7 +26,7 @@ static GFXINLINE void init_board(void) spiStart(&SPID1, &spicfg); } -static GFXINLINE bool_t getpin_pressed(void) +static GFXINLINE gBool getpin_pressed(void) { return (!palReadPad(GPIOC, 4)); } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h index dc8e979e..1af92bb2 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h @@ -45,12 +45,12 @@ static const SPIConfig spicfg = { // How much extra data to allocate at the end of the GMouse structure for the board's use #define GMOUSE_ADS7843_BOARD_DATA_SIZE 0 -static bool_t init_board(GMouse* m, unsigned driverinstance) { +static gBool init_board(GMouse* m, unsigned driverinstance) { (void)m; // Only one touch interface on this board if (driverinstance) - return FALSE; + return gFalse; // Set the GPIO modes palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL); @@ -62,10 +62,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) { // Start the SPI peripheral spiStart(&SPID1, &spicfg); - return TRUE; + return gTrue; } -static GFXINLINE bool_t getpin_pressed(GMouse* m) { +static GFXINLINE gBool getpin_pressed(GMouse* m) { (void) m; return (!palReadPad(GPIOC, 4)); diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old index 77d82bf8..70a22ee3 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old +++ b/demos/games/tetris/Example_Makefiles/stm32f4/gmouse_lld_ADS7843_board.h.old @@ -22,13 +22,13 @@ static const SPIConfig spicfg = { /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0, }; -static bool_t init_board(GMouse* m, unsigned driverinstance) +static gBool init_board(GMouse* m, unsigned driverinstance) { (void)m; // Only one touch interface on this board if (driverinstance) - return FALSE; + return gFalse; // Set the GPIO modes palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL); @@ -40,10 +40,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) // Start the SPI peripheral spiStart(&SPID1, &spicfg); - return TRUE; + return gTrue; } -GFXINLINE bool_t getpin_pressed(void) { +GFXINLINE gBool getpin_pressed(void) { return (!palReadPad(GPIOC, 4)); } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h index a74507e5..7e2bb05d 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h @@ -109,7 +109,7 @@ static GFXINLINE void post_init_board(GDisplay *g) { (void) g; } -static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { +static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) g; (void) state; } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h index 39538747..0568d4e5 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/ginput_lld_mouse_board.h @@ -26,7 +26,7 @@ static GFXINLINE void init_board(void) spiStart(&SPID1, &spicfg); } -static GFXINLINE bool_t getpin_pressed(void) +static GFXINLINE gBool getpin_pressed(void) { return (!palReadPad(GPIOC, 4)); } diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h index 77d82bf8..70a22ee3 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/gmouse_lld_ADS7843_board.h @@ -22,13 +22,13 @@ static const SPIConfig spicfg = { /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0, }; -static bool_t init_board(GMouse* m, unsigned driverinstance) +static gBool init_board(GMouse* m, unsigned driverinstance) { (void)m; // Only one touch interface on this board if (driverinstance) - return FALSE; + return gFalse; // Set the GPIO modes palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL); @@ -40,10 +40,10 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) // Start the SPI peripheral spiStart(&SPID1, &spicfg); - return TRUE; + return gTrue; } -GFXINLINE bool_t getpin_pressed(void) { +GFXINLINE gBool getpin_pressed(void) { return (!palReadPad(GPIOC, 4)); } diff --git a/demos/games/tetris/main.c b/demos/games/tetris/main.c index ffbccf6c..705813ab 100644 --- a/demos/games/tetris/main.c +++ b/demos/games/tetris/main.c @@ -43,7 +43,7 @@ int main(void) tetrisInit(); - while (TRUE) { + while (1) { // Start a new game // Will return when game is over tetrisStart(); diff --git a/demos/games/tetris/tetris.c b/demos/games/tetris/tetris.c index ed924781..cf73c978 100644 --- a/demos/games/tetris/tetris.c +++ b/demos/games/tetris/tetris.c @@ -86,9 +86,9 @@ int tetrisOldShape[4][2]; int tetrisNextShapeNum, tetrisOldShapeNum; unsigned long tetrisLines = 0; unsigned long tetrisScore = 0; -bool_t tetrisKeysPressed[5] = {FALSE, FALSE, FALSE, FALSE, FALSE}; // left/down/right/up/pause -bool_t tetrisPaused = FALSE; -bool_t tetrisGameOver = FALSE; +gBool tetrisKeysPressed[5] = {gFalse, gFalse, gFalse, gFalse, gFalse}; // left/down/right/up/pause +gBool tetrisPaused = gFalse; +gBool tetrisGameOver = gFalse; font_t font16; font_t font12; @@ -274,34 +274,34 @@ static void printTouchAreas(void) { gdispDrawLine(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-1, GFX_GRAY); } -static bool_t stay(bool_t down) { +static gBool stay(gBool down) { int sk, k; - bool_t stay; - if (down == TRUE) sk = 1; else sk = 0; - stay = FALSE; + gBool stay; + if (down) sk = 1; else sk = 0; + stay = gFalse; for (k = 0; k <= 3; k++) { if (tetrisCurrentShape[k][1] == 0) { - return TRUE; + return gTrue; } } for (k = 0; k <= 3; k++) { - if ((tetrisCurrentShape[k][0] < 0) || (tetrisCurrentShape[k][0] > 9)) return TRUE; + if ((tetrisCurrentShape[k][0] < 0) || (tetrisCurrentShape[k][0] > 9)) return gTrue; if (tetrisCurrentShape[k][1] <= 16) - if (tetrisField[tetrisCurrentShape[k][1]-sk][tetrisCurrentShape[k][0]] != 0) return TRUE; + if (tetrisField[tetrisCurrentShape[k][1]-sk][tetrisCurrentShape[k][0]] != 0) return gTrue; } return stay; } static void clearCompleteLines(void) { - bool_t t; + gBool t; uint8_t reiz = 0; int l,k,j; l = 0; while (l <= 16) { - t = TRUE; + t = gTrue; for (j = 0; j <= 9; j++) - if (tetrisField[l][j] == 0) t = FALSE; - if (t == TRUE) { + if (tetrisField[l][j] == 0) t = gFalse; + if (t) { for (j = 4; j >= 0; j--) { // cheap & dirty line removal animation :D drawCell(j,l, 0); drawCell(9-j,l, 0); @@ -331,7 +331,7 @@ static void clearCompleteLines(void) { static void goDown(void) { int i; - if (stay(TRUE) == FALSE) { + if (!stay(gTrue)) { drawShape(0); for (i = 0; i <= 3; i++) { tetrisCurrentShape[i][1]--; @@ -340,7 +340,7 @@ static void goDown(void) { } else { for (i = 0; i <= 3; i++) { if (tetrisCurrentShape[i][1] >=17) { - tetrisGameOver = TRUE; + tetrisGameOver = gTrue; return; } else { tetrisField[tetrisCurrentShape[i][1]][tetrisCurrentShape[i][0]] = tetrisOldShapeNum+1; @@ -348,8 +348,8 @@ static void goDown(void) { } clearCompleteLines(); createShape(); - if (stay(FALSE) == TRUE) { - tetrisGameOver = TRUE; + if (stay(gFalse)) { + tetrisGameOver = gTrue; return; } drawShape(tetrisOldShapeNum+1); @@ -383,7 +383,7 @@ static void rotateShape(void) { tetrisCurrentShape[i][0] = ox+(round((tx-ox)*cos(90*(3.14/180))-(ty-oy)*sin(90*(3.14/180)))); tetrisCurrentShape[i][1] = oy+(round((tx-ox)*sin(90*(3.14/180))+(ty-oy)*cos(90*(3.14/180)))); } - if (stay(FALSE) == FALSE) { + if (!stay(gFalse)) { memcpy(tetrisNextShape, tetrisCurrentShape, sizeof(tetrisNextShape)); // tetrisNextShape = tetrisCurrentShape; memcpy(tetrisCurrentShape, tetrisOldShape, sizeof(tetrisCurrentShape)); // tetrisCurrentShape = tetrisOldShape; drawShape(0); @@ -394,20 +394,20 @@ static void rotateShape(void) { } } -static bool_t checkSides(bool_t left) { +static gBool checkSides(gBool left) { int sk,k; - if (left == TRUE) sk = 1; else sk = -1; + if (left) sk = 1; else sk = -1; for (k = 0; k <= 3; k++) { - if ((tetrisCurrentShape[k][0]+sk < 0) || (tetrisCurrentShape[k][0]+sk > 9)) return TRUE; + if ((tetrisCurrentShape[k][0]+sk < 0) || (tetrisCurrentShape[k][0]+sk > 9)) return gTrue; if (tetrisCurrentShape[k][1] <= 16) - if (tetrisField[tetrisCurrentShape[k][1]][tetrisCurrentShape[k][0]+sk] != 0) return TRUE; + if (tetrisField[tetrisCurrentShape[k][1]][tetrisCurrentShape[k][0]+sk] != 0) return gTrue; } - return FALSE; + return gFalse; } static void goRight(void) { int i; - if (checkSides(TRUE) == FALSE) { + if (!checkSides(gTrue)) { drawShape(0); for (i = 0; i <= 3; i++) { tetrisCurrentShape[i][0]++; @@ -418,7 +418,7 @@ static void goRight(void) { static void goLeft(void) { int i; - if (checkSides(FALSE) == FALSE) { + if (!checkSides(gFalse)) { drawShape(0); for (i = 0; i <= 3; i++) { tetrisCurrentShape[i][0]--; @@ -434,8 +434,8 @@ static DECLARE_THREAD_FUNCTION(thdTetris, arg) { // key handling if (gfxSystemTicks() - tetrisPreviousKeyTime >= gfxMillisecondsToTicks(tetrisKeySpeed) || gfxSystemTicks() <= gfxMillisecondsToTicks(tetrisKeySpeed)) { for (i = 0; i < sizeof(tetrisKeysPressed); i++) { - if (tetrisKeysPressed[i] == TRUE) { - tetrisKeysPressed[i] = FALSE; + if (tetrisKeysPressed[i]) { + tetrisKeysPressed[i] = gFalse; } } tetrisPreviousKeyTime = gfxSystemTicks(); @@ -447,28 +447,28 @@ static DECLARE_THREAD_FUNCTION(thdTetris, arg) { tetrisPreviousGameTime = gfxSystemTicks(); } if (!(ev.buttons & GINPUT_MOUSE_BTN_LEFT)) continue; - if (ev.x <= gdispGetWidth()/4 && ev.y >= gdispGetHeight()-(gdispGetHeight()/4) && tetrisKeysPressed[0] == FALSE && !tetrisPaused) { + if (ev.x <= gdispGetWidth()/4 && ev.y >= gdispGetHeight()-(gdispGetHeight()/4) && !tetrisKeysPressed[0] && !tetrisPaused) { goLeft(); - tetrisKeysPressed[0] = TRUE; + tetrisKeysPressed[0] = gTrue; tetrisPreviousKeyTime = gfxSystemTicks(); } - if (ev.x > gdispGetWidth()-(gdispGetWidth()/4) && ev.y >= gdispGetHeight()-(gdispGetHeight()/4) && tetrisKeysPressed[2] == FALSE && !tetrisPaused) { + if (ev.x > gdispGetWidth()-(gdispGetWidth()/4) && ev.y >= gdispGetHeight()-(gdispGetHeight()/4) && !tetrisKeysPressed[2] && !tetrisPaused) { goRight(); - tetrisKeysPressed[2] = TRUE; + tetrisKeysPressed[2] = gTrue; tetrisPreviousKeyTime = gfxSystemTicks(); } - if (ev.y > gdispGetHeight()/4 && ev.y < gdispGetHeight()-(gdispGetHeight()/4) && tetrisKeysPressed[3] == FALSE && !tetrisPaused) { + if (ev.y > gdispGetHeight()/4 && ev.y < gdispGetHeight()-(gdispGetHeight()/4) && !tetrisKeysPressed[3] && !tetrisPaused) { rotateShape(); - tetrisKeysPressed[3] = TRUE; + tetrisKeysPressed[3] = gTrue; tetrisPreviousKeyTime = gfxSystemTicks(); } - if (ev.x > gdispGetWidth()/4 && ev.x <= gdispGetWidth()-(gdispGetWidth()/4) && ev.y >= gdispGetHeight()-(gdispGetHeight()/4) && tetrisKeysPressed[1] == FALSE && !tetrisPaused) { + if (ev.x > gdispGetWidth()/4 && ev.x <= gdispGetWidth()-(gdispGetWidth()/4) && ev.y >= gdispGetHeight()-(gdispGetHeight()/4) && !tetrisKeysPressed[1] && !tetrisPaused) { goDown(); - tetrisKeysPressed[1] = TRUE; + tetrisKeysPressed[1] = gTrue; tetrisPreviousKeyTime = gfxSystemTicks(); } - if (ev.y <= gdispGetHeight()/4 && tetrisKeysPressed[4] == FALSE) { - tetrisKeysPressed[4] = TRUE; + if (ev.y <= gdispGetHeight()/4 && !tetrisKeysPressed[4]) { + tetrisKeysPressed[4] = gTrue; tetrisPaused = !tetrisPaused; printPaused(); tetrisPreviousKeyTime = gfxSystemTicks(); @@ -495,8 +495,8 @@ void tetrisStart(void) { // Away we go initField(); - tetrisGameOver = FALSE; - printGameOver(); // removes "Game Over!" if tetrisGameOver == FALSE + tetrisGameOver = gFalse; + printGameOver(); // removes "Game Over!" if tetrisGameOver == gFalse tetrisPreviousGameTime = gfxSystemTicks(); gfxThreadCreate(0, 1024, NORMAL_PRIORITY, thdTetris, 0); while (!tetrisGameOver) { diff --git a/demos/modules/gadc/gwinosc.c b/demos/modules/gadc/gwinosc.c index f29107bc..e82cd7d8 100644 --- a/demos/modules/gadc/gwinosc.c +++ b/demos/modules/gadc/gwinosc.c @@ -89,10 +89,10 @@ void gwinScopeWaitForTrace(GHandle gh) { GDataBuffer *pd; uint8_t shr; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP - bool_t rdytrigger; + gBool rdytrigger; int flsamples; #elif TRIGGER_METHOD == TRIGGER_MINVALUE - bool_t rdytrigger; + gBool rdytrigger; int flsamples; coord_t scopemin; #endif @@ -116,10 +116,10 @@ void gwinScopeWaitForTrace(GHandle gh) { pc = gs->lastscopetrace+x; pa = (adcsample_t *)(pd+1); #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP - rdytrigger = FALSE; + rdytrigger = gFalse; flsamples = 0; #elif TRIGGER_METHOD == TRIGGER_MINVALUE - rdytrigger = FALSE; + rdytrigger = gFalse; flsamples = 0; scopemin = 0; #endif @@ -144,7 +144,7 @@ void gwinScopeWaitForTrace(GHandle gh) { #if TRIGGER_METHOD == TRIGGER_MINVALUE /* Arm when we reach the sample minimum (y value maximum) of the previous trace */ if (!rdytrigger && y >= gs->scopemin) - rdytrigger = TRUE; + rdytrigger = gTrue; #endif if (y == gs->lasty) { @@ -157,7 +157,7 @@ void gwinScopeWaitForTrace(GHandle gh) { flsamples = 0; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP /* Arm the trigger when samples fall (y increases) ie. negative slope */ - rdytrigger = TRUE; + rdytrigger = gTrue; #endif continue; } else { @@ -169,7 +169,7 @@ void gwinScopeWaitForTrace(GHandle gh) { } /* Ready for a the next trigger cycle */ - rdytrigger = FALSE; + rdytrigger = gFalse; #endif /* Prepare for a scope trace */ diff --git a/demos/modules/gadc/main.c b/demos/modules/gadc/main.c index ee54a118..5d07f8eb 100644 --- a/demos/modules/gadc/main.c +++ b/demos/modules/gadc/main.c @@ -154,7 +154,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; + wi.show = gTrue; wi.x = wi.y = 0; wi.width = swidth-SCOPE_CX; wi.height = sheight; @@ -166,7 +166,7 @@ int main(void) { /* Start our timer for reading the dial */ gtimerInit(&lsTimer); - gtimerStart(&lsTimer, LowSpeedTimer, ghText, TRUE, MY_LS_DELAY); + gtimerStart(&lsTimer, LowSpeedTimer, ghText, gTrue, MY_LS_DELAY); #endif /** @@ -188,7 +188,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; + wi.show = gTrue; wi.x = swidth-SCOPE_CX; wi.y = 0; wi.width = SCOPE_CX; @@ -200,7 +200,7 @@ int main(void) { gwinClear(ghScope); /* Just keep displaying the scope traces */ - while (TRUE) { + while (1) { /** * The function below internally performs a wait thus giving the timer thread a * chance to run. diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c index fcad648f..38edb35e 100644 --- a/demos/modules/gaudio/oscilloscope/gwinosc.c +++ b/demos/modules/gaudio/oscilloscope/gwinosc.c @@ -106,10 +106,10 @@ void gwinScopeWaitForTrace(GHandle gh) { uint8_t shr; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP - bool_t rdytrigger; + gBool rdytrigger; int flsamples; #elif TRIGGER_METHOD == TRIGGER_MINVALUE - bool_t rdytrigger; + gBool rdytrigger; int flsamples; coord_t scopemin; #endif @@ -136,10 +136,10 @@ void gwinScopeWaitForTrace(GHandle gh) { pa16 = (uint16_t *)(paud+1); #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP - rdytrigger = FALSE; + rdytrigger = gFalse; flsamples = 0; #elif TRIGGER_METHOD == TRIGGER_MINVALUE - rdytrigger = FALSE; + rdytrigger = gFalse; flsamples = 0; scopemin = 0; #endif @@ -167,7 +167,7 @@ void gwinScopeWaitForTrace(GHandle gh) { #if TRIGGER_METHOD == TRIGGER_MINVALUE /* Arm when we reach the sample minimum (y value maximum) of the previous trace */ if (!rdytrigger && y >= gs->scopemin) - rdytrigger = TRUE; + rdytrigger = gTrue; #endif if (y == gs->lasty) { @@ -180,7 +180,7 @@ void gwinScopeWaitForTrace(GHandle gh) { flsamples = 0; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP /* Arm the trigger when samples fall (y increases) ie. negative slope */ - rdytrigger = TRUE; + rdytrigger = gTrue; #endif continue; } else { @@ -192,7 +192,7 @@ void gwinScopeWaitForTrace(GHandle gh) { } /* Ready for a the next trigger cycle */ - rdytrigger = FALSE; + rdytrigger = gFalse; #endif /* Prepare for a scope trace */ diff --git a/demos/modules/gaudio/oscilloscope/main.c b/demos/modules/gaudio/oscilloscope/main.c index 335b2cee..cd62e1f1 100644 --- a/demos/modules/gaudio/oscilloscope/main.c +++ b/demos/modules/gaudio/oscilloscope/main.c @@ -74,7 +74,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; + wi.show = gTrue; wi.x = wi.y = 0; wi.width = swidth; wi.height = sheight; ghScope = gwinScopeCreate(&gScopeWindow, &wi, MY_AUDIO_CHANNEL, MY_AUDIO_FREQUENCY, MY_AUDIO_FORMAT); @@ -84,7 +84,7 @@ int main(void) { gwinClear(ghScope); /* Just keep displaying the scope traces */ - while (TRUE) { + while (1) { gwinScopeWaitForTrace(ghScope); } } diff --git a/demos/modules/gaudio/play-vs1053/main.c b/demos/modules/gaudio/play-vs1053/main.c index 66ac5f8d..21e28c98 100644 --- a/demos/modules/gaudio/play-vs1053/main.c +++ b/demos/modules/gaudio/play-vs1053/main.c @@ -114,6 +114,6 @@ theend: if (errmsg) gdispDrawString(0, gdispGetHeight()/2, errmsg, font, GFX_RED); - while(TRUE) + while(1) gfxSleepMilliseconds(1000); } diff --git a/demos/modules/gaudio/play-wave/main.c b/demos/modules/gaudio/play-wave/main.c index af3df7d1..4c863fcf 100644 --- a/demos/modules/gaudio/play-wave/main.c +++ b/demos/modules/gaudio/play-wave/main.c @@ -139,7 +139,7 @@ repeatplay: len += 20; // Read RIFF blocks until we get to the data RIFF block (contains the audio) - while(TRUE) { + while(1) { if (gfileRead(f, whdr, 8) != 8) { errmsg = "Err: Read block"; goto theend; @@ -196,6 +196,6 @@ theend: if (errmsg) gdispDrawString(0, gdispGetHeight()/2, errmsg, font, GFX_RED); - while(TRUE) + while(1) gfxSleepMilliseconds(1000); } diff --git a/demos/modules/gdisp/basics/main.c b/demos/modules/gdisp/basics/main.c index ccf98d22..9517e0a6 100644 --- a/demos/modules/gdisp/basics/main.c +++ b/demos/modules/gdisp/basics/main.c @@ -48,7 +48,7 @@ int main(void) { for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) gdispDrawPixel(i, j, GFX_WHITE); - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gdisp/circles/main.c b/demos/modules/gdisp/circles/main.c index 4efb896a..e631da1a 100644 --- a/demos/modules/gdisp/circles/main.c +++ b/demos/modules/gdisp/circles/main.c @@ -47,7 +47,7 @@ int main(void) { gdispFillEllipse (width-width/6, height-height/6, width/8, height/16, GFX_BLUE); gdispDrawEllipse (width-width/6, height-height/6, width/16, height/8, GFX_YELLOW); - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gdisp/fonts/main.c b/demos/modules/gdisp/fonts/main.c index 73d7c54e..a0d888dc 100644 --- a/demos/modules/gdisp/fonts/main.c +++ b/demos/modules/gdisp/fonts/main.c @@ -88,7 +88,7 @@ int main(void) { gdispFillStringBox(0, y, width, fheight1, buf, font1, GFX_RED, GFX_WHITE, justifyCenter); // Wait forever - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gdisp/fonts_cyrillic/main.c b/demos/modules/gdisp/fonts_cyrillic/main.c index b65801a1..1f6a30a9 100644 --- a/demos/modules/gdisp/fonts_cyrillic/main.c +++ b/demos/modules/gdisp/fonts_cyrillic/main.c @@ -42,7 +42,7 @@ int main(void) { gdispDrawString(10, 10, "привет мир", font1, GFX_YELLOW); // Wait forever - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c index 8b38a22a..ea05507b 100644 --- a/demos/modules/gdisp/multiple_displays/main.c +++ b/demos/modules/gdisp/multiple_displays/main.c @@ -83,7 +83,7 @@ gdispGDrawPixel(g, i, j, GFX_WHITE); } - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } @@ -126,7 +126,7 @@ gdispDrawPixel(i, j, GFX_WHITE); } - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gdisp/pixmap/main.c b/demos/modules/gdisp/pixmap/main.c index a6791ec9..975611c8 100644 --- a/demos/modules/gdisp/pixmap/main.c +++ b/demos/modules/gdisp/pixmap/main.c @@ -62,7 +62,7 @@ int main(void) { gdispGDrawLine(pixmap, 0, 0, gdispGGetWidth(pixmap)-1, gdispGGetHeight(pixmap)-1, GFX_WHITE); i = j = 0; - while(TRUE) { + while(1) { // Clear the old position gdispFillArea(i, j, PIXMAP_WIDTH, PIXMAP_HEIGHT, GFX_BLACK); diff --git a/demos/modules/gdisp/polygons/main.c b/demos/modules/gdisp/polygons/main.c index 8a4f7df3..277fd0bf 100644 --- a/demos/modules/gdisp/polygons/main.c +++ b/demos/modules/gdisp/polygons/main.c @@ -103,7 +103,7 @@ int main(void) { transmaxy = INT2MTYPE(height - 15); transminy = INT2MTYPE(15); - while(TRUE) { + while(1) { // Move to the new location, rotation and scale scalex += scaleincx; diff --git a/demos/modules/gdisp/thickarcs/main.c b/demos/modules/gdisp/thickarcs/main.c index adf42810..c190d43c 100644 --- a/demos/modules/gdisp/thickarcs/main.c +++ b/demos/modules/gdisp/thickarcs/main.c @@ -43,7 +43,7 @@ int main(void) // Initialize the uGFX library gfxInit(); - while(TRUE) { + while(1) { // Clear the entire screen gdispClear(GFX_BLACK); diff --git a/demos/modules/ginput/keyboard/main.c b/demos/modules/ginput/keyboard/main.c index dec93125..e521207f 100644 --- a/demos/modules/ginput/keyboard/main.c +++ b/demos/modules/ginput/keyboard/main.c @@ -54,7 +54,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; + wi.show = gTrue; wi.x = 0; wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight(); GW = gwinConsoleCreate(0, &wi); diff --git a/demos/modules/gos/threads/main.c b/demos/modules/gos/threads/main.c index 97b1c7e4..56ea4bb9 100644 --- a/demos/modules/gos/threads/main.c +++ b/demos/modules/gos/threads/main.c @@ -26,7 +26,7 @@ threadreturn_t heartbeat1(void* param) { (void)param; - while (TRUE) { + while (1) { DEBUGWRITE("thread 1\n"); gfxSleepMilliseconds(500); } @@ -38,7 +38,7 @@ threadreturn_t heartbeat2(void* param) { (void)param; - while (TRUE) { + while (1) { DEBUGWRITE("thread 2\n"); gfxSleepMilliseconds(900); } @@ -54,7 +54,7 @@ int main(void) gfxThreadCreate(0, 2048, NORMAL_PRIORITY, heartbeat1, 0); gfxThreadCreate(0, 2048, NORMAL_PRIORITY, heartbeat2, 0); - while (TRUE) { + while (1) { DEBUGWRITE("thread main\n"); gfxSleepMilliseconds(1400); } diff --git a/demos/modules/gos/threads_advanced/main.c b/demos/modules/gos/threads_advanced/main.c index 89cada9f..8527194e 100644 --- a/demos/modules/gos/threads_advanced/main.c +++ b/demos/modules/gos/threads_advanced/main.c @@ -65,11 +65,11 @@ gfxThreadHandle thd; */ threadreturn_t Thread_function(void* param) { - /* Cast the paramter into a bool pointer so we can use it */ - bool_t* doExit = (bool_t*)param; + /* Cast the paramter into a gBool pointer so we can use it */ + gBool* doExit = (gBool*)param; /* Execute this until we shall be terminated */ - while (*doExit == FALSE) { + while (!*doExit) { DEBUGWRITE("Message from Thread\n"); gfxSleepMilliseconds(500); } @@ -84,12 +84,12 @@ threadreturn_t Thread_function(void* param) */ void timerCallback(void* param) { - /* Cast the paramter into a bool pointer so we can use it */ - bool_t* threadExit = (bool_t*)param; + /* Cast the paramter into a gBool pointer so we can use it */ + gBool* threadExit = (gBool*)param; /* Ask the Thread to fall over the end */ DEBUGWRITE("Closing thread!\n"); - *threadExit = TRUE; + *threadExit = gTrue; } /* @@ -97,7 +97,7 @@ void timerCallback(void* param) */ int main(void) { - bool_t exitThread = FALSE; + gBool exitThread = gFalse; gfxInit(); @@ -112,9 +112,9 @@ int main(void) /* Start the timer. The callback function will be called once after 2000ms * We will pass the thread handle as a parameter so the timer can ask the thread to terminate */ - gtimerStart(>, timerCallback, (void*)&exitThread, FALSE, 2000); + gtimerStart(>, timerCallback, (void*)&exitThread, gFalse, 2000); - while(TRUE) { + while(1) { DEBUGWRITE("Message from main!\n"); gfxSleepMilliseconds(500); } diff --git a/demos/modules/gtimer/main.c b/demos/modules/gtimer/main.c index 89a6bab7..7612772c 100644 --- a/demos/modules/gtimer/main.c +++ b/demos/modules/gtimer/main.c @@ -51,12 +51,12 @@ int main(void) { gtimerInit(>2); /* continious mode - callback1() called without any argument every 250ms */ - gtimerStart(>1, callback1, 0, TRUE, 250); + gtimerStart(>1, callback1, 0, gTrue, 250); /* single shot mode - callback2() called without any argument once after 1s */ - gtimerStart(>2, callback2, 0, FALSE, 1000); + gtimerStart(>2, callback2, 0, gFalse, 1000); - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } diff --git a/demos/modules/gtrans/basic/main.c b/demos/modules/gtrans/basic/main.c index 77430a46..da42aa46 100644 --- a/demos/modules/gtrans/basic/main.c +++ b/demos/modules/gtrans/basic/main.c @@ -91,7 +91,7 @@ int main(void) gtransSetBaseLanguage(&EnglishTranslation); // Loop through the languages - while (TRUE) { + while (1) { // English gtransSetLanguage(&EnglishTranslation); updateText(); diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c index e5b66f17..901f9e6d 100644 --- a/demos/modules/gwin/basic/main.c +++ b/demos/modules/gwin/basic/main.c @@ -44,9 +44,9 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = 20; wi.y = 10; wi.width = 200; wi.height = 150; + wi.show = gTrue; wi.x = 20; wi.y = 10; wi.width = 200; wi.height = 150; GW1 = gwinWindowCreate(0, &wi); - wi.show = TRUE; wi.x = 50; wi.y = 190; wi.width = 150; wi.height = 100; + wi.show = gTrue; wi.x = 50; wi.y = 190; wi.width = 150; wi.height = 100; GW2 = gwinWindowCreate(0, &wi); } @@ -72,7 +72,7 @@ int main(void) { gwinFillCircle(GW1, 20, 20, 15); gwinFillCircle(GW2, 20, 20, 15); - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 29a5641f..6e766e74 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -37,7 +37,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // Apply the button parameters wi.g.width = 100; @@ -64,7 +64,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget @@ -90,7 +90,7 @@ int main(void) { // corner which should translate safely into any orientation. gdispSetOrientation(orients[which]); gdispClear(GFX_WHITE); - gwinRedrawDisplay(GDISP, FALSE); + gwinRedrawDisplay(GDISP, gFalse); } break; diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index 00f3ebdb..486c4057 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -37,7 +37,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // Apply the checkbox parameters wi.g.width = 100; // includes text @@ -58,7 +58,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c index 248aeedf..53b80fcb 100644 --- a/demos/modules/gwin/console/main.c +++ b/demos/modules/gwin/console/main.c @@ -49,7 +49,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; + wi.show = gTrue; wi.x = 0; wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight()/2; GW1 = gwinConsoleCreate(0, &wi); wi.y = gdispGetHeight()/2; wi.width = gdispGetWidth()/2; wi.height = gdispGetHeight(); @@ -92,13 +92,13 @@ int main(void) { /* Make console 3 invisible and then visible again to demonstrate the history buffer */ gwinPrintf(GW2, "Making red window \033uinvisible\033U\n"); - gwinSetVisible(GW3, FALSE); + gwinSetVisible(GW3, gFalse); gfxSleepMilliseconds(1000); gwinPrintf(GW2, "Making red window \033uvisible\033U\n"); - gwinSetVisible(GW3, TRUE); + gwinSetVisible(GW3, gTrue); gwinPrintf(GW3, "\033bI'm back!!!\033B\n", i+1); - while(TRUE) { + while(1) { gfxSleepMilliseconds(500); } } diff --git a/demos/modules/gwin/container/main.c b/demos/modules/gwin/container/main.c index af2e8b1f..d43eca93 100644 --- a/demos/modules/gwin/container/main.c +++ b/demos/modules/gwin/container/main.c @@ -10,14 +10,14 @@ static void createWidgets(void) { gwinWidgetClearInit(&wi); // Apply the container parameters - wi.g.show = FALSE; + wi.g.show = gFalse; wi.g.width = 200; wi.g.height = 150; wi.g.y = 10; wi.g.x = 10; wi.text = "Container"; ghContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); - wi.g.show = TRUE; + wi.g.show = gTrue; // Apply the button parameters wi.g.width = 120; @@ -39,7 +39,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // Create the widget diff --git a/demos/modules/gwin/container_nested/main.c b/demos/modules/gwin/container_nested/main.c index 0e5a2634..6d86704e 100644 --- a/demos/modules/gwin/container_nested/main.c +++ b/demos/modules/gwin/container_nested/main.c @@ -10,7 +10,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = FALSE; + wi.g.show = gFalse; // Container 1 wi.g.width = 300; @@ -20,7 +20,7 @@ static void createWidgets(void) { wi.text = "Container 1"; ghContainer1 = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); - wi.g.show = TRUE; + wi.g.show = gTrue; // Container 2 wi.g.width = 100; @@ -117,7 +117,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // Create the widget @@ -128,9 +128,9 @@ int main(void) { gwinAttachListener(&gl); // Set the initial state of the checkboxes - gwinCheckboxCheck(ghCheckbox1, TRUE); - gwinCheckboxCheck(ghCheckbox2, TRUE); - gwinCheckboxCheck(ghCheckbox3, TRUE); + gwinCheckboxCheck(ghCheckbox1, gTrue); + gwinCheckboxCheck(ghCheckbox2, gTrue); + gwinCheckboxCheck(ghCheckbox3, gTrue); while(1) { // Get an Event diff --git a/demos/modules/gwin/frame/main.c b/demos/modules/gwin/frame/main.c index aae4cfac..3ee330df 100644 --- a/demos/modules/gwin/frame/main.c +++ b/demos/modules/gwin/frame/main.c @@ -23,7 +23,7 @@ static void _createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // Create a surprise label behind the frame window wi.g.width = 100; @@ -119,7 +119,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/gl3d-gears/main.c b/demos/modules/gwin/gl3d-gears/main.c index 2b450799..882b4253 100644 --- a/demos/modules/gwin/gl3d-gears/main.c +++ b/demos/modules/gwin/gl3d-gears/main.c @@ -270,7 +270,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = (gdispGetWidth()-GL3D_WINDOW_SIZE)/2; wi.y = (gdispGetHeight()-GL3D_WINDOW_SIZE)/2; wi.width = GL3D_WINDOW_SIZE; wi.height = GL3D_WINDOW_SIZE; + wi.show = gTrue; wi.x = (gdispGetWidth()-GL3D_WINDOW_SIZE)/2; wi.y = (gdispGetHeight()-GL3D_WINDOW_SIZE)/2; wi.width = GL3D_WINDOW_SIZE; wi.height = GL3D_WINDOW_SIZE; gh = gwinGL3DCreate(0, &wi); } @@ -278,7 +278,7 @@ int main(void) { setup(); init(); - while(TRUE) { + while(1) { // rate control gfxSleepMilliseconds(FRAME_DELAY); diff --git a/demos/modules/gwin/gl3d-spin/main.c b/demos/modules/gwin/gl3d-spin/main.c index 4da6b053..0f4b397c 100644 --- a/demos/modules/gwin/gl3d-spin/main.c +++ b/demos/modules/gwin/gl3d-spin/main.c @@ -141,7 +141,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = (gdispGetWidth()-GL3D_WINDOW_SIZE)/2; wi.y = (gdispGetHeight()-GL3D_WINDOW_SIZE)/2; wi.width = GL3D_WINDOW_SIZE; wi.height = GL3D_WINDOW_SIZE; + wi.show = gTrue; wi.x = (gdispGetWidth()-GL3D_WINDOW_SIZE)/2; wi.y = (gdispGetHeight()-GL3D_WINDOW_SIZE)/2; wi.width = GL3D_WINDOW_SIZE; wi.height = GL3D_WINDOW_SIZE; gh = gwinGL3DCreate(0, &wi); } @@ -162,7 +162,7 @@ int main(void) { Ystep = Zstep = 0.0; - while(TRUE) { + while(1) { // rate control gfxSleepMilliseconds(FRAME_DELAY); diff --git a/demos/modules/gwin/graph/main.c b/demos/modules/gwin/graph/main.c index 2ca4d1a6..c184a939 100644 --- a/demos/modules/gwin/graph/main.c +++ b/demos/modules/gwin/graph/main.c @@ -71,7 +71,7 @@ int main(void) { { GWindowInit wi; - wi.show = TRUE; + wi.show = gTrue; wi.x = wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight(); @@ -105,7 +105,7 @@ int main(void) { // Draw a set of points gwinGraphDrawPoints(gh, data, sizeof(data)/sizeof(data[0])); - while(TRUE) { + while(1) { gfxSleepMilliseconds(100); } } diff --git a/demos/modules/gwin/imagebox/main.c b/demos/modules/gwin/imagebox/main.c index c4f70df2..64156669 100644 --- a/demos/modules/gwin/imagebox/main.c +++ b/demos/modules/gwin/imagebox/main.c @@ -38,7 +38,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // create the first image widget wi.g.x = 10; wi.g.y = 10; wi.g.width = 200; wi.g.height = 100; @@ -52,7 +52,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/keyboard/main.c b/demos/modules/gwin/keyboard/main.c index d81ac6a3..b43e72d1 100644 --- a/demos/modules/gwin/keyboard/main.c +++ b/demos/modules/gwin/keyboard/main.c @@ -43,7 +43,7 @@ static void createWidgets(void) { gwinWidgetClearInit(&wi); // Create the console - set colors before making it visible - wi.g.show = FALSE; + wi.g.show = gFalse; wi.g.x = 0; wi.g.y = 0; wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight()/2; ghConsole = gwinConsoleCreate(0, &wi.g); @@ -53,7 +53,7 @@ static void createWidgets(void) { gwinClear(ghConsole); // Create the keyboard - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 0; wi.g.y = gdispGetHeight()/2; wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight()/2; ghKeyboard = gwinKeyboardCreate(0, &wi); @@ -70,7 +70,7 @@ int main(void) { // Set the widget defaults font = gdispOpenFont("*"); // Get the first defined font. gwinSetDefaultFont(font); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // Create the gwin windows/widgets diff --git a/demos/modules/gwin/label/main.c b/demos/modules/gwin/label/main.c index f1fb6b92..6a2429a4 100644 --- a/demos/modules/gwin/label/main.c +++ b/demos/modules/gwin/label/main.c @@ -37,7 +37,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // Create the IP label wi.g.width = 200; wi.g.height = 20; wi.g.x = 10, wi.g.y = 80; @@ -60,7 +60,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index 22a2074e..86e50e9a 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -38,7 +38,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // Create the label for the first list wi.g.width = 150; wi.g.height = 20; wi.g.x = 10, wi.g.y = 80; @@ -56,7 +56,7 @@ static void createWidgets(void) { wi.g.y = 100; wi.g.x = 10; wi.text = "Name of list 1"; - ghList1 = gwinListCreate(0, &wi, FALSE); + ghList1 = gwinListCreate(0, &wi, gFalse); // The second list widget wi.g.width = 150; @@ -64,7 +64,7 @@ static void createWidgets(void) { wi.g.y = 100; wi.g.x = 165; wi.text = "Name of list 2"; - ghList2 = gwinListCreate(0, &wi, FALSE); + ghList2 = gwinListCreate(0, &wi, gFalse); gwinListSetScroll(ghList2, scrollSmooth); } @@ -76,7 +76,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget @@ -87,40 +87,40 @@ int main(void) { gwinAttachListener(&gl); // Add some items to the first list widget - gwinListAddItem(ghList1, "Item 0", FALSE); - gwinListAddItem(ghList1, "Item 1", FALSE); - gwinListAddItem(ghList1, "Item 2", FALSE); - gwinListAddItem(ghList1, "Item 3", FALSE); - gwinListAddItem(ghList1, "Item 4", FALSE); - gwinListAddItem(ghList1, "Item 5", FALSE); - gwinListAddItem(ghList1, "Item 6", FALSE); - gwinListAddItem(ghList1, "Item 7", FALSE); - gwinListAddItem(ghList1, "Item 8", FALSE); - gwinListAddItem(ghList1, "Item 9", FALSE); - gwinListAddItem(ghList1, "Item 10", FALSE); - gwinListAddItem(ghList1, "Item 11", FALSE); - gwinListAddItem(ghList1, "Item 12", FALSE); - gwinListAddItem(ghList1, "Item 13", FALSE); + gwinListAddItem(ghList1, "Item 0", gFalse); + gwinListAddItem(ghList1, "Item 1", gFalse); + gwinListAddItem(ghList1, "Item 2", gFalse); + gwinListAddItem(ghList1, "Item 3", gFalse); + gwinListAddItem(ghList1, "Item 4", gFalse); + gwinListAddItem(ghList1, "Item 5", gFalse); + gwinListAddItem(ghList1, "Item 6", gFalse); + gwinListAddItem(ghList1, "Item 7", gFalse); + gwinListAddItem(ghList1, "Item 8", gFalse); + gwinListAddItem(ghList1, "Item 9", gFalse); + gwinListAddItem(ghList1, "Item 10", gFalse); + gwinListAddItem(ghList1, "Item 11", gFalse); + gwinListAddItem(ghList1, "Item 12", gFalse); + gwinListAddItem(ghList1, "Item 13", gFalse); // Add some items to the second list widget // This time we will disable the render until // all the items have been added - gwinListEnableRender(ghList2, FALSE); - gwinListAddItem(ghList2, "Item 0", FALSE); - gwinListAddItem(ghList2, "Item 1", FALSE); - gwinListAddItem(ghList2, "Item 2", FALSE); - gwinListAddItem(ghList2, "Item 3", FALSE); - gwinListAddItem(ghList2, "Item 4", FALSE); - gwinListAddItem(ghList2, "Item 5", FALSE); - gwinListAddItem(ghList2, "Item 6", FALSE); - gwinListAddItem(ghList2, "Item 7", FALSE); - gwinListAddItem(ghList2, "Item 8", FALSE); - gwinListAddItem(ghList2, "Item 9", FALSE); - gwinListAddItem(ghList2, "Item 10", FALSE); - gwinListAddItem(ghList2, "Item 11", FALSE); - gwinListAddItem(ghList2, "Item 12", FALSE); - gwinListAddItem(ghList2, "Item 13", FALSE); - gwinListEnableRender(ghList2, TRUE); + gwinListEnableRender(ghList2, gFalse); + gwinListAddItem(ghList2, "Item 0", gFalse); + gwinListAddItem(ghList2, "Item 1", gFalse); + gwinListAddItem(ghList2, "Item 2", gFalse); + gwinListAddItem(ghList2, "Item 3", gFalse); + gwinListAddItem(ghList2, "Item 4", gFalse); + gwinListAddItem(ghList2, "Item 5", gFalse); + gwinListAddItem(ghList2, "Item 6", gFalse); + gwinListAddItem(ghList2, "Item 7", gFalse); + gwinListAddItem(ghList2, "Item 8", gFalse); + gwinListAddItem(ghList2, "Item 9", gFalse); + gwinListAddItem(ghList2, "Item 10", gFalse); + gwinListAddItem(ghList2, "Item 11", gFalse); + gwinListAddItem(ghList2, "Item 12", gFalse); + gwinListAddItem(ghList2, "Item 13", gFalse); + gwinListEnableRender(ghList2, gTrue); while(1) { // Get an Event diff --git a/demos/modules/gwin/progressbar/main.c b/demos/modules/gwin/progressbar/main.c index 374728cf..cf285014 100644 --- a/demos/modules/gwin/progressbar/main.c +++ b/demos/modules/gwin/progressbar/main.c @@ -6,7 +6,7 @@ static void _createWidget(void) { GWidgetInit wi; gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "Progress 1"; ghProgressbar = gwinProgressbarCreate(0, &wi); @@ -16,7 +16,7 @@ int main(void) { gfxInit(); gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); _createWidget(); diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index 18c34e4c..f6cc5b4d 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -41,7 +41,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // create Radio11 wi.g.y = 10; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1"; @@ -80,7 +80,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index 5e90c554..b813a393 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -37,7 +37,7 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // create Slider1 wi.g.y = 10; wi.g.x = 10; wi.g.width = gdispGetWidth()-20; wi.g.height = 20; wi.text = "S1"; @@ -48,7 +48,7 @@ static void createWidgets(void) { ghSlider2 = gwinSliderCreate(0, &wi); // Set slider 2 to return extended events - gwinSliderSendExtendedEvents(ghSlider2, TRUE); + gwinSliderSendExtendedEvents(ghSlider2, gTrue); // Some options to try //gwinSliderSetRange(ghSlider1, 0, 70000); @@ -69,7 +69,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/tabset/main.c b/demos/modules/gwin/tabset/main.c index c4472c39..bedd7ed8 100644 --- a/demos/modules/gwin/tabset/main.c +++ b/demos/modules/gwin/tabset/main.c @@ -39,14 +39,14 @@ static void createWidgets(void) { // Apply some default values for GWIN gwinWidgetClearInit(&wi); - wi.g.show = TRUE; + wi.g.show = gTrue; // Create the Tabset wi.g.width = 200; wi.g.height = 200; wi.g.x = 10, wi.g.y = 10; ghTabset = gwinTabsetCreate(0, &wi, GWIN_TABSET_BORDER); - ghPage1 = gwinTabsetAddTab(ghTabset, "Page 1", FALSE); - ghPage2 = gwinTabsetAddTab(ghTabset, "Page 2", FALSE); - ghPage3 = gwinTabsetAddTab(ghTabset, "Page 3", FALSE); + ghPage1 = gwinTabsetAddTab(ghTabset, "Page 1", gFalse); + ghPage2 = gwinTabsetAddTab(ghTabset, "Page 2", gFalse); + ghPage3 = gwinTabsetAddTab(ghTabset, "Page 3", gFalse); // Add some widgets to Page 1 wi.g.width = 120; wi.g.height = 20; wi.g.x = 10; wi.g.y = 10; @@ -75,7 +75,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // create the widget diff --git a/demos/modules/gwin/textedit/main.c b/demos/modules/gwin/textedit/main.c index b3fafcf0..490a949c 100644 --- a/demos/modules/gwin/textedit/main.c +++ b/demos/modules/gwin/textedit/main.c @@ -44,7 +44,7 @@ static void guiCreate(void) gwinWidgetClearInit(&wi); // Console - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 0; wi.g.y = 0; wi.g.width = gdispGetWidth()/2; @@ -56,7 +56,7 @@ static void guiCreate(void) gwinClear(ghConsole); // TextEdit1 - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = gdispGetWidth()/2 + 10; wi.g.y = 20; wi.g.width = 200; @@ -65,28 +65,28 @@ static void guiCreate(void) ghTextedit1 = gwinTexteditCreate(0, &wi, 100); // TextEdit2 - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = gdispGetWidth()/2 + 10; wi.g.y = 100; wi.g.width = 200; wi.g.height = 35; wi.text = "to switch between"; ghTextedit2 = gwinTexteditCreate(0, &wi, 20); - //gwinTexteditSetBorder(ghTextedit2, FALSE); + //gwinTexteditSetBorder(ghTextedit2, gFalse); // TextEdit3 - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = gdispGetWidth()/2 + 10; wi.g.y = 180; wi.g.width = 200; wi.g.height = 35; wi.text = "the different widgets"; ghTextedit3 = gwinTexteditCreate(0, &wi, 100); - //gwinTexteditSetBorder(ghTextedit3, TRUE); + //gwinTexteditSetBorder(ghTextedit3, gTrue); // Virtual keyboard #if GWIN_NEED_KEYBOARD - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 0; wi.g.y = gdispGetHeight()*3/4; wi.g.width = gdispGetWidth(); @@ -104,7 +104,7 @@ int main(void) { gdispClear(GFX_SILVER); gwinSetDefaultFont(gdispOpenFont("DejaVuSans16")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gwinSetDefaultColor(GFX_BLACK); gwinSetDefaultBgColor(GFX_WHITE); diff --git a/demos/modules/gwin/textedit_virtual_keyboard/main.c b/demos/modules/gwin/textedit_virtual_keyboard/main.c index 6bc29a57..a7af1e08 100644 --- a/demos/modules/gwin/textedit_virtual_keyboard/main.c +++ b/demos/modules/gwin/textedit_virtual_keyboard/main.c @@ -41,7 +41,7 @@ static void guiCreate(void) gwinWidgetClearInit(&wi); // TextEdit1 - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 10; wi.g.y = 20; wi.g.width = 200; @@ -50,7 +50,7 @@ static void guiCreate(void) ghTextedit1 = gwinTexteditCreate(0, &wi, 100); // TextEdit2 - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 10; wi.g.y = 100; wi.g.width = 200; @@ -59,7 +59,7 @@ static void guiCreate(void) ghTextedit2 = gwinTexteditCreate(0, &wi, 20); // TextEdit3 - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 10; wi.g.y = 180; wi.g.width = 200; @@ -68,7 +68,7 @@ static void guiCreate(void) ghTextedit3 = gwinTexteditCreate(0, &wi, 100); // Virtual keyboard - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = 0; wi.g.y = (gdispGetHeight()/2); wi.g.width = gdispGetWidth(); @@ -82,7 +82,7 @@ int main(void) gdispClear(GFX_SILVER); gwinSetDefaultFont(gdispOpenFont("DejaVuSans16")); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gwinSetDefaultColor(GFX_BLACK); gwinSetDefaultBgColor(GFX_WHITE); diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index 5f98387e..8e56af90 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -203,18 +203,18 @@ static void createWidgets(void) { // Create the Tabs #if GWIN_NEED_TABSET - wi.g.show = TRUE; + wi.g.show = gTrue; wi.g.x = border; wi.g.y = 0; wi.g.width = ScrWidth - 2*border; wi.g.height = ScrHeight-wi.g.y-border; ghTabset = gwinTabsetCreate(0, &wi, GWIN_TABSET_BORDER); - ghPgButtons = gwinTabsetAddTab(ghTabset, "Buttons", FALSE); - ghPgSliders = gwinTabsetAddTab(ghTabset, "Sliders", FALSE); - ghPgCheckboxes = gwinTabsetAddTab(ghTabset, "Checkbox", FALSE); - ghPgRadios = gwinTabsetAddTab(ghTabset, "Radios", FALSE); - ghPgLists = gwinTabsetAddTab(ghTabset, "Lists", FALSE); - ghPgLabels = gwinTabsetAddTab(ghTabset, "Labels", FALSE); - ghPgImages = gwinTabsetAddTab(ghTabset, "Images", FALSE); - ghPgProgressbars = gwinTabsetAddTab(ghTabset, "Progressbar", FALSE); + ghPgButtons = gwinTabsetAddTab(ghTabset, "Buttons", gFalse); + ghPgSliders = gwinTabsetAddTab(ghTabset, "Sliders", gFalse); + ghPgCheckboxes = gwinTabsetAddTab(ghTabset, "Checkbox", gFalse); + ghPgRadios = gwinTabsetAddTab(ghTabset, "Radios", gFalse); + ghPgLists = gwinTabsetAddTab(ghTabset, "Lists", gFalse); + ghPgLabels = gwinTabsetAddTab(ghTabset, "Labels", gFalse); + ghPgImages = gwinTabsetAddTab(ghTabset, "Images", gFalse); + ghPgProgressbars = gwinTabsetAddTab(ghTabset, "Progressbar", gFalse); pagewidth = gwinGetInnerWidth(ghTabset)/2; @@ -229,7 +229,7 @@ static void createWidgets(void) { gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0)); #else - wi.g.show = TRUE; wi.customDraw = gwinRadioDraw_Tab; + wi.g.show = gTrue; wi.customDraw = gwinRadioDraw_Tab; wi.g.height = TAB_HEIGHT; wi.g.y = 0; wi.g.x = 0; setbtntext(&wi, ScrWidth, "Buttons"); ghTabButtons = gwinRadioCreate(0, &wi, GROUP_TABS); @@ -251,7 +251,7 @@ static void createWidgets(void) { wi.customDraw = 0; // Create the Pages - wi.g.show = FALSE; + wi.g.show = gFalse; wi.g.x = border; wi.g.y += border; wi.g.width = ScrWidth/2 - border; wi.g.height = ScrHeight-wi.g.y-border; ghPgButtons = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); @@ -262,7 +262,7 @@ static void createWidgets(void) { ghPgLabels = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); ghPgImages = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); ghPgProgressbars = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); - wi.g.show = TRUE; + wi.g.show = gTrue; // Console - we apply some special colors before making it visible wi.g.x = ScrWidth/2+border; @@ -363,62 +363,62 @@ static void createWidgets(void) { wi.g.parent = ghPgLists; wi.g.width = LIST_WIDTH; wi.g.height = LIST_HEIGHT; wi.g.y = border; wi.g.x = border; wi.text = "L1"; - ghList1 = gwinListCreate(0, &wi, FALSE); - gwinListAddItem(ghList1, "Item 0", FALSE); - gwinListAddItem(ghList1, "Item 1", FALSE); - gwinListAddItem(ghList1, "Item 2", FALSE); - gwinListAddItem(ghList1, "Item 3", FALSE); - gwinListAddItem(ghList1, "Item 4", FALSE); - gwinListAddItem(ghList1, "Item 5", FALSE); - gwinListAddItem(ghList1, "Item 6", FALSE); - gwinListAddItem(ghList1, "Item 7", FALSE); - gwinListAddItem(ghList1, "Item 8", FALSE); - gwinListAddItem(ghList1, "Item 9", FALSE); - gwinListAddItem(ghList1, "Item 10", FALSE); - gwinListAddItem(ghList1, "Item 11", FALSE); - gwinListAddItem(ghList1, "Item 12", FALSE); - gwinListAddItem(ghList1, "Item 13", FALSE); + ghList1 = gwinListCreate(0, &wi, gFalse); + gwinListAddItem(ghList1, "Item 0", gFalse); + gwinListAddItem(ghList1, "Item 1", gFalse); + gwinListAddItem(ghList1, "Item 2", gFalse); + gwinListAddItem(ghList1, "Item 3", gFalse); + gwinListAddItem(ghList1, "Item 4", gFalse); + gwinListAddItem(ghList1, "Item 5", gFalse); + gwinListAddItem(ghList1, "Item 6", gFalse); + gwinListAddItem(ghList1, "Item 7", gFalse); + gwinListAddItem(ghList1, "Item 8", gFalse); + gwinListAddItem(ghList1, "Item 9", gFalse); + gwinListAddItem(ghList1, "Item 10", gFalse); + gwinListAddItem(ghList1, "Item 11", gFalse); + gwinListAddItem(ghList1, "Item 12", gFalse); + gwinListAddItem(ghList1, "Item 13", gFalse); wi.text = "L2"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; } - ghList2 = gwinListCreate(0, &wi, TRUE); - gwinListAddItem(ghList2, "Item 0", FALSE); - gwinListAddItem(ghList2, "Item 1", FALSE); - gwinListAddItem(ghList2, "Item 2", FALSE); - gwinListAddItem(ghList2, "Item 3", FALSE); - gwinListAddItem(ghList2, "Item 4", FALSE); - gwinListAddItem(ghList2, "Item 5", FALSE); - gwinListAddItem(ghList2, "Item 6", FALSE); - gwinListAddItem(ghList2, "Item 7", FALSE); - gwinListAddItem(ghList2, "Item 8", FALSE); - gwinListAddItem(ghList2, "Item 9", FALSE); - gwinListAddItem(ghList2, "Item 10", FALSE); - gwinListAddItem(ghList2, "Item 11", FALSE); - gwinListAddItem(ghList2, "Item 12", FALSE); - gwinListAddItem(ghList2, "Item 13", FALSE); + ghList2 = gwinListCreate(0, &wi, gTrue); + gwinListAddItem(ghList2, "Item 0", gFalse); + gwinListAddItem(ghList2, "Item 1", gFalse); + gwinListAddItem(ghList2, "Item 2", gFalse); + gwinListAddItem(ghList2, "Item 3", gFalse); + gwinListAddItem(ghList2, "Item 4", gFalse); + gwinListAddItem(ghList2, "Item 5", gFalse); + gwinListAddItem(ghList2, "Item 6", gFalse); + gwinListAddItem(ghList2, "Item 7", gFalse); + gwinListAddItem(ghList2, "Item 8", gFalse); + gwinListAddItem(ghList2, "Item 9", gFalse); + gwinListAddItem(ghList2, "Item 10", gFalse); + gwinListAddItem(ghList2, "Item 11", gFalse); + gwinListAddItem(ghList2, "Item 12", gFalse); + gwinListAddItem(ghList2, "Item 13", gFalse); wi.text = "L3"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; } - ghList3 = gwinListCreate(0, &wi, TRUE); - gwinListAddItem(ghList3, "Item 0", FALSE); - gwinListAddItem(ghList3, "Item 1", FALSE); - gwinListAddItem(ghList3, "Item 2", FALSE); - gwinListAddItem(ghList3, "Item 3", FALSE); + ghList3 = gwinListCreate(0, &wi, gTrue); + gwinListAddItem(ghList3, "Item 0", gFalse); + gwinListAddItem(ghList3, "Item 1", gFalse); + gwinListAddItem(ghList3, "Item 2", gFalse); + gwinListAddItem(ghList3, "Item 3", gFalse); gdispImageOpenFile(&imgYesNo, "image_yesno.gif"); gwinListItemSetImage(ghList3, 1, &imgYesNo); gwinListItemSetImage(ghList3, 3, &imgYesNo); wi.text = "L4"; wi.g.x += LIST_WIDTH+border; if (wi.g.x + LIST_WIDTH > pagewidth) { wi.g.x = border; wi.g.y += LIST_HEIGHT+border; } - ghList4 = gwinListCreate(0, &wi, TRUE); - gwinListAddItem(ghList4, "Item 0", FALSE); - gwinListAddItem(ghList4, "Item 1", FALSE); - gwinListAddItem(ghList4, "Item 2", FALSE); - gwinListAddItem(ghList4, "Item 3", FALSE); - gwinListAddItem(ghList4, "Item 4", FALSE); - gwinListAddItem(ghList4, "Item 5", FALSE); - gwinListAddItem(ghList4, "Item 6", FALSE); - gwinListAddItem(ghList4, "Item 7", FALSE); - gwinListAddItem(ghList4, "Item 8", FALSE); - gwinListAddItem(ghList4, "Item 9", FALSE); - gwinListAddItem(ghList4, "Item 10", FALSE); - gwinListAddItem(ghList4, "Item 11", FALSE); - gwinListAddItem(ghList4, "Item 12", FALSE); - gwinListAddItem(ghList4, "Item 13", FALSE); + ghList4 = gwinListCreate(0, &wi, gTrue); + gwinListAddItem(ghList4, "Item 0", gFalse); + gwinListAddItem(ghList4, "Item 1", gFalse); + gwinListAddItem(ghList4, "Item 2", gFalse); + gwinListAddItem(ghList4, "Item 3", gFalse); + gwinListAddItem(ghList4, "Item 4", gFalse); + gwinListAddItem(ghList4, "Item 5", gFalse); + gwinListAddItem(ghList4, "Item 6", gFalse); + gwinListAddItem(ghList4, "Item 7", gFalse); + gwinListAddItem(ghList4, "Item 8", gFalse); + gwinListAddItem(ghList4, "Item 9", gFalse); + gwinListAddItem(ghList4, "Item 10", gFalse); + gwinListAddItem(ghList4, "Item 11", gFalse); + gwinListAddItem(ghList4, "Item 12", gFalse); + gwinListAddItem(ghList4, "Item 13", gFalse); gwinListSetScroll(ghList4, scrollSmooth); // Image @@ -443,25 +443,25 @@ static void setLabels(void) { // The sliders snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider1)); - gwinSetText(ghLabelSlider1, tmp, TRUE); + gwinSetText(ghLabelSlider1, tmp, gTrue); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider2)); - gwinSetText(ghLabelSlider2, tmp, TRUE); + gwinSetText(ghLabelSlider2, tmp, gTrue); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider3)); - gwinSetText(ghLabelSlider3, tmp, TRUE); + gwinSetText(ghLabelSlider3, tmp, gTrue); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider4)); - gwinSetText(ghLabelSlider4, tmp, TRUE); + gwinSetText(ghLabelSlider4, tmp, gTrue); // The radio buttons if (gwinRadioIsPressed(ghRadio1)) - gwinSetText(ghLabelRadio1, "Yes", TRUE); + gwinSetText(ghLabelRadio1, "Yes", gTrue); else if (gwinRadioIsPressed(ghRadio2)) - gwinSetText(ghLabelRadio1, "No", TRUE); + gwinSetText(ghLabelRadio1, "No", gTrue); } /** * Control the progress bar auto-increment */ -static void setProgressbar(bool_t onoff) { +static void setProgressbar(gBool onoff) { if (onoff) gwinProgressbarStart(ghProgressbar1, 500); else { @@ -473,7 +473,7 @@ static void setProgressbar(bool_t onoff) { /** * Set the enabled state of every widget (except the tabs etc) */ -static void setEnabled(bool_t ena) { +static void setEnabled(gBool ena) { gwinSetEnabled(ghPgButtons, ena); gwinSetEnabled(ghPgSliders, ena); gwinSetEnabled(ghPgLabels, ena); @@ -485,7 +485,7 @@ static void setEnabled(bool_t ena) { gwinSetEnabled(ghCheckbox1, ena); gwinSetEnabled(ghCheckbox2, ena); gwinSetEnabled(ghCheckbox3, ena); - //gwinSetEnabled(ghCheckDisableAll, TRUE); + //gwinSetEnabled(ghCheckDisableAll, gTrue); } static void FlashOffFn(void *param) { @@ -503,7 +503,7 @@ int main(void) { // Set the widget defaults font = gdispOpenFont("*"); // Get the first defined font. gwinSetDefaultFont(font); - gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); + gwinSetDefaultStyle(&WhiteWidgetStyle, gFalse); gdispClear(GFX_WHITE); // Create the gwin windows/widgets @@ -557,7 +557,7 @@ int main(void) { // If it is the toggle button checkbox start the flash. } else if (((GEventGWinCheckbox *)pe)->gwin == ghCheckbox3) { gwinFlash(ghCheckbox3); - gtimerStart(&FlashTimer, FlashOffFn, 0, FALSE, 3000); + gtimerStart(&FlashTimer, FlashOffFn, 0, gFalse, 3000); } break; @@ -600,7 +600,7 @@ int main(void) { gdispClear(pstyle->background); // Update the style on all controls - gwinSetDefaultStyle(pstyle, TRUE); + gwinSetDefaultStyle(pstyle, gTrue); } break; } diff --git a/demos/tools/touch_calibration_grabber/main.c b/demos/tools/touch_calibration_grabber/main.c index 9f16bb90..e6017030 100644 --- a/demos/tools/touch_calibration_grabber/main.c +++ b/demos/tools/touch_calibration_grabber/main.c @@ -63,7 +63,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = 0; wi.y = bHeight; wi.width = swidth; wi.height = sheight-bHeight; + wi.show = gTrue; wi.x = 0; wi.y = bHeight; wi.width = swidth; wi.height = sheight-bHeight; ghc = gwinConsoleCreate(&gc, &wi); } diff --git a/demos/tools/touch_driver_test/main.c b/demos/tools/touch_driver_test/main.c index 5182056a..8a4e5304 100644 --- a/demos/tools/touch_driver_test/main.c +++ b/demos/tools/touch_driver_test/main.c @@ -42,7 +42,7 @@ static coord_t bWidth, bWidth2, bHeight; static GHandle ghc; static coord_t swidth, sheight; -static void DrawHeader(const char *title, bool_t btnNext, bool_t btnPrev, bool_t btnPlusMinus) { +static void DrawHeader(const char *title, gBool btnNext, gBool btnPrev, gBool btnPlusMinus) { #if GDISP_NEED_CLIP gdispSetClip(0, 0, swidth, sheight); #endif @@ -87,10 +87,10 @@ static int CheckButtons(GEventMouse *pem) { int main(void) { GSourceHandle gs; GEventMouse *pem; - bool_t isFirstTime; - bool_t isCalibrated; - bool_t isTouch; - bool_t isFinger; + gBool isFirstTime; + gBool isCalibrated; + gBool isTouch; + gBool isFinger; const char * isFingerText; const char * deviceText; GMouse * m; @@ -122,7 +122,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = 0; wi.y = bHeight; wi.width = swidth; wi.height = sheight-bHeight; + wi.show = gTrue; wi.x = 0; wi.y = bHeight; wi.width = swidth; wi.height = sheight-bHeight; ghc = gwinConsoleCreate(&gc, &wi); } @@ -144,8 +144,8 @@ int main(void) { geventAttachSource(&gl, gs, GLISTEN_MOUSEDOWNMOVES|GLISTEN_MOUSEMETA); // Get initial display settings for buttons - isFirstTime = TRUE; - isCalibrated = (vmt->d.flags & GMOUSE_VFLG_CALIBRATE) ? FALSE : TRUE; + isFirstTime = gTrue; + isCalibrated = (vmt->d.flags & GMOUSE_VFLG_CALIBRATE) ? gFalse : gTrue; calerr = 0; /* @@ -156,8 +156,8 @@ StepDeviceType: DrawHeader("1. Device Type", isCalibrated, isCalibrated && !isFirstTime, isCalibrated); // Get the type of device and the current mode - isTouch = (vmt->d.flags & GMOUSE_VFLG_TOUCH) ? TRUE : FALSE; - isFinger = (m->flags & GMOUSE_FLG_FINGERMODE) ? TRUE : FALSE; + isTouch = (vmt->d.flags & GMOUSE_VFLG_TOUCH) ? gTrue : gFalse; + isFinger = (m->flags & GMOUSE_FLG_FINGERMODE) ? gTrue : gFalse; pjit = isFinger ? &vmt->finger_jitter : &vmt->pen_jitter; isFingerText = isFinger ? "finger" : "pen"; deviceText = isTouch ? isFingerText : "mouse"; @@ -205,7 +205,7 @@ StepDeviceType: */ StepRawReading: - DrawHeader("2. Raw Mouse Output", FALSE, FALSE, FALSE); + DrawHeader("2. Raw Mouse Output", gFalse, gFalse, gFalse); if (isTouch) gwinPrintf(ghc, "Press and hold on the surface.\n\n"); else @@ -292,7 +292,7 @@ StepCalibrate: calerr = ginputCalibrateMouse(0); if (calerr) goto StepCalibrate; - isCalibrated = TRUE; + isCalibrated = gTrue; } /* @@ -300,7 +300,7 @@ StepCalibrate: */ StepMouseCoords: - DrawHeader("4. Show Mouse Coordinates", TRUE, TRUE, TRUE); + DrawHeader("4. Show Mouse Coordinates", gTrue, gTrue, gTrue); if (isTouch) gwinPrintf(ghc, "Press and hold on the surface.\n\n"); else @@ -345,7 +345,7 @@ StepMouseCoords: */ StepMovementJitter: - DrawHeader("5. Movement Jitter", TRUE, TRUE, TRUE); + DrawHeader("5. Movement Jitter", gTrue, gTrue, gTrue); if (isTouch) gwinPrintf(ghc, "Press firmly on the surface and move around as if to draw.\n\n"); else @@ -456,6 +456,6 @@ StepDrawing: } // Can't let this really exit - isFirstTime = FALSE; + isFirstTime = gFalse; goto StepDeviceType; } diff --git a/demos/tools/touch_raw_readings/main.c b/demos/tools/touch_raw_readings/main.c index 27c799f7..1e19f69f 100644 --- a/demos/tools/touch_raw_readings/main.c +++ b/demos/tools/touch_raw_readings/main.c @@ -68,7 +68,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = 0; wi.y = bHeight; wi.width = swidth; wi.height = sheight-bHeight; + wi.show = gTrue; wi.x = 0; wi.y = bHeight; wi.width = swidth; wi.height = sheight-bHeight; ghc = gwinConsoleCreate(&gc, &wi); } diff --git a/demos/tools/uGFXnetDisplay/main.c b/demos/tools/uGFXnetDisplay/main.c index 6f4ad4b6..9bf61b47 100644 --- a/demos/tools/uGFXnetDisplay/main.c +++ b/demos/tools/uGFXnetDisplay/main.c @@ -135,9 +135,9 @@ static font_t font; /** * Get a whole packet of data. * Len is specified in the number of uint16_t's we want as our protocol only talks uint16_t's. - * If the connection closes before we get all the data - the call returns FALSE. + * If the connection closes before we get all the data - the call returns gFalse. */ -static bool_t getpkt(uint16_t *pkt, int len) { +static gBool getpkt(uint16_t *pkt, int len) { int got; int have; @@ -149,22 +149,22 @@ static bool_t getpkt(uint16_t *pkt, int len) { len -= got; } if (len) - return FALSE; + return gFalse; // Convert each uint16_t to host order for(got = 0, have /= 2; got < have; got++) pkt[got] = ntohs(pkt[got]); - return TRUE; + return gTrue; } /** * Send a whole packet of data. * Len is specified in the number of uint16_t's we want to send as our protocol only talks uint16_t's. * Note that contents of the packet are modified to ensure it will cross the wire in the correct format. - * If the connection closes before we send all the data - the call returns FALSE. + * If the connection closes before we send all the data - the call returns gFalse. */ -static bool_t sendpkt(uint16_t *pkt, int len) { +static gBool sendpkt(uint16_t *pkt, int len) { int i; // Convert each uint16_t to network order -- cgit v1.2.3