diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-11-16 02:01:16 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-11-16 02:01:16 +1000 |
commit | d35bf6cda6a6842b244069e2673acea8778381f7 (patch) | |
tree | 030502af247e66775e1c706ff8c54032174f52ea /include | |
parent | 3c3bab5d8275a93e12d8b37526811f73a2283195 (diff) | |
download | uGFX-d35bf6cda6a6842b244069e2673acea8778381f7.tar.gz uGFX-d35bf6cda6a6842b244069e2673acea8778381f7.tar.bz2 uGFX-d35bf6cda6a6842b244069e2673acea8778381f7.zip |
Add support to GWIN for a routine that can redraw an entire display (subject to the controls being able to redraw).
This also removes a few change of visibility bugs in gwin and simplifies code.
Diffstat (limited to 'include')
-rw-r--r-- | include/gwin/class_gwin.h | 12 | ||||
-rw-r--r-- | include/gwin/gwin.h | 16 |
2 files changed, 27 insertions, 1 deletions
diff --git a/include/gwin/class_gwin.h b/include/gwin/class_gwin.h index 62b1752e..ae5ac756 100644 --- a/include/gwin/class_gwin.h +++ b/include/gwin/class_gwin.h @@ -104,6 +104,16 @@ typedef struct gwinVMT { /* @} */ #endif +// These flags are needed whether or not we are running a window manager. +/** + * @brief Flags for redrawing after a visibility change + * @{ + */ +#define GWIN_WMFLG_PRESERVE 0x0001 // @< Preserve whatever existing contents possible if a window can't redraw +#define GWIN_WMFLG_NOBGCLEAR 0x0002 // @< Don't clear the area if the window is not visible +#define GWIN_WMFLG_NOZORDER 0x0004 // @< Don't redraw higher z-order windows that overlap +/* @} */ + #if GWIN_NEED_WINDOWMANAGER || defined(__DOXYGEN__) #if 1 // When we know that wmq is the first element of the GWindowObject structure #define QItem2GWindow(qi) ((GHandle)qi) @@ -125,7 +135,7 @@ typedef struct gwinVMT { void (*DeInit) (void); // @< The window manager has just been removed as the current window manager bool_t (*Add) (GHandle gh, const GWindowInit *pInit); // @< A window has been added void (*Delete) (GHandle gh); // @< A window has been deleted - void (*Visible) (GHandle gh); // @< A window has changed its visibility state + void (*Redraw) (GHandle gh, int visflags); // @< A window needs to be redraw (or undrawn) void (*Redim) (GHandle gh, coord_t x, coord_t y, coord_t w, coord_t h); // @< A window wants to be moved or resized void (*Raise) (GHandle gh); // @< A window wants to be on top void (*MinMax) (GHandle gh, GWindowMinMax minmax); // @< A window wants to be minimized/maximised diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index fa5ba613..1a2c2c07 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -379,6 +379,22 @@ extern "C" { #if GWIN_NEED_WINDOWMANAGER /** + * @brief Redraw a window + * + * @param[in] g The display to redraw. Passing NULL will redraw all displays. + * @param[in] preserve Should the redraw try to preserve existing screen data for those + * windows that can't redraw themselves? + * + * @note This is normally never required as windows and widgets will redraw as required. + * @note Some windows are incapable of redrawing themselves as they don't save + * their drawing state. + * @note This does not clear the background - just redraws the gwin windows (where possible) + * + * @api + */ + void gwinRedrawDisplay(GDisplay *g, bool_t preserve); + + /** * @brief Minimize, Maximize or Restore a window * @pre GWIN_NEED_WINDOWMANAGER must be TRUE * |