diff options
Diffstat (limited to 'src/gwin')
30 files changed, 133 insertions, 133 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 0e309ba1..b254fb96 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -84,7 +84,7 @@ void _gwinDeinit(void) // Internal routine for use by GWIN components only // Initialise a window creating it dynamically if required. -GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint32_t flags) { +GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, gU32 flags) { // Allocate the structure if necessary if (!pgw) { if (!(pgw = gfxAlloc(vmt->size))) @@ -324,13 +324,13 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s #endif #if GDISP_NEED_ARCSECTORS - void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors) { + void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors) { if (!_gwinDrawStart(gh)) return; gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color); _gwinDrawEnd(gh); } - void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors) { + void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors) { if (!_gwinDrawStart(gh)) return; gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color); _gwinDrawEnd(gh); diff --git a/src/gwin/gwin.h b/src/gwin/gwin.h index ed48de11..b55cb381 100644 --- a/src/gwin/gwin.h +++ b/src/gwin/gwin.h @@ -50,7 +50,7 @@ typedef struct GWindowObject { gCoord height; /**< The height of this window */ gColor color; /**< The current foreground drawing color */ gColor bgcolor; /**< The current background drawing color */ - uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */ + gU32 flags; /**< Window flags (the meaning is private to the GWIN class) */ #if GDISP_NEED_TEXT gFont font; /**< The current font */ #endif @@ -830,7 +830,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s * * @api */ - void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors); + void gwinDrawArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors); /* * @brief Draw a filled selection of 45 degree arcs of a circle in the window. @@ -853,7 +853,7 @@ void gwinBlitArea(GHandle gh, gCoord x, gCoord y, gCoord cx, gCoord cy, gCoord s * * @api */ - void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, uint8_t sectors); + void gwinFillArcSectors(GHandle gh, gCoord x, gCoord y, gCoord radius, gU8 sectors); #endif /*------------------------------------------------- diff --git a/src/gwin/gwin_button.c b/src/gwin/gwin_button.c index 2b65856f..7d588e80 100644 --- a/src/gwin/gwin_button.c +++ b/src/gwin/gwin_button.c @@ -67,14 +67,14 @@ #if GINPUT_NEED_TOGGLE // A toggle off has occurred - static void ButtonToggleOff(GWidgetObject *gw, uint16_t role) { + static void ButtonToggleOff(GWidgetObject *gw, gU16 role) { (void) role; gw->g.flags &= ~GBUTTON_FLG_PRESSED; _gwinUpdate((GHandle)gw); } // A toggle on has occurred - static void ButtonToggleOn(GWidgetObject *gw, uint16_t role) { + static void ButtonToggleOn(GWidgetObject *gw, gU16 role) { (void) role; gw->g.flags |= GBUTTON_FLG_PRESSED; _gwinUpdate((GHandle)gw); @@ -82,12 +82,12 @@ _gwinSendEvent(&gw->g, GEVENT_GWIN_BUTTON); } - static void ButtonToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void ButtonToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GButtonObject *)gw)->toggle = instance; } - static uint16_t ButtonToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 ButtonToggleGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GButtonObject *)gw)->toggle; } diff --git a/src/gwin/gwin_button.h b/src/gwin/gwin_button.h index 4a80cdf7..ff6e0a22 100644 --- a/src/gwin/gwin_button.h +++ b/src/gwin/gwin_button.h @@ -54,7 +54,7 @@ typedef GEventGWin GEventGWinButton; typedef struct GButtonObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t toggle; + gU16 toggle; #endif } GButtonObject; diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c index 3be66e6b..7d09bddf 100644 --- a/src/gwin/gwin_checkbox.c +++ b/src/gwin/gwin_checkbox.c @@ -69,19 +69,19 @@ static void SendCheckboxEvent(GWidgetObject *gw) { #endif #if GINPUT_NEED_TOGGLE - static void CheckboxToggleOn(GWidgetObject *gw, uint16_t role) { + static void CheckboxToggleOn(GWidgetObject *gw, gU16 role) { (void) role; gw->g.flags ^= GCHECKBOX_FLG_CHECKED; _gwinUpdate((GHandle)gw); SendCheckboxEvent(gw); } - static void CheckboxToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void CheckboxToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GCheckboxObject *)gw)->toggle = instance; } - static uint16_t CheckboxToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 CheckboxToggleGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GCheckboxObject *)gw)->toggle; } diff --git a/src/gwin/gwin_checkbox.h b/src/gwin/gwin_checkbox.h index e67ff3ab..2b7ef9e9 100644 --- a/src/gwin/gwin_checkbox.h +++ b/src/gwin/gwin_checkbox.h @@ -57,7 +57,7 @@ typedef struct GEventGWinCheckbox { typedef struct GCheckboxObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t toggle; + gU16 toggle; #endif } GCheckboxObject; diff --git a/src/gwin/gwin_class.h b/src/gwin/gwin_class.h index 6d66e3d7..05a4bbf4 100644 --- a/src/gwin/gwin_class.h +++ b/src/gwin/gwin_class.h @@ -54,7 +54,7 @@ */ typedef struct gwinVMT { const char * classname; /**< The GWIN classname (mandatory) */ - size_t size; /**< The size of the class object */ + gMemSize size; /**< The size of the class object */ void (*Destroy) (GWindowObject *gh); /**< The GWIN destroy function (optional) */ void (*Redraw) (GWindowObject *gh); /**< The GWIN redraw routine (optional) */ void (*AfterClear) (GWindowObject *gh); /**< The GWIN after-clear function (optional) */ @@ -66,7 +66,7 @@ typedef struct gwinVMT { /** * @brief An toggle/dial instance is not being used */ - #define GWIDGET_NO_INSTANCE ((uint16_t)-1) + #define GWIDGET_NO_INSTANCE ((gU16)-1) /** * @brief The source handle that widgets use when sending events @@ -99,19 +99,19 @@ typedef struct gwinVMT { #endif #if GINPUT_NEED_TOGGLE struct { - uint16_t toggleroles; /**< The roles supported for toggles (0->toggleroles-1) */ - void (*ToggleAssign) (GWidgetObject *gw, uint16_t role, uint16_t instance); /**< Assign a toggle to a role (optional) */ - uint16_t (*ToggleGet) (GWidgetObject *gw, uint16_t role); /**< Return the instance for a particular role (optional) */ - void (*ToggleOff) (GWidgetObject *gw, uint16_t role); /**< Process toggle off events (optional) */ - void (*ToggleOn) (GWidgetObject *gw, uint16_t role); /**< Process toggle on events (optional) */ + gU16 toggleroles; /**< The roles supported for toggles (0->toggleroles-1) */ + void (*ToggleAssign) (GWidgetObject *gw, gU16 role, gU16 instance); /**< Assign a toggle to a role (optional) */ + gU16 (*ToggleGet) (GWidgetObject *gw, gU16 role); /**< Return the instance for a particular role (optional) */ + void (*ToggleOff) (GWidgetObject *gw, gU16 role); /**< Process toggle off events (optional) */ + void (*ToggleOn) (GWidgetObject *gw, gU16 role); /**< Process toggle on events (optional) */ }; #endif #if GINPUT_NEED_DIAL struct { - uint16_t dialroles; /**< The roles supported for dials (0->dialroles-1) */ - void (*DialAssign) (GWidgetObject *gw, uint16_t role, uint16_t instance); /**< Test the role and save the dial instance handle (optional) */ - uint16_t (*DialGet) (GWidgetObject *gw, uint16_t role); /**< Return the instance for a particular role (optional) */ - void (*DialMove) (GWidgetObject *gw, uint16_t role, uint16_t value, uint16_t max); /**< Process dial move events (optional) */ + gU16 dialroles; /**< The roles supported for dials (0->dialroles-1) */ + void (*DialAssign) (GWidgetObject *gw, gU16 role, gU16 instance); /**< Test the role and save the dial instance handle (optional) */ + gU16 (*DialGet) (GWidgetObject *gw, gU16 role); /**< Return the instance for a particular role (optional) */ + void (*DialMove) (GWidgetObject *gw, gU16 role, gU16 value, gU16 max); /**< Process dial move events (optional) */ }; #endif } gwidgetVMT; @@ -185,7 +185,7 @@ typedef struct gwinVMT { * * @notapi */ -GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint32_t flags); +GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, gU32 flags); /** * @brief Redraw the window after a status change. diff --git a/src/gwin/gwin_console.c b/src/gwin/gwin_console.c index cf331e59..67593557 100644 --- a/src/gwin/gwin_console.c +++ b/src/gwin/gwin_console.c @@ -42,23 +42,23 @@ #define Stream2GWindow(ip) ((GHandle)(((char *)(ip)) - (size_t)(&(((GConsoleObject *)0)->stream)))) #if CH_KERNEL_MAJOR == 2 - static size_t GWinStreamWrite(void *ip, const uint8_t *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } - static size_t GWinStreamRead(void *ip, uint8_t *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } - static msg_t GWinStreamPut(void *ip, uint8_t b) { gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } + static size_t GWinStreamWrite(void *ip, const gU8 *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } + static size_t GWinStreamRead(void *ip, gU8 *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } + static msg_t GWinStreamPut(void *ip, gU8 b) { gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } static msg_t GWinStreamGet(void *ip) {(void)ip; return RDY_OK; } - static msg_t GWinStreamPutTimed(void *ip, uint8_t b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } + static msg_t GWinStreamPutTimed(void *ip, gU8 b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return RDY_OK; } static msg_t GWinStreamGetTimed(void *ip, systime_t timeout) { (void)ip; (void)timeout; return RDY_OK; } - static size_t GWinStreamWriteTimed(void *ip, const uint8_t *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } - static size_t GWinStreamReadTimed(void *ip, uint8_t *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } + static size_t GWinStreamWriteTimed(void *ip, const gU8 *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return RDY_OK; } + static size_t GWinStreamReadTimed(void *ip, gU8 *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } #elif CH_KERNEL_MAJOR == 3 - static size_t GWinStreamWrite(void *ip, const uint8_t *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } - static size_t GWinStreamRead(void *ip, uint8_t *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } - static msg_t GWinStreamPut(void *ip, uint8_t b) { gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } + static size_t GWinStreamWrite(void *ip, const gU8 *bp, size_t n) { gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } + static size_t GWinStreamRead(void *ip, gU8 *bp, size_t n) { (void)ip; (void)bp; (void)n; return 0; } + static msg_t GWinStreamPut(void *ip, gU8 b) { gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } static msg_t GWinStreamGet(void *ip) {(void)ip; return MSG_OK; } - static msg_t GWinStreamPutTimed(void *ip, uint8_t b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } + static msg_t GWinStreamPutTimed(void *ip, gU8 b, systime_t time) { (void)time; gwinPutChar(Stream2GWindow(ip), (char)b); return MSG_OK; } static msg_t GWinStreamGetTimed(void *ip, systime_t timeout) { (void)ip; (void)timeout; return MSG_OK; } - static size_t GWinStreamWriteTimed(void *ip, const uint8_t *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } - static size_t GWinStreamReadTimed(void *ip, uint8_t *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } + static size_t GWinStreamWriteTimed(void *ip, const gU8 *bp, size_t n, systime_t time) { (void)time; gwinPutCharArray(Stream2GWindow(ip), (const char *)bp, n); return MSG_OK; } + static size_t GWinStreamReadTimed(void *ip, gU8 *bp, size_t n, systime_t time) { (void)ip; (void)bp; (void)n; (void)time; return 0; } #endif struct GConsoleWindowVMT_t { @@ -79,8 +79,8 @@ #if GWIN_CONSOLE_ESCSEQ // Convert escape sequences to attributes - static gBool ESCtoAttr(char c, uint8_t *pattr) { - uint8_t attr; + static gBool ESCtoAttr(char c, gU8 *pattr) { + gU8 attr; attr = pattr[0]; switch(c) { @@ -157,7 +157,7 @@ */ static void scrollBuffer(GConsoleObject *gcw) { char *p, *ep; - size_t dp; + gPtrDiff dp; // Only scroll if we need to if (!gcw->buffer || (gcw->g.flags & GCONSOLE_FLG_NOSTORE)) @@ -256,7 +256,7 @@ // Do we have enough space in the buffer if (gcw->bufpos >= gcw->bufsize) { char *p, *ep; - size_t dp; + gPtrDiff dp; /** * This should never really happen except if the user has changed the window @@ -433,7 +433,7 @@ GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *p void gwinPutChar(GHandle gh, char c) { #define gcw ((GConsoleObject *)gh) - uint8_t width, fy; + gU8 width, fy; if (gh->vmt != &consoleVMT || !gh->font) return; @@ -625,7 +625,7 @@ void gwinPutString(GHandle gh, const char *str) { gwinPutChar(gh, *str++); } -void gwinPutCharArray(GHandle gh, const char *str, size_t n) { +void gwinPutCharArray(GHandle gh, const char *str, gMemSize n) { while(n--) gwinPutChar(gh, *str++); } diff --git a/src/gwin/gwin_console.h b/src/gwin/gwin_console.h index fdf77e67..437968e0 100644 --- a/src/gwin/gwin_console.h +++ b/src/gwin/gwin_console.h @@ -34,15 +34,15 @@ typedef struct GConsoleObject { gCoord cx, cy; // Cursor position #if GWIN_CONSOLE_ESCSEQ - uint8_t startattr; // ANSI-like escape sequences - uint8_t currattr; - uint16_t escstate; + gU8 startattr; // ANSI-like escape sequences + gU8 currattr; + gU16 escstate; #endif #if GWIN_CONSOLE_USE_HISTORY char * buffer; // buffer to store console content - size_t bufsize; // size of buffer - size_t bufpos; // the position of the next char + gMemSize bufsize; // size of buffer + gMemSize bufpos; // the position of the next char #endif #if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM @@ -141,7 +141,7 @@ void gwinPutString(GHandle gh, const char *str); * * @api */ -void gwinPutCharArray(GHandle gh, const char *str, size_t n); +void gwinPutCharArray(GHandle gh, const char *str, gMemSize n); /** * @brief Print a formatted string at the cursor position in the window. It will wrap lines as required. diff --git a/src/gwin/gwin_container.c b/src/gwin/gwin_container.c index 7757ed5b..7f5f60bc 100644 --- a/src/gwin/gwin_container.c +++ b/src/gwin/gwin_container.c @@ -134,7 +134,7 @@ static const gcontainerVMT containerVMT = { 0, // A child has been deleted (optional) }; -GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gc, const GWidgetInit *pInit, uint32_t flags) { +GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gc, const GWidgetInit *pInit, gU32 flags) { if (!(gc = (GContainerObject *)_gcontainerCreate(g, gc, pInit, &containerVMT))) return 0; diff --git a/src/gwin/gwin_container.h b/src/gwin/gwin_container.h index 2ac7f605..3460e3b7 100644 --- a/src/gwin/gwin_container.h +++ b/src/gwin/gwin_container.h @@ -113,7 +113,7 @@ gCoord gwinGetInnerHeight(GHandle gh); * * @api */ -GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gw, const GWidgetInit *pInit, uint32_t flags); +GHandle gwinGContainerCreate(GDisplay *g, GContainerObject *gw, const GWidgetInit *pInit, gU32 flags); #define gwinContainerCreate(gc, pInit, flags) gwinGContainerCreate(GDISP, gc, pInit, flags) diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c index 13998bda..402da514 100644 --- a/src/gwin/gwin_frame.c +++ b/src/gwin/gwin_frame.c @@ -208,7 +208,7 @@ static const gcontainerVMT frameVMT = { 0, // A child has been deleted (optional) }; -GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint32_t flags) { +GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, gU32 flags) { if (!(fo = (GFrameObject *)_gcontainerCreate(g, (GContainerObject *)fo, pInit, &frameVMT))) return 0; diff --git a/src/gwin/gwin_frame.h b/src/gwin/gwin_frame.h index 89efa4c6..df26008d 100644 --- a/src/gwin/gwin_frame.h +++ b/src/gwin/gwin_frame.h @@ -68,7 +68,7 @@ typedef GContainerObject GFrameObject; * * @api */ -GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint32_t flags); +GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, gU32 flags); #define gwinFrameCreate(fo, pInit, flags) gwinGFrameCreate(GDISP, fo, pInit, flags); /** diff --git a/src/gwin/gwin_graph.h b/src/gwin/gwin_graph.h index 71bee1b0..20def920 100644 --- a/src/gwin/gwin_graph.h +++ b/src/gwin/gwin_graph.h @@ -61,7 +61,7 @@ typedef struct GGraphStyle_t { GGraphLineStyle yaxis; GGraphGridStyle xgrid; GGraphGridStyle ygrid; - uint16_t flags; + gU16 flags; #define GWIN_GRAPH_STYLE_XAXIS_POSITIVE_ARROWS 0x0001 #define GWIN_GRAPH_STYLE_XAXIS_NEGATIVE_ARROWS 0x0002 #define GWIN_GRAPH_STYLE_YAXIS_POSITIVE_ARROWS 0x0004 diff --git a/src/gwin/gwin_keyboard.c b/src/gwin/gwin_keyboard.c index 88d97583..70257f36 100644 --- a/src/gwin/gwin_keyboard.c +++ b/src/gwin/gwin_keyboard.c @@ -17,12 +17,12 @@ #include "gwin_class.h" #include "gwin_keyboard_layout.h" -typedef uint8_t utf8; -typedef uint16_t utf16; -typedef uint32_t utf32; +typedef gU8 utf8; +typedef gU16 utf16; +typedef gU32 utf32; // A character code - note this is not UTF-32 but a representation of the UTF-8 code stream for a single character. -typedef uint32_t ucode; +typedef gU32 ucode; static GSourceHandle AllKeyboards; @@ -393,7 +393,7 @@ void gwinKeyboardDraw_Normal(GWidgetObject *gw, void *param) { const char *pcap; const utf8 *krow; gCoord x, y, cx, cy; - uint8_t rows, cols, row, col, kcols; + gU8 rows, cols, row, col, kcols; ucode key; fixed fx, fy; const GColorSet *pcol; diff --git a/src/gwin/gwin_keyboard.h b/src/gwin/gwin_keyboard.h index aec159ea..653ed218 100644 --- a/src/gwin/gwin_keyboard.h +++ b/src/gwin/gwin_keyboard.h @@ -59,9 +59,9 @@ typedef struct GKeyboardObject { const char **keyset; gCoord keyx, keyy; gCoord keycx, keycy; - uint8_t lastkeyrow, lastkeycol; - uint8_t keyrow, keycol; - uint32_t key; + gU8 lastkeyrow, lastkeycol; + gU8 keyrow, keycol; + gU32 key; } GKeyboardObject; /** diff --git a/src/gwin/gwin_keyboard_layout.h b/src/gwin/gwin_keyboard_layout.h index 9a2db343..b35bd139 100644 --- a/src/gwin/gwin_keyboard_layout.h +++ b/src/gwin/gwin_keyboard_layout.h @@ -52,11 +52,11 @@ typedef struct GVSpecialKey { const char const *keycap; // The caption on the key const char const *sendkey; // The key to send (NULL means none) - uint8_t flags; // Flags + gU8 flags; // Flags #define GVKEY_INVERT 0x01 // Invert the color #define GVKEY_SINGLESET 0x02 // Change set when this key is pressed but only for a single keystroke #define GVKEY_LOCKSET 0x04 // Change set when this key is pressed but stay there until the set is changed by the user - uint8_t newset; // The new set to change to + gU8 newset; // The new set to change to } GVSpecialKey; typedef const char **GVKeySet; // Array of Rows - Null indicates the end diff --git a/src/gwin/gwin_list.c b/src/gwin/gwin_list.c index 76e4da3a..82b5c106 100644 --- a/src/gwin/gwin_list.c +++ b/src/gwin/gwin_list.c @@ -179,7 +179,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { #if GINPUT_NEED_TOGGLE // a toggle-on has occurred - static void ListToggleOn(GWidgetObject *gw, uint16_t role) { + static void ListToggleOn(GWidgetObject *gw, gU16 role) { const gfxQueueASyncItem * qi; const gfxQueueASyncItem * qix; int i; @@ -236,14 +236,14 @@ static void sendListEvent(GWidgetObject *gw, int item) { } } - static void ListToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void ListToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { if (role) gw2obj->t_up = instance; else gw2obj->t_dn = instance; } - static uint16_t ListToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 ListToggleGet(GWidgetObject *gw, gU16 role) { return role ? gw2obj->t_up : gw2obj->t_dn; } #endif @@ -356,7 +356,7 @@ int gwinListAddItem(GHandle gh, const char* text, gBool useAlloc) { return -1; if (useAlloc) { - size_t len = strlen(text)+1; + gMemSize len = strlen(text)+1; if (!(newItem = gfxAlloc(sizeof(ListItem) + len))) return -1; @@ -409,7 +409,7 @@ void gwinListItemSetText(GHandle gh, int item, const char* text, gBool useAlloc) // create the new object if (useAlloc) { - size_t len = strlen(text)+1; + gMemSize len = strlen(text)+1; if (!(newItem = gfxAlloc(sizeof(ListItem) + len))) return; @@ -498,7 +498,7 @@ int gwinListGetSelected(GHandle gh) { return -1; } -void gwinListItemSetParam(GHandle gh, int item, uint16_t param) { +void gwinListItemSetParam(GHandle gh, int item, gU16 param) { const gfxQueueASyncItem * qi; int i; @@ -559,7 +559,7 @@ void gwinListItemDelete(GHandle gh, int item) { } } -uint16_t gwinListItemGetParam(GHandle gh, int item) { +gU16 gwinListItemGetParam(GHandle gh, int item) { const gfxQueueASyncItem * qi; int i; diff --git a/src/gwin/gwin_list.h b/src/gwin/gwin_list.h index 34c5e249..a8f915fe 100644 --- a/src/gwin/gwin_list.h +++ b/src/gwin/gwin_list.h @@ -57,8 +57,8 @@ typedef struct GListObject { gCoord last_mouse_y; #endif #if GINPUT_NEED_TOGGLE - uint16_t t_up; - uint16_t t_dn; + gU16 t_up; + gU16 t_dn; #endif int cnt; // Number of items currently in the list (quicker than counting each time) @@ -95,9 +95,9 @@ typedef enum scroll_t { scrollAlways, scrollAuto, scrollSmooth } scroll_t; typedef struct ListItem { gfxQueueASyncItem q_item; // This must be the first member in the struct - uint16_t flags; + gU16 flags; #define GLIST_FLG_SELECTED 0x0001 - uint16_t param; // A parameter the user can specify himself + gU16 param; // A parameter the user can specify himself const char* text; #if GWIN_NEED_LIST_IMAGES gdispImage* pimg; @@ -218,7 +218,7 @@ int gwinListFindText(GHandle gh, const char* text); * * @api */ -void gwinListItemSetParam(GHandle gh, int item, uint16_t param); +void gwinListItemSetParam(GHandle gh, int item, gU16 param); /** * @brief Get the custom parameter of an item with a given ID @@ -230,7 +230,7 @@ void gwinListItemSetParam(GHandle gh, int item, uint16_t param); * * @api */ -uint16_t gwinListItemGetParam(GHandle gh, int item); +gU16 gwinListItemGetParam(GHandle gh, int item); /** * @brief Delete all the items of the list diff --git a/src/gwin/gwin_radio.c b/src/gwin/gwin_radio.c index c1450611..c3d1564a 100644 --- a/src/gwin/gwin_radio.c +++ b/src/gwin/gwin_radio.c @@ -69,18 +69,18 @@ static void SendRadioEvent(GWidgetObject *gw) { #if GINPUT_NEED_TOGGLE // A toggle on has occurred - static void RadioToggleOn(GWidgetObject *gw, uint16_t role) { + static void RadioToggleOn(GWidgetObject *gw, gU16 role) { (void) role; gwinRadioPress((GHandle)gw); } - static void RadioToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void RadioToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GRadioObject *)gw)->toggle = instance; } - static uint16_t RadioToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 RadioToggleGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GRadioObject *)gw)->toggle; } @@ -127,7 +127,7 @@ static const gwidgetVMT radioVMT = { #endif }; -GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gw, const GWidgetInit *pInit, uint16_t group) { +GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gw, const GWidgetInit *pInit, gU16 group) { if (!(gw = (GRadioObject *)_gwidgetCreate(g, &gw->w, pInit, &radioVMT))) return 0; @@ -161,7 +161,7 @@ gBool gwinRadioIsPressed(GHandle gh) { return (gh->flags & GRADIO_FLG_PRESSED) ? gTrue : gFalse; } -GHandle gwinRadioGetActive(uint16_t group) { +GHandle gwinRadioGetActive(gU16 group) { GHandle gh; for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) { diff --git a/src/gwin/gwin_radio.h b/src/gwin/gwin_radio.h index a3cb194d..05d2742f 100644 --- a/src/gwin/gwin_radio.h +++ b/src/gwin/gwin_radio.h @@ -42,7 +42,7 @@ typedef struct GEventGWinRadio { #if GWIN_WIDGET_TAGS WidgetTag tag; // The radio tag #endif - uint16_t group; // The group for this radio button + gU16 group; // The group for this radio button } GEventGWinRadio; /** @@ -60,9 +60,9 @@ typedef struct GEventGWinRadio { typedef struct GRadioObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t toggle; + gU16 toggle; #endif - uint16_t group; + gU16 group; } GRadioObject; /** @@ -88,7 +88,7 @@ typedef struct GRadioObject { * * @api */ -GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gb, const GWidgetInit *pInit, uint16_t group); +GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gb, const GWidgetInit *pInit, gU16 group); #define gwinRadioCreate(w, pInit, gr) gwinGRadioCreate(GDISP, w, pInit, gr) /** @@ -120,7 +120,7 @@ gBool gwinRadioIsPressed(GHandle gh); * * @api */ -GHandle gwinRadioGetActive(uint16_t group); +GHandle gwinRadioGetActive(gU16 group); /** * @defgroup Renderings_Radiobutton Renderings diff --git a/src/gwin/gwin_slider.c b/src/gwin/gwin_slider.c index a87ef9ed..22373027 100644 --- a/src/gwin/gwin_slider.c +++ b/src/gwin/gwin_slider.c @@ -42,7 +42,7 @@ static int SliderCalcPosFromDPos(GSliderObject *gsw) { } // Send the slider event -static void SendSliderEvent(GSliderObject *gsw, uint8_t action) { +static void SendSliderEvent(GSliderObject *gsw, gU8 action) { GSourceListener * psl; GEvent * pe; #define pse ((GEventGWinSlider *)pe) @@ -178,7 +178,7 @@ static void SliderResetDisplayPos(GSliderObject *gsw) { #if GINPUT_NEED_TOGGLE // A toggle on has occurred - static void SliderToggleOn(GWidgetObject *gw, uint16_t role) { + static void SliderToggleOn(GWidgetObject *gw, gU16 role) { #define gsw ((GSliderObject *)gw) if (role) { @@ -191,26 +191,26 @@ static void SliderResetDisplayPos(GSliderObject *gsw) { #undef gsw } - static void SliderToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void SliderToggleAssign(GWidgetObject *gw, gU16 role, gU16 instance) { if (role) ((GSliderObject *)gw)->t_up = instance; else ((GSliderObject *)gw)->t_dn = instance; } - static uint16_t SliderToggleGet(GWidgetObject *gw, uint16_t role) { + static gU16 SliderToggleGet(GWidgetObject *gw, gU16 role) { return role ? ((GSliderObject *)gw)->t_up : ((GSliderObject *)gw)->t_dn; } #endif #if GINPUT_NEED_DIAL // A dial move event - static void SliderDialMove(GWidgetObject *gw, uint16_t role, uint16_t value, uint16_t max) { + static void SliderDialMove(GWidgetObject *gw, gU16 role, gU16 value, gU16 max) { #define gsw ((GSliderObject *)gw) (void) role; // Set the new position - gsw->pos = (uint16_t)((uint32_t)value*(gsw->max-gsw->min)/max + gsw->min); + gsw->pos = (gU16)((gU32)value*(gsw->max-gsw->min)/max + gsw->min); SliderResetDisplayPos(gsw); _gwinUpdate(&gsw->w.g); @@ -220,12 +220,12 @@ static void SliderResetDisplayPos(GSliderObject *gsw) { #undef gsw } - static void SliderDialAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { + static void SliderDialAssign(GWidgetObject *gw, gU16 role, gU16 instance) { (void) role; ((GSliderObject *)gw)->dial = instance; } - static uint16_t SliderDialGet(GWidgetObject *gw, uint16_t role) { + static gU16 SliderDialGet(GWidgetObject *gw, gU16 role) { (void) role; return ((GSliderObject *)gw)->dial; } diff --git a/src/gwin/gwin_slider.h b/src/gwin/gwin_slider.h index 0b11385b..4eb9ed41 100644 --- a/src/gwin/gwin_slider.h +++ b/src/gwin/gwin_slider.h @@ -36,7 +36,7 @@ typedef struct GEventGWinSlider { #endif int position; - uint8_t action; + gU8 action; #define GSLIDER_EVENT_SET 4 /* Slider position is set. This is the only event returned by default */ #define GSLIDER_EVENT_CANCEL 3 /* Slider position changing has been cancelled */ #define GSLIDER_EVENT_START 2 /* Slider position has started changing */ @@ -57,11 +57,11 @@ typedef struct GEventGWinSlider { typedef struct GSliderObject { GWidgetObject w; #if GINPUT_NEED_TOGGLE - uint16_t t_dn; - uint16_t t_up; + gU16 t_dn; + gU16 t_up; #endif #if GINPUT_NEED_DIAL - uint16_t dial; + gU16 dial; #endif gCoord dpos; int min; diff --git a/src/gwin/gwin_tabset.c b/src/gwin/gwin_tabset.c index abfd9823..80a5f10d 100644 --- a/src/gwin/gwin_tabset.c +++ b/src/gwin/gwin_tabset.c @@ -288,7 +288,7 @@ static const gcontainerVMT tabsetVMT = { 0, // A child has been deleted (optional) }; -GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, uint32_t flags) { +GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, gU32 flags) { if (!(fo = (GTabsetObject *)_gcontainerCreate(g, (GContainerObject *)fo, pInit, &tabsetVMT))) return 0; diff --git a/src/gwin/gwin_tabset.h b/src/gwin/gwin_tabset.h index d01f9d9a..f2bde48b 100644 --- a/src/gwin/gwin_tabset.h +++ b/src/gwin/gwin_tabset.h @@ -76,7 +76,7 @@ typedef struct GTabsetObject { * * @api */ -GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, uint32_t flags); +GHandle gwinGTabsetCreate(GDisplay *g, GTabsetObject *fo, GWidgetInit *pInit, gU32 flags); #define gwinTabsetCreate(fo, pInit, flags) gwinGTabsetCreate(GDISP, fo, pInit, flags); /** diff --git a/src/gwin/gwin_textedit.c b/src/gwin/gwin_textedit.c index 853da0b7..3a2626d0 100644 --- a/src/gwin/gwin_textedit.c +++ b/src/gwin/gwin_textedit.c @@ -88,7 +88,7 @@ static gBool TextEditAddChars(GHandle gh, unsigned cnt) { // and do the comparation directly inside of that loop so we only iterate // the string once. static void TextEditMouseDown(GWidgetObject* gw, gCoord x, gCoord y) { - uint16_t i = 0; + gU16 i = 0; (void)y; @@ -118,7 +118,7 @@ static void TextEditMouseDown(GWidgetObject* gw, gCoord x, gCoord y) { // Is it a special key? if (pke->keystate & GKEYSTATE_SPECIAL) { // Arrow keys to move the cursor - gwinTextEditSendSpecialKey(&gw->g, (uint8_t)pke->c[0]); + gwinTextEditSendSpecialKey(&gw->g, (gU8)pke->c[0]); return; } @@ -167,7 +167,7 @@ static const gwidgetVMT texteditVMT = { #endif }; -GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, size_t maxSize) +GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, gMemSize maxSize) { // Create the underlying widget if (!(wt = (GTexteditObject*)_gwidgetCreate(g, &wt->w, pInit, &texteditVMT))) @@ -184,7 +184,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit } #if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || GWIN_NEED_KEYBOARD - void gwinTextEditSendSpecialKey(GHandle gh, uint8_t key) { + void gwinTextEditSendSpecialKey(GHandle gh, gU8 key) { // Is it a valid handle? if (gh->vmt != (gwinVMT*)&texteditVMT) return; @@ -224,7 +224,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit return; // Normal key press - switch((uint8_t)key[0]) { + switch((gU8)key[0]) { case GKEY_BACKSPACE: // Backspace if (!gh2obj->cursorPos) @@ -246,7 +246,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit break; default: // Ignore any other control characters - if ((uint8_t)key[0] < GKEY_SPACE) + if ((gU8)key[0] < GKEY_SPACE) return; // Keep the edit length to less than the maximum diff --git a/src/gwin/gwin_textedit.h b/src/gwin/gwin_textedit.h index 496b6408..c32f98e0 100644 --- a/src/gwin/gwin_textedit.h +++ b/src/gwin/gwin_textedit.h @@ -36,8 +36,8 @@ typedef struct GTexteditObject { GWidgetObject w; char* textBuffer; - size_t maxSize; - uint16_t cursorPos; + gMemSize maxSize; + gU16 cursorPos; } GTexteditObject; /** @@ -56,7 +56,7 @@ typedef struct GTexteditObject { * @note If the initial text set is larger than maxSize then the text is truncated at maxSize characters. * @api */ -GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, size_t maxSize); +GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, gMemSize maxSize); #define gwinTexteditCreate(wt, pInit, maxSize) gwinGTexteditCreate(GDISP, wt, pInit, maxSize) /** @@ -67,7 +67,7 @@ GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit * @pre Requires GINPUT_NEED_KEYBOARD or GWIN_NEED_KEYBOARD to be on * @api */ -void gwinTextEditSendSpecialKey(GHandle gh, uint8_t key); +void gwinTextEditSendSpecialKey(GHandle gh, gU8 key); /** * @brief Send a normal utf8 character to the textedit diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index 8da2ebdd..94b9dd33 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -107,7 +107,7 @@ static void gwidgetEvent(void *param, GEvent *pe) { GHandle gh;
#endif
#if GINPUT_NEED_TOGGLE || GINPUT_NEED_DIAL
- uint16_t role;
+ gU16 role;
#endif
#endif
@@ -346,9 +346,9 @@ static void gwidgetEvent(void *param, GEvent *pe) { #endif
#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
- static GHandle FindToggleUser(uint16_t instance) {
+ static GHandle FindToggleUser(gU16 instance) {
GHandle gh;
- uint16_t role;
+ gU16 role;
for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) {
if (!(gh->flags & GWIN_FLG_WIDGET)) // check if it a widget
@@ -364,9 +364,9 @@ static void gwidgetEvent(void *param, GEvent *pe) { #endif
#if GFX_USE_GINPUT && GINPUT_NEED_DIAL
- static GHandle FindDialUser(uint16_t instance) {
+ static GHandle FindDialUser(gU16 instance) {
GHandle gh;
- uint16_t role;
+ gU16 role;
for(gh = gwinGetNextWindow(0); gh; gh = gwinGetNextWindow(gh)) {
if (!(gh->flags & GWIN_FLG_WIDGET)) // check if it a widget
@@ -420,7 +420,7 @@ GHandle _gwidgetCreate(GDisplay *g, GWidgetObject *pgw, const GWidgetInit *pInit void _gwidgetDestroy(GHandle gh) {
#if GFX_USE_GINPUT && (GINPUT_NEED_TOGGLE || GINPUT_NEED_DIAL)
- uint16_t role, instance;
+ gU16 role, instance;
#endif
// Make the window is invisible so it is not eligible for focus
@@ -635,7 +635,7 @@ gBool gwinAttachListener(GListener *pl) { }
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
- gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(uint16_t instance) {
+ gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(gU16 instance) {
// This is now a NULL event because we automatically attach to all mice in the system.
(void) instance;
return gTrue;
@@ -643,9 +643,9 @@ gBool gwinAttachListener(GListener *pl) { #endif
#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
- gBool gwinAttachToggle(GHandle gh, uint16_t role, uint16_t instance) {
+ gBool gwinAttachToggle(GHandle gh, gU16 role, gU16 instance) {
GSourceHandle gsh;
- uint16_t oi;
+ gU16 oi;
// Is this a widget
if (!(gh->flags & GWIN_FLG_WIDGET))
@@ -676,8 +676,8 @@ gBool gwinAttachListener(GListener *pl) { return geventAttachSource(&gl, gsh, GLISTEN_TOGGLE_ON|GLISTEN_TOGGLE_OFF);
}
- gBool gwinDetachToggle(GHandle gh, uint16_t role) {
- uint16_t oi;
+ gBool gwinDetachToggle(GHandle gh, gU16 role) {
+ gU16 oi;
// Is this a widget
if (!(gh->flags & GWIN_FLG_WIDGET))
@@ -701,9 +701,9 @@ gBool gwinAttachListener(GListener *pl) { #endif
#if GFX_USE_GINPUT && GINPUT_NEED_DIAL
- gBool gwinAttachDial(GHandle gh, uint16_t role, uint16_t instance) {
+ gBool gwinAttachDial(GHandle gh, gU16 role, gU16 instance) {
GSourceHandle gsh;
- uint16_t oi;
+ gU16 oi;
if (!(gh->flags & GWIN_FLG_WIDGET))
return gFalse;
diff --git a/src/gwin/gwin_widget.h b/src/gwin/gwin_widget.h index 88943cc3..bd23de08 100644 --- a/src/gwin/gwin_widget.h +++ b/src/gwin/gwin_widget.h @@ -78,7 +78,7 @@ typedef void (*CustomWidgetDrawFunction)(struct GWidgetObject *gw, void *param); /** * @brief Defines a the type of a tag on a widget */ -typedef uint16_t WidgetTag; +typedef gU16 WidgetTag; /** * @brief The structure to initialise a widget. @@ -333,7 +333,7 @@ void gwinSetCustomDraw(GHandle gh, CustomWidgetDrawFunction fn, void *param); gBool gwinAttachListener(GListener *pl); #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) || defined(__DOXYGEN__) - gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(uint16_t instance); + gBool DEPRECATED("This call can now be removed. Attaching the mouse to GWIN is now automatic.") gwinAttachMouse(gU16 instance); #endif #if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) || defined(__DOXYGEN__) @@ -351,7 +351,7 @@ gBool gwinAttachListener(GListener *pl); * * @api */ - gBool gwinAttachToggle(GHandle gh, uint16_t role, uint16_t instance); + gBool gwinAttachToggle(GHandle gh, gU16 role, gU16 instance); /** * @brief Detach a toggle from a widget * @return gTrue on success @@ -365,7 +365,7 @@ gBool gwinAttachListener(GListener *pl); * * @api */ - gBool gwinDetachToggle(GHandle gh, uint16_t role); + gBool gwinDetachToggle(GHandle gh, gU16 role); #endif #if (GFX_USE_GINPUT && GINPUT_NEED_DIAL) || defined(__DOXYGEN__) @@ -383,7 +383,7 @@ gBool gwinAttachListener(GListener *pl); * * @api */ - gBool gwinAttachDial(GHandle gh, uint16_t role, uint16_t instance); + gBool gwinAttachDial(GHandle gh, gU16 role, gU16 instance); #endif #if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || GWIN_NEED_KEYBOARD || defined(__DOXYGEN__) diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c index eea44cb9..458d1408 100644 --- a/src/gwin/gwin_wm.c +++ b/src/gwin/gwin_wm.c @@ -171,7 +171,7 @@ static gfxQueueASync _GWINList; static GTimer RedrawTimer; static void RedrawTimerFn(void *param); #endif -static volatile uint8_t RedrawPending; +static volatile gU8 RedrawPending; #define DOREDRAW_INVISIBLES 0x01 #define DOREDRAW_VISIBLES 0x02 #define DOREDRAW_FLASHRUNNING 0x04 @@ -748,7 +748,7 @@ static void WM_Delete(GHandle gh) { } static void WM_Redraw(GHandle gh) { - uint32_t flags; + gU32 flags; flags = gh->flags; gh->flags &= ~(GWIN_FLG_NEEDREDRAW|GWIN_FLG_BGREDRAW|GWIN_FLG_PARENTREVEAL); |