apps/graphics/NxWidgets: CNxTkWindow, CNxWindow, CNxServer: Add support to create RAM backed windows.

apps/graphics/twm4nx:  IconMgr window now comes up correctly.  Need to revisit window width setup.  All windows are no created as RAM backed windows.
This commit is contained in:
Gregory Nutt 2019-05-04 11:45:15 -06:00
parent b5ae79b8f3
commit f3b3d1fc72
11 changed files with 57 additions and 35 deletions

View file

@ -160,18 +160,18 @@ namespace NXWidgets
* Get an instance of a raw NX window.
*/
inline CNxWindow *createRawWindow(CWidgetControl *widgetControl)
inline CNxWindow *createRawWindow(CWidgetControl *widgetControl, uint8_t flags = 0)
{
return new CNxWindow(m_hNxServer, widgetControl);
return new CNxWindow(m_hNxServer, widgetControl, flags);
}
/**
* Get an instance of the framed NX window.
*/
inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl)
inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl, uint8_t flags = 0)
{
return new CNxTkWindow(m_hNxServer, widgetControl);
return new CNxTkWindow(m_hNxServer, widgetControl, flags);
}
/**

View file

@ -89,6 +89,7 @@ namespace NXWidgets
CWidgetControl *m_widgetControl; /**< Controlling widget for the window */
CNxToolbar *m_toolbar; /**< Child toolbar */
nxgl_coord_t m_toolbarHeight; /**< The height of the toolbar */
uint8_t m_flags; /**< Window properties */
public:
@ -111,9 +112,11 @@ namespace NXWidgets
*
* @param hNxServer Handle to the NX server.
* @param widgetControl Controlling widget for this window.
* @param flags Window properties
*/
CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl);
CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl,
uint8_t flags);
/**
* Destructor.

View file

@ -52,10 +52,6 @@
#include "graphics/nxwidgets/ccallback.hxx"
#include "graphics/nxwidgets/inxwindow.hxx"
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/****************************************************************************
* Implementation Classes
****************************************************************************/
@ -89,6 +85,7 @@ namespace NXWidgets
NXHANDLE m_hNxServer; /**< Handle to the NX server. */
NXWINDOW m_hNxWindow; /**< Handle to the NX raw window */
CWidgetControl *m_widgetControl; /**< The controlling widget for the window */
uint8_t m_flags; /**< Window properties */
public:
@ -111,9 +108,11 @@ namespace NXWidgets
*
* @param hNxServer Handle to the NX server.
* @param widgetControl Controlling widget for this window.
* @param flags Window properties
*/
CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl);
CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl,
uint8_t flags = 0);
/**
* Destructor.

View file

@ -334,6 +334,18 @@ namespace Twm4Nx
FAR const struct NXWidgets::SRlePaletteBitmap *sbitmap,
bool isIconMgr, FAR CIconMgr *iconMgr, bool noToolbar);
/**
* Synchronize the window with the NX server. This function will delay
* until the the NX server has caught up with all of the queued requests.
* When this function returns, the state of the NX server will be the
* same as the state of the application.
*/
inline void synchronize(void)
{
m_nxWin->synchronize();
}
/**
* Get the widget control instance needed to support application drawing
* into the window.

View file

@ -146,15 +146,15 @@
// Spacing. Defaults values good at 75 and 100 DPI
#ifndef CONFIG_TWM4NX_TOOLBAR_HSPACING
# define CONFIG_TWM4NX_TOOLBAR_HSPACING 8
# define CONFIG_TWM4NX_TOOLBAR_HSPACING 2
#endif
#ifndef CONFIG_TWM4NX_ICONMGR_VSPACING
# define CONFIG_TWM4NX_FRAME_VSPACING 2
#ifndef CONFIG_TWM4NX_FRAME_VSPACING
# define CONFIG_TWM4NX_FRAME_VSPACING 2
#endif
#ifndef CONFIG_TWM4NX_BUTTON_INDENT
# define CONFIG_TWM4NX_BUTTON_INDENT 1
# define CONFIG_TWM4NX_BUTTON_INDENT 1
#endif
#ifndef CONFIG_TWM4NX_ICONMGR_VSPACING