aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/sys_defs.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-05-09 21:25:31 +1000
committerinmarket <andrewh@inmarket.com.au>2014-05-09 21:25:31 +1000
commit9e8b38ba943b339b966b1011bab899720d6305fc (patch)
treef0b169569f380857e4ed7c3927d0197bcb5ec6ae /src/gwin/sys_defs.h
parentca1a83abca9ecc159ff6f0d9e27ab133fb947997 (diff)
downloaduGFX-9e8b38ba943b339b966b1011bab899720d6305fc.tar.gz
uGFX-9e8b38ba943b339b966b1011bab899720d6305fc.tar.bz2
uGFX-9e8b38ba943b339b966b1011bab899720d6305fc.zip
Add gwinClearInit() and gwinWidgetClearInit() to clear gwin initialisation structures.
Incorporate into demo's
Diffstat (limited to 'src/gwin/sys_defs.h')
-rw-r--r--src/gwin/sys_defs.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gwin/sys_defs.h b/src/gwin/sys_defs.h
index f4e1c2f7..fa5084a3 100644
--- a/src/gwin/sys_defs.h
+++ b/src/gwin/sys_defs.h
@@ -34,7 +34,7 @@
*/
typedef struct GWindowObject {
#if GWIN_NEED_WINDOWMANAGER
- // This MUST be the first member of the struct
+ // This MUST be the first member of the structure
gfxQueueASyncItem wmq; // @< The next window (for the window manager)
#endif
const struct gwinVMT *vmt; // @< The VMT for this GWIN
@@ -54,6 +54,10 @@ typedef struct GWindowObject {
*
* @note Some gwin's will need extra parameters.
* @note The dimensions and position may be changed to fit on the real screen.
+ * @note If you create this structure on the stack, you should always memset
+ * it to all zero's first in case a future version of the software
+ * add's extra fields. Alternatively you can use @p gwinClearInit()
+ * to clear it.
*
* @{
*/
@@ -103,6 +107,18 @@ extern "C" {
*-------------------------------------------------*/
/**
+ * @brief Clear a GWindowInit structure to all zero's
+ * @note This function is provided just to prevent problems
+ * on operating systems where using memset() causes issues
+ * in the users application.
+ *
+ * @param[in] pwi The GWindowInit structure to clear
+ *
+ * @api
+ */
+ void gwinClearInit(GWindowInit *pwi);
+
+ /**
* @brief Set the default foreground color for all new GWIN windows
*
* @param[in] clr The color to be set