Fix an NxWidgets bug; Update NxWM (it kind of works now)

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4693 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-05-03 22:31:48 +00:00
parent 0ffc37d476
commit 1c44939445
7 changed files with 81 additions and 25 deletions

View File

@ -13,6 +13,10 @@
* CImage: Add logic to hightlight an CImage (using the selected LUT).
* nxwm: The tiny NX window manager (NxWM) is being developed in this directory.
* UnitTests/nxwm: A unit test for the NX window manager.
* CWidgetControl: Add a semaphore to force clients to wait if the
size or position of the window is not yet known (multi-user mode only).
* During integration of NxWM, corrected numerous problems with NxWidgets
running on toolbars and framed windows. That capability was commented
out in the 1.0 release but is verfied functional in 1.1.
* CRlePalettBitmap: Fix an error in the text that determines if we
need to "rewind" to the beginning of the image.

View File

@ -315,7 +315,7 @@ bool CRlePaletteBitmap::seekRow(nxgl_coord_t row)
{
// Is the current position already past the requested position?
if (row > m_row || (row == m_row && m_col != 0))
if (row < m_row || (row == m_row && m_col != 0))
{
// Yes.. rewind to the beginning of the image

View File

@ -73,10 +73,11 @@ namespace NxWM
struct SNxConsole
{
sem_t sem; /**< Sem that will be posted when the task is successfully initialized */
sem_t sem; /**< Sem that posted when the task is initialized */
NXTKWINDOW hwnd; /**< Window handle */
NXCONSOLE nxcon; /**< NxConsole handle */
int minor; /**< Next device minor number */
struct nxcon_window_s wndo; /**< Describes the NxConsole window */
bool result; /**< True if successfully initialized */
};
@ -211,6 +212,16 @@ bool CNxConsole::run(void)
g_nxconvars.hwnd = control->getWindowHandle();
// Describe the NxConsole
g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR;
g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR;
g_nxconvars.wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID;
// Get the size of the window
(void)window->getSize(&g_nxconvars.wndo.wsize);
// Start the NxConsole task
g_nxconvars.result = false;
@ -235,6 +246,8 @@ bool CNxConsole::run(void)
abstime.tv_sec += 2;
int ret = sem_timedwait(&g_nxconvars.sem, &abstime);
sched_unlock();
if (ret == OK && g_nxconvars.result)
{
// Save the handle to use in the stop method
@ -320,20 +333,15 @@ void CNxConsole::redraw(void)
int CNxConsole::nxconsole(int argc, char *argv[])
{
// Configure NxConsole
struct nxcon_window_s wndo; /* Describes the window */
wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR;
wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR;
wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID;
// To stop compiler complaining about "jump to label crosses initialization of 'int fd'
// To stop compiler complaining about "jump to label crosses initialization
// of 'int fd'
int fd = -1;
// Use the window handle to create the NX console
g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor);
g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &g_nxconvars.wndo,
g_nxconvars.minor);
if (!g_nxconvars.nxcon)
{
goto errout;
@ -370,6 +378,9 @@ int CNxConsole::nxconsole(int argc, char *argv[])
(void)std::dup2(fd, 1);
(void)std::dup2(fd, 2);
(void)std::fdopen(1, "w");
(void)std::fdopen(2, "w");
// And we can close our original driver file descriptor
std::close(fd);

View File

@ -72,7 +72,7 @@ using namespace NxWM;
static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 9 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 9 */
0x2449b6, 0x24496d, 0x244992, 0x242492, 0x496ddb, 0x0024db, 0x0024b6, 0x002492, /* Codes 1-8 */
0x0000b6, 0x2424b6, 0x0024ff, 0x0000db, 0x4949db, 0x496db6, 0x246db6, 0x4949b6, /* Codes 9-17 */
0x2449db, 0xb6dbff, 0xb6b6db, 0xdbdbff, 0xdbffff, 0x496dff, 0x246dff, 0x4949ff /* Codes 17-24 */
@ -84,7 +84,7 @@ static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] =
static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0x2256, 0x224d, 0x2252, 0x2132, 0x4b7b, 0x013b, 0x0136, 0x0132, 0x0016, 0x2136, /* Codes 1-10 */
0x013f, 0x001b, 0x4a5b, 0x4b76, 0x2376, 0x4a56, 0x225b, 0xb6df, 0xb5bb, 0xdedf, /* Codes 11-20 */
0xdfff, 0x4b7f, 0x237f, 0x4a5f /* Codes 21-24 */
@ -104,7 +104,7 @@ static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] =
static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0x4a, 0x42, 0x46, 0x30, 0x6e, 0x2e, 0x29, 0x25, 0x14, 0x34, 0x32, 0x18, 0x59, /* Codes 1-13 */
0x6a, 0x5f, 0x55, 0x4e, 0xd4, 0xba, 0xdf, 0xf4, 0x72, 0x67, 0x5d /* Codes 14-24 */
};
@ -115,7 +115,7 @@ static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] =
static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0x2a, 0x29, 0x2a, 0x26, 0x4f, 0x07, 0x06, 0x06, 0x02, 0x26, 0x07, 0x03, 0x4b, /* Codes 1-13 */
0x4e, 0x2e, 0x4a, 0x2b, 0xbb, 0xb7, 0xdb, 0xdf, 0x4f, 0x2f, 0x4b /* Codes 14-24 */
};

View File

@ -72,7 +72,7 @@ using namespace NxWM;
static const uint32_t g_stopLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0xdbdbdb, 0xdbb6db, 0xdbb6b6, 0xdb9292, 0xdb926d, 0xdb6d6d, 0xb66d6d, 0xb64949, /* Codes 1-8 */
0xb62449, 0xdb246d, 0xdb4949, 0xff496d, 0xffb6b6, 0xffdbff, 0xffdbdb, 0xff9292, /* Codes 9-16 */
0xff6d6d, 0xdb6d49, 0xff2449, 0xff246d, 0xdb2449, 0xdbdbb6, 0xff4949, 0xff2424, /* Codes 17-24 */
@ -90,7 +90,7 @@ static const uint32_t g_stopLut[BITMAP_NLUTCODES] =
static const uint16_t g_stopLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0xdedb, 0xddbb, 0xddb6, 0xdc92, 0xdc8d, 0xdb6d, 0xb36d, 0xb249, 0xb129, 0xd92d, /* Codes 1-10 */
0xda49, 0xfa4d, 0xfdb6, 0xfedf, 0xfedb, 0xfc92, 0xfb6d, 0xdb69, 0xf929, 0xf92d, /* Codes 11-20 */
0xd929, 0xded6, 0xfa49, 0xf924, 0xfffb, 0xddb2, 0xd924, 0xfa44, 0xfdbb, 0xfed6, /* Codes 21-30 */
@ -114,7 +114,7 @@ static const uint16_t g_stopLut[BITMAP_NLUTCODES] =
static const uint8_t g_stopLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0xdb, 0xc5, 0xc1, 0xa7, 0xa3, 0x8d, 0x82, 0x69, 0x53, 0x63, 0x74, 0x83, 0xcb, /* Codes 1-13 */
0xe9, 0xe5, 0xb2, 0x98, 0x89, 0x69, 0x6d, 0x5e, 0xd6, 0x7f, 0x65, 0xfa, 0xbc, /* Codes 14-26 */
0x5a, 0x7b, 0xd0, 0xe1, 0x94, 0xc7, 0x70, 0x65, 0xd2, 0x9c, 0x4f, 0x78, 0x98, /* Codes 27-39 */
@ -129,7 +129,7 @@ static const uint8_t g_stopLut[BITMAP_NLUTCODES] =
static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] =
{
CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */
CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */
0xdb, 0xd7, 0xd6, 0xd2, 0xd1, 0xcd, 0xad, 0xa9, 0xa5, 0xc5, 0xc9, 0xe9, 0xf6, /* Codes 1-13 */
0xfb, 0xfb, 0xf2, 0xed, 0xcd, 0xe5, 0xe5, 0xc5, 0xda, 0xe9, 0xe4, 0xff, 0xd6, /* Codes 14-26 */
0xc4, 0xe8, 0xf7, 0xfa, 0xed, 0xf6, 0xc8, 0xa8, 0xda, 0xb2, 0xa4, 0xc9, 0xb1, /* Codes 27-39 */

View File

@ -419,6 +419,47 @@ nxwm
trunk/NxWidgets/UnitTests/READEM.txt
NOTE: There is an issue with running this example under the
simulation. In the default configuration, this example will
run the NxConsole example which waits on readline() for console
intput. When it calls readline(), the whole system blocks
waiting from input from the host OS. So, in order to get
this example to run, you must comment out the readline call in
apps/nshlib/nsh_consolemain.c like:
Index: nsh_consolemain.c
===================================================================
--- nsh_consolemain.c (revision 4681)
+++ nsh_consolemain.c (working copy)
@@ -117,7 +117,8 @@
/* Execute the startup script */
#ifdef CONFIG_NSH_ROMFSETC
- (void)nsh_script(&pstate->cn_vtbl, "init", NSH_INITPATH);
+// REMOVE ME
+// (void)nsh_script(&pstate->cn_vtbl, "init", NSH_INITPATH);
#endif
/* Then enter the command line parsing loop */
@@ -130,7 +131,8 @@
fflush(pstate->cn_outstream);
/* Get the next line of input */
-
+sleep(2); // REMOVE ME
+#if 0 // REMOVE ME
ret = readline(pstate->cn_line, CONFIG_NSH_LINELEN,
INSTREAM(pstate), OUTSTREAM(pstate));
if (ret > 0)
@@ -153,6 +155,7 @@
"readline", NSH_ERRNO_OF(-ret));
nsh_exit(&pstate->cn_vtbl, 1);
}
+#endif // REMOVE ME
}
/* Clean up */
ostest
Description

View File

@ -168,7 +168,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR _TCB *tcb)
#endif
}
/* The descriptor is in a valid range to file descriptor... do the read */
/* The descriptor is in a valid range to file descriptor... perform some more checks */
#if CONFIG_NFILE_DESCRIPTORS > 0
else