diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html index 1d844983ef..95405ecd0a 100644 --- a/Documentation/NXGraphicsSubsystem.html +++ b/Documentation/NXGraphicsSubsystem.html @@ -1497,8 +1497,14 @@ NXWINDOW nx_openwindow(NXHANDLE handle, uint8_t flags,
The handle returned by nx_connect().
flags
Optional flags. - Must be zero unless CONFIG_NX_RAMBACKED is enabled. - In that case, it may be zero or NXBE_WINDOW_RAMBACKED. + These include: +
cb
Callbacks used to process window events
arg @@ -2312,8 +2318,14 @@ NXTKWINDOW nxtk_openwindow(NXHANDLE handle, uint8_t flags,
The handle returned by nx_connect().
flags
Optional flags. - Must be zero unless CONFIG_NX_RAMBACKED is enabled. - In that case, it may be zero or NXBE_WINDOW_RAMBACKED. + These include: +
cb
Callbacks used to process window events
arg diff --git a/graphics/nxmu/nxmu_openwindow.c b/graphics/nxmu/nxmu_openwindow.c index a914b13fd6..a0bfb2ba10 100644 --- a/graphics/nxmu/nxmu_openwindow.c +++ b/graphics/nxmu/nxmu_openwindow.c @@ -160,32 +160,37 @@ void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd) } #endif - /* Now, insert the new window at the correct position in the 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. - */ + /* Is the window being created in the hidden state? */ - 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 - * has focus. + /* No.. Insert the new window at the correct position in the + * 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; - wnd->below = be->topwnd->below; + if (NXBE_STATE_ISMODAL(be) && be->topwnd->below != NULL) + { + /* We are in a modal state. The topwnd is not the background and + * it has focus. + */ - be->topwnd->below = wnd; - } - else - { - /* Otherwise insert the new window at the top on the display. */ + wnd->above = be->topwnd; + wnd->below = be->topwnd->below; - wnd->above = NULL; - wnd->below = be->topwnd; + be->topwnd->below = wnd; + } + else + { + /* Otherwise insert the new window at the top on the display. */ - be->topwnd->above = wnd; - be->topwnd = wnd; + wnd->above = NULL; + wnd->below = be->topwnd; + + be->topwnd->above = wnd; + be->topwnd = wnd; + } } /* Report the initial size/position of the window to the client */ diff --git a/include/nuttx/nx/nx.h b/include/nuttx/nx/nx.h index cf37b03dfc..7b2d22aab8 100644 --- a/include/nuttx/nx/nx.h +++ b/include/nuttx/nx/nx.h @@ -404,9 +404,11 @@ int nx_eventnotify(NXHANDLE handle, int signo); * * Input Parameters: * handle - The handle returned by nx_connect() - * flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is - * enabled. In that case, it may be zero or - * NXBE_WINDOW_RAMBACKED + * flags - Optional flags. These include: + * NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This + * 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 * arg - User provided value that will be returned with NX callbacks. * diff --git a/include/nuttx/nx/nxbe.h b/include/nuttx/nx/nxbe.h index 91829bcf80..258f2927f4 100644 --- a/include/nuttx/nx/nxbe.h +++ b/include/nuttx/nx/nxbe.h @@ -81,18 +81,28 @@ #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 */ -/* 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 -# define NX_WINDOW_USER NXBE_WINDOW_RAMBACKED -# define NXTK_WINDOW_USER (NXBE_WINDOW_FRAMED | NXBE_WINDOW_RAMBACKED) -# define NXBE_WINDOW_USER (NXBE_WINDOW_FRAMED | NXBE_WINDOW_RAMBACKED) +# define NX_WINDOW_USER (NXBE_WINDOW_RAMBACKED | NXBE_WINDOW_HIDDEN) #else -# define NX_WINDOW_USER 0 -# define NXTK_WINDOW_USER NXBE_WINDOW_FRAMED -# define NXBE_WINDOW_USER NXBE_WINDOW_FRAMED +# define NX_WINDOW_USER NXBE_WINDOW_HIDDEN #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 */ #define NXBE_ISBLOCKED(wnd) \ diff --git a/include/nuttx/nx/nxtk.h b/include/nuttx/nx/nxtk.h index d82084fdea..b6399056a6 100644 --- a/include/nuttx/nx/nxtk.h +++ b/include/nuttx/nx/nxtk.h @@ -122,9 +122,11 @@ extern "C" * * Input Parameters: * handle - The handle returned by nx_connect - * flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is - * enabled. In that case, it may be zero or - * NXBE_WINDOW_RAMBACKED + * flags - Optional flags. These include: + * NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This + * 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 * arg - User provided value that will be returned with NXTK callbacks. * diff --git a/libs/libnx/nxmu/nx_openwindow.c b/libs/libnx/nxmu/nx_openwindow.c index 44e2e1c6d0..addd3a5047 100644 --- a/libs/libnx/nxmu/nx_openwindow.c +++ b/libs/libnx/nxmu/nx_openwindow.c @@ -61,9 +61,11 @@ * * Input Parameters: * handle - The handle returned by nx_connect - * flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is - * enabled. In that case, it may be zero or - * NXBE_WINDOW_RAMBACKED + * flags - Optional flags. These include: + * NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This + * 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 * arg - User provided value that will be returned with NX callbacks. * diff --git a/libs/libnx/nxtk/nxtk_openwindow.c b/libs/libnx/nxtk/nxtk_openwindow.c index 73158b1401..ee292b2667 100644 --- a/libs/libnx/nxtk/nxtk_openwindow.c +++ b/libs/libnx/nxtk/nxtk_openwindow.c @@ -89,9 +89,11 @@ nxgl_mxpixel_t g_bordercolor3[CONFIG_NX_NPLANES] = * * Input Parameters: * handle - The handle returned by nx_connect - * flags - Optional flags. Must be zero unless CONFIG_NX_RAMBACKED is - * enabled. In that case, it may be zero or - * NXBE_WINDOW_RAMBACKED + * flags - Optional flags. These include: + * NXBE_WINDOW_RAMBACKED: Creates a RAM backed window. This + * 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 * arg - User provided value that will be returned with NXTK callbacks. *