aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-07-08 12:19:30 +1000
committerinmarket <andrewh@inmarket.com.au>2018-07-08 12:19:30 +1000
commit2e8eaa34717f99c9696867b62ff5f19e76a7ccf8 (patch)
tree5842c0ccaaffd195430b83fd2bd9211bd6f1fffe /demos
parent788cbced624d83a4c493182fde15cfa244910294 (diff)
downloaduGFX-2e8eaa34717f99c9696867b62ff5f19e76a7ccf8.tar.gz
uGFX-2e8eaa34717f99c9696867b62ff5f19e76a7ccf8.tar.bz2
uGFX-2e8eaa34717f99c9696867b62ff5f19e76a7ccf8.zip
Added type gJustify to replace V2.x justify_t, and values gJustifyXXX replace justifyXXX
Diffstat (limited to 'demos')
-rw-r--r--demos/3rdparty/notepad-2/notepadApp.c2
-rw-r--r--demos/applications/notepad/main.c10
-rw-r--r--demos/benchmarks/main.c8
-rw-r--r--demos/games/tetris/tetris.c12
-rw-r--r--demos/modules/gdisp/fonts/main.c14
-rw-r--r--demos/modules/gdisp/multiple_displays/main.c8
-rw-r--r--demos/modules/gtrans/basic/main.c8
-rw-r--r--demos/tools/touch_calibration_grabber/main.c2
-rw-r--r--demos/tools/touch_driver_test/main.c10
-rw-r--r--demos/tools/touch_raw_readings/main.c2
-rw-r--r--demos/tools/uGFXnetDisplay/main.c2
11 files changed, 39 insertions, 39 deletions
diff --git a/demos/3rdparty/notepad-2/notepadApp.c b/demos/3rdparty/notepad-2/notepadApp.c
index 722e2c8d..7526faad 100644
--- a/demos/3rdparty/notepad-2/notepadApp.c
+++ b/demos/3rdparty/notepad-2/notepadApp.c
@@ -351,7 +351,7 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) {
NPAD_TITLETEXT_STR,
font,
nCurColorScheme.titleTextColor,
- justifyLeft);
+ gJustifyLeft);
/* Create the drawing window, draw its border */
gdispDrawBox(NPAD_DRAWING_AREA_START_X - 1,
diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c
index 877be7fa..852396c2 100644
--- a/demos/applications/notepad/main.c
+++ b/demos/applications/notepad/main.c
@@ -61,11 +61,11 @@ void drawScreen(void) {
gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_WHITE); /* White */
/* pens */
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, GFX_WHITE, GFX_BLACK, gJustifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, GFX_WHITE, GFX_BLACK, gJustifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, GFX_WHITE, GFX_BLACK, gJustifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, GFX_WHITE, GFX_BLACK, gJustifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, GFX_WHITE, GFX_BLACK, gJustifyCenter);
gdispCloseFont(font1);
gdispCloseFont(font2);
diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c
index 17058610..553af7bd 100644
--- a/demos/benchmarks/main.c
+++ b/demos/benchmarks/main.c
@@ -98,10 +98,10 @@ void benchmark(void) {
height = gdispGetHeight();
font = gdispOpenFont("UI2 Double");
- gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, GFX_WHITE, justifyCenter);
+ gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, GFX_WHITE, gJustifyCenter);
font = gdispOpenFont("UI2");
- gdispDrawStringBox(0, height/2, width, 30, "5000 random rectangles", font, GFX_WHITE, justifyCenter);
+ gdispDrawStringBox(0, height/2, width, 30, "5000 random rectangles", font, GFX_WHITE, gJustifyCenter);
gfxSleepMilliseconds(3000);
@@ -131,8 +131,8 @@ void benchmark(void) {
font = gdispOpenFont("UI2 Double");
gdispClear(GFX_BLACK);
- gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, GFX_WHITE, justifyCenter);
- gdispDrawStringBox(0, height/2, width, 30, pps_str, font, GFX_WHITE, justifyCenter);
+ gdispDrawStringBox(0, 0, width, 30, "ChibiOS/GFX - Benchmark", font, GFX_WHITE, gJustifyCenter);
+ gdispDrawStringBox(0, height/2, width, 30, pps_str, font, GFX_WHITE, gJustifyCenter);
//gdispDrawString(20, height/2, pps_str, font, GFX_WHITE);
}
diff --git a/demos/games/tetris/tetris.c b/demos/games/tetris/tetris.c
index 937ca87a..5beae2e9 100644
--- a/demos/games/tetris/tetris.c
+++ b/demos/games/tetris/tetris.c
@@ -262,12 +262,12 @@ static void printGameOver(void) {
}
static void printTouchAreas(void) {
- gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetFontMetric(font16, fontHeight), "Touch Area's", font16, GFX_WHITE, justifyCenter);
- gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight()/4, "Pause", font16, GFX_GRAY, justifyCenter);
- gdispDrawStringBox(0, gdispGetHeight()/4, gdispGetWidth(), gdispGetHeight()/2, "Rotate", font16, GFX_GRAY, justifyCenter);
- gdispDrawStringBox(0, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Left", font16, GFX_GRAY, justifyCenter);
- gdispDrawStringBox(gdispGetWidth()/4, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/2, gdispGetHeight()/4, "Down", font16, GFX_GRAY, justifyCenter);
- gdispDrawStringBox(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Right", font16, GFX_GRAY, justifyCenter);
+ gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetFontMetric(font16, fontHeight), "Touch Area's", font16, GFX_WHITE, gJustifyCenter);
+ gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight()/4, "Pause", font16, GFX_GRAY, gJustifyCenter);
+ gdispDrawStringBox(0, gdispGetHeight()/4, gdispGetWidth(), gdispGetHeight()/2, "Rotate", font16, GFX_GRAY, gJustifyCenter);
+ gdispDrawStringBox(0, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Left", font16, GFX_GRAY, gJustifyCenter);
+ gdispDrawStringBox(gdispGetWidth()/4, gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/2, gdispGetHeight()/4, "Down", font16, GFX_GRAY, gJustifyCenter);
+ gdispDrawStringBox(gdispGetWidth()-(gdispGetWidth()/4), gdispGetHeight()-(gdispGetHeight()/4), gdispGetWidth()/4, gdispGetHeight()/4, "Right", font16, GFX_GRAY, gJustifyCenter);
gdispDrawLine(0, gdispGetHeight()/4, gdispGetWidth()-1, gdispGetHeight()/4, GFX_GRAY);
gdispDrawLine(0, gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()-1, gdispGetHeight()-gdispGetHeight()/4, GFX_GRAY);
gdispDrawLine(gdispGetWidth()/4, gdispGetHeight()-gdispGetHeight()/4, gdispGetWidth()/4, gdispGetHeight()-1, GFX_GRAY);
diff --git a/demos/modules/gdisp/fonts/main.c b/demos/modules/gdisp/fonts/main.c
index d7852a93..9c351de8 100644
--- a/demos/modules/gdisp/fonts/main.c
+++ b/demos/modules/gdisp/fonts/main.c
@@ -60,21 +60,21 @@ int main(void) {
line2 = "0123456789~!@#$%^&*_-+=(){}[]<>|/\\:;,.?'\"`";
// Font 1
- gdispFillStringBox(0, y, width, fheight1, line1, font1, GFX_BLACK, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, y, width, fheight1, line1, font1, GFX_BLACK, GFX_WHITE, gJustifyCenter);
y += fheight1+1;
- gdispFillStringBox(0, y, width, fheight1, line2, font1, GFX_BLACK, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, y, width, fheight1, line2, font1, GFX_BLACK, GFX_WHITE, gJustifyCenter);
y += fheight1+1;
// Font 2
- gdispFillStringBox(0, y, width, fheight2, line1, font2, GFX_BLACK, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, y, width, fheight2, line1, font2, GFX_BLACK, GFX_WHITE, gJustifyCenter);
y += fheight2+1;
- gdispFillStringBox(0, y, width, fheight2, line2, font2, GFX_BLACK, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, y, width, fheight2, line2, font2, GFX_BLACK, GFX_WHITE, gJustifyCenter);
y += fheight2+1;
// Font 1 drawing White on the (black) background
- gdispDrawStringBox(0, y, width, fheight1, line1, font1, GFX_WHITE, justifyCenter);
+ gdispDrawStringBox(0, y, width, fheight1, line1, font1, GFX_WHITE, gJustifyCenter);
y += fheight1+1;
- gdispDrawStringBox(0, y, width, fheight1, line2, font1, GFX_WHITE, justifyCenter);
+ gdispDrawStringBox(0, y, width, fheight1, line2, font1, GFX_WHITE, gJustifyCenter);
y += fheight1+1;
// Show Sizes
@@ -85,7 +85,7 @@ int main(void) {
buf[4] = (fheight2-2)/10 + '0';
buf[5] = (fheight2-2)%10 + '0';
buf[6] = 0;
- gdispFillStringBox(0, y, width, fheight1, buf, font1, GFX_RED, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, y, width, fheight1, buf, font1, GFX_RED, GFX_WHITE, gJustifyCenter);
// Wait forever
while(1) {
diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c
index b753fc04..5df0e479 100644
--- a/demos/modules/gdisp/multiple_displays/main.c
+++ b/demos/modules/gdisp/multiple_displays/main.c
@@ -72,10 +72,10 @@
sprintg(buf, "Display %u", display);
if (width < 128) {
gdispGDrawBox(g, 0, 0, width/2, height/2, GFX_YELLOW);
- gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, justifyCenter);
+ gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, gJustifyCenter);
} else {
gdispGDrawBox(g, 10, 10, width/2, height/2, GFX_YELLOW);
- gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, GFX_WHITE, GFX_BLUE, justifyCenter);
+ gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, GFX_WHITE, GFX_BLUE, gJustifyCenter);
}
gdispGDrawLine(g, 5, 30, width-50, height-40, GFX_RED);
@@ -115,10 +115,10 @@
sprintg(buf, "Display %u", display);
if (width < 128) {
gdispDrawBox(0, 0, width/2, height/2, GFX_YELLOW);
- gdispFillStringBox(0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, justifyCenter);
+ gdispFillStringBox(0, height/2, width, height/2, buf, f, GFX_BLACK, GFX_BLUE, gJustifyCenter);
} else {
gdispDrawBox(10, 10, width/2, height/2, GFX_YELLOW);
- gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, GFX_WHITE, GFX_BLUE, justifyCenter);
+ gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, GFX_WHITE, GFX_BLUE, gJustifyCenter);
}
gdispDrawLine(5, 30, width-50, height-40, GFX_RED);
diff --git a/demos/modules/gtrans/basic/main.c b/demos/modules/gtrans/basic/main.c
index 1a1657cf..283a7211 100644
--- a/demos/modules/gtrans/basic/main.c
+++ b/demos/modules/gtrans/basic/main.c
@@ -68,14 +68,14 @@ void updateText()
gCoord height = 30;
// Translate some basic strings
- gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
- gdispFillStringBox(20, 60, width, height, gt("This is a translated uGFX application"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
- gdispFillStringBox(20, 100, width, height, gt("Goodbye"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
+ gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, gJustifyLeft);
+ gdispFillStringBox(20, 60, width, height, gt("This is a translated uGFX application"), font, COLOR_TEXT, COLOR_BACKGROUND, gJustifyLeft);
+ gdispFillStringBox(20, 100, width, height, gt("Goodbye"), font, COLOR_TEXT, COLOR_BACKGROUND, gJustifyLeft);
// A more complex example using string formatting
char buffer[128];
sprintf(buffer, gt("The temperature is %d degrees"), 18);
- gdispFillStringBox(20, 140, width, height, buffer, font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
+ gdispFillStringBox(20, 140, width, height, buffer, font, COLOR_TEXT, COLOR_BACKGROUND, gJustifyLeft);
}
int main(void)
diff --git a/demos/tools/touch_calibration_grabber/main.c b/demos/tools/touch_calibration_grabber/main.c
index d33774d7..ac55f051 100644
--- a/demos/tools/touch_calibration_grabber/main.c
+++ b/demos/tools/touch_calibration_grabber/main.c
@@ -56,7 +56,7 @@ int main(void) {
font = gdispOpenFont("UI2");
gwinSetDefaultFont(font);
bHeight = gdispGetFontMetric(font, fontHeight)+4;
- gdispFillStringBox(0, 0, swidth, bHeight, "Touchscreen Calibration Grabber", font, GFX_RED, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, 0, swidth, bHeight, "Touchscreen Calibration Grabber", font, GFX_RED, GFX_WHITE, gJustifyCenter);
// Create our main display writing window
{
diff --git a/demos/tools/touch_driver_test/main.c b/demos/tools/touch_driver_test/main.c
index c8470aa9..08d6da3b 100644
--- a/demos/tools/touch_driver_test/main.c
+++ b/demos/tools/touch_driver_test/main.c
@@ -46,14 +46,14 @@ static void DrawHeader(const char *title, gBool btnNext, gBool btnPrev, gBool bt
#if GDISP_NEED_CLIP
gdispSetClip(0, 0, swidth, sheight);
#endif
- gdispFillStringBox(0, 0, swidth, bHeight, "Touch Calibration", font, GFX_RED, GFX_WHITE, justifyLeft);
+ gdispFillStringBox(0, 0, swidth, bHeight, "Touch Calibration", font, GFX_RED, GFX_WHITE, gJustifyLeft);
if (btnNext)
- gdispFillStringBox(swidth-1*bWidth, 0, bWidth , bHeight, "Next", font, GFX_BLACK, GFX_GRAY, justifyCenter);
+ gdispFillStringBox(swidth-1*bWidth, 0, bWidth , bHeight, "Next", font, GFX_BLACK, GFX_GRAY, gJustifyCenter);
if (btnPrev)
- gdispFillStringBox(swidth-2*bWidth, 0, bWidth-1, bHeight, "Prev", font, GFX_BLACK, GFX_GRAY, justifyCenter);
+ gdispFillStringBox(swidth-2*bWidth, 0, bWidth-1, bHeight, "Prev", font, GFX_BLACK, GFX_GRAY, gJustifyCenter);
if (btnPlusMinus) {
- gdispFillStringBox(swidth-2*bWidth-1*bWidth2, 0, bWidth2-1, bHeight, "+", font, GFX_BLACK, GFX_GRAY, justifyCenter);
- gdispFillStringBox(swidth-2*bWidth-2*bWidth2, 0, bWidth2-1, bHeight, "-", font, GFX_BLACK, GFX_GRAY, justifyCenter);
+ gdispFillStringBox(swidth-2*bWidth-1*bWidth2, 0, bWidth2-1, bHeight, "+", font, GFX_BLACK, GFX_GRAY, gJustifyCenter);
+ gdispFillStringBox(swidth-2*bWidth-2*bWidth2, 0, bWidth2-1, bHeight, "-", font, GFX_BLACK, GFX_GRAY, gJustifyCenter);
}
gwinClear(ghc);
gwinSetColor(ghc, GFX_YELLOW);
diff --git a/demos/tools/touch_raw_readings/main.c b/demos/tools/touch_raw_readings/main.c
index 98a3191f..416b75a5 100644
--- a/demos/tools/touch_raw_readings/main.c
+++ b/demos/tools/touch_raw_readings/main.c
@@ -61,7 +61,7 @@ int main(void) {
font = gdispOpenFont("UI2");
gwinSetDefaultFont(font);
bHeight = gdispGetFontMetric(font, fontHeight)+4;
- gdispFillStringBox(0, 0, swidth, bHeight, "Raw Touch Readings", font, GFX_RED, GFX_WHITE, justifyCenter);
+ gdispFillStringBox(0, 0, swidth, bHeight, "Raw Touch Readings", font, GFX_RED, GFX_WHITE, gJustifyCenter);
// Create our main display writing window
{
diff --git a/demos/tools/uGFXnetDisplay/main.c b/demos/tools/uGFXnetDisplay/main.c
index 481b3a64..18e6d2ef 100644
--- a/demos/tools/uGFXnetDisplay/main.c
+++ b/demos/tools/uGFXnetDisplay/main.c
@@ -336,7 +336,7 @@ int main(proto_args) {
font = gdispOpenFont("UI2");
// Open the connection
- gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight(), "Connecting to host...", font, GFX_WHITE, justifyCenter);
+ gdispDrawStringBox(0, 0, gdispGetWidth(), gdispGetHeight(), "Connecting to host...", font, GFX_WHITE, gJustifyCenter);
StartSockets();
netfd = doConnect(cmd_args);
if (netfd == (SOCKET_TYPE)-1)