From 8ed9e763c0f97f2946990a911bb940f8c80ff761 Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 24 Jun 2013 22:58:37 +1000 Subject: GWIN reduce Initialisation parameters and fix visibility issues --- include/gwin/gwin.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'include/gwin/gwin.h') diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index efce49fc..2a03c125 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -49,6 +49,21 @@ typedef struct GWindowObject { } GWindowObject, * GHandle; /* @} */ +/** + * @brief The structure to initialise a GWIN. + * + * @note Some gwin's will need extra parameters. + * @note The dimensions and position may be changed to fit on the real screen. + * + * @{ + */ +typedef struct GWindowInit { + coord_t x, y; // @< The initial screen position + coord_t width, height; // @< The initial dimension + bool_t show; // @< Should the window be visible initially +} GWindowInit; +/* @} */ + /** * @brief A window's minimized, maximized or normal size */ @@ -128,22 +143,18 @@ extern "C" { * @return NULL if there is no resultant drawing area, otherwise a window handle. * * @param[in] pgw The window structure to initialize. If this is NULL the structure is dynamically allocated. - * @param[in] x,y The screen coordinates for the top left corner of the window - * @param[in] width The width of the window - * @param[in] height The height of the window + * @param[in] pInit How to initialise the window * * @note The drawing color and the background color get set to the current defaults. If you haven't called * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there * is no default font and text drawing operations will no nothing. - * @note The dimensions and position may be changed to fit on the real screen. - * @note On creation the window is marked as visible. * @note A basic window does not save the drawing state. It is not automatically redrawn if the window is moved or * its visibility state is changed. * * @api */ - GHandle gwinCreateWindow(GWindowObject *pgw, coord_t x, coord_t y, coord_t width, coord_t height); + GHandle gwinCreateWindow(GWindowObject *pgw, GWindowInit *pInit); /** * @brief Destroy a window (of any type). Releases any dynamically allocated memory. -- cgit v1.2.3