From 2acf00c2cde3fd8f42d0ae7eb9df787310b85c41 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 18 May 2012 23:08:34 +0000 Subject: [PATCH] Final refactoring and implementation of delayed window deletion logic. Works worse now, but the changes are important and need to be checked in now git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4747 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- NxWidgets/UnitTests/nxwm/main.cxx | 52 +++++++-- NxWidgets/libnxwidgets/include/ibitmap.hxx | 9 ++ NxWidgets/libnxwidgets/include/ilistbox.hxx | 8 ++ .../include/ilistdataeventhandler.hxx | 9 ++ NxWidgets/libnxwidgets/include/inxwindow.hxx | 8 ++ .../libnxwidgets/include/iscrollable.hxx | 9 ++ NxWidgets/libnxwidgets/include/islider.hxx | 8 ++ NxWidgets/libnxwidgets/include/itextbox.hxx | 8 ++ NxWidgets/libnxwidgets/src/ccallback.cxx | 2 +- NxWidgets/libnxwidgets/src/cnxwindow.cxx | 2 +- NxWidgets/nxwm/Makefile | 12 ++- NxWidgets/nxwm/doc/NxWM-ThreadingModel.ppt | Bin 92672 -> 126464 bytes NxWidgets/nxwm/include/capplicationwindow.hxx | 30 ++++-- NxWidgets/nxwm/include/ccalibration.hxx | 13 +++ NxWidgets/nxwm/include/cfullscreenwindow.hxx | 30 ++++-- NxWidgets/nxwm/include/cnxconsole.hxx | 21 +++- NxWidgets/nxwm/include/cstartwindow.hxx | 56 +++++----- NxWidgets/nxwm/include/ctaskbar.hxx | 37 ++----- ...windowcontrol.hxx => cwindowmessenger.hxx} | 27 ++--- NxWidgets/nxwm/include/iapplication.hxx | 29 +++-- NxWidgets/nxwm/include/iapplicationwindow.hxx | 41 +++++-- NxWidgets/nxwm/include/nxwmconfig.hxx | 2 +- NxWidgets/nxwm/src/capplicationwindow.cxx | 73 +++++++++---- NxWidgets/nxwm/src/ccalibration.cxx | 30 ++++++ NxWidgets/nxwm/src/cfullscreenwindow.cxx | 40 +++++-- NxWidgets/nxwm/src/cnxconsole.cxx | 37 ++++++- NxWidgets/nxwm/src/cstartwindow.cxx | 90 ++++++++++++++-- NxWidgets/nxwm/src/ctaskbar.cxx | 100 +++++++++++++++--- ...windowcontrol.cxx => cwindowmessenger.cxx} | 43 +++----- nuttx/configs/sim/nxwm/defconfig | 14 ++- nuttx/configs/stm3240g-eval/nxwm/defconfig | 4 +- nuttx/fs/nfs/rpc.h | 2 +- nuttx/graphics/nxmu/nx_disconnect.c | 7 +- 33 files changed, 621 insertions(+), 232 deletions(-) rename NxWidgets/nxwm/include/{cwindowcontrol.hxx => cwindowmessenger.hxx} (81%) rename NxWidgets/nxwm/src/{cwindowcontrol.cxx => cwindowmessenger.cxx} (87%) diff --git a/NxWidgets/UnitTests/nxwm/main.cxx b/NxWidgets/UnitTests/nxwm/main.cxx index 6a2e952d85..86ea324d5d 100644 --- a/NxWidgets/UnitTests/nxwm/main.cxx +++ b/NxWidgets/UnitTests/nxwm/main.cxx @@ -46,10 +46,13 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" -#include "ctouchscreen.hxx" -#include "ccalibration.hxx" #include "cnxconsole.hxx" +#ifdef CONFIG_NXWM_TOUCHSCREEN +# include "ctouchscreen.hxx" +# include "ccalibration.hxx" +#endif + ///////////////////////////////////////////////////////////////////////////// // Pre-processor Definitions ///////////////////////////////////////////////////////////////////////////// @@ -67,10 +70,19 @@ #ifdef CONFIG_HAVE_FILENAME # define showTestStepMemory(msg) \ _showTestStepMemory((FAR const char*)__FILE__, (int)__LINE__, msg) -# define showTestCaseMemory(msg) \ - _showTestCaseMemory((FAR const char*)__FILE__, (int)__LINE__, msg) -# define showTestMemory(msg) \ - _showTestMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +#endif + +#ifdef CONFIG_NXWIDGET_MEMMONITOR +# ifdef CONFIG_HAVE_FILENAME +# define showTestCaseMemory(msg) \ + _showTestCaseMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# define showTestMemory(msg) \ + _showTestMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# endif +#else +# define initMemoryUsage() +# define showTestCaseMemory(msg) +# define showTestMemory(msg) #endif ///////////////////////////////////////////////////////////////////////////// @@ -85,9 +97,11 @@ struct SNxWmTest NxWM::CTouchscreen *touchscreen; // The touchscreen struct NxWM::SCalibrationData calibData; // Calibration data #endif +#ifdef CONFIG_NXWIDGET_MEMMONITOR unsigned int mmInitial; // Initial memory usage unsigned int mmStep; // Memory Usage at beginning of test step unsigned int mmSubStep; // Memory Usage at beginning of test sub-step +#endif }; ///////////////////////////////////////////////////////////////////////////// @@ -112,6 +126,7 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // Name: updateMemoryUsage ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR #ifdef CONFIG_HAVE_FILENAME static void updateMemoryUsage(unsigned int *previous, FAR const char *file, int line, @@ -145,11 +160,13 @@ static void updateMemoryUsage(unsigned int *previous, *previous = mmcurrent.uordblks; } +#endif ///////////////////////////////////////////////////////////////////////////// // Name: showTestCaseMemory ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR #ifdef CONFIG_HAVE_FILENAME static void _showTestCaseMemory(FAR const char *file, int line, FAR const char *msg) { @@ -163,11 +180,13 @@ static void showTestCaseMemory(FAR const char *msg) g_nxwmtest.mmSubStep = g_nxwmtest.mmInitial; } #endif +#endif ///////////////////////////////////////////////////////////////////////////// // Name: showTestMemory ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR #ifdef CONFIG_HAVE_FILENAME static void _showTestMemory(FAR const char *file, int line, FAR const char *msg) { @@ -179,11 +198,13 @@ static void showTestMemory(FAR const char *msg) updateMemoryUsage(&g_nxwmtest.mmInitial, msg); } #endif +#endif ///////////////////////////////////////////////////////////////////////////// // Name: initMemoryUsage ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR static void initMemoryUsage(void) { struct mallinfo mmcurrent; @@ -198,6 +219,7 @@ static void initMemoryUsage(void) g_nxwmtest.mmStep = mmcurrent.uordblks; g_nxwmtest.mmSubStep = mmcurrent.uordblks; } +#endif ///////////////////////////////////////////////////////////////////////////// // Name: cleanup @@ -361,7 +383,7 @@ static bool startWindowManager(void) return false; } - showTestCaseMemory("AstartWindowManager: fter starting the window manager"); + showTestCaseMemory("startWindowManager: After starting the window manager"); return true; } @@ -497,12 +519,16 @@ static bool createNxConsole(void) #ifdef CONFIG_HAVE_FILENAME void _showTestStepMemory(FAR const char *file, int line, FAR const char *msg) { +#ifdef CONFIG_NXWIDGET_MEMMONITOR updateMemoryUsage(&g_nxwmtest.mmSubStep, file, line, msg); +#endif } #else void showTestStepMemory(FAR const char *msg) { +#ifdef CONFIG_NXWIDGET_MEMMONITOR updateMemoryUsage(&g_nxwmtest.mmSubStep, msg); +#endif } #endif @@ -608,19 +634,23 @@ int MAIN_NAME(int argc, char *argv[]) } #endif - // Wait a little bit for the display to stabilize. The simulation pressing of + // Wait a little bit for the display to stabilize. Then simulate pressing of // the 'start window' icon in the task bar #ifndef CONFIG_NXWM_TOUCHSCREEN sleep(2); - g_nxwmtest.taskbar->clickIcon(0); + g_nxwmtest.taskbar->clickIcon(0, true); + usleep(500*1000); + g_nxwmtest.taskbar->clickIcon(0, false); showTestCaseMemory(MAIN_STRING "After clicking the start window icon"); - // Wait bit to see the result of the button press. The press the first icon + // Wait bit to see the result of the button press. Then press the first icon // in the start menu. That should be the NxConsole icon. sleep(2); - g_nxwmtest.startwindow->clickIcon(0); + g_nxwmtest.startwindow->clickIcon(0, true); + usleep(500*1000); + g_nxwmtest.startwindow->clickIcon(0, false); showTestCaseMemory(MAIN_STRING "After clicking the NxConsole icon"); #endif diff --git a/NxWidgets/libnxwidgets/include/ibitmap.hxx b/NxWidgets/libnxwidgets/include/ibitmap.hxx index 5eaa5b3c95..923df407a8 100644 --- a/NxWidgets/libnxwidgets/include/ibitmap.hxx +++ b/NxWidgets/libnxwidgets/include/ibitmap.hxx @@ -102,6 +102,15 @@ namespace NXWidgets class IBitmap { public: + /** + * A virtual destructor is required in order to override the IBitmap + * destructor. We do this because if we delete IBitmap, we want the + * destructor of the class that inherits from IBitmap to run, not this + * one. + */ + + virtual ~IBitmap(void) { } + /** * Get the bitmap's color format. * diff --git a/NxWidgets/libnxwidgets/include/ilistbox.hxx b/NxWidgets/libnxwidgets/include/ilistbox.hxx index 9184f23c81..0eb33bc3b4 100644 --- a/NxWidgets/libnxwidgets/include/ilistbox.hxx +++ b/NxWidgets/libnxwidgets/include/ilistbox.hxx @@ -102,6 +102,14 @@ namespace NXWidgets class IListBox { public: + /** + * A virtual destructor is required in order to override the IListBox + * destructor. We do this because if we delete IListBox, we want the + * destructor of the class that inherits from IListBox to run, not this + * one. + */ + + virtual ~IListBox(void) { } /** * Add a new option to the widget using default colors. diff --git a/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx b/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx index b6119a2ae2..26bf1411b0 100644 --- a/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx +++ b/NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx @@ -103,6 +103,15 @@ namespace NXWidgets class IListDataEventHandler { public: + /** + * A virtual destructor is required in order to override the IListDataEventHandler + * destructor. We do this because if we delete IListDataEventHandler, we want the + * destructor of the class that inherits from IListDataEventHandler to run, not this + * one. + */ + + virtual ~IListDataEventHandler(void) { } + /** * Handle data changes. * diff --git a/NxWidgets/libnxwidgets/include/inxwindow.hxx b/NxWidgets/libnxwidgets/include/inxwindow.hxx index c38052de02..750994a71b 100644 --- a/NxWidgets/libnxwidgets/include/inxwindow.hxx +++ b/NxWidgets/libnxwidgets/include/inxwindow.hxx @@ -79,6 +79,14 @@ namespace NXWidgets class INxWindow { public: + /** + * A virtual destructor is required in order to override the INxWindow + * destructor. We do this because if we delete INxWindow, we want the + * destructor of the class that inherits from INxWindow to run, not this + * one. + */ + + virtual ~INxWindow(void) { } /** * Creates a new window. Window creation is separate from diff --git a/NxWidgets/libnxwidgets/include/iscrollable.hxx b/NxWidgets/libnxwidgets/include/iscrollable.hxx index 21a69e487e..b0e65a9dbc 100644 --- a/NxWidgets/libnxwidgets/include/iscrollable.hxx +++ b/NxWidgets/libnxwidgets/include/iscrollable.hxx @@ -102,6 +102,15 @@ namespace NXWidgets class IScrollable { public: + /** + * A virtual destructor is required in order to override the IScrollable + * destructor. We do this because if we delete IScrollable, we want the + * destructor of the class that inherits from IScrollable to run, not this + * one. + */ + + virtual ~IScrollable(void) { } + /** * Gets the x coordinate of the virtual canvas. * diff --git a/NxWidgets/libnxwidgets/include/islider.hxx b/NxWidgets/libnxwidgets/include/islider.hxx index 5ea821e427..5a93409230 100644 --- a/NxWidgets/libnxwidgets/include/islider.hxx +++ b/NxWidgets/libnxwidgets/include/islider.hxx @@ -99,6 +99,14 @@ namespace NXWidgets class ISlider { public: + /** + * A virtual destructor is required in order to override the ISlider + * destructor. We do this because if we delete ISlider, we want the + * destructor of the class that inherits from ISlider to run, not this + * one. + */ + + virtual ~ISlider(void) { } /** * Get the smallest value that the slider can represent. diff --git a/NxWidgets/libnxwidgets/include/itextbox.hxx b/NxWidgets/libnxwidgets/include/itextbox.hxx index 78de7e5029..0e2e7b824e 100644 --- a/NxWidgets/libnxwidgets/include/itextbox.hxx +++ b/NxWidgets/libnxwidgets/include/itextbox.hxx @@ -115,6 +115,14 @@ namespace NXWidgets class ITextBox { public: + /** + * A virtual destructor is required in order to override the ITextBox + * destructor. We do this because if we delete ITextBox, we want the + * destructor of the class that inherits from ITextBox to run, not this + * one. + */ + + virtual ~ITextBox(void) { } /** * Sets the cursor display mode. diff --git a/NxWidgets/libnxwidgets/src/ccallback.cxx b/NxWidgets/libnxwidgets/src/ccallback.cxx index 09dc53a5aa..32c5b7d642 100644 --- a/NxWidgets/libnxwidgets/src/ccallback.cxx +++ b/NxWidgets/libnxwidgets/src/ccallback.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/NxWidgets/libnxwidgets/src/cnxwindow.cxx b/NxWidgets/libnxwidgets/src/cnxwindow.cxx index 5993359721..5ba4d734c4 100644 --- a/NxWidgets/libnxwidgets/src/cnxwindow.cxx +++ b/NxWidgets/libnxwidgets/src/cnxwindow.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/NxWidgets/nxwm/Makefile b/NxWidgets/nxwm/Makefile index d951d11b26..b0b33c73d5 100644 --- a/NxWidgets/nxwm/Makefile +++ b/NxWidgets/nxwm/Makefile @@ -41,10 +41,16 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = + + # Window Manager -CXXSRCS = capplicationwindow.cxx ccalibration.cxx cfullscreenwindow.cxx -CXXSRCS += cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx ctouchscreen.cxx -CXXSRCS += cwindowcontrol.cxx +CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx cnxconsole.cxx +CXXSRCS += cstartwindow.cxx ctaskbar.cxx cwindowmessenger.cxx + +ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) +CXXSRCS += ccalibration.cxx ctouchscreen.cxx +endif + # Images CXXSRCS += glyph_calibration.cxx glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx CXXSRCS += glyph_play.cxx glyph_start.cxx glyph_stop.cxx diff --git a/NxWidgets/nxwm/doc/NxWM-ThreadingModel.ppt b/NxWidgets/nxwm/doc/NxWM-ThreadingModel.ppt index 382f69dd84bc787bb639cc4ffe0563e0affb942c..b532eaa659e45903c928aa6d20d60f0e62a4842c 100644 GIT binary patch delta 16011 zcmcgz3v^Z0nf~^<@8mubl8_J*auQ-mNC<(TSRaT2LO>qjAqYwgBsYo1B<9T+xL2U< zw9*RhncB40qGh>e+8LL4M{z7;)#8(sQnj{YX+Z~STWynO67c}Qp0AhdD{>i0n`XF|Xw?k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nEzmav-25J}?0ul} zPx6t-WM9q)#t+`)4DTeoEf(Le+ux8hP;DX;OcGMXdM_r-BFC zi;omL#ir~dH|C3oCiU~P?yV4_@JRJEQI)mw-0*NX8jB4M41}YD!-LWAKsXu=hr{QF z2cyxL`gV&N!#8IDE=!r_5IIp_3eW6^!b#NqZ*(Qs~f zc%%v{FgzHJ#=_z7z(7TxAk`BN m4-bzt$?abFa-jX(k@BTtuu$v&;NHJ9iGL8g@9l0Dcl{sa0v>As delta 1332 zcmYjReN0>2-OoZ-gu^0IcFn-aLQVQo?zKyF^pjOkx;4KD+L3=o?FCdOC| z0PrpV69BX_1OO0{ItKtwW(R;f0Kkx1Lh3YX4VGUJ%jqupZlM@rayj+MN{$|{%O5-o zXQ^2z6Vx8Ch0_gV$}CR-uT%ReOG183nbLk=d6eU?8jG}v+^xuOv=z}rZYD`Sk%rxs zT4SDw{8Ne!YC-pUtT<<3JTLQNlJ6)>E`wwkwy=|n1uX!1AjX*8!IsEyK4!FNvHYlD zISl|AkgnS;&fn(5=T!gNpiel5QFA&&1B z@1qB|ydwT3giIU7FVZL!ZPPZjZ{bau!i@1(>uS5TwU#?H=ja70i30|p(=TW{!)7Lu#Tiv;b-v>oebx2$7-p$Gn;DajTHO&PRbpY zGBeVc<5BtFRt1=rTea$8vp{1cVOo6TP3qm9jZO5??ia9&Bohq+i7wVyDPD{es-SreV;qF`biU9^;VbOXSElBbVKNH20h0GL+* zUc42++YRtuKfr5)%=D+sx`kCgW6>$Wb75W8=NKV__8L6rjCk+;>ZMyyj5Idkew%u= z5oKkx6d+4a4{)mCzi&0C3G*U30cy$8bcL2+c(?ydw$~XV-mh@h&3zwMmoDN?tX9Ln;rKsw&~GXL diff --git a/NxWidgets/nxwm/include/capplicationwindow.hxx b/NxWidgets/nxwm/include/capplicationwindow.hxx index f923f28b48..686150d144 100644 --- a/NxWidgets/nxwm/include/capplicationwindow.hxx +++ b/NxWidgets/nxwm/include/capplicationwindow.hxx @@ -44,6 +44,7 @@ #include "cnxtkwindow.hxx" #include "cnxtoolbar.hxx" +#include "cwidgetcontrol.hxx" #include "cwidgeteventargs.hxx" #include "cwidgeteventhandler.hxx" #include "cimage.hxx" @@ -151,12 +152,19 @@ namespace NxWM NXWidgets::INxWindow *getWindow(void) const; /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ - CWindowControl *getWindowControl(void) const ; + NXWidgets::CWidgetControl *getWidgetControl(void) const; + + /** + * Block further activity on this window in preparation for window + * shutdown. + */ + + void block(void); /** * Set the window label @@ -195,21 +203,25 @@ namespace NxWM } /** - * Simulate a mouse click on the minimize icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickMinimizeIcon(int index); + void clickMinimizePosition(bool click); #endif /** - * Simulate a mouse click on the stop applicaiton icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickStopIcon(int index); + void clickStopIcon(bool click); #endif }; } diff --git a/NxWidgets/nxwm/include/ccalibration.hxx b/NxWidgets/nxwm/include/ccalibration.hxx index 55cef6d848..e9b5d400f3 100644 --- a/NxWidgets/nxwm/include/ccalibration.hxx +++ b/NxWidgets/nxwm/include/ccalibration.hxx @@ -52,6 +52,7 @@ #include "ctaskbar.hxx" #include "iapplication.hxx" #include "cfullscreenwindow.hxx" +#include "cwindowmessenger.hxx" /**************************************************************************** * Pre-processor Definitions @@ -143,6 +144,7 @@ namespace NxWM * CCalibration state data */ + CWindowMessenger m_messenger; /**< Window event handler/messenger */ CTaskbar *m_taskbar; /**< The taskbar (used to terminate calibration) */ CFullScreenWindow *m_window; /**< The window for the calibration display */ CTouchscreen *m_touchscreen; /**< The touchscreen device */ @@ -289,6 +291,17 @@ namespace NxWM 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 diff --git a/NxWidgets/nxwm/include/cfullscreenwindow.hxx b/NxWidgets/nxwm/include/cfullscreenwindow.hxx index 2e3fbd45d5..1bab37543f 100644 --- a/NxWidgets/nxwm/include/cfullscreenwindow.hxx +++ b/NxWidgets/nxwm/include/cfullscreenwindow.hxx @@ -43,6 +43,7 @@ #include #include "cnxwindow.hxx" +#include "cwidgetcontrol.hxx" #include "iapplicationwindow.hxx" @@ -115,12 +116,19 @@ namespace NxWM NXWidgets::INxWindow *getWindow(void) const; /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ - CWindowControl *getWindowControl(void) const; + NXWidgets::CWidgetControl *getWidgetControl(void) const; + + /** + * Block further activity on this window in preparation for window + * shutdown. + */ + + void block(void); /** * Set the window label @@ -147,21 +155,25 @@ namespace NxWM void registerCallbacks(IApplicationCallback *callback); /** - * Simulate a mouse click on the minimize icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickMinimizeIcon(int index); + void clickMinimizePosition(bool click); #endif /** - * Simulate a mouse click on the stop applicaiton icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickStopIcon(int index); + void clickStopIcon(bool click); #endif }; } diff --git a/NxWidgets/nxwm/include/cnxconsole.hxx b/NxWidgets/nxwm/include/cnxconsole.hxx index b95c86406c..bf3606f053 100644 --- a/NxWidgets/nxwm/include/cnxconsole.hxx +++ b/NxWidgets/nxwm/include/cnxconsole.hxx @@ -49,6 +49,7 @@ #include "iapplication.hxx" #include "capplicationwindow.hxx" #include "ctaskbar.hxx" +#include "cwindowmessenger.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -78,10 +79,11 @@ namespace NxWM class CNxConsole : public IApplication, private IApplicationCallback { private: - CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ - CApplicationWindow *m_window; /**< Reference to the application window */ - NXCONSOLE m_nxcon; /**< NxConsole handle */ - pid_t m_pid; /**< Task ID of the NxConsole thread */ + CWindowMessenger m_messenger; /**< Window event handler/messenger */ + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CApplicationWindow *m_window; /**< Reference to the application window */ + NXCONSOLE m_nxcon; /**< NxConsole handle */ + pid_t m_pid; /**< Task ID of the NxConsole thread */ /** * This is the NxConsole task. This function first redirects output to the @@ -166,6 +168,17 @@ namespace NxWM 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 diff --git a/NxWidgets/nxwm/include/cstartwindow.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx index 8b5fd92d36..3a5325cb75 100644 --- a/NxWidgets/nxwm/include/cstartwindow.hxx +++ b/NxWidgets/nxwm/include/cstartwindow.hxx @@ -48,6 +48,7 @@ #include "iapplication.hxx" #include "capplicationwindow.hxx" +#include "cwindowmessenger.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -115,11 +116,12 @@ namespace NxWM * CStartWindow state data */ - CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ - CApplicationWindow *m_window; /**< Reference to the application window */ - TNxArray m_slots; /**< List of apps in the start window */ - struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ - pid_t m_taskId; /**< ID of the start window task */ + CWindowMessenger m_messenger; /**< Window event handler/messenger */ + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CApplicationWindow *m_window; /**< Reference to the application window */ + TNxArray m_slots; /**< List of apps in the start window */ + struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ + pid_t m_taskId; /**< ID of the start window task */ /** * This is the start window task. This function receives window events from @@ -138,8 +140,8 @@ namespace NxWM * 4. NXWidgets::CWidgetControl records the new state data and raises a * window event. * 5. NXWidgets::CWindowEventHandlerList will give the event to - * NxWM::CWindowControl. - * 6. NxWM::CWindowControl will send the a message on a well-known message + * NxWM::CWindowMessenger. + * 6. NxWM::CWindowMessenger will send the a message on a well-known message * queue. * 7. This CStartWindow::startWindow task will receive and process that * message. @@ -235,6 +237,17 @@ namespace NxWM 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) @@ -275,32 +288,15 @@ namespace NxWM bool addApplication(IApplicationFactory *app); /** - * Simulate a mouse click on the icon at index. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - inline void clickIcon(int index) - { - if (index < m_slots.size()) - { - // Get the image widget at this index - - NXWidgets::CImage *image = m_slots.at(index).image; - - // Get the size and position of the widget - - struct nxgl_size_s imageSize; - image->getSize(imageSize); - - struct nxgl_point_s imagePos; - image->getPos(imagePos); - - // And click the image at its center - - image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); - } - } + void clickIcon(int index, bool click); #endif }; } diff --git a/NxWidgets/nxwm/include/ctaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx index cf98d10d9f..a78fb17394 100644 --- a/NxWidgets/nxwm/include/ctaskbar.hxx +++ b/NxWidgets/nxwm/include/ctaskbar.hxx @@ -110,12 +110,12 @@ namespace NxWM /** * Create a raw window. * - * 1) Create a dumb CWindowControl instance - * 2) Pass the dumb CWindowControl instance to the window constructor - * that inherits from INxWindow. This will "smarten" the CWindowControl + * 1) Create a dumb NXWidgets::CWidgetControl instance + * 2) Pass the dumb NXWidgets::CWidgetControl instance to the window constructor + * that inherits from INxWindow. This will "smarten" the NXWidgets::CWidgetControl * instance with some window knowlede * 3) Call the open() method on the window to display the window. - * 4) After that, the fully smartened CWindowControl instance can + * 4) After that, the fully smartened NXWidgets::CWidgetControl instance can * be used to generate additional widgets by passing it to the * widget constructor */ @@ -398,32 +398,15 @@ namespace NxWM void getDisplaySize(FAR struct nxgl_size_s &size); /** - * Simulate a mouse click on the icon at index. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - inline void clickIcon(int index) - { - if (index < m_slots.size()) - { - // Get the image widget at this index - - NXWidgets::CImage *image = m_slots.at(index).image; - - // Get the size and position of the widget - - struct nxgl_size_s imageSize; - image->getSize(imageSize); - - struct nxgl_point_s imagePos; - image->getPos(imagePos); - - // And click the image at its center - - image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); - } - } + void clickIcon(int index, bool click); #endif }; } diff --git a/NxWidgets/nxwm/include/cwindowcontrol.hxx b/NxWidgets/nxwm/include/cwindowmessenger.hxx similarity index 81% rename from NxWidgets/nxwm/include/cwindowcontrol.hxx rename to NxWidgets/nxwm/include/cwindowmessenger.hxx index 91e430c5c0..645e750cb1 100644 --- a/NxWidgets/nxwm/include/cwindowcontrol.hxx +++ b/NxWidgets/nxwm/include/cwindowmessenger.hxx @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/nxwm/include/cwindowcontrol.hxx + * NxWidgets/nxwm/include/cwindowmessenger.hxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CWINDOWCONTROL_HXX -#define __INCLUDE_CWINDOWCONTROL_HXX +#ifndef __INCLUDE_CWINDOWMESSENGER_HXX +#define __INCLUDE_CWINDOWMESSENGER_HXX /**************************************************************************** * Included Files @@ -70,12 +70,11 @@ namespace NxWM class IApplication; /** - * The class CWindowControl integrates the widget control with some special + * The class CWindowMessenger integrates the widget control with some special * handling of mouse and keyboard inputs neesed by NxWM */ - class CWindowControl : public NXWidgets::CWidgetControl, - private NXWidgets::CWindowEventHandler + class CWindowMessenger : public NXWidgets::CWindowEventHandler { private: mqd_t m_mqd; /**< Message queue descriptor used to commincate with the @@ -102,24 +101,20 @@ namespace NxWM public: /** - * Constructor - * - * @param style The default style that all widgets on this display - * should use. If this is not specified, the widget will use the - * values stored in the defaultCWidgetStyle object. + * CWindowMessenger Constructor */ - CWindowControl(FAR const NXWidgets::CWidgetStyle *style = (const NXWidgets::CWidgetStyle *)NULL); + CWindowMessenger(void); /** - * Destructor. + * CWindowMessenger Destructor. */ - ~CWindowControl(void); + ~CWindowMessenger(void); /** * Destroy the application window and everything in it. This is - * handled by CWindowControl (vs just calling the destructors) because + * handled by CWindowMessenger (vs just calling the destructors) because * in the case where an application destroys itself (because of pressing * the stop button), then we need to unwind and get out of the application * logic before destroying all of its objects. @@ -130,4 +125,4 @@ namespace NxWM } #endif // __cplusplus -#endif // __INCLUDE_CWINDOWCONTROL_HXX +#endif // __INCLUDE_CWINDOWMESSENGER_HXX diff --git a/NxWidgets/nxwm/include/iapplication.hxx b/NxWidgets/nxwm/include/iapplication.hxx index 45067d900a..28e50e0136 100644 --- a/NxWidgets/nxwm/include/iapplication.hxx +++ b/NxWidgets/nxwm/include/iapplication.hxx @@ -45,8 +45,7 @@ #include "cnxstring.hxx" #include "ibitmap.hxx" -#include "cwindowcontrol.hxx" -#include "capplicationwindow.hxx" +#include "iapplicationwindow.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -93,18 +92,6 @@ namespace NxWM virtual IApplicationWindow *getWindow(void) const = 0; - /** - * Get the window widget control. - * - * @return The widget control of the underlying window instance. - */ - - virtual inline CWindowControl *getWindowControl(void) const - { - IApplicationWindow *window = getWindow(); - return window->getWindowControl(); - } - /** * Get the icon associated with the application * @@ -132,11 +119,23 @@ namespace NxWM virtual bool run(void) = 0; /** - * Stop the application. + * Stop the application, put all widgets in a deactivated/disabled state + * and wait to see what happens next. */ virtual void stop(void) = 0; + /** + * 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. + */ + + virtual void destroy(void) = 0; + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy diff --git a/NxWidgets/nxwm/include/iapplicationwindow.hxx b/NxWidgets/nxwm/include/iapplicationwindow.hxx index fe8830c2fa..ed221797d4 100644 --- a/NxWidgets/nxwm/include/iapplicationwindow.hxx +++ b/NxWidgets/nxwm/include/iapplicationwindow.hxx @@ -44,8 +44,7 @@ #include "inxwindow.hxx" #include "cnxstring.hxx" - -#include "cwindowcontrol.hxx" +#include "cwidgetcontrol.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -88,6 +87,15 @@ namespace NxWM class IApplicationWindow { public: + /** + * A virtual destructor is required in order to override the IApplicationWindow + * destructor. We do this because if we delete IApplicationWindow, we want the + * destructor of the class that inherits from IApplicationWindow to run, not this + * one. + */ + + virtual ~IApplicationWindow(void) { } + /** * Initialize window. Window initialization is separate from * object instantiation so that failures can be reported. @@ -119,12 +127,19 @@ namespace NxWM virtual NXWidgets::INxWindow *getWindow(void) const = 0; /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ - virtual CWindowControl *getWindowControl(void) const = 0; + virtual NXWidgets::CWidgetControl *getWidgetControl(void) const = 0; + + /** + * Block further activity on this window in preparation for window + * shutdown. + */ + + virtual void block(void) = 0; /** * Set the window label @@ -151,21 +166,25 @@ namespace NxWM virtual void registerCallbacks(IApplicationCallback *callback) = 0; /** - * Simulate a mouse click on the minimize icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - virtual void clickMinimizeIcon(int index) = 0; + virtual void clickMinimizePosition(bool click) = 0; #endif /** - * Simulate a mouse click on the stop applicaiton icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - virtual void clickStopIcon(int index) = 0; + virtual void clickStopIcon(bool click) = 0; #endif }; } diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx index 3605f8c4fc..25a8beb662 100644 --- a/NxWidgets/nxwm/include/nxwmconfig.hxx +++ b/NxWidgets/nxwm/include/nxwmconfig.hxx @@ -264,7 +264,7 @@ * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 2 rows * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon * CONFIG_NXWM_STARTWINDOW_MQNAME - The well known name of the message queue - * Used to communicated from CWindowControl tothe start window thread. + * Used to communicated from CWindowMessenger to the start window thread. * Default: "/dev/nxwm" * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue * before blocking. Defualt 32 diff --git a/NxWidgets/nxwm/src/capplicationwindow.cxx b/NxWidgets/nxwm/src/capplicationwindow.cxx index 15d4a4a9d0..c0bc9ed62c 100644 --- a/NxWidgets/nxwm/src/capplicationwindow.cxx +++ b/NxWidgets/nxwm/src/capplicationwindow.cxx @@ -47,7 +47,6 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" -#include "cwindowcontrol.hxx" #include "capplicationwindow.hxx" /******************************************************************************************** @@ -153,9 +152,9 @@ CApplicationWindow::~CApplicationWindow(void) bool CApplicationWindow::open(void) { - // Create one of our special window controls for the tool bar + // Create a widget control for the tool bar - CWindowControl *control = new CWindowControl(); + NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl(); if (!control) { return false; @@ -414,15 +413,31 @@ NXWidgets::INxWindow *CApplicationWindow::getWindow(void) const } /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ -CWindowControl *CApplicationWindow::getWindowControl(void) const +NXWidgets::CWidgetControl *CApplicationWindow::getWidgetControl(void) const { + return m_window->getWidgetControl(); +} + +/** + * Block further activity on this window in preparation for window + * shutdown. + */ + +void CApplicationWindow::block(void) +{ + // Get the widget control from the NXWidgets::CNxWindow instance + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - return static_cast(control); + + // And then block further reporting activity on the underlying + // NX framed window + + nxtk_block(control->getWindowHandle()); } /** @@ -459,12 +474,14 @@ void CApplicationWindow::registerCallbacks(IApplicationCallback *callback) } /** - * Simulate a mouse click on the minimize icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CApplicationWindow::clickMinimizeIcon(int index) +void CApplicationWindow::clickMinimizePosition(bool click) { // Get the size and position of the widget @@ -474,20 +491,30 @@ void CApplicationWindow::clickMinimizeIcon(int index) struct nxgl_point_s imagePos; m_minimizeImage->getPos(imagePos); - // And click the image at its center + // And click or release the image at its center - m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), - imagePos.y + (imageSize.h >> 1)); + if (click) + { + m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + m_minimizeImage->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } } #endif /** - * Simulate a mouse click on the stop applicaiton icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CApplicationWindow::clickStopIcon(int index) +void CApplicationWindow::clickStopIcon(bool click) { // The stop icon will not be available for "persistent" applications @@ -501,10 +528,18 @@ void CApplicationWindow::clickStopIcon(int index) struct nxgl_point_s imagePos; m_stopImage->getPos(imagePos); - // And click the image at its center + // And click or release the image at its center - m_stopImage->click(imagePos.x + (imageSize.w >> 1), - imagePos.y + (imageSize.h >> 1)); + if (click) + { + m_stopImage->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + m_stopImage->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } } } #endif diff --git a/NxWidgets/nxwm/src/ccalibration.cxx b/NxWidgets/nxwm/src/ccalibration.cxx index 248aca8389..d93f56a47a 100644 --- a/NxWidgets/nxwm/src/ccalibration.cxx +++ b/NxWidgets/nxwm/src/ccalibration.cxx @@ -99,6 +99,11 @@ CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, m_calthread = CALTHREAD_NOTRUNNING; m_calphase = CALPHASE_NOT_STARTED; m_touched = false; + + // Add our messenger as the window callback + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + control->addWindowEventHandler(&m_messenger); } /** @@ -112,6 +117,11 @@ CCalibration::~CCalibration(void) stop(); + // Remove ourself from the window callback + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + control->removeWindowEventHandler(&m_messenger); + // Although we did not create the window, the rule is that I have to dispose // of it @@ -199,6 +209,26 @@ void CCalibration::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 CCalibration::destroy(void) +{ + // Block any further window messages + + m_window->block(); + + // Make sure that the application is stopped + + stop(); +} + /** * The application window is hidden (either it is minimized or it is * maximized, but it is not at the top of the hierarchy) diff --git a/NxWidgets/nxwm/src/cfullscreenwindow.cxx b/NxWidgets/nxwm/src/cfullscreenwindow.cxx index 40647d8e90..0c34166c06 100644 --- a/NxWidgets/nxwm/src/cfullscreenwindow.cxx +++ b/NxWidgets/nxwm/src/cfullscreenwindow.cxx @@ -128,15 +128,31 @@ NXWidgets::INxWindow *CFullScreenWindow::getWindow(void) const } /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ -CWindowControl *CFullScreenWindow::getWindowControl(void) const +NXWidgets::CWidgetControl *CFullScreenWindow::getWidgetControl(void) const { + return m_window->getWidgetControl(); +} + +/** + * Block further activity on this window in preparation for window + * shutdown. + */ + +void CFullScreenWindow::block(void) +{ + // Get the widget control from the NXWidgets::CNxWindow instance + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - return static_cast(control); + + // And then block further reporting activity on the underlying + // NX raw window + + nx_block(control->getWindowHandle()); } /** @@ -171,23 +187,27 @@ void CFullScreenWindow::registerCallbacks(IApplicationCallback *callback) } /** - * Simulate a mouse click on the minimize icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CFullScreenWindow::clickMinimizeIcon(int index) +void CFullScreenWindow::clickMinimizePosition(bool click) { } #endif /** - * Simulate a mouse click on the stop applicaiton icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CFullScreenWindow::clickStopIcon(int index) +void CFullScreenWindow::clickStopIcon(bool click) { } #endif diff --git a/NxWidgets/nxwm/src/cnxconsole.cxx b/NxWidgets/nxwm/src/cnxconsole.cxx index 577bf661e0..64321ddfbf 100644 --- a/NxWidgets/nxwm/src/cnxconsole.cxx +++ b/NxWidgets/nxwm/src/cnxconsole.cxx @@ -129,9 +129,14 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) NXWidgets::CNxString myName = getName(); window->setWindowLabel(myName); - // Add our callbacks to the application window + // Add our callbacks with the application window window->registerCallbacks(static_cast(this)); + + // Add our messenger as the window callback + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + control->addWindowEventHandler(&m_messenger); } /** @@ -147,13 +152,15 @@ CNxConsole::~CNxConsole(void) stop(); + // Remove ourself from the window callback + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + control->removeWindowEventHandler(&m_messenger); + // Although we didn't create it, we are responsible for deleting the // application window - if (m_window) - { - delete m_window; - } + delete m_window; } /** @@ -321,6 +328,26 @@ void CNxConsole::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 CNxConsole::destroy(void) +{ + // Block any further window messages + + m_window->block(); + + // Make sure that the application is stopped + + stop(); +} + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy diff --git a/NxWidgets/nxwm/src/cstartwindow.cxx b/NxWidgets/nxwm/src/cstartwindow.cxx index 2b7ecbe66d..3dfab50975 100644 --- a/NxWidgets/nxwm/src/cstartwindow.cxx +++ b/NxWidgets/nxwm/src/cstartwindow.cxx @@ -99,6 +99,11 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); + + // Add our messenger as the window callback + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + control->addWindowEventHandler(&m_messenger); } /** @@ -112,13 +117,15 @@ CStartWindow::~CStartWindow(void) stop(); + // Remove ourself from the window callback + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + control->removeWindowEventHandler(&m_messenger); + // Although we didn't create it, we are responsible for deleting the // application window - if (m_window) - { - delete m_window; - } + delete m_window; // Then stop and delete all applications @@ -211,6 +218,28 @@ void CStartWindow::stop(void) task_delete(pid); } } +/** + * 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 CStartWindow::destroy(void) +{ + // What are we doing? This should never happen because the start + // window task is persistent! + + // Block any further window messages + + m_window->block(); + + // Make sure that the application is stopped + + stop(); +} /** * The application window is hidden (either it is minimized or it is @@ -404,6 +433,47 @@ bool CStartWindow::addApplication(IApplicationFactory *app) return true; } +/** + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CStartWindow::clickIcon(int index, bool click) +{ + if (index < m_slots.size()) + { + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click or release the image at its center + + if (click) + { + image->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + image->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + } +} +#endif + /** * Called when the window minimize button is pressed. */ @@ -523,11 +593,11 @@ void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } else { - // If we cannot start the app. Destroy the - // instance we created and see what happens next. + // If we cannot start the app. Destroy the instance we + // created and see what happens next. Could be interesting. - CWindowControl *control = app->getWindowControl(); - control->destroy(app); + app->stop(); + app->destroy(); } } } @@ -548,8 +618,8 @@ void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) * 4. NXWidgets::CWidgetControl records the new state data and raises a * window event. * 5. NXWidgets::CWindowEventHandlerList will give the event to - * NxWM::CWindowControl. - * 6. NxWM::CWindowControl will send the a message on a well-known message + * NxWM::CWindowMessenger. + * 6. NxWM::CWindowMessenger will send the a message on a well-known message * queue. * 7. This CStartWindow::startWindow task will receive and process that * message. diff --git a/NxWidgets/nxwm/src/ctaskbar.cxx b/NxWidgets/nxwm/src/ctaskbar.cxx index ab686f81cc..b4df0bb862 100644 --- a/NxWidgets/nxwm/src/ctaskbar.cxx +++ b/NxWidgets/nxwm/src/ctaskbar.cxx @@ -47,7 +47,6 @@ #include "cwidgetcontrol.hxx" #include "cnxtkwindow.hxx" -#include "cwindowcontrol.hxx" #include "ctaskbar.hxx" /******************************************************************************************** @@ -68,11 +67,11 @@ using namespace NxWM; CTaskbar::CTaskbar(void) { - m_taskbar = (NXWidgets::CNxWindow *)0; - m_background = (NXWidgets::CNxWindow *)0; - m_backImage = (NXWidgets::CImage *)0; - m_topApp = (IApplication *)0; - m_started = false; + m_taskbar = (NXWidgets::CNxWindow *)0; + m_background = (NXWidgets::CNxWindow *)0; + m_backImage = (NXWidgets::CImage *)0; + m_topApp = (IApplication *)0; + m_started = false; } /** @@ -81,6 +80,9 @@ CTaskbar::CTaskbar(void) CTaskbar::~CTaskbar(void) { + // The disconnect,putting the instance back in the state that it + // was before it was constructed. + disconnect(); } @@ -107,7 +109,8 @@ bool CTaskbar::connect(void) } /** - * Disconnect from the server + * Disconnect from the server. This method restores the taskbar to the + * same state that it was in when it was constructed. */ void CTaskbar::disconnect(void) @@ -141,6 +144,7 @@ void CTaskbar::disconnect(void) // Then delete the task bar window delete m_taskbar; + m_taskbar = (NXWidgets::CNxWindow *)0; } if (m_background) @@ -157,8 +161,22 @@ void CTaskbar::disconnect(void) // Then delete the background delete m_background; + m_background = (NXWidgets::CNxWindow *)0; } + // Delete the background image + + if (m_backImage) + { + delete m_backImage; + m_backImage = (NXWidgets::CImage *)0; + } + + // Reset other variables + + m_topApp = (IApplication *)0; + m_started = false; + // And disconnect from the server CNxServer::disconnect(); @@ -279,7 +297,9 @@ bool CTaskbar::startWindowManager(void) continue; } - // Hide all appliations except for the top application + // Hide all applications except for the top application. NOTE: + // topIndex may still be -1, meaning that there is no application + // and that all applications should be hidden. if (i != topIndex) { @@ -303,6 +323,17 @@ bool CTaskbar::startWindowManager(void) i++; } + // If there is no top appliation (i.e., no applications or all applications + // are minimized), then draw the background image + + if (!m_topApp) + { + if (!redrawBackgroundWindow()) + { + return false; + } + } + // Draw the taskbar. It will be draw at a higher level than the application. return redrawTaskbarWindow(); @@ -418,7 +449,7 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) { // Get the widget control associated with the task bar window - NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); // Get the bitmap icon that goes with this application @@ -633,10 +664,10 @@ bool CTaskbar::stopApplication(IApplication *app) } } - // destroy the application + // Destroy the application (actually, this just sets up the application for + // later destruction. - CWindowControl *control = app->getWindowControl(); - control->destroy(app); + app->destroy(); // Re-draw the new top, non-minimized application @@ -673,6 +704,47 @@ void CTaskbar::getDisplaySize(FAR struct nxgl_size_s &size) rect.getSize(size); } +/** + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CTaskbar::clickIcon(int index, bool click) +{ + if (index < m_slots.size()) + { + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click or release the image at its center + + if (click) + { + image->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + image->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + } +} +#endif + /** * Create a raw window. * @@ -690,7 +762,7 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) { // Initialize the widget control using the default style - CWindowControl *control = new CWindowControl((NXWidgets::CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. @@ -727,7 +799,7 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { // Initialize the widget control using the default style - CWindowControl *control = new CWindowControl((NXWidgets::CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the framed window as a class // that derives from INxWindow. diff --git a/NxWidgets/nxwm/src/cwindowcontrol.cxx b/NxWidgets/nxwm/src/cwindowmessenger.cxx similarity index 87% rename from NxWidgets/nxwm/src/cwindowcontrol.cxx rename to NxWidgets/nxwm/src/cwindowmessenger.cxx index 6c2144bad7..4e458566d3 100644 --- a/NxWidgets/nxwm/src/cwindowcontrol.cxx +++ b/NxWidgets/nxwm/src/cwindowmessenger.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cwindowcontrol.cxx + * NxWidgets/nxwm/src/cwindowmessenger.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,28 +46,23 @@ #include "nxwmconfig.hxx" #include "cstartwindow.hxx" -#include "cwindowcontrol.hxx" +#include "cwindowmessenger.hxx" /******************************************************************************************** * Pre-Processor Definitions ********************************************************************************************/ /******************************************************************************************** - * CWindowControl Method Implementations + * CWindowMessenger Method Implementations ********************************************************************************************/ using namespace NxWM; /** - * Constructor - * - * @param style The default style that all widgets on this display - * should use. If this is not specified, the widget will use the - * values stored in the defaultCWidgetStyle object. + * CWindowMessenger Constructor */ -CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) -: NXWidgets::CWidgetControl(style) +CWindowMessenger::CWindowMessenger(void) { // Open a message queue to communicate with the start window task. We need to create // the message queue if it does not exist. @@ -82,36 +77,28 @@ CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) { gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); } - - // Add ourself as the window callback - - addWindowEventHandler(this); } /** - * Destructor. + * CWindowMessenger Destructor. */ -CWindowControl::~CWindowControl(void) +CWindowMessenger::~CWindowMessenger(void) { // Close the message queue (void)mq_close(m_mqd); - - // Remove ourself from the window callback - - removeWindowEventHandler(this); } /** * Destroy the application window and everything in it. This is - * handled by CWindowControl (vs just calling the destructors) because + * handled by CWindowMessenger (vs just calling the destructors) because * in the case where an application destroys itself (because of pressing * the stop button), then we need to unwind and get out of the application * logic before destroying all of its objects. */ -void CWindowControl::destroy(IApplication *app) +void CWindowMessenger::destroy(IApplication *app) { // Send a message to destroy the window isntance at a later time @@ -135,7 +122,7 @@ void CWindowControl::destroy(IApplication *app) */ #ifdef CONFIG_NX_MOUSE -void CWindowControl::handleMouseEvent(void) +void CWindowMessenger::handleMouseEvent(void) { // The logic path here is tortuous but flexible: // @@ -157,8 +144,8 @@ void CWindowControl::handleMouseEvent(void) // 7. NXWidgets::CWidgetControl records the new state data and raises a // window event. // 8. NXWidgets::CWindowEventHandlerList will give the event to this method - // NxWM::CWindowControl. - // 9. This NxWM::CWindowControl method will send the a message on a well- + // NxWM::CWindowMessenger. + // 9. This NxWM::CWindowMessenger method will send the a message on a well- // known message queue. // 10. This CStartWindow::startWindow task will receive and process that // message by calling CWidgetControl::pollEvents() @@ -181,7 +168,7 @@ void CWindowControl::handleMouseEvent(void) */ #ifdef CONFIG_NX_KBD -void CWindowControl::handleKeyboardEvent(void) +void CWindowMessenger::handleKeyboardEvent(void) { // The logic path here is tortuous but flexible: // @@ -203,8 +190,8 @@ void CWindowControl::handleKeyboardEvent(void) // 7. NXWidgets::CWidgetControl records the new state data and raises a // window event. // 8. NXWidgets::CWindowEventHandlerList will give the event to this method - // NxWM::CWindowControl. - // 9. This NxWM::CWindowControl method will send the a message on a well- + // NxWM::CWindowMessenger. + // 9. This NxWM::CWindowMessenger method will send the a message on a well- // known message queue. // 10. This CStartWindow::startWindow task will receive and process that // message by calling CWidgetControl::pollEvents() diff --git a/nuttx/configs/sim/nxwm/defconfig b/nuttx/configs/sim/nxwm/defconfig index 75afe862a9..3daa60f668 100644 --- a/nuttx/configs/sim/nxwm/defconfig +++ b/nuttx/configs/sim/nxwm/defconfig @@ -162,6 +162,7 @@ CONFIG_SIM_TOUCHSCREEN=n # the worker thread. Default: 4 # CONFIG_SCHED_WAITPID - Enable the waitpid() API # CONFIG_SCHED_ATEXIT - Enabled the atexit() API +# CONFIG_SCHED_ONEXIT - Enabled the on_exit() API # #CONFIG_APPS_DIR= CONFIG_DEBUG=n @@ -195,6 +196,7 @@ CONFIG_SCHED_WORKPERIOD=(50*1000) CONFIG_SCHED_WORKSTACKSIZE=8192 CONFIG_SCHED_WAITPID=y CONFIG_SCHED_ATEXIT=n +CONFIG_SCHED_ONEXIT=y # # The following can be used to disable categories of @@ -557,11 +559,14 @@ CONFIG_NX_MXCLIENTMSGS=16 # NxWidgets / NxWM # # Use all defaults except -# 1. Need an especially big server stack size to work with X -# 2. Make the NxWidgets background color match the NxWM back color -# 3. Taskbar on the left -# 4. Bigger stack for NxConsole +# 1. 32 bits-per-pixel +# 2. Need an especially big server stack size to work with X +# 3. Make the NxWidgets background color match the NxWM back color +# 4. Taskbar on the left +# 5. Bigger stack for NxConsole +# 6. No touchscreen # +CONFIG_NXWIDGETS_BPP=32 CONFIG_NXWIDGETS_SERVERSTACK=16384 CONFIG_NXWIDGETS_LISTENERSTACK=8192 CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR=MKRGB(148,189,215) @@ -571,6 +576,7 @@ CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR=MKRGB(35,58,73) CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_NXCONSOLE_STACKSIZE=8192 CONFIG_NXWM_UNITTEST=y +CONFIG_NXWM_TOUCHSCREEN=n # # NxConsole Configuration Settings: diff --git a/nuttx/configs/stm3240g-eval/nxwm/defconfig b/nuttx/configs/stm3240g-eval/nxwm/defconfig index 0633a03f4b..2a3cf3c86d 100644 --- a/nuttx/configs/stm3240g-eval/nxwm/defconfig +++ b/nuttx/configs/stm3240g-eval/nxwm/defconfig @@ -512,7 +512,7 @@ CONFIG_HAVE_LIBM=n # the worker thread. Default: 4 # CONFIG_SCHED_WAITPID - Enable the waitpid() API # CONFIG_SCHED_ATEXIT - Enabled the atexit() API -# CONFIG_SCHED_ONEXIT - Enabled the atexit() API +# CONFIG_SCHED_ONEXIT - Enabled the on_exit() API # #CONFIG_APPS_DIR= CONFIG_DEBUG=n @@ -710,7 +710,7 @@ CONFIG_NAME_MAX=32 CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 -CONFIG_PREALLOC_MQ_MSGS=8 +CONFIG_PREALLOC_MQ_MSGS=32 CONFIG_MQ_MAXMSGSIZE=48 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=8 diff --git a/nuttx/fs/nfs/rpc.h b/nuttx/fs/nfs/rpc.h index 16bafa440e..52694ccbd9 100644 --- a/nuttx/fs/nfs/rpc.h +++ b/nuttx/fs/nfs/rpc.h @@ -171,7 +171,7 @@ struct auth_unix struct rpc_call_header { uint32_t rp_xid; /* request transaction id */ - int32_t rp_direction; /* call direction (0) */ + int32_t rp_direction; /* call direction (0) */ uint32_t rp_rpcvers; /* rpc version (2) */ uint32_t rp_prog; /* program */ uint32_t rp_vers; /* version */ diff --git a/nuttx/graphics/nxmu/nx_disconnect.c b/nuttx/graphics/nxmu/nx_disconnect.c index bbbf05251b..48e1e9cc03 100644 --- a/nuttx/graphics/nxmu/nx_disconnect.c +++ b/nuttx/graphics/nxmu/nx_disconnect.c @@ -90,6 +90,7 @@ void nx_disconnect(NXHANDLE handle) { FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle; struct nxsvrmsg_s outmsg; + int ret; /* Inform the server that this client no longer exists */ @@ -98,6 +99,10 @@ void nx_disconnect(NXHANDLE handle) /* We will finish the teardown upon receipt of the DISCONNECTED message */ - return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s)); + ret = nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s)); + if (ret < 0) + { + gdbg("ERROR: nxmu_sendserver() returned %d\n", ret); + } }