aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-07-08 10:54:19 +1000
committerinmarket <andrewh@inmarket.com.au>2018-07-08 10:54:19 +1000
commit2ab2d77fcba42467b62f2be732cb8dc00510fe19 (patch)
tree8dbd616faa116a2946ad47c62c20d4a34fb749b2 /src
parent7e95acb7310d83284288a6e89a6b3fe4bf4e8668 (diff)
downloaduGFX-2ab2d77fcba42467b62f2be732cb8dc00510fe19.tar.gz
uGFX-2ab2d77fcba42467b62f2be732cb8dc00510fe19.tar.bz2
uGFX-2ab2d77fcba42467b62f2be732cb8dc00510fe19.zip
Change coord_t to gCoord
Diffstat (limited to 'src')
-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
46 files changed, 381 insertions, 380 deletions
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) {