mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 13:18:50 +08:00
graphics/: Windows can now be created in the hidden state. This can be used to clean up initial window presentation which may involve several steps. This makes those steps all invisible until nx[tk]_setvisibility() is called to make the windows visible.
This commit is contained in:
parent
8cc0d2fc15
commit
b05e940135
7 changed files with 77 additions and 42 deletions
|
@ -1497,8 +1497,14 @@ NXWINDOW nx_openwindow(NXHANDLE handle, uint8_t flags,
|
||||||
<dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
|
<dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
|
||||||
<dt><code>flags</code>
|
<dt><code>flags</code>
|
||||||
<dd>Optional flags.
|
<dd>Optional flags.
|
||||||
Must be zero unless <code>CONFIG_NX_RAMBACKED</code> is enabled.
|
These include:
|
||||||
In that case, it may be zero or <code>NXBE_WINDOW_RAMBACKED</code>.
|
<ul>
|
||||||
|
<li><code>NXBE_WINDOW_RAMBACKED</code>: Creates a RAM backed window.
|
||||||
|
This option is only valid if <code>CONFIG_NX_RAMBACKED</code> is enabled.
|
||||||
|
</li>
|
||||||
|
<li><code>NXBE_WINDOW_HIDDEN</code>: The window is create in the HIDDEN state and can be made visible later with <code>nx_setvisibility()</code>.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<dt><code>cb</code>
|
<dt><code>cb</code>
|
||||||
<dd>Callbacks used to process window events
|
<dd>Callbacks used to process window events
|
||||||
<dt><code>arg</code>
|
<dt><code>arg</code>
|
||||||
|
@ -2312,8 +2318,14 @@ NXTKWINDOW nxtk_openwindow(NXHANDLE handle, uint8_t flags,
|
||||||
<dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
|
<dd>The handle returned by <a href="#nxconnectinstance"><code>nx_connect()</code></a>.
|
||||||
<dt><code>flags</code>
|
<dt><code>flags</code>
|
||||||
<dd>Optional flags.
|
<dd>Optional flags.
|
||||||
Must be zero unless <code>CONFIG_NX_RAMBACKED</code> is enabled.
|
These include:
|
||||||
In that case, it may be zero or <code>NXBE_WINDOW_RAMBACKED</code>.
|
<ul>
|
||||||
|
<li><code>NXBE_WINDOW_RAMBACKED</code>: Creates a RAM backed window.
|
||||||
|
This option is only valid if <code>CONFIG_NX_RAMBACKED</code> is enabled.
|
||||||
|
</li>
|
||||||
|
<li><code>NXBE_WINDOW_HIDDEN</code>: The window is create in the HIDDEN state and can be made visible later with <code>nxtk_setvisibility()</code>.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<dt><code>cb</code>
|
<dt><code>cb</code>
|
||||||
<dd>Callbacks used to process window events
|
<dd>Callbacks used to process window events
|
||||||
<dt><code>arg</code>
|
<dt><code>arg</code>
|
||||||
|
|
|
@ -160,32 +160,37 @@ void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Now, insert the new window at the correct position in the hierarchy.
|
/* Is the window being created in the hidden state? */
|
||||||
* topwnd is never NULL (it may point only at the background window,
|
|
||||||
* however). If we are in a modal state, then we cannot insert the
|
|
||||||
* window at the top of the display.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (NXBE_STATE_ISMODAL(be) && be->topwnd->below != NULL)
|
if (!NXBE_ISHIDDEN(wnd))
|
||||||
{
|
{
|
||||||
/* We are in a modal state. The topwnd is not the background and it
|
/* No.. Insert the new window at the correct position in the
|
||||||
* has focus.
|
* hierarchy. topwnd is never NULL (it may point only at the
|
||||||
|
* background window, however). If we are in a modal state, then we
|
||||||
|
* cannot insert the window at the top of the display.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wnd->above = be->topwnd;
|
if (NXBE_STATE_ISMODAL(be) && be->topwnd->below != NULL)
|
||||||
wnd->below = be->topwnd->below;
|
{
|
||||||
|
/* We are in a modal state. The topwnd is not the background and
|
||||||
|
* it has focus.
|
||||||
|
*/
|
||||||
|
|
||||||
be->topwnd->below = wnd;
|
wnd->above = be->topwnd;
|
||||||
}
|
wnd->below = be->topwnd->below;
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Otherwise insert the new window at the top on the display. */
|
|
||||||
|
|
||||||
wnd->above = NULL;
|
be->topwnd->below = wnd;
|
||||||
wnd->below = be->topwnd;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise insert the new window at the top on the display. */
|
||||||
|
|
||||||
be->topwnd->above = wnd;
|
wnd->above = NULL;
|
||||||
be->topwnd = wnd;
|
wnd->below = be->topwnd;
|
||||||
|
|
||||||
|
be->topwnd->above = wnd;
|
||||||
|
be->topwnd = wnd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Report the initial size/position of the window to the client */
|
/* Report the initial size/position of the window to the client */
|
||||||
|
|
|
@ -404,9 +404,11 @@ int nx_eventnotify(NXHANDLE handle, int signo);
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* handle - The handle returned by nx_connect()
|
* handle - The handle returned by nx_connect()
|
||||||
* flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is
|
* flags - Optional flags. These include:
|
||||||
* enabled. In that case, it may be zero or
|
* NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This
|
||||||
* NXBE_WINDOW_RAMBACKED
|
* option is only valid if CONFIG_NX_RAMBACKED is enabled.
|
||||||
|
* NXBE_WINDOW_HIDDEN: The window is create in the HIDDEN state
|
||||||
|
* and can be made visible later with nx_setvisibility().
|
||||||
* cb - Callbacks used to process window events
|
* cb - Callbacks used to process window events
|
||||||
* arg - User provided value that will be returned with NX callbacks.
|
* arg - User provided value that will be returned with NX callbacks.
|
||||||
*
|
*
|
||||||
|
|
|
@ -81,18 +81,28 @@
|
||||||
#define NXBE_WINDOW_MODAL (1 << 3) /* Bit 3: Window is in a focused, modal state */
|
#define NXBE_WINDOW_MODAL (1 << 3) /* Bit 3: Window is in a focused, modal state */
|
||||||
#define NXBE_WINDOW_HIDDEN (1 << 4) /* Bit 4: Window is hidden */
|
#define NXBE_WINDOW_HIDDEN (1 << 4) /* Bit 4: Window is hidden */
|
||||||
|
|
||||||
/* Valid user flags for different window types */
|
/* Valid user flags for different window types. This is the subset of flags
|
||||||
|
* that may be passed with nx_openwindow() or nxtk_openwindow. Most of the
|
||||||
|
* flags are controlled internally or must be selected via NX interfaces.
|
||||||
|
* These may be selected by the user when the window is created.
|
||||||
|
*
|
||||||
|
* Exception: NXBE_WINDOW_FRAMED is not user-selectable. It is
|
||||||
|
* automatically set by nxtk_openwindow() but appears to be a user
|
||||||
|
* setting from the point of view of lower layers.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NX_RAMBACKED
|
#ifdef CONFIG_NX_RAMBACKED
|
||||||
# define NX_WINDOW_USER NXBE_WINDOW_RAMBACKED
|
# define NX_WINDOW_USER (NXBE_WINDOW_RAMBACKED | NXBE_WINDOW_HIDDEN)
|
||||||
# define NXTK_WINDOW_USER (NXBE_WINDOW_FRAMED | NXBE_WINDOW_RAMBACKED)
|
|
||||||
# define NXBE_WINDOW_USER (NXBE_WINDOW_FRAMED | NXBE_WINDOW_RAMBACKED)
|
|
||||||
#else
|
#else
|
||||||
# define NX_WINDOW_USER 0
|
# define NX_WINDOW_USER NXBE_WINDOW_HIDDEN
|
||||||
# define NXTK_WINDOW_USER NXBE_WINDOW_FRAMED
|
|
||||||
# define NXBE_WINDOW_USER NXBE_WINDOW_FRAMED
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NXTK_WINDOW_USER (NXBE_WINDOW_FRAMED | NX_WINDOW_USER)
|
||||||
|
|
||||||
|
/* This is the set of startup flags that could be received in NXBE. */
|
||||||
|
|
||||||
|
#define NXBE_WINDOW_USER (NXBE_WINDOW_FRAMED | NX_WINDOW_USER)
|
||||||
|
|
||||||
/* Helpful flag macros */
|
/* Helpful flag macros */
|
||||||
|
|
||||||
#define NXBE_ISBLOCKED(wnd) \
|
#define NXBE_ISBLOCKED(wnd) \
|
||||||
|
|
|
@ -122,9 +122,11 @@ extern "C"
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* handle - The handle returned by nx_connect
|
* handle - The handle returned by nx_connect
|
||||||
* flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is
|
* flags - Optional flags. These include:
|
||||||
* enabled. In that case, it may be zero or
|
* NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This
|
||||||
* NXBE_WINDOW_RAMBACKED
|
* option is only valid if CONFIG_NX_RAMBACKED is enabled.
|
||||||
|
* NXBE_WINDOW_HIDDEN: The window is create in the HIDDEN state
|
||||||
|
* and can be made visible later with nxtk_setvisibility().
|
||||||
* cb - Callbacks used to process window events
|
* cb - Callbacks used to process window events
|
||||||
* arg - User provided value that will be returned with NXTK callbacks.
|
* arg - User provided value that will be returned with NXTK callbacks.
|
||||||
*
|
*
|
||||||
|
|
|
@ -61,9 +61,11 @@
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* handle - The handle returned by nx_connect
|
* handle - The handle returned by nx_connect
|
||||||
* flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is
|
* flags - Optional flags. These include:
|
||||||
* enabled. In that case, it may be zero or
|
* NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This
|
||||||
* NXBE_WINDOW_RAMBACKED
|
* option is only valid if CONFIG_NX_RAMBACKED is enabled.
|
||||||
|
* NXBE_WINDOW_HIDDEN: The window is create in the HIDDEN state
|
||||||
|
* and can be made visible later with nx_setvisibility().
|
||||||
* cb - Callbacks used to process window events
|
* cb - Callbacks used to process window events
|
||||||
* arg - User provided value that will be returned with NX callbacks.
|
* arg - User provided value that will be returned with NX callbacks.
|
||||||
*
|
*
|
||||||
|
|
|
@ -89,9 +89,11 @@ nxgl_mxpixel_t g_bordercolor3[CONFIG_NX_NPLANES] =
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* handle - The handle returned by nx_connect
|
* handle - The handle returned by nx_connect
|
||||||
* flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is
|
* flags - Optional flags. These include:
|
||||||
* enabled. In that case, it may be zero or
|
* NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This
|
||||||
* NXBE_WINDOW_RAMBACKED
|
* option is only valid if CONFIG_NX_RAMBACKED is enabled.
|
||||||
|
* NXBE_WINDOW_HIDDEN: The window is create in the HIDDEN state
|
||||||
|
* and can be made visible later with nxtk_setvisibility().
|
||||||
* cb - Callbacks used to process window events
|
* cb - Callbacks used to process window events
|
||||||
* arg - User provided value that will be returned with NXTK callbacks.
|
* arg - User provided value that will be returned with NXTK callbacks.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue