diff --git a/ChangeLog.txt b/ChangeLog.txt index d6971dc45..cefced15b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -548,3 +548,6 @@ coverage was superficial (2013-5-3). * apps/examples/smart: This is an adaptation of the NXFFS stress test for the SMART file system (Ken Pettit, 2013-5-3). + * apps/examplex/nxtext: Remove the CONFIG_EXAMPLES_NXTEXT_NOGETRUN + option. The test logic was bad for the case where this options + is not selected. Also, complete the empty Kconfig file (2013-5-7). diff --git a/examples/nxtext/Kconfig b/examples/nxtext/Kconfig index 1ff2c44be..6b220b2a2 100644 --- a/examples/nxtext/Kconfig +++ b/examples/nxtext/Kconfig @@ -10,4 +10,158 @@ config EXAMPLES_NXTEXT Enable the NX graphics text example if EXAMPLES_NXTEXT + +comment "Basic Configuration of the example" + +config EXAMPLES_NXTEXT_BUILTIN + bool "NSH Built-IN" + depends on NSH_BUILTIN_APPS + ---help--- + Build the NX Text example as a "built-in" that can be executed from the + NSH command line. + +config EXAMPLES_NXTEXT_VPLANE + int "Video Plane" + default 0 + ---help--- + The plane to select from the framebuffer driver for use in the test. + Default: 0 + +config EXAMPLES_NXTEXT_DEVNO + int "Video Device Number" + default 0 + ---help--- + The LCD device to select from the LCD driver for use in the test: + Default: 0 + +config EXAMPLES_NXTEXT_BPP + int "Bits-Per-Pixel" + default 32 + ---help--- + Pixels per pixel to use. Valid options include 2, 4, 8, 16, 24, + and 32. Default is 32. + +config EXAMPLES_NXTEXT_BMCACHE + int "Character cache size" + default 128 + ---help--- + Size of the character cache. + +config EXAMPLES_NXTEXT_GLCACHE + int "Glyph cache size" + default 16 + ---help--- + Size of the glyph cache. + +comment "Example Color Configuration" + +config EXAMPLES_NXTEXT_DEFAULT_COLORS + bool "Use Default Colors" + default y + +if !EXAMPLES_NXTEXT_DEFAULT_COLORS + +config EXAMPLES_NXTEXT_BGCOLOR + hex "Background color" + default 0x0 + ---help--- + The color of the background. Default depends on config + EXAMPLES_NXTEXT_BPP. + +config EXAMPLES_NXTEXT_BGFONTCOLOR + hex "Background font color" + default 0x0 + ---help--- + The color of the fonts used in the background window. Default + depends on config EXAMPLES_NXTEXT_BPP. + +config EXAMPLES_NXTEXT_PUCOLOR + hex "Pop-up color" + default 0x0 + ---help--- + The color of the pop-up window. Default depends on config + EXAMPLES_NXTEXT_BPP. + +config EXAMPLES_NXTEXT_PUFONTCOLOR + hex "Pop-up font color" + default 0x0 + ---help--- + The color of the fonts used in the pop-up window. Default + depends on config EXAMPLES_NXTEXT_BPP. + +endif + +comment "Example Font Configuration" + +config EXAMPLES_NXTEXT_DEFAULT_FONT + bool "Use Default Font" + default y + +if !EXAMPLES_NXTEXT_DEFAULT_FONT + +config EXAMPLES_NXTEXT_BGFONTID + bool "Background font ID" + default 0 + ---help--- + Selects the font used in the background window (see font ID numbers + in include/nuttx/nx/nxfonts.h) + +config EXAMPLES_NXTEXT_PUFONTID + bool "Pop-up font ID" + default 0 + ---help--- + Selects the font used in the pop-up window (see font ID numbers + in include/nuttx/nx/nxfonts.h) + +endif + +config EXAMPLES_NXTEXT_EXTERNINIT + bool "External Device Initialization" + default n + ---help--- + The driver for the graphics device on this platform requires some + unusual initialization. This is the case, for example, for SPI LCD/OLED + devices. If this configuration is selected, then the platform code + must provide an LCD initialization function with a prototype like: + + #ifdef CONFIG_NX_LCDDRIVER + FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno); + #else + FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno); + #endif + +if NX_MULTIUSER +comment "Multi-User Configuration Options" + +config EXAMPLES_NXTEXT_STACKSIZE + int "NX Server Stack Size" + default 2048 + ---help--- + The stacksize to use when creating the NX server. Default 2048 + +config EXAMPLES_NXTEXT_CLIENTPRIO + int "Client Priority" + default 100 + ---help--- + The client priority. Default: 100 + +config EXAMPLES_NXTEXT_SERVERPRIO + int "Server Priority" + default 120 + ---help--- + The server priority. Default: 120 + +config EXAMPLES_NXTEXT_LISTENERPRIO + int "Listener Priority" + default 80 + ---help--- + The priority of the event listener thread. Default 100. + +config EXAMPLES_NXTEXT_NOTIFYSIGNO + int "Notify Signal Number" + default 4 + ---help--- + The signal number to use with nx_eventnotify(). Default: 4 + +endif endif diff --git a/examples/nxtext/nxtext_bkgd.c b/examples/nxtext/nxtext_bkgd.c index d457432db..7817bf441 100644 --- a/examples/nxtext/nxtext_bkgd.c +++ b/examples/nxtext/nxtext_bkgd.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxtext/nxtext_bkgd.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -231,7 +231,6 @@ static void nxbg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, * only. ****************************************************************************/ -#ifdef CONFIG_EXAMPLES_NXTEXT_NOGETRUN static inline void nxbg_movedisplay(NXWINDOW hwnd, int bottom, int lineheight) { FAR struct nxtext_bitmap_s *bm; @@ -287,38 +286,6 @@ static inline void nxbg_movedisplay(NXWINDOW hwnd, int bottom, int lineheight) message("nxbg_movedisplay: nx_fill failed: %d\n", errno); } } -#else -static inline void nxbg_movedisplay(NXWINDOW hwnd, int bottom, int lineheight) -{ - struct nxgl_rect_s rect; - struct nxgl_point_s offset; - int ret; - - /* Move the display in the range of 0-height up one lineheight. The - * line at the bottom will be reset to the background color automatically. - * - * The source rectangle to be moved. - */ - - rect.pt1.x = 0; - rect.pt1.y = lineheight + LINE_SEPARATION; - rect.pt2.x = g_bgstate.wsize.w - 1; - rect.pt2.y = g_bgstate.wsize.h - 1; - - /* The offset that determines how far to move the source rectangle */ - - offset.x = 0; - offset.y = -lineheight; - - /* Move the source rectangle */ - - ret = nx_move(hwnd, &rect, &offset); - if (ret < 0) - { - message("nxbg_movedisplay: nx_move failed: %d\n", errno); - } -} -#endif /**************************************************************************** * Name: nxbg_scroll