summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm/include/capplicationwindow.hxx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-09 19:31:48 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-09 19:31:48 +0000
commitd97899b6e2c22b4f33f23a8333a03cd323bcd45e (patch)
tree3275cf363a5ddb67c70108c4712f8903fb0b958c /NxWidgets/nxwm/include/capplicationwindow.hxx
parent0f72f7085182b9038e0037c3b949458ac3306fdc (diff)
downloadnuttx-d97899b6e2c22b4f33f23a8333a03cd323bcd45e.tar.gz
nuttx-d97899b6e2c22b4f33f23a8333a03cd323bcd45e.tar.bz2
nuttx-d97899b6e2c22b4f33f23a8333a03cd323bcd45e.zip
NxWidgets: Remove modal loops, Add CWindowEventHandler*. NxWM: Add support for full screen applications
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4716 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/nxwm/include/capplicationwindow.hxx')
-rw-r--r--NxWidgets/nxwm/include/capplicationwindow.hxx95
1 files changed, 31 insertions, 64 deletions
diff --git a/NxWidgets/nxwm/include/capplicationwindow.hxx b/NxWidgets/nxwm/include/capplicationwindow.hxx
index 924389709..e8ce53740 100644
--- a/NxWidgets/nxwm/include/capplicationwindow.hxx
+++ b/NxWidgets/nxwm/include/capplicationwindow.hxx
@@ -49,6 +49,9 @@
#include "cimage.hxx"
#include "clabel.hxx"
#include "crlepalettebitmap.hxx"
+#include "cwindoweventhandler.hxx"
+
+#include "iapplicationwindow.hxx"
/****************************************************************************
* Pre-Processor Definitions
@@ -63,33 +66,14 @@
namespace NxWM
{
/**
- * This callback class is used by the application to get notification of toolbar
- * related events.
- */
-
- class IApplicationCallback
- {
- public:
- /**
- * Called when the window minimize button is pressed.
- */
-
- virtual void minimize(void) = 0;
-
- /**
- * Called when the window minimize close is pressed.
- */
-
- virtual void close(void) = 0;
- };
-
- /**
* This class represents that application window. This class contains that the
* framed window and its toolbar. It manages callbacks from the toolbar minimize
* and close buttions and passes these to the application via callbacks.
*/
- class CApplicationWindow : private NXWidgets::CWidgetEventHandler
+ class CApplicationWindow : public IApplicationWindow,
+ private NXWidgets::CWidgetEventHandler,
+ private NXWidgets::CWindowEventHandler
{
protected:
NXWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */
@@ -103,6 +87,24 @@ namespace NxWM
IApplicationCallback *m_callback; /**< Toolbar action callbacks */
/**
+ * Handle an NX window mouse input event.
+ *
+ * @param e The event data.
+ */
+
+#ifdef CONFIG_NX_MOUSE
+ void handleMouseEvent(void);
+#endif
+
+ /**
+ * Handle a NX window keyboard input event.
+ */
+
+#ifdef CONFIG_NX_KBD
+ void handleKeyboardEvent(void);
+#endif
+
+ /**
* Handle a mouse button click event.
*
* @param e The event data.
@@ -154,10 +156,7 @@ namespace NxWM
* @return. The window used by this application
*/
- inline NXWidgets::CNxTkWindow *getWindow(void) const
- {
- return m_window;
- }
+ NXWidgets::INxWindow *getWindow(void) const;
/**
* Set the window label
@@ -165,40 +164,21 @@ namespace NxWM
* @param appname. The name of the application to place on the window
*/
- inline void setWindowLabel(NXWidgets::CNxString &appname)
- {
- m_windowLabel->setText(appname);
- }
+ void setWindowLabel(NXWidgets::CNxString &appname);
/**
* Register to receive callbacks when toolbar icons are selected
*/
- void registerCallbacks(IApplicationCallback *callback)
- {
- m_callback = callback;
- }
+ void registerCallbacks(IApplicationCallback *callback);
/**
* Simulate a mouse click on the minimize icon. This inline method is only
* used during automated testing of NxWM.
*/
-#ifdef CONFIG_NXWM_UNITTEST
- inline void clickMinimizeIcon(int index)
- {
- // Get the size and position of the widget
-
- struct nxgl_size_s imageSize;
- m_minimizeImage->getSize(imageSize);
-
- struct nxgl_point_s imagePos;
- m_minimizeImage->getPos(imagePos);
-
- // And click the image at its center
-
- m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1));
- }
+#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN)
+ void clickMinimizeIcon(int index);
#endif
/**
@@ -206,21 +186,8 @@ namespace NxWM
* used during automated testing of NxWM.
*/
-#ifdef CONFIG_NXWM_UNITTEST
- inline void clickStopIcon(int index)
- {
- // Get the size and position of the widget
-
- struct nxgl_size_s imageSize;
- m_stopImage->getSize(imageSize);
-
- struct nxgl_point_s imagePos;
- m_stopImage->getPos(imagePos);
-
- // And click the image at its center
-
- m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1));
- }
+#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN)
+ void clickStopIcon(int index);
#endif
};
}