From 96c93d6499f93ac4baf0d892c3c3c6aaef8a11f9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 15:58:12 -0600 Subject: NxWM: Can now configure to use small or large icons --- NxWidgets/Kconfig | 30 +++++++++++++++++++++------ NxWidgets/nxwm/Makefile | 9 +++++++- NxWidgets/nxwm/include/nxwmconfig.hxx | 22 +++++++++++++------- NxWidgets/nxwm/src/glyph_calibration48x42.cxx | 20 +++++++++--------- NxWidgets/nxwm/src/glyph_minimize42x42.cxx | 26 +++++++++++------------ NxWidgets/nxwm/src/glyph_stop42x42.cxx | 16 +++++++------- apps/NxWidgets/Kconfig | 20 +++++++++++++++--- 7 files changed, 95 insertions(+), 48 deletions(-) diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig index 7a903c335..8495d0908 100644 --- a/NxWidgets/Kconfig +++ b/NxWidgets/Kconfig @@ -313,13 +313,27 @@ if NXWM menu "NxWM General settings" -config NXWM_SYSTEM_CUSTOM_FONTID +config NXWM_LARGE_ICONS + bool "Use large icons" + default n + ---help--- + The default icons are nominally 25x25 pixels for a small + resolution/display, this is a good selection. For example, a + 320x240 display that is 4.5cm x 3.375 would have a resolution of + about 71 dots per cm. In this case, the icon would be 0.35cm. + + If you use a larger display, these smaller icons may seem + inappropriately small. In this case, you have two options: (1) + Enable image scaling which will make the icons "fuzzy" looking, or + (2) select this option to enable use of larger icons. + +config NXWM_CUSTOM_FONTID bool "Use Custom Default Font" default n ---help--- Set to override the system default font id (NXFONT_DEFAULT). -if NXWM_SYSTEM_CUSTOM_FONTID +if NXWM_CUSTOM_FONTID config NXWM_DEFAULT_FONTID int "Font ID" @@ -328,7 +342,7 @@ config NXWM_DEFAULT_FONTID Use this NxWM default font ID instead of the system font ID (NXFONT_DEFAULT). Default: 0 -endif # NXWM_SYSTEM_CUSTOM_FONTID +endif # NXWM_CUSTOM_FONTID config NXWM_UNITTEST bool "NxWM Unit Test" @@ -480,7 +494,8 @@ if NXWM_CUSTOM_TASKBAR_WIDTH config NXWM_TASKBAR_WIDTH int "Taskbar Width" - default 29 + default 29 if !NXWM_LARGE_ICONS + default 54 if !NXWM_LARGE_ICONS ---help--- Task bar thickness (either vertical or horizontal). Default: 25 + 2*2 @@ -532,16 +547,19 @@ config NXWM_CUSTOM_TOOLBAR_HEIGHT ---help--- Set to override the default tooldar height The default depends on the selected horizontal or vertical spacing. Default: 21 + 2*spacing + or 42 + 2*spacing if large icons are selected if NXWM_CUSTOM_TOOLBAR_HEIGHT config NXWM_TOOLBAR_HEIGHT int "Toolbar Height" - default 25 + default 25 if !NXWM_LARGE_ICONS + default 46 if NXWM_LARGE_ICONS ---help--- The height of the tool bar in each application window. At present, all icons are 21 pixels in height and, hence, require a task bar of - at least that size. Default: 21 + 2*2 + at least that size. Default: 21 + 2*2or 42 + 2*spacing if large + icons are selected endif # NXWM_CUSTOM_TOOLBAR_HEIGHT endmenu # NxWM Toolbar Configuration diff --git a/NxWidgets/nxwm/Makefile b/NxWidgets/nxwm/Makefile index 69f2a1ac8..ff4b256b1 100644 --- a/NxWidgets/nxwm/Makefile +++ b/NxWidgets/nxwm/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/nxwm/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -75,8 +75,15 @@ CXXSRCS += cnxconsole.cxx endif # Images + + +ifeq ($(CONFIG_NXWM_LARGE_ICONS),y) +CXXSRCS += glyph_calculator47x49.cxx glyph_calibration48x42.cxx glyph_cmd49x43.cxx +CXXSRCS += glyph_minimize42x42.cxx glyph_play48x48.cxx glyph_stop42x42.cxx +else CXXSRCS += glyph_calculator24x25.cxx glyph_calibration24x21.cxx glyph_cmd25x22.cxx CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_stop21x21.cxx +endif ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) CXXSRCS += glyph_mediaplayer24x24.cxx cmediaplayer.cxx glyph_mplayer_controls32x32.cxx diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx index b6c4d6da4..0f31e8d55 100644 --- a/NxWidgets/nxwm/include/nxwmconfig.hxx +++ b/NxWidgets/nxwm/include/nxwmconfig.hxx @@ -188,7 +188,8 @@ * CONFIG_NXWM_TASKBAR_RIGHT - Task bar is on the right side of the display * * CONFIG_NXWM_TASKBAR_WIDTH - Task bar thickness (either vertical or - * horizontal). Default: 25 + 2*spacing + * horizontal). Default: 25 + 2*spacing unless large icons are selected. + * Then the default is 50 *spacing */ /** @@ -226,7 +227,7 @@ // Taskbar ICON scaling -#ifdef CONFIG_NXWM_TASKBAR_ICONSCALE +#if defined(CONFIG_NXWM_TASKBAR_ICONSCALE) # ifndef CONFIG_NXWM_TASKBAR_ICONWIDTH # error Scaling requires CONFIG_NXWM_TASKBAR_ICONWIDTH # define CONFIG_NXWM_TASKBAR_ICONWIDTH 50 @@ -235,11 +236,16 @@ # error Scaling requires CONFIG_NXWM_TASKBAR_ICONHEIGHT # define CONFIG_NXWM_TASKBAR_ICONHEIGHT 42 # endif +#elif defined(CONFIG_NXWM_LARGE_ICONS) +# undef CONFIG_NXWM_TASKBAR_ICONWIDTH +# define CONFIG_NXWM_TASKBAR_ICONWIDTH 50 +# undef CONFIG_NXWM_TASKBAR_ICONHEIGHT +# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 42 #else # undef CONFIG_NXWM_TASKBAR_ICONWIDTH -# define CONFIG_NXWM_TASKBAR_ICONWIDTH 25 // Used below +# define CONFIG_NXWM_TASKBAR_ICONWIDTH 25 # undef CONFIG_NXWM_TASKBAR_ICONHEIGHT -# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 21 // Used below (NOT) +# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 21 #endif /** @@ -260,12 +266,14 @@ /* Tool Bar Configuration ***************************************************/ /** * CONFIG_NXWM_TOOLBAR_HEIGHT. The height of the tool bar in each - * application window. At present, all icons are 21 pixels in height and, - * hence require a task bar of at least that size. + * application window. At present, all icons are 21 or 42 pixels in height + * (depending on the setting of CONFIG_NXWM_LARGE_ICONS) and, hence require + * a task bar of at least that size. */ #ifndef CONFIG_NXWM_TOOLBAR_HEIGHT -# define CONFIG_NXWM_TOOLBAR_HEIGHT (21+2*CONFIG_NXWM_TASKBAR_HSPACING) +# define CONFIG_NXWM_TOOLBAR_HEIGHT \ + (CONFIG_NXWM_TASKBAR_ICONHEIGHT + 2*CONFIG_NXWM_TASKBAR_HSPACING) #endif /* Background Image **********************************************************/ diff --git a/NxWidgets/nxwm/src/glyph_calibration48x42.cxx b/NxWidgets/nxwm/src/glyph_calibration48x42.cxx index 7e87f085c..3d6fe04f3 100644 --- a/NxWidgets/nxwm/src/glyph_calibration48x42.cxx +++ b/NxWidgets/nxwm/src/glyph_calibration48x42.cxx @@ -108,7 +108,7 @@ static const uint32_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x0000, 0xbdf7, 0xad55, 0x8410, 0x39e7, 0xab62, 0x81e2, /* Codes 1-6 */ + 0xbdf7, 0xad55, 0x8410, 0x39e7, 0xab62, 0x81e2 /* Codes 1-6 */ }; static const uint16_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = @@ -301,14 +301,14 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_minimizeNormalLut, // Index 0: Unselected LUT - g_minimizeBrightlLut, // Index 1: Selected LUT + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calibrationNormalLut, // Index 0: Unselected LUT + g_calibrationBrightlLut, // Index 1: Selected LUT }, - g_minimizeRleEntries // data - Pointer to the beginning of the RLE data + g_calibrationRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/NxWidgets/nxwm/src/glyph_minimize42x42.cxx b/NxWidgets/nxwm/src/glyph_minimize42x42.cxx index 6ba2f23f8..0d207570f 100644 --- a/NxWidgets/nxwm/src/glyph_minimize42x42.cxx +++ b/NxWidgets/nxwm/src/glyph_minimize42x42.cxx @@ -78,7 +78,7 @@ static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x1b368a, 0x3651a5, 0x001b8a, 0x001ba5, 0x1b1b6f, 0x00008a, 0xbdbdbd, 0xa5bdbd /* Codes 0-7 */ }; -static const uint32_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ }; @@ -90,7 +90,7 @@ static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ }; -static const uint32_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2d5ae6, 0x5a87ff, 0x002de6, 0x002dff, 0x2d2db9, 0x0000e6, 0xffffff, 0xffffff /* Codes 0-7 */ }; @@ -106,7 +106,7 @@ static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x19b1, 0x3294, 0x00d1, 0x00d4, 0x18cd, 0x0011, 0xbdf7, 0xa5f7 /* Codes 0-7 */ }; -static const uint16_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ }; @@ -118,7 +118,7 @@ static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ }; -static const uint16_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2adc, 0x5c3f, 0x017c, 0x017f, 0x2977, 0x001c, 0xffff, 0xffff /* Codes 0-7 */ }; @@ -144,7 +144,7 @@ static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x37, 0x52, 0x1f, 0x22, 0x24, 0x0f, 0xbd, 0xb5 /* Codes 0-7 */ }; -static const uint8_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ }; @@ -156,7 +156,7 @@ static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ }; -static const uint8_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x5c, 0x87, 0x34, 0x37, 0x3c, 0x1a, 0xff, 0xff /* Codes 0-7 */ }; @@ -174,7 +174,7 @@ static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x06, 0x2a, 0x02, 0x02, 0x01, 0x02, 0xb6, 0xb6 /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ }; @@ -186,7 +186,7 @@ static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2b, 0x53, 0x07, 0x07, 0x26, 0x03, 0xff, 0xff /* Codes 0-7 */ }; @@ -249,11 +249,11 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_minimizeNormalLut, // Index 0: Unselected LUT g_minimizeBrightLut, // Index 1: Selected LUT diff --git a/NxWidgets/nxwm/src/glyph_stop42x42.cxx b/NxWidgets/nxwm/src/glyph_stop42x42.cxx index 91f7dbe60..0b8ca8fe6 100644 --- a/NxWidgets/nxwm/src/glyph_stop42x42.cxx +++ b/NxWidgets/nxwm/src/glyph_stop42x42.cxx @@ -78,7 +78,7 @@ static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xa5a5a5, 0xa50000, 0xbd0000, 0x6f1b1b, 0xbdbdbd, 0xa5bdbd, 0x8a0000, 0xbda5a5 /* Codes 0-7 */ }; -static const uint32_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdcdcdc, 0xdc0000, 0xfc0000, 0x942424, 0xfcfcfc, 0xdcfcfc, 0xb80000, 0xfcdcdc /* Codes 0-7 */ }; @@ -90,7 +90,7 @@ static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdcdcdc, 0xdc0000, 0xfc0000, 0x942424, 0xfcfcfc, 0xdcfcfc, 0xb80000, 0xfcdcdc /* Codes 0-7 */ }; -static const uint32_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xffffff, 0xff0000, 0xff0000, 0xb92d2d, 0xffffff, 0xffffff, 0xe60000, 0xffffff /* Codes 0-7 */ }; @@ -106,7 +106,7 @@ static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xa534, 0xa000, 0xb800, 0x68c3, 0xbdf7, 0xa5f7, 0x8800, 0xbd34 /* Codes 0-7 */ }; -static const uint16_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdefb, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb800, 0xfefb /* Codes 0-7 */ }; @@ -118,7 +118,7 @@ static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdefb, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb800, 0xfefb /* Codes 0-7 */ }; -static const uint16_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xffff, 0xf800, 0xf800, 0xb965, 0xffff, 0xffff, 0xe000, 0xffff /* Codes 0-7 */ }; @@ -144,7 +144,7 @@ static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xa5, 0x31, 0x38, 0x34, 0xbd, 0xb5, 0x29, 0xac /* Codes 0-7 */ }; -static const uint8_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdc, 0x41, 0x4b, 0x45, 0xfc, 0xf2, 0x37, 0xe5 /* Codes 0-7 */ }; @@ -156,7 +156,7 @@ static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdc, 0x41, 0x4b, 0x45, 0xfc, 0xf2, 0x37, 0xe5 /* Codes 0-7 */ }; -static const uint8_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xff, 0x4c, 0x4c, 0x56, 0xff, 0xff, 0x44, 0xff /* Codes 0-7 */ }; @@ -174,7 +174,7 @@ static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xb6, 0xa0, 0xa0, 0x60, 0xb6, 0xb6, 0x80, 0xb6 /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdb, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xfb /* Codes 0-7 */ }; @@ -186,7 +186,7 @@ static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdb, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xfb /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xe0, 0xe0, 0xa4, 0xff, 0xff, 0xe0, 0xff /* Codes 0-7 */ }; diff --git a/apps/NxWidgets/Kconfig b/apps/NxWidgets/Kconfig index 7a903c335..f8d66b1cb 100644 --- a/apps/NxWidgets/Kconfig +++ b/apps/NxWidgets/Kconfig @@ -313,13 +313,27 @@ if NXWM menu "NxWM General settings" -config NXWM_SYSTEM_CUSTOM_FONTID +config NXWM_LARGE_ICONS + bool "Use large icons" + default n + ---help--- + The default icons are nominally 25x25 pixels for a small + resolution/display, this is a good selection. For example, a + 320x240 display that is 4.5cm x 3.375 would have a resolution of + about 71 dots per cm. In this case, the icon would be 0.35cm. + + If you use a larger display, these smaller icons may seem + inappropriately small. In this case, you have two options: (1) + Enable image scaling which will make the icons "fuzzy" looking, or + (2) select this option to enable use of larger icons. + +config NXWM_CUSTOM_FONTID bool "Use Custom Default Font" default n ---help--- Set to override the system default font id (NXFONT_DEFAULT). -if NXWM_SYSTEM_CUSTOM_FONTID +if NXWM_CUSTOM_FONTID config NXWM_DEFAULT_FONTID int "Font ID" @@ -328,7 +342,7 @@ config NXWM_DEFAULT_FONTID Use this NxWM default font ID instead of the system font ID (NXFONT_DEFAULT). Default: 0 -endif # NXWM_SYSTEM_CUSTOM_FONTID +endif # NXWM_CUSTOM_FONTID config NXWM_UNITTEST bool "NxWM Unit Test" -- cgit v1.2.3