From 28f10aaa3a67a288a051c841866f6c68a90e880f Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 9 May 2014 21:35:30 +1000 Subject: Rename GWIN image header file to be consistent with all other controls and with its source file --- src/gwin/gimage.h | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/gwin/image.h | 127 ---------------------------------------------------- src/gwin/sys_defs.h | 2 +- 3 files changed, 128 insertions(+), 128 deletions(-) create mode 100644 src/gwin/gimage.h delete mode 100644 src/gwin/image.h (limited to 'src/gwin') diff --git a/src/gwin/gimage.h b/src/gwin/gimage.h new file mode 100644 index 00000000..fdaabc92 --- /dev/null +++ b/src/gwin/gimage.h @@ -0,0 +1,127 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +/** + * @file src/gwin/image.h + * @brief GWIN image widget header file. + * + * @defgroup Image Image + * @ingroup GWIN + * + * @details GWIN allos it to create an image widget. The widget + * takes no user input. + * + * @pre GFX_USE_GDISP must be set to TRUE in your gfxconf.h + * @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h + * @pre GDISP_NEED_IMAGE must be set to TRUE in your gfxconf.h + * @pre GWIN_NEED_IMAGE must be set to TRUE in your gfxconf.h + * @pre At least one image type must be enabled in your gfxconf.h + * + * @{ + */ + +#ifndef _GWIN_IMAGE_H +#define _GWIN_IMAGE_H + +// This file is included within "gwin/gwin.h" + +// An image window +typedef struct GImageObject { + GWindowObject g; + gdispImage image; // The image itself + #if GWIN_NEED_IMAGE_ANIMATION + GTimer timer; // Timer used for animated images + #endif +} GImageObject; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Create an image widget. + * @details Display's a picture. + * @return NULL if there is no resultant drawing area, otherwise the widget handle. + * + * @param[in] g The GDisplay to display this window on + * @param[in] widget The image widget structure to initialise. If this is NULL, the structure is dynamically allocated. + * @param[in] pInit The initialization parameters to use. + * + * @note The default background color gets set to the current default one. + * @note An image window knows how to redraw. + * + * @api + */ +GHandle gwinGImageCreate(GDisplay *g, GImageObject *widget, GWindowInit *pInit); +#define gwinImageCreate(w, pInit) gwinGImageCreate(GDISP, w, pInit) + +/** + * @brief Opens the image using a GFILE + * @return TRUE if the image can be opened + * + * @param[in] gh The widget (must be an image widget) + * @param[in] f The open (for reading) GFILE to use + * + * @api + */ +bool_t gwinImageOpenGFile(GHandle gh, GFILE *f); + +/** + * @brief Opens the image using the specified filename + * @return TRUE if the open succeeds + * + * @param[in] gh The widget (must be an image widget) + * @param[in] filename The filename to open + * + * @api + */ +#define gwinImageOpenFile(gh, filename) gwinImageOpenGFile((gh), gfileOpen((filename), "rb")) + + /** + * @brief Sets the input routines that support reading the image from memory + * in RAM or flash. + * @pre GFILE_NEED_MEMFS must be TRUE + * @return TRUE if the IO open function succeeds + * + * @param[in] gh The widget (must be an image widget) + * @param[in] ptr A pointer to the image in RAM or Flash + * + * @api + */ +#define gwinImageOpenMemory(gh, ptr) gwinImageOpenGFile((gh), gfileOpenMemory((void *)(ptr), "rb")) + +/** + * @brief Sets the input routines that support reading the image from a BaseFileStream (eg. an SD-Card). + * @return TRUE if the IO open function succeeds + * @pre GFILE_NEED_CHIBIOSFS and GFX_USE_OS_CHIBIOS must be TRUE + * + * @param[in] gh The widget (must be an image widget) + * @param[in] streamPtr A pointer to the (open) BaseFileStream object. + * + * @api + */ +#define gwinImageOpenStream(gh, streamPtr) gwinImageOpenGFile((gh), gfileOpenBaseFIleStream((streamPtr), "rb")) + +/** + * @brief Cache the image. + * @details Decodes and caches the current frame into RAM. + * + * @param[in] gh The widget (must be an image widget) + * + * @return GDISP_IMAGE_ERR_OK (0) on success or an error code. + * + * @api + */ +gdispImageError gwinImageCache(GHandle gh); + +#ifdef __cplusplus +} +#endif + +#endif // _GWIN_IMAGE_H +/** @} */ + diff --git a/src/gwin/image.h b/src/gwin/image.h deleted file mode 100644 index fdaabc92..00000000 --- a/src/gwin/image.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -/** - * @file src/gwin/image.h - * @brief GWIN image widget header file. - * - * @defgroup Image Image - * @ingroup GWIN - * - * @details GWIN allos it to create an image widget. The widget - * takes no user input. - * - * @pre GFX_USE_GDISP must be set to TRUE in your gfxconf.h - * @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h - * @pre GDISP_NEED_IMAGE must be set to TRUE in your gfxconf.h - * @pre GWIN_NEED_IMAGE must be set to TRUE in your gfxconf.h - * @pre At least one image type must be enabled in your gfxconf.h - * - * @{ - */ - -#ifndef _GWIN_IMAGE_H -#define _GWIN_IMAGE_H - -// This file is included within "gwin/gwin.h" - -// An image window -typedef struct GImageObject { - GWindowObject g; - gdispImage image; // The image itself - #if GWIN_NEED_IMAGE_ANIMATION - GTimer timer; // Timer used for animated images - #endif -} GImageObject; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Create an image widget. - * @details Display's a picture. - * @return NULL if there is no resultant drawing area, otherwise the widget handle. - * - * @param[in] g The GDisplay to display this window on - * @param[in] widget The image widget structure to initialise. If this is NULL, the structure is dynamically allocated. - * @param[in] pInit The initialization parameters to use. - * - * @note The default background color gets set to the current default one. - * @note An image window knows how to redraw. - * - * @api - */ -GHandle gwinGImageCreate(GDisplay *g, GImageObject *widget, GWindowInit *pInit); -#define gwinImageCreate(w, pInit) gwinGImageCreate(GDISP, w, pInit) - -/** - * @brief Opens the image using a GFILE - * @return TRUE if the image can be opened - * - * @param[in] gh The widget (must be an image widget) - * @param[in] f The open (for reading) GFILE to use - * - * @api - */ -bool_t gwinImageOpenGFile(GHandle gh, GFILE *f); - -/** - * @brief Opens the image using the specified filename - * @return TRUE if the open succeeds - * - * @param[in] gh The widget (must be an image widget) - * @param[in] filename The filename to open - * - * @api - */ -#define gwinImageOpenFile(gh, filename) gwinImageOpenGFile((gh), gfileOpen((filename), "rb")) - - /** - * @brief Sets the input routines that support reading the image from memory - * in RAM or flash. - * @pre GFILE_NEED_MEMFS must be TRUE - * @return TRUE if the IO open function succeeds - * - * @param[in] gh The widget (must be an image widget) - * @param[in] ptr A pointer to the image in RAM or Flash - * - * @api - */ -#define gwinImageOpenMemory(gh, ptr) gwinImageOpenGFile((gh), gfileOpenMemory((void *)(ptr), "rb")) - -/** - * @brief Sets the input routines that support reading the image from a BaseFileStream (eg. an SD-Card). - * @return TRUE if the IO open function succeeds - * @pre GFILE_NEED_CHIBIOSFS and GFX_USE_OS_CHIBIOS must be TRUE - * - * @param[in] gh The widget (must be an image widget) - * @param[in] streamPtr A pointer to the (open) BaseFileStream object. - * - * @api - */ -#define gwinImageOpenStream(gh, streamPtr) gwinImageOpenGFile((gh), gfileOpenBaseFIleStream((streamPtr), "rb")) - -/** - * @brief Cache the image. - * @details Decodes and caches the current frame into RAM. - * - * @param[in] gh The widget (must be an image widget) - * - * @return GDISP_IMAGE_ERR_OK (0) on success or an error code. - * - * @api - */ -gdispImageError gwinImageCache(GHandle gh); - -#ifdef __cplusplus -} -#endif - -#endif // _GWIN_IMAGE_H -/** @} */ - diff --git a/src/gwin/sys_defs.h b/src/gwin/sys_defs.h index fa5084a3..c632b069 100644 --- a/src/gwin/sys_defs.h +++ b/src/gwin/sys_defs.h @@ -890,7 +890,7 @@ extern "C" { #endif #if GWIN_NEED_IMAGE || defined(__DOXYGEN__) - #include "src/gwin/image.h" + #include "src/gwin/gimage.h" #endif #endif /* GFX_USE_GWIN */ -- cgit v1.2.3