aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boards/base/ArduinoTinyScreen/ugfx_test.ino4
-rw-r--r--changelog.txt1
-rw-r--r--demos/3rdparty/notepad-2/notepadApp.c2
-rw-r--r--demos/3rdparty/notepad-2/notepadCore.c6
-rw-r--r--demos/applications/combo/bounce.c6
-rw-r--r--demos/applications/combo/main.c6
-rw-r--r--demos/benchmarks/main.c2
-rw-r--r--demos/modules/gadc/gwinosc.c12
-rw-r--r--demos/modules/gadc/gwinosc.h10
-rw-r--r--demos/modules/gadc/main.c2
-rw-r--r--demos/modules/gaudio/oscilloscope/gwinosc.c14
-rw-r--r--demos/modules/gaudio/oscilloscope/gwinosc.h10
-rw-r--r--demos/modules/gaudio/oscilloscope/main.c2
-rw-r--r--demos/modules/gdisp/arcsectors/main.c2
-rw-r--r--demos/modules/gdisp/basics/main.c4
-rw-r--r--demos/modules/gdisp/circles/main.c2
-rw-r--r--demos/modules/gdisp/fonts/main.c4
-rw-r--r--demos/modules/gdisp/images/main.c2
-rw-r--r--demos/modules/gdisp/images_animated/main.c2
-rw-r--r--demos/modules/gdisp/multiple_displays/main.c8
-rw-r--r--demos/modules/gdisp/pixmap/main.c4
-rw-r--r--demos/modules/gdisp/polygons/main.c2
-rw-r--r--demos/modules/gdisp/streaming/main.c6
-rw-r--r--demos/modules/gtrans/basic/main.c4
-rw-r--r--demos/modules/gwin/basic/main.c2
-rw-r--r--demos/modules/gwin/widgets/main.c4
-rw-r--r--demos/tools/touch_calibration_grabber/main.c4
-rw-r--r--demos/tools/touch_driver_test/main.c4
-rw-r--r--demos/tools/touch_raw_readings/main.c4
-rw-r--r--demos/tools/uGFXnetDisplay/main.c2
-rw-r--r--drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c6
-rw-r--r--drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c6
-rw-r--r--drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c2
-rw-r--r--drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c8
-rw-r--r--drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c8
-rw-r--r--drivers/gdisp/QImage/gdisp_lld_qimage.cpp2
-rw-r--r--drivers/gdisp/QImage/gdisp_lld_qimage.h2
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c2
-rw-r--r--drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c10
-rw-r--r--drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c4
-rw-r--r--drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c12
-rw-r--r--drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c2
-rw-r--r--drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c2
-rw-r--r--drivers/gdisp/ST7565/gdisp_lld_ST7565.c4
-rw-r--r--drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c20
-rw-r--r--drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c8
-rw-r--r--drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c8
-rw-r--r--drivers/gdisp/UC1610/gdisp_lld_UC1610.c12
-rw-r--r--drivers/gdisp/UC8173/gdisp_lld_UC8173.c4
-rw-r--r--drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c2
-rw-r--r--drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c6
-rw-r--r--drivers/ginput/touch/FT5336/gmouse_lld_FT5336.c4
-rw-r--r--drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c4
-rw-r--r--drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c4
-rw-r--r--drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c2
-rw-r--r--drivers/ginput/touch/QWidget/example/mywidget.cpp6
-rw-r--r--drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c6
-rw-r--r--drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c6
-rw-r--r--drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c6
-rw-r--r--drivers/multiple/SDL/gdisp_lld_SDL.c2
-rw-r--r--drivers/multiple/Win32/gdisp_lld_Win32.c44
-rw-r--r--drivers/multiple/Win32/gdisp_lld_config.h4
-rw-r--r--drivers/multiple/X/gdisp_lld_X.c2
-rw-r--r--drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c4
-rw-r--r--drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp4
-rw-r--r--src/gdisp/gdisp.c138
-rw-r--r--src/gdisp/gdisp.h79
-rw-r--r--src/gdisp/gdisp_driver.h24
-rw-r--r--src/gdisp/gdisp_image.c18
-rw-r--r--src/gdisp/gdisp_image.h4
-rw-r--r--src/gdisp/gdisp_image_bmp.c12
-rw-r--r--src/gdisp/gdisp_image_gif.c14
-rw-r--r--src/gdisp/gdisp_image_jpg.c6
-rw-r--r--src/gdisp/gdisp_image_native.c4
-rw-r--r--src/gdisp/gdisp_image_png.c16
-rw-r--r--src/gdisp/gdisp_pixmap.c18
-rw-r--r--src/gdisp/gdisp_pixmap.h2
-rw-r--r--src/ginput/ginput_driver_mouse.h16
-rw-r--r--src/ginput/ginput_mouse.c16
-rw-r--r--src/ginput/ginput_mouse.h2
-rw-r--r--src/gmisc/gmisc_hittest.c2
-rw-r--r--src/gmisc/gmisc_matrix2d.c2
-rw-r--r--src/gwin/gwin.c52
-rw-r--r--src/gwin/gwin.h72
-rw-r--r--src/gwin/gwin_button.c8
-rw-r--r--src/gwin/gwin_checkbox.c8
-rw-r--r--src/gwin/gwin_class.h22
-rw-r--r--src/gwin/gwin_console.c6
-rw-r--r--src/gwin/gwin_console.h2
-rw-r--r--src/gwin/gwin_container.c8
-rw-r--r--src/gwin/gwin_container.h4
-rw-r--r--src/gwin/gwin_frame.c20
-rw-r--r--src/gwin/gwin_graph.c18
-rw-r--r--src/gwin/gwin_graph.h16
-rw-r--r--src/gwin/gwin_image.c2
-rw-r--r--src/gwin/gwin_keyboard.c8
-rw-r--r--src/gwin/gwin_keyboard.h4
-rw-r--r--src/gwin/gwin_label.c8
-rw-r--r--src/gwin/gwin_label.h4
-rw-r--r--src/gwin/gwin_list.c20
-rw-r--r--src/gwin/gwin_list.h6
-rw-r--r--src/gwin/gwin_progressbar.c2
-rw-r--r--src/gwin/gwin_progressbar.h2
-rw-r--r--src/gwin/gwin_radio.c8
-rw-r--r--src/gwin/gwin_slider.c10
-rw-r--r--src/gwin/gwin_slider.h2
-rw-r--r--src/gwin/gwin_tabset.c42
-rw-r--r--src/gwin/gwin_tabset.h2
-rw-r--r--src/gwin/gwin_textedit.c4
-rw-r--r--src/gwin/gwin_widget.c8
-rw-r--r--src/gwin/gwin_wm.c20
111 files changed, 564 insertions, 562 deletions
diff --git a/boards/base/ArduinoTinyScreen/ugfx_test.ino b/boards/base/ArduinoTinyScreen/ugfx_test.ino
index 456dd1fc..8dd54182 100644
--- a/boards/base/ArduinoTinyScreen/ugfx_test.ino
+++ b/boards/base/ArduinoTinyScreen/ugfx_test.ino
@@ -3,8 +3,8 @@
#include <gfx.h>
void setup() {
- coord_t width, height;
- coord_t i, j;
+ gCoord width, height;
+ gCoord i, j;
pinMode(13, OUTPUT);
diff --git a/changelog.txt b/changelog.txt
index fe8549c7..7dd306b9 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -20,6 +20,7 @@ FEATURE: Added types gPtr and gPtrDiff
FEATURE: Added gI64 and gU64 when the compiler supports it. GFX_TYPE_64 macro is defined as GFXON if it does.
FEATURE: Fixed headers to ensure size_t, NULL are always defined. size_t is not used as it may be 64bit.
CHANGE: Added type gPoint to replace V2.x point and point_t
+CHANGE: Added type gCoord to replace V2.x coord_t
FIX: Added gfxRealloc() to Qt port
FIX: Fixed UC1610 driver private area initialisation
FIX: Fixed ST7735 driver and added kapacuk changes
diff --git a/demos/3rdparty/notepad-2/notepadApp.c b/demos/3rdparty/notepad-2/notepadApp.c
index 0540da2c..57d2ad20 100644
--- a/demos/3rdparty/notepad-2/notepadApp.c
+++ b/demos/3rdparty/notepad-2/notepadApp.c
@@ -48,7 +48,7 @@ static GHandle gstatusConsole; // GConsole Handle to the Status Bar
static GEventMouse curPtr; // Holder for current pointer location
static font_t font;
-static coord_t swidth, sheight;
+static gCoord swidth, sheight;
// The toolbar buttons - Self-Explanatory
static GButtonObject btnNew, btnOpen, btnSave;
diff --git a/demos/3rdparty/notepad-2/notepadCore.c b/demos/3rdparty/notepad-2/notepadCore.c
index 65afc988..2a739e12 100644
--- a/demos/3rdparty/notepad-2/notepadCore.c
+++ b/demos/3rdparty/notepad-2/notepadCore.c
@@ -55,7 +55,7 @@ static GHandle nStatusConsole = NULL;
static volatile gBool doExit;
-static void draw_point(coord_t x, coord_t y) {
+static void draw_point(gCoord x, gCoord y) {
color_t c = ncoreDrawingArea->color;
if (nMode == NCORE_MODE_DRAW)
@@ -71,7 +71,7 @@ static void draw_point(coord_t x, coord_t y) {
/* Bresenham's Line Drawing Algorithm
Modified version to draw line of variable thickness */
-static void draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
+static void draw_line(gCoord x0, gCoord y0, gCoord x1, gCoord y1) {
int16_t dy, dx;
int16_t addx, addy;
int16_t P, diff, i;
@@ -130,7 +130,7 @@ static void draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
static DECLARE_THREAD_FUNCTION(ncoreDrawThread, msg) {
GEventMouse ev, evPrev;
- coord_t dx, dy;
+ gCoord dx, dy;
int state = 0, dist;
diff --git a/demos/applications/combo/bounce.c b/demos/applications/combo/bounce.c
index d3709056..33bb8394 100644
--- a/demos/applications/combo/bounce.c
+++ b/demos/applications/combo/bounce.c
@@ -63,9 +63,9 @@ static gfxThreadHandle thread;
#define SHADOWALPHA (255-255*0.2)
static DECLARE_THREAD_FUNCTION(task, param) {
- coord_t width, height, x, y, radius, ballx, bally, dx, floor;
- coord_t minx, miny, maxx, maxy, winx, winy;
- coord_t ballcx, ballcy;
+ gCoord width, height, x, y, radius, ballx, bally, dx, floor;
+ gCoord minx, miny, maxx, maxy, winx, winy;
+ gCoord ballcx, ballcy;
color_t colour;
float ii, spin, dy, spinspeed, h, f, g;
(void) param;
diff --git a/demos/applications/combo/main.c b/demos/applications/combo/main.c
index 05cdb643..1e7c6584 100644
--- a/demos/applications/combo/main.c
+++ b/demos/applications/combo/main.c
@@ -115,14 +115,14 @@ static void nextline(GWidgetInit *pwi) {
pwi->g.y += pwi->g.height+1;
}
-static void setbtntext(GWidgetInit *pwi, coord_t maxwidth, char *txt) {
+static void setbtntext(GWidgetInit *pwi, gCoord maxwidth, char *txt) {
pwi->text = txt;
pwi->g.width = gdispGetStringWidth(pwi->text, font) + BUTTON_PADDING;
if (pwi->g.x + pwi->g.width > maxwidth)
nextline(pwi);
}
-static void nextpos(GWidgetInit *pwi, coord_t maxwidth, coord_t nextwidth) {
+static void nextpos(GWidgetInit *pwi, gCoord maxwidth, gCoord nextwidth) {
pwi->g.x += pwi->g.width+1;
pwi->g.width = nextwidth;
if (pwi->g.x + nextwidth > maxwidth)
@@ -138,7 +138,7 @@ static void nextpos(GWidgetInit *pwi, coord_t maxwidth, coord_t nextwidth) {
*/
static void createWidgets(void) {
GWidgetInit wi;
- coord_t border, pagewidth;
+ gCoord border, pagewidth;
gwinWidgetClearInit(&wi);
diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c
index d14f3cc6..65dbd0bc 100644
--- a/demos/benchmarks/main.c
+++ b/demos/benchmarks/main.c
@@ -88,7 +88,7 @@ static int uitoa(unsigned int value, char * buf, int max) {
void benchmark(void) {
uint32_t i, pixels, ms, pps;
char pps_str[25];
- coord_t height, width, rx, ry, rcx, rcy;
+ gCoord height, width, rx, ry, rcx, rcy;
color_t random_color;
font_t font;
diff --git a/demos/modules/gadc/gwinosc.c b/demos/modules/gadc/gwinosc.c
index e82cd7d8..4f89a262 100644
--- a/demos/modules/gadc/gwinosc.c
+++ b/demos/modules/gadc/gwinosc.c
@@ -62,7 +62,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
if (!(gs = (GScopeObject *)_gwindowCreate(g, &gs->g, pInit, &scopeVMT, 0)))
return 0;
gs->nextx = 0;
- if (!(gs->lastscopetrace = gfxAlloc(gs->g.width * sizeof(coord_t))))
+ if (!(gs->lastscopetrace = gfxAlloc(gs->g.width * sizeof(gCoord))))
return 0;
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
gs->lasty = gs->g.height/2;
@@ -82,10 +82,10 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
void gwinScopeWaitForTrace(GHandle gh) {
#define gs ((GScopeObject *)(gh))
int i;
- coord_t x, y;
- coord_t yoffset;
+ gCoord x, y;
+ gCoord yoffset;
adcsample_t *pa;
- coord_t *pc;
+ gCoord *pc;
GDataBuffer *pd;
uint8_t shr;
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
@@ -94,7 +94,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
gBool rdytrigger;
int flsamples;
- coord_t scopemin;
+ gCoord scopemin;
#endif
if (gh->vmt != &scopeVMT)
@@ -127,7 +127,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
for(i = pd->len/sizeof(adcsample_t); i; i--) {
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
- y = yoffset - (((coord_t)(*pa++) << shr) >> (16-SCOPE_Y_BITS));
+ y = yoffset - (((gCoord)(*pa++) << shr) >> (16-SCOPE_Y_BITS));
#if TRIGGER_METHOD == TRIGGER_MINVALUE
/* Calculate the scopemin ready for the next trace */
diff --git a/demos/modules/gadc/gwinosc.h b/demos/modules/gadc/gwinosc.h
index 0c687a4f..15ef2f3a 100644
--- a/demos/modules/gadc/gwinosc.h
+++ b/demos/modules/gadc/gwinosc.h
@@ -63,13 +63,13 @@
typedef struct GScopeObject_t {
GWindowObject g; // Base Class
- coord_t *lastscopetrace; // To store last scope trace
- coord_t nextx; // Where we are up to
+ gCoord *lastscopetrace; // To store last scope trace
+ gCoord nextx; // Where we are up to
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
- coord_t lasty; // The last y value - used for trigger slope detection
+ gCoord lasty; // The last y value - used for trigger slope detection
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
- coord_t lasty; // The last y value - used for trigger slope detection
- coord_t scopemin; // The last scopes minimum value
+ gCoord lasty; // The last y value - used for trigger slope detection
+ gCoord scopemin; // The last scopes minimum value
#endif
} GScopeObject;
diff --git a/demos/modules/gadc/main.c b/demos/modules/gadc/main.c
index 5d07f8eb..92312e83 100644
--- a/demos/modules/gadc/main.c
+++ b/demos/modules/gadc/main.c
@@ -134,7 +134,7 @@ static GTimer lsTimer;
*/
int main(void) {
GHandle ghScope;
- coord_t swidth, sheight;
+ gCoord swidth, sheight;
#if defined(MY_DIAL_DEVICE) || defined(MY_TEMP_DEVICE)
GHandle ghText;
font_t font;
diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c
index 38edb35e..17ea9566 100644
--- a/demos/modules/gaudio/oscilloscope/gwinosc.c
+++ b/demos/modules/gaudio/oscilloscope/gwinosc.c
@@ -76,7 +76,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
/* Initialise the scope object members and allocate memory for buffers */
gs->format = format;
gs->nextx = 0;
- if (!(gs->lastscopetrace = (coord_t *)gfxAlloc(gs->g.width * sizeof(coord_t))))
+ if (!(gs->lastscopetrace = (gCoord *)gfxAlloc(gs->g.width * sizeof(gCoord))))
return 0;
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
gs->lasty = gs->g.height/2;
@@ -98,11 +98,11 @@ void gwinScopeWaitForTrace(GHandle gh) {
#define gs ((GScopeObject *)(gh))
GDataBuffer *paud;
int i;
- coord_t x, y;
- coord_t yoffset;
+ gCoord x, y;
+ gCoord yoffset;
uint8_t *pa8;
uint16_t *pa16;
- coord_t *pc;
+ gCoord *pc;
uint8_t shr;
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
@@ -111,7 +111,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
gBool rdytrigger;
int flsamples;
- coord_t scopemin;
+ gCoord scopemin;
#endif
if (gh->vmt != &scopeVMT)
@@ -148,9 +148,9 @@ void gwinScopeWaitForTrace(GHandle gh) {
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
if (gfxSampleFormatBits(gs->format) <= 8)
- y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
+ y = yoffset - (((gCoord)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
else
- y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
+ y = yoffset - (((gCoord)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
#if TRIGGER_METHOD == TRIGGER_MINVALUE
/* Calculate the scopemin ready for the next trace */
diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.h b/demos/modules/gaudio/oscilloscope/gwinosc.h
index 5a5c5034..e77a61b2 100644
--- a/demos/modules/gaudio/oscilloscope/gwinosc.h
+++ b/demos/modules/gaudio/oscilloscope/gwinosc.h
@@ -63,14 +63,14 @@
typedef struct GScopeObject_t {
GWindowObject g; // Base Class
- coord_t *lastscopetrace; // To store last scope trace
+ gCoord *lastscopetrace; // To store last scope trace
ArrayDataFormat format; // The sample format
- coord_t nextx; // Where we are up to
+ gCoord nextx; // Where we are up to
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
- coord_t lasty; // The last y value - used for trigger slope detection
+ gCoord lasty; // The last y value - used for trigger slope detection
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
- coord_t lasty; // The last y value - used for trigger slope detection
- coord_t scopemin; // The last scopes minimum value
+ gCoord lasty; // The last y value - used for trigger slope detection
+ gCoord scopemin; // The last scopes minimum value
#endif
} GScopeObject;
diff --git a/demos/modules/gaudio/oscilloscope/main.c b/demos/modules/gaudio/oscilloscope/main.c
index cd62e1f1..f9623b29 100644
--- a/demos/modules/gaudio/oscilloscope/main.c
+++ b/demos/modules/gaudio/oscilloscope/main.c
@@ -51,7 +51,7 @@ static GScopeObject gScopeWindow;
*/
int main(void) {
GHandle ghScope;
- coord_t swidth, sheight;
+ gCoord swidth, sheight;
gfxInit();
diff --git a/demos/modules/gdisp/arcsectors/main.c b/demos/modules/gdisp/arcsectors/main.c
index 7c73201c..6a9a2737 100644
--- a/demos/modules/gdisp/arcsectors/main.c
+++ b/demos/modules/gdisp/arcsectors/main.c
@@ -30,7 +30,7 @@
#include "gfx.h"
int main(void) {
- coord_t width, height, r1, r2, cx, cy;
+ gCoord width, height, r1, r2, cx, cy;
uint8_t sectors;
// Initialize and clear the display
diff --git a/demos/modules/gdisp/basics/main.c b/demos/modules/gdisp/basics/main.c
index 9517e0a6..ac7870f1 100644
--- a/demos/modules/gdisp/basics/main.c
+++ b/demos/modules/gdisp/basics/main.c
@@ -30,8 +30,8 @@
#include "gfx.h"
int main(void) {
- coord_t width, height;
- coord_t i, j;
+ gCoord width, height;
+ gCoord i, j;
// Initialize and clear the display
gfxInit();
diff --git a/demos/modules/gdisp/circles/main.c b/demos/modules/gdisp/circles/main.c
index e631da1a..bd7d5c2e 100644
--- a/demos/modules/gdisp/circles/main.c
+++ b/demos/modules/gdisp/circles/main.c
@@ -30,7 +30,7 @@
#include "gfx.h"
int main(void) {
- coord_t width, height;
+ gCoord width, height;
// Initialize and clear the display
gfxInit();
diff --git a/demos/modules/gdisp/fonts/main.c b/demos/modules/gdisp/fonts/main.c
index a0d888dc..d7852a93 100644
--- a/demos/modules/gdisp/fonts/main.c
+++ b/demos/modules/gdisp/fonts/main.c
@@ -30,9 +30,9 @@
#include "gfx.h"
int main(void) {
- coord_t width, y;
+ gCoord width, y;
font_t font1, font2;
- coord_t fheight1, fheight2;
+ gCoord fheight1, fheight2;
const char *line1, *line2;
char buf[8];
diff --git a/demos/modules/gdisp/images/main.c b/demos/modules/gdisp/images/main.c
index 6a2e4418..a394bd2e 100644
--- a/demos/modules/gdisp/images/main.c
+++ b/demos/modules/gdisp/images/main.c
@@ -39,7 +39,7 @@
static gdispImage myImage;
int main(void) {
- coord_t swidth, sheight;
+ gCoord swidth, sheight;
// Initialize uGFX and the underlying system
gfxInit();
diff --git a/demos/modules/gdisp/images_animated/main.c b/demos/modules/gdisp/images_animated/main.c
index a50e593f..09d46304 100644
--- a/demos/modules/gdisp/images_animated/main.c
+++ b/demos/modules/gdisp/images_animated/main.c
@@ -54,7 +54,7 @@ static gdispImage myImage;
* Orange - Decoding a frame has produced an error.
*/
int main(void) {
- coord_t swidth, sheight, errx, erry, errcx, errcy;
+ gCoord swidth, sheight, errx, erry, errcx, errcy;
delaytime_t delay;
gfxInit(); // Initialize the display
diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c
index ea05507b..b753fc04 100644
--- a/demos/modules/gdisp/multiple_displays/main.c
+++ b/demos/modules/gdisp/multiple_displays/main.c
@@ -45,8 +45,8 @@
#if USE_METHOD_1
int main(void) {
- coord_t width, height;
- coord_t display, i, j, cnt;
+ gCoord width, height;
+ gCoord display, i, j, cnt;
font_t f;
GDisplay *g;
char buf[16];
@@ -89,8 +89,8 @@
}
#else
int main(void) {
- coord_t width, height;
- coord_t display, i, j, cnt;
+ gCoord width, height;
+ gCoord display, i, j, cnt;
font_t f;
char buf[16];
diff --git a/demos/modules/gdisp/pixmap/main.c b/demos/modules/gdisp/pixmap/main.c
index 975611c8..ce9a4a13 100644
--- a/demos/modules/gdisp/pixmap/main.c
+++ b/demos/modules/gdisp/pixmap/main.c
@@ -36,8 +36,8 @@ static GDisplay* pixmap;
static pixel_t* surface;
int main(void) {
- coord_t width, height;
- coord_t i, j;
+ gCoord width, height;
+ gCoord i, j;
// Initialize and clear the display
gfxInit();
diff --git a/demos/modules/gdisp/polygons/main.c b/demos/modules/gdisp/polygons/main.c
index f91a5cdd..6b3896fe 100644
--- a/demos/modules/gdisp/polygons/main.c
+++ b/demos/modules/gdisp/polygons/main.c
@@ -69,7 +69,7 @@ static gPoint oldresult[NUM_POINTS];
int main(void) {
- coord_t width, height;
+ gCoord width, height;
mtype scalex, scaley;
mtype scaleincx, scaleincy;
mtype translatex, translatey;
diff --git a/demos/modules/gdisp/streaming/main.c b/demos/modules/gdisp/streaming/main.c
index a360ecc2..695b15b6 100644
--- a/demos/modules/gdisp/streaming/main.c
+++ b/demos/modules/gdisp/streaming/main.c
@@ -57,9 +57,9 @@
#define SHADOWALPHA (255-255*0.2)
int main(void) {
- coord_t width, height, x, y, radius, ballx, bally, dx, floor;
- coord_t minx, miny, maxx, maxy;
- coord_t ballcx, ballcy;
+ gCoord width, height, x, y, radius, ballx, bally, dx, floor;
+ gCoord minx, miny, maxx, maxy;
+ gCoord ballcx, ballcy;
color_t colour;
float ii, spin, dy, spinspeed, h, f, g;
diff --git a/demos/modules/gtrans/basic/main.c b/demos/modules/gtrans/basic/main.c
index da42aa46..1a1657cf 100644
--- a/demos/modules/gtrans/basic/main.c
+++ b/demos/modules/gtrans/basic/main.c
@@ -64,8 +64,8 @@ static const transTable FrenchTranslation = { sizeof(FrenchStrings)/sizeof(Frenc
void updateText()
{
- coord_t width = 400;
- coord_t height = 30;
+ gCoord width = 400;
+ gCoord height = 30;
// Translate some basic strings
gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c
index 901f9e6d..00404aae 100644
--- a/demos/modules/gwin/basic/main.c
+++ b/demos/modules/gwin/basic/main.c
@@ -33,7 +33,7 @@
GHandle GW1, GW2;
int main(void) {
- coord_t i, j;
+ gCoord i, j;
/* Initialize and clear the display */
gfxInit();
diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c
index 8e56af90..fd0bee1a 100644
--- a/demos/modules/gwin/widgets/main.c
+++ b/demos/modules/gwin/widgets/main.c
@@ -171,7 +171,7 @@ static gdispImage imgYesNo;
#endif
// Wrap buttons onto the next line if they don't fit.
-static void setbtntext(GWidgetInit *pwi, coord_t maxwidth, char *txt) {
+static void setbtntext(GWidgetInit *pwi, gCoord maxwidth, char *txt) {
if (pwi->g.x >= maxwidth) {
pwi->g.x = 5;
pwi->g.y += pwi->g.height+1;
@@ -194,7 +194,7 @@ static void setbtntext(GWidgetInit *pwi, coord_t maxwidth, char *txt) {
*/
static void createWidgets(void) {
GWidgetInit wi;
- coord_t border, pagewidth;
+ gCoord border, pagewidth;
gwinWidgetClearInit(&wi);
diff --git a/demos/tools/touch_calibration_grabber/main.c b/demos/tools/touch_calibration_grabber/main.c
index e6017030..d33774d7 100644
--- a/demos/tools/touch_calibration_grabber/main.c
+++ b/demos/tools/touch_calibration_grabber/main.c
@@ -34,9 +34,9 @@
static GConsoleObject gc;
static font_t font;
-static coord_t bHeight;
+static gCoord bHeight;
static GHandle ghc;
-static coord_t swidth, sheight;
+static gCoord swidth, sheight;
#if !GWIN_CONSOLE_USE_FLOAT
#error "You need to enable float support for the console widget. (GWIN_CONSOLE_USE_FLOAT)"
diff --git a/demos/tools/touch_driver_test/main.c b/demos/tools/touch_driver_test/main.c
index 8a4e5304..c8470aa9 100644
--- a/demos/tools/touch_driver_test/main.c
+++ b/demos/tools/touch_driver_test/main.c
@@ -38,9 +38,9 @@
static GConsoleObject gc;
static GListener gl;
static font_t font;
-static coord_t bWidth, bWidth2, bHeight;
+static gCoord bWidth, bWidth2, bHeight;
static GHandle ghc;
-static coord_t swidth, sheight;
+static gCoord swidth, sheight;
static void DrawHeader(const char *title, gBool btnNext, gBool btnPrev, gBool btnPlusMinus) {
#if GDISP_NEED_CLIP
diff --git a/demos/tools/touch_raw_readings/main.c b/demos/tools/touch_raw_readings/main.c
index 1e19f69f..98a3191f 100644
--- a/demos/tools/touch_raw_readings/main.c
+++ b/demos/tools/touch_raw_readings/main.c
@@ -38,9 +38,9 @@
static GConsoleObject gc;
static GListener gl;
static font_t font;
-static coord_t bHeight;
+static gCoord bHeight;
static GHandle ghc;
-static coord_t swidth, sheight;
+static gCoord swidth, sheight;
/*------------------------------------------------------------------------*
* GINPUT Touch Driver Calibrator. *
diff --git a/demos/tools/uGFXnetDisplay/main.c b/demos/tools/uGFXnetDisplay/main.c
index 9bf61b47..481b3a64 100644
--- a/demos/tools/uGFXnetDisplay/main.c
+++ b/demos/tools/uGFXnetDisplay/main.c
@@ -187,7 +187,7 @@ static gBool sendpkt(uint16_t *pkt, int len) {
GEventMouse *pem;
uint16_t cmd[2];
uint16_t lbuttons;
- coord_t lx, ly;
+ gCoord lx, ly;
(void) param;
// Initialize the mouse and the listener.
diff --git a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
index 1fb34378..2c03ed59 100644
--- a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
+++ b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c
@@ -29,7 +29,7 @@
typedef struct fbPriv {
void* pixels; // The pixel buffer
- coord_t linelen; // The number of bytes per display line
+ gCoord linelen; // The number of bytes per display line
void* frame0;
void* frame1;
} fbPriv;
@@ -177,7 +177,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -187,7 +187,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
index 61f7b500..d3aeadfe 100644
--- a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
+++ b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c
@@ -15,7 +15,7 @@
typedef struct fbInfo {
void * pixels; // The pixel buffer
- coord_t linelen; // The number of bytes per display line
+ gCoord linelen; // The number of bytes per display line
} fbInfo;
#include "board_fb24bpp.h"
@@ -155,7 +155,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -165,7 +165,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
index 86f4a94f..2a9d2488 100644
--- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
+++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
@@ -342,7 +342,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_BITFILLS
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
- coord_t lg, x, y;
+ gCoord lg, x, y;
uint16_t c1, c2;
unsigned tuples;
const pixel_t *buffer;
diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
index 568860e0..7f4f2050 100644
--- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
+++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c
@@ -117,7 +117,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
#if GDISP_NEED_CONTROL
switch(g->g.Orientation) {
@@ -156,7 +156,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
@@ -209,7 +209,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
index e7e621cc..0812057f 100644
--- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
+++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c
@@ -127,7 +127,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
#if GDISP_NEED_CONTROL
switch(g->g.Orientation) {
@@ -166,7 +166,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
@@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/QImage/gdisp_lld_qimage.cpp b/drivers/gdisp/QImage/gdisp_lld_qimage.cpp
index ba7cf44d..2d2876f0 100644
--- a/drivers/gdisp/QImage/gdisp_lld_qimage.cpp
+++ b/drivers/gdisp/QImage/gdisp_lld_qimage.cpp
@@ -3,7 +3,7 @@
#include "../../../src/gdisp/gdisp_driver.h"
#include "gdisp_lld_qimage.h"
-gBool qimage_init(GDisplay* g, coord_t width, coord_t height)
+gBool qimage_init(GDisplay* g, gCoord width, gCoord height)
{
QImage* qimage = new QImage(width, height, QImage::Format_RGB888);
if (!qimage) {
diff --git a/drivers/gdisp/QImage/gdisp_lld_qimage.h b/drivers/gdisp/QImage/gdisp_lld_qimage.h
index 512fdf53..b8b0d9c9 100644
--- a/drivers/gdisp/QImage/gdisp_lld_qimage.h
+++ b/drivers/gdisp/QImage/gdisp_lld_qimage.h
@@ -7,7 +7,7 @@
extern "C" {
#endif
-gBool qimage_init(GDisplay* g, coord_t width, coord_t height);
+gBool qimage_init(GDisplay* g, gCoord width, gCoord height);
void qimage_setPixel(GDisplay* g);
color_t qimage_getPixel(GDisplay* g);
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
index c4e0a941..b8ee55cb 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
+++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c
@@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
pixel_t *buffer;
- coord_t ycnt;
+ gCoord ycnt;
buffer = (pixel_t *)g->p.ptr + g->p.x1 + g->p.y1 * g->p.x2;
diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
index 9658cc26..c91e77a3 100644
--- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
+++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c
@@ -169,9 +169,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_FILLS
LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
- coord_t sy, ey;
- coord_t sx, ex;
- coord_t col;
+ gCoord sy, ey;
+ gCoord sx, ex;
+ gCoord col;
unsigned spage, zpages;
uint8_t * base;
uint8_t mask;
@@ -236,7 +236,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
@@ -267,7 +267,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
diff --git a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
index 6793b461..9b50f753 100644
--- a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
+++ b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c
@@ -189,7 +189,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
uint8_t *ram;
switch(g->g.Orientation) {
@@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
LLDCOLOR_TYPE c;
switch(g->g.Orientation) {
diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
index 412ba042..cec6f1df 100644
--- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
+++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
@@ -341,8 +341,8 @@ LLDSPEC void gdisp_lld_clear (GDisplay *g)
#if GDISP_HARDWARE_FILLS
LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
{
- coord_t scol, ecol, sx, ex;
- coord_t y, col, x;
+ gCoord scol, ecol, sx, ex;
+ gCoord y, col, x;
uint16_t area = (uint16_t) g->p.cx * g->p.cy;
uint8_t temp;
@@ -400,7 +400,7 @@ LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
{
- coord_t x, y;
+ gCoord x, y;
switch (g->g.Orientation)
{
@@ -436,7 +436,7 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g)
{
- coord_t x, y;
+ gCoord x, y;
switch (g->g.Orientation)
{
@@ -554,8 +554,8 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
#if GDISP_HARDWARE_BITFILLS
LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
{
- coord_t scol, ecol, sx;
- coord_t y, col;
+ gCoord scol, ecol, sx;
+ gCoord y, col;
uint16_t area;
uint8_t temp, temp2, i;
diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
index f5d9fd63..1bf3a45d 100644
--- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
+++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c
@@ -17,7 +17,7 @@
#define CALC_FPR(w,h,hb,hf,hp,vb,vf,vp,fps) ((fps * CALC_PERIOD(w,hb,hf,hp) * CALC_PERIOD(h,vb,vf,vp) * 1048576)/100000000)
typedef struct LCD_Parameters {
- coord_t width, height; // Panel width and height
+ gCoord width, height; // Panel width and height
uint16_t hbporch; // Horizontal Back Porch
uint16_t hfporch; // Horizontal Front Porch
uint16_t hpulse; // Horizontal Pulse
diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
index 75bea819..0631b0c0 100644
--- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
+++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
@@ -295,7 +295,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
LLDSPEC void gdisp_lld_blit_area(GDisplay* g) {
pixel_t* buffer;
- coord_t ycnt;
+ gCoord ycnt;
buffer = (pixel_t*)g->p.ptr + g->p.x1 + g->p.y1 * g->p.x2;
diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
index 2639e268..d347c22b 100644
--- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
+++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c
@@ -166,7 +166,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
@@ -197,7 +197,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
index 57253b0d..763c4c29 100644
--- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
+++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
@@ -48,13 +48,13 @@
typedef struct ltdcLayerConfig {
// Frame
LLDCOLOR_TYPE* frame; // Frame buffer address
- coord_t width, height; // Frame size in pixels
- coord_t pitch; // Line pitch, in bytes
+ gCoord width, height; // Frame size in pixels
+ gCoord pitch; // Line pitch, in bytes
uint16_t fmt; // Pixel format in LTDC format
// Window
- coord_t x, y; // Start pixel position of the virtual layer
- coord_t cx, cy; // Size of the virtual layer
+ gCoord x, y; // Start pixel position of the virtual layer
+ gCoord cx, cy; // Size of the virtual layer
uint32_t defcolor; // Default color, ARGB8888
uint32_t keycolor; // Color key, RGB888
@@ -66,10 +66,10 @@ typedef struct ltdcLayerConfig {
} ltdcLayerConfig;
typedef struct ltdcConfig {
- coord_t width, height; // Screen size
- coord_t hsync, vsync; // Horizontal and Vertical sync pixels
- coord_t hbackporch, vbackporch; // Horizontal and Vertical back porch pixels
- coord_t hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels
+ gCoord width, height; // Screen size
+ gCoord hsync, vsync; // Horizontal and Vertical sync pixels
+ gCoord hbackporch, vbackporch; // Horizontal and Vertical back porch pixels
+ gCoord hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels
uint32_t syncflags; // Sync flags
uint32_t bgcolor; // Clear screen color RGB888
@@ -382,7 +382,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -392,7 +392,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
index be5bf3c7..5d605cd4 100644
--- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
+++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c
@@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
#if GDISP_NEED_CONTROL
switch(g->g.Orientation) {
@@ -172,7 +172,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
@@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -239,7 +239,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
index 479e49e9..9da593d6 100644
--- a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
+++ b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c
@@ -138,7 +138,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
#if GDISP_NEED_CONTROL
switch(g->g.Orientation) {
@@ -177,7 +177,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_PIXELREAD
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
@@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -244,7 +244,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
index b0d4660b..bd11dce0 100644
--- a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
+++ b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c
@@ -45,10 +45,10 @@
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0)
typedef struct UC1610_Window {
- coord_t x1;
- coord_t y1;
- coord_t x2;
- coord_t y2;
+ gCoord x1;
+ gCoord y1;
+ gCoord x2;
+ gCoord y2;
} UC1610_Window;
/*===========================================================================*/
@@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
uint8_t *c;
// handle orientation
@@ -170,7 +170,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_FLUSH
LLDSPEC void gdisp_lld_flush(GDisplay* g)
{
- coord_t x1, y1, x2, y2, cx;
+ gCoord x1, y1, x2, y2, cx;
uint8_t *c;
// Don't flush unless we really need to
diff --git a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
index ec135f1a..724c6f36 100644
--- a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
+++ b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c
@@ -309,7 +309,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
#if GDISP_HARDWARE_FLUSH
LLDSPEC void gdisp_lld_flush(GDisplay* g)
{
- coord_t cy, cx, dx, dy;
+ gCoord cy, cx, dx, dy;
LLDCOLOR_TYPE *fb;
UC8173_Private *priv;
@@ -390,7 +390,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g)
{
- coord_t x, y;
+ gCoord x, y;
UC8173_Private *priv;
priv = (UC8173_Private *)g->priv;
diff --git a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
index ab700b0a..009e52f2 100644
--- a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
+++ b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c
@@ -163,7 +163,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_HARDWARE_DRAWPIXEL
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
switch(g->g.Orientation) {
default:
diff --git a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
index 40f476b4..121787e1 100644
--- a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
+++ b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
@@ -15,7 +15,7 @@
typedef struct fbInfo {
void * pixels; // The pixel buffer
- coord_t linelen; // The number of bytes per display line
+ gCoord linelen; // The number of bytes per display line
} fbInfo;
#include "board_framebuffer.h"
@@ -135,7 +135,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -145,7 +145,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/drivers/ginput/touch/FT5336/gmouse_lld_FT5336.c b/drivers/ginput/touch/FT5336/gmouse_lld_FT5336.c
index 082c372a..3f23cad2 100644
--- a/drivers/ginput/touch/FT5336/gmouse_lld_FT5336.c
+++ b/drivers/ginput/touch/FT5336/gmouse_lld_FT5336.c
@@ -65,8 +65,8 @@ static gBool ft5336ReadXYZ(GMouse* m, GMouseReading* pdr)
// Only take a reading if exactly one touch contact point
if (read_byte(m, FT5336_TD_STAT_REG) == 1) {
// Get and return X, Y an Z values
- pdr->y = (coord_t)(read_word(m, FT5336_P1_XH_REG) & 0x0FFF);
- pdr->x = (coord_t)(read_word(m, FT5336_P1_YH_REG) & 0x0FFF);
+ pdr->y = (gCoord)(read_word(m, FT5336_P1_XH_REG) & 0x0FFF);
+ pdr->x = (gCoord)(read_word(m, FT5336_P1_YH_REG) & 0x0FFF);
pdr->z = 1;
}
diff --git a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c
index 50fa36a0..aef4de42 100644
--- a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c
+++ b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c
@@ -68,8 +68,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
if ((read_byte(m, FT5x06_TOUCH_POINTS) & 0x07)) {
/* Get the X, Y, Z values */
- pdr->x = (coord_t)(read_word(m, FT5x06_TOUCH1_XH) & 0x0fff);
- pdr->y = (coord_t)read_word(m, FT5x06_TOUCH1_YH);
+ pdr->x = (gCoord)(read_word(m, FT5x06_TOUCH1_XH) & 0x0fff);
+ pdr->y = (gCoord)read_word(m, FT5x06_TOUCH1_YH);
pdr->z = 1;
// Rescale X,Y if we are using self-calibration
diff --git a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c
index 5f3902b3..674a057a 100644
--- a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c
+++ b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06.c
@@ -68,8 +68,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
if ((read_byte(m, FT6x06_TOUCH_POINTS) & 0x07)) {
/* Get the X, Y, Z values */
- pdr->x = (coord_t)(read_word(m, FT6x06_TOUCH1_XH) & 0x0fff);
- pdr->y = (coord_t)read_word(m, FT6x06_TOUCH1_YH);
+ pdr->x = (gCoord)(read_word(m, FT6x06_TOUCH1_XH) & 0x0fff);
+ pdr->y = (gCoord)read_word(m, FT6x06_TOUCH1_YH);
pdr->z = 1;
// Rescale X,Y if we are using self-calibration
diff --git a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c
index f2222898..034f8e3a 100644
--- a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c
+++ b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c
@@ -152,7 +152,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
return gTrue;
}
- // Strip the tags (we need to take care because coord_t is signed - and sign bit gets extended on shift!)
+ // Strip the tags (we need to take care because gCoord is signed - and sign bit gets extended on shift!)
pdr->x = (uint16_t)(pdr->x) >> 4;
pdr->y = (uint16_t)(pdr->y) >> 4;
pdr->z = Z_MAX;
diff --git a/drivers/ginput/touch/QWidget/example/mywidget.cpp b/drivers/ginput/touch/QWidget/example/mywidget.cpp
index b14713b1..c4599193 100644
--- a/drivers/ginput/touch/QWidget/example/mywidget.cpp
+++ b/drivers/ginput/touch/QWidget/example/mywidget.cpp
@@ -2,9 +2,9 @@
#include "ugfx/src/ginput/ginput_driver_mouse.h"
extern GMouse* qwidgetMouse;
-extern coord_t qwidgetMouseX;
-extern coord_t qwidgetMouseY;
-extern coord_t qwidgetMouseZ;
+extern gCoord qwidgetMouseX;
+extern gCoord qwidgetMouseY;
+extern gCoord qwidgetMouseZ;
extern uint16_t qwidgetMouseButtons;
MyWidget::MyWidget(QWidget* parent) : QWidget(parent)
diff --git a/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c b/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c
index 53b167bb..13037136 100644
--- a/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c
+++ b/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c
@@ -14,9 +14,9 @@
#include "../../../../src/ginput/ginput_driver_mouse.h"
GMouse* qwidgetMouse;
-coord_t qwidgetMouseX;
-coord_t qwidgetMouseY;
-coord_t qwidgetMouseZ;
+gCoord qwidgetMouseX;
+gCoord qwidgetMouseY;
+gCoord qwidgetMouseZ;
uint16_t qwidgetMouseButtons;
static gBool _init(GMouse* m, unsigned driverinstance)
diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c
index eab13de4..3d3acc55 100644
--- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c
+++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c
@@ -171,10 +171,10 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
#endif
// Time to get some readings
- pdr->x = (coord_t)read_word(m, STMPE610_REG_TSC_DATA_X);
- pdr->y = (coord_t)read_word(m, STMPE610_REG_TSC_DATA_Y);
+ pdr->x = (gCoord)read_word(m, STMPE610_REG_TSC_DATA_X);
+ pdr->y = (gCoord)read_word(m, STMPE610_REG_TSC_DATA_Y);
#if GMOUSE_STMPE610_READ_PRESSURE
- pdr->z = (coord_t)read_byte(m, STMPE610_REG_TSC_DATA_Z);
+ pdr->z = (gCoord)read_byte(m, STMPE610_REG_TSC_DATA_Z);
#else
pdr->z = gmvmt(m)->z_max;
#endif
diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c
index fe978828..6f8b442e 100644
--- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c
+++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c
@@ -171,10 +171,10 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
#endif
// Time to get some readings
- pdr->x = (coord_t)read_word(m, STMPE811_REG_TSC_DATA_X);
- pdr->y = (coord_t)read_word(m, STMPE811_REG_TSC_DATA_Y);
+ pdr->x = (gCoord)read_word(m, STMPE811_REG_TSC_DATA_X);
+ pdr->y = (gCoord)read_word(m, STMPE811_REG_TSC_DATA_Y);
#if GMOUSE_STMPE811_READ_PRESSURE
- pdr->z = (coord_t)read_byte(m, STMPE811_REG_TSC_DATA_Z);
+ pdr->z = (gCoord)read_byte(m, STMPE811_REG_TSC_DATA_Z);
#else
pdr->z = gmvmt(m)->z_max;
#endif
diff --git a/drivers/multiple/SDL/gdisp_lld_SDL.c b/drivers/multiple/SDL/gdisp_lld_SDL.c
index 3ea2168f..54830d7f 100644
--- a/drivers/multiple/SDL/gdisp_lld_SDL.c
+++ b/drivers/multiple/SDL/gdisp_lld_SDL.c
@@ -161,7 +161,7 @@ struct SDL_UGFXContext {
int16_t need_redraw;
int minx,miny,maxx,maxy;
#if GINPUT_NEED_MOUSE
- coord_t mousex, mousey;
+ gCoord mousex, mousey;
uint16_t buttons;
#endif
#if GINPUT_NEED_KEYBOARD
diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c
index 86af1d80..5e23b3d5 100644
--- a/drivers/multiple/Win32/gdisp_lld_Win32.c
+++ b/drivers/multiple/Win32/gdisp_lld_Win32.c
@@ -442,18 +442,18 @@ typedef struct winPriv {
HBITMAP dcBitmap;
HBITMAP dcOldBitmap;
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
- coord_t mousex, mousey;
+ gCoord mousex, mousey;
uint16_t mousebuttons;
GMouse *mouse;
gBool mouseenabled;
- void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, coord_t x, coord_t y);
+ void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y);
#endif
#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
uint8_t toggles;
#endif
#if GDISP_HARDWARE_STREAM_WRITE || GDISP_HARDWARE_STREAM_READ
- coord_t x0, y0, x1, y1;
- coord_t x, y;
+ gCoord x0, y0, x1, y1;
+ gCoord x, y;
#endif
} winPriv;
@@ -462,7 +462,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) {
}
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
- void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, coord_t x, coord_t y) {
+ void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y) {
winPriv * priv;
priv = (winPriv *)g->priv;
@@ -475,7 +475,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) {
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled) {
((winPriv *)g->priv)->mouseenabled = enabled;
}
- void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, coord_t x, coord_t y)) {
+ void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y)) {
((winPriv *)g->priv)->capfn = capfn;
}
#endif
@@ -495,7 +495,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
RECT rect;
HGDIOBJ old;
POINT p;
- coord_t pos;
+ gCoord pos;
uint8_t bit;
#endif
@@ -526,7 +526,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
// Handle mouse down on the window
#if GINPUT_NEED_MOUSE
- if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
+ if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
btns = priv->mousebuttons;
btns |= GINPUT_MOUSE_BTN_LEFT;
goto mousemove;
@@ -535,8 +535,8 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
// Handle mouse down on the toggle area
#if GINPUT_NEED_TOGGLE
- if ((coord_t)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT && (g->flags & GDISP_FLG_HASTOGGLE)) {
- bit = 1 << ((coord_t)LOWORD(lParam)*8/g->g.Width);
+ if ((gCoord)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT && (g->flags & GDISP_FLG_HASTOGGLE)) {
+ bit = 1 << ((gCoord)LOWORD(lParam)*8/g->g.Width);
priv->toggles ^= bit;
rect.left = 0;
rect.right = GDISP_SCREEN_WIDTH;
@@ -576,7 +576,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
// Handle mouse up on the window
#if GINPUT_NEED_MOUSE
- if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
+ if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
btns = priv->mousebuttons;
btns &= ~GINPUT_MOUSE_BTN_LEFT;
goto mousemove;
@@ -589,7 +589,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_MBUTTONDOWN:
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
priv = (winPriv *)g->priv;
- if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
+ if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
btns = priv->mousebuttons;
btns |= GINPUT_MOUSE_BTN_MIDDLE;
goto mousemove;
@@ -598,7 +598,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_MBUTTONUP:
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
priv = (winPriv *)g->priv;
- if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
+ if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
btns = priv->mousebuttons;
btns &= ~GINPUT_MOUSE_BTN_MIDDLE;
goto mousemove;
@@ -607,7 +607,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_RBUTTONDOWN:
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
priv = (winPriv *)g->priv;
- if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
+ if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
btns = priv->mousebuttons;
btns |= GINPUT_MOUSE_BTN_RIGHT;
goto mousemove;
@@ -616,7 +616,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_RBUTTONUP:
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
priv = (winPriv *)g->priv;
- if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
+ if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
btns = priv->mousebuttons;
btns &= ~GINPUT_MOUSE_BTN_RIGHT;
goto mousemove;
@@ -625,17 +625,17 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE:
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
priv = (winPriv *)g->priv;
- if ((coord_t)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT)
+ if ((gCoord)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT)
break;
btns = priv->mousebuttons;
mousemove:
if (priv->capfn)
- priv->capfn(hWnd, g, btns, (coord_t)LOWORD(lParam), (coord_t)HIWORD(lParam));
+ priv->capfn(hWnd, g, btns, (gCoord)LOWORD(lParam), (gCoord)HIWORD(lParam));
if (priv->mouseenabled) {
priv->mousebuttons = btns;
- priv->mousex = (coord_t)LOWORD(lParam);
- priv->mousey = (coord_t)HIWORD(lParam);
+ priv->mousex = (gCoord)LOWORD(lParam);
+ priv->mousey = (gCoord)HIWORD(lParam);
if ((gmvmt(priv->mouse)->d.flags & GMOUSE_VFLG_NOPOLL)) // For normal setup this is always true
_gmouseWakeup(priv->mouse);
}
@@ -1229,7 +1229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
pixel_t *dst;
const pixel_t *src;
size_t sz;
- coord_t i, j;
+ gCoord i, j;
// Allocate the destination buffer
sz = (size_t)g->p.cx * (size_t)g->p.cy;
@@ -1408,7 +1408,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) {
winPriv * priv;
RECT rect;
- coord_t lines;
+ gCoord lines;
priv = g->priv;
@@ -1571,7 +1571,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
#if GDISP_NEED_CONTROL
// If the self-rotation has been set in the VMT then do that here (TESTING ONLY)
if ((gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) { // For normal setup this is always False
- coord_t t;
+ gCoord t;
switch(gdispGGetOrientation(m->display)) {
case GDISP_ROTATE_0:
diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h
index c95b554a..568c4c3d 100644
--- a/drivers/multiple/Win32/gdisp_lld_config.h
+++ b/drivers/multiple/Win32/gdisp_lld_config.h
@@ -55,14 +55,14 @@ void gfxEmulatorSetParentWindow(void *hwnd);
#if GINPUT_NEED_MOUSE
// This function allows you to inject mouse events into the ugfx mouse driver
- void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, coord_t x, coord_t y);
+ void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y);
// This function enables you to turn on/off normal mouse functions on a ugfx Win32 display window.
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled);
// This function enables you to capture mouse events on a ugfx Win32 display window.
// Passing NULL turns off the capture
- void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, coord_t x, coord_t y));
+ void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y));
#endif
#endif /* GFX_USE_GDISP */
diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c
index 05e80614..78a9cb02 100644
--- a/drivers/multiple/X/gdisp_lld_X.c
+++ b/drivers/multiple/X/gdisp_lld_X.c
@@ -181,7 +181,7 @@ typedef struct xPriv {
GC gc;
Window win;
#if GINPUT_NEED_MOUSE
- coord_t mousex, mousey;
+ gCoord mousex, mousey;
uint16_t buttons;
GMouse * mouse;
#endif
diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
index 653b75c4..24460e97 100644
--- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
+++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
@@ -159,7 +159,7 @@ typedef struct netPriv {
unsigned databytes; // How many bytes have been read
uint16_t data[2]; // Buffer for storing data read.
#if GINPUT_NEED_MOUSE
- coord_t mousex, mousey;
+ gCoord mousex, mousey;
uint16_t mousebuttons;
GMouse * mouse;
#endif
@@ -540,7 +540,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
netPriv * priv;
pixel_t * buffer;
uint16_t buf[5];
- coord_t x, y;
+ gCoord x, y;
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
if (!(g->flags & GDISP_FLG_CONNECTED))
diff --git a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
index 8df5e08d..f8420bd3 100644
--- a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
+++ b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp
@@ -119,7 +119,7 @@ typedef struct netPriv {
unsigned databytes; // How many bytes have been read
uint16_t data[2]; // Buffer for storing data read.
#if GINPUT_NEED_MOUSE
- coord_t mousex, mousey;
+ gCoord mousex, mousey;
uint16_t mousebuttons;
GMouse * mouse;
#endif
@@ -423,7 +423,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
netPriv * priv;
pixel_t * buffer;
uint16_t buf[5];
- coord_t x, y;
+ gCoord x, y;
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
if (!(g->flags & GDISP_FLG_CONNECTED))
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 23e9061f..96e425fd 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -70,7 +70,7 @@ GDisplay *GDISP;
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
static GFXINLINE void setglobalwindow(GDisplay *g) {
- coord_t x, y;
+ gCoord x, y;
x = g->p.x; y = g->p.y;
g->p.x = g->p.y = 0;
g->p.cx = g->g.Width; g->p.cy = g->g.Height;
@@ -227,7 +227,7 @@ static GFXINLINE void fillarea(GDisplay *g) {
// if (gvmt(g)->pixel)
//#endif
{
- coord_t x0, y0, x1, y1;
+ gCoord x0, y0, x1, y1;
x0 = g->p.x;
y0 = g->p.y;
@@ -503,9 +503,9 @@ static void line_clip(GDisplay *g) {
#if GDISP_STARTUP_LOGO_TIMEOUT > 0
static gBool gdispInitDone;
static void StartupLogoDisplay(GDisplay *g) {
- coord_t x, y, w;
- const coord_t * p;
- static const coord_t blks[] = {
+ gCoord x, y, w;
+ const gCoord * p;
+ static const gCoord blks[] = {
// u
2, 6, 1, 10,
3, 11, 4, 1,
@@ -709,8 +709,8 @@ unsigned gdispGetDisplayCount(void) {
return gdriverInstanceCount(GDRIVER_TYPE_DISPLAY);
}
-coord_t gdispGGetWidth(GDisplay *g) { return g->g.Width; }
-coord_t gdispGGetHeight(GDisplay *g) { return g->g.Height; }
+gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
+gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; }
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; }
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
@@ -732,7 +732,7 @@ void gdispGFlush(GDisplay *g) {
}
#if GDISP_NEED_STREAMING
- void gdispGStreamStart(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy) {
+ void gdispGStreamStart(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy) {
MUTEX_ENTER(g);
#if NEED_CLIPPING
@@ -794,7 +794,7 @@ void gdispGFlush(GDisplay *g) {
void gdispGStreamColor(GDisplay *g, color_t color) {
#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
- coord_t sx1, sy1;
+ gCoord sx1, sy1;
#endif
// Don't touch the mutex as we should already own it
@@ -978,7 +978,7 @@ void gdispGFlush(GDisplay *g) {
}
#endif
-void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color) {
+void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color) {
MUTEX_ENTER(g);
g->p.x = x;
g->p.y = y;
@@ -988,7 +988,7 @@ void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color) {
MUTEX_EXIT(g);
}
-void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color) {
+void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color) {
MUTEX_ENTER(g);
g->p.x = x0;
g->p.y = y0;
@@ -1083,7 +1083,7 @@ void gdispGClear(GDisplay *g, color_t color) {
#endif
}
-void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
+void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
MUTEX_ENTER(g);
g->p.x = x;
g->p.y = y;
@@ -1097,7 +1097,7 @@ void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
MUTEX_EXIT(g);
}
-void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
+void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const pixel_t *buffer) {
MUTEX_ENTER(g);
#if NEED_CLIPPING
@@ -1234,7 +1234,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
}
#if GDISP_NEED_CLIP || GDISP_NEED_VALIDATION
- void gdispGSetClip(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy) {
+ void gdispGSetClip(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy) {
MUTEX_ENTER(g);
// Best is using hardware clipping
@@ -1271,8 +1271,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_CIRCLE
- void gdispGDrawCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color) {
- coord_t a, b, P;
+ void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
+ gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1313,8 +1313,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_CIRCLE
- void gdispGFillCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color) {
- coord_t a, b, P;
+ void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color) {
+ gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1357,8 +1357,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
g->p.x = x+r2+1; g->p.x1 = x+r1; g->p.color = color1; hline_clip(g)
#define DRAW_SINGLELINE(yval, r) g->p.y = yval; g->p.x = x-r; g->p.x1 = x+r; hline_clip(g)
- void gdispGFillDualCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius1, color_t color1, coord_t radius2, color_t color2) {
- coord_t a, b1, b2, p1, p2;
+ void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2) {
+ gCoord a, b1, b2, p1, p2;
MUTEX_ENTER(g);
@@ -1426,8 +1426,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ELLIPSE
- void gdispGDrawEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
- coord_t dx, dy;
+ void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
+ gCoord dx, dy;
int32_t a2, b2;
int32_t err, e2;
@@ -1465,8 +1465,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ELLIPSE
- void gdispGFillEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color) {
- coord_t dx, dy;
+ void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color) {
+ gCoord dx, dy;
int32_t a2, b2;
int32_t err, e2;
@@ -1502,8 +1502,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ARCSECTORS
- void gdispGDrawArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color) {
- coord_t a, b, P;
+ void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
+ gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1546,8 +1546,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ARCSECTORS
- void gdispGFillArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color) {
- coord_t a, b, P;
+ void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color) {
+ gCoord a, b, P;
MUTEX_ENTER(g);
@@ -1731,8 +1731,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#include <math.h>
#endif
- void gdispGDrawArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) {
- coord_t a, b, P, sedge, eedge;
+ void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
+ gCoord a, b, P, sedge, eedge;
uint8_t full, sbit, ebit, tbit;
// Normalize the angles
@@ -1917,10 +1917,10 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#include <math.h>
#endif
- void gdispGDrawThickArc(GDisplay *g, coord_t xc, coord_t yc, coord_t radiusStart, coord_t radiusEnd, coord_t start, coord_t end, color_t color) {
- coord_t x, y, d, r;
- coord_t startTan, endTan, curangle;
- coord_t precision = 512;
+ void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, color_t color) {
+ gCoord x, y, d, r;
+ gCoord startTan, endTan, curangle;
+ gCoord precision = 512;
// Normalize the angles
if (start < 0)
@@ -2032,9 +2032,9 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ARC
- void gdispGFillArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) {
- coord_t a, b, P;
- coord_t sy, ey;
+ void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
+ gCoord a, b, P;
+ gCoord sy, ey;
fixed sxa, sxb, sxd, exa, exb, exd;
uint8_t qtr;
@@ -2042,7 +2042,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
// We add a half pixel so that we are drawing from the centre of the pixel
// instead of the left edge of the pixel. This also fixes the implied floor()
- // when converting back to a coord_t
+ // when converting back to a gCoord
sxa = exa = FIXED(x) + FIXED0_5;
// Do the trig to get the formulas for the start and end lines.
@@ -2534,7 +2534,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
- void gdispGDrawRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color) {
+ void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
if (2*radius > cx || 2*radius > cy) {
gdispGDrawBox(g, x, y, cx, cy, color);
return;
@@ -2559,8 +2559,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
- void gdispGFillRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color) {
- coord_t radius2;
+ void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
+ gCoord radius2;
radius2 = radius*2;
if (radius2 > cx || radius2 > cy) {
@@ -2585,7 +2585,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_PIXELREAD
- color_t gdispGGetPixelColor(GDisplay *g, coord_t x, coord_t y) {
+ color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y) {
color_t c;
/* Always synchronous as it must return a value */
@@ -2632,10 +2632,10 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
#endif
#if GDISP_NEED_SCROLL
- void gdispGVerticalScroll(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
- coord_t abslines;
+ void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor) {
+ gCoord abslines;
#if GDISP_HARDWARE_SCROLL != GFXON
- coord_t fy, dy, ix, fx, i, j;
+ gCoord fy, dy, ix, fx, i, j;
#endif
if (!lines) return;
@@ -2938,7 +2938,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
return -1;
#endif
MUTEX_ENTER(g);
- g->p.x = (coord_t)what;
+ g->p.x = (gCoord)what;
res = gdisp_lld_query(g);
MUTEX_EXIT(g);
return res;
@@ -2955,7 +2955,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
/* High Level Driver Routines. */
/*===========================================================================*/
-void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
+void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color) {
if (cx <= 0 || cy <= 0) return;
cx = x+cx-1; cy = y+cy-1; // cx, cy are now the end point.
@@ -2985,7 +2985,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
}
#if GDISP_NEED_CONVEX_POLYGON
- void gdispGDrawPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color) {
+ void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
const gPoint *epnt, *p;
epnt = &pntarray[cnt-1];
@@ -3001,10 +3001,10 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- void gdispGFillConvexPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color) {
+ void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color) {
const gPoint *lpnt, *rpnt, *epnts;
fixed lx, rx, lk, rk;
- coord_t y, ymax, lxc, rxc;
+ gCoord y, ymax, lxc, rxc;
epnts = &pntarray[cnt-1];
@@ -3109,9 +3109,9 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
/* Find a vector (nx, ny) that is perpendicular to (dx, dy) and has length
* equal to 'norm'. */
- static void get_normal_vector(coord_t dx, coord_t dy, coord_t norm, coord_t *nx, coord_t *ny)
+ static void get_normal_vector(gCoord dx, gCoord dy, gCoord norm, gCoord *nx, gCoord *ny)
{
- coord_t absDx, absDy;
+ gCoord absDx, absDy;
int32_t len_n, len, len2;
char maxSteps;
@@ -3150,8 +3150,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
return;
}
- void gdispGDrawThickLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color, coord_t width, gBool round) {
- coord_t dx, dy, nx = 0, ny = 0;
+ void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round) {
+ gCoord dx, dy, nx = 0, ny = 0;
/* Compute the direction vector for the line */
dx = x1 - x0;
@@ -3211,7 +3211,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
* pt0 -------------------pt7
*/
gPoint pntarray[8];
- coord_t nx2, ny2;
+ gCoord nx2, ny2;
/* Magic numbers:
* 75/256 = sin(45) / (1 + sqrt(2)) diagonal octagon segments
@@ -3344,7 +3344,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
(void) line;
(void) count;
- ((coord_t*)state)[0]++;
+ ((gCoord*)state)[0]++;
return gTrue;
}
static gBool mf_drawline_callback(mf_str line, uint16_t count, void *state) {
@@ -3363,7 +3363,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
}
#endif
- void gdispGDrawChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color) {
+ void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3378,7 +3378,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- void gdispGFillChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor) {
+ void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color, color_t bgcolor) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3400,7 +3400,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- void gdispGDrawString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color) {
+ void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3416,7 +3416,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- void gdispGFillString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor) {
+ void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color, color_t bgcolor) {
if (!font)
return;
MUTEX_ENTER(g);
@@ -3439,8 +3439,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- void gdispGDrawStringBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, font_t font, color_t color, justify_t justify) {
- coord_t totalHeight;
+ void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify) {
+ gCoord totalHeight;
if (!font)
return;
@@ -3517,8 +3517,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- void gdispGFillStringBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, font_t font, color_t color, color_t bgcolor, justify_t justify) {
- coord_t totalHeight;
+ void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, color_t bgcolor, justify_t justify) {
+ gCoord totalHeight;
if (!font)
return;
@@ -3608,7 +3608,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
MUTEX_EXIT(g);
}
- coord_t gdispGetFontMetric(font_t font, fontmetric_t metric) {
+ gCoord gdispGetFontMetric(font_t font, fontmetric_t metric) {
if (!font)
return 0;
/* No mutex required as we only read static data */
@@ -3625,14 +3625,14 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
return 0;
}
- coord_t gdispGetCharWidth(char c, font_t font) {
+ gCoord gdispGetCharWidth(char c, font_t font) {
if (!font)
return 0;
/* No mutex required as we only read static data */
return mf_character_width(font, c);
}
- coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) {
+ gCoord gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) {
if (!str || !font)
return 0;
@@ -3644,7 +3644,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
#endif
}
- coord_t gdispGetStringWidth(const char* str, font_t font) {
+ gCoord gdispGetStringWidth(const char* str, font_t font) {
return gdispGetStringWidthCount(str, font, 0);
}
#endif
@@ -3732,7 +3732,7 @@ color_t gdispContrastColor(color_t color) {
}
#if (!defined(gdispPackPixels) && !defined(GDISP_PIXELFORMAT_CUSTOM))
- void gdispPackPixels(pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color) {
+ void gdispPackPixels(pixel_t *buf, gCoord cx, gCoord x, gCoord y, color_t color) {
/* No mutex required as we only read static data */
#if defined(GDISP_PIXELFORMAT_RGB888)
#error "GDISP: Packed pixels not supported yet"
diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h
index 33ac5468..3a92d784 100644
--- a/src/gdisp/gdisp.h
+++ b/src/gdisp/gdisp.h
@@ -36,7 +36,7 @@
/**
* @brief The type for a coordinate or length on the screen.
*/
-typedef int16_t coord_t;
+typedef int16_t gCoord;
#if GFX_USE_GDISP || defined(__DOXYGEN__)
@@ -49,8 +49,8 @@ typedef int16_t coord_t;
* @brief Type for a 2D point on the screen.
*/
typedef struct gPoint {
- coord_t x; /**< The x coordinate of the point. */
- coord_t y; /**< The y coordinate of the point. */
+ gCoord x; /**< The x coordinate of the point. */
+ gCoord y; /**< The y coordinate of the point. */
} gPoint;
/**
@@ -298,7 +298,7 @@ unsigned gdispGetDisplayCount(void);
*
* @api
*/
-coord_t gdispGGetWidth(GDisplay *g);
+gCoord gdispGGetWidth(GDisplay *g);
#define gdispGetWidth() gdispGGetWidth(GDISP)
/**
@@ -310,7 +310,7 @@ coord_t gdispGGetWidth(GDisplay *g);
*
* @api
*/
-coord_t gdispGGetHeight(GDisplay *g);
+gCoord gdispGGetHeight(GDisplay *g);
#define gdispGetHeight() gdispGGetHeight(GDISP)
/**
@@ -404,7 +404,7 @@ void gdispGClear(GDisplay *g, color_t color);
*
* @api
*/
-void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color);
+void gdispGDrawPixel(GDisplay *g, gCoord x, gCoord y, color_t color);
#define gdispDrawPixel(x,y,c) gdispGDrawPixel(GDISP,x,y,c)
/**
@@ -417,7 +417,7 @@ void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color);
*
* @api
*/
-void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
+void gdispGDrawLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color);
#define gdispDrawLine(x0,y0,x1,y1,c) gdispGDrawLine(GDISP,x0,y0,x1,y1,c)
/**
@@ -430,7 +430,7 @@ void gdispGDrawLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1,
*
* @api
*/
-void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
+void gdispGFillArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color);
#define gdispFillArea(x,y,cx,cy,c) gdispGFillArea(GDISP,x,y,cx,cy,c)
/**
@@ -452,7 +452,7 @@ void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
*
* @api
*/
-void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
+void gdispGBlitArea(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const pixel_t *buffer);
#define gdispBlitAreaEx(x,y,cx,cy,sx,sy,rx,b) gdispGBlitArea(GDISP,x,y,cx,cy,sx,sy,rx,b)
/**
@@ -465,7 +465,7 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
*
* @api
*/
-void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
+void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, color_t color);
#define gdispDrawBox(x,y,cx,cy,c) gdispGDrawBox(GDISP,x,y,cx,cy,c)
/* Streaming Functions */
@@ -495,7 +495,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGStreamStart(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy);
+ void gdispGStreamStart(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy);
#define gdispStreamStart(x,y,cx,cy) gdispGStreamStart(GDISP,x,y,cx,cy)
/**
@@ -543,7 +543,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGSetClip(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy);
+ void gdispGSetClip(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy);
#define gdispSetClip(x,y,cx,cy) gdispGSetClip(GDISP,x,y,cx,cy)
#endif
@@ -561,7 +561,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color);
+ void gdispGDrawCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color);
#define gdispDrawCircle(x,y,r,c) gdispGDrawCircle(GDISP,x,y,r,c)
/**
@@ -575,7 +575,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius, color_t color);
+ void gdispGFillCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius, color_t color);
#define gdispFillCircle(x,y,r,c) gdispGFillCircle(GDISP,x,y,r,c)
#endif
@@ -593,7 +593,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillDualCircle(GDisplay *g, coord_t x, coord_t y, coord_t radius1, color_t color1, coord_t radius2, color_t color2);
+ void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2);
#define gdispFillDualCircle(x,y,r1,c1,r2,c2) gdispGFillDualCircle(GDISP,x,y,r1,c1,r2,c2)
#endif
@@ -611,7 +611,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
+ void gdispGDrawEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color);
#define gdispDrawEllipse(x,y,a,b,c) gdispGDrawEllipse(GDISP,x,y,a,b,c)
/**
@@ -625,7 +625,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillEllipse(GDisplay *g, coord_t x, coord_t y, coord_t a, coord_t b, color_t color);
+ void gdispGFillEllipse(GDisplay *g, gCoord x, gCoord y, gCoord a, gCoord b, color_t color);
#define gdispFillEllipse(x,y,a,b,c) gdispGFillEllipse(GDISP,x,y,a,b,c)
#endif
@@ -657,7 +657,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color);
+ void gdispGDrawArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color);
#define gdispDrawArcSectors(x,y,r,s,c) gdispGDrawArcSectors(GDISP,x,y,r,s,c)
/**
@@ -686,7 +686,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillArcSectors(GDisplay *g, coord_t x, coord_t y, coord_t radius, uint8_t sectors, color_t color);
+ void gdispGFillArcSectors(GDisplay *g, gCoord x, gCoord y, gCoord radius, uint8_t sectors, color_t color);
#define gdispFillArcSectors(x,y,r,s,c) gdispGFillArcSectors(GDISP,x,y,r,s,c)
#endif
@@ -713,7 +713,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
+ void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color);
#define gdispDrawArc(x,y,r,s,e,c) gdispGDrawArc(GDISP,x,y,r,s,e,c)
/**
@@ -738,7 +738,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawThickArc(GDisplay *g, coord_t xc, coord_t yc, coord_t startradius, coord_t endradius, coord_t startangle, coord_t endangle, color_t color);
+ void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle, color_t color);
#define gdispDrawThickArc(x,y,rs,re,s,e,c) gdispGDrawThickArc(GDISP,x,y,rs,re,s,e,c)
/**
@@ -763,7 +763,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle, color_t color);
+ void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle, color_t color);
#define gdispFillArc(x,y,r,s,e,c) gdispGFillArc(GDISP,x,y,r,s,e,c)
#endif
@@ -780,7 +780,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- color_t gdispGGetPixelColor(GDisplay *g, coord_t x, coord_t y);
+ color_t gdispGGetPixelColor(GDisplay *g, gCoord x, gCoord y);
#define gdispGetPixelColor(x,y) gdispGGetPixelColor(GDISP,x,y)
#endif
@@ -801,7 +801,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGVerticalScroll(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor);
+ void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor);
#define gdispVerticalScroll(x,y,cx,cy,l,b) gdispGVerticalScroll(GDISP,x,y,cx,cy,l,b)
#endif
@@ -855,7 +855,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color);
+ void gdispGDrawPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color);
#define gdispDrawPoly(x,y,p,i,c) gdispGDrawPoly(GDISP,x,y,p,i,c)
/**
@@ -879,7 +879,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillConvexPoly(GDisplay *g, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt, color_t color);
+ void gdispGFillConvexPoly(GDisplay *g, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt, color_t color);
#define gdispFillConvexPoly(x,y,p,i,c) gdispGFillConvexPoly(GDISP,x,y,p,i,c)
/**
@@ -898,7 +898,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawThickLine(GDisplay *g, coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color, coord_t width, gBool round);
+ void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round);
#define gdispDrawThickLine(x0,y0,x1,y1,c,w,r) gdispGDrawThickLine(GDISP,x0,y0,x1,y1,c,w,r)
#endif
@@ -917,7 +917,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color);
+ void gdispGDrawChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color);
#define gdispDrawChar(x,y,s,f,c) gdispGDrawChar(GDISP,x,y,s,f,c)
/**
@@ -933,7 +933,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillChar(GDisplay *g, coord_t x, coord_t y, uint16_t c, font_t font, color_t color, color_t bgcolor);
+ void gdispGFillChar(GDisplay *g, gCoord x, gCoord y, uint16_t c, font_t font, color_t color, color_t bgcolor);
#define gdispFillChar(x,y,s,f,c,b) gdispGFillChar(GDISP,x,y,s,f,c,b)
/**
@@ -948,7 +948,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color);
+ void gdispGDrawString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color);
#define gdispDrawString(x,y,s,f,c) gdispGDrawString(GDISP,x,y,s,f,c)
/**
@@ -964,7 +964,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillString(GDisplay *g, coord_t x, coord_t y, const char *str, font_t font, color_t color, color_t bgcolor);
+ void gdispGFillString(GDisplay *g, gCoord x, gCoord y, const char *str, font_t font, color_t color, color_t bgcolor);
#define gdispFillString(x,y,s,f,c,b) gdispGFillString(GDISP,x,y,s,f,c,b)
/**
@@ -981,7 +981,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawStringBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, font_t font, color_t color, justify_t justify);
+ void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify);
#define gdispDrawStringBox(x,y,cx,cy,s,f,c,j) gdispGDrawStringBox(GDISP,x,y,cx,cy,s,f,c,j)
/**
@@ -1000,7 +1000,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillStringBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, font_t font, color_t color, color_t bgColor, justify_t justify);
+ void gdispGFillStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, color_t bgColor, justify_t justify);
#define gdispFillStringBox(x,y,cx,cy,s,f,c,b,j) gdispGFillStringBox(GDISP,x,y,cx,cy,s,f,c,b,j)
/**
@@ -1013,7 +1013,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- coord_t gdispGetFontMetric(font_t font, fontmetric_t metric);
+ gCoord gdispGetFontMetric(font_t font, fontmetric_t metric);
/**
* @brief Get the pixel width of a character.
@@ -1025,7 +1025,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- coord_t gdispGetCharWidth(char c, font_t font);
+ gCoord gdispGetCharWidth(char c, font_t font);
/**
* @brief Get the pixel width of a string of a given character length.
@@ -1040,7 +1040,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count);
+ gCoord gdispGetStringWidthCount(const char* str, font_t font, uint16_t count);
/**
* @brief Get the pixel width of an entire string.
@@ -1052,7 +1052,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- coord_t gdispGetStringWidth(const char* str, font_t font);
+ gCoord gdispGetStringWidth(const char* str, font_t font);
/**
* @brief Find a font and return it.
@@ -1130,7 +1130,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGDrawRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color);
+ void gdispGDrawRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color);
#define gdispDrawRoundedBox(x,y,cx,cy,r,c) gdispGDrawRoundedBox(GDISP,x,y,cx,cy,r,c)
/**
@@ -1145,7 +1145,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
*
* @api
*/
- void gdispGFillRoundedBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color);
+ void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color);
#define gdispFillRoundedBox(x,y,cx,cy,r,c) gdispGFillRoundedBox(GDISP,x,y,cx,cy,r,c)
#endif
@@ -1230,6 +1230,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
/* V2 compatibility */
#if GFX_COMPAT_V2
+ typedef gCoord coord_t;
typedef gPoint point, point_t;
#endif
diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h
index dffce58d..1b6b89d6 100644
--- a/src/gdisp/gdisp_driver.h
+++ b/src/gdisp/gdisp_driver.h
@@ -308,7 +308,7 @@
*
* @api
*/
- void gdispPackPixels(const pixel_t *buf, coord_t cx, coord_t x, coord_t y, color_t color);
+ void gdispPackPixels(const pixel_t *buf, gCoord cx, gCoord x, gCoord y, color_t color);
#endif
//------------------------------------------------------------------------------------------------------------
@@ -318,8 +318,8 @@ struct GDisplay {
#define gvmt(g) ((const GDISPVMT const *)((g)->d.vmt)) // For ease of access to the vmt member
struct GDISPControl {
- coord_t Width;
- coord_t Height;
+ gCoord Width;
+ gCoord Height;
orientation_t Orientation;
powermode_t Powermode;
uint8_t Backlight;
@@ -343,16 +343,16 @@ struct GDisplay {
// Software clipping
#if GDISP_HARDWARE_CLIP != GFXON && (GDISP_NEED_CLIP || GDISP_NEED_VALIDATION)
- coord_t clipx0, clipy0;
- coord_t clipx1, clipy1; /* not inclusive */
+ gCoord clipx0, clipy0;
+ gCoord clipx1, clipy1; /* not inclusive */
#endif
// Driver call parameters
struct {
- coord_t x, y;
- coord_t cx, cy;
- coord_t x1, y1;
- coord_t x2, y2;
+ gCoord x, y;
+ gCoord cx, cy;
+ gCoord x1, y1;
+ gCoord x2, y2;
color_t color;
void *ptr;
} p;
@@ -365,10 +365,10 @@ struct GDisplay {
font_t font;
color_t color;
color_t bgcolor;
- coord_t clipx0, clipy0;
- coord_t clipx1, clipy1;
+ gCoord clipx0, clipy0;
+ gCoord clipx1, clipy1;
#if GDISP_NEED_TEXT_WORDWRAP
- coord_t wrapx, wrapy;
+ gCoord wrapx, wrapy;
justify_t lrj;
#endif
} t;
diff --git a/src/gdisp/gdisp_image.c b/src/gdisp/gdisp_image.c
index ae6a1a77..3e202b18 100644
--- a/src/gdisp/gdisp_image.c
+++ b/src/gdisp/gdisp_image.c
@@ -15,7 +15,7 @@
extern gdispImageError gdispImageOpen_NATIVE(gdispImage *img);
extern void gdispImageClose_NATIVE(gdispImage *img);
extern gdispImageError gdispImageCache_NATIVE(gdispImage *img);
- extern gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+ extern gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern delaytime_t gdispImageNext_NATIVE(gdispImage *img);
#endif
@@ -23,7 +23,7 @@
extern gdispImageError gdispImageOpen_GIF(gdispImage *img);
extern void gdispImageClose_GIF(gdispImage *img);
extern gdispImageError gdispImageCache_GIF(gdispImage *img);
- extern gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+ extern gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern delaytime_t gdispImageNext_GIF(gdispImage *img);
#endif
@@ -31,7 +31,7 @@
extern gdispImageError gdispImageOpen_BMP(gdispImage *img);
extern void gdispImageClose_BMP(gdispImage *img);
extern gdispImageError gdispImageCache_BMP(gdispImage *img);
- extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+ extern gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern delaytime_t gdispImageNext_BMP(gdispImage *img);
extern uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img);
extern color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index);
@@ -42,7 +42,7 @@
extern gdispImageError gdispImageOpen_JPG(gdispImage *img);
extern void gdispImageClose_JPG(gdispImage *img);
extern gdispImageError gdispImageCache_JPG(gdispImage *img);
- extern gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+ extern gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern delaytime_t gdispImageNext_JPG(gdispImage *img);
#endif
@@ -50,7 +50,7 @@
extern gdispImageError gdispImageOpen_PNG(gdispImage *img);
extern void gdispImageClose_PNG(gdispImage *img);
extern gdispImageError gdispImageCache_PNG(gdispImage *img);
- extern gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+ extern gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
extern delaytime_t gdispImageNext_PNG(gdispImage *img);
#endif
@@ -61,9 +61,9 @@ typedef struct gdispImageHandlers {
gdispImageError (*cache)(gdispImage *img); /* The cache function */
gdispImageError (*draw)(GDisplay *g,
gdispImage *img,
- coord_t x, coord_t y,
- coord_t cx, coord_t cy,
- coord_t sx, coord_t sy); /* The draw function */
+ gCoord x, gCoord y,
+ gCoord cx, gCoord cy,
+ gCoord sx, gCoord sy); /* The draw function */
delaytime_t (*next)(gdispImage *img); /* The next frame function */
uint16_t (*getPaletteSize)(gdispImage *img); /* Retrieve the size of the palette (number of entries) */
color_t (*getPalette)(gdispImage *img, uint16_t index); /* Retrieve a specific color value of the palette */
@@ -170,7 +170,7 @@ gdispImageError gdispImageCache(gdispImage *img) {
return img->fns->cache(img);
}
-gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
+gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
if (!img) return GDISP_IMAGE_ERR_NULLPOINTER;
if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT;
diff --git a/src/gdisp/gdisp_image.h b/src/gdisp/gdisp_image.h
index 99391850..864c0a20 100644
--- a/src/gdisp/gdisp_image.h
+++ b/src/gdisp/gdisp_image.h
@@ -60,7 +60,7 @@ typedef struct gdispImage {
gdispImageType type; /* @< The image type */
gdispImageFlags flags; /* @< The image flags */
color_t bgcolor; /* @< The default background color */
- coord_t width, height; /* @< The image dimensions */
+ gCoord width, height; /* @< The image dimensions */
GFILE * f; /* @< The underlying GFILE */
#if GDISP_NEED_IMAGE_ACCOUNTING
uint32_t memused; /* @< How much RAM is currently allocated */
@@ -221,7 +221,7 @@ gdispImageError gdispImageCache(gdispImage *img);
* is drawing. This may be significantly slower than if the image has been cached (but
* uses a lot less RAM)
*/
-gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
#define gdispImageDraw(img,x,y,cx,cy,sx,sy) gdispGImageDraw(GDISP,img,x,y,cx,cy,sx,sy)
/**
diff --git a/src/gdisp/gdisp_image_bmp.c b/src/gdisp/gdisp_image_bmp.c
index 2cb00853..54e66abb 100644
--- a/src/gdisp/gdisp_image_bmp.c
+++ b/src/gdisp/gdisp_image_bmp.c
@@ -352,10 +352,10 @@ unsupportedcleanup:
return GDISP_IMAGE_ERR_UNSUPPORTED; // Not supported
}
-static coord_t getPixels(gdispImage *img, coord_t x) {
+static gCoord getPixels(gdispImage *img, gCoord x) {
gdispImagePrivate_BMP * priv;
color_t * pc;
- coord_t len;
+ gCoord len;
priv = (gdispImagePrivate_BMP *)img->priv;
pc = priv->buf;
@@ -695,7 +695,7 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) {
gdispImagePrivate_BMP * priv;
color_t * pcs;
color_t * pcd;
- coord_t pos, x, y;
+ gCoord pos, x, y;
size_t len;
/* If we are already cached - just return OK */
@@ -749,10 +749,10 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) {
return GDISP_IMAGE_ERR_OK;
}
-gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
+gdispImageError gdispGImageDraw_BMP(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gdispImagePrivate_BMP * priv;
- coord_t mx, my;
- coord_t pos, len, st;
+ gCoord mx, my;
+ gCoord pos, len, st;
priv = (gdispImagePrivate_BMP *)img->priv;
diff --git a/src/gdisp/gdisp_image_gif.c b/src/gdisp/gdisp_image_gif.c
index 91a47b6c..5aaeaeb1 100644
--- a/src/gdisp/gdisp_image_gif.c
+++ b/src/gdisp/gdisp_image_gif.c
@@ -52,8 +52,8 @@ typedef struct gifimgdecode {
// The data on a single frame
typedef struct gifimgframe {
- coord_t x, y; // position relative to full image
- coord_t width, height; // size of frame
+ gCoord x, y; // position relative to full image
+ gCoord width, height; // size of frame
uint16_t delay; // delay after processing
uint8_t flags; // Local flags
#define GIFL_TRANSPARENT 0x01 // There exists a transparent color
@@ -80,8 +80,8 @@ typedef struct gifimgcache {
typedef struct gifimgdispose {
uint8_t flags; // Frame flags
uint8_t paltrans; // Transparency
- coord_t x, y; // position relative to full image
- coord_t width, height; // size of dispose area
+ gCoord x, y; // position relative to full image
+ gCoord width, height; // size of dispose area
} gifimgdispose;
typedef struct gdispImagePrivate_GIF {
@@ -601,7 +601,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
gifimgdecode * decode;
uint8_t * p;
uint8_t * q;
- coord_t mx, my;
+ gCoord mx, my;
uint16_t cnt;
/* If we are already cached - just return OK */
@@ -766,11 +766,11 @@ baddatacleanup:
return GDISP_IMAGE_ERR_BADDATA;
}
-gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
+gdispImageError gdispGImageDraw_GIF(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gdispImagePrivate_GIF * priv;
gifimgdecode * decode;
uint8_t * q = 0;
- coord_t mx, my, fx, fy;
+ gCoord mx, my, fx, fy;
uint16_t cnt, gcnt;
uint8_t col;
diff --git a/src/gdisp/gdisp_image_jpg.c b/src/gdisp/gdisp_image_jpg.c
index 974d7142..b188f0f0 100644
--- a/src/gdisp/gdisp_image_jpg.c
+++ b/src/gdisp/gdisp_image_jpg.c
@@ -28,7 +28,7 @@
#define JD_WORKSZ (JD_SZBUF+2580+8) /* The extra 8 bytes just for safety */
typedef struct {
- coord_t left, right, top, bottom;
+ gCoord left, right, top, bottom;
} JRECT;
/* Decompressor object structure */
typedef struct JDEC {
@@ -134,7 +134,7 @@ static unsigned gdispImage_JPG_WriteToCache(gdispImage *img, void *bitmap, JRECT
gdispImagePrivate_JPG *priv;
uint8_t *in;
pixel_t *out;
- coord_t x, y;
+ gCoord x, y;
priv = (gdispImagePrivate_JPG *)img->priv;
in = (unsigned char *)bitmap;
@@ -176,7 +176,7 @@ gdispImageError gdispImageCache_JPG(gdispImage *img) {
return r;
}
-gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy){
+gdispImageError gdispGImageDraw_JPG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy){
gdispImagePrivate_JPG * priv;
priv = (gdispImagePrivate_JPG *)img->priv;
diff --git a/src/gdisp/gdisp_image_native.c b/src/gdisp/gdisp_image_native.c
index 28706564..2043401c 100644
--- a/src/gdisp/gdisp_image_native.c
+++ b/src/gdisp/gdisp_image_native.c
@@ -93,8 +93,8 @@ gdispImageError gdispImageCache_NATIVE(gdispImage *img) {
return GDISP_IMAGE_ERR_OK;
}
-gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
- coord_t mx, mcx;
+gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
+ gCoord mx, mcx;
size_t pos, len;
gdispImagePrivate_NATIVE * priv;
diff --git a/src/gdisp/gdisp_image_png.c b/src/gdisp/gdisp_image_png.c
index 8032ffe6..9cb34cd5 100644
--- a/src/gdisp/gdisp_image_png.c
+++ b/src/gdisp/gdisp_image_png.c
@@ -65,10 +65,10 @@ typedef struct PNG_input {
// Handle the display output and windowing
typedef struct PNG_output {
GDisplay *g;
- coord_t x, y;
- coord_t cx, cy;
- coord_t sx, sy;
- coord_t ix, iy;
+ gCoord x, y;
+ gCoord cx, cy;
+ gCoord sx, sy;
+ gCoord ix, iy;
unsigned cnt;
pixel_t buf[GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE];
} PNG_output;
@@ -198,7 +198,7 @@ static uint8_t PNG_iGetByte(PNG_decode *d) {
*---------------------------------------------------------------*/
// Initialize the display output window
-static void PNG_oInit(PNG_output *o, GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
+static void PNG_oInit(PNG_output *o, GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
o->g = g;
o->x = x;
o->y = y;
@@ -222,7 +222,7 @@ static void PNG_oFlush(PNG_output *o) {
}
// Start a new image line
-static gBool PNG_oStartY(PNG_output *o, coord_t y) {
+static gBool PNG_oStartY(PNG_output *o, gCoord y) {
if (y < o->sy || y >= o->sy+o->cy)
return gFalse;
o->ix = 0;
@@ -233,7 +233,7 @@ static gBool PNG_oStartY(PNG_output *o, coord_t y) {
// Feed a pixel color to the display buffer
static void PNG_oColor(PNG_output *o, color_t c) {
// Is it in the window
- if (o->ix+(coord_t)o->cnt < o->sx || o->ix+(coord_t)o->cnt >= o->sx+o->cx) {
+ if (o->ix+(gCoord)o->cnt < o->sx || o->ix+(gCoord)o->cnt >= o->sx+o->cx) {
// No - just skip the pixel
PNG_oFlush(o);
o->ix++;
@@ -1497,7 +1497,7 @@ exit_nonmem:
return GDISP_IMAGE_ERR_NOMEMORY;
}
-gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
+gdispImageError gdispGImageDraw_PNG(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
PNG_info *pinfo;
PNG_decode *d;
diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c
index 88bd57a3..081db8d3 100644
--- a/src/gdisp/gdisp_pixmap.c
+++ b/src/gdisp/gdisp_pixmap.c
@@ -49,15 +49,15 @@ typedef struct pixmap {
color_t pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard.
} pixmap;
-GDisplay *gdispPixmapCreate(coord_t width, coord_t height) {
+GDisplay *gdispPixmapCreate(gCoord width, gCoord height) {
GDisplay *g;
pixmap *p;
unsigned i;
// Calculate the size of the display surface in bytes
i = width*height*sizeof(color_t);
- if (i < 2*sizeof(coord_t))
- i = 2*sizeof(coord_t);
+ if (i < 2*sizeof(gCoord))
+ i = 2*sizeof(gCoord);
// Allocate the pixmap
if (!(p = gfxAlloc(i+sizeof(pixmap)-sizeof(p->pixels))))
@@ -76,8 +76,8 @@ GDisplay *gdispPixmapCreate(coord_t width, coord_t height) {
#endif
// Save the width and height so the driver can retrieve it.
- ((coord_t *)p->pixels)[0] = width;
- ((coord_t *)p->pixels)[1] = height;
+ ((gCoord *)p->pixels)[0] = width;
+ ((gCoord *)p->pixels)[1] = height;
// Register the driver
g = (GDisplay *)gdriverRegister(&GDISPVMT_pixmap->d, p);
@@ -118,8 +118,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
// Initialize the GDISP structure
// Width and height were saved into the start of the framebuffer.
- g->g.Width = ((coord_t *)((pixmap *)g->priv)->pixels)[0];
- g->g.Height = ((coord_t *)((pixmap *)g->priv)->pixels)[1];
+ g->g.Width = ((gCoord *)((pixmap *)g->priv)->pixels)[0];
+ g->g.Height = ((gCoord *)((pixmap *)g->priv)->pixels)[1];
g->g.Backlight = 100;
g->g.Contrast = 50;
g->g.Orientation = GDISP_ROTATE_0;
@@ -195,7 +195,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
case GDISP_ROTATE_0:
case GDISP_ROTATE_180:
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
@@ -205,7 +205,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
case GDISP_ROTATE_90:
case GDISP_ROTATE_270:
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
- coord_t tmp;
+ gCoord tmp;
tmp = g->g.Width;
g->g.Width = g->g.Height;
diff --git a/src/gdisp/gdisp_pixmap.h b/src/gdisp/gdisp_pixmap.h
index 4d5e8004..5e139796 100644
--- a/src/gdisp/gdisp_pixmap.h
+++ b/src/gdisp/gdisp_pixmap.h
@@ -37,7 +37,7 @@
* @note Because the RAM for the display area is allocated, on small micros only very small pixmaps should be considered.
* For example a 100x100 at 16 bits per pixel would be 20K of RAM (plus some overheads).
*/
-GDisplay *gdispPixmapCreate(coord_t width, coord_t height);
+GDisplay *gdispPixmapCreate(gCoord width, gCoord height);
/**
* @brief Destroy an off-screen pixmap
diff --git a/src/ginput/ginput_driver_mouse.h b/src/ginput/ginput_driver_mouse.h
index 42c93e75..8b239517 100644
--- a/src/ginput/ginput_driver_mouse.h
+++ b/src/ginput/ginput_driver_mouse.h
@@ -23,7 +23,7 @@
#include "../gdriver/gdriver.h"
typedef struct GMouseReading {
- coord_t x, y, z;
+ gCoord x, y, z;
uint16_t buttons;
} GMouseReading;
@@ -60,9 +60,9 @@ typedef struct GMouse {
} GMouse;
typedef struct GMouseJitter {
- coord_t calibrate; // Maximum error for a calibration to succeed
- coord_t click; // Movement allowed without discarding the CLICK or CLICKCXT event
- coord_t move; // Movement allowed without discarding the MOVE event
+ gCoord calibrate; // Maximum error for a calibration to succeed
+ gCoord click; // Movement allowed without discarding the CLICK or CLICKCXT event
+ gCoord move; // Movement allowed without discarding the MOVE event
} GMouseJitter;
typedef struct GMouseVMT {
@@ -77,10 +77,10 @@ typedef struct GMouseVMT {
#define GMOUSE_VFLG_ONLY_DOWN 0x0100 // This device returns a valid position only when the mouse is down
#define GMOUSE_VFLG_POORUPDOWN 0x0200 // Position readings during up/down are unreliable
#define GMOUSE_VFLG_DYNAMICONLY 0x8000 // This mouse driver should not be statically initialized eg Win32
- coord_t z_max; // TOUCH: Maximum possible z value (fully touched)
- coord_t z_min; // TOUCH: Minimum possible z value (touch off screen). Note may also be > z_max
- coord_t z_touchon; // TOUCH: z values between z_max and this are a solid touch on
- coord_t z_touchoff; // TOUCH: z values between z_min and this are a solid touch off
+ gCoord z_max; // TOUCH: Maximum possible z value (fully touched)
+ gCoord z_min; // TOUCH: Minimum possible z value (touch off screen). Note may also be > z_max
+ gCoord z_touchon; // TOUCH: z values between z_max and this are a solid touch on
+ gCoord z_touchoff; // TOUCH: z values between z_min and this are a solid touch off
GMouseJitter pen_jitter; // PEN MODE: Jitter settings
GMouseJitter finger_jitter; // FINGER MODE: Jitter settings
diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c
index 73d855b8..4caaeb92 100644
--- a/src/ginput/ginput_mouse.c
+++ b/src/ginput/ginput_mouse.c
@@ -72,10 +72,10 @@ static GTIMER_DECL(MouseTimer);
#include <string.h> // Required for memcpy
static GFXINLINE void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) {
- coord_t x, y;
+ gCoord x, y;
- x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx);
- y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
+ x = (gCoord) (c->ax * pt->x + c->bx * pt->y + c->cx);
+ y = (gCoord) (c->ay * pt->x + c->by * pt->y + c->cy);
pt->x = x;
pt->y = y;
@@ -196,7 +196,7 @@ static void GetMouseReading(GMouse *m) {
// We can't clip or rotate if we don't have a display
if (m->display) {
- coord_t w, h;
+ gCoord w, h;
// We now need display information
w = gdispGGetWidth(m->display);
@@ -205,7 +205,7 @@ static void GetMouseReading(GMouse *m) {
#if GDISP_NEED_CONTROL
// Do we need to rotate the reading to match the display
if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) {
- coord_t t;
+ gCoord t;
switch(gdispGGetOrientation(m->display)) {
case GDISP_ROTATE_0:
@@ -372,7 +372,7 @@ static void MousePoll(void *param) {
static GFXINLINE void CalibrationCalculate(GMouse *m, const gPoint *cross, const gPoint *points) {
float dx;
- coord_t c0, c1, c2;
+ gCoord c0, c1, c2;
(void) m;
// Work on x values
@@ -462,7 +462,7 @@ static void MousePoll(void *param) {
}
static uint32_t CalibrateMouse(GMouse *m) {
- coord_t w, h;
+ gCoord w, h;
gPoint cross[4]; // The locations of the test points on the display
gPoint points[4]; // The x, y readings obtained from the mouse for each test point
uint32_t err;
@@ -570,7 +570,7 @@ static void MousePoll(void *param) {
// Do we need to rotate the reading to match the display
#if GDISP_NEED_CONTROL
if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) {
- coord_t t;
+ gCoord t;
switch(gdispGGetOrientation(m->display)) {
case GDISP_ROTATE_0:
diff --git a/src/ginput/ginput_mouse.h b/src/ginput/ginput_mouse.h
index 0d641d90..4b31f814 100644
--- a/src/ginput/ginput_mouse.h
+++ b/src/ginput/ginput_mouse.h
@@ -33,7 +33,7 @@
/* This type definition is also used by touch */
typedef struct GEventMouse_t {
GEventType type; // The type of this event (GEVENT_MOUSE or GEVENT_TOUCH)
- coord_t x, y, z; // The position of the mouse.
+ gCoord x, y, z; // The position of the mouse.
// - For touch devices, Z is the current pressure if supported (values are device specific)
// - For mice, Z is the 3rd dimension if supported (values are device specific)
uint16_t buttons; // A bit is set if the button is down or a meta event has occurred.
diff --git a/src/gmisc/gmisc_hittest.c b/src/gmisc/gmisc_hittest.c
index 9b279873..e3a6266d 100644
--- a/src/gmisc/gmisc_hittest.c
+++ b/src/gmisc/gmisc_hittest.c
@@ -28,7 +28,7 @@ static char _pointCrossingSegment(const gPoint *a, const gPoint *b, const gPoint
* it won't intersect.
*/
if (c->y <= a->y && c->y >= b->y) {
- coord_t crossProduct;
+ gCoord crossProduct;
/* If the line is parallel */
if (a->y == b->y) {
diff --git a/src/gmisc/gmisc_matrix2d.c b/src/gmisc/gmisc_matrix2d.c
index ad792ca0..0a31e12d 100644
--- a/src/gmisc/gmisc_matrix2d.c
+++ b/src/gmisc/gmisc_matrix2d.c
@@ -178,7 +178,7 @@ void gmiscMatrixFixed2DApplyShear(MatrixFixed2D *dst, const MatrixFixed2D *src,
#endif
void gmiscMatrixFixed2DApplyToPoints(gPoint *dst, const gPoint *src, const MatrixFixed2D *m, int cnt) {
- coord_t x;
+ gCoord x;
for( ;cnt--; dst++, src++) {
x = src->x; // This allows in-place operation
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c
index 9fbc304e..8b093851 100644
--- a/src/gwin/gwin.c
+++ b/src/gwin/gwin.c
@@ -237,44 +237,44 @@ void gwinClear(GHandle gh) {
gh->vmt->AfterClear(gh);
}
-void gwinDrawPixel(GHandle gh, coord_t x, coord_t y) {
+void gwinDrawPixel(GHandle gh, gCoord x, gCoord y) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawPixel(gh->display, gh->x+x, gh->y+y, gh->color);
_gwinDrawEnd(gh);
}
-void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
+void gwinDrawLine(GHandle gh, gCoord x0, gCoord y0, gCoord x1, gCoord y1) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color);
_gwinDrawEnd(gh);
}
-void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
+void gwinDrawBox(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawBox(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
_gwinDrawEnd(gh);
}
-void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
+void gwinFillArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy) {
if (!_gwinDrawStart(gh)) return;
gdispGFillArea(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
_gwinDrawEnd(gh);
}
-void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
+void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const pixel_t *buffer) {
if (!_gwinDrawStart(gh)) return;
gdispGBlitArea(gh->display, gh->x+x, gh->y+y, cx, cy, srcx, srcy, srccx, buffer);
_gwinDrawEnd(gh);
}
#if GDISP_NEED_CIRCLE
- void gwinDrawCircle(GHandle gh, coord_t x, coord_t y, coord_t radius) {
+ void gwinDrawCircle(GHandle gh, gCoord x, gCoord y, gCoord radius) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius) {
+ void gwinFillCircle(GHandle gh, gCoord x, gCoord y, gCoord radius) {
if (!_gwinDrawStart(gh)) return;
gdispGFillCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
_gwinDrawEnd(gh);
@@ -282,7 +282,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_DUALCIRCLE
- void gwinFillDualCircle(GHandle gh, coord_t x, coord_t y, coord_t radius1, coord_t radius2) {
+ void gwinFillDualCircle(GHandle gh, gCoord x, gCoord y, gCoord radius1, gCoord radius2) {
if (!_gwinDrawStart(gh)) return;
gdispGFillDualCircle(gh->display, gh->x+x, gh->y+y, radius1, gh->bgcolor, radius2, gh->color);
_gwinDrawEnd(gh);
@@ -290,13 +290,13 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_ELLIPSE
- void gwinDrawEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b) {
+ void gwinDrawEllipse(GHandle gh, gCoord x, gCoord y, gCoord a, gCoord b) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b) {
+ void gwinFillEllipse(GHandle gh, gCoord x, gCoord y, gCoord a, gCoord b) {
if (!_gwinDrawStart(gh)) return;
gdispGFillEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
_gwinDrawEnd(gh);
@@ -304,19 +304,19 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_ARC
- void gwinDrawArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle) {
+ void gwinDrawArc(GHandle gh, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle) {
+ void gwinFillArc(GHandle gh, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle) {
if (!_gwinDrawStart(gh)) return;
gdispGFillArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
_gwinDrawEnd(gh);
}
- void gwinDrawThickArc(GHandle gh, coord_t x, coord_t y, coord_t startradius, coord_t endradius, coord_t startangle, coord_t endangle) {
+ void gwinDrawThickArc(GHandle gh, gCoord x, gCoord y, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawThickArc(gh->display, gh->x+x, gh->y+y, startradius, endradius, startangle, endangle, gh->color);
_gwinDrawEnd(gh);
@@ -324,13 +324,13 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_ARCSECTORS
- void gwinDrawArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors) {
+ void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors) {
+ void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors) {
if (!_gwinDrawStart(gh)) return;
gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
_gwinDrawEnd(gh);
@@ -338,7 +338,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_PIXELREAD
- color_t gwinGetPixelColor(GHandle gh, coord_t x, coord_t y) {
+ color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y) {
if (!_gwinDrawStart(gh)) return (color_t)0;
return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
_gwinDrawEnd(gh);
@@ -346,37 +346,37 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_TEXT
- void gwinDrawChar(GHandle gh, coord_t x, coord_t y, char c) {
+ void gwinDrawChar(GHandle gh, gCoord x, gCoord y, char c) {
if (!gh->font || !_gwinDrawStart(gh)) return;
gdispGDrawChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c) {
+ void gwinFillChar(GHandle gh, gCoord x, gCoord y, char c) {
if (!gh->font || !_gwinDrawStart(gh)) return;
gdispGFillChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color, gh->bgcolor);
_gwinDrawEnd(gh);
}
- void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str) {
+ void gwinDrawString(GHandle gh, gCoord x, gCoord y, const char *str) {
if (!gh->font || !_gwinDrawStart(gh)) return;
gdispGDrawString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str) {
+ void gwinFillString(GHandle gh, gCoord x, gCoord y, const char *str) {
if (!gh->font || !_gwinDrawStart(gh)) return;
gdispGFillString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color, gh->bgcolor);
_gwinDrawEnd(gh);
}
- void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
+ void gwinDrawStringBox(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, justify_t justify) {
if (!gh->font || !_gwinDrawStart(gh)) return;
gdispGDrawStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, justify);
_gwinDrawEnd(gh);
}
- void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
+ void gwinFillStringBox(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, justify_t justify) {
if (!gh->font || !_gwinDrawStart(gh)) return;
gdispGFillStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, gh->bgcolor, justify);
_gwinDrawEnd(gh);
@@ -384,18 +384,18 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_CONVEX_POLYGON
- void gwinDrawPoly(GHandle gh, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt) {
+ void gwinDrawPoly(GHandle gh, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
_gwinDrawEnd(gh);
}
- void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt) {
+ void gwinFillConvexPoly(GHandle gh, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt) {
if (!_gwinDrawStart(gh)) return;
gdispGFillConvexPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
_gwinDrawEnd(gh);
}
- void gwinDrawThickLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1, coord_t width, gBool round) {
+ void gwinDrawThickLine(GHandle gh, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gCoord width, gBool round) {
if (!_gwinDrawStart(gh)) return;
gdispGDrawThickLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color, width, round);
_gwinDrawEnd(gh);
@@ -403,7 +403,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
#endif
#if GDISP_NEED_IMAGE
- gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy) {
+ gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
gdispImageError ret;
if (!_gwinDrawStart(gh)) return GDISP_IMAGE_ERR_OK;
diff --git a/src/gwin/gwin.h b/src/gwin/gwin.h
index e313743a..c27aadc3 100644
--- a/src/gwin/gwin.h
+++ b/src/gwin/gwin.h
@@ -44,10 +44,10 @@ typedef struct GWindowObject {
#endif
const struct gwinVMT* vmt; /**< The VMT for this GWIN */
GDisplay * display; /**< The display this window is on */
- coord_t x; /**< The position relative to the screen */
- coord_t y; /**< The position relative to the screen */
- coord_t width; /**< The width of this window */
- coord_t height; /**< The height of this window */
+ gCoord x; /**< The position relative to the screen */
+ gCoord y; /**< The position relative to the screen */
+ gCoord width; /**< The width of this window */
+ gCoord height; /**< The height of this window */
color_t color; /**< The current foreground drawing color */
color_t bgcolor; /**< The current background drawing color */
uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */
@@ -73,10 +73,10 @@ typedef struct GWindowObject {
* @{
*/
typedef struct GWindowInit {
- coord_t x; /**< The initial position relative to its parent */
- coord_t y; /**< The initial position relative to its parent */
- coord_t width; /**< The width */
- coord_t height; /**< The height */
+ gCoord x; /**< The initial position relative to its parent */
+ gCoord y; /**< The initial position relative to its parent */
+ gCoord width; /**< The width */
+ gCoord height; /**< The height */
gBool show; /**< Should the window be visible initially */
#if GWIN_NEED_CONTAINERS
GHandle parent; /**< The parent - must be a container or NULL */
@@ -437,7 +437,7 @@ gBool gwinGetEnabled(GHandle gh);
*
* @api
*/
-void gwinMove(GHandle gh, coord_t x, coord_t y);
+void gwinMove(GHandle gh, gCoord x, gCoord y);
/**
* @brief Resize a window
@@ -455,7 +455,7 @@ void gwinMove(GHandle gh, coord_t x, coord_t y);
*
* @api
*/
-void gwinResize(GHandle gh, coord_t width, coord_t height);
+void gwinResize(GHandle gh, gCoord width, gCoord height);
/**
* @brief Redraw a window
@@ -622,7 +622,7 @@ void gwinClear(GHandle gh);
*
* @api
*/
-void gwinDrawPixel(GHandle gh, coord_t x, coord_t y);
+void gwinDrawPixel(GHandle gh, gCoord x, gCoord y);
/**
* @brief Draw a line in the window
@@ -635,7 +635,7 @@ void gwinDrawPixel(GHandle gh, coord_t x, coord_t y);
*
* @api
*/
-void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1);
+void gwinDrawLine(GHandle gh, gCoord x0, gCoord y0, gCoord x1, gCoord y1);
/**
* @brief Draw a box in the window
@@ -648,7 +648,7 @@ void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1);
*
* @api
*/
-void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy);
+void gwinDrawBox(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy);
/**
* @brief Fill an rectangular area in the window
@@ -661,7 +661,7 @@ void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy);
*
* @api
*/
-void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy);
+void gwinFillArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy);
/**
* @brief Fill an area in the window using the supplied bitmap.
@@ -680,7 +680,7 @@ void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy);
*
* @api
*/
-void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
+void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord srcx, gCoord srcy, gCoord srccx, const pixel_t *buffer);
/*-------------------------------------------------
* Circle, ellipse, arc and arc-sectors functions
@@ -698,7 +698,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawCircle(GHandle gh, coord_t x, coord_t y, coord_t radius);
+ void gwinDrawCircle(GHandle gh, gCoord x, gCoord y, gCoord radius);
/**
* @brief Draw a filled circle in the window.
@@ -711,7 +711,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius);
+ void gwinFillCircle(GHandle gh, gCoord x, gCoord y, gCoord radius);
#endif
#if GDISP_NEED_DUALCIRCLE || defined(__DOXYGEN__)
@@ -729,7 +729,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillDualCircle(GHandle gh, coord_t x, coord_t y, coord_t radius1, coord_t radius2);
+ void gwinFillDualCircle(GHandle gh, gCoord x, gCoord y, gCoord radius1, gCoord radius2);
#endif
#if GDISP_NEED_ELLIPSE || defined(__DOXYGEN__)
@@ -744,7 +744,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b);
+ void gwinDrawEllipse(GHandle gh, gCoord x, gCoord y, gCoord a, gCoord b);
/**
* @brief Draw an filled ellipse.
@@ -757,7 +757,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b);
+ void gwinFillEllipse(GHandle gh, gCoord x, gCoord y, gCoord a, gCoord b);
#endif
#if GDISP_NEED_ARC || defined(__DOXYGEN__)
@@ -774,7 +774,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle);
+ void gwinDrawArc(GHandle gh, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle);
/*
* @brief Draw a filled arc in the window.
@@ -789,7 +789,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle);
+ void gwinFillArc(GHandle gh, gCoord x, gCoord y, gCoord radius, gCoord startangle, gCoord endangle);
/*
* @brief Draw a thick arc in the window.
@@ -805,7 +805,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawThickArc(GHandle gh, coord_t x, coord_t y, coord_t startradius, coord_t endradius, coord_t startangle, coord_t endangle);
+ void gwinDrawThickArc(GHandle gh, gCoord x, gCoord y, gCoord startradius, gCoord endradius, gCoord startangle, gCoord endangle);
#endif
#if GDISP_NEED_ARCSECTORS || defined(__DOXYGEN__)
@@ -830,7 +830,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors);
+ void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors);
/*
* @brief Draw a filled selection of 45 degree arcs of a circle in the window.
@@ -853,7 +853,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors);
+ void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors);
#endif
/*-------------------------------------------------
@@ -871,7 +871,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- color_t gwinGetPixelColor(GHandle gh, coord_t x, coord_t y);
+ color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y);
#endif
/*-------------------------------------------------
@@ -891,7 +891,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawChar(GHandle gh, coord_t x, coord_t y, char c);
+ void gwinDrawChar(GHandle gh, gCoord x, gCoord y, char c);
/**
* @brief Draw a text character with a filled background at the specified position in the window.
@@ -905,7 +905,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c);
+ void gwinFillChar(GHandle gh, gCoord x, gCoord y, char c);
/**
* @brief Draw a text string in the window
@@ -919,7 +919,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str);
+ void gwinDrawString(GHandle gh, gCoord x, gCoord y, const char *str);
/**
* @brief Draw a text string with a filled background in the window
@@ -933,7 +933,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str);
+ void gwinFillString(GHandle gh, gCoord x, gCoord y, const char *str);
/**
* @brief Draw a text string verticly centered within the specified box.
@@ -950,7 +950,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify);
+ void gwinDrawStringBox(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, justify_t justify);
/**
* @brief Draw a text string verticly centered within the specified filled box.
@@ -967,7 +967,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify);
+ void gwinFillStringBox(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, justify_t justify);
#endif
/*-------------------------------------------------
@@ -987,7 +987,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawPoly(GHandle gh, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt);
+ void gwinDrawPoly(GHandle gh, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt);
/**
* @brief Fill a convex polygon
@@ -1010,7 +1010,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const gPoint *pntarray, unsigned cnt);
+ void gwinFillConvexPoly(GHandle gh, gCoord tx, gCoord ty, const gPoint *pntarray, unsigned cnt);
/**
* @brief Draw a thick line in the window
@@ -1027,7 +1027,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- void gwinDrawThickLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1, coord_t width, gBool round);
+ void gwinDrawThickLine(GHandle gh, gCoord x0, gCoord y0, gCoord x1, gCoord y1, gCoord width, gBool round);
#endif
/*-------------------------------------------------
@@ -1056,7 +1056,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
*
* @api
*/
- gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
+ gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy);
#endif
/*-------------------------------------------------
diff --git a/src/gwin/gwin_button.c b/src/gwin/gwin_button.c
index 2c4b598e..2e637140 100644
--- a/src/gwin/gwin_button.c
+++ b/src/gwin/gwin_button.c
@@ -25,14 +25,14 @@
#if GINPUT_NEED_MOUSE
// A mouse down has occurred over the button
- static void ButtonMouseDown(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void ButtonMouseDown(GWidgetObject *gw, gCoord x, gCoord y) {
(void) x; (void) y;
gw->g.flags |= GBUTTON_FLG_PRESSED;
_gwinUpdate((GHandle)gw);
}
// A mouse up has occurred (it may or may not be over the button)
- static void ButtonMouseUp(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void ButtonMouseUp(GWidgetObject *gw, gCoord x, gCoord y) {
(void) x; (void) y;
gw->g.flags &= ~GBUTTON_FLG_PRESSED;
_gwinUpdate((GHandle)gw);
@@ -183,7 +183,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
const GColorSet * pcol;
fixed alpha;
fixed dalpha;
- coord_t i;
+ gCoord i;
color_t tcol, bcol;
(void) param;
@@ -453,7 +453,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
#if GDISP_NEED_IMAGE || defined(__DOXYGEN__)
void gwinButtonDraw_Image(GWidgetObject *gw, void *param) {
const GColorSet * pcol;
- coord_t sy;
+ gCoord sy;
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
pcol = getButtonColors(gw);
diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c
index 21d2ba86..42734626 100644
--- a/src/gwin/gwin_checkbox.c
+++ b/src/gwin/gwin_checkbox.c
@@ -44,7 +44,7 @@ static void SendCheckboxEvent(GWidgetObject *gw) {
}
#if GINPUT_NEED_MOUSE
- static void CheckboxMouseDown(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void CheckboxMouseDown(GWidgetObject *gw, gCoord x, gCoord y) {
(void) x; (void) y;
gw->g.flags ^= GCHECKBOX_FLG_CHECKED;
_gwinUpdate((GHandle)gw);
@@ -173,7 +173,7 @@ static const GColorSet *getCheckboxColors(GWidgetObject *gw) {
void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
#define gcw ((GCheckboxObject *)gw)
- coord_t ld, df;
+ gCoord ld, df;
const GColorSet * pcol;
(void) param;
@@ -202,7 +202,7 @@ void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
#define gcw ((GCheckboxObject *)gw)
- coord_t ep, ld, df;
+ gCoord ep, ld, df;
const GColorSet * pcol;
(void) param;
@@ -254,7 +254,7 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
const GColorSet * pcol;
fixed alpha;
fixed dalpha;
- coord_t i;
+ gCoord i;
color_t tcol, bcol;
(void) param;
diff --git a/src/gwin/gwin_class.h b/src/gwin/gwin_class.h
index c161c0f6..a38f0378 100644
--- a/src/gwin/gwin_class.h
+++ b/src/gwin/gwin_class.h
@@ -87,9 +87,9 @@ typedef struct gwinVMT {
void (*DefaultDraw) (GWidgetObject *gw, void *param); /**< The default drawing routine (mandatory) */
#if GINPUT_NEED_MOUSE
struct {
- void (*MouseDown) (GWidgetObject *gw, coord_t x, coord_t y); /**< Process mouse down events (optional) */
- void (*MouseUp) (GWidgetObject *gw, coord_t x, coord_t y); /**< Process mouse up events (optional) */
- void (*MouseMove) (GWidgetObject *gw, coord_t x, coord_t y); /**< Process mouse move events (optional) */
+ void (*MouseDown) (GWidgetObject *gw, gCoord x, gCoord y); /**< Process mouse down events (optional) */
+ void (*MouseUp) (GWidgetObject *gw, gCoord x, gCoord y); /**< Process mouse up events (optional) */
+ void (*MouseMove) (GWidgetObject *gw, gCoord x, gCoord y); /**< Process mouse move events (optional) */
};
#endif
#if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD
@@ -131,10 +131,10 @@ typedef struct gwinVMT {
*/
typedef struct gcontainerVMT {
gwidgetVMT gw;
- coord_t (*LeftBorder) (GHandle gh); /**< The size of the left border (mandatory) */
- coord_t (*TopBorder) (GHandle gh); /**< The size of the top border (mandatory) */
- coord_t (*RightBorder) (GHandle gh); /**< The size of the right border (mandatory) */
- coord_t (*BottomBorder) (GHandle gh); /**< The size of the bottom border (mandatory) */
+ gCoord (*LeftBorder) (GHandle gh); /**< The size of the left border (mandatory) */
+ gCoord (*TopBorder) (GHandle gh); /**< The size of the top border (mandatory) */
+ gCoord (*RightBorder) (GHandle gh); /**< The size of the right border (mandatory) */
+ gCoord (*BottomBorder) (GHandle gh); /**< The size of the bottom border (mandatory) */
void (*NotifyAdd) (GHandle gh, GHandle ghChild); /**< Notification that a child has been added (optional) */
void (*NotifyDelete) (GHandle gh, GHandle ghChild); /**< Notification that a child has been deleted (optional) */
} gcontainerVMT;
@@ -157,8 +157,8 @@ typedef struct gwinVMT {
gBool (*Add) (GHandle gh, const GWindowInit *pInit); /**< A window has been added */
void (*Delete) (GHandle gh); /**< A window has been deleted */
void (*Redraw) (GHandle gh); /**< A window needs to be redraw (or undrawn) */
- void (*Size) (GHandle gh, coord_t w, coord_t h); /**< A window wants to be resized */
- void (*Move) (GHandle gh, coord_t x, coord_t y); /**< A window wants to be moved */
+ void (*Size) (GHandle gh, gCoord w, gCoord h); /**< A window wants to be resized */
+ void (*Move) (GHandle gh, gCoord x, gCoord y); /**< A window wants to be moved */
void (*Raise) (GHandle gh); /**< A window wants to be on top */
void (*MinMax) (GHandle gh, GWindowMinMax minmax); /**< A window wants to be minimized/maximised */
} gwmVMT;
@@ -353,7 +353,7 @@ gBool _gwinWMAdd(GHandle gh, const GWindowInit *pInit);
*
* @notapi
*/
- void _gwidgetDrawFocusRect(GWidgetObject *gw, coord_t x, coord_t y, coord_t cx, coord_t cy);
+ void _gwidgetDrawFocusRect(GWidgetObject *gw, gCoord x, gCoord y, gCoord cx, gCoord cy);
/**
* @brief Draw a simple focus circle in the default style.
@@ -368,7 +368,7 @@ gBool _gwinWMAdd(GHandle gh, const GWindowInit *pInit);
* @notapi
*/
#if GDISP_NEED_CIRCLE
- void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius);
+ void _gwidgetDrawFocusCircle(GWidgetObject *gx, gCoord radius);
#endif
#else
diff --git a/src/gwin/gwin_console.c b/src/gwin/gwin_console.c
index 7bd0780e..d2b55f5d 100644
--- a/src/gwin/gwin_console.c
+++ b/src/gwin/gwin_console.c
@@ -193,7 +193,7 @@
static void HistoryRedraw(GWindowObject *gh) {
#define gcw ((GConsoleObject *)gh)
- coord_t fy;
+ gCoord fy;
// No redrawing if there is no history
if (!gcw->buffer)
@@ -229,7 +229,7 @@
#if GWIN_CONSOLE_USE_CLEAR_LINES
// Clear the remaining space
{
- coord_t y;
+ gCoord y;
y = gcw->cy;
if (gcw->cx)
@@ -563,7 +563,7 @@ void gwinPutChar(GHandle gh, char c) {
// Set the cursor to the start of the last line
gcw->cx = 0;
- gcw->cy = (((coord_t)(gh->height/fy))-1)*fy;
+ gcw->cy = (((gCoord)(gh->height/fy))-1)*fy;
}
#else
{
diff --git a/src/gwin/gwin_console.h b/src/gwin/gwin_console.h
index 208ab16b..922a20a9 100644
--- a/src/gwin/gwin_console.h
+++ b/src/gwin/gwin_console.h
@@ -31,7 +31,7 @@
// A console window. Supports wrapped text writing and a cursor.
typedef struct GConsoleObject {
GWindowObject g;
- coord_t cx, cy; // Cursor position
+ gCoord cx, cy; // Cursor position
#if GWIN_CONSOLE_ESCSEQ
uint8_t startattr; // ANSI-like escape sequences
diff --git a/src/gwin/gwin_container.c b/src/gwin/gwin_container.c
index f680f6fb..9b1bd3c4 100644
--- a/src/gwin/gwin_container.c
+++ b/src/gwin/gwin_container.c
@@ -59,13 +59,13 @@ GHandle gwinGetSibling(GHandle gh) {
return 0;
}
-coord_t gwinGetInnerWidth(GHandle gh) {
+gCoord gwinGetInnerWidth(GHandle gh) {
if (!(gh->flags & GWIN_FLG_CONTAINER))
return 0;
return gh->width - ((const gcontainerVMT *)gh->vmt)->LeftBorder(gh) - ((const gcontainerVMT *)gh->vmt)->RightBorder(gh);
}
-coord_t gwinGetInnerHeight(GHandle gh) {
+gCoord gwinGetInnerHeight(GHandle gh) {
if (!(gh->flags & GWIN_FLG_CONTAINER))
return 0;
return gh->height - ((const gcontainerVMT *)gh->vmt)->TopBorder(gh) - ((const gcontainerVMT *)gh->vmt)->BottomBorder(gh);
@@ -92,7 +92,7 @@ coord_t gwinGetInnerHeight(GHandle gh) {
#define BORDER_WIDTH 2
-static coord_t ContainerBorderSize(GHandle gh) { return (gh->flags & GWIN_CONTAINER_BORDER) ? BORDER_WIDTH : 0; }
+static gCoord ContainerBorderSize(GHandle gh) { return (gh->flags & GWIN_CONTAINER_BORDER) ? BORDER_WIDTH : 0; }
// The container VMT table
static const gcontainerVMT containerVMT = {
@@ -169,7 +169,7 @@ void gwinContainerDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE
void gwinContainerDraw_Image(GWidgetObject *gw, void *param) {
#define gi ((gdispImage *)param)
- coord_t x, y, iw, ih, mx, my;
+ gCoord x, y, iw, ih, mx, my;
if (gw->g.vmt != (gwinVMT *)&containerVMT)
return;
diff --git a/src/gwin/gwin_container.h b/src/gwin/gwin_container.h
index a4a3afa2..cdb4b818 100644
--- a/src/gwin/gwin_container.h
+++ b/src/gwin/gwin_container.h
@@ -81,7 +81,7 @@ GHandle gwinGetSibling(GHandle gh);
*
* @api
*/
-coord_t gwinGetInnerWidth(GHandle gh);
+gCoord gwinGetInnerWidth(GHandle gh);
/**
* @brief Get the inner height of a container window
@@ -92,7 +92,7 @@ coord_t gwinGetInnerWidth(GHandle gh);
*
* @api
*/
-coord_t gwinGetInnerHeight(GHandle gh);
+gCoord gwinGetInnerHeight(GHandle gh);
/**
diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c
index 9aed4c06..c79e813d 100644
--- a/src/gwin/gwin_frame.c
+++ b/src/gwin/gwin_frame.c
@@ -37,10 +37,10 @@
#error "GWIN Frame: - Flag definitions don't match"
#endif
-static coord_t FrameBorderSizeL(GHandle gh) { (void)gh; return FRM_BORDER_L; }
-static coord_t FrameBorderSizeR(GHandle gh) { (void)gh; return FRM_BORDER_R; }
-static coord_t FrameBorderSizeT(GHandle gh) { (void)gh; return FRM_BORDER_T; }
-static coord_t FrameBorderSizeB(GHandle gh) { (void)gh; return FRM_BORDER_B; }
+static gCoord FrameBorderSizeL(GHandle gh) { (void)gh; return FRM_BORDER_L; }
+static gCoord FrameBorderSizeR(GHandle gh) { (void)gh; return FRM_BORDER_R; }
+static gCoord FrameBorderSizeT(GHandle gh) { (void)gh; return FRM_BORDER_T; }
+static gCoord FrameBorderSizeB(GHandle gh) { (void)gh; return FRM_BORDER_B; }
static void forceFrameRedraw(GWidgetObject *gw) {
// Force a redraw of just the frame.
@@ -51,8 +51,8 @@ static void forceFrameRedraw(GWidgetObject *gw) {
}
#if GINPUT_NEED_MOUSE
- static void FrameMouseDown(GWidgetObject *gw, coord_t x, coord_t y) {
- coord_t pos;
+ static void FrameMouseDown(GWidgetObject *gw, gCoord x, gCoord y) {
+ gCoord pos;
// We must be clicking on the frame button area to be of interest
if (y < FRM_BUTTON_T || y >= FRM_BUTTON_T+FRM_BUTTON_Y)
@@ -86,7 +86,7 @@ static void forceFrameRedraw(GWidgetObject *gw) {
}
}
- static void FrameMouseUp(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void FrameMouseUp(GWidgetObject *gw, gCoord x, gCoord y) {
#if GWIN_BUTTON_LAZY_RELEASE
if ((gw->g.flags & GWIN_FRAME_CLOSE_PRESSED)) {
// Close is released - destroy the window
@@ -118,7 +118,7 @@ static void forceFrameRedraw(GWidgetObject *gw) {
// We must be releasing over the button
if (y >= FRM_BUTTON_T && y < FRM_BUTTON_T+FRM_BUTTON_Y) {
- coord_t pos;
+ gCoord pos;
pos = gw->g.width - (FRM_BORDER_R+FRM_BUTTON_X);
if ((gw->g.flags & GWIN_FRAME_CLOSE_BTN)) {
@@ -229,7 +229,7 @@ GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint
void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
const GColorSet *pcol;
- coord_t pos;
+ gCoord pos;
color_t contrast;
color_t btn;
(void)param;
@@ -295,7 +295,7 @@ void gwinFrameDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE
void gwinFrameDraw_Image(GWidgetObject *gw, void *param) {
#define gi ((gdispImage *)param)
- coord_t x, y, iw, ih, mx, my;
+ gCoord x, y, iw, ih, mx, my;
if (gw->g.vmt != (gwinVMT *)&frameVMT)
return;
diff --git a/src/gwin/gwin_graph.c b/src/gwin/gwin_graph.c
index 217f1755..6c7a6932 100644
--- a/src/gwin/gwin_graph.c
+++ b/src/gwin/gwin_graph.c
@@ -37,7 +37,7 @@ static const gwinVMT graphVMT = {
0, // The after-clear routine
};
-static void pointto(GGraphObject *gg, coord_t x, coord_t y, const GGraphPointStyle *style) {
+static void pointto(GGraphObject *gg, gCoord x, gCoord y, const GGraphPointStyle *style) {
if (style->type == GGRAPH_POINT_NONE)
return;
@@ -66,11 +66,11 @@ static void pointto(GGraphObject *gg, coord_t x, coord_t y, const GGraphPointSty
}
}
-static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t y1, const GGraphLineStyle *style) {
- coord_t dy, dx;
- coord_t addx, addy;
- coord_t P, diff, i;
- coord_t run_on, run_off, run;
+static void lineto(GGraphObject *gg, gCoord x0, gCoord y0, gCoord x1, gCoord y1, const GGraphLineStyle *style) {
+ gCoord dy, dx;
+ gCoord addx, addy;
+ gCoord P, diff, i;
+ gCoord run_on, run_off, run;
if (style->type == GGRAPH_LINE_NONE)
return;
@@ -193,7 +193,7 @@ void gwinGraphSetStyle(GHandle gh, const GGraphStyle *pstyle) {
#undef gg
}
-void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y) {
+void gwinGraphSetOrigin(GHandle gh, gCoord x, gCoord y) {
#define gg ((GGraphObject *)gh)
if (gh->vmt != &graphVMT)
@@ -207,7 +207,7 @@ void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y) {
void gwinGraphDrawAxis(GHandle gh) {
#define gg ((GGraphObject *)gh)
- coord_t i, xmin, ymin, xmax, ymax;
+ gCoord i, xmin, ymin, xmax, ymax;
if (gh->vmt != &graphVMT || !_gwinDrawStart(gh))
return;
@@ -274,7 +274,7 @@ void gwinGraphStartSet(GHandle gh) {
gh->flags &= ~GGRAPH_FLG_CONNECTPOINTS;
}
-void gwinGraphDrawPoint(GHandle gh, coord_t x, coord_t y) {
+void gwinGraphDrawPoint(GHandle gh, gCoord x, gCoord y) {
#define gg ((GGraphObject *)gh)
if (gh->vmt != &graphVMT || !_gwinDrawStart(gh))
diff --git a/src/gwin/gwin_graph.h b/src/gwin/gwin_graph.h
index d13fd1c5..eaaa82ab 100644
--- a/src/gwin/gwin_graph.h
+++ b/src/gwin/gwin_graph.h
@@ -33,7 +33,7 @@ typedef enum GGraphPointType_e {
typedef struct GGraphPointStyle_t {
GGraphPointType type;
- coord_t size;
+ gCoord size;
color_t color;
} GGraphPointStyle;
@@ -43,15 +43,15 @@ typedef enum GGraphLineType_e {
typedef struct GGraphLineStyle_t {
GGraphLineType type;
- coord_t size;
+ gCoord size;
color_t color;
} GGraphLineStyle;
typedef struct GGraphGridStyle_t {
GGraphLineType type;
- coord_t size;
+ gCoord size;
color_t color;
- coord_t spacing;
+ gCoord spacing;
} GGraphGridStyle;
typedef struct GGraphStyle_t {
@@ -77,8 +77,8 @@ typedef struct GGraphStyle_t {
typedef struct GGraphObject {
GWindowObject g;
GGraphStyle style;
- coord_t xorigin, yorigin;
- coord_t lastx, lasty;
+ gCoord xorigin, yorigin;
+ gCoord lastx, lasty;
} GGraphObject;
/*===========================================================================*/
@@ -130,7 +130,7 @@ void gwinGraphSetStyle(GHandle gh, const GGraphStyle *pstyle);
*
* @api
*/
-void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y);
+void gwinGraphSetOrigin(GHandle gh, gCoord x, gCoord y);
/**
* @brief Draw the axis and the background grid.
@@ -161,7 +161,7 @@ void gwinGraphStartSet(GHandle gh);
*
* @api
*/
-void gwinGraphDrawPoint(GHandle gh, coord_t x, coord_t y);
+void gwinGraphDrawPoint(GHandle gh, gCoord x, gCoord y);
/**
* @brief Draw multiple graph points.
diff --git a/src/gwin/gwin_image.c b/src/gwin/gwin_image.c
index a4cc5028..73db206e 100644
--- a/src/gwin/gwin_image.c
+++ b/src/gwin/gwin_image.c
@@ -34,7 +34,7 @@ static void ImageDestroy(GWindowObject *gh) {
#endif
static void ImageRedraw(GHandle gh) {
- coord_t x, y, w, h, dx, dy;
+ gCoord x, y, w, h, dx, dy;
color_t bg;
#if GWIN_NEED_IMAGE_ANIMATION
delaytime_t delay;
diff --git a/src/gwin/gwin_keyboard.c b/src/gwin/gwin_keyboard.c
index b8a54e8e..f75c2bee 100644
--- a/src/gwin/gwin_keyboard.c
+++ b/src/gwin/gwin_keyboard.c
@@ -174,7 +174,7 @@ static void SendVirtualKeyEvent(GKeyboardObject *gk) {
#if GINPUT_NEED_MOUSE
// Find the key from the keyset and the x, y position
- static void KeyFindKey(GKeyboardObject *gk, coord_t x, coord_t y) {
+ static void KeyFindKey(GKeyboardObject *gk, gCoord x, gCoord y) {
const utf8 *krow;
fixed f;
int idx;
@@ -210,7 +210,7 @@ static void SendVirtualKeyEvent(GKeyboardObject *gk) {
}
// A mouse up has occurred (it may or may not be over the button)
- static void KeyMouseUp(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void KeyMouseUp(GWidgetObject *gw, gCoord x, gCoord y) {
#define gk ((GKeyboardObject *)gw)
KeyFindKey(gk, x, y);
@@ -281,7 +281,7 @@ static void SendVirtualKeyEvent(GKeyboardObject *gk) {
}
// A mouse move has occurred (it may or may not be over the button)
- static void KeyMouseMove(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void KeyMouseMove(GWidgetObject *gw, gCoord x, gCoord y) {
#define gk ((GKeyboardObject *)gw)
KeyFindKey(gk, x, y);
@@ -392,7 +392,7 @@ void gwinKeyboardDraw_Normal(GWidgetObject *gw, void *param) {
char cap[5];
const char *pcap;
const utf8 *krow;
- coord_t x, y, cx, cy;
+ gCoord x, y, cx, cy;
uint8_t rows, cols, row, col, kcols;
ucode key;
fixed fx, fy;
diff --git a/src/gwin/gwin_keyboard.h b/src/gwin/gwin_keyboard.h
index 0f4185ab..d048453f 100644
--- a/src/gwin/gwin_keyboard.h
+++ b/src/gwin/gwin_keyboard.h
@@ -57,8 +57,8 @@ typedef struct GKeyboardObject {
GWidgetObject w;
const struct GVKeyTable *keytable;
const char **keyset;
- coord_t keyx, keyy;
- coord_t keycx, keycy;
+ gCoord keyx, keyy;
+ gCoord keycx, keycy;
uint8_t lastkeyrow, lastkeycol;
uint8_t keyrow, keycol;
uint32_t key;
diff --git a/src/gwin/gwin_label.c b/src/gwin/gwin_label.c
index b522768a..d8ca1512 100644
--- a/src/gwin/gwin_label.c
+++ b/src/gwin/gwin_label.c
@@ -21,14 +21,14 @@
#define gw2obj ((GLabelObject *)gw)
// simple: single line with no wrapping
-static coord_t getwidth(const char *text, font_t font, coord_t maxwidth) {
+static gCoord getwidth(const char *text, font_t font, gCoord maxwidth) {
(void) maxwidth;
return gdispGetStringWidth(text, font)+2; // Allow one pixel of padding on each side
}
// simple: single line with no wrapping
-static coord_t getheight(const char *text, font_t font, coord_t maxwidth) {
+static gCoord getheight(const char *text, font_t font, gCoord maxwidth) {
(void) text;
(void) maxwidth;
@@ -117,7 +117,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border) {
}
#if GWIN_LABEL_ATTRIBUTE
- void gwinLabelSetAttribute(GHandle gh, coord_t tab, const char* attr) {
+ void gwinLabelSetAttribute(GHandle gh, gCoord tab, const char* attr) {
// is it a valid handle?
if (gh->vmt != (gwinVMT *)&labelVMT)
return;
@@ -130,7 +130,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border) {
#endif // GWIN_LABEL_ATTRIBUTE
static void gwinLabelDraw(GWidgetObject *gw, justify_t justify) {
- coord_t w, h;
+ gCoord w, h;
color_t c;
// is it a valid handle?
diff --git a/src/gwin/gwin_label.h b/src/gwin/gwin_label.h
index 77bf5364..281fb408 100644
--- a/src/gwin/gwin_label.h
+++ b/src/gwin/gwin_label.h
@@ -48,7 +48,7 @@ typedef struct GLabelObject {
GWidgetObject w;
#if GWIN_LABEL_ATTRIBUTE
- coord_t tab;
+ gCoord tab;
const char* attr;
#endif
} GLabelObject;
@@ -102,7 +102,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border);
*
* @api
*/
- void gwinLabelSetAttribute(GHandle gh, coord_t tab, const char* attr);
+ void gwinLabelSetAttribute(GHandle gh, gCoord tab, const char* attr);
#endif
/**
diff --git a/src/gwin/gwin_list.c b/src/gwin/gwin_list.c
index 8b161238..49caefe1 100644
--- a/src/gwin/gwin_list.c
+++ b/src/gwin/gwin_list.c
@@ -54,10 +54,10 @@ static void sendListEvent(GWidgetObject *gw, int item) {
}
#if GINPUT_NEED_MOUSE
- static void ListMouseSelect(GWidgetObject* gw, coord_t x, coord_t y) {
+ static void ListMouseSelect(GWidgetObject* gw, gCoord x, gCoord y) {
const gfxQueueASyncItem* qi;
int item, i;
- coord_t iheight;
+ gCoord iheight;
(void) x;
iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD;
@@ -88,8 +88,8 @@ static void sendListEvent(GWidgetObject *gw, int item) {
}
// a mouse down has occurred over the list area
- static void ListMouseDown(GWidgetObject* gw, coord_t x, coord_t y) {
- coord_t iheight, pgsz;
+ static void ListMouseDown(GWidgetObject* gw, gCoord x, gCoord y) {
+ gCoord iheight, pgsz;
// Save our mouse start position
gw2obj->start_mouse_x = x;
@@ -143,7 +143,7 @@ static void sendListEvent(GWidgetObject *gw, int item) {
ListMouseSelect(gw, x, y);
}
- static void ListMouseUp(GWidgetObject* gw, coord_t x, coord_t y) {
+ static void ListMouseUp(GWidgetObject* gw, gCoord x, gCoord y) {
// Only act when we are a smooth scrolling list
if (!(gw->g.flags & GLIST_FLG_SCROLLSMOOTH))
return;
@@ -155,7 +155,7 @@ static void sendListEvent(GWidgetObject *gw, int item) {
ListMouseSelect(gw, x, y);
}
- static void ListMouseMove(GWidgetObject* gw, coord_t x, coord_t y) {
+ static void ListMouseMove(GWidgetObject* gw, gCoord x, gCoord y) {
int iheight, oldtop;
(void) x;
@@ -184,7 +184,7 @@ static void sendListEvent(GWidgetObject *gw, int item) {
const gfxQueueASyncItem * qix;
int i;
- coord_t iheight;
+ gCoord iheight;
iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD;
switch (role) {
@@ -653,7 +653,7 @@ void gwinListSetSelected(GHandle gh, int item, gBool doSelect) {
}
void gwinListViewItem(GHandle gh, int item) {
- coord_t iheight;
+ gCoord iheight;
// is it a valid handle?
if (gh->vmt != (gwinVMT *)&listVMT)
@@ -703,11 +703,11 @@ void gwinListViewItem(GHandle gh, int item) {
void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
const gfxQueueASyncItem* qi;
int i;
- coord_t x, y, iheight, iwidth;
+ gCoord x, y, iheight, iwidth;
color_t fill;
const GColorSet * ps;
#if GWIN_NEED_LIST_IMAGES
- coord_t sy;
+ gCoord sy;
#endif
#if GDISP_NEED_CONVEX_POLYGON
static const gPoint upArrow[] = { {0, LST_ARROW_SZ}, {LST_ARROW_SZ, LST_ARROW_SZ}, {LST_ARROW_SZ/2, 0} };
diff --git a/src/gwin/gwin_list.h b/src/gwin/gwin_list.h
index 9bd7075d..7c2cd1e7 100644
--- a/src/gwin/gwin_list.h
+++ b/src/gwin/gwin_list.h
@@ -52,9 +52,9 @@ typedef struct GListObject {
GWidgetObject w;
#if GINPUT_NEED_MOUSE
- coord_t start_mouse_x;
- coord_t start_mouse_y;
- coord_t last_mouse_y;
+ gCoord start_mouse_x;
+ gCoord start_mouse_y;
+ gCoord last_mouse_y;
#endif
#if GINPUT_NEED_TOGGLE
uint16_t t_up;
diff --git a/src/gwin/gwin_progressbar.c b/src/gwin/gwin_progressbar.c
index 23d1b4c7..ea3c6482 100644
--- a/src/gwin/gwin_progressbar.c
+++ b/src/gwin/gwin_progressbar.c
@@ -265,7 +265,7 @@ void gwinProgressbarDraw_Image(GWidgetObject *gw, void *param) {
#define gsw ((GProgressbarObject *)gw)
#define gi ((gdispImage *)param)
const GColorSet * pcol;
- coord_t z, v;
+ gCoord z, v;
if (gw->g.vmt != (gwinVMT *)&progressbarVMT)
return;
diff --git a/src/gwin/gwin_progressbar.h b/src/gwin/gwin_progressbar.h
index aa4deb2d..a5af2502 100644
--- a/src/gwin/gwin_progressbar.h
+++ b/src/gwin/gwin_progressbar.h
@@ -26,7 +26,7 @@
// A progressbar window
typedef struct GProgressbarObject {
GWidgetObject w;
- coord_t dpos;
+ gCoord dpos;
int min;
int max;
int res;
diff --git a/src/gwin/gwin_radio.c b/src/gwin/gwin_radio.c
index d3747762..53ca494b 100644
--- a/src/gwin/gwin_radio.c
+++ b/src/gwin/gwin_radio.c
@@ -46,7 +46,7 @@ static void SendRadioEvent(GWidgetObject *gw) {
#if GINPUT_NEED_MOUSE
// A mouse down has occurred over the button
- static void RadioMouseDown(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void RadioMouseDown(GWidgetObject *gw, gCoord x, gCoord y) {
(void) x; (void) y;
gwinRadioPress((GHandle)gw);
@@ -183,7 +183,7 @@ static const GColorSet *getDrawColors(GWidgetObject *gw) {
void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
#define gcw ((GRadioObject *)gw)
- coord_t ld, df;
+ gCoord ld, df;
const GColorSet * pcol;
(void) param;
@@ -263,7 +263,7 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
const GColorSet * pcol;
fixed alpha;
fixed dalpha;
- coord_t i;
+ gCoord i;
color_t tcol, bcol;
(void) param;
@@ -288,7 +288,7 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
const GColorSet * pcol;
fixed alpha;
fixed dalpha;
- coord_t i;
+ gCoord i;
color_t tcol, bcol;
(void) param;
diff --git a/src/gwin/gwin_slider.c b/src/gwin/gwin_slider.c
index d3316bc2..467ecfd3 100644
--- a/src/gwin/gwin_slider.c
+++ b/src/gwin/gwin_slider.c
@@ -92,7 +92,7 @@ static void SliderResetDisplayPos(GSliderObject *gsw) {
#if GINPUT_NEED_MOUSE
// Set the display position from the mouse position
- static void SetDisplayPosFromMouse(GSliderObject *gsw, coord_t x, coord_t y) {
+ static void SetDisplayPosFromMouse(GSliderObject *gsw, gCoord x, gCoord y) {
if (gsw->w.g.width < gsw->w.g.height)
gsw->dpos = y < 0 ? 0 : (y >= gsw->w.g.height ? gsw->w.g.height-1 : y);
else
@@ -100,7 +100,7 @@ static void SliderResetDisplayPos(GSliderObject *gsw) {
}
// A mouse up event
- static void SliderMouseUp(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void SliderMouseUp(GWidgetObject *gw, gCoord x, gCoord y) {
#define gsw ((GSliderObject *)gw)
#if !GWIN_BUTTON_LAZY_RELEASE
@@ -144,7 +144,7 @@ static void SliderResetDisplayPos(GSliderObject *gsw) {
}
// A mouse down event
- static void SliderMouseDown(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void SliderMouseDown(GWidgetObject *gw, gCoord x, gCoord y) {
#define gsw ((GSliderObject *)gw)
// Determine the display position
@@ -160,7 +160,7 @@ static void SliderResetDisplayPos(GSliderObject *gsw) {
}
// A mouse move event
- static void SliderMouseMove(GWidgetObject *gw, coord_t x, coord_t y) {
+ static void SliderMouseMove(GWidgetObject *gw, gCoord x, gCoord y) {
#define gsw ((GSliderObject *)gw)
// Determine the display position
@@ -391,7 +391,7 @@ void gwinSliderDraw_Image(GWidgetObject *gw, void *param) {
#define gsw ((GSliderObject *)gw)
#define gi ((gdispImage *)param)
const GColorSet * pcol;
- coord_t z, v;
+ gCoord z, v;
if (gw->g.vmt != (gwinVMT *)&sliderVMT)
return;
diff --git a/src/gwin/gwin_slider.h b/src/gwin/gwin_slider.h
index 588a39e8..fe884287 100644
--- a/src/gwin/gwin_slider.h
+++ b/src/gwin/gwin_slider.h
@@ -63,7 +63,7 @@ typedef struct GSliderObject {
#if GINPUT_NEED_DIAL
uint16_t dial;
#endif
- coord_t dpos;
+ gCoord dpos;
int min;
int max;
int pos;
diff --git a/src/gwin/gwin_tabset.c b/src/gwin/gwin_tabset.c
index 43718391..f3e07eea 100644
--- a/src/gwin/gwin_tabset.c
+++ b/src/gwin/gwin_tabset.c
@@ -45,7 +45,7 @@ static void FixTabSizePos(GHandle gh);
typedef GContainerObject GTabpageObject;
-static coord_t TabpageBorderSize(GHandle gh) { (void)gh; return 0; }
+static gCoord TabpageBorderSize(GHandle gh) { (void)gh; return 0; }
static void gwinTabpageDraw_Std(GWidgetObject *gw, void *param) {
(void)gw;
@@ -121,9 +121,9 @@ void gwinTabsetSetTitle(GHandle gh, const char *title, gBool useAlloc) {
* Tab-set stuff
*/
-static coord_t CalcTabHeight(GHandle gh) {
+static gCoord CalcTabHeight(GHandle gh) {
GHandle ph;
- coord_t x, y, w;
+ gCoord x, y, w;
x = w = 0;
y = GWIN_TABSET_TABHEIGHT;
@@ -141,7 +141,7 @@ static coord_t CalcTabHeight(GHandle gh) {
}
static void FixTabSizePos(GHandle gh) {
- coord_t w, h, oldth;
+ gCoord w, h, oldth;
GHandle vis, ph;
oldth = ((GTabsetObject *)gh)->border_top;
@@ -169,11 +169,11 @@ static void FixTabSizePos(GHandle gh) {
}
}
-static coord_t TabSetBorderSize(GHandle gh) { return (gh->flags & GWIN_TABSET_BORDER) ? GTABSET_BORDER : 0; }
-static coord_t TabSetBorderTop(GHandle gh) { return ((GTabsetObject *)gh)->border_top; }
+static gCoord TabSetBorderSize(GHandle gh) { return (gh->flags & GWIN_TABSET_BORDER) ? GTABSET_BORDER : 0; }
+static gCoord TabSetBorderTop(GHandle gh) { return ((GTabsetObject *)gh)->border_top; }
#if GINPUT_NEED_MOUSE
- static void mouseDown(GWidgetObject *gw, coord_t mx, coord_t my) {
+ static void mouseDown(GWidgetObject *gw, gCoord mx, gCoord my) {
GHandle ph, gh;
int cnt;
@@ -182,7 +182,7 @@ static coord_t TabSetBorderTop(GHandle gh) { return ((GTabsetObject *)gh)->bord
// Work out which tab was pressed
{
- coord_t x, w, y;
+ gCoord x, w, y;
cnt = 0;
x = w = 0;
@@ -395,7 +395,7 @@ void gwinTabsetSetTab(GHandle gh) {
///////////////////////////////////////////////////////////////////////////////////////////////////
#if GWIN_FLAT_STYLING
- static void fgarea(GWidgetObjset *gw, const char *text, coord_t y, coord_t x, coord_t w) {
+ static void fgarea(GWidgetObjset *gw, const char *text, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->pressed : &gw->pstyle->disabled;
@@ -403,7 +403,7 @@ void gwinTabsetSetTab(GHandle gh) {
gdispGDrawBox(gw->g.display, gw->g.x+x, gw->g.y+y, w, GWIN_TABSET_TABHEIGHT, pcol->edge);
gdispGFillStringBox(gw->g.display, gw->g.x+x+1, gw->g.y+y+1, w-2, GWIN_TABSET_TABHEIGHT-1, text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
}
- static void bgarea(GWidgetObjset *gw, const char *text, coord_t y, coord_t x, coord_t w) {
+ static void bgarea(GWidgetObjset *gw, const char *text, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled;
@@ -412,7 +412,7 @@ void gwinTabsetSetTab(GHandle gh) {
gdispGDrawLine(gw->g.display, gw->g.x+x+w-1, gw->g.y+y, gw->g.x+x+w-1, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, pcol->edge);
gdispGDrawLine(gw->g.display, gw->g.x+x, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, gw->g.x+x+w-2, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, pcol->edge);
}
- static void ntarea(GWidgetObjset *gw, coord_t y, coord_t x, coord_t w) {
+ static void ntarea(GWidgetObjset *gw, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->pressed : &gw->pstyle->disabled;
@@ -421,7 +421,7 @@ void gwinTabsetSetTab(GHandle gh) {
gdispGDrawLine(gw->g.display, gw->g.x+x, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, gw->g.x+x+w-1, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, pcol->edge);
}
#else
- static void fgarea(GWidgetObject *gw, const char *text, coord_t y, coord_t x, coord_t w) {
+ static void fgarea(GWidgetObject *gw, const char *text, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
color_t tcol;
@@ -435,10 +435,10 @@ void gwinTabsetSetTab(GHandle gh) {
if (!x)
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+y, gw->g.x, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, tcol);
}
- static void bgarea(GWidgetObject *gw, const char *text, coord_t y, coord_t x, coord_t w) {
+ static void bgarea(GWidgetObject *gw, const char *text, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
fixed alpha;
- coord_t i;
+ gCoord i;
color_t tcol, bcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled;
@@ -451,7 +451,7 @@ void gwinTabsetSetTab(GHandle gh) {
gdispGDrawLine(gw->g.display, gw->g.x+x+w-1, gw->g.y+y, gw->g.x+x+w-1, gw->g.y+y+GWIN_TABSET_TABHEIGHT-1, pcol->edge);
gdispGDrawStringBox(gw->g.display, gw->g.x+x+1, gw->g.y+y+1, w-2, GWIN_TABSET_TABHEIGHT-2, text, gw->g.font, pcol->text, justifyCenter);
}
- static void ntarea(GWidgetObject *gw, coord_t y, coord_t x, coord_t w) {
+ static void ntarea(GWidgetObject *gw, gCoord y, gCoord x, gCoord w) {
const GColorSet * pcol;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->pressed : &gw->pstyle->disabled;
@@ -461,9 +461,9 @@ void gwinTabsetSetTab(GHandle gh) {
}
#endif
-static coord_t drawtabs(GWidgetObject *gw) {
+static gCoord drawtabs(GWidgetObject *gw) {
GHandle ph;
- coord_t x, y, w;
+ gCoord x, y, w;
x = w = 0;
y = 0;
@@ -487,10 +487,10 @@ static coord_t drawtabs(GWidgetObject *gw) {
return y + GWIN_TABSET_TABHEIGHT;
}
-static void drawborder(GWidgetObject *gw, coord_t y) {
+static void drawborder(GWidgetObject *gw, gCoord y) {
if ((gw->g.flags & GWIN_CONTAINER_BORDER)) {
const GColorSet * pcol;
- coord_t x, w;
+ gCoord x, w;
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled;
x = gw->g.x+gw->g.width-1;
@@ -513,7 +513,7 @@ void gwinTabsetDraw_Transparent(GWidgetObject *gw, void *param) {
}
void gwinTabsetDraw_Std(GWidgetObject *gw, void *param) {
- coord_t y;
+ gCoord y;
(void) param;
if (gw->g.vmt != (gwinVMT *)&tabsetVMT)
@@ -533,7 +533,7 @@ void gwinTabsetDraw_Std(GWidgetObject *gw, void *param) {
#if GDISP_NEED_IMAGE
void gwinTabsetDraw_Image(GWidgetObject *gw, void *param) {
#define gi ((gdispImage *)param)
- coord_t x, y, iw, ih, mx, my;
+ gCoord x, y, iw, ih, mx, my;
if (gw->g.vmt != (gwinVMT *)&tabsetVMT)
return;
diff --git a/src/gwin/gwin_tabset.h b/src/gwin/gwin_tabset.h
index 8c07c7d2..0a2a1496 100644
--- a/src/gwin/gwin_tabset.h
+++ b/src/gwin/gwin_tabset.h
@@ -57,7 +57,7 @@ typedef struct GEventGWinTabset {
typedef struct GTabsetObject {
GContainerObject c;
- coord_t border_top;
+ gCoord border_top;
} GTabsetObject;
/**
diff --git a/src/gwin/gwin_textedit.c b/src/gwin/gwin_textedit.c
index 1cc168f1..098c91ca 100644
--- a/src/gwin/gwin_textedit.c
+++ b/src/gwin/gwin_textedit.c
@@ -87,7 +87,7 @@ static gBool TextEditAddChars(GHandle gh, unsigned cnt) {
// slow. An optimized version would copy the behavior of mf_get_string_width()
// and do the comparation directly inside of that loop so we only iterate
// the string once.
-static void TextEditMouseDown(GWidgetObject* gw, coord_t x, coord_t y) {
+static void TextEditMouseDown(GWidgetObject* gw, gCoord x, gCoord y) {
uint16_t i = 0;
(void)y;
@@ -269,7 +269,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit
void gwinTexteditDefaultDraw(GWidgetObject* gw, void* param)
{
const char* p;
- coord_t cpos, tpos;
+ gCoord cpos, tpos;
const GColorSet* pcol;
(void)param;
diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c
index d4865935..cc5bf1a1 100644
--- a/src/gwin/gwin_widget.c
+++ b/src/gwin/gwin_widget.c
@@ -317,8 +317,8 @@ static void gwidgetEvent(void *param, GEvent *pe) {
_widgetInFocus = 0;
}
- void _gwidgetDrawFocusRect(GWidgetObject *gx, coord_t x, coord_t y, coord_t cx, coord_t cy) {
- coord_t i;
+ void _gwidgetDrawFocusRect(GWidgetObject *gx, gCoord x, gCoord y, gCoord cx, gCoord cy) {
+ gCoord i;
// Don't do anything if we don't have the focus
if (&gx->g != _widgetInFocus)
@@ -331,8 +331,8 @@ static void gwidgetEvent(void *param, GEvent *pe) {
}
#if GDISP_NEED_CIRCLE
- void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius) {
- coord_t i;
+ void _gwidgetDrawFocusCircle(GWidgetObject *gx, gCoord radius) {
+ gCoord i;
// Don't do anything if we don't have the focus
if (&gx->g != _widgetInFocus)
diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c
index 6761180f..2c9f25d9 100644
--- a/src/gwin/gwin_wm.c
+++ b/src/gwin/gwin_wm.c
@@ -125,7 +125,7 @@
}
}
- void gwinMove(GHandle gh, coord_t x, coord_t y) {
+ void gwinMove(GHandle gh, gCoord x, gCoord y) {
gh->x = x; gh->y = y;
if (gh->x < 0) gh->x = 0;
if (gh->y < 0) gh->y = 0;
@@ -136,7 +136,7 @@
_gwinUpdate(gh);
}
- void gwinResize(GHandle gh, coord_t width, coord_t height) {
+ void gwinResize(GHandle gh, gCoord width, gCoord height) {
gh->width = width; gh->height = height;
if (gh->width < MIN_WIN_WIDTH) { gh->width = MIN_WIN_WIDTH; }
if (gh->height < MIN_WIN_HEIGHT) { gh->height = MIN_WIN_HEIGHT; }
@@ -553,11 +553,11 @@ void gwinRedraw(GHandle gh) {
}
#endif
-void gwinMove(GHandle gh, coord_t x, coord_t y) {
+void gwinMove(GHandle gh, gCoord x, gCoord y) {
_GWINwm->vmt->Move(gh, x, y);
}
-void gwinResize(GHandle gh, coord_t width, coord_t height) {
+void gwinResize(GHandle gh, gCoord width, gCoord height) {
_GWINwm->vmt->Size(gh, width, height);
}
@@ -691,8 +691,8 @@ static void WM_DeInit(void);
static gBool WM_Add(GHandle gh, const GWindowInit *pInit);
static void WM_Delete(GHandle gh);
static void WM_Redraw(GHandle gh);
-static void WM_Size(GHandle gh, coord_t w, coord_t h);
-static void WM_Move(GHandle gh, coord_t x, coord_t y);
+static void WM_Size(GHandle gh, gCoord w, gCoord h);
+static void WM_Move(GHandle gh, gCoord x, gCoord y);
static void WM_Raise(GHandle gh);
static void WM_MinMax(GHandle gh, GWindowMinMax minmax);
@@ -823,8 +823,8 @@ static void WM_Redraw(GHandle gh) {
}
}
-static void WM_Size(GHandle gh, coord_t w, coord_t h) {
- coord_t v;
+static void WM_Size(GHandle gh, gCoord w, gCoord h) {
+ gCoord v;
#if GWIN_NEED_CONTAINERS
if (gh->parent) {
@@ -896,8 +896,8 @@ static void WM_Size(GHandle gh, coord_t w, coord_t h) {
}
}
-static void WM_Move(GHandle gh, coord_t x, coord_t y) {
- coord_t u, v;
+static void WM_Move(GHandle gh, gCoord x, gCoord y) {
+ gCoord u, v;
#if GWIN_NEED_CONTAINERS
if (gh->parent) {