From e699e549ac015cfe40da0134095a05254978bd47 Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 5 Oct 2015 07:39:58 +1000 Subject: Another minor update Also add new studio options file --- src/gqueue/gqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gqueue/gqueue.h b/src/gqueue/gqueue.h index 924024b7..40a41bce 100644 --- a/src/gqueue/gqueue.h +++ b/src/gqueue/gqueue.h @@ -385,7 +385,7 @@ GDataBuffer *gfxBufferGetI(void); /** @} */ /** - * @name BufferRelease) Functions + * @name BufferRelease() Functions * @brief Release a buffer back to the free list * * @param[in] pd The buffer to put (back) on the free-list. -- cgit v1.2.3 From 470868f51a9a937f0a045ca2081e4183bc76ec0c Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 6 Oct 2015 01:13:11 +1000 Subject: More STM32F746-Discovery changes. --- src/gos/gos_chibios.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gos/gos_chibios.c b/src/gos/gos_chibios.c index eb839dc6..d650caa0 100644 --- a/src/gos/gos_chibios.c +++ b/src/gos/gos_chibios.c @@ -158,13 +158,13 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_ { if (!stackarea) { if (!stacksz) stacksz = 256; - return chThdCreateFromHeap(0, stacksz, prio, fn, param); + return chThdCreateFromHeap(0, stacksz, prio, (tfunc_t)fn, param); } if (!stacksz) return 0; - return chThdCreateStatic(stackarea, stacksz, prio, fn, param); + return chThdCreateStatic(stackarea, stacksz, prio, (tfunc_t)fn, param); } #endif /* GFX_USE_OS_CHIBIOS */ -- cgit v1.2.3 From 25482f5c901e8c20d8b1110ea802f61dfac98ec8 Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 6 Oct 2015 12:01:29 +1000 Subject: Doco improvement --- src/gwin/gwin.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gwin/gwin.h b/src/gwin/gwin.h index 4a7d02bf..cc0d44f1 100644 --- a/src/gwin/gwin.h +++ b/src/gwin/gwin.h @@ -38,19 +38,22 @@ typedef struct GWindowObject *GHandle; typedef struct GWindowObject { #if GWIN_NEED_WINDOWMANAGER // This MUST be the first member of the structure - gfxQueueASyncItem wmq; // @< The next window (for the window manager) + gfxQueueASyncItem wmq; /**< The next window (for the window manager) */ #endif - const struct gwinVMT *vmt; // @< The VMT for this GWIN - GDisplay * display; // @< The display this window is on. - coord_t x, y; // @< Screen relative position - coord_t width, height; // @< Dimensions of this window - color_t color, bgcolor; // @< The current drawing colors - uint32_t flags; // @< Window flags (the meaning is private to the GWIN class) + const struct gwinVMT* vmt; /**< The VMT for this GWIN */ + GDisplay * display; /**< The display this window is on */ + coord_t x; /**< The position relative to the screen */ + coord_t y; /**< The position relative to the screen */ + coord_t width; /**< The width of this window */ + coord_t height; /**< The height of this window */ + color_t color; /**< The current foreground drawing color */ + color_t bgcolor; /**< The current background drawing color */ + uint32_t flags; /**< Window flags (the meaning is private to the GWIN class) */ #if GDISP_NEED_TEXT - font_t font; // @< The current font + font_t font; /**< The current font */ #endif #if GWIN_NEED_CONTAINERS - GHandle parent; // @< The parent window + GHandle parent; /**< The parent window */ #endif } GWindowObject, * GHandle; /** @} */ @@ -68,11 +71,13 @@ typedef struct GWindowObject { * @{ */ typedef struct GWindowInit { - coord_t x, y; // @< The initial position relative to its parent - coord_t width, height; // @< The initial dimension - bool_t show; // @< Should the window be visible initially + coord_t x; /**< The initial position relative to its parent */ + coord_t y; /**< The initial position relative to its parent */ + coord_t width; /**< The width */ + coord_t height; /**< The height */ + bool_t show; /**< Should the window be visible initially */ #if GWIN_NEED_CONTAINERS - GHandle parent; // @< The parent - must be a container or NULL + GHandle parent; /**< The parent - must be a container or NULL */ #endif } GWindowInit; /** @} */ -- cgit v1.2.3 From 53cb1af757a2d0b2a18276cdbbeb0bf826a8540c Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 6 Oct 2015 12:02:58 +1000 Subject: Add extra font metrics --- src/gdisp/gdisp.c | 16 +++++++++++++--- src/gdisp/gdisp.h | 21 +++++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 377ccddb..0ddee1f6 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -3313,6 +3313,8 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co case fontCharPadding: return 0; case fontMinWidth: return font->min_x_advance; case fontMaxWidth: return font->max_x_advance; + case fontBaselineX: return font->baseline_x; + case fontBaselineY: return font->baseline_y; } return 0; } @@ -3322,12 +3324,20 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co return mf_character_width(font, c); } - coord_t gdispGetStringWidth(const char* str, font_t font) { + coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count) { if (!str) return 0; - /* No mutex required as we only read static data */ - return mf_get_string_width(font, str, 0, 0); + // No mutex required as we only read static data + #if GDISP_NEED_TEXT_KERNING + return mf_get_string_width(font, str, count, TRUE); + #else + return mf_get_string_width(font, str, count, FALSE); + #endif + } + + coord_t gdispGetStringWidth(const char* str, font_t font) { + return gdispGetStringWidthCount(str, font, 0); } #endif diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 4513f3f7..d51ab917 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -72,7 +72,9 @@ typedef enum fontmetric { fontLineSpacing, /**< The line spacing */ fontCharPadding, /**< The char padding */ fontMinWidth, /**< The minimum width */ - fontMaxWidth /**< The maximum width */ + fontMaxWidth, /**< The maximum width */ + fontBaselineX, /**< The base line in x direction */ + fontBaselineY /**< The base line in y direction */ } fontmetric_t; /** @@ -976,7 +978,22 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co coord_t gdispGetCharWidth(char c, font_t font); /** - * @brief Get the pixel width of a string. + * @brief Get the pixel width of a string of a given character length. + * @return The width of the string in pixels. + * @pre GDISP_NEED_TEXT must be TRUE in your gfxconf.h + * + * @note Passing 0 to count has the same effect as calling gdispGetStringWidt() + * + * @param[in] str The string to measure + * @param[in] font The font to use + * @param[in] count The number of characters to take into account + * + * @api + */ + coord_t gdispGetStringWidthCount(const char* str, font_t font, uint16_t count); + + /** + * @brief Get the pixel width of an entire string. * @return The width of the string in pixels. * @pre GDISP_NEED_TEXT must be TRUE in your gfxconf.h * -- cgit v1.2.3 From 64a184fc591f7d6a17d903e37370d3f5b8a38bb1 Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 6 Oct 2015 12:03:24 +1000 Subject: Fix compiler warning --- src/gdisp/gdisp_image_gif.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gdisp/gdisp_image_gif.c b/src/gdisp/gdisp_image_gif.c index d5c6b3ca..88dac4c8 100644 --- a/src/gdisp/gdisp_image_gif.c +++ b/src/gdisp/gdisp_image_gif.c @@ -687,6 +687,7 @@ gdispImageError gdispImageCache_GIF(gdispImage *img) { // Check for interlacing cnt = 0; + q = 0; if (cache->frame.flags & GIFL_INTERLACE) { // Every 8th row starting at row 0 for(p=cache->imagebits, my=0; my < cache->frame.height; my+=8, p += cache->frame.width*7) { -- cgit v1.2.3 From ed946e24abceec13ef5430b4ea63ff589903fe6c Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 6 Oct 2015 12:03:51 +1000 Subject: Improve RAW32 compatibility with other libraries --- src/gos/gos_raw32.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/gos/gos_raw32.h b/src/gos/gos_raw32.h index 0fca9223..2937e52b 100644 --- a/src/gos/gos_raw32.h +++ b/src/gos/gos_raw32.h @@ -33,6 +33,13 @@ typedef unsigned char bool_t; #if __STDC_VERSION__ >= 199901L #include +#elif defined(__GNUC__) || defined(__GNUG__) + typedef __INT8_TYPE__ int8_t; + typedef __UINT8_TYPE__ uint8_t; + typedef __INT16_TYPE__ int16_t; + typedef __UINT16_TYPE__ uint16_t; + typedef __INT32_TYPE__ int32_t; + typedef __UINT32_TYPE__ uint32_t; #else typedef signed char int8_t; typedef unsigned char uint8_t; -- cgit v1.2.3