diff options
Diffstat (limited to 'NxWidgets/nxwm/include')
-rw-r--r-- | NxWidgets/nxwm/include/capplicationwindow.hxx | 2 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/cbackgroundimage.hxx (renamed from NxWidgets/nxwm/include/cnxbackimage.hxx) | 16 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/cnxconsole.hxx | 12 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/cstartwindow.hxx (renamed from NxWidgets/nxwm/include/cnxstart.hxx) | 44 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/ctaskbar.hxx (renamed from NxWidgets/nxwm/include/cnxtaskbar.hxx) | 84 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/iapplication.hxx (renamed from NxWidgets/nxwm/include/inxapplication.hxx) | 31 | ||||
-rw-r--r-- | NxWidgets/nxwm/include/nxwmconfig.hxx | 12 |
7 files changed, 100 insertions, 101 deletions
diff --git a/NxWidgets/nxwm/include/capplicationwindow.hxx b/NxWidgets/nxwm/include/capplicationwindow.hxx index 984f03b46..805df4184 100644 --- a/NxWidgets/nxwm/include/capplicationwindow.hxx +++ b/NxWidgets/nxwm/include/capplicationwindow.hxx @@ -55,7 +55,7 @@ ****************************************************************************/ /**************************************************************************** - * Abstract Base Classes + * Implementation Classes ****************************************************************************/ #if defined(__cplusplus) diff --git a/NxWidgets/nxwm/include/cnxbackimage.hxx b/NxWidgets/nxwm/include/cbackgroundimage.hxx index cc56e6519..89ca469cd 100644 --- a/NxWidgets/nxwm/include/cnxbackimage.hxx +++ b/NxWidgets/nxwm/include/cbackgroundimage.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NXWM_INCLUDE_CNXBACKIMAGE_HXX -#define __NXWM_INCLUDE_CNXBACKIMAGE_HXX +#ifndef __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX +#define __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX /**************************************************************************** * Included Files @@ -64,25 +64,25 @@ namespace NxWM * This class describes the NX windo manager's background image. */ - class CNxBackImage : public NXWidgets::CImage + class CBackgroundImage : public NXWidgets::CImage { private: NXWidgets::CWidgetControl *m_widgetControl; // The controlling widget for the window public: /** - * CNxBackImage Constructor + * CBackgroundImage Constructor */ - CNxBackImage(void); + CBackgroundImage(void); /** - * CNxBackImage Destructor + * CBackgroundImage Destructor */ - ~CNxBackImage(void); + ~CBackgroundImage(void); }; } #endif // __cplusplus -#endif // __NXWM_INCLUDE_CNXBACKIMAGE_HXX +#endif // __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX diff --git a/NxWidgets/nxwm/include/cnxconsole.hxx b/NxWidgets/nxwm/include/cnxconsole.hxx index 891ac8884..4009eb8b9 100644 --- a/NxWidgets/nxwm/include/cnxconsole.hxx +++ b/NxWidgets/nxwm/include/cnxconsole.hxx @@ -42,9 +42,7 @@ #include <nuttx/config.h> -#include "crlepalettebitmap.hxx" -#include "inxwindow.hxx" -#include "cnxapplication.hxx" +#include "iapplication.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -62,7 +60,7 @@ namespace NxWM * This class implements the NxConsole application. */ - class CNxConsole : public CNxApplication + class CNxConsole : public IApplication { protected: /** @@ -83,12 +81,12 @@ namespace NxWM /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @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::INxBitmap *getIcon(void); + NXWidgets::IBitmap *getIcon(void); }; } #endif // __cplusplus diff --git a/NxWidgets/nxwm/include/cnxstart.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx index fbfb9c54b..c47b85d83 100644 --- a/NxWidgets/nxwm/include/cnxstart.hxx +++ b/NxWidgets/nxwm/include/cstartwindow.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CNXSTART_NXX -#define __INCLUDE_CNXSTART_NXX +#ifndef __INCLUDE_CSTARTWINDOW_NXX +#define __INCLUDE_CSTARTWINDOW_NXX /**************************************************************************** * Included Files @@ -42,7 +42,8 @@ #include <nuttx/config.h> -#include "cnxapplication.hxx" +#include "iapplication.hxx" +#include "tnxarray.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -56,33 +57,34 @@ namespace NxWM { - class CNxTaskbar; + class CTaskbar; class CApplicationWindow; - class CNxStart : public INxApplication + class CStartWindow : public IApplication { protected: - CNxTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + TNxArray<CApplication*> m_applications; /**< List of apps in the start window */ /** - * CNxStart Constructor + * CStartWindow Constructor */ - ~CNxStart(void); + ~CStartWindow(void); public: /** - * CNxStart Constructor + * CStartWindow Constructor * * @param taskbar. A pointer to the parent task bar instance * @param window. The window to be used by this application. */ - CNxStart(CNxTaskbar *taskbar, CApplicationWindow *window); + CStartWindow(CTaskbar *taskbar, CApplicationWindow *window); /** - * Each implementation of INxApplication must provide a method to recover + * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. */ @@ -91,12 +93,12 @@ namespace NxWM /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @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::INxBitmap *getIcon(void); + NXWidgets::IBitmap *getIcon(void); /** * Get the name string associated with the application @@ -119,17 +121,23 @@ namespace NxWM stop(void); /** - * Add the application to the start window + * Add the application to the start window. The general sequence for + * setting up the start window is: + * + * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, + * 2. Call CStartMenu::addApplication numerous times to install applications + * in the start window. + * 3. Call CTaskBar::startApplication (initially minimized) to start the start + * window application. * * @param application. The new application to add to the start window * @return true on success */ - bool addApplication(INxApplication *application); - + bool addApplication(IApplication *application); }; } #endif // __cplusplus -#endif // __INCLUDE_CNXSTART_NXX +#endif // __INCLUDE_CSTARTWINDOW_NXX diff --git a/NxWidgets/nxwm/include/cnxtaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx index 3809e17ff..0c420a0e2 100644 --- a/NxWidgets/nxwm/include/cnxtaskbar.hxx +++ b/NxWidgets/nxwm/include/ctaskbar.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NXWM_INCLUDE_CNXTASKBAR_HXX -#define __NXWM_INCLUDE_CNXTASKBAR_HXX +#ifndef __NXWM_INCLUDE_CTASKBAR_HXX +#define __NXWM_INCLUDE_CTASKBAR_HXX /**************************************************************************** * Included Files @@ -43,6 +43,13 @@ #include <nuttx/config.h> #include "nxconfig.hxx" +#include "tnxarray.hxx" +#include "inxwindow.hxx" +#include "cnxserver.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgeteventargs.hxx" + +#include "iapplication.hxx" /**************************************************************************** * Pre-processor Definitions @@ -60,12 +67,12 @@ namespace NxWM * This class describes the NX window manager's task bar */ - class CNxTaskBar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler + class CTaskbar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler { private: - NXWidgets:INxWindow *m_taskbar; /**< The toolbar window */ - NXWidgets:INxWindow *m_background; /**< The background window */ - INxApplication *m_start; /**< The start window */ + NXWidgets::INxWindow *m_taskbar; /**< The toolbar window */ + NXWidgets::INxWindow *m_background; /**< The background window */ + TNxArray<IApplication*> m_applications; /**< List of apps in the task bar */ /** * Connect to the server @@ -97,7 +104,7 @@ namespace NxWM /** * Create a framed application window * - * This may be used to provide the window parater to the INxApplication constructor + * This may be used to provide the window parater to the IApplication constructor * * @return A partially initialized application window instance. */ @@ -135,66 +142,50 @@ namespace NxWM * @param e The event data. */ - void handleClickEvent(const CWidgetEventArgs &e); + void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); /** - * CNxTaskBar Destructor + * CTaskbar Destructor */ - ~CNxTaskBar(void); + ~CTaskbar(void); public: /** - * CNxTaskBar Constructor + * CTaskbar Constructor * * @param hWnd - NX server handle */ - CNxTaskBar(void); - - /** - * Add the application to the start window. The window manager start-up - * sequence is: - * - * 1. Create the CNxTaskBar instance, - * 2. Call addApplication repeatedly to add applications to the start window - * 3. Call startWindowManager to start the display - * - * @param application. The new application to add to the start window - * @return true on success - */ - - bool addApplication(INxApplication *application); + CTaskbar(void); /** * Start the window manager and present the initial displays. The window * manager start-up sequence is: * - * 1. Create the CNxTaskBar instance, - * 2. Call addApplication repeatedly to add applications to the start window - * 3. Call startWindowManager to start the display + * 1. Create the CTaskbar instance, + * 2. Call CTaskBar::startApplication repeatedly to add applications to the task bar + * 3. Call CTaskBar::startWindowManager to start the display with applications in place * * startWindowManager will present the taskar and the background image. The * initial taskbar will contain only the start window icon. - * - * @param application. The new application to add to the start window - * @return true on success */ - bool startWindowManager(start); + bool startWindowManager(void); /** - * Create an application window. Creating a new applicatino in the start + * Create an application window. Creating a new application in the start * window requires three steps: * - * 1. Call openApplicationWindow to create a window for the application, + * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's * constructor, - * 3. Then call addApplication to add the application to the start window. + * 3. Then call CStartWindow::addApplication to add the application to the + * start window. * * When the application is selected from the start window: * - * 4. Call startApplication start the application and bring its window to + * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. */ @@ -202,24 +193,25 @@ namespace NxWM /** * Start an application and add its icon to the taskbar. The applications's - * window is brought to the top. Creating a new applicatino in the start + * window is brought to the top. Creating a new application in the start * window requires three steps: * - * 1. Call openApplicationWindow to create a window for the application, + * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's * constructor, - * 3. Then call addApplication to add the application to the start window. + * 3. Then call CStartWindow::addApplication to add the application to the start window. * * When the application is selected from the start window: * - * 4. Call startApplication start the application and bring its window to + * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. * - * @param application. The new application to add to the task bar + * @param app. The new application to add to the task bar + * @param minimized. The new application starts in the minimized state * @return true on success */ - bool startApplication(INxApplication *application); + bool startApplication(IApplication *app, bool minimized); /** * Hide an application by moving its window to the bottom. @@ -228,7 +220,7 @@ namespace NxWM * @return true on success */ - bool hideApplication(INxApplication *application); + bool hideApplication(IApplication *application); /** * Destroy an application. Move its window to the bottom and remove its @@ -238,9 +230,9 @@ namespace NxWM * @return true on success */ - bool stopApplication(INxApplication *application); + bool stopApplication(IApplication *application); }; } #endif // __cplusplus -#endif // __NXWM_INCLUDE_CNXTASKBAR_HXX +#endif // __NXWM_INCLUDE_CTASKBAR_HXX diff --git a/NxWidgets/nxwm/include/inxapplication.hxx b/NxWidgets/nxwm/include/iapplication.hxx index 70d4ac104..1056e18c0 100644 --- a/NxWidgets/nxwm/include/inxapplication.hxx +++ b/NxWidgets/nxwm/include/iapplication.hxx @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/nxwm/include/inxapplication.hxx + * NxWidgets/nxwm/include/iapplication.hxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_INXAPPLICATION_NXX -#define __INCLUDE_INXAPPLICATION_NXX +#ifndef __INCLUDE_IAPPLICATION_NXX +#define __INCLUDE_IAPPLICATION_NXX /**************************************************************************** * Included Files @@ -42,6 +42,10 @@ #include <nuttx/config.h> +#include "cnxstring.hxx" +#include "ibitmap.hxx" +#include "capplicationwindow.hxx" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -54,18 +58,15 @@ namespace NxWM { - class CApplicationWindow; - class NxWidget::CNxString; - /** - * INxApplication provides the abstract base class for each NxWM application. + * IApplication provides the abstract base class for each NxWM application. */ - class INxApplication + class IApplication { public: /** - * Each implementation of INxApplication must provide a method to recover + * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. */ @@ -74,12 +75,12 @@ namespace NxWM /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @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. */ - virtual NXWidgets::INxBitmap *getIcon(void) = 0; + virtual NXWidgets::IBitmap *getIcon(void) = 0; /** * Get the name string associated with the application @@ -93,16 +94,16 @@ namespace NxWM * Start the application. */ - virtual run(void) = 0; + virtual void run(void) = 0; /** * Stop the application. */ - virtual stop(void) = 0; + virtual void stop(void) = 0; }; } #endif // __cplusplus -#endif // __INCLUDE_INXAPPLICATION_NXX +#endif // __INCLUDE_IAPPLICATION_NXX diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx index dc6c2acf2..178cc37a2 100644 --- a/NxWidgets/nxwm/include/nxwmconfig.hxx +++ b/NxWidgets/nxwm/include/nxwmconfig.hxx @@ -71,7 +71,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR MKRGB(160,160,160) #endif /** @@ -79,7 +79,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(120,192,192) #endif /** @@ -127,18 +127,18 @@ #if defined(CONFIG_NXWM_TASKBAR_TOP) # if defined(CONFIG_NXWM_TASKBAR_BOTTOM) || defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) -# warning "Multiple task positions specified" +# warning "Multiple task bar positions specified" # endif #elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) # if defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) -# warning "Multiple task positions specified" +# warning "Multiple task bar positions specified" # endif #elif defined(CONFIG_NXWM_TASKBAR_LEFT) # if defined defined (CONFIG_NXWM_TASKBAR_RIGHT) -# warning "Multiple task positions specified" +# warning "Multiple task bar positions specified" # endif #elif !defined(CONFIG_NXWM_TASKBAR_RIGHT) -# warning "No task positions specified" +# warning "No task bar position specified" # define CONFIG_NXWM_TASKBAR_TOP 1 #endif |