diff options
Diffstat (limited to 'src/gwin/sys_defs.h')
-rw-r--r-- | src/gwin/sys_defs.h | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/src/gwin/sys_defs.h b/src/gwin/sys_defs.h index c632b069..91831cba 100644 --- a/src/gwin/sys_defs.h +++ b/src/gwin/sys_defs.h @@ -27,6 +27,9 @@ #if GFX_USE_GWIN || defined(__DOXYGEN__) +/* Forward declaration */ +typedef struct GWindowObject *GHandle; + /** * @brief A window object structure * @note Do not access the members directly. Treat it as a black-box and use the method functions. @@ -46,6 +49,9 @@ typedef struct GWindowObject { #if GDISP_NEED_TEXT font_t font; // @< The current font #endif + #if GWIN_NEED_CONTAINERS + GHandle parent; // @< The parent window + #endif } GWindowObject, * GHandle; /* @} */ @@ -62,9 +68,12 @@ typedef struct GWindowObject { * @{ */ typedef struct GWindowInit { - coord_t x, y; // @< The initial screen position + 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 + #if GWIN_NEED_CONTAINERS + GHandle parent; // @< The parent - must be a container or NULL + #endif } GWindowInit; /* @} */ @@ -324,6 +333,9 @@ extern "C" { * as not visible, nothing is done to remove the window from the screen. * When there is a window manager, it is up to the window manager to * handle what happens. + * @note Even when you mark a window as visible, it may still not be displayed + * if it's parent is invisible. When the parent becomes visible this child + * will automatically be shown because it is already marked as visible. * * @api */ @@ -333,6 +345,9 @@ extern "C" { * @brief Gets the visibility of a window * @return TRUE if visible * + * @note It is possible for a child to be marked as visible by @p gwinSetVisible() + * but for this call to return FALSE if one of its parents are not visible. + * * @param[in] gh The window * * @api @@ -345,8 +360,10 @@ extern "C" { * @param[in] gh The window handle * @param[in] enabled Enable or disable the window * - * @note The window is automatically redrawn if it - * supports self-redrawing. + * @note The window is automatically redrawn if it supports self-redrawing. + * @note Even when you mark a window as enabled, it may still remain disabled + * if it's parent is disabled. When the parent becomes enabled this child + * will automatically be enabled because it is already marked as enabled. * * @api */ @@ -374,6 +391,9 @@ extern "C" { * @brief Gets the enabled state of a window * @return TRUE if enabled * + * @note It is possible for a child to be marked as enabled by @p gwinSetEnabled() + * but for this call to return FALSE if one of its parents are not enabled. + * * @param[in] gh The window * * @api @@ -491,6 +511,24 @@ extern "C" { * @api */ void gwinRaise(GHandle gh); + + /** + * @brief Get the next window in the z-order + * @return The next window or NULL if no more windows + * + * @param[in] gh The previous window or NULL to get the first window + * + * @note This returns the next window in the system from top to bottom. + * @note Where there are parent child relationships, this ignores them + * and will list all windows in the system. There is no defined + * order between children of siblings and they can in fact be mixed + * in order. The only relationship honored is that parents will be + * listed before their children. + * + * @api + */ + GHandle gwinGetNextWindow(GHandle gh); + #endif #if GDISP_NEED_TEXT || defined(__DOXYGEN__) @@ -880,7 +918,12 @@ extern "C" { #include "src/gwin/gwidget.h" #endif - /* Include extra window types */ + /* Include containers */ + #if GWIN_NEED_CONTAINERS || defined(__DOXYGEN__) + #include "src/gwin/gcontainer.h" + #endif + + /* Include vanilla window objects */ #if GWIN_NEED_CONSOLE || defined(__DOXYGEN__) #include "src/gwin/console.h" #endif |