README.txt 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. README
  2. ^^^^^^
  3. This directory contains tiny graphics support for NuttX. The contents of this directory
  4. are only build if CONFIG_NX is defined in the NuttX configuration file.
  5. Contents
  6. ^^^^^^^^
  7. Roadmap
  8. Related Header Files
  9. Directories
  10. Installing New Fonts
  11. Configuration Settings
  12. Roadmap
  13. ^^^^^^^
  14. This directory holds NuttX graphic packages. Not all of these packages are implemented
  15. at the present, but here is the longer term roadmap:
  16. NxWidgets - NxWidgets is a higher level, C++, object-oriented library for object-
  17. oriented access to graphics "widgets." NxWidgets is provided as a separate
  18. package. NxWidgets is built on top of the core NuttX graphics subsystem,
  19. but is not a part of the core graphics subsystems.
  20. NXTOOLKIT - A set of C graphics tools that provide higher-level window drawing
  21. operations. The toolkit can be used for window-oriented graphics
  22. without NxWidgets and is built on top of NX.
  23. NXFONTS - A set of C graphics tools for presenting (bitmap) font images.
  24. NX - The tiny NuttX windowing system. This includes the small-footprint
  25. multi-user implementation (NXMU as described below). NX can be used
  26. without NxWidgets and without NXTOOLKIT for raw access to window memory.
  27. NXGLIB - Low level graphics utilities and direct framebuffer rendering logic.
  28. NX is built on top of NXGLIB.
  29. NxTerm - NxTerm is a write-only character device that is built on top of
  30. an NX window. This character device can be used to provide stdout
  31. and stderr and, hence, can provide the output side of NuttX console.
  32. Related Header Files
  33. ^^^^^^^^^^^^^^^^^^^^
  34. include/nuttx/nx/nxglib.h -- Describes the NXGLIB C interfaces
  35. include/nuttx/nx/nx.h -- Describes the NX C interfaces
  36. include/nuttx/nx/nxtk.h -- Describe the NXTOOLKIT C interfaces
  37. include/nuttx/nx/nxfont.h -- Describe sthe NXFONT C interfaces
  38. Directories
  39. ^^^^^^^^^^^
  40. The graphics capability consist both of components internal to the RTOS
  41. and of user-callable interfaces. In the NuttX kernel mode build there are
  42. some components of the graphics subsystem are callable in user mode and other
  43. components that are internal to the RTOS. This directory, nuttx/graphics,
  44. contains only those components that are internal to the RTOS.
  45. User callable functions must, instead, be part of a library that can be
  46. linked against user applications. This user callable interfaces are
  47. provided in sub-directories under nuttx/libs/libnx.
  48. libs/libnx/nx
  49. Client application callable interfaces.
  50. graphics/nxglib
  51. libs/libnx/nxglib
  52. The NuttX tiny graphics library. The directory contains generic utilities
  53. support operations on primitive graphics objects and logic to rasterize directly
  54. into a framebuffer. It has no concept of windows (other than the one, framebuffer
  55. window).
  56. graphics/nxbe
  57. This is the "back-end" of a tiny windowing system. It contains most
  58. of the important window management logic: clipping, window controls,
  59. window drawing, etc. Currently, the NXserver is the only "front-end"
  60. (Historically, there was a single user front-end, NXSU, but that front-
  61. end no longer exists).
  62. graphics/nxmu
  63. libs/libnx/nxmu
  64. This is the NX multi user "front end". When combined with the generic
  65. "back-end" (nxbe), it implements a multi-threaded, multi-user windowing
  66. system. The files in this directory present the window APIs described in
  67. include/nuttx/nx/nx.h. The multi-user front-end includes the NX graphics
  68. server that executes on its own thread; multiple graphics clients then
  69. communicate with the server via a POSIX message queue to serialize window
  70. operations from many threads. The multi-user front-end is selected
  71. automatically.
  72. libs/libnx/nxfonts
  73. This is where the NXFONTS implementation resides. This is a relatively low-
  74. level set of charset set/glyph management APIs. See include/nuttx/nx/nxfonts.h
  75. libs/libnx/nxtk
  76. This is where the NXTOOLKIT implementation resides. This toolkit is built on
  77. top of NX and works with either the single-user or multi-user NX version. See
  78. include/nuttx/nx/nxtk.h
  79. apps/grahpics/nxwidgets
  80. The NxWidgets code is provided as a separate package located outside of the
  81. NuttX source tree (probably at this location).
  82. graphics/vnc
  83. The future home of the VNC Remote Frame Buffer (RFB) server and client
  84. implementations.
  85. Installing New Fonts
  86. ^^^^^^^^^^^^^^^^^^^^
  87. [Refer to nuttx/libs/libnx/nxfonts/README.txt]
  88. Configuration Settings
  89. ^^^^^^^^^^^^^^^^^^^^^^
  90. General NX Settings
  91. -------------------
  92. CONFIG_NX
  93. Enables overall support for graphics library and NX
  94. CONFIG_NX_NPLANES
  95. Some YUV color formats requires support for multiple planes, one for each
  96. color component. Unless you have such special hardware, this value should be
  97. undefined or set to 1.
  98. CONFIG_NX_WRITEONLY
  99. Define if the underlying graphics device does not support read operations.
  100. Automatically defined if CONFIG_NX_LCDDRIVER and CONFIG_LCD_NOGETRUN are
  101. defined.
  102. CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
  103. CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
  104. CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
  105. CONFIG_NX_DISABLE_32BPP
  106. NX supports a variety of pixel depths. You can save some memory by disabling
  107. support for unused color depths.
  108. CONFIG_NX_PACKEDMSFIRST
  109. If a pixel depth of less than 8-bits is used, then NX needs to know if the
  110. pixels pack from the MS to LS or from LS to MS
  111. CONFIG_NX_XYINPUT
  112. Build in support for a X/Y positional input device such as a mouse or a
  113. touchscreen.
  114. CONFIG_NX_KBD
  115. Build in support of keypad/keyboard input.
  116. CONFIG_NXTK_BORDERWIDTH
  117. Specifies the width of the border (in pixels) used with framed windows.
  118. The default is 4.
  119. CONFIG_NXTK_BORDERCOLOR1, CONFIG_NXTK_BORDERCOLOR2, CONFIG_NXTK_BORDERCOLOR3
  120. Specify the colors of the border used with framed windows.
  121. CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so is normally darker.
  122. CONFIG_NXTK_BORDERCOLOR3 is the shiny side color and so is normally brighter.
  123. The default is mediumdark grey, and light grey, respectively
  124. CONFIG_NXTK_AUTORAISE
  125. If set, a window will be raised to the top if the mouse position is over a
  126. visible portion of the window. Default: A mouse button must be clicked over
  127. a visible portion of the window.
  128. CONFIG_VNCSERVER and CONFIG_VNCCLIENT
  129. Enable the VNC RFB server and client, respecitively.
  130. Font Selections
  131. ---------------
  132. [Refer to nuttx/libs/libnx/nxfonts/README.txt]
  133. NxTerm Configuration Settings
  134. --------------------------------
  135. CONFIG_NXTERM
  136. Enables building of the NxTerm driver.
  137. NxTerm output text/graphics options:
  138. CONFIG_NXTERM_BPP
  139. Currently, NxTerm supports only a single pixel depth. This
  140. configuration setting must be provided to support that single pixel depth.
  141. Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
  142. CONFIG_NXTERM_CURSORCHAR
  143. The bitmap code to use as the cursor. Default '_'
  144. CONFIG_NXTERM_MXCHARS
  145. NxTerm needs to remember every character written to the console so
  146. that it can redraw the window. This setting determines the size of some
  147. internal memory allocations used to hold the character data. Default: 128.
  148. CONFIG_NXTERM_CACHESIZE
  149. NxTerm supports caching of rendered fonts. This font caching is required
  150. for two reasons: (1) First, it improves text performance, but more
  151. importantly (2) it preserves the font memory. Since the NX server runs on
  152. a separate server thread, it requires that the rendered font memory persist
  153. until the server has a chance to render the font. Unfortunately, the font
  154. cache would be quite large if all fonts were saved. The CONFIG_NXTERM_CACHESIZE
  155. setting will control the size of the font cache (in number of glyphs). Only that
  156. number of the most recently used glyphs will be retained. Default: 16.
  157. NOTE: There can still be a race condition between the NxTerm driver and the
  158. NX task. If you every see character corruption (especially when printing
  159. a lot of data or scrolling), then increasing the value of CONFIG_NXTERM_CACHESIZE
  160. is something that you should try. Alternatively, you can reduce the size of
  161. CONFIG_MQ_MAXMSGSIZE which will force NxTerm task to pace the server task.
  162. CONFIG_NXTERM_CACHESIZE should be larger than CONFIG_MQ_MAXMSGSIZE in any event.
  163. CONFIG_NXTERM_LINESEPARATION
  164. This the space (in rows) between each row of test. Default: 0
  165. CONFIG_NXTERM_NOWRAP
  166. By default, lines will wrap when the test reaches the right hand side
  167. of the window. This setting can be defining to change this behavior so
  168. that the text is simply truncated until a new line is encountered.
  169. NxTerm Input options
  170. CONFIG_NXTERM_NXKBDIN
  171. Take input from the NX keyboard input callback. By default, keyboard
  172. input is taken from stdin (/dev/console). If this option is set, then
  173. the interface nxterm_kdbin() is enabled. That interface may be driven
  174. by window callback functions so that keyboard input *only* goes to the
  175. top window.
  176. CONFIG_NXTERM_KBDBUFSIZE
  177. If CONFIG_NXTERM_NXKBDIN is enabled, then this value may be used to
  178. define the size of the per-window keyboard input buffer. Default: 16
  179. CONFIG_NXTERM_NPOLLWAITERS
  180. The number of threads that can be waiting for read data available.
  181. Default: 4
  182. NX Multi-user options
  183. ---------------------
  184. CONFIG_NX_BLOCKING
  185. Open the client message queues in blocking mode. In this case,
  186. nx_eventhandler() will not return until a message is received and processed.
  187. CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS
  188. Specifies the maximum number of messages that can fit in the message queues.
  189. No additional resources are allocated, but this can be set to prevent
  190. flooding of the client or server with too many messages (CONFIG_PREALLOC_MQ_MSGS
  191. controls how many messages are pre-allocated).