diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html index cfe66daaeaa..9450b897caf 100644 --- a/Documentation/NXGraphicsSubsystem.html +++ b/Documentation/NXGraphicsSubsystem.html @@ -148,7 +148,7 @@

- 2.5 NX Fonts Support (NXFONTS)
+ 2.5 NX Fonts Support (NXFONTS)

+

+ 2.6 Sample Code +

Appendix A graphics/ Directory Structure
@@ -176,6 +179,13 @@

Appendix C NX Test Coverage

+ @@ -1714,6 +1724,43 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, ubyte buttons);

2.4 NX Tool Kit (NXTK)

+

+ NXTK implements where the framed window. + NX framed windows consist of three components within one NX window: +

+
    +
  1. The window border,
  2. +
  3. The main client window area, and
  4. +
  5. A toolbar area
  6. +
+ +

+ Each sub-window represents a region within one window. + Figure 1 shows some simple NX framed windows. + NXTK allows these sub-windows to be managed more-or-less independently: +

+ +

2.4.1 NXTK Types()

@@ -2103,9 +2150,9 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height, nxtk_openwindow().

height
The requested height of the toolbar in pixels. -
+
cb
Callbacks used to process toolbar events. -
+
arg
User provided value that will be returned with toolbar callbacks.

@@ -2392,22 +2439,28 @@ FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch); #include <nuttx/nxfonts.h> int nxf_convert_2bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, uint16 ch, + uint16 width, uint16 stride, + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); int nxf_convert_4bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, uint16 ch, + uint16 width, uint16 stride, + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); int nxf_convert_8bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, uint16 ch, + uint16 width, uint16 stride, + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); int nxf_convert_16bpp(FAR uint16 *dest, uint16 height, - uint16 width, uint16 stride, uint16 ch, + uint16 width, uint16 stride, + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); int nxf_convert_24bpp(FAR uint32 *dest, uint16 height, - uint16 width, uint16 stride, uint16 ch, + uint16 width, uint16 stride, + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); int nxf_convert_32bpp(FAR uint32 *dest, uint16 height, - uint16 width, uint16 stride, uint16 ch, + uint16 width, uint16 stride, + FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color);

@@ -2424,16 +2477,39 @@ int nxf_convert_32bpp(FAR uint32 *dest, uint16 height,

The max width of the returned char in pixels.
stride
The width of the destination buffer in bytes. -
ch -
The character code to convert. +
bm +
Describes the character glyph to convert
color
The color to use for '1' bits in the font bitmap (0 bits are transparent).

Returned Value: - On Success, these functions returns the actual width of the font in bytes. - on failed, a negated errno is retured. + OK on success; + ERROR on failure with errno set appropriately. +

+ +

2.6 Sample Code

+ +

examples/nx. + No sample code is provided in this document. + However, an example can be found in the NuttX source tree at examples/nx. + That code is intended to test NX. + Since it is test code, it is designed to exercise functionality and does not necessarily + represent best NX coding practices. +

+ +

+ In its current form, the NX graphics system provides a low level of graphics and window + support. + Most of the complexity of manage redrawing and handling mouse and keyboard events must + be implemented by the NX client code. +

+ +

Building examples/nx. + Testing was performed using the Linux/Cygwin-based NuttX simulator. + Instructions are provided for building that simulation are provided in + Appendix C of this document.

@@ -2602,17 +2678,468 @@ int nxf_convert_32bpp(FAR uint32 *dest, uint16 height,
-

+

examples/nx. The primary test tool for debugging NX resides at examples/nx. - At present, that test only exercises a subset of NX; the remainder is essentially - untested. +

+

Building examples/nx. + NX testing was performed using examples/nx with the + Linux/Cygwin-based NuttX simulator. + Configuration files for building this test can be found in configs/sim/nx. + There are two alternative configurations for building the simulation: +

+
    +
  1. + The default configuration using the configuration file at + configs/sim/nx/defconfig. + This default configuration exercises the NX logic a 8 BPP but provides no visual feedback. + In this configuration, a very simple, simulated framebuffer driver is used that is + based upon a simple region of memory posing as video memory. + That default configuration can be built as follows: +
      +cd <NuttX-Directory>/tools
      +./configure sim/nx
      +cd  <NuttX-Directory>
      +make
      +./nuttx
      +
    +
  2. +
  3. + A preferred configuration extends the test with a simulated framebuffer driver + that uses an X window as a framebuffer. + This configuration uses the configuration file at configs/sim/nx/defconfig-x11. + This is a superior test configuration because the X window appears at your desktop + and you can see the NX output. + This preferred configuration can be built as follows: +
      +cd <NuttX-Directory>/tools
      +./configure sim/nx
      +cd  <NuttX-Directory>
      +cp <NuttX-Directory>/configs/sim/nx/defconfig-x11 .config
      +make
      +./nuttx
      +
    +
  4. +
+

+ Why isn't this configuration the default? Because not all systems the use NX support X. +

+ +

Test Coverage. + At present, examples/nxt only exercises a subset of NX; + the remainder is essentially untested. The following table describes the testing performed on each NX API:

-

Table C.1: NX Test Coverage

+

Table C.1: NXGLIB API Test Coverage

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionSpecial Setup/NotesVerified
nxgl_rgb2yuv()
NO
nxgl_yuv2rgb()
NO
nxgl_rectcopy()
YES
nxgl_rectoffset()
YES
nxgl_vectoradd()
YES
nxgl_vectorsubtract()
YES
nxgl_rectintersect()
YES
nxgl_rectunion()
YES
nxgl_nonintersecting()
YES
nxgl_rectoverlap()
YES
nxgl_rectinside()
YES
nxgl_rectsize()
YES
nxgl_nullrect()
YES
nxgl_runoffset()
NO
nxgl_runcopy()
NO
nxgl_trapoffset()
NO
nxgl_trapcopy()
NO
nxgl_colorcopy
YES
-
- + +

Table C.2: NX Server Callbacks Test Coverage

+
To be provided
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionSpecial Setup/NotesVerified
redraw()
YES
position()
YES
mousein()
YES
kbdin()
YES
+ +

Table C.3: NX API Test Coverage

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionSpecial Setup/NotesVerified
nx_runinstance()Change to CONFIG_NX_MULTIUSER=y in the + <NuttX-Directory>/.config file YES
nx_connectinstance()Change to CONFIG_NX_MULTIUSER=y in the + <NuttX-Directory>/.config file YES
nx_open()
YES
nx_disconnect()Change to CONFIG_NX_MULTIUSER=y in the + <NuttX-Directory>/.config file YES
nx_close()
YES
nx_eventhandler()Change to CONFIG_NX_MULTIUSER=y in the + <NuttX-Directory>/.config fileYES
nx_eventnotify()This is not used in the current version of examples/nx, + was tested in a previous version)NO
nx_openwindow()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_closewindow()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_requestbkgd()
NO
nx_releasebkgd()
NO
nx_getposition()
NO
nx_setposition()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_setsize()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_raise()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_lower()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_fill()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileYES
nx_filltrapezoid()
NO
nx_setbgcolor()
YES
nx_move()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config fileNO
nx_bitmap()Change to CONFIG_EXAMPLES_NX_RAWWINDOWS=y in the + <NuttX-Directory>/.config file.YES
nx_kbdin()
YES
nx_mousein()
YES
+ + +

Table C.4: NXTK API Test Coverage

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionSpecial Setup/NotesVerified
nxtk_openwindow()
YES
nxtk_closewindow()
YES
nxtk_getposition()
NO
nxtk_setposition()
YES
nxtk_setsize()
YES
nxtk_raise()
YES
nxtk_lower()
YES
nxtk_fillwindow()
YES
nxtk_filltrapwindow()
NO
nxtk_movewindow()
NO
nxtk_bitmapwindow()
YES
nxtk_opentoolbar()
YES
nxtk_closetoolbar()
YES
nxtk_filltoolbar()
YES
nxtk_filltraptoolbar()
NO
nxtk_movetoolbar()
NO
nxtk_bitmaptoolbar()
NO
+ +

Table C.5: NXFONTS API Test Coverage

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionSpecial Setup/NotesVerified
nxf_getfontset()
YES
nxf_getbitmap()
YES
nxf_convert_2bpp()
NO
nxf_convert_4bpp()
NO
nxf_convert_8bpp()Use defconfig when building.YES
nxf_convert_16bpp()
NO
nxf_convert_24bpp()
NO
nxf_convert_32bpp()Use defconfig-x11 when building.YES