From 6402e6269bd2f9619b7a7b21bab9a1fedc6f360b Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Mar 2012 01:52:00 +0000 Subject: More NX Console fixes... good progress but still not ready for prime time git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4533 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/nxconsole/nxcon_internal.h | 2 +- apps/examples/nxtext/nxtext_internal.h | 40 +++++++++- nuttx/Documentation/NxWidgets.html | 126 ++++++++++++++++-------------- nuttx/graphics/nxbe/nxbe_bitmap.c | 14 ++-- nuttx/graphics/nxconsole/nxcon_internal.h | 2 + 5 files changed, 115 insertions(+), 69 deletions(-) diff --git a/apps/examples/nxconsole/nxcon_internal.h b/apps/examples/nxconsole/nxcon_internal.h index 06c989551..f5d88e600 100644 --- a/apps/examples/nxconsole/nxcon_internal.h +++ b/apps/examples/nxconsole/nxcon_internal.h @@ -71,7 +71,7 @@ # define CONFIG_EXAMPLES_NXCON_VPLANE 0 #endif -/* Pixel depth. If non provided, pick the smallest enabled pixel depth */ +/* Pixel depth. If none provided, pick the smallest enabled pixel depth */ #ifndef CONFIG_EXAMPLES_NXCON_BPP # if !defined(CONFIG_NX_DISABLE_1BPP) diff --git a/apps/examples/nxtext/nxtext_internal.h b/apps/examples/nxtext/nxtext_internal.h index caf8cd9fc..7a8159c98 100644 --- a/apps/examples/nxtext/nxtext_internal.h +++ b/apps/examples/nxtext/nxtext_internal.h @@ -64,10 +64,30 @@ # define CONFIG_EXAMPLES_NXTEXT_VPLANE 0 #endif +/* Pixel depth. If none provided, pick the smallest enabled pixel depth */ + #ifndef CONFIG_EXAMPLES_NXTEXT_BPP -# define CONFIG_EXAMPLES_NXTEXT_BPP 32 +# if !defined(CONFIG_NX_DISABLE_1BPP) +# define CONFIG_EXAMPLES_NXTEXT_BPP 1 +# elif !defined(CONFIG_NX_DISABLE_2BPP) +# define CONFIG_EXAMPLES_NXTEXT_BPP 2 +# elif !defined(CONFIG_NX_DISABLE_4BPP) +# define CONFIG_EXAMPLES_NXTEXT_BPP 4 +# elif !defined(CONFIG_NX_DISABLE_8BPP) +# define CONFIG_EXAMPLES_NXTEXT_BPP 8 +# elif !defined(CONFIG_NX_DISABLE_16BPP) +# define CONFIG_EXAMPLES_NXTEXT_BPP 16 +//#elif !defined(CONFIG_NX_DISABLE_24BPP) +//# define CONFIG_NXCONSOLE_BPP 24 +# elif !defined(CONFIG_NX_DISABLE_32BPP) +# define CONFIG_EXAMPLES_NXTEXT_BPP 32 +# else +# error "No pixel depth provided" +# endif #endif +/* Background color */ + #ifndef CONFIG_EXAMPLES_NXTEXT_BGCOLOR # if CONFIG_EXAMPLES_NXTEXT_BPP == 24 || CONFIG_EXAMPLES_NXTEXT_BPP == 32 # define CONFIG_EXAMPLES_NXTEXT_BGCOLOR 0x007b68ee @@ -78,10 +98,14 @@ # endif #endif +/* Pop-up font ID */ + #ifndef CONFIG_EXAMPLES_NXTEXT_PUFONTID # define CONFIG_EXAMPLES_NXTEXT_PUFONTID NXFONT_DEFAULT #endif +/* Pop-up window color */ + #ifndef CONFIG_EXAMPLES_NXTEXT_PUCOLOR # if CONFIG_EXAMPLES_NXTEXT_BPP == 24 || CONFIG_EXAMPLES_NXTEXT_BPP == 32 # define CONFIG_EXAMPLES_NXTEXT_PUCOLOR 0x00dcdcdc @@ -92,10 +116,14 @@ # endif #endif +/* Background font ID */ + #ifndef CONFIG_EXAMPLES_NXTEXT_BGFONTID # define CONFIG_EXAMPLES_NXTEXT_BGFONTID NXFONT_DEFAULT #endif +/* Background font color */ + #ifndef CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR # if CONFIG_EXAMPLES_NXTEXT_BPP == 24 || CONFIG_EXAMPLES_NXTEXT_BPP == 32 # define CONFIG_EXAMPLES_NXTEXT_BGFONTCOLOR 0x00000000 @@ -106,6 +134,8 @@ # endif #endif +/* Pop-up font color */ + #ifndef CONFIG_EXAMPLES_NXTEXT_PUFONTCOLOR # if CONFIG_EXAMPLES_NXTEXT_BPP == 24 || CONFIG_EXAMPLES_NXTEXT_BPP == 32 # define CONFIG_EXAMPLES_NXTEXT_PUFONTCOLOR 0x00000000 @@ -116,14 +146,20 @@ # endif #endif +/* Character caching */ + #ifndef CONFIG_EXAMPLES_NXTEXT_BMCACHE # define CONFIG_EXAMPLES_NXTEXT_BMCACHE 128 #endif +/* Font glyph caching */ + #ifndef CONFIG_EXAMPLES_NXTEXT_GLCACHE -# define CONFIG_EXAMPLES_NXTEXT_BMCACHE 16 +# define CONFIG_EXAMPLES_NXTEXT_GLCACHE 16 #endif +/* NX muli-user mode */ + #ifdef CONFIG_NX_MULTIUSER # ifdef CONFIG_DISABLE_MQUEUE # error "The multi-threaded example requires MQ support (CONFIG_DISABLE_MQUEUE=n)" diff --git a/nuttx/Documentation/NxWidgets.html b/nuttx/Documentation/NxWidgets.html index 41f041162..165248145 100755 --- a/nuttx/Documentation/NxWidgets.html +++ b/nuttx/Documentation/NxWidgets.html @@ -1,59 +1,67 @@ - - -NxWidgets - - -

- - - - -
-

NxWidgets

-

Last Updated: March 24, 2012

-
-

NXWidgets

-

- In order to better support NuttX based platforms, a special graphical userinterface has been created called NXWidgets. - NXWidgets is written in C++ and integrates seamlessly with the NuttX NX graphics subsystem in order to provide graphic objects, or "widgets," in the NX Graphics Subsystem -

-

- Some of the features of NXWidgets include: -

- -

- Note: Many of the fundamental classed in NxWidgets derive from the Antony - Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style - license. See the COPYING file for details. -

- - + + +NxWidgets + + +

+ + + + +
+

NxWidgets

+

Last Updated: March 27, 2012

+
+

NXWidgets

+

+ In order to better support NuttX based platforms, a special graphical userinterface has been created called NXWidgets. + NXWidgets is written in C++ and integrates seamlessly with the NuttX NX graphics subsystem in order to provide graphic objects, or "widgets," in the NX Graphics Subsystem +

+

+ Some of the features of NXWidgets include: +

+ +

+ Note: Many of the fundamental classed in NxWidgets derive from the Antony + Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style + license. See the COPYING file for details. +

+

NXWidgets DOxygen Documentation

+

+ DOxygen documentation for the NxWidgets-1.0 is now available online at this location. +

+

+ Thanks go to Jose Pablo Carballo for contributing this! +

+

+ + diff --git a/nuttx/graphics/nxbe/nxbe_bitmap.c b/nuttx/graphics/nxbe/nxbe_bitmap.c index 75692ecb5..991b91d82 100644 --- a/nuttx/graphics/nxbe/nxbe_bitmap.c +++ b/nuttx/graphics/nxbe/nxbe_bitmap.c @@ -135,16 +135,11 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de } #endif - /* Offset the rectangle and image origin by the window origin */ - - nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y); - nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1); - /* Verify that the destination rectangle begins "below" and to the "right" * of the origin */ - if (bounds.pt1.x < origin->x || bounds.pt1.y < origin->y) + if (dest->pt1.x < origin->x || dest->pt1.y < origin->y) { gdbg("Bad dest start position\n"); return; @@ -154,13 +149,18 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de * width of the source bitmap data (taking into account the bitmap origin) */ - deststride = (((bounds.pt2.x - origin->x + 1) * wnd->be->plane[0].pinfo.bpp + 7) >> 3); + deststride = (((dest->pt2.x - origin->x + 1) * wnd->be->plane[0].pinfo.bpp + 7) >> 3); if (deststride > stride) { gdbg("Bad dest width\n"); return; } + /* Offset the rectangle and image origin by the window origin */ + + nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y); + nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1); + /* Clip to the limits of the window and of the background screen */ nxgl_rectintersect(&remaining, &bounds, &wnd->bounds); diff --git a/nuttx/graphics/nxconsole/nxcon_internal.h b/nuttx/graphics/nxconsole/nxcon_internal.h index 27b963d73..f5cbc9c6d 100644 --- a/nuttx/graphics/nxconsole/nxcon_internal.h +++ b/nuttx/graphics/nxconsole/nxcon_internal.h @@ -149,7 +149,9 @@ struct nxcon_glyph_s uint8_t height; /* Height of this glyph (in rows) */ uint8_t width; /* Width of this glyph (in pixels) */ uint8_t stride; /* Width of the glyph row (in bytes) */ +#ifdef CONFIG_NXCONSOLE_FONTCACHE uint8_t usecnt; /* Use count */ +#endif FAR uint8_t *bitmap; /* Allocated bitmap memory */ }; -- cgit v1.2.3