Change coord_t to gCoord
This commit is contained in:
parent
7e95acb731
commit
2ab2d77fcb
@ -3,8 +3,8 @@
|
||||
#include <gfx.h>
|
||||
|
||||
void setup() {
|
||||
coord_t width, height;
|
||||
coord_t i, j;
|
||||
gCoord width, height;
|
||||
gCoord i, j;
|
||||
|
||||
pinMode(13, OUTPUT);
|
||||
|
||||
|
@ -20,6 +20,7 @@ FEATURE: Added types gPtr and gPtrDiff
|
||||
FEATURE: Added gI64 and gU64 when the compiler supports it. GFX_TYPE_64 macro is defined as GFXON if it does.
|
||||
FEATURE: Fixed headers to ensure size_t, NULL are always defined. size_t is not used as it may be 64bit.
|
||||
CHANGE: Added type gPoint to replace V2.x point and point_t
|
||||
CHANGE: Added type gCoord to replace V2.x coord_t
|
||||
FIX: Added gfxRealloc() to Qt port
|
||||
FIX: Fixed UC1610 driver private area initialisation
|
||||
FIX: Fixed ST7735 driver and added kapacuk changes
|
||||
|
2
demos/3rdparty/notepad-2/notepadApp.c
vendored
2
demos/3rdparty/notepad-2/notepadApp.c
vendored
@ -48,7 +48,7 @@ static GHandle gstatusConsole; // GConsole Handle to the Status Bar
|
||||
static GEventMouse curPtr; // Holder for current pointer location
|
||||
|
||||
static font_t font;
|
||||
static coord_t swidth, sheight;
|
||||
static gCoord swidth, sheight;
|
||||
|
||||
// The toolbar buttons - Self-Explanatory
|
||||
static GButtonObject btnNew, btnOpen, btnSave;
|
||||
|
6
demos/3rdparty/notepad-2/notepadCore.c
vendored
6
demos/3rdparty/notepad-2/notepadCore.c
vendored
@ -55,7 +55,7 @@ static GHandle nStatusConsole = NULL;
|
||||
|
||||
static volatile gBool doExit;
|
||||
|
||||
static void draw_point(coord_t x, coord_t y) {
|
||||
static void draw_point(gCoord x, gCoord y) {
|
||||
color_t c = ncoreDrawingArea->color;
|
||||
|
||||
if (nMode == NCORE_MODE_DRAW)
|
||||
@ -71,7 +71,7 @@ static void draw_point(coord_t x, coord_t y) {
|
||||
|
||||
/* Bresenham's Line Drawing Algorithm
|
||||
Modified version to draw line of variable thickness */
|
||||
static void draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
|
||||
static void draw_line(gCoord x0, gCoord y0, gCoord x1, gCoord y1) {
|
||||
int16_t dy, dx;
|
||||
int16_t addx, addy;
|
||||
int16_t P, diff, i;
|
||||
@ -130,7 +130,7 @@ static void draw_line(coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
|
||||
static DECLARE_THREAD_FUNCTION(ncoreDrawThread, msg) {
|
||||
|
||||
GEventMouse ev, evPrev;
|
||||
coord_t dx, dy;
|
||||
gCoord dx, dy;
|
||||
|
||||
int state = 0, dist;
|
||||
|
||||
|
@ -63,9 +63,9 @@ static gfxThreadHandle thread;
|
||||
#define SHADOWALPHA (255-255*0.2)
|
||||
|
||||
static DECLARE_THREAD_FUNCTION(task, param) {
|
||||
coord_t width, height, x, y, radius, ballx, bally, dx, floor;
|
||||
coord_t minx, miny, maxx, maxy, winx, winy;
|
||||
coord_t ballcx, ballcy;
|
||||
gCoord width, height, x, y, radius, ballx, bally, dx, floor;
|
||||
gCoord minx, miny, maxx, maxy, winx, winy;
|
||||
gCoord ballcx, ballcy;
|
||||
color_t colour;
|
||||
float ii, spin, dy, spinspeed, h, f, g;
|
||||
(void) param;
|
||||
|
@ -115,14 +115,14 @@ static void nextline(GWidgetInit *pwi) {
|
||||
pwi->g.y += pwi->g.height+1;
|
||||
}
|
||||
|
||||
static void setbtntext(GWidgetInit *pwi, coord_t maxwidth, char *txt) {
|
||||
static void setbtntext(GWidgetInit *pwi, gCoord maxwidth, char *txt) {
|
||||
pwi->text = txt;
|
||||
pwi->g.width = gdispGetStringWidth(pwi->text, font) + BUTTON_PADDING;
|
||||
if (pwi->g.x + pwi->g.width > maxwidth)
|
||||
nextline(pwi);
|
||||
}
|
||||
|
||||
static void nextpos(GWidgetInit *pwi, coord_t maxwidth, coord_t nextwidth) {
|
||||
static void nextpos(GWidgetInit *pwi, gCoord maxwidth, gCoord nextwidth) {
|
||||
pwi->g.x += pwi->g.width+1;
|
||||
pwi->g.width = nextwidth;
|
||||
if (pwi->g.x + nextwidth > maxwidth)
|
||||
@ -138,7 +138,7 @@ static void nextpos(GWidgetInit *pwi, coord_t maxwidth, coord_t nextwidth) {
|
||||
*/
|
||||
static void createWidgets(void) {
|
||||
GWidgetInit wi;
|
||||
coord_t border, pagewidth;
|
||||
gCoord border, pagewidth;
|
||||
|
||||
gwinWidgetClearInit(&wi);
|
||||
|
||||
|
@ -88,7 +88,7 @@ static int uitoa(unsigned int value, char * buf, int max) {
|
||||
void benchmark(void) {
|
||||
uint32_t i, pixels, ms, pps;
|
||||
char pps_str[25];
|
||||
coord_t height, width, rx, ry, rcx, rcy;
|
||||
gCoord height, width, rx, ry, rcx, rcy;
|
||||
color_t random_color;
|
||||
font_t font;
|
||||
|
||||
|
@ -62,7 +62,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
|
||||
if (!(gs = (GScopeObject *)_gwindowCreate(g, &gs->g, pInit, &scopeVMT, 0)))
|
||||
return 0;
|
||||
gs->nextx = 0;
|
||||
if (!(gs->lastscopetrace = gfxAlloc(gs->g.width * sizeof(coord_t))))
|
||||
if (!(gs->lastscopetrace = gfxAlloc(gs->g.width * sizeof(gCoord))))
|
||||
return 0;
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
gs->lasty = gs->g.height/2;
|
||||
@ -82,10 +82,10 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
|
||||
void gwinScopeWaitForTrace(GHandle gh) {
|
||||
#define gs ((GScopeObject *)(gh))
|
||||
int i;
|
||||
coord_t x, y;
|
||||
coord_t yoffset;
|
||||
gCoord x, y;
|
||||
gCoord yoffset;
|
||||
adcsample_t *pa;
|
||||
coord_t *pc;
|
||||
gCoord *pc;
|
||||
GDataBuffer *pd;
|
||||
uint8_t shr;
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
@ -94,7 +94,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||
gBool rdytrigger;
|
||||
int flsamples;
|
||||
coord_t scopemin;
|
||||
gCoord scopemin;
|
||||
#endif
|
||||
|
||||
if (gh->vmt != &scopeVMT)
|
||||
@ -127,7 +127,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||
for(i = pd->len/sizeof(adcsample_t); i; i--) {
|
||||
|
||||
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
|
||||
y = yoffset - (((coord_t)(*pa++) << shr) >> (16-SCOPE_Y_BITS));
|
||||
y = yoffset - (((gCoord)(*pa++) << shr) >> (16-SCOPE_Y_BITS));
|
||||
|
||||
#if TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||
/* Calculate the scopemin ready for the next trace */
|
||||
|
@ -63,13 +63,13 @@
|
||||
typedef struct GScopeObject_t {
|
||||
GWindowObject g; // Base Class
|
||||
|
||||
coord_t *lastscopetrace; // To store last scope trace
|
||||
coord_t nextx; // Where we are up to
|
||||
gCoord *lastscopetrace; // To store last scope trace
|
||||
gCoord nextx; // Where we are up to
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
coord_t lasty; // The last y value - used for trigger slope detection
|
||||
gCoord lasty; // The last y value - used for trigger slope detection
|
||||
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||
coord_t lasty; // The last y value - used for trigger slope detection
|
||||
coord_t scopemin; // The last scopes minimum value
|
||||
gCoord lasty; // The last y value - used for trigger slope detection
|
||||
gCoord scopemin; // The last scopes minimum value
|
||||
#endif
|
||||
} GScopeObject;
|
||||
|
||||
|
@ -134,7 +134,7 @@ static GTimer lsTimer;
|
||||
*/
|
||||
int main(void) {
|
||||
GHandle ghScope;
|
||||
coord_t swidth, sheight;
|
||||
gCoord swidth, sheight;
|
||||
#if defined(MY_DIAL_DEVICE) || defined(MY_TEMP_DEVICE)
|
||||
GHandle ghText;
|
||||
font_t font;
|
||||
|
@ -76,7 +76,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
|
||||
/* Initialise the scope object members and allocate memory for buffers */
|
||||
gs->format = format;
|
||||
gs->nextx = 0;
|
||||
if (!(gs->lastscopetrace = (coord_t *)gfxAlloc(gs->g.width * sizeof(coord_t))))
|
||||
if (!(gs->lastscopetrace = (gCoord *)gfxAlloc(gs->g.width * sizeof(gCoord))))
|
||||
return 0;
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
gs->lasty = gs->g.height/2;
|
||||
@ -98,11 +98,11 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||
#define gs ((GScopeObject *)(gh))
|
||||
GDataBuffer *paud;
|
||||
int i;
|
||||
coord_t x, y;
|
||||
coord_t yoffset;
|
||||
gCoord x, y;
|
||||
gCoord yoffset;
|
||||
uint8_t *pa8;
|
||||
uint16_t *pa16;
|
||||
coord_t *pc;
|
||||
gCoord *pc;
|
||||
uint8_t shr;
|
||||
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
@ -111,7 +111,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||
gBool rdytrigger;
|
||||
int flsamples;
|
||||
coord_t scopemin;
|
||||
gCoord scopemin;
|
||||
#endif
|
||||
|
||||
if (gh->vmt != &scopeVMT)
|
||||
@ -148,9 +148,9 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||
|
||||
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
|
||||
if (gfxSampleFormatBits(gs->format) <= 8)
|
||||
y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
|
||||
y = yoffset - (((gCoord)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
|
||||
else
|
||||
y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
|
||||
y = yoffset - (((gCoord)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
|
||||
|
||||
#if TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||
/* Calculate the scopemin ready for the next trace */
|
||||
|
@ -63,14 +63,14 @@
|
||||
typedef struct GScopeObject_t {
|
||||
GWindowObject g; // Base Class
|
||||
|
||||
coord_t *lastscopetrace; // To store last scope trace
|
||||
gCoord *lastscopetrace; // To store last scope trace
|
||||
ArrayDataFormat format; // The sample format
|
||||
coord_t nextx; // Where we are up to
|
||||
gCoord nextx; // Where we are up to
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
coord_t lasty; // The last y value - used for trigger slope detection
|
||||
gCoord lasty; // The last y value - used for trigger slope detection
|
||||
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||
coord_t lasty; // The last y value - used for trigger slope detection
|
||||
coord_t scopemin; // The last scopes minimum value
|
||||
gCoord lasty; // The last y value - used for trigger slope detection
|
||||
gCoord scopemin; // The last scopes minimum value
|
||||
#endif
|
||||
} GScopeObject;
|
||||
|
||||
|
@ -51,7 +51,7 @@ static GScopeObject gScopeWindow;
|
||||
*/
|
||||
int main(void) {
|
||||
GHandle ghScope;
|
||||
coord_t swidth, sheight;
|
||||
gCoord swidth, sheight;
|
||||
|
||||
gfxInit();
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "gfx.h"
|
||||
|
||||
int main(void) {
|
||||
coord_t width, height, r1, r2, cx, cy;
|
||||
gCoord width, height, r1, r2, cx, cy;
|
||||
uint8_t sectors;
|
||||
|
||||
// Initialize and clear the display
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "gfx.h"
|
||||
|
||||
int main(void) {
|
||||
coord_t width, height;
|
||||
coord_t i, j;
|
||||
gCoord width, height;
|
||||
gCoord i, j;
|
||||
|
||||
// Initialize and clear the display
|
||||
gfxInit();
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "gfx.h"
|
||||
|
||||
int main(void) {
|
||||
coord_t width, height;
|
||||
gCoord width, height;
|
||||
|
||||
// Initialize and clear the display
|
||||
gfxInit();
|
||||
|
@ -30,9 +30,9 @@
|
||||
#include "gfx.h"
|
||||
|
||||
int main(void) {
|
||||
coord_t width, y;
|
||||
gCoord width, y;
|
||||
font_t font1, font2;
|
||||
coord_t fheight1, fheight2;
|
||||
gCoord fheight1, fheight2;
|
||||
const char *line1, *line2;
|
||||
char buf[8];
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
static gdispImage myImage;
|
||||
|
||||
int main(void) {
|
||||
coord_t swidth, sheight;
|
||||
gCoord swidth, sheight;
|
||||
|
||||
// Initialize uGFX and the underlying system
|
||||
gfxInit();
|
||||
|
@ -54,7 +54,7 @@ static gdispImage myImage;
|
||||
* Orange - Decoding a frame has produced an error.
|
||||
*/
|
||||
int main(void) {
|
||||
coord_t swidth, sheight, errx, erry, errcx, errcy;
|
||||
gCoord swidth, sheight, errx, erry, errcx, errcy;
|
||||
delaytime_t delay;
|
||||
|
||||
gfxInit(); // Initialize the display
|
||||
|
@ -45,8 +45,8 @@
|
||||
|
||||
#if USE_METHOD_1
|
||||
int main(void) {
|
||||
coord_t width, height;
|
||||
coord_t display, i, j, cnt;
|
||||
gCoord width, height;
|
||||
gCoord display, i, j, cnt;
|
||||
font_t f;
|
||||
GDisplay *g;
|
||||
char buf[16];
|
||||
@ -89,8 +89,8 @@
|
||||
}
|
||||
#else
|
||||
int main(void) {
|
||||
coord_t width, height;
|
||||
coord_t display, i, j, cnt;
|
||||
gCoord width, height;
|
||||
gCoord display, i, j, cnt;
|
||||
font_t f;
|
||||
char buf[16];
|
||||
|
||||
|
@ -36,8 +36,8 @@ static GDisplay* pixmap;
|
||||
static pixel_t* surface;
|
||||
|
||||
int main(void) {
|
||||
coord_t width, height;
|
||||
coord_t i, j;
|
||||
gCoord width, height;
|
||||
gCoord i, j;
|
||||
|
||||
// Initialize and clear the display
|
||||
gfxInit();
|
||||
|
@ -69,7 +69,7 @@ static gPoint oldresult[NUM_POINTS];
|
||||
|
||||
|
||||
int main(void) {
|
||||
coord_t width, height;
|
||||
gCoord width, height;
|
||||
mtype scalex, scaley;
|
||||
mtype scaleincx, scaleincy;
|
||||
mtype translatex, translatey;
|
||||
|
@ -57,9 +57,9 @@
|
||||
#define SHADOWALPHA (255-255*0.2)
|
||||
|
||||
int main(void) {
|
||||
coord_t width, height, x, y, radius, ballx, bally, dx, floor;
|
||||
coord_t minx, miny, maxx, maxy;
|
||||
coord_t ballcx, ballcy;
|
||||
gCoord width, height, x, y, radius, ballx, bally, dx, floor;
|
||||
gCoord minx, miny, maxx, maxy;
|
||||
gCoord ballcx, ballcy;
|
||||
color_t colour;
|
||||
float ii, spin, dy, spinspeed, h, f, g;
|
||||
|
||||
|
@ -64,8 +64,8 @@ static const transTable FrenchTranslation = { sizeof(FrenchStrings)/sizeof(Frenc
|
||||
|
||||
void updateText()
|
||||
{
|
||||
coord_t width = 400;
|
||||
coord_t height = 30;
|
||||
gCoord width = 400;
|
||||
gCoord height = 30;
|
||||
|
||||
// Translate some basic strings
|
||||
gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
|
||||
|
@ -33,7 +33,7 @@
|
||||
GHandle GW1, GW2;
|
||||
|
||||
int main(void) {
|
||||
coord_t i, j;
|
||||
gCoord i, j;
|
||||
|
||||
/* Initialize and clear the display */
|
||||
gfxInit();
|
||||
|
@ -171,7 +171,7 @@ static gdispImage imgYesNo;
|
||||
#endif
|
||||
|
||||
// Wrap buttons onto the next line if they don't fit.
|
||||
static void setbtntext(GWidgetInit *pwi, coord_t maxwidth, char *txt) {
|
||||
static void setbtntext(GWidgetInit *pwi, gCoord maxwidth, char *txt) {
|
||||
if (pwi->g.x >= maxwidth) {
|
||||
pwi->g.x = 5;
|
||||
pwi->g.y += pwi->g.height+1;
|
||||
@ -194,7 +194,7 @@ static void setbtntext(GWidgetInit *pwi, coord_t maxwidth, char *txt) {
|
||||
*/
|
||||
static void createWidgets(void) {
|
||||
GWidgetInit wi;
|
||||
coord_t border, pagewidth;
|
||||
gCoord border, pagewidth;
|
||||
|
||||
gwinWidgetClearInit(&wi);
|
||||
|
||||
|
@ -34,9 +34,9 @@
|
||||
|
||||
static GConsoleObject gc;
|
||||
static font_t font;
|
||||
static coord_t bHeight;
|
||||
static gCoord bHeight;
|
||||
static GHandle ghc;
|
||||
static coord_t swidth, sheight;
|
||||
static gCoord swidth, sheight;
|
||||
|
||||
#if !GWIN_CONSOLE_USE_FLOAT
|
||||
#error "You need to enable float support for the console widget. (GWIN_CONSOLE_USE_FLOAT)"
|
||||
|
@ -38,9 +38,9 @@
|
||||
static GConsoleObject gc;
|
||||
static GListener gl;
|
||||
static font_t font;
|
||||
static coord_t bWidth, bWidth2, bHeight;
|
||||
static gCoord bWidth, bWidth2, bHeight;
|
||||
static GHandle ghc;
|
||||
static coord_t swidth, sheight;
|
||||
static gCoord swidth, sheight;
|
||||
|
||||
static void DrawHeader(const char *title, gBool btnNext, gBool btnPrev, gBool btnPlusMinus) {
|
||||
#if GDISP_NEED_CLIP
|
||||
|
@ -38,9 +38,9 @@
|
||||
static GConsoleObject gc;
|
||||
static GListener gl;
|
||||
static font_t font;
|
||||
static coord_t bHeight;
|
||||
static gCoord bHeight;
|
||||
static GHandle ghc;
|
||||
static coord_t swidth, sheight;
|
||||
static gCoord swidth, sheight;
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* GINPUT Touch Driver Calibrator. *
|
||||
|
@ -187,7 +187,7 @@ static gBool sendpkt(uint16_t *pkt, int len) {
|
||||
GEventMouse *pem;
|
||||
uint16_t cmd[2];
|
||||
uint16_t lbuttons;
|
||||
coord_t lx, ly;
|
||||
gCoord lx, ly;
|
||||
(void) param;
|
||||
|
||||
// Initialize the mouse and the listener.
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
typedef struct fbPriv {
|
||||
void* pixels; // The pixel buffer
|
||||
coord_t linelen; // The number of bytes per display line
|
||||
gCoord linelen; // The number of bytes per display line
|
||||
void* frame0;
|
||||
void* frame1;
|
||||
} fbPriv;
|
||||
@ -177,7 +177,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -187,7 +187,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
typedef struct fbInfo {
|
||||
void * pixels; // The pixel buffer
|
||||
coord_t linelen; // The number of bytes per display line
|
||||
gCoord linelen; // The number of bytes per display line
|
||||
} fbInfo;
|
||||
|
||||
#include "board_fb24bpp.h"
|
||||
@ -155,7 +155,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -165,7 +165,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -342,7 +342,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_BITFILLS
|
||||
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
||||
coord_t lg, x, y;
|
||||
gCoord lg, x, y;
|
||||
uint16_t c1, c2;
|
||||
unsigned tuples;
|
||||
const pixel_t *buffer;
|
||||
|
@ -117,7 +117,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
#if GDISP_NEED_CONTROL
|
||||
switch(g->g.Orientation) {
|
||||
@ -156,7 +156,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
@ -209,7 +209,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -127,7 +127,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
#if GDISP_NEED_CONTROL
|
||||
switch(g->g.Orientation) {
|
||||
@ -166,7 +166,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "../../../src/gdisp/gdisp_driver.h"
|
||||
#include "gdisp_lld_qimage.h"
|
||||
|
||||
gBool qimage_init(GDisplay* g, coord_t width, coord_t height)
|
||||
gBool qimage_init(GDisplay* g, gCoord width, gCoord height)
|
||||
{
|
||||
QImage* qimage = new QImage(width, height, QImage::Format_RGB888);
|
||||
if (!qimage) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
gBool qimage_init(GDisplay* g, coord_t width, coord_t height);
|
||||
gBool qimage_init(GDisplay* g, gCoord width, gCoord height);
|
||||
void qimage_setPixel(GDisplay* g);
|
||||
color_t qimage_getPixel(GDisplay* g);
|
||||
|
||||
|
@ -259,7 +259,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
||||
pixel_t *buffer;
|
||||
coord_t ycnt;
|
||||
gCoord ycnt;
|
||||
|
||||
buffer = (pixel_t *)g->p.ptr + g->p.x1 + g->p.y1 * g->p.x2;
|
||||
|
||||
|
@ -169,9 +169,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_FILLS
|
||||
LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
|
||||
coord_t sy, ey;
|
||||
coord_t sx, ex;
|
||||
coord_t col;
|
||||
gCoord sy, ey;
|
||||
gCoord sx, ex;
|
||||
gCoord col;
|
||||
unsigned spage, zpages;
|
||||
uint8_t * base;
|
||||
uint8_t mask;
|
||||
@ -236,7 +236,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
@ -267,7 +267,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
|
@ -189,7 +189,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
uint8_t *ram;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
LLDCOLOR_TYPE c;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
|
@ -341,8 +341,8 @@ LLDSPEC void gdisp_lld_clear (GDisplay *g)
|
||||
#if GDISP_HARDWARE_FILLS
|
||||
LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
|
||||
{
|
||||
coord_t scol, ecol, sx, ex;
|
||||
coord_t y, col, x;
|
||||
gCoord scol, ecol, sx, ex;
|
||||
gCoord y, col, x;
|
||||
uint16_t area = (uint16_t) g->p.cx * g->p.cy;
|
||||
uint8_t temp;
|
||||
|
||||
@ -400,7 +400,7 @@ LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
|
||||
{
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch (g->g.Orientation)
|
||||
{
|
||||
@ -436,7 +436,7 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g)
|
||||
{
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch (g->g.Orientation)
|
||||
{
|
||||
@ -554,8 +554,8 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
|
||||
#if GDISP_HARDWARE_BITFILLS
|
||||
LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
|
||||
{
|
||||
coord_t scol, ecol, sx;
|
||||
coord_t y, col;
|
||||
gCoord scol, ecol, sx;
|
||||
gCoord y, col;
|
||||
uint16_t area;
|
||||
uint8_t temp, temp2, i;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#define CALC_FPR(w,h,hb,hf,hp,vb,vf,vp,fps) ((fps * CALC_PERIOD(w,hb,hf,hp) * CALC_PERIOD(h,vb,vf,vp) * 1048576)/100000000)
|
||||
|
||||
typedef struct LCD_Parameters {
|
||||
coord_t width, height; // Panel width and height
|
||||
gCoord width, height; // Panel width and height
|
||||
uint16_t hbporch; // Horizontal Back Porch
|
||||
uint16_t hfporch; // Horizontal Front Porch
|
||||
uint16_t hpulse; // Horizontal Pulse
|
||||
|
@ -295,7 +295,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
||||
|
||||
LLDSPEC void gdisp_lld_blit_area(GDisplay* g) {
|
||||
pixel_t* buffer;
|
||||
coord_t ycnt;
|
||||
gCoord ycnt;
|
||||
|
||||
buffer = (pixel_t*)g->p.ptr + g->p.x1 + g->p.y1 * g->p.x2;
|
||||
|
||||
|
@ -166,7 +166,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
@ -197,7 +197,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
|
@ -48,13 +48,13 @@
|
||||
typedef struct ltdcLayerConfig {
|
||||
// Frame
|
||||
LLDCOLOR_TYPE* frame; // Frame buffer address
|
||||
coord_t width, height; // Frame size in pixels
|
||||
coord_t pitch; // Line pitch, in bytes
|
||||
gCoord width, height; // Frame size in pixels
|
||||
gCoord pitch; // Line pitch, in bytes
|
||||
uint16_t fmt; // Pixel format in LTDC format
|
||||
|
||||
// Window
|
||||
coord_t x, y; // Start pixel position of the virtual layer
|
||||
coord_t cx, cy; // Size of the virtual layer
|
||||
gCoord x, y; // Start pixel position of the virtual layer
|
||||
gCoord cx, cy; // Size of the virtual layer
|
||||
|
||||
uint32_t defcolor; // Default color, ARGB8888
|
||||
uint32_t keycolor; // Color key, RGB888
|
||||
@ -66,10 +66,10 @@ typedef struct ltdcLayerConfig {
|
||||
} ltdcLayerConfig;
|
||||
|
||||
typedef struct ltdcConfig {
|
||||
coord_t width, height; // Screen size
|
||||
coord_t hsync, vsync; // Horizontal and Vertical sync pixels
|
||||
coord_t hbackporch, vbackporch; // Horizontal and Vertical back porch pixels
|
||||
coord_t hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels
|
||||
gCoord width, height; // Screen size
|
||||
gCoord hsync, vsync; // Horizontal and Vertical sync pixels
|
||||
gCoord hbackporch, vbackporch; // Horizontal and Vertical back porch pixels
|
||||
gCoord hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels
|
||||
uint32_t syncflags; // Sync flags
|
||||
uint32_t bgcolor; // Clear screen color RGB888
|
||||
|
||||
@ -382,7 +382,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -392,7 +392,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
#if GDISP_NEED_CONTROL
|
||||
switch(g->g.Orientation) {
|
||||
@ -172,7 +172,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -239,7 +239,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -138,7 +138,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
#if GDISP_NEED_CONTROL
|
||||
switch(g->g.Orientation) {
|
||||
@ -177,7 +177,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_PIXELREAD
|
||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -244,7 +244,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -45,10 +45,10 @@
|
||||
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0)
|
||||
|
||||
typedef struct UC1610_Window {
|
||||
coord_t x1;
|
||||
coord_t y1;
|
||||
coord_t x2;
|
||||
coord_t y2;
|
||||
gCoord x1;
|
||||
gCoord y1;
|
||||
gCoord x2;
|
||||
gCoord y2;
|
||||
} UC1610_Window;
|
||||
|
||||
/*===========================================================================*/
|
||||
@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
uint8_t *c;
|
||||
|
||||
// handle orientation
|
||||
@ -170,7 +170,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#if GDISP_HARDWARE_FLUSH
|
||||
LLDSPEC void gdisp_lld_flush(GDisplay* g)
|
||||
{
|
||||
coord_t x1, y1, x2, y2, cx;
|
||||
gCoord x1, y1, x2, y2, cx;
|
||||
uint8_t *c;
|
||||
|
||||
// Don't flush unless we really need to
|
||||
|
@ -309,7 +309,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
|
||||
#if GDISP_HARDWARE_FLUSH
|
||||
LLDSPEC void gdisp_lld_flush(GDisplay* g)
|
||||
{
|
||||
coord_t cy, cx, dx, dy;
|
||||
gCoord cy, cx, dx, dy;
|
||||
LLDCOLOR_TYPE *fb;
|
||||
UC8173_Private *priv;
|
||||
|
||||
@ -390,7 +390,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g)
|
||||
{
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
UC8173_Private *priv;
|
||||
|
||||
priv = (UC8173_Private *)g->priv;
|
||||
|
@ -163,7 +163,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
|
||||
#if GDISP_HARDWARE_DRAWPIXEL
|
||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
switch(g->g.Orientation) {
|
||||
default:
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
typedef struct fbInfo {
|
||||
void * pixels; // The pixel buffer
|
||||
coord_t linelen; // The number of bytes per display line
|
||||
gCoord linelen; // The number of bytes per display line
|
||||
} fbInfo;
|
||||
|
||||
#include "board_framebuffer.h"
|
||||
@ -135,7 +135,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
case GDISP_ROTATE_0:
|
||||
case GDISP_ROTATE_180:
|
||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
@ -145,7 +145,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||
case GDISP_ROTATE_90:
|
||||
case GDISP_ROTATE_270:
|
||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||
coord_t tmp;
|
||||
gCoord tmp;
|
||||
|
||||
tmp = g->g.Width;
|
||||
g->g.Width = g->g.Height;
|
||||
|
@ -65,8 +65,8 @@ static gBool ft5336ReadXYZ(GMouse* m, GMouseReading* pdr)
|
||||
// Only take a reading if exactly one touch contact point
|
||||
if (read_byte(m, FT5336_TD_STAT_REG) == 1) {
|
||||
// Get and return X, Y an Z values
|
||||
pdr->y = (coord_t)(read_word(m, FT5336_P1_XH_REG) & 0x0FFF);
|
||||
pdr->x = (coord_t)(read_word(m, FT5336_P1_YH_REG) & 0x0FFF);
|
||||
pdr->y = (gCoord)(read_word(m, FT5336_P1_XH_REG) & 0x0FFF);
|
||||
pdr->x = (gCoord)(read_word(m, FT5336_P1_YH_REG) & 0x0FFF);
|
||||
pdr->z = 1;
|
||||
}
|
||||
|
||||
|
@ -68,8 +68,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||
if ((read_byte(m, FT5x06_TOUCH_POINTS) & 0x07)) {
|
||||
|
||||
/* Get the X, Y, Z values */
|
||||
pdr->x = (coord_t)(read_word(m, FT5x06_TOUCH1_XH) & 0x0fff);
|
||||
pdr->y = (coord_t)read_word(m, FT5x06_TOUCH1_YH);
|
||||
pdr->x = (gCoord)(read_word(m, FT5x06_TOUCH1_XH) & 0x0fff);
|
||||
pdr->y = (gCoord)read_word(m, FT5x06_TOUCH1_YH);
|
||||
pdr->z = 1;
|
||||
|
||||
// Rescale X,Y if we are using self-calibration
|
||||
|
@ -68,8 +68,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||
if ((read_byte(m, FT6x06_TOUCH_POINTS) & 0x07)) {
|
||||
|
||||
/* Get the X, Y, Z values */
|
||||
pdr->x = (coord_t)(read_word(m, FT6x06_TOUCH1_XH) & 0x0fff);
|
||||
pdr->y = (coord_t)read_word(m, FT6x06_TOUCH1_YH);
|
||||
pdr->x = (gCoord)(read_word(m, FT6x06_TOUCH1_XH) & 0x0fff);
|
||||
pdr->y = (gCoord)read_word(m, FT6x06_TOUCH1_YH);
|
||||
pdr->z = 1;
|
||||
|
||||
// Rescale X,Y if we are using self-calibration
|
||||
|
@ -152,7 +152,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||
return gTrue;
|
||||
}
|
||||
|
||||
// Strip the tags (we need to take care because coord_t is signed - and sign bit gets extended on shift!)
|
||||
// Strip the tags (we need to take care because gCoord is signed - and sign bit gets extended on shift!)
|
||||
pdr->x = (uint16_t)(pdr->x) >> 4;
|
||||
pdr->y = (uint16_t)(pdr->y) >> 4;
|
||||
pdr->z = Z_MAX;
|
||||
|
@ -2,9 +2,9 @@
|
||||
#include "ugfx/src/ginput/ginput_driver_mouse.h"
|
||||
|
||||
extern GMouse* qwidgetMouse;
|
||||
extern coord_t qwidgetMouseX;
|
||||
extern coord_t qwidgetMouseY;
|
||||
extern coord_t qwidgetMouseZ;
|
||||
extern gCoord qwidgetMouseX;
|
||||
extern gCoord qwidgetMouseY;
|
||||
extern gCoord qwidgetMouseZ;
|
||||
extern uint16_t qwidgetMouseButtons;
|
||||
|
||||
MyWidget::MyWidget(QWidget* parent) : QWidget(parent)
|
||||
|
@ -14,9 +14,9 @@
|
||||
#include "../../../../src/ginput/ginput_driver_mouse.h"
|
||||
|
||||
GMouse* qwidgetMouse;
|
||||
coord_t qwidgetMouseX;
|
||||
coord_t qwidgetMouseY;
|
||||
coord_t qwidgetMouseZ;
|
||||
gCoord qwidgetMouseX;
|
||||
gCoord qwidgetMouseY;
|
||||
gCoord qwidgetMouseZ;
|
||||
uint16_t qwidgetMouseButtons;
|
||||
|
||||
static gBool _init(GMouse* m, unsigned driverinstance)
|
||||
|
@ -171,10 +171,10 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||
#endif
|
||||
|
||||
// Time to get some readings
|
||||
pdr->x = (coord_t)read_word(m, STMPE610_REG_TSC_DATA_X);
|
||||
pdr->y = (coord_t)read_word(m, STMPE610_REG_TSC_DATA_Y);
|
||||
pdr->x = (gCoord)read_word(m, STMPE610_REG_TSC_DATA_X);
|
||||
pdr->y = (gCoord)read_word(m, STMPE610_REG_TSC_DATA_Y);
|
||||
#if GMOUSE_STMPE610_READ_PRESSURE
|
||||
pdr->z = (coord_t)read_byte(m, STMPE610_REG_TSC_DATA_Z);
|
||||
pdr->z = (gCoord)read_byte(m, STMPE610_REG_TSC_DATA_Z);
|
||||
#else
|
||||
pdr->z = gmvmt(m)->z_max;
|
||||
#endif
|
||||
|
@ -171,10 +171,10 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||
#endif
|
||||
|
||||
// Time to get some readings
|
||||
pdr->x = (coord_t)read_word(m, STMPE811_REG_TSC_DATA_X);
|
||||
pdr->y = (coord_t)read_word(m, STMPE811_REG_TSC_DATA_Y);
|
||||
pdr->x = (gCoord)read_word(m, STMPE811_REG_TSC_DATA_X);
|
||||
pdr->y = (gCoord)read_word(m, STMPE811_REG_TSC_DATA_Y);
|
||||
#if GMOUSE_STMPE811_READ_PRESSURE
|
||||
pdr->z = (coord_t)read_byte(m, STMPE811_REG_TSC_DATA_Z);
|
||||
pdr->z = (gCoord)read_byte(m, STMPE811_REG_TSC_DATA_Z);
|
||||
#else
|
||||
pdr->z = gmvmt(m)->z_max;
|
||||
#endif
|
||||
|
@ -161,7 +161,7 @@ struct SDL_UGFXContext {
|
||||
int16_t need_redraw;
|
||||
int minx,miny,maxx,maxy;
|
||||
#if GINPUT_NEED_MOUSE
|
||||
coord_t mousex, mousey;
|
||||
gCoord mousex, mousey;
|
||||
uint16_t buttons;
|
||||
#endif
|
||||
#if GINPUT_NEED_KEYBOARD
|
||||
|
@ -442,18 +442,18 @@ typedef struct winPriv {
|
||||
HBITMAP dcBitmap;
|
||||
HBITMAP dcOldBitmap;
|
||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
||||
coord_t mousex, mousey;
|
||||
gCoord mousex, mousey;
|
||||
uint16_t mousebuttons;
|
||||
GMouse *mouse;
|
||||
gBool mouseenabled;
|
||||
void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, coord_t x, coord_t y);
|
||||
void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y);
|
||||
#endif
|
||||
#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
|
||||
uint8_t toggles;
|
||||
#endif
|
||||
#if GDISP_HARDWARE_STREAM_WRITE || GDISP_HARDWARE_STREAM_READ
|
||||
coord_t x0, y0, x1, y1;
|
||||
coord_t x, y;
|
||||
gCoord x0, y0, x1, y1;
|
||||
gCoord x, y;
|
||||
#endif
|
||||
} winPriv;
|
||||
|
||||
@ -462,7 +462,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) {
|
||||
}
|
||||
|
||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
||||
void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, coord_t x, coord_t y) {
|
||||
void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y) {
|
||||
winPriv * priv;
|
||||
|
||||
priv = (winPriv *)g->priv;
|
||||
@ -475,7 +475,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) {
|
||||
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled) {
|
||||
((winPriv *)g->priv)->mouseenabled = enabled;
|
||||
}
|
||||
void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, coord_t x, coord_t y)) {
|
||||
void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y)) {
|
||||
((winPriv *)g->priv)->capfn = capfn;
|
||||
}
|
||||
#endif
|
||||
@ -495,7 +495,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
RECT rect;
|
||||
HGDIOBJ old;
|
||||
POINT p;
|
||||
coord_t pos;
|
||||
gCoord pos;
|
||||
uint8_t bit;
|
||||
#endif
|
||||
|
||||
@ -526,7 +526,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
// Handle mouse down on the window
|
||||
#if GINPUT_NEED_MOUSE
|
||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
btns = priv->mousebuttons;
|
||||
btns |= GINPUT_MOUSE_BTN_LEFT;
|
||||
goto mousemove;
|
||||
@ -535,8 +535,8 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
// Handle mouse down on the toggle area
|
||||
#if GINPUT_NEED_TOGGLE
|
||||
if ((coord_t)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT && (g->flags & GDISP_FLG_HASTOGGLE)) {
|
||||
bit = 1 << ((coord_t)LOWORD(lParam)*8/g->g.Width);
|
||||
if ((gCoord)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT && (g->flags & GDISP_FLG_HASTOGGLE)) {
|
||||
bit = 1 << ((gCoord)LOWORD(lParam)*8/g->g.Width);
|
||||
priv->toggles ^= bit;
|
||||
rect.left = 0;
|
||||
rect.right = GDISP_SCREEN_WIDTH;
|
||||
@ -576,7 +576,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
// Handle mouse up on the window
|
||||
#if GINPUT_NEED_MOUSE
|
||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
btns = priv->mousebuttons;
|
||||
btns &= ~GINPUT_MOUSE_BTN_LEFT;
|
||||
goto mousemove;
|
||||
@ -589,7 +589,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_MBUTTONDOWN:
|
||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
priv = (winPriv *)g->priv;
|
||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
btns = priv->mousebuttons;
|
||||
btns |= GINPUT_MOUSE_BTN_MIDDLE;
|
||||
goto mousemove;
|
||||
@ -598,7 +598,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_MBUTTONUP:
|
||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
priv = (winPriv *)g->priv;
|
||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
btns = priv->mousebuttons;
|
||||
btns &= ~GINPUT_MOUSE_BTN_MIDDLE;
|
||||
goto mousemove;
|
||||
@ -607,7 +607,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_RBUTTONDOWN:
|
||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
priv = (winPriv *)g->priv;
|
||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
btns = priv->mousebuttons;
|
||||
btns |= GINPUT_MOUSE_BTN_RIGHT;
|
||||
goto mousemove;
|
||||
@ -616,7 +616,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_RBUTTONUP:
|
||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
priv = (winPriv *)g->priv;
|
||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||
btns = priv->mousebuttons;
|
||||
btns &= ~GINPUT_MOUSE_BTN_RIGHT;
|
||||
goto mousemove;
|
||||
@ -625,17 +625,17 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_MOUSEMOVE:
|
||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||
priv = (winPriv *)g->priv;
|
||||
if ((coord_t)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT)
|
||||
if ((gCoord)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT)
|
||||
break;
|
||||
btns = priv->mousebuttons;
|
||||
|
||||
mousemove:
|
||||
if (priv->capfn)
|
||||
priv->capfn(hWnd, g, btns, (coord_t)LOWORD(lParam), (coord_t)HIWORD(lParam));
|
||||
priv->capfn(hWnd, g, btns, (gCoord)LOWORD(lParam), (gCoord)HIWORD(lParam));
|
||||
if (priv->mouseenabled) {
|
||||
priv->mousebuttons = btns;
|
||||
priv->mousex = (coord_t)LOWORD(lParam);
|
||||
priv->mousey = (coord_t)HIWORD(lParam);
|
||||
priv->mousex = (gCoord)LOWORD(lParam);
|
||||
priv->mousey = (gCoord)HIWORD(lParam);
|
||||
if ((gmvmt(priv->mouse)->d.flags & GMOUSE_VFLG_NOPOLL)) // For normal setup this is always true
|
||||
_gmouseWakeup(priv->mouse);
|
||||
}
|
||||
@ -1229,7 +1229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
pixel_t *dst;
|
||||
const pixel_t *src;
|
||||
size_t sz;
|
||||
coord_t i, j;
|
||||
gCoord i, j;
|
||||
|
||||
// Allocate the destination buffer
|
||||
sz = (size_t)g->p.cx * (size_t)g->p.cy;
|
||||
@ -1408,7 +1408,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) {
|
||||
winPriv * priv;
|
||||
RECT rect;
|
||||
coord_t lines;
|
||||
gCoord lines;
|
||||
|
||||
priv = g->priv;
|
||||
|
||||
@ -1571,7 +1571,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
#if GDISP_NEED_CONTROL
|
||||
// If the self-rotation has been set in the VMT then do that here (TESTING ONLY)
|
||||
if ((gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) { // For normal setup this is always False
|
||||
coord_t t;
|
||||
gCoord t;
|
||||
|
||||
switch(gdispGGetOrientation(m->display)) {
|
||||
case GDISP_ROTATE_0:
|
||||
|
@ -55,14 +55,14 @@ void gfxEmulatorSetParentWindow(void *hwnd);
|
||||
|
||||
#if GINPUT_NEED_MOUSE
|
||||
// This function allows you to inject mouse events into the ugfx mouse driver
|
||||
void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, coord_t x, coord_t y);
|
||||
void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y);
|
||||
|
||||
// This function enables you to turn on/off normal mouse functions on a ugfx Win32 display window.
|
||||
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled);
|
||||
|
||||
// This function enables you to capture mouse events on a ugfx Win32 display window.
|
||||
// Passing NULL turns off the capture
|
||||
void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, coord_t x, coord_t y));
|
||||
void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y));
|
||||
#endif
|
||||
|
||||
#endif /* GFX_USE_GDISP */
|
||||
|
@ -181,7 +181,7 @@ typedef struct xPriv {
|
||||
GC gc;
|
||||
Window win;
|
||||
#if GINPUT_NEED_MOUSE
|
||||
coord_t mousex, mousey;
|
||||
gCoord mousex, mousey;
|
||||
uint16_t buttons;
|
||||
GMouse * mouse;
|
||||
#endif
|
||||
|
@ -159,7 +159,7 @@ typedef struct netPriv {
|
||||
unsigned databytes; // How many bytes have been read
|
||||
uint16_t data[2]; // Buffer for storing data read.
|
||||
#if GINPUT_NEED_MOUSE
|
||||
coord_t mousex, mousey;
|
||||
gCoord mousex, mousey;
|
||||
uint16_t mousebuttons;
|
||||
GMouse * mouse;
|
||||
#endif
|
||||
@ -540,7 +540,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
netPriv * priv;
|
||||
pixel_t * buffer;
|
||||
uint16_t buf[5];
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
||||
if (!(g->flags & GDISP_FLG_CONNECTED))
|
||||
|
@ -119,7 +119,7 @@ typedef struct netPriv {
|
||||
unsigned databytes; // How many bytes have been read
|
||||
uint16_t data[2]; // Buffer for storing data read.
|
||||
#if GINPUT_NEED_MOUSE
|
||||
coord_t mousex, mousey;
|
||||
gCoord mousex, mousey;
|
||||
uint16_t mousebuttons;
|
||||
GMouse * mouse;
|
||||
#endif
|
||||
@ -423,7 +423,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||
netPriv * priv;
|
||||
pixel_t * buffer;
|
||||
uint16_t buf[5];
|
||||
coord_t x, y;
|
||||
gCoord x, y;
|
||||
|
||||
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
||||
if (!(g->flags & GDISP_FLG_CONNECTED))
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -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))
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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?
|
||||
|
@ -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
|
||||
|
||||
/**
|
||||
|
@ -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} };
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user