summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-30 22:51:34 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-30 22:51:34 +0000
commit1d3abc8d480110850480ca27560e6a9672052e0b (patch)
treed3fe39dd74ee37e27515c87e27230b6bad3d6d95 /NxWidgets/nxwm/include
parent9384da7066d128ab6a0fb7616a671047c374cd4a (diff)
downloadnuttx-1d3abc8d480110850480ca27560e6a9672052e0b.tar.gz
nuttx-1d3abc8d480110850480ca27560e6a9672052e0b.tar.bz2
nuttx-1d3abc8d480110850480ca27560e6a9672052e0b.zip
More NX window manager updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4679 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/nxwm/include')
-rw-r--r--NxWidgets/nxwm/include/cstartwindow.hxx83
-rw-r--r--NxWidgets/nxwm/include/ctaskbar.hxx2
-rw-r--r--NxWidgets/nxwm/include/iapplication.hxx12
-rw-r--r--NxWidgets/nxwm/include/nxwmconfig.hxx19
4 files changed, 101 insertions, 15 deletions
diff --git a/NxWidgets/nxwm/include/cstartwindow.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx
index 2a1dac088..fca886e8d 100644
--- a/NxWidgets/nxwm/include/cstartwindow.hxx
+++ b/NxWidgets/nxwm/include/cstartwindow.hxx
@@ -42,9 +42,11 @@
#include <nuttx/config.h>
-#include "iapplication.hxx"
#include "tnxarray.hxx"
+#include "iapplication.hxx"
+#include "capplicationwindow.hxx"
+
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
@@ -58,13 +60,61 @@
namespace NxWM
{
class CTaskbar;
- class CApplicationWindow;
- class CStartWindow : public IApplication
+ class CStartWindow : public IApplication, private IApplicationCallback,
+ private NXWidgets::CWidgetEventHandler
{
protected:
- CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */
- TNxArray<CApplication*> m_applications; /**< List of apps in the start window */
+ /**
+ * This structure represents an application and its associated icon image
+ */
+
+ struct SStartWindowSlot
+ {
+ IApplication *app; /**< A reference to the icon */
+ NXWidgets::CImage *image; /**< The icon image that goes with the application */
+ };
+
+ /**
+ * CStartWindow state data
+ */
+
+ CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */
+ CApplicationWindow *m_window; /**< Reference to the application window */
+ TNxArray<struct SStartWindowSlot> m_slots; /**< List of apps in the start window */
+ struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */
+
+ /**
+ * Called when the window minimize button is pressed.
+ */
+
+ void minimize(void);
+
+ /**
+ * Called when the window minimize close is pressed.
+ */
+
+ void close(void);
+
+ /**
+ * Calculate the icon bounding box
+ */
+
+ void getIconBounds(void);
+
+ /**
+ * Stop all applications
+ */
+
+ void stopAllApplications(void);
+
+ /**
+ * Handle a mouse button click event.
+ *
+ * @param e The event data.
+ */
+
+ void handleClickEvent(const NXWidgets::CWidgetEventArgs &e);
/**
* CStartWindow Constructor
@@ -112,13 +162,28 @@ namespace NxWM
* Start the application.
*/
- run(void);
+ void run(void);
/**
* Stop the application.
*/
- stop(void);
+ void stop(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 hiearchy. This method is call from
+ * CTaskbar when the application window must be displayed
+ */
+
+ virtual void redraw(void) = 0;
/**
* Add the application to the start window. The general sequence for
@@ -131,11 +196,11 @@ namespace NxWM
* 4. Call CTaskBar::startApplication (initially minimized) to start the start
* window application.
*
- * @param application. The new application to add to the start window
+ * @param app. The new application to add to the start window
* @return true on success
*/
- bool addApplication(IApplication *application);
+ bool addApplication(IApplication *app);
};
}
diff --git a/NxWidgets/nxwm/include/ctaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx
index ef25fd563..1de4a7491 100644
--- a/NxWidgets/nxwm/include/ctaskbar.hxx
+++ b/NxWidgets/nxwm/include/ctaskbar.hxx
@@ -81,7 +81,7 @@ namespace NxWM
{
private:
/**
- * This structgure represents an application and its associated icon image
+ * This structure represents an application and its associated icon image
*/
struct STaskbarSlot
diff --git a/NxWidgets/nxwm/include/iapplication.hxx b/NxWidgets/nxwm/include/iapplication.hxx
index 88583d4c5..885b85710 100644
--- a/NxWidgets/nxwm/include/iapplication.hxx
+++ b/NxWidgets/nxwm/include/iapplication.hxx
@@ -111,8 +111,16 @@ namespace NxWM
virtual void stop(void) = 0;
/**
- * Re-draw the application window. This method is call from CTaskbar
- * when the application window must be displayed
+ * The application window is hidden (either it is minimized or it is
+ * maximized, but not at the top of the hierarchy
+ */
+
+ virtual void hide(void) = 0;
+
+ /**
+ * 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
*/
virtual void redraw(void) = 0;
diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx
index d416bf8f0..cdbcee564 100644
--- a/NxWidgets/nxwm/include/nxwmconfig.hxx
+++ b/NxWidgets/nxwm/include/nxwmconfig.hxx
@@ -173,16 +173,29 @@
# endif
#endif
+/* Tool Bar Configuration ***************************************************/
+
+#ifndef CONFIG_NXWM_TOOLBAR_HEIGHT
+# define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH
+#endif
+
/* Background Image **********************************************************/
#ifndef CONFIG_NXWM_BACKGROUND_IMAGE
# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap
#endif
-/* Tool Bar Configuration ***************************************************/
+/* Start Window Configuration ***********************************************/
+/**
+ * Horizontal and vertical spacing of icons in the task bar.
+ */
-#ifndef CONFIG_NXWM_TOOLBAR_HEIGHT
-# define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH
+#ifndef CONFIG_NXWM_STARTWINDOW_VSPACING
+# define CONFIG_NXWM_STARTWINDOW_VSPACING (2)
+#endif
+
+#ifndef CONFIG_NXWM_STARTWINDOW_HSPACING
+# define CONFIG_NXWM_STARTWINDOW_HSPACING (2)
#endif
#endif // __INCLUDE_NXWMCONFIG_HXX