summaryrefslogtreecommitdiff
path: root/NxWidgets
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-05-11 16:15:51 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-05-11 16:15:51 -0600
commit9170f5ac5117c9239e9fb9265a9d74725b089d16 (patch)
tree7f32fd395083732ea58ec3697d0e6c0121773847 /NxWidgets
parent5b0a06cafebd0a0dc8060f7e7a4208cac06dcaaa (diff)
downloadpx4-nuttx-9170f5ac5117c9239e9fb9265a9d74725b089d16.tar.gz
px4-nuttx-9170f5ac5117c9239e9fb9265a9d74725b089d16.tar.bz2
px4-nuttx-9170f5ac5117c9239e9fb9265a9d74725b089d16.zip
Add beginning a a media player window to NxWM from Ken Pettit. Still a work in progress
Diffstat (limited to 'NxWidgets')
-rw-r--r--NxWidgets/ChangeLog.txt6
-rw-r--r--NxWidgets/Kconfig18
-rw-r--r--NxWidgets/UnitTests/nxwm/nxwm_main.cxx45
-rw-r--r--NxWidgets/nxwm/Makefile4
-rw-r--r--NxWidgets/nxwm/include/cmediaplayer.hxx286
-rw-r--r--NxWidgets/nxwm/include/nxwmconfig.hxx23
-rw-r--r--NxWidgets/nxwm/include/nxwmglyphs.hxx1
-rw-r--r--NxWidgets/nxwm/src/cmediaplayer.cxx454
-rw-r--r--NxWidgets/nxwm/src/glyph_mediaplayer.cxx305
9 files changed, 1139 insertions, 3 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index be423b9dd..12e429f45 100644
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/ChangeLog.txt
@@ -346,3 +346,9 @@
From Petteri Aimonen (2013-4-22).
1.8 2013-xx-xx Gregory Nutt <gnutt@nuttx.org>
+
+* NxWM::CMediaPlayer: shell application for an MP3 Media Player with
+ Kconfig settings to enable it. I plan to write this app to help
+ develop and test the MP3 codec chip driver. It really doesn't do
+ anything yet except display a text box saying "Coming soon", and I
+ need to minimize the icon size a bit. From Ken Pettit (2013-5-11).
diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig
index efa56a06c..1e4e10c66 100644
--- a/NxWidgets/Kconfig
+++ b/NxWidgets/Kconfig
@@ -470,7 +470,7 @@ config NXWM_BACKGROUND_IMAGE
NXWidgets::g_nuttxBitmap
comment "Application Window Configuration"
-
+
config NXWM_CUSTOM_APPWINDOW_ICONS
bool "Custom Start/Stop Application Window Icons"
default n
@@ -591,13 +591,13 @@ if NXWM_NXCONSOLE_CUSTOM_COLORS
config NXWM_NXCONSOLE_WCOLOR
hex "NxConsole Background Color"
---help---
- The color of the NxConsole window background. Default:
+ The color of the NxConsole window background. Default:
RGB(192,192,192)
config NXWM_NXCONSOLE_FONTCOLOR
hex "NxConsole Font Color"
---help---
- The color of the fonts to use in the NxConsole window.
+ The color of the fonts to use in the NxConsole window.
Default: RGB(0,0,0)
endif
@@ -840,4 +840,16 @@ config NXWM_HEXCALCULATOR_FONTID
NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0
endif
+config NXWM_MEDIAPLAYER
+ bool "Enable Media Player"
+ default n
+ ---help---
+ Enable support for the MP3 Media Player. This features requires
+ a board that includes an MP3 Codec chip, such as the Mikromedia
+ boards available from MikroElektronica, along with a NuttX port
+ with a device driver for the MP3 codec.
+
+ NOTE: This application is currently under development and just
+ a shell of an app which will be developed soon.
+
endif
diff --git a/NxWidgets/UnitTests/nxwm/nxwm_main.cxx b/NxWidgets/UnitTests/nxwm/nxwm_main.cxx
index fa05d52e4..04ffb64ba 100644
--- a/NxWidgets/UnitTests/nxwm/nxwm_main.cxx
+++ b/NxWidgets/UnitTests/nxwm/nxwm_main.cxx
@@ -49,6 +49,10 @@
#include "cnxconsole.hxx"
#include "chexcalculator.hxx"
+#ifdef CONFIG_NXWM_MEDIAPLAYER
+#include "cmediaplayer.hxx"
+#endif
+
#ifdef CONFIG_NXWM_TOUCHSCREEN
# include "ctouchscreen.hxx"
# include "ccalibration.hxx"
@@ -561,6 +565,37 @@ static bool createHexCalculator(void)
}
/////////////////////////////////////////////////////////////////////////////
+// Name: createMediaPlayer
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef CONFIG_NXWM_MEDIAPLAYER
+static bool createMediaPlayer(void)
+{
+ // Add the hex calculator application to the start window
+
+ printf("createHexCalculator: Creating the hex calculator application\n");
+ NxWM::CMediaPlayerFactory *calculator = new NxWM::CMediaPlayerFactory(g_nxwmtest.taskbar);
+ if (!calculator)
+ {
+ printf("createMediaPlayer: ERROR: Failed to instantiate CMediaPlayerFactory\n");
+ return false;
+ }
+ showTestCaseMemory("createMediaPlayer: After creating the media player application");
+
+ printf("createMediaPlayer: Adding the hex calculator application to the start window\n");
+ if (!g_nxwmtest.startwindow->addApplication(calculator))
+ {
+ printf("createMediaPlayer: ERROR: Failed to add CNxConsoleFactory to the start window\n");
+ delete calculator;
+ return false;
+ }
+
+ showTestCaseMemory("createMediaPlayer: After adding the media player application");
+ return true;
+}
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
// Public Functions
/////////////////////////////////////////////////////////////////////////////
@@ -673,6 +708,16 @@ int nxwm_main(int argc, char *argv[])
testCleanUpAndExit(EXIT_FAILURE);
}
+ // Create the media player application and add it to the start window
+
+#ifdef CONFIG_NXWM_MEDIAPLAYER
+ if (!createMediaPlayer())
+ {
+ printf("nxwm_main: ERROR: Failed to create the media player application\n");
+ testCleanUpAndExit(EXIT_FAILURE);
+ }
+#endif
+
// Call CTaskBar::startWindowManager to start the display with applications in place.
if (!startWindowManager())
diff --git a/NxWidgets/nxwm/Makefile b/NxWidgets/nxwm/Makefile
index 0bea357b2..22653a524 100644
--- a/NxWidgets/nxwm/Makefile
+++ b/NxWidgets/nxwm/Makefile
@@ -75,6 +75,10 @@ CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx
CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx
CXXSRCS += glyph_stop.cxx
+ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y)
+CXXSRCS += glyph_mediaplayer.cxx cmediaplayer.cxx
+endif
+
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
diff --git a/NxWidgets/nxwm/include/cmediaplayer.hxx b/NxWidgets/nxwm/include/cmediaplayer.hxx
new file mode 100644
index 000000000..88143617e
--- /dev/null
+++ b/NxWidgets/nxwm/include/cmediaplayer.hxx
@@ -0,0 +1,286 @@
+/****************************************************************************
+ * NxWidgets/nxwm/include/cmediaplayer.hxx
+ *
+ * Copyright (C) 2013 Ken Pettit. All rights reserved.
+ * Author: Ken Pettit <pettitkd@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
+ * me be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_CMEDIAPLAYER_HXX
+#define __INCLUDE_CMEDIAPLAYER_HXX
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <nuttx/nx/nxtk.h>
+#include <nuttx/nx/nxconsole.h>
+
+#include "cbuttonarray.hxx"
+#include "clabel.hxx"
+#include "cnxfont.hxx"
+
+#include "iapplication.hxx"
+#include "capplicationwindow.hxx"
+#include "ctaskbar.hxx"
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+#define NXWM_MEDIAPLAYER_NROWS 6
+#define NXWM_MEDIAPLAYER_NCOLUMNS 6
+
+/****************************************************************************
+ * Implementation Classes
+ ****************************************************************************/
+
+#if defined(__cplusplus)
+
+namespace NxWM
+{
+ /**
+ * This class implements the CMediaPlayer application.
+ */
+
+ class CMediaPlayer : public IApplication,
+ private IApplicationCallback,
+ private NXWidgets::CWidgetEventHandler
+ {
+ private:
+ /**
+ * The structure defines a pending operation.
+ */
+
+ struct SPendingOperation
+ {
+ int64_t value; /**< Accumulated value */
+ uint8_t operation; /**< Identifies the operations */
+ };
+
+ /**
+ * Media player state data.
+ */
+
+ /**
+ * Cached constructor parameters.
+ */
+
+ CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */
+ CApplicationWindow *m_window; /**< Reference to the application window */
+
+ /**
+ * Widgets
+ */
+
+ NXWidgets::CLabel *m_text; /**< Some text in the app for now */
+ NXWidgets::CNxFont *m_font; /**< The font used in the media player */
+
+ /**
+ * Calculator geometry. This stuff does not really have to be retained
+ * in memory. If you are pinched for memory, get rid of these.
+ */
+
+ struct nxgl_size_s m_windowSize; /**< The size of the calculator window */
+ struct nxgl_size_s m_textSize; /**< The size of the calculator textbox */
+ struct nxgl_point_s m_textPos; /**< The position of the calculator textbox */
+
+ /**
+ * Select the geometry of the media player given the current window size.
+ * Only called as part of construction.
+ */
+
+ inline void setGeometry(void);
+
+ /**
+ * Create the Media Player conrols. Only start as part of the applicaiton
+ * start method.
+ */
+
+ inline bool createPlayer(void);
+
+ /**
+ * Called when the window minimize button is pressed.
+ */
+
+ void minimize(void);
+
+ /**
+ * Called when the window minimize close is pressed.
+ */
+
+ void close(void);
+
+ /**
+ * Handle a widget action event. For CImage, this is a button pre-
+ * release event.
+ *
+ * @param e The event data.
+ */
+
+ void handleActionEvent(const NXWidgets::CWidgetEventArgs &e);
+
+ public:
+ /**
+ * CMediaPlayer constructor
+ *
+ * @param window. The application window
+ *
+ * @param taskbar. A pointer to the parent task bar instance
+ * @param window. The window to be used by this application.
+ */
+
+ CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window);
+
+ /**
+ * CMediaPlayer destructor
+ */
+
+ ~CMediaPlayer(void);
+
+ /**
+ * Each implementation of IApplication must provide a method to recover
+ * the contained CApplicationWindow instance.
+ */
+
+ IApplicationWindow *getWindow(void) const;
+
+ /**
+ * Get the icon associated with the application
+ *
+ * @return An instance if IBitmap that may be used to rend the
+ * application's icon. This is an new IBitmap instance that must
+ * be deleted by the caller when it is no long needed.
+ */
+
+ NXWidgets::IBitmap *getIcon(void);
+
+ /**
+ * Get the name string associated with the application
+ *
+ * @return A copy if CNxString that contains the name of the application.
+ */
+
+ NXWidgets::CNxString getName(void);
+
+ /**
+ * Start the application (perhaps in the minimized state).
+ *
+ * @return True if the application was successfully started.
+ */
+
+ bool run(void);
+
+ /**
+ * Stop the application.
+ */
+
+ void stop(void);
+
+ /**
+ * Destroy the application and free all of its resources. This method
+ * will initiate blocking of messages from the NX server. The server
+ * will flush the window message queue and reply with the blocked
+ * message. When the block message is received by CWindowMessenger,
+ * it will send the destroy message to the start window task which
+ * will, finally, safely delete the application.
+ */
+
+ void destroy(void);
+
+ /**
+ * The application window is hidden (either it is minimized or it is
+ * maximized, but not at the top of the hierarchy
+ */
+
+ void hide(void);
+
+ /**
+ * Redraw the entire window. The application has been maximized or
+ * otherwise moved to the top of the hierarchy. This method is call from
+ * CTaskbar when the application window must be displayed
+ */
+
+ void redraw(void);
+
+ /**
+ * Report of this is a "normal" window or a full screen window. The
+ * primary purpose of this method is so that window manager will know
+ * whether or not it show draw the task bar.
+ *
+ * @return True if this is a full screen window.
+ */
+
+ bool isFullScreen(void) const;
+ };
+
+ class CMediaPlayerFactory : public IApplicationFactory
+ {
+ private:
+ CTaskbar *m_taskbar; /**< The taskbar */
+
+ public:
+ /**
+ * CMediaPlayerFactory Constructor
+ *
+ * @param taskbar. The taskbar instance used to terminate calibration
+ */
+
+ CMediaPlayerFactory(CTaskbar *taskbar);
+
+ /**
+ * CMediaPlayerFactory Destructor
+ */
+
+ inline ~CMediaPlayerFactory(void) { }
+
+ /**
+ * Create a new instance of an CMediaPlayer (as IApplication).
+ */
+
+ IApplication *create(void);
+
+ /**
+ * Get the icon associated with the application
+ *
+ * @return An instance if IBitmap that may be used to rend the
+ * application's icon. This is an new IBitmap instance that must
+ * be deleted by the caller when it is no long needed.
+ */
+
+ NXWidgets::IBitmap *getIcon(void);
+ };
+}
+#endif // __cplusplus
+
+#endif // __INCLUDE_CMEDIAPLAYER_HXX
diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx
index 0c43125bb..d57b58b59 100644
--- a/NxWidgets/nxwm/include/nxwmconfig.hxx
+++ b/NxWidgets/nxwm/include/nxwmconfig.hxx
@@ -533,6 +533,29 @@
# define CONFIG_NXWM_HEXCALCULATOR_FONTID CONFIG_NXWM_DEFAULT_FONTID
#endif
+/* Media Player application ***********************************************/
+/**
+ *
+ * CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR - The background color of the
+ * calculator display. Default: Same as CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR
+ * CONFIG_NXWM_HEXCALCULATOR_ICON - The ICON to use for the hex calculator
+ * application. Default: NxWM::g_calculatorBitmap
+ * CONFIG_NXWM_HEXCALCULATOR_FONTID - The font used with the calculator.
+ * Default: CONFIG_NXWM_DEFAULT_FONTID
+ */
+
+#ifndef CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR
+# define CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR
+#endif
+
+#ifndef CONFIG_NXWM_MEDIAPLAYER_ICON
+# define CONFIG_NXWM_MEDIAPLAYER_ICON NxWM::g_mediaplayerBitmap
+#endif
+
+#ifndef CONFIG_NXWM_MEDIAPLAYER_FONTID
+# define CONFIG_NXWM_MEDIAPLAYER_FONTID CONFIG_NXWM_DEFAULT_FONTID
+#endif
+
/****************************************************************************
* Global Function Prototypes
****************************************************************************/
diff --git a/NxWidgets/nxwm/include/nxwmglyphs.hxx b/NxWidgets/nxwm/include/nxwmglyphs.hxx
index 7db02fd17..74b527611 100644
--- a/NxWidgets/nxwm/include/nxwmglyphs.hxx
+++ b/NxWidgets/nxwm/include/nxwmglyphs.hxx
@@ -60,6 +60,7 @@ namespace NxWM
extern const struct NXWidgets::SRlePaletteBitmap g_calculatorBitmap;
extern const struct NXWidgets::SRlePaletteBitmap g_calibrationBitmap;
extern const struct NXWidgets::SRlePaletteBitmap g_cmdBitmap;
+ extern const struct NXWidgets::SRlePaletteBitmap g_mediaplayerBitmap;
extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap;
extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap;
extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap;
diff --git a/NxWidgets/nxwm/src/cmediaplayer.cxx b/NxWidgets/nxwm/src/cmediaplayer.cxx
new file mode 100644
index 000000000..ffe237fc1
--- /dev/null
+++ b/NxWidgets/nxwm/src/cmediaplayer.cxx
@@ -0,0 +1,454 @@
+/********************************************************************************************
+ * NxWidgets/nxwm/src/cmediaplayer.cxx
+ *
+ * Copyright (C) 2013 Ken Pettit. All rights reserved.
+ * Author: Ken Pettit <pettitkd@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
+ * me be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ********************************************************************************************/
+
+/********************************************************************************************
+ * Included Files
+ ********************************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <cstdio>
+#include <debug.h>
+
+#include "cwidgetcontrol.hxx"
+
+#include "nxwmconfig.hxx"
+#include "nxwmglyphs.hxx"
+#include "cmediaplayer.hxx"
+
+/********************************************************************************************
+ * Pre-Processor Definitions
+ ********************************************************************************************/
+
+/********************************************************************************************
+ * Private Types
+ ********************************************************************************************/
+
+/********************************************************************************************
+ * Private Data
+ ********************************************************************************************/
+
+/********************************************************************************************
+ * Private Functions
+ ********************************************************************************************/
+
+/********************************************************************************************
+ * CMediaPlayer Method Implementations
+ ********************************************************************************************/
+
+extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_MEDIAPLAYER_ICON;
+
+using namespace NxWM;
+
+/**
+ * CMediaPlayer constructor
+ *
+ * @param window. The application window
+ */
+
+CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window)
+{
+ // Save the constructor data
+
+ m_taskbar = taskbar;
+ m_window = window;
+
+ // Nullify widgets that will be instantiated when the window is started
+
+ m_text = (NXWidgets::CLabel *)0;
+ m_font = (NXWidgets::CNxFont *)0;
+
+ // Add our personalized window label
+
+ NXWidgets::CNxString myName = getName();
+ window->setWindowLabel(myName);
+
+ // Add our callbacks with the application window
+
+ window->registerCallbacks(static_cast<IApplicationCallback *>(this));
+
+ // Set the geometry of the media player
+
+ setGeometry();
+}
+
+/**
+ * CMediaPlayer destructor
+ *
+ * @param window. The application window
+ */
+
+CMediaPlayer::~CMediaPlayer(void)
+{
+ // Destroy widgets
+
+ if (m_text)
+ {
+ delete m_text;
+ }
+
+ if (m_font)
+ {
+ delete m_font;
+ }
+
+ // Although we didn't create it, we are responsible for deleting the
+ // application window
+
+ delete m_window;
+}
+
+/**
+ * Each implementation of IApplication must provide a method to recover
+ * the contained CApplicationWindow instance.
+ */
+
+IApplicationWindow *CMediaPlayer::getWindow(void) const
+{
+ return static_cast<IApplicationWindow*>(m_window);
+}
+
+/**
+ * Get the icon associated with the application
+ *
+ * @return An instance if IBitmap that may be used to rend the
+ * application's icon. This is an new IBitmap instance that must
+ * be deleted by the caller when it is no long needed.
+ */
+
+NXWidgets::IBitmap *CMediaPlayer::getIcon(void)
+{
+ NXWidgets::CRlePaletteBitmap *bitmap =
+ new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MEDIAPLAYER_ICON);
+
+ return bitmap;
+}
+
+/**
+ * Get the name string associated with the application
+ *
+ * @return A copy if CNxString that contains the name of the application.
+ */
+
+NXWidgets::CNxString CMediaPlayer::getName(void)
+{
+ return NXWidgets::CNxString("Media Player");
+}
+
+/**
+ * Start the application (perhaps in the minimized state).
+ *
+ * @return True if the application was successfully started.
+ */
+
+bool CMediaPlayer::run(void)
+{
+ // Create the widgets (if we have not already done so)
+
+ if (!m_text)
+ {
+ // Create the widgets
+
+ if (!createPlayer())
+ {
+ gdbg("ERROR: Failed to create widgets\n");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Stop the application.
+ */
+
+void CMediaPlayer::stop(void)
+{
+ // Just disable further drawing
+
+ m_text->disableDrawing();
+}
+
+/**
+ * Destroy the application and free all of its resources. This method
+ * will initiate blocking of messages from the NX server. The server
+ * will flush the window message queue and reply with the blocked
+ * message. When the block message is received by CWindowMessenger,
+ * it will send the destroy message to the start window task which
+ * will, finally, safely delete the application.
+ */
+
+void CMediaPlayer::destroy(void)
+{
+ // Make sure that the widgets are stopped
+
+ stop();
+
+ // Block any further window messages
+
+ m_window->block(this);
+}
+
+/**
+ * The application window is hidden (either it is minimized or it is
+ * maximized, but not at the top of the hierarchy
+ */
+
+void CMediaPlayer::hide(void)
+{
+ // Disable drawing and events
+
+ stop();
+}
+
+/**
+ * Redraw the entire window. The application has been maximized or
+ * otherwise moved to the top of the hierarchy. This method is call from
+ * CTaskbar when the application window must be displayed
+ */
+
+void CMediaPlayer::redraw(void)
+{
+ char buffer[24];
+
+ snprintf(buffer, 24, "Comming soon!");
+
+ // setText will perform the redraw as well
+
+ m_text->setText(buffer);
+
+ // Get the widget control associated with the application window
+
+ NXWidgets::CWidgetControl *control = m_window->getWidgetControl();
+
+ // Get the CCGraphicsPort instance for this window
+
+ NXWidgets::CGraphicsPort *port = control->getGraphicsPort();
+
+ // Fill the entire window with the background color
+
+ port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h,
+ CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR);
+
+ // Enable and redraw widgets
+
+ m_text->enableDrawing();
+ m_text->redraw();
+}
+
+/**
+ * Report of this is a "normal" window or a full screen window. The
+ * primary purpose of this method is so that window manager will know
+ * whether or not it show draw the task bar.
+ *
+ * @return True if this is a full screen window.
+ */
+
+bool CMediaPlayer::isFullScreen(void) const
+{
+ return m_window->isFullScreen();
+}
+
+/**
+ * Select the geometry of the calculator given the current window size.
+ */
+
+void CMediaPlayer::setGeometry(void)
+{
+ // Recover the NXTK window instance contained in the application window
+
+ NXWidgets::INxWindow *window = m_window->getWindow();
+
+ // Get the size of the window
+
+ (void)window->getSize(&m_windowSize);
+
+ // Get the size of the text box. Same width as the m_keypad
+
+ m_textSize.w = m_windowSize.w - 10;
+ m_textSize.h = 36;
+
+ // Now position the text box
+
+ m_textPos.x = 5;
+ m_textPos.y = 5;
+}
+
+/**
+ * Create the calculator widgets. Only start as part of the applicaiton
+ * start method.
+ */
+
+bool CMediaPlayer::createPlayer(void)
+{
+ // Select a font for the calculator
+
+ m_font = new NXWidgets::CNxFont((nx_fontid_e)CONFIG_NXWM_MEDIAPLAYER_FONTID,
+ CONFIG_NXWM_DEFAULT_FONTCOLOR,
+ CONFIG_NXWM_TRANSPARENT_COLOR);
+ if (!m_font)
+ {
+ gdbg("ERROR failed to create font\n");
+ return false;
+ }
+
+ // Get the widget control associated with the application window
+
+ NXWidgets::CWidgetControl *control = m_window->getWidgetControl();
+
+ // Create a label to show some text. A simple label is used
+ // because the power of a text box is un-necessary in this application.
+
+ m_text = new NXWidgets::CLabel(control,
+ m_textPos.x, m_textPos.y,
+ m_textSize.w, m_textSize.h,
+ "0");
+ if (!m_text)
+ {
+ gdbg("ERROR: Failed to create CLabel\n");
+ return false;
+ }
+
+ // Align text on the left
+
+ m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_RIGHT);
+
+ // Disable drawing and events until we are asked to redraw the window
+
+ m_text->disableDrawing();
+ m_text->setRaisesEvents(false);
+
+ // Select the font
+
+ m_text->setFont(m_font);
+ return true;
+}
+
+/**
+ * Called when the window minimize button is pressed.
+ */
+
+void CMediaPlayer::minimize(void)
+{
+ m_taskbar->minimizeApplication(static_cast<IApplication*>(this));
+}
+
+/**
+ * Called when the window close button is pressed.
+ */
+
+void CMediaPlayer::close(void)
+{
+ m_taskbar->stopApplication(static_cast<IApplication*>(this));
+}
+
+/**
+ * Handle a widget action event. For CButtonArray, this is a button pre-
+ * release event.
+ *
+ * @param e The event data.
+ */
+
+void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e)
+{
+ /* Nothing here yet! Comming soon! */
+}
+
+/**
+ * CMediaPlayerFactory Constructor
+ *
+ * @param taskbar. The taskbar instance used to terminate the console
+ */
+
+CMediaPlayerFactory::CMediaPlayerFactory(CTaskbar *taskbar)
+{
+ m_taskbar = taskbar;
+}
+
+/**
+ * Create a new instance of an CMediaPlayer (as IApplication).
+ */
+
+IApplication *CMediaPlayerFactory::create(void)
+{
+ // Call CTaskBar::openFullScreenWindow to create a application window for
+ // the NxConsole application
+
+ CApplicationWindow *window = m_taskbar->openApplicationWindow();
+ if (!window)
+ {
+ gdbg("ERROR: Failed to create CApplicationWindow\n");
+ return (IApplication *)0;
+ }
+
+ // Open the window (it is hot in here)
+
+ if (!window->open())
+ {
+ gdbg("ERROR: Failed to open CApplicationWindow\n");
+ delete window;
+ return (IApplication *)0;
+ }
+
+ // Instantiate the application, providing the window to the application's
+ // constructor
+
+ CMediaPlayer *mediaPlayer = new CMediaPlayer(m_taskbar, window);
+ if (!mediaPlayer)
+ {
+ gdbg("ERROR: Failed to instantiate CMediaPlayer\n");
+ delete window;
+ return (IApplication *)0;
+ }
+
+ return static_cast<IApplication*>(mediaPlayer);
+}
+
+/**
+ * Get the icon associated with the application
+ *
+ * @return An instance if IBitmap that may be used to rend the
+ * application's icon. This is an new IBitmap instance that must
+ * be deleted by the caller when it is no long needed.
+ */
+
+NXWidgets::IBitmap *CMediaPlayerFactory::getIcon(void)
+{
+ NXWidgets::CRlePaletteBitmap *bitmap =
+ new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MEDIAPLAYER_ICON);
+
+ return bitmap;
+}
diff --git a/NxWidgets/nxwm/src/glyph_mediaplayer.cxx b/NxWidgets/nxwm/src/glyph_mediaplayer.cxx
new file mode 100644
index 000000000..e258c2065
--- /dev/null
+++ b/NxWidgets/nxwm/src/glyph_mediaplayer.cxx
@@ -0,0 +1,305 @@
+/********************************************************************************************
+ * NxWidgets/nxwm/src/glyph_mediaplayer.cxx
+ *
+ * Copyright (C) 2013 Ken Pettit. All rights reserved.
+ * Author: Ken Pettit <pettitkd@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
+ * me be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ********************************************************************************************/
+
+/********************************************************************************************
+ * Included Files
+ ********************************************************************************************/
+
+/* Automatically NuttX bitmap file. */
+/* Generated from play_music.png by bitmap_converter.py. */
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <nuttx/nx/nxglib.h>
+#include <nuttx/fb.h>
+#include <nuttx/rgbcolors.h>
+
+#include "crlepalettebitmap.hxx"
+
+#include "nxwmconfig.hxx"
+#include "nxwmglyphs.hxx"
+
+
+/********************************************************************************************
+ * Pre-Processor Definitions
+ ********************************************************************************************/
+
+#define BITMAP_WIDTH 24
+#define BITMAP_HEIGHT 24
+#define BITMAP_PALETTESIZE 255
+
+using namespace NxWM;
+
+/* RGB24 (8-8-8) Colors */
+
+static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] =
+{
+ MKRGB( 0, 0, 0), MKRGB(255,255,255), MKRGB(116,187,231), MKRGB(120,200,242),
+ MKRGB(114,186,226), MKRGB(111,182,229), MKRGB(106,181,227), MKRGB( 93,176,231),
+ MKRGB( 46,106,167), MKRGB( 27,106,185), MKRGB(123,203,244), MKRGB(122,203,244),
+ MKRGB(119,191,228), MKRGB( 6, 74,154), MKRGB(144,206,241), MKRGB(124,205,245),
+ MKRGB(143,204,235), MKRGB(121,202,243), MKRGB(134,198,239), MKRGB(135,197,233),
+ MKRGB(131,193,235), MKRGB(125,191,229), MKRGB(124,191,231), MKRGB(119,191,229),
+ MKRGB(122,189,231), MKRGB(114,189,225), MKRGB(116,188,227), MKRGB(113,184,229),
+ MKRGB(105,182,231), MKRGB( 98,181,233), MKRGB(100,180,231), MKRGB(113,176,219),
+ MKRGB( 91,175,231), MKRGB(102,174,217), MKRGB( 88,173,229), MKRGB( 85,172,229),
+ MKRGB( 83,171,229), MKRGB( 74,164,225), MKRGB( 67,161,225), MKRGB( 92,154,203),
+ MKRGB( 62,153,221), MKRGB( 58,152,219), MKRGB( 56,148,217), MKRGB( 58,146,215),
+ MKRGB( 54,139,207), MKRGB( 54,137,207), MKRGB( 52,135,203), MKRGB( 50,128,199),
+ MKRGB( 59,127,187), MKRGB( 41,114,189), MKRGB( 36,110,185), MKRGB( 37,101,169),
+ MKRGB( 29, 95,169), MKRGB( 32, 93,167), MKRGB( 30, 89,161), MKRGB( 21, 78,153),
+ MKRGB( 19, 77,151), MKRGB( 14, 70,145), MKRGB(130,209,246), MKRGB(130,208,246),
+ MKRGB(119,200,244), MKRGB(146,199,234), MKRGB(117,198,242), MKRGB(129,197,236),
+ MKRGB(107,192,238), MKRGB(123,191,232), MKRGB(102,189,234), MKRGB(117,187,230),
+ MKRGB(110,183,230), MKRGB(100,183,234), MKRGB(119,182,222), MKRGB(109,181,222),
+ MKRGB(103,180,226), MKRGB( 95,179,230), MKRGB(107,177,220), MKRGB( 95,176,230),
+ MKRGB( 79,170,226), MKRGB( 77,167,224), MKRGB( 79,162,220), MKRGB( 86,158,206),
+ MKRGB( 64,155,220), MKRGB( 59,154,220), MKRGB( 60,150,218), MKRGB( 84,147,200),
+ MKRGB( 55,141,210), MKRGB( 58,140,206), MKRGB( 49,127,198), MKRGB( 45,122,192),
+ MKRGB( 33,118,192), MKRGB( 25,104,184), MKRGB( 38,103,172), MKRGB( 28, 94,168),
+ MKRGB( 30, 93,168), MKRGB( 28, 90,162), MKRGB( 26, 87,160), MKRGB( 25, 85,160),
+ MKRGB( 25, 84,158), MKRGB( 20, 78,150), MKRGB( 19, 78,150), MKRGB( 18, 74,148),
+ MKRGB( 15, 71,146), MKRGB( 13, 69,144), MKRGB( 11, 67,142), MKRGB(254,255,255),
+ MKRGB(242,250,253), MKRGB(239,246,249), MKRGB(238,244,247), MKRGB(100,177,227),
+ MKRGB(222,231,241), MKRGB(220,230,241), MKRGB(213,227,237), MKRGB(171,216,243),
+ MKRGB(134,214,251), MKRGB(163,212,241), MKRGB(162,211,241), MKRGB(130,211,249),
+ MKRGB(128,210,249), MKRGB(128,208,247), MKRGB(125,208,247), MKRGB(123,205,247),
+ MKRGB(123,204,245), MKRGB(122,204,247), MKRGB(179,202,225), MKRGB(123,201,243),
+ MKRGB(119,201,245), MKRGB(119,200,243), MKRGB(116,200,241), MKRGB(172,197,223),
+ MKRGB(122,197,233), MKRGB(115,197,243), MKRGB(135,195,233), MKRGB(114,195,241),
+ MKRGB(108,195,241), MKRGB(122,194,237), MKRGB(110,194,237), MKRGB(126,193,231),
+ MKRGB(122,193,233), MKRGB(118,192,227), MKRGB(110,192,241), MKRGB(109,191,239),
+ MKRGB(104,189,239), MKRGB(118,188,229), MKRGB(102,188,235), MKRGB(149,186,219),
+ MKRGB(121,186,225), MKRGB( 99,184,237), MKRGB(143,183,217), MKRGB(106,183,231),
+ MKRGB(140,182,217), MKRGB(112,182,229), MKRGB(103,182,225), MKRGB( 95,182,235),
+ MKRGB(116,181,221), MKRGB( 94,181,235), MKRGB( 92,178,229), MKRGB(100,177,225),
+ MKRGB( 91,176,231), MKRGB( 84,175,231), MKRGB( 83,175,233), MKRGB( 97,174,225),
+ MKRGB( 92,174,227), MKRGB( 89,174,229), MKRGB( 89,173,227), MKRGB( 85,173,231),
+ MKRGB(100,171,221), MKRGB( 87,171,227), MKRGB( 86,171,221), MKRGB( 95,170,219),
+ MKRGB( 87,169,223), MKRGB( 86,169,223), MKRGB(101,168,213), MKRGB( 78,168,225),
+ MKRGB( 81,167,225), MKRGB( 79,167,227), MKRGB( 75,167,219), MKRGB( 75,166,223),
+ MKRGB( 82,165,223), MKRGB( 69,165,225), MKRGB( 90,164,217), MKRGB( 73,164,225),
+ MKRGB( 90,163,217), MKRGB( 75,163,223), MKRGB( 70,163,223), MKRGB( 75,162,221),
+ MKRGB( 68,161,221), MKRGB( 73,160,217), MKRGB( 72,159,219), MKRGB(114,158,201),
+ MKRGB( 90,157,209), MKRGB( 75,156,213), MKRGB( 69,156,217), MKRGB( 68,156,217),
+ MKRGB( 73,153,209), MKRGB( 63,153,217), MKRGB( 77,152,207), MKRGB( 81,149,205),
+ MKRGB(100,144,193), MKRGB( 65,142,205), MKRGB( 73,160,221), MKRGB( 68,133,191),
+ MKRGB( 61,126,185), MKRGB( 66,123,179), MKRGB( 38,117,191), MKRGB( 37,117,191),
+ MKRGB( 39,116,187), MKRGB( 30,116,191), MKRGB( 43,114,187), MKRGB( 31,114,189),
+ MKRGB( 29,112,187), MKRGB( 49,111,177), MKRGB( 49,110,177), MKRGB( 38,108,179),
+ MKRGB( 25,107,183), MKRGB( 29,106,185), MKRGB( 45,105,167), MKRGB( 26,105,185),
+ MKRGB( 24,103,183), MKRGB( 42,102,165), MKRGB( 22,102,183), MKRGB( 36,100,169),
+ MKRGB( 36, 99,169), MKRGB( 14, 85,165), MKRGB( 22, 80,153), MKRGB( 21, 80,153),
+ MKRGB( 2, 72,153), MKRGB(252,253,254), MKRGB(247,249,250), MKRGB(245,248,252),
+ MKRGB(237,244,248), MKRGB(215,228,240), MKRGB(213,227,238), MKRGB(123,204,246),
+ MKRGB(122,204,246), MKRGB(140,203,238), MKRGB(121,201,242), MKRGB(119,201,246),
+ MKRGB(121,200,242), MKRGB(170,198,224), MKRGB(171,197,222), MKRGB(114,196,242),
+ MKRGB(147,194,228), MKRGB(119,194,230), MKRGB(120,191,228), MKRGB(114,191,236),
+ MKRGB(119,190,234), MKRGB(118,190,228), MKRGB(119,189,228), MKRGB(118,189,228),
+ MKRGB(115,189,234), MKRGB(109,187,232), MKRGB(106,187,236), MKRGB(103,187,236),
+ MKRGB(146,186,218), MKRGB(117,185,230), MKRGB( 95,185,236),
+};
+
+static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] =
+{
+ MKRGB( 50, 50, 50), MKRGB(255,255,255), MKRGB(166,237,255), MKRGB(170,250,255),
+ MKRGB(164,236,255), MKRGB(161,232,255), MKRGB(156,231,255), MKRGB(143,226,255),
+ MKRGB( 96,156,217), MKRGB( 77,156,235), MKRGB(173,253,255), MKRGB(172,253,255),
+ MKRGB(169,241,255), MKRGB( 56,124,204), MKRGB(194,255,255), MKRGB(174,255,255),
+ MKRGB(193,254,255), MKRGB(171,252,255), MKRGB(184,248,255), MKRGB(185,247,255),
+ MKRGB(181,243,255), MKRGB(175,241,255), MKRGB(174,241,255), MKRGB(169,241,255),
+ MKRGB(172,239,255), MKRGB(164,239,255), MKRGB(166,238,255), MKRGB(163,234,255),
+ MKRGB(155,232,255), MKRGB(148,231,255), MKRGB(150,230,255), MKRGB(163,226,255),
+ MKRGB(141,225,255), MKRGB(152,224,255), MKRGB(138,223,255), MKRGB(135,222,255),
+ MKRGB(133,221,255), MKRGB(124,214,255), MKRGB(117,211,255), MKRGB(142,204,253),
+ MKRGB(112,203,255), MKRGB(108,202,255), MKRGB(106,198,255), MKRGB(108,196,255),
+ MKRGB(104,189,255), MKRGB(104,187,255), MKRGB(102,185,253), MKRGB(100,178,249),
+ MKRGB(109,177,237), MKRGB( 91,164,239), MKRGB( 86,160,235), MKRGB( 87,151,219),
+ MKRGB( 79,145,219), MKRGB( 82,143,217), MKRGB( 80,139,211), MKRGB( 71,128,203),
+ MKRGB( 69,127,201), MKRGB( 64,120,195), MKRGB(180,255,255), MKRGB(180,255,255),
+ MKRGB(169,250,255), MKRGB(196,249,255), MKRGB(167,248,255), MKRGB(179,247,255),
+ MKRGB(157,242,255), MKRGB(173,241,255), MKRGB(152,239,255), MKRGB(167,237,255),
+ MKRGB(160,233,255), MKRGB(150,233,255), MKRGB(169,232,255), MKRGB(159,231,255),
+ MKRGB(153,230,255), MKRGB(145,229,255), MKRGB(157,227,255), MKRGB(145,226,255),
+ MKRGB(129,220,255), MKRGB(127,217,255), MKRGB(129,212,255), MKRGB(136,208,255),
+ MKRGB(114,205,255), MKRGB(109,204,255), MKRGB(110,200,255), MKRGB(134,197,250),
+ MKRGB(105,191,255), MKRGB(108,190,255), MKRGB( 99,177,248), MKRGB( 95,172,242),
+ MKRGB( 83,168,242), MKRGB( 75,154,234), MKRGB( 88,153,222), MKRGB( 78,144,218),
+ MKRGB( 80,143,218), MKRGB( 78,140,212), MKRGB( 76,137,210), MKRGB( 75,135,210),
+ MKRGB( 75,134,208), MKRGB( 70,128,200), MKRGB( 69,128,200), MKRGB( 68,124,198),
+ MKRGB( 65,121,196), MKRGB( 63,119,194), MKRGB( 61,117,192), MKRGB(255,255,255),
+ MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(150,227,255),
+ MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(221,255,255),
+ MKRGB(184,255,255), MKRGB(213,255,255), MKRGB(212,255,255), MKRGB(180,255,255),
+ MKRGB(178,255,255), MKRGB(178,255,255), MKRGB(175,255,255), MKRGB(173,255,255),
+ MKRGB(173,254,255), MKRGB(172,254,255), MKRGB(229,252,255), MKRGB(173,251,255),
+ MKRGB(169,251,255), MKRGB(169,250,255), MKRGB(166,250,255), MKRGB(222,247,255),
+ MKRGB(172,247,255), MKRGB(165,247,255), MKRGB(185,245,255), MKRGB(164,245,255),
+ MKRGB(158,245,255), MKRGB(172,244,255), MKRGB(160,244,255), MKRGB(176,243,255),
+ MKRGB(172,243,255), MKRGB(168,242,255), MKRGB(160,242,255), MKRGB(159,241,255),
+ MKRGB(154,239,255), MKRGB(168,238,255), MKRGB(152,238,255), MKRGB(199,236,255),
+ MKRGB(171,236,255), MKRGB(149,234,255), MKRGB(193,233,255), MKRGB(156,233,255),
+ MKRGB(190,232,255), MKRGB(162,232,255), MKRGB(153,232,255), MKRGB(145,232,255),
+ MKRGB(166,231,255), MKRGB(144,231,255), MKRGB(142,228,255), MKRGB(150,227,255),
+ MKRGB(141,226,255), MKRGB(134,225,255), MKRGB(133,225,255), MKRGB(147,224,255),
+ MKRGB(142,224,255), MKRGB(139,224,255), MKRGB(139,223,255), MKRGB(135,223,255),
+ MKRGB(150,221,255), MKRGB(137,221,255), MKRGB(136,221,255), MKRGB(145,220,255),
+ MKRGB(137,219,255), MKRGB(136,219,255), MKRGB(151,218,255), MKRGB(128,218,255),
+ MKRGB(131,217,255), MKRGB(129,217,255), MKRGB(125,217,255), MKRGB(125,216,255),
+ MKRGB(132,215,255), MKRGB(119,215,255), MKRGB(140,214,255), MKRGB(123,214,255),
+ MKRGB(140,213,255), MKRGB(125,213,255), MKRGB(120,213,255), MKRGB(125,212,255),
+ MKRGB(118,211,255), MKRGB(123,210,255), MKRGB(122,209,255), MKRGB(164,208,251),
+ MKRGB(140,207,255), MKRGB(125,206,255), MKRGB(119,206,255), MKRGB(118,206,255),
+ MKRGB(123,203,255), MKRGB(113,203,255), MKRGB(127,202,255), MKRGB(131,199,255),
+ MKRGB(150,194,243), MKRGB(115,192,255), MKRGB(123,210,255), MKRGB(118,183,241),
+ MKRGB(111,176,235), MKRGB(116,173,229), MKRGB( 88,167,241), MKRGB( 87,167,241),
+ MKRGB( 89,166,237), MKRGB( 80,166,241), MKRGB( 93,164,237), MKRGB( 81,164,239),
+ MKRGB( 79,162,237), MKRGB( 99,161,227), MKRGB( 99,160,227), MKRGB( 88,158,229),
+ MKRGB( 75,157,233), MKRGB( 79,156,235), MKRGB( 95,155,217), MKRGB( 76,155,235),
+ MKRGB( 74,153,233), MKRGB( 92,152,215), MKRGB( 72,152,233), MKRGB( 86,150,219),
+ MKRGB( 86,149,219), MKRGB( 64,135,215), MKRGB( 72,130,203), MKRGB( 71,130,203),
+ MKRGB( 52,122,203), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255),
+ MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(173,254,255),
+ MKRGB(172,254,255), MKRGB(190,253,255), MKRGB(171,251,255), MKRGB(169,251,255),
+ MKRGB(171,250,255), MKRGB(220,248,255), MKRGB(221,247,255), MKRGB(164,246,255),
+ MKRGB(197,244,255), MKRGB(169,244,255), MKRGB(170,241,255), MKRGB(164,241,255),
+ MKRGB(169,240,255), MKRGB(168,240,255), MKRGB(169,239,255), MKRGB(168,239,255),
+ MKRGB(165,239,255), MKRGB(159,237,255), MKRGB(156,237,255), MKRGB(153,237,255),
+ MKRGB(196,236,255), MKRGB(167,235,255), MKRGB(145,235,255),
+};
+
+static const NXWidgets::SRlePaletteBitmapEntry bitmap[] =
+{
+ { 7, 0}, { 1, 99}, { 1, 100}, { 1, 101}, { 1, 102}, { 2, 98},
+ { 1, 102}, { 1, 101}, { 1, 100}, { 1, 99}, { 7, 0}, /* Row 0 */
+ { 5, 0}, { 1, 56}, { 1, 57}, { 1, 93}, { 1, 48}, { 1, 79},
+ { 1, 33}, { 2, 71}, { 1, 33}, { 1, 79}, { 1, 48}, { 1, 93},
+ { 1, 57}, { 1, 56}, { 5, 0}, /* Row 1 */
+ { 4, 0}, { 1, 97}, { 1, 223}, { 1, 83}, { 1, 74}, { 1, 25},
+ { 1, 26}, { 4, 4}, { 1, 26}, { 1, 25}, { 1, 74}, { 1, 83},
+ { 1, 222}, { 1, 97}, { 4, 0}, /* Row 2 */
+ { 3, 0}, { 1, 55}, { 1, 220}, { 1, 170}, { 1, 137}, { 1, 245},
+ { 1, 247}, { 2, 12}, { 1, 242}, { 1, 12}, { 2, 23}, { 1, 241},
+ { 1, 128}, { 1, 74}, { 1, 170}, { 1, 219}, { 1, 55}, { 3, 0}, /* Row 3 */
+ { 2, 0}, { 1, 96}, { 1, 51}, { 1, 152}, { 1, 135}, { 1, 21},
+ { 1, 246}, { 1, 150}, { 1, 166}, { 2, 174}, { 1, 185}, { 1, 192},
+ { 1, 195}, { 1, 199}, { 1, 209}, { 1, 196}, { 1, 201}, { 1, 144},
+ { 1, 51}, { 1, 96}, { 2, 0}, /* Row 4 */
+ { 1, 0}, { 1, 54}, { 1, 94}, { 1, 31}, { 1, 130}, { 1, 21},
+ { 1, 155}, { 1, 78}, { 1, 176}, { 1, 180}, { 1, 79}, { 1, 83},
+ { 1, 39}, { 1, 148}, { 1, 237}, { 1, 108}, { 2, 1}, { 1, 8},
+ { 1, 233}, { 1, 31}, { 1, 94}, { 1, 54}, { 1, 0}, /* Row 5 */
+ { 1, 0}, { 1, 95}, { 1, 39}, { 1, 16}, { 1, 141}, { 2, 168},
+ { 1, 160}, { 1, 167}, { 1, 199}, { 1, 238}, { 7, 1}, { 1, 214},
+ { 1, 136}, { 1, 16}, { 1, 39}, { 1, 95}, { 1, 0}, /* Row 6 */
+ { 1, 53}, { 1, 90}, { 1, 61}, { 1, 27}, { 1, 159}, { 3, 107},
+ { 1, 178}, { 1, 225}, { 2, 1}, { 1, 228}, { 1, 229}, { 1, 127},
+ { 1, 187}, { 1, 209}, { 1, 1}, { 1, 8}, { 1, 30}, { 1, 27},
+ { 1, 61}, { 1, 90}, { 1, 53}, /* Row 7 */
+ { 1, 92}, { 1, 83}, { 1, 19}, { 1, 72}, { 4, 6}, { 1, 178},
+ { 1, 227}, { 1, 106}, { 1, 122}, { 1, 212}, { 1, 50}, { 1, 188},
+ { 1, 164}, { 1, 200}, { 1, 1}, { 1, 8}, { 1, 249}, { 1, 72},
+ { 1, 19}, { 1, 83}, { 1, 92}, /* Row 8 */
+ { 1, 52}, { 1, 70}, { 1, 68}, { 2, 5}, { 1, 149}, { 1, 27},
+ { 1, 253}, { 1, 78}, { 1, 1}, { 1, 194}, { 1, 213}, { 1, 76},
+ { 1, 172}, { 1, 165}, { 1, 147}, { 1, 199}, { 1, 1}, { 1, 8},
+ { 1, 248}, { 1, 5}, { 1, 68}, { 1, 70}, { 1, 52}, /* Row 9 */
+ { 1, 91}, { 1, 65}, { 2, 2}, { 2, 67}, { 1, 160}, { 1, 182},
+ { 1, 205}, { 1, 1}, { 1, 89}, { 1, 193}, { 1, 182}, { 2, 184},
+ { 1, 177}, { 1, 221}, { 1, 1}, { 1, 217}, { 1, 133}, { 2, 2},
+ { 1, 65}, { 1, 91}, /* Row 10 */
+ { 1, 211}, { 1, 63}, { 1, 24}, { 1, 22}, { 1, 68}, { 1, 179},
+ { 1, 175}, { 1, 76}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 191},
+ { 1, 171}, { 2, 77}, { 1, 36}, { 1, 221}, { 1, 1}, { 1, 224},
+ { 1, 243}, { 1, 22}, { 1, 24}, { 1, 63}, { 1, 211}, /* Row 11 */
+ { 1, 206}, { 1, 18}, { 1, 20}, { 1, 75}, { 1, 173}, { 2, 36},
+ { 1, 163}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 186}, { 2, 36},
+ { 2, 157}, { 1, 13}, { 1, 1}, { 1, 13}, { 1, 158}, { 1, 75},
+ { 1, 20}, { 1, 18}, { 1, 206}, /* Row 12 */
+ { 1, 50}, { 1, 14}, { 1, 30}, { 1, 35}, { 2, 34}, { 1, 161},
+ { 1, 73}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 78}, { 1, 156},
+ { 1, 34}, { 1, 204}, { 1, 224}, { 1, 148}, { 1, 1}, { 1, 13},
+ { 1, 153}, { 1, 35}, { 1, 30}, { 1, 14}, { 1, 50}, /* Row 13 */
+ { 1, 49}, { 1, 28}, { 1, 32}, { 2, 7}, { 1, 75}, { 1, 7},
+ { 1, 181}, { 1, 208}, { 1, 1}, { 1, 215}, { 1, 176}, { 1, 151},
+ { 1, 221}, { 1, 146}, { 3, 1}, { 1, 13}, { 1, 145}, { 1, 7},
+ { 1, 32}, { 1, 28}, { 1, 49}, /* Row 14 */
+ { 1, 87}, { 1, 78}, { 1, 69}, { 1, 29}, { 1, 69}, { 1, 36},
+ { 1, 208}, { 1, 74}, { 1, 240}, { 1, 103}, { 1, 89}, { 1, 34},
+ { 1, 209}, { 1, 143}, { 4, 1}, { 1, 13}, { 1, 140}, { 1, 29},
+ { 1, 69}, { 1, 78}, { 1, 87}, /* Row 15 */
+ { 1, 86}, { 1, 85}, { 1, 64}, { 1, 251}, { 1, 254}, { 1, 208},
+ { 1, 104}, { 3, 1}, { 1, 216}, { 1, 156}, { 1, 210}, { 1, 252},
+ { 3, 1}, { 1, 230}, { 1, 13}, { 1, 132}, { 1, 142}, { 1, 64},
+ { 1, 85}, { 1, 86}, /* Row 16 */
+ { 1, 0}, { 1, 47}, { 1, 73}, { 1, 129}, { 1, 203}, { 1, 111},
+ { 4, 1}, { 1, 218}, { 1, 154}, { 1, 162}, { 1, 90}, { 1, 109},
+ { 1, 226}, { 1, 110}, { 1, 102}, { 1, 189}, { 1, 138}, { 1, 139},
+ { 1, 73}, { 1, 47}, { 1, 0}, /* Row 17 */
+ { 1, 0}, { 1, 46}, { 1, 44}, { 1, 235}, { 1, 202}, { 1, 244},
+ { 3, 1}, { 1, 105}, { 1, 216}, { 1, 250}, { 1, 124}, { 1, 197},
+ { 1, 52}, { 1, 221}, { 1, 90}, { 1, 169}, { 1, 60}, { 1, 131},
+ { 1, 239}, { 1, 44}, { 1, 46}, { 1, 0}, /* Row 18 */
+ { 2, 0}, { 1, 45}, { 1, 186}, { 1, 116}, { 1, 208}, { 1, 113},
+ { 1, 1}, { 1, 114}, { 1, 212}, { 1, 168}, { 1, 60}, { 1, 62},
+ { 1, 60}, { 1, 121}, { 1, 119}, { 1, 232}, { 1, 125}, { 1, 62},
+ { 1, 10}, { 1, 190}, { 1, 45}, { 2, 0}, /* Row 19 */
+ { 3, 0}, { 1, 84}, { 1, 183}, { 1, 118}, { 1, 207}, { 1, 205},
+ { 1, 207}, { 1, 231}, { 1, 10}, { 1, 234}, { 4, 3}, { 1, 236},
+ { 1, 123}, { 1, 10}, { 1, 198}, { 1, 84}, { 3, 0}, /* Row 20 */
+ { 4, 0}, { 1, 43}, { 1, 193}, { 1, 126}, { 1, 112}, { 1, 115},
+ { 1, 15}, { 4, 11}, { 1, 120}, { 1, 15}, { 1, 117}, { 1, 134},
+ { 1, 82}, { 1, 43}, { 4, 0}, /* Row 21 */
+ { 5, 0}, { 1, 82}, { 1, 42}, { 1, 37}, { 1, 66}, { 1, 17},
+ { 1, 58}, { 2, 59}, { 1, 58}, { 1, 17}, { 1, 66}, { 1, 37},
+ { 1, 42}, { 1, 82}, { 5, 0}, /* Row 22 */
+ { 7, 0}, { 1, 80}, { 1, 40}, { 1, 81}, { 1, 41}, { 2, 38},
+ { 1, 41}, { 1, 81}, { 1, 40}, { 1, 80}, { 7, 0}, /* Row 23 */
+};
+
+const struct NXWidgets::SRlePaletteBitmap NxWM::g_mediaplayerBitmap =
+{
+ CONFIG_NXWIDGETS_BPP,
+ CONFIG_NXWIDGETS_FMT,
+ BITMAP_PALETTESIZE,
+ BITMAP_WIDTH,
+ BITMAP_HEIGHT,
+ {palette, hilight_palette},
+ bitmap
+};