Change coord_t to gCoord
This commit is contained in:
parent
7e95acb731
commit
2ab2d77fcb
111 changed files with 564 additions and 562 deletions
|
@ -3,8 +3,8 @@
|
||||||
#include <gfx.h>
|
#include <gfx.h>
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
coord_t i, j;
|
gCoord i, j;
|
||||||
|
|
||||||
pinMode(13, OUTPUT);
|
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: 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.
|
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 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: Added gfxRealloc() to Qt port
|
||||||
FIX: Fixed UC1610 driver private area initialisation
|
FIX: Fixed UC1610 driver private area initialisation
|
||||||
FIX: Fixed ST7735 driver and added kapacuk changes
|
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 GEventMouse curPtr; // Holder for current pointer location
|
||||||
|
|
||||||
static font_t font;
|
static font_t font;
|
||||||
static coord_t swidth, sheight;
|
static gCoord swidth, sheight;
|
||||||
|
|
||||||
// The toolbar buttons - Self-Explanatory
|
// The toolbar buttons - Self-Explanatory
|
||||||
static GButtonObject btnNew, btnOpen, btnSave;
|
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 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;
|
color_t c = ncoreDrawingArea->color;
|
||||||
|
|
||||||
if (nMode == NCORE_MODE_DRAW)
|
if (nMode == NCORE_MODE_DRAW)
|
||||||
|
@ -71,7 +71,7 @@ static void draw_point(coord_t x, coord_t y) {
|
||||||
|
|
||||||
/* Bresenham's Line Drawing Algorithm
|
/* Bresenham's Line Drawing Algorithm
|
||||||
Modified version to draw line of variable thickness */
|
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 dy, dx;
|
||||||
int16_t addx, addy;
|
int16_t addx, addy;
|
||||||
int16_t P, diff, i;
|
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) {
|
static DECLARE_THREAD_FUNCTION(ncoreDrawThread, msg) {
|
||||||
|
|
||||||
GEventMouse ev, evPrev;
|
GEventMouse ev, evPrev;
|
||||||
coord_t dx, dy;
|
gCoord dx, dy;
|
||||||
|
|
||||||
int state = 0, dist;
|
int state = 0, dist;
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,9 @@ static gfxThreadHandle thread;
|
||||||
#define SHADOWALPHA (255-255*0.2)
|
#define SHADOWALPHA (255-255*0.2)
|
||||||
|
|
||||||
static DECLARE_THREAD_FUNCTION(task, param) {
|
static DECLARE_THREAD_FUNCTION(task, param) {
|
||||||
coord_t width, height, x, y, radius, ballx, bally, dx, floor;
|
gCoord width, height, x, y, radius, ballx, bally, dx, floor;
|
||||||
coord_t minx, miny, maxx, maxy, winx, winy;
|
gCoord minx, miny, maxx, maxy, winx, winy;
|
||||||
coord_t ballcx, ballcy;
|
gCoord ballcx, ballcy;
|
||||||
color_t colour;
|
color_t colour;
|
||||||
float ii, spin, dy, spinspeed, h, f, g;
|
float ii, spin, dy, spinspeed, h, f, g;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
|
@ -115,14 +115,14 @@ static void nextline(GWidgetInit *pwi) {
|
||||||
pwi->g.y += pwi->g.height+1;
|
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->text = txt;
|
||||||
pwi->g.width = gdispGetStringWidth(pwi->text, font) + BUTTON_PADDING;
|
pwi->g.width = gdispGetStringWidth(pwi->text, font) + BUTTON_PADDING;
|
||||||
if (pwi->g.x + pwi->g.width > maxwidth)
|
if (pwi->g.x + pwi->g.width > maxwidth)
|
||||||
nextline(pwi);
|
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.x += pwi->g.width+1;
|
||||||
pwi->g.width = nextwidth;
|
pwi->g.width = nextwidth;
|
||||||
if (pwi->g.x + nextwidth > maxwidth)
|
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) {
|
static void createWidgets(void) {
|
||||||
GWidgetInit wi;
|
GWidgetInit wi;
|
||||||
coord_t border, pagewidth;
|
gCoord border, pagewidth;
|
||||||
|
|
||||||
gwinWidgetClearInit(&wi);
|
gwinWidgetClearInit(&wi);
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ static int uitoa(unsigned int value, char * buf, int max) {
|
||||||
void benchmark(void) {
|
void benchmark(void) {
|
||||||
uint32_t i, pixels, ms, pps;
|
uint32_t i, pixels, ms, pps;
|
||||||
char pps_str[25];
|
char pps_str[25];
|
||||||
coord_t height, width, rx, ry, rcx, rcy;
|
gCoord height, width, rx, ry, rcx, rcy;
|
||||||
color_t random_color;
|
color_t random_color;
|
||||||
font_t font;
|
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)))
|
if (!(gs = (GScopeObject *)_gwindowCreate(g, &gs->g, pInit, &scopeVMT, 0)))
|
||||||
return 0;
|
return 0;
|
||||||
gs->nextx = 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;
|
return 0;
|
||||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||||
gs->lasty = gs->g.height/2;
|
gs->lasty = gs->g.height/2;
|
||||||
|
@ -82,10 +82,10 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
|
||||||
void gwinScopeWaitForTrace(GHandle gh) {
|
void gwinScopeWaitForTrace(GHandle gh) {
|
||||||
#define gs ((GScopeObject *)(gh))
|
#define gs ((GScopeObject *)(gh))
|
||||||
int i;
|
int i;
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
coord_t yoffset;
|
gCoord yoffset;
|
||||||
adcsample_t *pa;
|
adcsample_t *pa;
|
||||||
coord_t *pc;
|
gCoord *pc;
|
||||||
GDataBuffer *pd;
|
GDataBuffer *pd;
|
||||||
uint8_t shr;
|
uint8_t shr;
|
||||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||||
|
@ -94,7 +94,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||||
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||||
gBool rdytrigger;
|
gBool rdytrigger;
|
||||||
int flsamples;
|
int flsamples;
|
||||||
coord_t scopemin;
|
gCoord scopemin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gh->vmt != &scopeVMT)
|
if (gh->vmt != &scopeVMT)
|
||||||
|
@ -127,7 +127,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||||
for(i = pd->len/sizeof(adcsample_t); i; i--) {
|
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 */
|
/* 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
|
#if TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||||
/* Calculate the scopemin ready for the next trace */
|
/* Calculate the scopemin ready for the next trace */
|
||||||
|
|
|
@ -63,13 +63,13 @@
|
||||||
typedef struct GScopeObject_t {
|
typedef struct GScopeObject_t {
|
||||||
GWindowObject g; // Base Class
|
GWindowObject g; // Base Class
|
||||||
|
|
||||||
coord_t *lastscopetrace; // To store last scope trace
|
gCoord *lastscopetrace; // To store last scope trace
|
||||||
coord_t nextx; // Where we are up to
|
gCoord nextx; // Where we are up to
|
||||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
#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
|
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||||
coord_t lasty; // The last y value - used for trigger slope detection
|
gCoord lasty; // The last y value - used for trigger slope detection
|
||||||
coord_t scopemin; // The last scopes minimum value
|
gCoord scopemin; // The last scopes minimum value
|
||||||
#endif
|
#endif
|
||||||
} GScopeObject;
|
} GScopeObject;
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ static GTimer lsTimer;
|
||||||
*/
|
*/
|
||||||
int main(void) {
|
int main(void) {
|
||||||
GHandle ghScope;
|
GHandle ghScope;
|
||||||
coord_t swidth, sheight;
|
gCoord swidth, sheight;
|
||||||
#if defined(MY_DIAL_DEVICE) || defined(MY_TEMP_DEVICE)
|
#if defined(MY_DIAL_DEVICE) || defined(MY_TEMP_DEVICE)
|
||||||
GHandle ghText;
|
GHandle ghText;
|
||||||
font_t font;
|
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 */
|
/* Initialise the scope object members and allocate memory for buffers */
|
||||||
gs->format = format;
|
gs->format = format;
|
||||||
gs->nextx = 0;
|
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;
|
return 0;
|
||||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||||
gs->lasty = gs->g.height/2;
|
gs->lasty = gs->g.height/2;
|
||||||
|
@ -98,11 +98,11 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||||
#define gs ((GScopeObject *)(gh))
|
#define gs ((GScopeObject *)(gh))
|
||||||
GDataBuffer *paud;
|
GDataBuffer *paud;
|
||||||
int i;
|
int i;
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
coord_t yoffset;
|
gCoord yoffset;
|
||||||
uint8_t *pa8;
|
uint8_t *pa8;
|
||||||
uint16_t *pa16;
|
uint16_t *pa16;
|
||||||
coord_t *pc;
|
gCoord *pc;
|
||||||
uint8_t shr;
|
uint8_t shr;
|
||||||
|
|
||||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||||
|
@ -111,7 +111,7 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||||
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||||
gBool rdytrigger;
|
gBool rdytrigger;
|
||||||
int flsamples;
|
int flsamples;
|
||||||
coord_t scopemin;
|
gCoord scopemin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gh->vmt != &scopeVMT)
|
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 */
|
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
|
||||||
if (gfxSampleFormatBits(gs->format) <= 8)
|
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
|
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
|
#if TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||||
/* Calculate the scopemin ready for the next trace */
|
/* Calculate the scopemin ready for the next trace */
|
||||||
|
|
|
@ -63,14 +63,14 @@
|
||||||
typedef struct GScopeObject_t {
|
typedef struct GScopeObject_t {
|
||||||
GWindowObject g; // Base Class
|
GWindowObject g; // Base Class
|
||||||
|
|
||||||
coord_t *lastscopetrace; // To store last scope trace
|
gCoord *lastscopetrace; // To store last scope trace
|
||||||
ArrayDataFormat format; // The sample format
|
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
|
#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
|
#elif TRIGGER_METHOD == TRIGGER_MINVALUE
|
||||||
coord_t lasty; // The last y value - used for trigger slope detection
|
gCoord lasty; // The last y value - used for trigger slope detection
|
||||||
coord_t scopemin; // The last scopes minimum value
|
gCoord scopemin; // The last scopes minimum value
|
||||||
#endif
|
#endif
|
||||||
} GScopeObject;
|
} GScopeObject;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ static GScopeObject gScopeWindow;
|
||||||
*/
|
*/
|
||||||
int main(void) {
|
int main(void) {
|
||||||
GHandle ghScope;
|
GHandle ghScope;
|
||||||
coord_t swidth, sheight;
|
gCoord swidth, sheight;
|
||||||
|
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height, r1, r2, cx, cy;
|
gCoord width, height, r1, r2, cx, cy;
|
||||||
uint8_t sectors;
|
uint8_t sectors;
|
||||||
|
|
||||||
// Initialize and clear the display
|
// Initialize and clear the display
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
coord_t i, j;
|
gCoord i, j;
|
||||||
|
|
||||||
// Initialize and clear the display
|
// Initialize and clear the display
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
|
|
||||||
// Initialize and clear the display
|
// Initialize and clear the display
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, y;
|
gCoord width, y;
|
||||||
font_t font1, font2;
|
font_t font1, font2;
|
||||||
coord_t fheight1, fheight2;
|
gCoord fheight1, fheight2;
|
||||||
const char *line1, *line2;
|
const char *line1, *line2;
|
||||||
char buf[8];
|
char buf[8];
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
static gdispImage myImage;
|
static gdispImage myImage;
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t swidth, sheight;
|
gCoord swidth, sheight;
|
||||||
|
|
||||||
// Initialize uGFX and the underlying system
|
// Initialize uGFX and the underlying system
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
|
@ -54,7 +54,7 @@ static gdispImage myImage;
|
||||||
* Orange - Decoding a frame has produced an error.
|
* Orange - Decoding a frame has produced an error.
|
||||||
*/
|
*/
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t swidth, sheight, errx, erry, errcx, errcy;
|
gCoord swidth, sheight, errx, erry, errcx, errcy;
|
||||||
delaytime_t delay;
|
delaytime_t delay;
|
||||||
|
|
||||||
gfxInit(); // Initialize the display
|
gfxInit(); // Initialize the display
|
||||||
|
|
|
@ -45,8 +45,8 @@
|
||||||
|
|
||||||
#if USE_METHOD_1
|
#if USE_METHOD_1
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
coord_t display, i, j, cnt;
|
gCoord display, i, j, cnt;
|
||||||
font_t f;
|
font_t f;
|
||||||
GDisplay *g;
|
GDisplay *g;
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
@ -89,8 +89,8 @@
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
coord_t display, i, j, cnt;
|
gCoord display, i, j, cnt;
|
||||||
font_t f;
|
font_t f;
|
||||||
char buf[16];
|
char buf[16];
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ static GDisplay* pixmap;
|
||||||
static pixel_t* surface;
|
static pixel_t* surface;
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
coord_t i, j;
|
gCoord i, j;
|
||||||
|
|
||||||
// Initialize and clear the display
|
// Initialize and clear the display
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
|
@ -69,7 +69,7 @@ static gPoint oldresult[NUM_POINTS];
|
||||||
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height;
|
gCoord width, height;
|
||||||
mtype scalex, scaley;
|
mtype scalex, scaley;
|
||||||
mtype scaleincx, scaleincy;
|
mtype scaleincx, scaleincy;
|
||||||
mtype translatex, translatey;
|
mtype translatex, translatey;
|
||||||
|
|
|
@ -57,9 +57,9 @@
|
||||||
#define SHADOWALPHA (255-255*0.2)
|
#define SHADOWALPHA (255-255*0.2)
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t width, height, x, y, radius, ballx, bally, dx, floor;
|
gCoord width, height, x, y, radius, ballx, bally, dx, floor;
|
||||||
coord_t minx, miny, maxx, maxy;
|
gCoord minx, miny, maxx, maxy;
|
||||||
coord_t ballcx, ballcy;
|
gCoord ballcx, ballcy;
|
||||||
color_t colour;
|
color_t colour;
|
||||||
float ii, spin, dy, spinspeed, h, f, g;
|
float ii, spin, dy, spinspeed, h, f, g;
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@ static const transTable FrenchTranslation = { sizeof(FrenchStrings)/sizeof(Frenc
|
||||||
|
|
||||||
void updateText()
|
void updateText()
|
||||||
{
|
{
|
||||||
coord_t width = 400;
|
gCoord width = 400;
|
||||||
coord_t height = 30;
|
gCoord height = 30;
|
||||||
|
|
||||||
// Translate some basic strings
|
// Translate some basic strings
|
||||||
gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
|
gdispFillStringBox(20, 20, width, height, gt("Welcome"), font, COLOR_TEXT, COLOR_BACKGROUND, justifyLeft);
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
GHandle GW1, GW2;
|
GHandle GW1, GW2;
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
coord_t i, j;
|
gCoord i, j;
|
||||||
|
|
||||||
/* Initialize and clear the display */
|
/* Initialize and clear the display */
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
|
@ -171,7 +171,7 @@ static gdispImage imgYesNo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Wrap buttons onto the next line if they don't fit.
|
// 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) {
|
if (pwi->g.x >= maxwidth) {
|
||||||
pwi->g.x = 5;
|
pwi->g.x = 5;
|
||||||
pwi->g.y += pwi->g.height+1;
|
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) {
|
static void createWidgets(void) {
|
||||||
GWidgetInit wi;
|
GWidgetInit wi;
|
||||||
coord_t border, pagewidth;
|
gCoord border, pagewidth;
|
||||||
|
|
||||||
gwinWidgetClearInit(&wi);
|
gwinWidgetClearInit(&wi);
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,9 @@
|
||||||
|
|
||||||
static GConsoleObject gc;
|
static GConsoleObject gc;
|
||||||
static font_t font;
|
static font_t font;
|
||||||
static coord_t bHeight;
|
static gCoord bHeight;
|
||||||
static GHandle ghc;
|
static GHandle ghc;
|
||||||
static coord_t swidth, sheight;
|
static gCoord swidth, sheight;
|
||||||
|
|
||||||
#if !GWIN_CONSOLE_USE_FLOAT
|
#if !GWIN_CONSOLE_USE_FLOAT
|
||||||
#error "You need to enable float support for the console widget. (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 GConsoleObject gc;
|
||||||
static GListener gl;
|
static GListener gl;
|
||||||
static font_t font;
|
static font_t font;
|
||||||
static coord_t bWidth, bWidth2, bHeight;
|
static gCoord bWidth, bWidth2, bHeight;
|
||||||
static GHandle ghc;
|
static GHandle ghc;
|
||||||
static coord_t swidth, sheight;
|
static gCoord swidth, sheight;
|
||||||
|
|
||||||
static void DrawHeader(const char *title, gBool btnNext, gBool btnPrev, gBool btnPlusMinus) {
|
static void DrawHeader(const char *title, gBool btnNext, gBool btnPrev, gBool btnPlusMinus) {
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
static GConsoleObject gc;
|
static GConsoleObject gc;
|
||||||
static GListener gl;
|
static GListener gl;
|
||||||
static font_t font;
|
static font_t font;
|
||||||
static coord_t bHeight;
|
static gCoord bHeight;
|
||||||
static GHandle ghc;
|
static GHandle ghc;
|
||||||
static coord_t swidth, sheight;
|
static gCoord swidth, sheight;
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*
|
/*------------------------------------------------------------------------*
|
||||||
* GINPUT Touch Driver Calibrator. *
|
* GINPUT Touch Driver Calibrator. *
|
||||||
|
|
|
@ -187,7 +187,7 @@ static gBool sendpkt(uint16_t *pkt, int len) {
|
||||||
GEventMouse *pem;
|
GEventMouse *pem;
|
||||||
uint16_t cmd[2];
|
uint16_t cmd[2];
|
||||||
uint16_t lbuttons;
|
uint16_t lbuttons;
|
||||||
coord_t lx, ly;
|
gCoord lx, ly;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
// Initialize the mouse and the listener.
|
// Initialize the mouse and the listener.
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
typedef struct fbPriv {
|
typedef struct fbPriv {
|
||||||
void* pixels; // The pixel buffer
|
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* frame0;
|
||||||
void* frame1;
|
void* frame1;
|
||||||
} fbPriv;
|
} fbPriv;
|
||||||
|
@ -177,7 +177,7 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay* g)
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
typedef struct fbInfo {
|
typedef struct fbInfo {
|
||||||
void * pixels; // The pixel buffer
|
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;
|
} fbInfo;
|
||||||
|
|
||||||
#include "board_fb24bpp.h"
|
#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_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -342,7 +342,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_BITFILLS
|
#if GDISP_HARDWARE_BITFILLS
|
||||||
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
||||||
coord_t lg, x, y;
|
gCoord lg, x, y;
|
||||||
uint16_t c1, c2;
|
uint16_t c1, c2;
|
||||||
unsigned tuples;
|
unsigned tuples;
|
||||||
const pixel_t *buffer;
|
const pixel_t *buffer;
|
||||||
|
|
|
@ -117,7 +117,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
|
@ -156,7 +156,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
@ -209,7 +209,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_90:
|
case GDISP_ROTATE_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -127,7 +127,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
|
@ -166,7 +166,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
@ -219,7 +219,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_90:
|
case GDISP_ROTATE_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "../../../src/gdisp/gdisp_driver.h"
|
#include "../../../src/gdisp/gdisp_driver.h"
|
||||||
#include "gdisp_lld_qimage.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);
|
QImage* qimage = new QImage(width, height, QImage::Format_RGB888);
|
||||||
if (!qimage) {
|
if (!qimage) {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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);
|
void qimage_setPixel(GDisplay* g);
|
||||||
color_t qimage_getPixel(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) {
|
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
||||||
pixel_t *buffer;
|
pixel_t *buffer;
|
||||||
coord_t ycnt;
|
gCoord ycnt;
|
||||||
|
|
||||||
buffer = (pixel_t *)g->p.ptr + g->p.x1 + g->p.y1 * g->p.x2;
|
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
|
#if GDISP_HARDWARE_FILLS
|
||||||
LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
|
LLDSPEC void gdisp_lld_fill_area(GDisplay *g) {
|
||||||
coord_t sy, ey;
|
gCoord sy, ey;
|
||||||
coord_t sx, ex;
|
gCoord sx, ex;
|
||||||
coord_t col;
|
gCoord col;
|
||||||
unsigned spage, zpages;
|
unsigned spage, zpages;
|
||||||
uint8_t * base;
|
uint8_t * base;
|
||||||
uint8_t mask;
|
uint8_t mask;
|
||||||
|
@ -236,7 +236,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
@ -267,7 +267,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -189,7 +189,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
uint8_t *ram;
|
uint8_t *ram;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
|
@ -220,7 +220,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
LLDCOLOR_TYPE c;
|
LLDCOLOR_TYPE c;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
|
|
|
@ -341,8 +341,8 @@ LLDSPEC void gdisp_lld_clear (GDisplay *g)
|
||||||
#if GDISP_HARDWARE_FILLS
|
#if GDISP_HARDWARE_FILLS
|
||||||
LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
|
LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
|
||||||
{
|
{
|
||||||
coord_t scol, ecol, sx, ex;
|
gCoord scol, ecol, sx, ex;
|
||||||
coord_t y, col, x;
|
gCoord y, col, x;
|
||||||
uint16_t area = (uint16_t) g->p.cx * g->p.cy;
|
uint16_t area = (uint16_t) g->p.cx * g->p.cy;
|
||||||
uint8_t temp;
|
uint8_t temp;
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
|
LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
|
||||||
{
|
{
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch (g->g.Orientation)
|
switch (g->g.Orientation)
|
||||||
{
|
{
|
||||||
|
@ -436,7 +436,7 @@ LLDSPEC void gdisp_lld_draw_pixel (GDisplay *g)
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g)
|
LLDSPEC color_t gdisp_lld_get_pixel_color (GDisplay *g)
|
||||||
{
|
{
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch (g->g.Orientation)
|
switch (g->g.Orientation)
|
||||||
{
|
{
|
||||||
|
@ -554,8 +554,8 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
|
||||||
#if GDISP_HARDWARE_BITFILLS
|
#if GDISP_HARDWARE_BITFILLS
|
||||||
LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
|
LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
|
||||||
{
|
{
|
||||||
coord_t scol, ecol, sx;
|
gCoord scol, ecol, sx;
|
||||||
coord_t y, col;
|
gCoord y, col;
|
||||||
uint16_t area;
|
uint16_t area;
|
||||||
uint8_t temp, temp2, i;
|
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)
|
#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 {
|
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 hbporch; // Horizontal Back Porch
|
||||||
uint16_t hfporch; // Horizontal Front Porch
|
uint16_t hfporch; // Horizontal Front Porch
|
||||||
uint16_t hpulse; // Horizontal Pulse
|
uint16_t hpulse; // Horizontal Pulse
|
||||||
|
|
|
@ -295,7 +295,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) {
|
||||||
|
|
||||||
LLDSPEC void gdisp_lld_blit_area(GDisplay* g) {
|
LLDSPEC void gdisp_lld_blit_area(GDisplay* g) {
|
||||||
pixel_t* buffer;
|
pixel_t* buffer;
|
||||||
coord_t ycnt;
|
gCoord ycnt;
|
||||||
|
|
||||||
buffer = (pixel_t*)g->p.ptr + g->p.x1 + g->p.y1 * g->p.x2;
|
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
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
@ -197,7 +197,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -48,13 +48,13 @@
|
||||||
typedef struct ltdcLayerConfig {
|
typedef struct ltdcLayerConfig {
|
||||||
// Frame
|
// Frame
|
||||||
LLDCOLOR_TYPE* frame; // Frame buffer address
|
LLDCOLOR_TYPE* frame; // Frame buffer address
|
||||||
coord_t width, height; // Frame size in pixels
|
gCoord width, height; // Frame size in pixels
|
||||||
coord_t pitch; // Line pitch, in bytes
|
gCoord pitch; // Line pitch, in bytes
|
||||||
uint16_t fmt; // Pixel format in LTDC format
|
uint16_t fmt; // Pixel format in LTDC format
|
||||||
|
|
||||||
// Window
|
// Window
|
||||||
coord_t x, y; // Start pixel position of the virtual layer
|
gCoord x, y; // Start pixel position of the virtual layer
|
||||||
coord_t cx, cy; // Size of the virtual layer
|
gCoord cx, cy; // Size of the virtual layer
|
||||||
|
|
||||||
uint32_t defcolor; // Default color, ARGB8888
|
uint32_t defcolor; // Default color, ARGB8888
|
||||||
uint32_t keycolor; // Color key, RGB888
|
uint32_t keycolor; // Color key, RGB888
|
||||||
|
@ -66,10 +66,10 @@ typedef struct ltdcLayerConfig {
|
||||||
} ltdcLayerConfig;
|
} ltdcLayerConfig;
|
||||||
|
|
||||||
typedef struct ltdcConfig {
|
typedef struct ltdcConfig {
|
||||||
coord_t width, height; // Screen size
|
gCoord width, height; // Screen size
|
||||||
coord_t hsync, vsync; // Horizontal and Vertical sync pixels
|
gCoord hsync, vsync; // Horizontal and Vertical sync pixels
|
||||||
coord_t hbackporch, vbackporch; // Horizontal and Vertical back porch pixels
|
gCoord hbackporch, vbackporch; // Horizontal and Vertical back porch pixels
|
||||||
coord_t hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels
|
gCoord hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels
|
||||||
uint32_t syncflags; // Sync flags
|
uint32_t syncflags; // Sync flags
|
||||||
uint32_t bgcolor; // Clear screen color RGB888
|
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_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
|
@ -172,7 +172,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
@ -229,7 +229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
@ -239,7 +239,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_90:
|
case GDISP_ROTATE_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -138,7 +138,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
|
@ -177,7 +177,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_PIXELREAD
|
#if GDISP_HARDWARE_PIXELREAD
|
||||||
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
@ -244,7 +244,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
case GDISP_ROTATE_90:
|
case GDISP_ROTATE_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
g->g.Width = g->g.Height;
|
||||||
|
|
|
@ -45,10 +45,10 @@
|
||||||
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0)
|
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0)
|
||||||
|
|
||||||
typedef struct UC1610_Window {
|
typedef struct UC1610_Window {
|
||||||
coord_t x1;
|
gCoord x1;
|
||||||
coord_t y1;
|
gCoord y1;
|
||||||
coord_t x2;
|
gCoord x2;
|
||||||
coord_t y2;
|
gCoord y2;
|
||||||
} UC1610_Window;
|
} UC1610_Window;
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -133,7 +133,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
uint8_t *c;
|
uint8_t *c;
|
||||||
|
|
||||||
// handle orientation
|
// handle orientation
|
||||||
|
@ -170,7 +170,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
#if GDISP_HARDWARE_FLUSH
|
#if GDISP_HARDWARE_FLUSH
|
||||||
LLDSPEC void gdisp_lld_flush(GDisplay* g)
|
LLDSPEC void gdisp_lld_flush(GDisplay* g)
|
||||||
{
|
{
|
||||||
coord_t x1, y1, x2, y2, cx;
|
gCoord x1, y1, x2, y2, cx;
|
||||||
uint8_t *c;
|
uint8_t *c;
|
||||||
|
|
||||||
// Don't flush unless we really need to
|
// Don't flush unless we really need to
|
||||||
|
|
|
@ -309,7 +309,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
|
||||||
#if GDISP_HARDWARE_FLUSH
|
#if GDISP_HARDWARE_FLUSH
|
||||||
LLDSPEC void gdisp_lld_flush(GDisplay* g)
|
LLDSPEC void gdisp_lld_flush(GDisplay* g)
|
||||||
{
|
{
|
||||||
coord_t cy, cx, dx, dy;
|
gCoord cy, cx, dx, dy;
|
||||||
LLDCOLOR_TYPE *fb;
|
LLDCOLOR_TYPE *fb;
|
||||||
UC8173_Private *priv;
|
UC8173_Private *priv;
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g)
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g)
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay* g)
|
||||||
{
|
{
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
UC8173_Private *priv;
|
UC8173_Private *priv;
|
||||||
|
|
||||||
priv = (UC8173_Private *)g->priv;
|
priv = (UC8173_Private *)g->priv;
|
||||||
|
|
|
@ -163,7 +163,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
#if GDISP_HARDWARE_DRAWPIXEL
|
#if GDISP_HARDWARE_DRAWPIXEL
|
||||||
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
switch(g->g.Orientation) {
|
switch(g->g.Orientation) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
typedef struct fbInfo {
|
typedef struct fbInfo {
|
||||||
void * pixels; // The pixel buffer
|
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;
|
} fbInfo;
|
||||||
|
|
||||||
#include "board_framebuffer.h"
|
#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_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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
|
// Only take a reading if exactly one touch contact point
|
||||||
if (read_byte(m, FT5336_TD_STAT_REG) == 1) {
|
if (read_byte(m, FT5336_TD_STAT_REG) == 1) {
|
||||||
// Get and return X, Y an Z values
|
// Get and return X, Y an Z values
|
||||||
pdr->y = (coord_t)(read_word(m, FT5336_P1_XH_REG) & 0x0FFF);
|
pdr->y = (gCoord)(read_word(m, FT5336_P1_XH_REG) & 0x0FFF);
|
||||||
pdr->x = (coord_t)(read_word(m, FT5336_P1_YH_REG) & 0x0FFF);
|
pdr->x = (gCoord)(read_word(m, FT5336_P1_YH_REG) & 0x0FFF);
|
||||||
pdr->z = 1;
|
pdr->z = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||||
if ((read_byte(m, FT5x06_TOUCH_POINTS) & 0x07)) {
|
if ((read_byte(m, FT5x06_TOUCH_POINTS) & 0x07)) {
|
||||||
|
|
||||||
/* Get the X, Y, Z values */
|
/* Get the X, Y, Z values */
|
||||||
pdr->x = (coord_t)(read_word(m, FT5x06_TOUCH1_XH) & 0x0fff);
|
pdr->x = (gCoord)(read_word(m, FT5x06_TOUCH1_XH) & 0x0fff);
|
||||||
pdr->y = (coord_t)read_word(m, FT5x06_TOUCH1_YH);
|
pdr->y = (gCoord)read_word(m, FT5x06_TOUCH1_YH);
|
||||||
pdr->z = 1;
|
pdr->z = 1;
|
||||||
|
|
||||||
// Rescale X,Y if we are using self-calibration
|
// 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)) {
|
if ((read_byte(m, FT6x06_TOUCH_POINTS) & 0x07)) {
|
||||||
|
|
||||||
/* Get the X, Y, Z values */
|
/* Get the X, Y, Z values */
|
||||||
pdr->x = (coord_t)(read_word(m, FT6x06_TOUCH1_XH) & 0x0fff);
|
pdr->x = (gCoord)(read_word(m, FT6x06_TOUCH1_XH) & 0x0fff);
|
||||||
pdr->y = (coord_t)read_word(m, FT6x06_TOUCH1_YH);
|
pdr->y = (gCoord)read_word(m, FT6x06_TOUCH1_YH);
|
||||||
pdr->z = 1;
|
pdr->z = 1;
|
||||||
|
|
||||||
// Rescale X,Y if we are using self-calibration
|
// Rescale X,Y if we are using self-calibration
|
||||||
|
|
|
@ -152,7 +152,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||||
return gTrue;
|
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->x = (uint16_t)(pdr->x) >> 4;
|
||||||
pdr->y = (uint16_t)(pdr->y) >> 4;
|
pdr->y = (uint16_t)(pdr->y) >> 4;
|
||||||
pdr->z = Z_MAX;
|
pdr->z = Z_MAX;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
#include "ugfx/src/ginput/ginput_driver_mouse.h"
|
#include "ugfx/src/ginput/ginput_driver_mouse.h"
|
||||||
|
|
||||||
extern GMouse* qwidgetMouse;
|
extern GMouse* qwidgetMouse;
|
||||||
extern coord_t qwidgetMouseX;
|
extern gCoord qwidgetMouseX;
|
||||||
extern coord_t qwidgetMouseY;
|
extern gCoord qwidgetMouseY;
|
||||||
extern coord_t qwidgetMouseZ;
|
extern gCoord qwidgetMouseZ;
|
||||||
extern uint16_t qwidgetMouseButtons;
|
extern uint16_t qwidgetMouseButtons;
|
||||||
|
|
||||||
MyWidget::MyWidget(QWidget* parent) : QWidget(parent)
|
MyWidget::MyWidget(QWidget* parent) : QWidget(parent)
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
#include "../../../../src/ginput/ginput_driver_mouse.h"
|
#include "../../../../src/ginput/ginput_driver_mouse.h"
|
||||||
|
|
||||||
GMouse* qwidgetMouse;
|
GMouse* qwidgetMouse;
|
||||||
coord_t qwidgetMouseX;
|
gCoord qwidgetMouseX;
|
||||||
coord_t qwidgetMouseY;
|
gCoord qwidgetMouseY;
|
||||||
coord_t qwidgetMouseZ;
|
gCoord qwidgetMouseZ;
|
||||||
uint16_t qwidgetMouseButtons;
|
uint16_t qwidgetMouseButtons;
|
||||||
|
|
||||||
static gBool _init(GMouse* m, unsigned driverinstance)
|
static gBool _init(GMouse* m, unsigned driverinstance)
|
||||||
|
|
|
@ -171,10 +171,10 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Time to get some readings
|
// Time to get some readings
|
||||||
pdr->x = (coord_t)read_word(m, STMPE610_REG_TSC_DATA_X);
|
pdr->x = (gCoord)read_word(m, STMPE610_REG_TSC_DATA_X);
|
||||||
pdr->y = (coord_t)read_word(m, STMPE610_REG_TSC_DATA_Y);
|
pdr->y = (gCoord)read_word(m, STMPE610_REG_TSC_DATA_Y);
|
||||||
#if GMOUSE_STMPE610_READ_PRESSURE
|
#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
|
#else
|
||||||
pdr->z = gmvmt(m)->z_max;
|
pdr->z = gmvmt(m)->z_max;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -171,10 +171,10 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Time to get some readings
|
// Time to get some readings
|
||||||
pdr->x = (coord_t)read_word(m, STMPE811_REG_TSC_DATA_X);
|
pdr->x = (gCoord)read_word(m, STMPE811_REG_TSC_DATA_X);
|
||||||
pdr->y = (coord_t)read_word(m, STMPE811_REG_TSC_DATA_Y);
|
pdr->y = (gCoord)read_word(m, STMPE811_REG_TSC_DATA_Y);
|
||||||
#if GMOUSE_STMPE811_READ_PRESSURE
|
#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
|
#else
|
||||||
pdr->z = gmvmt(m)->z_max;
|
pdr->z = gmvmt(m)->z_max;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -161,7 +161,7 @@ struct SDL_UGFXContext {
|
||||||
int16_t need_redraw;
|
int16_t need_redraw;
|
||||||
int minx,miny,maxx,maxy;
|
int minx,miny,maxx,maxy;
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
coord_t mousex, mousey;
|
gCoord mousex, mousey;
|
||||||
uint16_t buttons;
|
uint16_t buttons;
|
||||||
#endif
|
#endif
|
||||||
#if GINPUT_NEED_KEYBOARD
|
#if GINPUT_NEED_KEYBOARD
|
||||||
|
|
|
@ -442,18 +442,18 @@ typedef struct winPriv {
|
||||||
HBITMAP dcBitmap;
|
HBITMAP dcBitmap;
|
||||||
HBITMAP dcOldBitmap;
|
HBITMAP dcOldBitmap;
|
||||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
||||||
coord_t mousex, mousey;
|
gCoord mousex, mousey;
|
||||||
uint16_t mousebuttons;
|
uint16_t mousebuttons;
|
||||||
GMouse *mouse;
|
GMouse *mouse;
|
||||||
gBool mouseenabled;
|
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
|
#endif
|
||||||
#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
|
#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
|
||||||
uint8_t toggles;
|
uint8_t toggles;
|
||||||
#endif
|
#endif
|
||||||
#if GDISP_HARDWARE_STREAM_WRITE || GDISP_HARDWARE_STREAM_READ
|
#if GDISP_HARDWARE_STREAM_WRITE || GDISP_HARDWARE_STREAM_READ
|
||||||
coord_t x0, y0, x1, y1;
|
gCoord x0, y0, x1, y1;
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
#endif
|
#endif
|
||||||
} winPriv;
|
} winPriv;
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
#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;
|
winPriv * priv;
|
||||||
|
|
||||||
priv = (winPriv *)g->priv;
|
priv = (winPriv *)g->priv;
|
||||||
|
@ -475,7 +475,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) {
|
||||||
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled) {
|
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled) {
|
||||||
((winPriv *)g->priv)->mouseenabled = 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;
|
((winPriv *)g->priv)->capfn = capfn;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -495,7 +495,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
RECT rect;
|
RECT rect;
|
||||||
HGDIOBJ old;
|
HGDIOBJ old;
|
||||||
POINT p;
|
POINT p;
|
||||||
coord_t pos;
|
gCoord pos;
|
||||||
uint8_t bit;
|
uint8_t bit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
// Handle mouse down on the window
|
// Handle mouse down on the window
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
btns |= GINPUT_MOUSE_BTN_LEFT;
|
btns |= GINPUT_MOUSE_BTN_LEFT;
|
||||||
goto mousemove;
|
goto mousemove;
|
||||||
|
@ -535,8 +535,8 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
// Handle mouse down on the toggle area
|
// Handle mouse down on the toggle area
|
||||||
#if GINPUT_NEED_TOGGLE
|
#if GINPUT_NEED_TOGGLE
|
||||||
if ((coord_t)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT && (g->flags & GDISP_FLG_HASTOGGLE)) {
|
if ((gCoord)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT && (g->flags & GDISP_FLG_HASTOGGLE)) {
|
||||||
bit = 1 << ((coord_t)LOWORD(lParam)*8/g->g.Width);
|
bit = 1 << ((gCoord)LOWORD(lParam)*8/g->g.Width);
|
||||||
priv->toggles ^= bit;
|
priv->toggles ^= bit;
|
||||||
rect.left = 0;
|
rect.left = 0;
|
||||||
rect.right = GDISP_SCREEN_WIDTH;
|
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
|
// Handle mouse up on the window
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
btns &= ~GINPUT_MOUSE_BTN_LEFT;
|
btns &= ~GINPUT_MOUSE_BTN_LEFT;
|
||||||
goto mousemove;
|
goto mousemove;
|
||||||
|
@ -589,7 +589,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
priv = (winPriv *)g->priv;
|
priv = (winPriv *)g->priv;
|
||||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
btns |= GINPUT_MOUSE_BTN_MIDDLE;
|
btns |= GINPUT_MOUSE_BTN_MIDDLE;
|
||||||
goto mousemove;
|
goto mousemove;
|
||||||
|
@ -598,7 +598,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
priv = (winPriv *)g->priv;
|
priv = (winPriv *)g->priv;
|
||||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
btns &= ~GINPUT_MOUSE_BTN_MIDDLE;
|
btns &= ~GINPUT_MOUSE_BTN_MIDDLE;
|
||||||
goto mousemove;
|
goto mousemove;
|
||||||
|
@ -607,7 +607,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
priv = (winPriv *)g->priv;
|
priv = (winPriv *)g->priv;
|
||||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
btns |= GINPUT_MOUSE_BTN_RIGHT;
|
btns |= GINPUT_MOUSE_BTN_RIGHT;
|
||||||
goto mousemove;
|
goto mousemove;
|
||||||
|
@ -616,7 +616,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
priv = (winPriv *)g->priv;
|
priv = (winPriv *)g->priv;
|
||||||
if ((coord_t)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
if ((gCoord)HIWORD(lParam) < GDISP_SCREEN_HEIGHT) {
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
btns &= ~GINPUT_MOUSE_BTN_RIGHT;
|
btns &= ~GINPUT_MOUSE_BTN_RIGHT;
|
||||||
goto mousemove;
|
goto mousemove;
|
||||||
|
@ -625,17 +625,17 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
g = (GDisplay *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
priv = (winPriv *)g->priv;
|
priv = (winPriv *)g->priv;
|
||||||
if ((coord_t)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT)
|
if ((gCoord)HIWORD(lParam) >= GDISP_SCREEN_HEIGHT)
|
||||||
break;
|
break;
|
||||||
btns = priv->mousebuttons;
|
btns = priv->mousebuttons;
|
||||||
|
|
||||||
mousemove:
|
mousemove:
|
||||||
if (priv->capfn)
|
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) {
|
if (priv->mouseenabled) {
|
||||||
priv->mousebuttons = btns;
|
priv->mousebuttons = btns;
|
||||||
priv->mousex = (coord_t)LOWORD(lParam);
|
priv->mousex = (gCoord)LOWORD(lParam);
|
||||||
priv->mousey = (coord_t)HIWORD(lParam);
|
priv->mousey = (gCoord)HIWORD(lParam);
|
||||||
if ((gmvmt(priv->mouse)->d.flags & GMOUSE_VFLG_NOPOLL)) // For normal setup this is always true
|
if ((gmvmt(priv->mouse)->d.flags & GMOUSE_VFLG_NOPOLL)) // For normal setup this is always true
|
||||||
_gmouseWakeup(priv->mouse);
|
_gmouseWakeup(priv->mouse);
|
||||||
}
|
}
|
||||||
|
@ -1229,7 +1229,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
pixel_t *dst;
|
pixel_t *dst;
|
||||||
const pixel_t *src;
|
const pixel_t *src;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
coord_t i, j;
|
gCoord i, j;
|
||||||
|
|
||||||
// Allocate the destination buffer
|
// Allocate the destination buffer
|
||||||
sz = (size_t)g->p.cx * (size_t)g->p.cy;
|
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) {
|
LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) {
|
||||||
winPriv * priv;
|
winPriv * priv;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
coord_t lines;
|
gCoord lines;
|
||||||
|
|
||||||
priv = g->priv;
|
priv = g->priv;
|
||||||
|
|
||||||
|
@ -1571,7 +1571,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
// If the self-rotation has been set in the VMT then do that here (TESTING ONLY)
|
// 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
|
if ((gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) { // For normal setup this is always False
|
||||||
coord_t t;
|
gCoord t;
|
||||||
|
|
||||||
switch(gdispGGetOrientation(m->display)) {
|
switch(gdispGGetOrientation(m->display)) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
|
|
|
@ -55,14 +55,14 @@ void gfxEmulatorSetParentWindow(void *hwnd);
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
// This function allows you to inject mouse events into the ugfx mouse driver
|
// 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.
|
// This function enables you to turn on/off normal mouse functions on a ugfx Win32 display window.
|
||||||
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled);
|
void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled);
|
||||||
|
|
||||||
// This function enables you to capture mouse events on a ugfx Win32 display window.
|
// This function enables you to capture mouse events on a ugfx Win32 display window.
|
||||||
// Passing NULL turns off the capture
|
// 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
|
||||||
|
|
||||||
#endif /* GFX_USE_GDISP */
|
#endif /* GFX_USE_GDISP */
|
||||||
|
|
|
@ -181,7 +181,7 @@ typedef struct xPriv {
|
||||||
GC gc;
|
GC gc;
|
||||||
Window win;
|
Window win;
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
coord_t mousex, mousey;
|
gCoord mousex, mousey;
|
||||||
uint16_t buttons;
|
uint16_t buttons;
|
||||||
GMouse * mouse;
|
GMouse * mouse;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -159,7 +159,7 @@ typedef struct netPriv {
|
||||||
unsigned databytes; // How many bytes have been read
|
unsigned databytes; // How many bytes have been read
|
||||||
uint16_t data[2]; // Buffer for storing data read.
|
uint16_t data[2]; // Buffer for storing data read.
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
coord_t mousex, mousey;
|
gCoord mousex, mousey;
|
||||||
uint16_t mousebuttons;
|
uint16_t mousebuttons;
|
||||||
GMouse * mouse;
|
GMouse * mouse;
|
||||||
#endif
|
#endif
|
||||||
|
@ -540,7 +540,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
netPriv * priv;
|
netPriv * priv;
|
||||||
pixel_t * buffer;
|
pixel_t * buffer;
|
||||||
uint16_t buf[5];
|
uint16_t buf[5];
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
||||||
if (!(g->flags & GDISP_FLG_CONNECTED))
|
if (!(g->flags & GDISP_FLG_CONNECTED))
|
||||||
|
|
|
@ -119,7 +119,7 @@ typedef struct netPriv {
|
||||||
unsigned databytes; // How many bytes have been read
|
unsigned databytes; // How many bytes have been read
|
||||||
uint16_t data[2]; // Buffer for storing data read.
|
uint16_t data[2]; // Buffer for storing data read.
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
coord_t mousex, mousey;
|
gCoord mousex, mousey;
|
||||||
uint16_t mousebuttons;
|
uint16_t mousebuttons;
|
||||||
GMouse * mouse;
|
GMouse * mouse;
|
||||||
#endif
|
#endif
|
||||||
|
@ -423,7 +423,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
netPriv * priv;
|
netPriv * priv;
|
||||||
pixel_t * buffer;
|
pixel_t * buffer;
|
||||||
uint16_t buf[5];
|
uint16_t buf[5];
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
#if GDISP_DONT_WAIT_FOR_NET_DISPLAY
|
||||||
if (!(g->flags & GDISP_FLG_CONNECTED))
|
if (!(g->flags & GDISP_FLG_CONNECTED))
|
||||||
|
|
|
@ -70,7 +70,7 @@ GDisplay *GDISP;
|
||||||
|
|
||||||
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
|
#if GDISP_HARDWARE_STREAM_POS && GDISP_HARDWARE_STREAM_WRITE
|
||||||
static GFXINLINE void setglobalwindow(GDisplay *g) {
|
static GFXINLINE void setglobalwindow(GDisplay *g) {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
x = g->p.x; y = g->p.y;
|
x = g->p.x; y = g->p.y;
|
||||||
g->p.x = g->p.y = 0;
|
g->p.x = g->p.y = 0;
|
||||||
g->p.cx = g->g.Width; g->p.cy = g->g.Height;
|
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)
|
// if (gvmt(g)->pixel)
|
||||||
//#endif
|
//#endif
|
||||||
{
|
{
|
||||||
coord_t x0, y0, x1, y1;
|
gCoord x0, y0, x1, y1;
|
||||||
|
|
||||||
x0 = g->p.x;
|
x0 = g->p.x;
|
||||||
y0 = g->p.y;
|
y0 = g->p.y;
|
||||||
|
@ -503,9 +503,9 @@ static void line_clip(GDisplay *g) {
|
||||||
#if GDISP_STARTUP_LOGO_TIMEOUT > 0
|
#if GDISP_STARTUP_LOGO_TIMEOUT > 0
|
||||||
static gBool gdispInitDone;
|
static gBool gdispInitDone;
|
||||||
static void StartupLogoDisplay(GDisplay *g) {
|
static void StartupLogoDisplay(GDisplay *g) {
|
||||||
coord_t x, y, w;
|
gCoord x, y, w;
|
||||||
const coord_t * p;
|
const gCoord * p;
|
||||||
static const coord_t blks[] = {
|
static const gCoord blks[] = {
|
||||||
// u
|
// u
|
||||||
2, 6, 1, 10,
|
2, 6, 1, 10,
|
||||||
3, 11, 4, 1,
|
3, 11, 4, 1,
|
||||||
|
@ -709,8 +709,8 @@ unsigned gdispGetDisplayCount(void) {
|
||||||
return gdriverInstanceCount(GDRIVER_TYPE_DISPLAY);
|
return gdriverInstanceCount(GDRIVER_TYPE_DISPLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t gdispGGetWidth(GDisplay *g) { return g->g.Width; }
|
gCoord gdispGGetWidth(GDisplay *g) { return g->g.Width; }
|
||||||
coord_t gdispGGetHeight(GDisplay *g) { return g->g.Height; }
|
gCoord gdispGGetHeight(GDisplay *g) { return g->g.Height; }
|
||||||
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
|
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
|
||||||
orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; }
|
orientation_t gdispGGetOrientation(GDisplay *g) { return g->g.Orientation; }
|
||||||
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
|
uint8_t gdispGGetBacklight(GDisplay *g) { return g->g.Backlight; }
|
||||||
|
@ -732,7 +732,7 @@ void gdispGFlush(GDisplay *g) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GDISP_NEED_STREAMING
|
#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);
|
MUTEX_ENTER(g);
|
||||||
|
|
||||||
#if NEED_CLIPPING
|
#if NEED_CLIPPING
|
||||||
|
@ -794,7 +794,7 @@ void gdispGFlush(GDisplay *g) {
|
||||||
|
|
||||||
void gdispGStreamColor(GDisplay *g, color_t color) {
|
void gdispGStreamColor(GDisplay *g, color_t color) {
|
||||||
#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
|
#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
|
||||||
coord_t sx1, sy1;
|
gCoord sx1, sy1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Don't touch the mutex as we should already own it
|
// Don't touch the mutex as we should already own it
|
||||||
|
@ -978,7 +978,7 @@ void gdispGFlush(GDisplay *g) {
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
MUTEX_ENTER(g);
|
||||||
g->p.x = x;
|
g->p.x = x;
|
||||||
g->p.y = y;
|
g->p.y = y;
|
||||||
|
@ -988,7 +988,7 @@ void gdispGDrawPixel(GDisplay *g, coord_t x, coord_t y, color_t color) {
|
||||||
MUTEX_EXIT(g);
|
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);
|
MUTEX_ENTER(g);
|
||||||
g->p.x = x0;
|
g->p.x = x0;
|
||||||
g->p.y = y0;
|
g->p.y = y0;
|
||||||
|
@ -1083,7 +1083,7 @@ void gdispGClear(GDisplay *g, color_t color) {
|
||||||
#endif
|
#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);
|
MUTEX_ENTER(g);
|
||||||
g->p.x = x;
|
g->p.x = x;
|
||||||
g->p.y = y;
|
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);
|
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);
|
MUTEX_ENTER(g);
|
||||||
|
|
||||||
#if NEED_CLIPPING
|
#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
|
#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);
|
MUTEX_ENTER(g);
|
||||||
|
|
||||||
// Best is using hardware clipping
|
// 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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_CIRCLE
|
#if GDISP_NEED_CIRCLE
|
||||||
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) {
|
||||||
coord_t a, b, P;
|
gCoord a, b, P;
|
||||||
|
|
||||||
MUTEX_ENTER(g);
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_CIRCLE
|
#if GDISP_NEED_CIRCLE
|
||||||
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) {
|
||||||
coord_t a, b, P;
|
gCoord a, b, P;
|
||||||
|
|
||||||
MUTEX_ENTER(g);
|
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)
|
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)
|
#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) {
|
void gdispGFillDualCircle(GDisplay *g, gCoord x, gCoord y, gCoord radius1, color_t color1, gCoord radius2, color_t color2) {
|
||||||
coord_t a, b1, b2, p1, p2;
|
gCoord a, b1, b2, p1, p2;
|
||||||
|
|
||||||
MUTEX_ENTER(g);
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ELLIPSE
|
#if GDISP_NEED_ELLIPSE
|
||||||
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) {
|
||||||
coord_t dx, dy;
|
gCoord dx, dy;
|
||||||
int32_t a2, b2;
|
int32_t a2, b2;
|
||||||
int32_t err, e2;
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ELLIPSE
|
#if GDISP_NEED_ELLIPSE
|
||||||
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) {
|
||||||
coord_t dx, dy;
|
gCoord dx, dy;
|
||||||
int32_t a2, b2;
|
int32_t a2, b2;
|
||||||
int32_t err, e2;
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARCSECTORS
|
#if GDISP_NEED_ARCSECTORS
|
||||||
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) {
|
||||||
coord_t a, b, P;
|
gCoord a, b, P;
|
||||||
|
|
||||||
MUTEX_ENTER(g);
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARCSECTORS
|
#if GDISP_NEED_ARCSECTORS
|
||||||
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) {
|
||||||
coord_t a, b, P;
|
gCoord a, b, P;
|
||||||
|
|
||||||
MUTEX_ENTER(g);
|
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>
|
#include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void gdispGDrawArc(GDisplay *g, coord_t x, coord_t y, coord_t radius, coord_t start, coord_t end, color_t color) {
|
void gdispGDrawArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
|
||||||
coord_t a, b, P, sedge, eedge;
|
gCoord a, b, P, sedge, eedge;
|
||||||
uint8_t full, sbit, ebit, tbit;
|
uint8_t full, sbit, ebit, tbit;
|
||||||
|
|
||||||
// Normalize the angles
|
// 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>
|
#include <math.h>
|
||||||
#endif
|
#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) {
|
void gdispGDrawThickArc(GDisplay *g, gCoord xc, gCoord yc, gCoord radiusStart, gCoord radiusEnd, gCoord start, gCoord end, color_t color) {
|
||||||
coord_t x, y, d, r;
|
gCoord x, y, d, r;
|
||||||
coord_t startTan, endTan, curangle;
|
gCoord startTan, endTan, curangle;
|
||||||
coord_t precision = 512;
|
gCoord precision = 512;
|
||||||
|
|
||||||
// Normalize the angles
|
// Normalize the angles
|
||||||
if (start < 0)
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARC
|
#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) {
|
void gdispGFillArc(GDisplay *g, gCoord x, gCoord y, gCoord radius, gCoord start, gCoord end, color_t color) {
|
||||||
coord_t a, b, P;
|
gCoord a, b, P;
|
||||||
coord_t sy, ey;
|
gCoord sy, ey;
|
||||||
fixed sxa, sxb, sxd, exa, exb, exd;
|
fixed sxa, sxb, sxd, exa, exb, exd;
|
||||||
uint8_t qtr;
|
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
|
// 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()
|
// 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;
|
sxa = exa = FIXED(x) + FIXED0_5;
|
||||||
|
|
||||||
// Do the trig to get the formulas for the start and end lines.
|
// 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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
|
#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) {
|
if (2*radius > cx || 2*radius > cy) {
|
||||||
gdispGDrawBox(g, x, y, cx, cy, color);
|
gdispGDrawBox(g, x, y, cx, cy, color);
|
||||||
return;
|
return;
|
||||||
|
@ -2559,8 +2559,8 @@ void gdispGBlitArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARC || GDISP_NEED_ARCSECTORS
|
#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) {
|
void gdispGFillRoundedBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord radius, color_t color) {
|
||||||
coord_t radius2;
|
gCoord radius2;
|
||||||
|
|
||||||
radius2 = radius*2;
|
radius2 = radius*2;
|
||||||
if (radius2 > cx || radius2 > cy) {
|
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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_PIXELREAD
|
#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;
|
color_t c;
|
||||||
|
|
||||||
/* Always synchronous as it must return a value */
|
/* 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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_SCROLL
|
#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) {
|
void gdispGVerticalScroll(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, int lines, color_t bgcolor) {
|
||||||
coord_t abslines;
|
gCoord abslines;
|
||||||
#if GDISP_HARDWARE_SCROLL != GFXON
|
#if GDISP_HARDWARE_SCROLL != GFXON
|
||||||
coord_t fy, dy, ix, fx, i, j;
|
gCoord fy, dy, ix, fx, i, j;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!lines) return;
|
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;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
MUTEX_ENTER(g);
|
MUTEX_ENTER(g);
|
||||||
g->p.x = (coord_t)what;
|
g->p.x = (gCoord)what;
|
||||||
res = gdisp_lld_query(g);
|
res = gdisp_lld_query(g);
|
||||||
MUTEX_EXIT(g);
|
MUTEX_EXIT(g);
|
||||||
return res;
|
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. */
|
/* 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;
|
if (cx <= 0 || cy <= 0) return;
|
||||||
cx = x+cx-1; cy = y+cy-1; // cx, cy are now the end point.
|
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
|
#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;
|
const gPoint *epnt, *p;
|
||||||
|
|
||||||
epnt = &pntarray[cnt-1];
|
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);
|
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;
|
const gPoint *lpnt, *rpnt, *epnts;
|
||||||
fixed lx, rx, lk, rk;
|
fixed lx, rx, lk, rk;
|
||||||
coord_t y, ymax, lxc, rxc;
|
gCoord y, ymax, lxc, rxc;
|
||||||
|
|
||||||
epnts = &pntarray[cnt-1];
|
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
|
/* Find a vector (nx, ny) that is perpendicular to (dx, dy) and has length
|
||||||
* equal to 'norm'. */
|
* 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;
|
int32_t len_n, len, len2;
|
||||||
char maxSteps;
|
char maxSteps;
|
||||||
|
|
||||||
|
@ -3150,8 +3150,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
return;
|
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) {
|
void gdispGDrawThickLine(GDisplay *g, gCoord x0, gCoord y0, gCoord x1, gCoord y1, color_t color, gCoord width, gBool round) {
|
||||||
coord_t dx, dy, nx = 0, ny = 0;
|
gCoord dx, dy, nx = 0, ny = 0;
|
||||||
|
|
||||||
/* Compute the direction vector for the line */
|
/* Compute the direction vector for the line */
|
||||||
dx = x1 - x0;
|
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
|
* pt0 -------------------pt7
|
||||||
*/
|
*/
|
||||||
gPoint pntarray[8];
|
gPoint pntarray[8];
|
||||||
coord_t nx2, ny2;
|
gCoord nx2, ny2;
|
||||||
|
|
||||||
/* Magic numbers:
|
/* Magic numbers:
|
||||||
* 75/256 = sin(45) / (1 + sqrt(2)) diagonal octagon segments
|
* 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) line;
|
||||||
(void) count;
|
(void) count;
|
||||||
|
|
||||||
((coord_t*)state)[0]++;
|
((gCoord*)state)[0]++;
|
||||||
return gTrue;
|
return gTrue;
|
||||||
}
|
}
|
||||||
static gBool mf_drawline_callback(mf_str line, uint16_t count, void *state) {
|
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
|
#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)
|
if (!font)
|
||||||
return;
|
return;
|
||||||
MUTEX_ENTER(g);
|
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);
|
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)
|
if (!font)
|
||||||
return;
|
return;
|
||||||
MUTEX_ENTER(g);
|
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);
|
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)
|
if (!font)
|
||||||
return;
|
return;
|
||||||
MUTEX_ENTER(g);
|
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);
|
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)
|
if (!font)
|
||||||
return;
|
return;
|
||||||
MUTEX_ENTER(g);
|
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);
|
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) {
|
void gdispGDrawStringBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, const char* str, font_t font, color_t color, justify_t justify) {
|
||||||
coord_t totalHeight;
|
gCoord totalHeight;
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
return;
|
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);
|
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) {
|
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) {
|
||||||
coord_t totalHeight;
|
gCoord totalHeight;
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
return;
|
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);
|
MUTEX_EXIT(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t gdispGetFontMetric(font_t font, fontmetric_t metric) {
|
gCoord gdispGetFontMetric(font_t font, fontmetric_t metric) {
|
||||||
if (!font)
|
if (!font)
|
||||||
return 0;
|
return 0;
|
||||||
/* No mutex required as we only read static data */
|
/* 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t gdispGetCharWidth(char c, font_t font) {
|
gCoord gdispGetCharWidth(char c, font_t font) {
|
||||||
if (!font)
|
if (!font)
|
||||||
return 0;
|
return 0;
|
||||||
/* No mutex required as we only read static data */
|
/* No mutex required as we only read static data */
|
||||||
return mf_character_width(font, c);
|
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)
|
if (!str || !font)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -3644,7 +3644,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t gdispGetStringWidth(const char* str, font_t font) {
|
gCoord gdispGetStringWidth(const char* str, font_t font) {
|
||||||
return gdispGetStringWidthCount(str, font, 0);
|
return gdispGetStringWidthCount(str, font, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3732,7 +3732,7 @@ color_t gdispContrastColor(color_t color) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (!defined(gdispPackPixels) && !defined(GDISP_PIXELFORMAT_CUSTOM))
|
#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 */
|
/* No mutex required as we only read static data */
|
||||||
#if defined(GDISP_PIXELFORMAT_RGB888)
|
#if defined(GDISP_PIXELFORMAT_RGB888)
|
||||||
#error "GDISP: Packed pixels not supported yet"
|
#error "GDISP: Packed pixels not supported yet"
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief The type for a coordinate or length on the screen.
|
* @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__)
|
#if GFX_USE_GDISP || defined(__DOXYGEN__)
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ typedef int16_t coord_t;
|
||||||
* @brief Type for a 2D point on the screen.
|
* @brief Type for a 2D point on the screen.
|
||||||
*/
|
*/
|
||||||
typedef struct gPoint {
|
typedef struct gPoint {
|
||||||
coord_t x; /**< The x coordinate of the point. */
|
gCoord x; /**< The x coordinate of the point. */
|
||||||
coord_t y; /**< The y coordinate of the point. */
|
gCoord y; /**< The y coordinate of the point. */
|
||||||
} gPoint;
|
} gPoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -298,7 +298,7 @@ unsigned gdispGetDisplayCount(void);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
coord_t gdispGGetWidth(GDisplay *g);
|
gCoord gdispGGetWidth(GDisplay *g);
|
||||||
#define gdispGetWidth() gdispGGetWidth(GDISP)
|
#define gdispGetWidth() gdispGGetWidth(GDISP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -310,7 +310,7 @@ coord_t gdispGGetWidth(GDisplay *g);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
coord_t gdispGGetHeight(GDisplay *g);
|
gCoord gdispGGetHeight(GDisplay *g);
|
||||||
#define gdispGetHeight() gdispGGetHeight(GDISP)
|
#define gdispGetHeight() gdispGGetHeight(GDISP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -404,7 +404,7 @@ void gdispGClear(GDisplay *g, color_t color);
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#define gdispDrawBox(x,y,cx,cy,c) gdispGDrawBox(GDISP,x,y,cx,cy,c)
|
||||||
|
|
||||||
/* Streaming Functions */
|
/* Streaming Functions */
|
||||||
|
@ -495,7 +495,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#define gdispSetClip(x,y,cx,cy) gdispGSetClip(GDISP,x,y,cx,cy)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#define gdispFillCircle(x,y,r,c) gdispGFillCircle(GDISP,x,y,r,c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -593,7 +593,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#define gdispFillDualCircle(x,y,r1,c1,r2,c2) gdispGFillDualCircle(GDISP,x,y,r1,c1,r2,c2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#define gdispFillEllipse(x,y,a,b,c) gdispGFillEllipse(GDISP,x,y,a,b,c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -657,7 +657,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#define gdispFillArcSectors(x,y,r,s,c) gdispGFillArcSectors(GDISP,x,y,r,s,c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -713,7 +713,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#define gdispFillArc(x,y,r,s,e,c) gdispGFillArc(GDISP,x,y,r,s,e,c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -780,7 +780,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#define gdispGetPixelColor(x,y) gdispGGetPixelColor(GDISP,x,y)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#define gdispVerticalScroll(x,y,cx,cy,l,b) gdispGVerticalScroll(GDISP,x,y,cx,cy,l,b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -855,7 +855,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#define gdispDrawThickLine(x0,y0,x1,y1,c,w,r) gdispGDrawThickLine(GDISP,x0,y0,x1,y1,c,w,r)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -917,7 +917,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
*
|
*
|
||||||
* @api
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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)
|
#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
|
* @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.
|
* @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
|
* @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.
|
* @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
|
* @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.
|
* @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
|
* @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.
|
* @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
|
* @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)
|
#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
|
* @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)
|
#define gdispFillRoundedBox(x,y,cx,cy,r,c) gdispGFillRoundedBox(GDISP,x,y,cx,cy,r,c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1230,6 +1230,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
|
||||||
|
|
||||||
/* V2 compatibility */
|
/* V2 compatibility */
|
||||||
#if GFX_COMPAT_V2
|
#if GFX_COMPAT_V2
|
||||||
|
typedef gCoord coord_t;
|
||||||
typedef gPoint point, point_t;
|
typedef gPoint point, point_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@
|
||||||
*
|
*
|
||||||
* @api
|
* @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
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -318,8 +318,8 @@ struct GDisplay {
|
||||||
#define gvmt(g) ((const GDISPVMT const *)((g)->d.vmt)) // For ease of access to the vmt member
|
#define gvmt(g) ((const GDISPVMT const *)((g)->d.vmt)) // For ease of access to the vmt member
|
||||||
|
|
||||||
struct GDISPControl {
|
struct GDISPControl {
|
||||||
coord_t Width;
|
gCoord Width;
|
||||||
coord_t Height;
|
gCoord Height;
|
||||||
orientation_t Orientation;
|
orientation_t Orientation;
|
||||||
powermode_t Powermode;
|
powermode_t Powermode;
|
||||||
uint8_t Backlight;
|
uint8_t Backlight;
|
||||||
|
@ -343,16 +343,16 @@ struct GDisplay {
|
||||||
|
|
||||||
// Software clipping
|
// Software clipping
|
||||||
#if GDISP_HARDWARE_CLIP != GFXON && (GDISP_NEED_CLIP || GDISP_NEED_VALIDATION)
|
#if GDISP_HARDWARE_CLIP != GFXON && (GDISP_NEED_CLIP || GDISP_NEED_VALIDATION)
|
||||||
coord_t clipx0, clipy0;
|
gCoord clipx0, clipy0;
|
||||||
coord_t clipx1, clipy1; /* not inclusive */
|
gCoord clipx1, clipy1; /* not inclusive */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Driver call parameters
|
// Driver call parameters
|
||||||
struct {
|
struct {
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
coord_t cx, cy;
|
gCoord cx, cy;
|
||||||
coord_t x1, y1;
|
gCoord x1, y1;
|
||||||
coord_t x2, y2;
|
gCoord x2, y2;
|
||||||
color_t color;
|
color_t color;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
} p;
|
} p;
|
||||||
|
@ -365,10 +365,10 @@ struct GDisplay {
|
||||||
font_t font;
|
font_t font;
|
||||||
color_t color;
|
color_t color;
|
||||||
color_t bgcolor;
|
color_t bgcolor;
|
||||||
coord_t clipx0, clipy0;
|
gCoord clipx0, clipy0;
|
||||||
coord_t clipx1, clipy1;
|
gCoord clipx1, clipy1;
|
||||||
#if GDISP_NEED_TEXT_WORDWRAP
|
#if GDISP_NEED_TEXT_WORDWRAP
|
||||||
coord_t wrapx, wrapy;
|
gCoord wrapx, wrapy;
|
||||||
justify_t lrj;
|
justify_t lrj;
|
||||||
#endif
|
#endif
|
||||||
} t;
|
} t;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
extern gdispImageError gdispImageOpen_NATIVE(gdispImage *img);
|
extern gdispImageError gdispImageOpen_NATIVE(gdispImage *img);
|
||||||
extern void gdispImageClose_NATIVE(gdispImage *img);
|
extern void gdispImageClose_NATIVE(gdispImage *img);
|
||||||
extern gdispImageError gdispImageCache_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);
|
extern delaytime_t gdispImageNext_NATIVE(gdispImage *img);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
extern gdispImageError gdispImageOpen_GIF(gdispImage *img);
|
extern gdispImageError gdispImageOpen_GIF(gdispImage *img);
|
||||||
extern void gdispImageClose_GIF(gdispImage *img);
|
extern void gdispImageClose_GIF(gdispImage *img);
|
||||||
extern gdispImageError gdispImageCache_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);
|
extern delaytime_t gdispImageNext_GIF(gdispImage *img);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
extern gdispImageError gdispImageOpen_BMP(gdispImage *img);
|
extern gdispImageError gdispImageOpen_BMP(gdispImage *img);
|
||||||
extern void gdispImageClose_BMP(gdispImage *img);
|
extern void gdispImageClose_BMP(gdispImage *img);
|
||||||
extern gdispImageError gdispImageCache_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 delaytime_t gdispImageNext_BMP(gdispImage *img);
|
||||||
extern uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img);
|
extern uint16_t gdispImageGetPaletteSize_BMP(gdispImage *img);
|
||||||
extern color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index);
|
extern color_t gdispImageGetPalette_BMP(gdispImage *img, uint16_t index);
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
extern gdispImageError gdispImageOpen_JPG(gdispImage *img);
|
extern gdispImageError gdispImageOpen_JPG(gdispImage *img);
|
||||||
extern void gdispImageClose_JPG(gdispImage *img);
|
extern void gdispImageClose_JPG(gdispImage *img);
|
||||||
extern gdispImageError gdispImageCache_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);
|
extern delaytime_t gdispImageNext_JPG(gdispImage *img);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
extern gdispImageError gdispImageOpen_PNG(gdispImage *img);
|
extern gdispImageError gdispImageOpen_PNG(gdispImage *img);
|
||||||
extern void gdispImageClose_PNG(gdispImage *img);
|
extern void gdispImageClose_PNG(gdispImage *img);
|
||||||
extern gdispImageError gdispImageCache_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);
|
extern delaytime_t gdispImageNext_PNG(gdispImage *img);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ typedef struct gdispImageHandlers {
|
||||||
gdispImageError (*cache)(gdispImage *img); /* The cache function */
|
gdispImageError (*cache)(gdispImage *img); /* The cache function */
|
||||||
gdispImageError (*draw)(GDisplay *g,
|
gdispImageError (*draw)(GDisplay *g,
|
||||||
gdispImage *img,
|
gdispImage *img,
|
||||||
coord_t x, coord_t y,
|
gCoord x, gCoord y,
|
||||||
coord_t cx, coord_t cy,
|
gCoord cx, gCoord cy,
|
||||||
coord_t sx, coord_t sy); /* The draw function */
|
gCoord sx, gCoord sy); /* The draw function */
|
||||||
delaytime_t (*next)(gdispImage *img); /* The next frame function */
|
delaytime_t (*next)(gdispImage *img); /* The next frame function */
|
||||||
uint16_t (*getPaletteSize)(gdispImage *img); /* Retrieve the size of the palette (number of entries) */
|
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 */
|
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);
|
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) return GDISP_IMAGE_ERR_NULLPOINTER;
|
||||||
if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT;
|
if (!img->fns) return GDISP_IMAGE_ERR_BADFORMAT;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ typedef struct gdispImage {
|
||||||
gdispImageType type; /* @< The image type */
|
gdispImageType type; /* @< The image type */
|
||||||
gdispImageFlags flags; /* @< The image flags */
|
gdispImageFlags flags; /* @< The image flags */
|
||||||
color_t bgcolor; /* @< The default background color */
|
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 */
|
GFILE * f; /* @< The underlying GFILE */
|
||||||
#if GDISP_NEED_IMAGE_ACCOUNTING
|
#if GDISP_NEED_IMAGE_ACCOUNTING
|
||||||
uint32_t memused; /* @< How much RAM is currently allocated */
|
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
|
* is drawing. This may be significantly slower than if the image has been cached (but
|
||||||
* uses a lot less RAM)
|
* 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)
|
#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
|
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;
|
gdispImagePrivate_BMP * priv;
|
||||||
color_t * pc;
|
color_t * pc;
|
||||||
coord_t len;
|
gCoord len;
|
||||||
|
|
||||||
priv = (gdispImagePrivate_BMP *)img->priv;
|
priv = (gdispImagePrivate_BMP *)img->priv;
|
||||||
pc = priv->buf;
|
pc = priv->buf;
|
||||||
|
@ -695,7 +695,7 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) {
|
||||||
gdispImagePrivate_BMP * priv;
|
gdispImagePrivate_BMP * priv;
|
||||||
color_t * pcs;
|
color_t * pcs;
|
||||||
color_t * pcd;
|
color_t * pcd;
|
||||||
coord_t pos, x, y;
|
gCoord pos, x, y;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* If we are already cached - just return OK */
|
/* If we are already cached - just return OK */
|
||||||
|
@ -749,10 +749,10 @@ gdispImageError gdispImageCache_BMP(gdispImage *img) {
|
||||||
return GDISP_IMAGE_ERR_OK;
|
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;
|
gdispImagePrivate_BMP * priv;
|
||||||
coord_t mx, my;
|
gCoord mx, my;
|
||||||
coord_t pos, len, st;
|
gCoord pos, len, st;
|
||||||
|
|
||||||
priv = (gdispImagePrivate_BMP *)img->priv;
|
priv = (gdispImagePrivate_BMP *)img->priv;
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ typedef struct gifimgdecode {
|
||||||
|
|
||||||
// The data on a single frame
|
// The data on a single frame
|
||||||
typedef struct gifimgframe {
|
typedef struct gifimgframe {
|
||||||
coord_t x, y; // position relative to full image
|
gCoord x, y; // position relative to full image
|
||||||
coord_t width, height; // size of frame
|
gCoord width, height; // size of frame
|
||||||
uint16_t delay; // delay after processing
|
uint16_t delay; // delay after processing
|
||||||
uint8_t flags; // Local flags
|
uint8_t flags; // Local flags
|
||||||
#define GIFL_TRANSPARENT 0x01 // There exists a transparent color
|
#define GIFL_TRANSPARENT 0x01 // There exists a transparent color
|
||||||
|
@ -80,8 +80,8 @@ typedef struct gifimgcache {
|
||||||
typedef struct gifimgdispose {
|
typedef struct gifimgdispose {
|
||||||
uint8_t flags; // Frame flags
|
uint8_t flags; // Frame flags
|
||||||
uint8_t paltrans; // Transparency
|
uint8_t paltrans; // Transparency
|
||||||
coord_t x, y; // position relative to full image
|
gCoord x, y; // position relative to full image
|
||||||
coord_t width, height; // size of dispose area
|
gCoord width, height; // size of dispose area
|
||||||
} gifimgdispose;
|
} gifimgdispose;
|
||||||
|
|
||||||
typedef struct gdispImagePrivate_GIF {
|
typedef struct gdispImagePrivate_GIF {
|
||||||
|
@ -601,7 +601,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) {
|
||||||
gifimgdecode * decode;
|
gifimgdecode * decode;
|
||||||
uint8_t * p;
|
uint8_t * p;
|
||||||
uint8_t * q;
|
uint8_t * q;
|
||||||
coord_t mx, my;
|
gCoord mx, my;
|
||||||
uint16_t cnt;
|
uint16_t cnt;
|
||||||
|
|
||||||
/* If we are already cached - just return OK */
|
/* If we are already cached - just return OK */
|
||||||
|
@ -766,11 +766,11 @@ baddatacleanup:
|
||||||
return GDISP_IMAGE_ERR_BADDATA;
|
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;
|
gdispImagePrivate_GIF * priv;
|
||||||
gifimgdecode * decode;
|
gifimgdecode * decode;
|
||||||
uint8_t * q = 0;
|
uint8_t * q = 0;
|
||||||
coord_t mx, my, fx, fy;
|
gCoord mx, my, fx, fy;
|
||||||
uint16_t cnt, gcnt;
|
uint16_t cnt, gcnt;
|
||||||
uint8_t col;
|
uint8_t col;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#define JD_WORKSZ (JD_SZBUF+2580+8) /* The extra 8 bytes just for safety */
|
#define JD_WORKSZ (JD_SZBUF+2580+8) /* The extra 8 bytes just for safety */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
coord_t left, right, top, bottom;
|
gCoord left, right, top, bottom;
|
||||||
} JRECT;
|
} JRECT;
|
||||||
/* Decompressor object structure */
|
/* Decompressor object structure */
|
||||||
typedef struct JDEC {
|
typedef struct JDEC {
|
||||||
|
@ -134,7 +134,7 @@ static unsigned gdispImage_JPG_WriteToCache(gdispImage *img, void *bitmap, JRECT
|
||||||
gdispImagePrivate_JPG *priv;
|
gdispImagePrivate_JPG *priv;
|
||||||
uint8_t *in;
|
uint8_t *in;
|
||||||
pixel_t *out;
|
pixel_t *out;
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
|
|
||||||
priv = (gdispImagePrivate_JPG *)img->priv;
|
priv = (gdispImagePrivate_JPG *)img->priv;
|
||||||
in = (unsigned char *)bitmap;
|
in = (unsigned char *)bitmap;
|
||||||
|
@ -176,7 +176,7 @@ gdispImageError gdispImageCache_JPG(gdispImage *img) {
|
||||||
return r;
|
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;
|
gdispImagePrivate_JPG * priv;
|
||||||
|
|
||||||
priv = (gdispImagePrivate_JPG *)img->priv;
|
priv = (gdispImagePrivate_JPG *)img->priv;
|
||||||
|
|
|
@ -93,8 +93,8 @@ gdispImageError gdispImageCache_NATIVE(gdispImage *img) {
|
||||||
return GDISP_IMAGE_ERR_OK;
|
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) {
|
gdispImageError gdispGImageDraw_NATIVE(GDisplay *g, gdispImage *img, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord sx, gCoord sy) {
|
||||||
coord_t mx, mcx;
|
gCoord mx, mcx;
|
||||||
size_t pos, len;
|
size_t pos, len;
|
||||||
gdispImagePrivate_NATIVE * priv;
|
gdispImagePrivate_NATIVE * priv;
|
||||||
|
|
||||||
|
|
|
@ -65,10 +65,10 @@ typedef struct PNG_input {
|
||||||
// Handle the display output and windowing
|
// Handle the display output and windowing
|
||||||
typedef struct PNG_output {
|
typedef struct PNG_output {
|
||||||
GDisplay *g;
|
GDisplay *g;
|
||||||
coord_t x, y;
|
gCoord x, y;
|
||||||
coord_t cx, cy;
|
gCoord cx, cy;
|
||||||
coord_t sx, sy;
|
gCoord sx, sy;
|
||||||
coord_t ix, iy;
|
gCoord ix, iy;
|
||||||
unsigned cnt;
|
unsigned cnt;
|
||||||
pixel_t buf[GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE];
|
pixel_t buf[GDISP_IMAGE_PNG_BLIT_BUFFER_SIZE];
|
||||||
} PNG_output;
|
} PNG_output;
|
||||||
|
@ -198,7 +198,7 @@ static uint8_t PNG_iGetByte(PNG_decode *d) {
|
||||||
*---------------------------------------------------------------*/
|
*---------------------------------------------------------------*/
|
||||||
|
|
||||||
// Initialize the display output window
|
// 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->g = g;
|
||||||
o->x = x;
|
o->x = x;
|
||||||
o->y = y;
|
o->y = y;
|
||||||
|
@ -222,7 +222,7 @@ static void PNG_oFlush(PNG_output *o) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start a new image line
|
// 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)
|
if (y < o->sy || y >= o->sy+o->cy)
|
||||||
return gFalse;
|
return gFalse;
|
||||||
o->ix = 0;
|
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
|
// Feed a pixel color to the display buffer
|
||||||
static void PNG_oColor(PNG_output *o, color_t c) {
|
static void PNG_oColor(PNG_output *o, color_t c) {
|
||||||
// Is it in the window
|
// 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
|
// No - just skip the pixel
|
||||||
PNG_oFlush(o);
|
PNG_oFlush(o);
|
||||||
o->ix++;
|
o->ix++;
|
||||||
|
@ -1497,7 +1497,7 @@ exit_nonmem:
|
||||||
return GDISP_IMAGE_ERR_NOMEMORY;
|
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_info *pinfo;
|
||||||
PNG_decode *d;
|
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.
|
color_t pixels[1]; // We really want pixels[0] but some compilers don't allow that even though it is C standard.
|
||||||
} pixmap;
|
} pixmap;
|
||||||
|
|
||||||
GDisplay *gdispPixmapCreate(coord_t width, coord_t height) {
|
GDisplay *gdispPixmapCreate(gCoord width, gCoord height) {
|
||||||
GDisplay *g;
|
GDisplay *g;
|
||||||
pixmap *p;
|
pixmap *p;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
// Calculate the size of the display surface in bytes
|
// Calculate the size of the display surface in bytes
|
||||||
i = width*height*sizeof(color_t);
|
i = width*height*sizeof(color_t);
|
||||||
if (i < 2*sizeof(coord_t))
|
if (i < 2*sizeof(gCoord))
|
||||||
i = 2*sizeof(coord_t);
|
i = 2*sizeof(gCoord);
|
||||||
|
|
||||||
// Allocate the pixmap
|
// Allocate the pixmap
|
||||||
if (!(p = gfxAlloc(i+sizeof(pixmap)-sizeof(p->pixels))))
|
if (!(p = gfxAlloc(i+sizeof(pixmap)-sizeof(p->pixels))))
|
||||||
|
@ -76,8 +76,8 @@ GDisplay *gdispPixmapCreate(coord_t width, coord_t height) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Save the width and height so the driver can retrieve it.
|
// Save the width and height so the driver can retrieve it.
|
||||||
((coord_t *)p->pixels)[0] = width;
|
((gCoord *)p->pixels)[0] = width;
|
||||||
((coord_t *)p->pixels)[1] = height;
|
((gCoord *)p->pixels)[1] = height;
|
||||||
|
|
||||||
// Register the driver
|
// Register the driver
|
||||||
g = (GDisplay *)gdriverRegister(&GDISPVMT_pixmap->d, p);
|
g = (GDisplay *)gdriverRegister(&GDISPVMT_pixmap->d, p);
|
||||||
|
@ -118,8 +118,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
|
|
||||||
// Initialize the GDISP structure
|
// Initialize the GDISP structure
|
||||||
// Width and height were saved into the start of the framebuffer.
|
// Width and height were saved into the start of the framebuffer.
|
||||||
g->g.Width = ((coord_t *)((pixmap *)g->priv)->pixels)[0];
|
g->g.Width = ((gCoord *)((pixmap *)g->priv)->pixels)[0];
|
||||||
g->g.Height = ((coord_t *)((pixmap *)g->priv)->pixels)[1];
|
g->g.Height = ((gCoord *)((pixmap *)g->priv)->pixels)[1];
|
||||||
g->g.Backlight = 100;
|
g->g.Backlight = 100;
|
||||||
g->g.Contrast = 50;
|
g->g.Contrast = 50;
|
||||||
g->g.Orientation = GDISP_ROTATE_0;
|
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_0:
|
||||||
case GDISP_ROTATE_180:
|
case GDISP_ROTATE_180:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
if (g->g.Orientation == GDISP_ROTATE_90 || g->g.Orientation == GDISP_ROTATE_270) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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_90:
|
||||||
case GDISP_ROTATE_270:
|
case GDISP_ROTATE_270:
|
||||||
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
if (g->g.Orientation == GDISP_ROTATE_0 || g->g.Orientation == GDISP_ROTATE_180) {
|
||||||
coord_t tmp;
|
gCoord tmp;
|
||||||
|
|
||||||
tmp = g->g.Width;
|
tmp = g->g.Width;
|
||||||
g->g.Width = g->g.Height;
|
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.
|
* @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).
|
* 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
|
* @brief Destroy an off-screen pixmap
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../gdriver/gdriver.h"
|
#include "../gdriver/gdriver.h"
|
||||||
|
|
||||||
typedef struct GMouseReading {
|
typedef struct GMouseReading {
|
||||||
coord_t x, y, z;
|
gCoord x, y, z;
|
||||||
uint16_t buttons;
|
uint16_t buttons;
|
||||||
} GMouseReading;
|
} GMouseReading;
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ typedef struct GMouse {
|
||||||
} GMouse;
|
} GMouse;
|
||||||
|
|
||||||
typedef struct GMouseJitter {
|
typedef struct GMouseJitter {
|
||||||
coord_t calibrate; // Maximum error for a calibration to succeed
|
gCoord calibrate; // Maximum error for a calibration to succeed
|
||||||
coord_t click; // Movement allowed without discarding the CLICK or CLICKCXT event
|
gCoord click; // Movement allowed without discarding the CLICK or CLICKCXT event
|
||||||
coord_t move; // Movement allowed without discarding the MOVE event
|
gCoord move; // Movement allowed without discarding the MOVE event
|
||||||
} GMouseJitter;
|
} GMouseJitter;
|
||||||
|
|
||||||
typedef struct GMouseVMT {
|
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_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_POORUPDOWN 0x0200 // Position readings during up/down are unreliable
|
||||||
#define GMOUSE_VFLG_DYNAMICONLY 0x8000 // This mouse driver should not be statically initialized eg Win32
|
#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)
|
gCoord 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
|
gCoord 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
|
gCoord 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_touchoff; // TOUCH: z values between z_min and this are a solid touch off
|
||||||
|
|
||||||
GMouseJitter pen_jitter; // PEN MODE: Jitter settings
|
GMouseJitter pen_jitter; // PEN MODE: Jitter settings
|
||||||
GMouseJitter finger_jitter; // FINGER MODE: Jitter settings
|
GMouseJitter finger_jitter; // FINGER MODE: Jitter settings
|
||||||
|
|
|
@ -72,10 +72,10 @@ static GTIMER_DECL(MouseTimer);
|
||||||
#include <string.h> // Required for memcpy
|
#include <string.h> // Required for memcpy
|
||||||
|
|
||||||
static GFXINLINE void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) {
|
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);
|
x = (gCoord) (c->ax * pt->x + c->bx * pt->y + c->cx);
|
||||||
y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
|
y = (gCoord) (c->ay * pt->x + c->by * pt->y + c->cy);
|
||||||
|
|
||||||
pt->x = x;
|
pt->x = x;
|
||||||
pt->y = y;
|
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
|
// We can't clip or rotate if we don't have a display
|
||||||
if (m->display) {
|
if (m->display) {
|
||||||
coord_t w, h;
|
gCoord w, h;
|
||||||
|
|
||||||
// We now need display information
|
// We now need display information
|
||||||
w = gdispGGetWidth(m->display);
|
w = gdispGGetWidth(m->display);
|
||||||
|
@ -205,7 +205,7 @@ static void GetMouseReading(GMouse *m) {
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
// Do we need to rotate the reading to match the display
|
// Do we need to rotate the reading to match the display
|
||||||
if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) {
|
if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) {
|
||||||
coord_t t;
|
gCoord t;
|
||||||
|
|
||||||
switch(gdispGGetOrientation(m->display)) {
|
switch(gdispGGetOrientation(m->display)) {
|
||||||
case GDISP_ROTATE_0:
|
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) {
|
static GFXINLINE void CalibrationCalculate(GMouse *m, const gPoint *cross, const gPoint *points) {
|
||||||
float dx;
|
float dx;
|
||||||
coord_t c0, c1, c2;
|
gCoord c0, c1, c2;
|
||||||
(void) m;
|
(void) m;
|
||||||
|
|
||||||
// Work on x values
|
// Work on x values
|
||||||
|
@ -462,7 +462,7 @@ static void MousePoll(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t CalibrateMouse(GMouse *m) {
|
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 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
|
gPoint points[4]; // The x, y readings obtained from the mouse for each test point
|
||||||
uint32_t err;
|
uint32_t err;
|
||||||
|
@ -570,7 +570,7 @@ static void MousePoll(void *param) {
|
||||||
// Do we need to rotate the reading to match the display
|
// Do we need to rotate the reading to match the display
|
||||||
#if GDISP_NEED_CONTROL
|
#if GDISP_NEED_CONTROL
|
||||||
if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) {
|
if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_SELFROTATION)) {
|
||||||
coord_t t;
|
gCoord t;
|
||||||
|
|
||||||
switch(gdispGGetOrientation(m->display)) {
|
switch(gdispGGetOrientation(m->display)) {
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
/* This type definition is also used by touch */
|
/* This type definition is also used by touch */
|
||||||
typedef struct GEventMouse_t {
|
typedef struct GEventMouse_t {
|
||||||
GEventType type; // The type of this event (GEVENT_MOUSE or GEVENT_TOUCH)
|
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 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)
|
// - 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.
|
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.
|
* it won't intersect.
|
||||||
*/
|
*/
|
||||||
if (c->y <= a->y && c->y >= b->y) {
|
if (c->y <= a->y && c->y >= b->y) {
|
||||||
coord_t crossProduct;
|
gCoord crossProduct;
|
||||||
|
|
||||||
/* If the line is parallel */
|
/* If the line is parallel */
|
||||||
if (a->y == b->y) {
|
if (a->y == b->y) {
|
||||||
|
|
|
@ -178,7 +178,7 @@ void gmiscMatrixFixed2DApplyShear(MatrixFixed2D *dst, const MatrixFixed2D *src,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void gmiscMatrixFixed2DApplyToPoints(gPoint *dst, const gPoint *src, const MatrixFixed2D *m, int cnt) {
|
void gmiscMatrixFixed2DApplyToPoints(gPoint *dst, const gPoint *src, const MatrixFixed2D *m, int cnt) {
|
||||||
coord_t x;
|
gCoord x;
|
||||||
|
|
||||||
for( ;cnt--; dst++, src++) {
|
for( ;cnt--; dst++, src++) {
|
||||||
x = src->x; // This allows in-place operation
|
x = src->x; // This allows in-place operation
|
||||||
|
|
|
@ -237,44 +237,44 @@ void gwinClear(GHandle gh) {
|
||||||
gh->vmt->AfterClear(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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawPixel(gh->display, gh->x+x, gh->y+y, gh->color);
|
gdispGDrawPixel(gh->display, gh->x+x, gh->y+y, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color);
|
gdispGDrawLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawBox(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
|
gdispGDrawBox(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillArea(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
|
gdispGFillArea(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGBlitArea(gh->display, gh->x+x, gh->y+y, cx, cy, srcx, srcy, srccx, buffer);
|
gdispGBlitArea(gh->display, gh->x+x, gh->y+y, cx, cy, srcx, srcy, srccx, buffer);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GDISP_NEED_CIRCLE
|
#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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
|
gdispGDrawCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
|
gdispGFillCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -282,7 +282,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_DUALCIRCLE
|
#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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillDualCircle(gh->display, gh->x+x, gh->y+y, radius1, gh->bgcolor, radius2, gh->color);
|
gdispGFillDualCircle(gh->display, gh->x+x, gh->y+y, radius1, gh->bgcolor, radius2, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -290,13 +290,13 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ELLIPSE
|
#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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
|
gdispGDrawEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
|
gdispGFillEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -304,19 +304,19 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARC
|
#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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
gdispGDrawArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
gdispGFillArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawThickArc(gh->display, gh->x+x, gh->y+y, startradius, endradius, startangle, endangle, gh->color);
|
gdispGDrawThickArc(gh->display, gh->x+x, gh->y+y, startradius, endradius, startangle, endangle, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -324,13 +324,13 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARCSECTORS
|
#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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
|
gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
|
gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -338,7 +338,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_PIXELREAD
|
#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;
|
if (!_gwinDrawStart(gh)) return (color_t)0;
|
||||||
return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
|
return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -346,37 +346,37 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_TEXT
|
#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;
|
if (!gh->font || !_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color);
|
gdispGDrawChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!gh->font || !_gwinDrawStart(gh)) return;
|
||||||
gdispGFillChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color, gh->bgcolor);
|
gdispGFillChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color, gh->bgcolor);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!gh->font || !_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color);
|
gdispGDrawString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!gh->font || !_gwinDrawStart(gh)) return;
|
||||||
gdispGFillString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color, gh->bgcolor);
|
gdispGFillString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color, gh->bgcolor);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!gh->font || !_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, justify);
|
gdispGDrawStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, justify);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
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);
|
gdispGFillStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, gh->bgcolor, justify);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -384,18 +384,18 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_CONVEX_POLYGON
|
#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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
gdispGDrawPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGFillConvexPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
gdispGFillConvexPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
||||||
_gwinDrawEnd(gh);
|
_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;
|
if (!_gwinDrawStart(gh)) return;
|
||||||
gdispGDrawThickLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color, width, round);
|
gdispGDrawThickLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color, width, round);
|
||||||
_gwinDrawEnd(gh);
|
_gwinDrawEnd(gh);
|
||||||
|
@ -403,7 +403,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_IMAGE
|
#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;
|
gdispImageError ret;
|
||||||
|
|
||||||
if (!_gwinDrawStart(gh)) return GDISP_IMAGE_ERR_OK;
|
if (!_gwinDrawStart(gh)) return GDISP_IMAGE_ERR_OK;
|
||||||
|
|
|
@ -44,10 +44,10 @@ typedef struct GWindowObject {
|
||||||
#endif
|
#endif
|
||||||
const struct gwinVMT* vmt; /**< The VMT for this GWIN */
|
const struct gwinVMT* vmt; /**< The VMT for this GWIN */
|
||||||
GDisplay * display; /**< The display this window is on */
|
GDisplay * display; /**< The display this window is on */
|
||||||
coord_t x; /**< The position relative to the screen */
|
gCoord x; /**< The position relative to the screen */
|
||||||
coord_t y; /**< The position relative to the screen */
|
gCoord y; /**< The position relative to the screen */
|
||||||
coord_t width; /**< The width of this window */
|
gCoord width; /**< The width of this window */
|
||||||
coord_t height; /**< The height of this window */
|
gCoord height; /**< The height of this window */
|
||||||
color_t color; /**< The current foreground drawing color */
|
color_t color; /**< The current foreground drawing color */
|
||||||
color_t bgcolor; /**< The current background drawing color */
|
color_t bgcolor; /**< The current background drawing color */
|
||||||
uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */
|
uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */
|
||||||
|
@ -73,10 +73,10 @@ typedef struct GWindowObject {
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
typedef struct GWindowInit {
|
typedef struct GWindowInit {
|
||||||
coord_t x; /**< The initial position relative to its parent */
|
gCoord x; /**< The initial position relative to its parent */
|
||||||
coord_t y; /**< The initial position relative to its parent */
|
gCoord y; /**< The initial position relative to its parent */
|
||||||
coord_t width; /**< The width */
|
gCoord width; /**< The width */
|
||||||
coord_t height; /**< The height */
|
gCoord height; /**< The height */
|
||||||
gBool show; /**< Should the window be visible initially */
|
gBool show; /**< Should the window be visible initially */
|
||||||
#if GWIN_NEED_CONTAINERS
|
#if GWIN_NEED_CONTAINERS
|
||||||
GHandle parent; /**< The parent - must be a container or NULL */
|
GHandle parent; /**< The parent - must be a container or NULL */
|
||||||
|
@ -437,7 +437,7 @@ gBool gwinGetEnabled(GHandle gh);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
void gwinMove(GHandle gh, coord_t x, coord_t y);
|
void gwinMove(GHandle gh, gCoord x, gCoord y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resize a window
|
* @brief Resize a window
|
||||||
|
@ -455,7 +455,7 @@ void gwinMove(GHandle gh, coord_t x, coord_t y);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
void gwinResize(GHandle gh, coord_t width, coord_t height);
|
void gwinResize(GHandle gh, gCoord width, gCoord height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Redraw a window
|
* @brief Redraw a window
|
||||||
|
@ -622,7 +622,7 @@ void gwinClear(GHandle gh);
|
||||||
*
|
*
|
||||||
* @api
|
* @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
|
* @brief Draw a line in the window
|
||||||
|
@ -635,7 +635,7 @@ void gwinDrawPixel(GHandle gh, coord_t x, coord_t y);
|
||||||
*
|
*
|
||||||
* @api
|
* @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
|
* @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
|
* @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
|
* @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
|
* @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.
|
* @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
|
* @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
|
* 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
|
* @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.
|
* @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
|
* @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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_DUALCIRCLE || defined(__DOXYGEN__)
|
#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
|
* @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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ELLIPSE || defined(__DOXYGEN__)
|
#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
|
* @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.
|
* @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
|
* @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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARC || defined(__DOXYGEN__)
|
#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
|
* @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.
|
* @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
|
* @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.
|
* @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
|
* @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
|
#endif
|
||||||
|
|
||||||
#if GDISP_NEED_ARCSECTORS || defined(__DOXYGEN__)
|
#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
|
* @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.
|
* @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
|
* @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
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
|
@ -871,7 +871,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
color_t gwinGetPixelColor(GHandle gh, coord_t x, coord_t y);
|
color_t gwinGetPixelColor(GHandle gh, gCoord x, gCoord y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
|
@ -891,7 +891,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
*
|
*
|
||||||
* @api
|
* @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.
|
* @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
|
* @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
|
* @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
|
* @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
|
* @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
|
* @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.
|
* @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
|
* @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.
|
* @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
|
* @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
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
|
@ -987,7 +987,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
*
|
*
|
||||||
* @api
|
* @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
|
* @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
|
* @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
|
* @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
|
* @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
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
|
@ -1056,7 +1056,7 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
*
|
*
|
||||||
* @api
|
* @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
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
|
|
|
@ -25,14 +25,14 @@
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
// A mouse down has occurred over the button
|
// 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;
|
(void) x; (void) y;
|
||||||
gw->g.flags |= GBUTTON_FLG_PRESSED;
|
gw->g.flags |= GBUTTON_FLG_PRESSED;
|
||||||
_gwinUpdate((GHandle)gw);
|
_gwinUpdate((GHandle)gw);
|
||||||
}
|
}
|
||||||
|
|
||||||
// A mouse up has occurred (it may or may not be over the button)
|
// 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;
|
(void) x; (void) y;
|
||||||
gw->g.flags &= ~GBUTTON_FLG_PRESSED;
|
gw->g.flags &= ~GBUTTON_FLG_PRESSED;
|
||||||
_gwinUpdate((GHandle)gw);
|
_gwinUpdate((GHandle)gw);
|
||||||
|
@ -183,7 +183,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
|
||||||
const GColorSet * pcol;
|
const GColorSet * pcol;
|
||||||
fixed alpha;
|
fixed alpha;
|
||||||
fixed dalpha;
|
fixed dalpha;
|
||||||
coord_t i;
|
gCoord i;
|
||||||
color_t tcol, bcol;
|
color_t tcol, bcol;
|
||||||
|
|
||||||
(void) param;
|
(void) param;
|
||||||
|
@ -453,7 +453,7 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
|
||||||
#if GDISP_NEED_IMAGE || defined(__DOXYGEN__)
|
#if GDISP_NEED_IMAGE || defined(__DOXYGEN__)
|
||||||
void gwinButtonDraw_Image(GWidgetObject *gw, void *param) {
|
void gwinButtonDraw_Image(GWidgetObject *gw, void *param) {
|
||||||
const GColorSet * pcol;
|
const GColorSet * pcol;
|
||||||
coord_t sy;
|
gCoord sy;
|
||||||
|
|
||||||
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
||||||
pcol = getButtonColors(gw);
|
pcol = getButtonColors(gw);
|
||||||
|
|
|
@ -44,7 +44,7 @@ static void SendCheckboxEvent(GWidgetObject *gw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#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;
|
(void) x; (void) y;
|
||||||
gw->g.flags ^= GCHECKBOX_FLG_CHECKED;
|
gw->g.flags ^= GCHECKBOX_FLG_CHECKED;
|
||||||
_gwinUpdate((GHandle)gw);
|
_gwinUpdate((GHandle)gw);
|
||||||
|
@ -173,7 +173,7 @@ static const GColorSet *getCheckboxColors(GWidgetObject *gw) {
|
||||||
|
|
||||||
void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
|
void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
|
||||||
#define gcw ((GCheckboxObject *)gw)
|
#define gcw ((GCheckboxObject *)gw)
|
||||||
coord_t ld, df;
|
gCoord ld, df;
|
||||||
const GColorSet * pcol;
|
const GColorSet * pcol;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
|
||||||
|
|
||||||
void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
|
void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
|
||||||
#define gcw ((GCheckboxObject *)gw)
|
#define gcw ((GCheckboxObject *)gw)
|
||||||
coord_t ep, ld, df;
|
gCoord ep, ld, df;
|
||||||
const GColorSet * pcol;
|
const GColorSet * pcol;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
|
||||||
const GColorSet * pcol;
|
const GColorSet * pcol;
|
||||||
fixed alpha;
|
fixed alpha;
|
||||||
fixed dalpha;
|
fixed dalpha;
|
||||||
coord_t i;
|
gCoord i;
|
||||||
color_t tcol, bcol;
|
color_t tcol, bcol;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
|
|
|
@ -87,9 +87,9 @@ typedef struct gwinVMT {
|
||||||
void (*DefaultDraw) (GWidgetObject *gw, void *param); /**< The default drawing routine (mandatory) */
|
void (*DefaultDraw) (GWidgetObject *gw, void *param); /**< The default drawing routine (mandatory) */
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
struct {
|
struct {
|
||||||
void (*MouseDown) (GWidgetObject *gw, coord_t x, coord_t y); /**< Process mouse down events (optional) */
|
void (*MouseDown) (GWidgetObject *gw, gCoord x, gCoord y); /**< Process mouse down events (optional) */
|
||||||
void (*MouseUp) (GWidgetObject *gw, coord_t x, coord_t y); /**< Process mouse up events (optional) */
|
void (*MouseUp) (GWidgetObject *gw, gCoord x, gCoord y); /**< Process mouse up events (optional) */
|
||||||
void (*MouseMove) (GWidgetObject *gw, coord_t x, coord_t y); /**< Process mouse move events (optional) */
|
void (*MouseMove) (GWidgetObject *gw, gCoord x, gCoord y); /**< Process mouse move events (optional) */
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD
|
#if GINPUT_NEED_KEYBOARD || GWIN_NEED_KEYBOARD
|
||||||
|
@ -131,10 +131,10 @@ typedef struct gwinVMT {
|
||||||
*/
|
*/
|
||||||
typedef struct gcontainerVMT {
|
typedef struct gcontainerVMT {
|
||||||
gwidgetVMT gw;
|
gwidgetVMT gw;
|
||||||
coord_t (*LeftBorder) (GHandle gh); /**< The size of the left border (mandatory) */
|
gCoord (*LeftBorder) (GHandle gh); /**< The size of the left border (mandatory) */
|
||||||
coord_t (*TopBorder) (GHandle gh); /**< The size of the top border (mandatory) */
|
gCoord (*TopBorder) (GHandle gh); /**< The size of the top border (mandatory) */
|
||||||
coord_t (*RightBorder) (GHandle gh); /**< The size of the right border (mandatory) */
|
gCoord (*RightBorder) (GHandle gh); /**< The size of the right border (mandatory) */
|
||||||
coord_t (*BottomBorder) (GHandle gh); /**< The size of the bottom 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 (*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) */
|
void (*NotifyDelete) (GHandle gh, GHandle ghChild); /**< Notification that a child has been deleted (optional) */
|
||||||
} gcontainerVMT;
|
} gcontainerVMT;
|
||||||
|
@ -157,8 +157,8 @@ typedef struct gwinVMT {
|
||||||
gBool (*Add) (GHandle gh, const GWindowInit *pInit); /**< A window has been added */
|
gBool (*Add) (GHandle gh, const GWindowInit *pInit); /**< A window has been added */
|
||||||
void (*Delete) (GHandle gh); /**< A window has been deleted */
|
void (*Delete) (GHandle gh); /**< A window has been deleted */
|
||||||
void (*Redraw) (GHandle gh); /**< A window needs to be redraw (or undrawn) */
|
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 (*Size) (GHandle gh, gCoord w, gCoord h); /**< A window wants to be resized */
|
||||||
void (*Move) (GHandle gh, coord_t x, coord_t y); /**< A window wants to be moved */
|
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 (*Raise) (GHandle gh); /**< A window wants to be on top */
|
||||||
void (*MinMax) (GHandle gh, GWindowMinMax minmax); /**< A window wants to be minimized/maximised */
|
void (*MinMax) (GHandle gh, GWindowMinMax minmax); /**< A window wants to be minimized/maximised */
|
||||||
} gwmVMT;
|
} gwmVMT;
|
||||||
|
@ -353,7 +353,7 @@ gBool _gwinWMAdd(GHandle gh, const GWindowInit *pInit);
|
||||||
*
|
*
|
||||||
* @notapi
|
* @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.
|
* @brief Draw a simple focus circle in the default style.
|
||||||
|
@ -368,7 +368,7 @@ gBool _gwinWMAdd(GHandle gh, const GWindowInit *pInit);
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
#if GDISP_NEED_CIRCLE
|
#if GDISP_NEED_CIRCLE
|
||||||
void _gwidgetDrawFocusCircle(GWidgetObject *gx, coord_t radius);
|
void _gwidgetDrawFocusCircle(GWidgetObject *gx, gCoord radius);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -193,7 +193,7 @@
|
||||||
|
|
||||||
static void HistoryRedraw(GWindowObject *gh) {
|
static void HistoryRedraw(GWindowObject *gh) {
|
||||||
#define gcw ((GConsoleObject *)gh)
|
#define gcw ((GConsoleObject *)gh)
|
||||||
coord_t fy;
|
gCoord fy;
|
||||||
|
|
||||||
// No redrawing if there is no history
|
// No redrawing if there is no history
|
||||||
if (!gcw->buffer)
|
if (!gcw->buffer)
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
#if GWIN_CONSOLE_USE_CLEAR_LINES
|
#if GWIN_CONSOLE_USE_CLEAR_LINES
|
||||||
// Clear the remaining space
|
// Clear the remaining space
|
||||||
{
|
{
|
||||||
coord_t y;
|
gCoord y;
|
||||||
|
|
||||||
y = gcw->cy;
|
y = gcw->cy;
|
||||||
if (gcw->cx)
|
if (gcw->cx)
|
||||||
|
@ -563,7 +563,7 @@ void gwinPutChar(GHandle gh, char c) {
|
||||||
|
|
||||||
// Set the cursor to the start of the last line
|
// Set the cursor to the start of the last line
|
||||||
gcw->cx = 0;
|
gcw->cx = 0;
|
||||||
gcw->cy = (((coord_t)(gh->height/fy))-1)*fy;
|
gcw->cy = (((gCoord)(gh->height/fy))-1)*fy;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
// A console window. Supports wrapped text writing and a cursor.
|
// A console window. Supports wrapped text writing and a cursor.
|
||||||
typedef struct GConsoleObject {
|
typedef struct GConsoleObject {
|
||||||
GWindowObject g;
|
GWindowObject g;
|
||||||
coord_t cx, cy; // Cursor position
|
gCoord cx, cy; // Cursor position
|
||||||
|
|
||||||
#if GWIN_CONSOLE_ESCSEQ
|
#if GWIN_CONSOLE_ESCSEQ
|
||||||
uint8_t startattr; // ANSI-like escape sequences
|
uint8_t startattr; // ANSI-like escape sequences
|
||||||
|
|
|
@ -59,13 +59,13 @@ GHandle gwinGetSibling(GHandle gh) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t gwinGetInnerWidth(GHandle gh) {
|
gCoord gwinGetInnerWidth(GHandle gh) {
|
||||||
if (!(gh->flags & GWIN_FLG_CONTAINER))
|
if (!(gh->flags & GWIN_FLG_CONTAINER))
|
||||||
return 0;
|
return 0;
|
||||||
return gh->width - ((const gcontainerVMT *)gh->vmt)->LeftBorder(gh) - ((const gcontainerVMT *)gh->vmt)->RightBorder(gh);
|
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))
|
if (!(gh->flags & GWIN_FLG_CONTAINER))
|
||||||
return 0;
|
return 0;
|
||||||
return gh->height - ((const gcontainerVMT *)gh->vmt)->TopBorder(gh) - ((const gcontainerVMT *)gh->vmt)->BottomBorder(gh);
|
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
|
#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
|
// The container VMT table
|
||||||
static const gcontainerVMT containerVMT = {
|
static const gcontainerVMT containerVMT = {
|
||||||
|
@ -169,7 +169,7 @@ void gwinContainerDraw_Std(GWidgetObject *gw, void *param) {
|
||||||
#if GDISP_NEED_IMAGE
|
#if GDISP_NEED_IMAGE
|
||||||
void gwinContainerDraw_Image(GWidgetObject *gw, void *param) {
|
void gwinContainerDraw_Image(GWidgetObject *gw, void *param) {
|
||||||
#define gi ((gdispImage *)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)
|
if (gw->g.vmt != (gwinVMT *)&containerVMT)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -81,7 +81,7 @@ GHandle gwinGetSibling(GHandle gh);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
coord_t gwinGetInnerWidth(GHandle gh);
|
gCoord gwinGetInnerWidth(GHandle gh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the inner height of a container window
|
* @brief Get the inner height of a container window
|
||||||
|
@ -92,7 +92,7 @@ coord_t gwinGetInnerWidth(GHandle gh);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
coord_t gwinGetInnerHeight(GHandle gh);
|
gCoord gwinGetInnerHeight(GHandle gh);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -37,10 +37,10 @@
|
||||||
#error "GWIN Frame: - Flag definitions don't match"
|
#error "GWIN Frame: - Flag definitions don't match"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static coord_t FrameBorderSizeL(GHandle gh) { (void)gh; return FRM_BORDER_L; }
|
static gCoord FrameBorderSizeL(GHandle gh) { (void)gh; return FRM_BORDER_L; }
|
||||||
static coord_t FrameBorderSizeR(GHandle gh) { (void)gh; return FRM_BORDER_R; }
|
static gCoord FrameBorderSizeR(GHandle gh) { (void)gh; return FRM_BORDER_R; }
|
||||||
static coord_t FrameBorderSizeT(GHandle gh) { (void)gh; return FRM_BORDER_T; }
|
static gCoord FrameBorderSizeT(GHandle gh) { (void)gh; return FRM_BORDER_T; }
|
||||||
static coord_t FrameBorderSizeB(GHandle gh) { (void)gh; return FRM_BORDER_B; }
|
static gCoord FrameBorderSizeB(GHandle gh) { (void)gh; return FRM_BORDER_B; }
|
||||||
|
|
||||||
static void forceFrameRedraw(GWidgetObject *gw) {
|
static void forceFrameRedraw(GWidgetObject *gw) {
|
||||||
// Force a redraw of just the frame.
|
// Force a redraw of just the frame.
|
||||||
|
@ -51,8 +51,8 @@ static void forceFrameRedraw(GWidgetObject *gw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
static void FrameMouseDown(GWidgetObject *gw, coord_t x, coord_t y) {
|
static void FrameMouseDown(GWidgetObject *gw, gCoord x, gCoord y) {
|
||||||
coord_t pos;
|
gCoord pos;
|
||||||
|
|
||||||
// We must be clicking on the frame button area to be of interest
|
// 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)
|
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 GWIN_BUTTON_LAZY_RELEASE
|
||||||
if ((gw->g.flags & GWIN_FRAME_CLOSE_PRESSED)) {
|
if ((gw->g.flags & GWIN_FRAME_CLOSE_PRESSED)) {
|
||||||
// Close is released - destroy the window
|
// Close is released - destroy the window
|
||||||
|
@ -118,7 +118,7 @@ static void forceFrameRedraw(GWidgetObject *gw) {
|
||||||
|
|
||||||
// We must be releasing over the button
|
// We must be releasing over the button
|
||||||
if (y >= FRM_BUTTON_T && y < FRM_BUTTON_T+FRM_BUTTON_Y) {
|
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);
|
pos = gw->g.width - (FRM_BORDER_R+FRM_BUTTON_X);
|
||||||
if ((gw->g.flags & GWIN_FRAME_CLOSE_BTN)) {
|
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) {
|
void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
|
||||||
const GColorSet *pcol;
|
const GColorSet *pcol;
|
||||||
coord_t pos;
|
gCoord pos;
|
||||||
color_t contrast;
|
color_t contrast;
|
||||||
color_t btn;
|
color_t btn;
|
||||||
(void)param;
|
(void)param;
|
||||||
|
@ -295,7 +295,7 @@ void gwinFrameDraw_Std(GWidgetObject *gw, void *param) {
|
||||||
#if GDISP_NEED_IMAGE
|
#if GDISP_NEED_IMAGE
|
||||||
void gwinFrameDraw_Image(GWidgetObject *gw, void *param) {
|
void gwinFrameDraw_Image(GWidgetObject *gw, void *param) {
|
||||||
#define gi ((gdispImage *)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)
|
if (gw->g.vmt != (gwinVMT *)&frameVMT)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -37,7 +37,7 @@ static const gwinVMT graphVMT = {
|
||||||
0, // The after-clear routine
|
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)
|
if (style->type == GGRAPH_POINT_NONE)
|
||||||
return;
|
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) {
|
static void lineto(GGraphObject *gg, gCoord x0, gCoord y0, gCoord x1, gCoord y1, const GGraphLineStyle *style) {
|
||||||
coord_t dy, dx;
|
gCoord dy, dx;
|
||||||
coord_t addx, addy;
|
gCoord addx, addy;
|
||||||
coord_t P, diff, i;
|
gCoord P, diff, i;
|
||||||
coord_t run_on, run_off, run;
|
gCoord run_on, run_off, run;
|
||||||
|
|
||||||
if (style->type == GGRAPH_LINE_NONE)
|
if (style->type == GGRAPH_LINE_NONE)
|
||||||
return;
|
return;
|
||||||
|
@ -193,7 +193,7 @@ void gwinGraphSetStyle(GHandle gh, const GGraphStyle *pstyle) {
|
||||||
#undef gg
|
#undef gg
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y) {
|
void gwinGraphSetOrigin(GHandle gh, gCoord x, gCoord y) {
|
||||||
#define gg ((GGraphObject *)gh)
|
#define gg ((GGraphObject *)gh)
|
||||||
|
|
||||||
if (gh->vmt != &graphVMT)
|
if (gh->vmt != &graphVMT)
|
||||||
|
@ -207,7 +207,7 @@ void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y) {
|
||||||
|
|
||||||
void gwinGraphDrawAxis(GHandle gh) {
|
void gwinGraphDrawAxis(GHandle gh) {
|
||||||
#define gg ((GGraphObject *)gh)
|
#define gg ((GGraphObject *)gh)
|
||||||
coord_t i, xmin, ymin, xmax, ymax;
|
gCoord i, xmin, ymin, xmax, ymax;
|
||||||
|
|
||||||
if (gh->vmt != &graphVMT || !_gwinDrawStart(gh))
|
if (gh->vmt != &graphVMT || !_gwinDrawStart(gh))
|
||||||
return;
|
return;
|
||||||
|
@ -274,7 +274,7 @@ void gwinGraphStartSet(GHandle gh) {
|
||||||
gh->flags &= ~GGRAPH_FLG_CONNECTPOINTS;
|
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)
|
#define gg ((GGraphObject *)gh)
|
||||||
|
|
||||||
if (gh->vmt != &graphVMT || !_gwinDrawStart(gh))
|
if (gh->vmt != &graphVMT || !_gwinDrawStart(gh))
|
||||||
|
|
|
@ -33,7 +33,7 @@ typedef enum GGraphPointType_e {
|
||||||
|
|
||||||
typedef struct GGraphPointStyle_t {
|
typedef struct GGraphPointStyle_t {
|
||||||
GGraphPointType type;
|
GGraphPointType type;
|
||||||
coord_t size;
|
gCoord size;
|
||||||
color_t color;
|
color_t color;
|
||||||
} GGraphPointStyle;
|
} GGraphPointStyle;
|
||||||
|
|
||||||
|
@ -43,15 +43,15 @@ typedef enum GGraphLineType_e {
|
||||||
|
|
||||||
typedef struct GGraphLineStyle_t {
|
typedef struct GGraphLineStyle_t {
|
||||||
GGraphLineType type;
|
GGraphLineType type;
|
||||||
coord_t size;
|
gCoord size;
|
||||||
color_t color;
|
color_t color;
|
||||||
} GGraphLineStyle;
|
} GGraphLineStyle;
|
||||||
|
|
||||||
typedef struct GGraphGridStyle_t {
|
typedef struct GGraphGridStyle_t {
|
||||||
GGraphLineType type;
|
GGraphLineType type;
|
||||||
coord_t size;
|
gCoord size;
|
||||||
color_t color;
|
color_t color;
|
||||||
coord_t spacing;
|
gCoord spacing;
|
||||||
} GGraphGridStyle;
|
} GGraphGridStyle;
|
||||||
|
|
||||||
typedef struct GGraphStyle_t {
|
typedef struct GGraphStyle_t {
|
||||||
|
@ -77,8 +77,8 @@ typedef struct GGraphStyle_t {
|
||||||
typedef struct GGraphObject {
|
typedef struct GGraphObject {
|
||||||
GWindowObject g;
|
GWindowObject g;
|
||||||
GGraphStyle style;
|
GGraphStyle style;
|
||||||
coord_t xorigin, yorigin;
|
gCoord xorigin, yorigin;
|
||||||
coord_t lastx, lasty;
|
gCoord lastx, lasty;
|
||||||
} GGraphObject;
|
} GGraphObject;
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -130,7 +130,7 @@ void gwinGraphSetStyle(GHandle gh, const GGraphStyle *pstyle);
|
||||||
*
|
*
|
||||||
* @api
|
* @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.
|
* @brief Draw the axis and the background grid.
|
||||||
|
@ -161,7 +161,7 @@ void gwinGraphStartSet(GHandle gh);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
void gwinGraphDrawPoint(GHandle gh, coord_t x, coord_t y);
|
void gwinGraphDrawPoint(GHandle gh, gCoord x, gCoord y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Draw multiple graph points.
|
* @brief Draw multiple graph points.
|
||||||
|
|
|
@ -34,7 +34,7 @@ static void ImageDestroy(GWindowObject *gh) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void ImageRedraw(GHandle gh) {
|
static void ImageRedraw(GHandle gh) {
|
||||||
coord_t x, y, w, h, dx, dy;
|
gCoord x, y, w, h, dx, dy;
|
||||||
color_t bg;
|
color_t bg;
|
||||||
#if GWIN_NEED_IMAGE_ANIMATION
|
#if GWIN_NEED_IMAGE_ANIMATION
|
||||||
delaytime_t delay;
|
delaytime_t delay;
|
||||||
|
|
|
@ -174,7 +174,7 @@ static void SendVirtualKeyEvent(GKeyboardObject *gk) {
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
// Find the key from the keyset and the x, y position
|
// 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;
|
const utf8 *krow;
|
||||||
fixed f;
|
fixed f;
|
||||||
int idx;
|
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)
|
// 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)
|
#define gk ((GKeyboardObject *)gw)
|
||||||
|
|
||||||
KeyFindKey(gk, x, y);
|
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)
|
// 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)
|
#define gk ((GKeyboardObject *)gw)
|
||||||
|
|
||||||
KeyFindKey(gk, x, y);
|
KeyFindKey(gk, x, y);
|
||||||
|
@ -392,7 +392,7 @@ void gwinKeyboardDraw_Normal(GWidgetObject *gw, void *param) {
|
||||||
char cap[5];
|
char cap[5];
|
||||||
const char *pcap;
|
const char *pcap;
|
||||||
const utf8 *krow;
|
const utf8 *krow;
|
||||||
coord_t x, y, cx, cy;
|
gCoord x, y, cx, cy;
|
||||||
uint8_t rows, cols, row, col, kcols;
|
uint8_t rows, cols, row, col, kcols;
|
||||||
ucode key;
|
ucode key;
|
||||||
fixed fx, fy;
|
fixed fx, fy;
|
||||||
|
|
|
@ -57,8 +57,8 @@ typedef struct GKeyboardObject {
|
||||||
GWidgetObject w;
|
GWidgetObject w;
|
||||||
const struct GVKeyTable *keytable;
|
const struct GVKeyTable *keytable;
|
||||||
const char **keyset;
|
const char **keyset;
|
||||||
coord_t keyx, keyy;
|
gCoord keyx, keyy;
|
||||||
coord_t keycx, keycy;
|
gCoord keycx, keycy;
|
||||||
uint8_t lastkeyrow, lastkeycol;
|
uint8_t lastkeyrow, lastkeycol;
|
||||||
uint8_t keyrow, keycol;
|
uint8_t keyrow, keycol;
|
||||||
uint32_t key;
|
uint32_t key;
|
||||||
|
|
|
@ -21,14 +21,14 @@
|
||||||
#define gw2obj ((GLabelObject *)gw)
|
#define gw2obj ((GLabelObject *)gw)
|
||||||
|
|
||||||
// simple: single line with no wrapping
|
// 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;
|
(void) maxwidth;
|
||||||
|
|
||||||
return gdispGetStringWidth(text, font)+2; // Allow one pixel of padding on each side
|
return gdispGetStringWidth(text, font)+2; // Allow one pixel of padding on each side
|
||||||
}
|
}
|
||||||
|
|
||||||
// simple: single line with no wrapping
|
// 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) text;
|
||||||
(void) maxwidth;
|
(void) maxwidth;
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GWIN_LABEL_ATTRIBUTE
|
#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?
|
// is it a valid handle?
|
||||||
if (gh->vmt != (gwinVMT *)&labelVMT)
|
if (gh->vmt != (gwinVMT *)&labelVMT)
|
||||||
return;
|
return;
|
||||||
|
@ -130,7 +130,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border) {
|
||||||
#endif // GWIN_LABEL_ATTRIBUTE
|
#endif // GWIN_LABEL_ATTRIBUTE
|
||||||
|
|
||||||
static void gwinLabelDraw(GWidgetObject *gw, justify_t justify) {
|
static void gwinLabelDraw(GWidgetObject *gw, justify_t justify) {
|
||||||
coord_t w, h;
|
gCoord w, h;
|
||||||
color_t c;
|
color_t c;
|
||||||
|
|
||||||
// is it a valid handle?
|
// is it a valid handle?
|
||||||
|
|
|
@ -48,7 +48,7 @@ typedef struct GLabelObject {
|
||||||
GWidgetObject w;
|
GWidgetObject w;
|
||||||
|
|
||||||
#if GWIN_LABEL_ATTRIBUTE
|
#if GWIN_LABEL_ATTRIBUTE
|
||||||
coord_t tab;
|
gCoord tab;
|
||||||
const char* attr;
|
const char* attr;
|
||||||
#endif
|
#endif
|
||||||
} GLabelObject;
|
} GLabelObject;
|
||||||
|
@ -102,7 +102,7 @@ void gwinLabelSetBorder(GHandle gh, gBool border);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
void gwinLabelSetAttribute(GHandle gh, coord_t tab, const char* attr);
|
void gwinLabelSetAttribute(GHandle gh, gCoord tab, const char* attr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -54,10 +54,10 @@ static void sendListEvent(GWidgetObject *gw, int item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#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;
|
const gfxQueueASyncItem* qi;
|
||||||
int item, i;
|
int item, i;
|
||||||
coord_t iheight;
|
gCoord iheight;
|
||||||
(void) x;
|
(void) x;
|
||||||
|
|
||||||
iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD;
|
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
|
// a mouse down has occurred over the list area
|
||||||
static void ListMouseDown(GWidgetObject* gw, coord_t x, coord_t y) {
|
static void ListMouseDown(GWidgetObject* gw, gCoord x, gCoord y) {
|
||||||
coord_t iheight, pgsz;
|
gCoord iheight, pgsz;
|
||||||
|
|
||||||
// Save our mouse start position
|
// Save our mouse start position
|
||||||
gw2obj->start_mouse_x = x;
|
gw2obj->start_mouse_x = x;
|
||||||
|
@ -143,7 +143,7 @@ static void sendListEvent(GWidgetObject *gw, int item) {
|
||||||
ListMouseSelect(gw, x, y);
|
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
|
// Only act when we are a smooth scrolling list
|
||||||
if (!(gw->g.flags & GLIST_FLG_SCROLLSMOOTH))
|
if (!(gw->g.flags & GLIST_FLG_SCROLLSMOOTH))
|
||||||
return;
|
return;
|
||||||
|
@ -155,7 +155,7 @@ static void sendListEvent(GWidgetObject *gw, int item) {
|
||||||
ListMouseSelect(gw, x, y);
|
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;
|
int iheight, oldtop;
|
||||||
(void) x;
|
(void) x;
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ static void sendListEvent(GWidgetObject *gw, int item) {
|
||||||
const gfxQueueASyncItem * qix;
|
const gfxQueueASyncItem * qix;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
coord_t iheight;
|
gCoord iheight;
|
||||||
iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD;
|
iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD;
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
|
@ -653,7 +653,7 @@ void gwinListSetSelected(GHandle gh, int item, gBool doSelect) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinListViewItem(GHandle gh, int item) {
|
void gwinListViewItem(GHandle gh, int item) {
|
||||||
coord_t iheight;
|
gCoord iheight;
|
||||||
|
|
||||||
// is it a valid handle?
|
// is it a valid handle?
|
||||||
if (gh->vmt != (gwinVMT *)&listVMT)
|
if (gh->vmt != (gwinVMT *)&listVMT)
|
||||||
|
@ -703,11 +703,11 @@ void gwinListViewItem(GHandle gh, int item) {
|
||||||
void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
|
void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
|
||||||
const gfxQueueASyncItem* qi;
|
const gfxQueueASyncItem* qi;
|
||||||
int i;
|
int i;
|
||||||
coord_t x, y, iheight, iwidth;
|
gCoord x, y, iheight, iwidth;
|
||||||
color_t fill;
|
color_t fill;
|
||||||
const GColorSet * ps;
|
const GColorSet * ps;
|
||||||
#if GWIN_NEED_LIST_IMAGES
|
#if GWIN_NEED_LIST_IMAGES
|
||||||
coord_t sy;
|
gCoord sy;
|
||||||
#endif
|
#endif
|
||||||
#if GDISP_NEED_CONVEX_POLYGON
|
#if GDISP_NEED_CONVEX_POLYGON
|
||||||
static const gPoint upArrow[] = { {0, LST_ARROW_SZ}, {LST_ARROW_SZ, LST_ARROW_SZ}, {LST_ARROW_SZ/2, 0} };
|
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…
Add table
Reference in a new issue