NX graphics: This commit adds support for hiding windows. This features is needed by Twm4Nx: When a window is iconfied, the icon should appear on the background and the window should disappear (i.e., be hidden). The windows needs to remain healthy and to be updated in all ways, but it cannot affect the display content.

Converserely, when the icon is clicked, the icon needs to be hidden on the backgound and the window needs to be restored in its current state (which may be different than the state of the window at the time it was iconified.

Squashed commit of the following:

    graphics/:  Add checks in all places that I can think to avoid doing something stupid with hidden windows

    Improve some naming

    Add a new file missing in last commit.

    graphics/:  Initial, incomplete support for hiding windows.
This commit is contained in:
Gregory Nutt
2019-05-05 15:18:31 -06:00
parent a3312b74bb
commit da314276a1
26 changed files with 677 additions and 124 deletions
+56 -10
View File
@@ -86,10 +86,6 @@ static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
#endif
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nxbe_setpixel
*
@@ -106,22 +102,20 @@ static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
*
****************************************************************************/
void nxbe_setpixel(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_point_s *pos,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
static void nxbe_setpixel_dev(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_point_s *pos,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
struct nxbe_setpixel_s info;
struct nxgl_rect_s rect;
int i;
DEBUGASSERT(wnd != NULL && pos != NULL);
/* Offset the position by the window origin */
nxgl_vectoradd(&rect.pt1, pos, &wnd->bounds.pt1);
/* Make sure that the point is within the limits of the window
* and of the background screen
* and of the background screen.
*/
if (!nxgl_rectinside(&wnd->bounds, &rect.pt1) ||
@@ -165,3 +159,55 @@ void nxbe_setpixel(FAR struct nxbe_window_s *wnd,
#endif
}
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nxbe_setpixel
*
* Description:
* Fill the specified rectangle in the window with the specified color
*
* Input Parameters:
* wnd - The window structure reference
* rect - The location to be filled
* col - The color to use in the fill
*
* Returned Value:
* None
*
****************************************************************************/
void nxbe_setpixel(FAR struct nxbe_window_s *wnd,
FAR const struct nxgl_point_s *pos,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
DEBUGASSERT(wnd != NULL && pos != NULL);
#ifdef CONFIG_NX_RAMBACKED
/* If this window supports a pre-window frame buffer then shadow the full,
* unclipped bitmap in that framebuffer.
* REVISIT: The logic to set a pixel in the per-window frame buffer is missing
*/
DEBUGASSERT(!NXBE_ISRAMBACKED(wnd));
#endif
/* Don't update hidden windows */
if (!NXBE_ISHIDDEN(wnd))
{
nxbe_setpixel_dev(wnd, pos, color);
#ifdef CONFIG_NX_SWCURSOR
/* Was the software cursor visible?
* REVISIT: Missing logic for the case where the update clobbers a
* single pixel in the cursor image
*/
DEBUGASSERT(!wnd->be->cursor.visible);
#endif
}
}