From a591b9ca86b86684f2804cedf5d0c17a3614e913 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 May 2012 01:01:00 +0000 Subject: NxWM: Add a missing part of the message blocking logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4748 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/libnxwidgets/include/ccallback.hxx | 5 +++-- NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx | 8 +++----- NxWidgets/libnxwidgets/include/cwindoweventhandler.hxx | 4 +++- NxWidgets/libnxwidgets/include/cwindoweventhandlerlist.hxx | 6 ++++-- NxWidgets/libnxwidgets/src/ccallback.cxx | 13 +++++++------ NxWidgets/libnxwidgets/src/cwindoweventhandlerlist.cxx | 6 ++++-- 6 files changed, 24 insertions(+), 18 deletions(-) (limited to 'NxWidgets/libnxwidgets') diff --git a/NxWidgets/libnxwidgets/include/ccallback.hxx b/NxWidgets/libnxwidgets/include/ccallback.hxx index ca3313a9b..09cb83a8a 100644 --- a/NxWidgets/libnxwidgets/include/ccallback.hxx +++ b/NxWidgets/libnxwidgets/include/ccallback.hxx @@ -195,12 +195,13 @@ namespace NXWidgets * callbacks can lead to bad behavior when the callback is executed. * * @param hwnd. Window handle of the blocked window - * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * @param arg1. User provided argument (see nx_openwindow, nx_requestbkgd, * nxtk_openwindow, or nxtk_opentoolbar) + * @param arg2 - User provided argument (see nx_block or nxtk_block) */ #ifdef CONFIG_NX_MULTIUSER - static void windowBlocked(NXWINDOW hwnd, FAR void *arg); + static void windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2); #endif public: diff --git a/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx b/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx index 453cc1115..e709271a0 100644 --- a/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx +++ b/NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx @@ -609,15 +609,13 @@ namespace NXWidgets * window may be safely closed. Closing the window prior with pending * callbacks can lead to bad behavior when the callback is executed. * - * @param hwnd. Window handle of the blocked window - * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, - * nxtk_openwindow, or nxtk_opentoolbar) + * @param arg - User provided argument (see nx_block or nxtk_block) */ #ifdef CONFIG_NX_MULTIUSER - inline void windowBlocked(void) + inline void windowBlocked(FAR void *arg) { - m_eventHandlers.raiseBlockedEvent(); + m_eventHandlers.raiseBlockedEvent(arg); } #endif diff --git a/NxWidgets/libnxwidgets/include/cwindoweventhandler.hxx b/NxWidgets/libnxwidgets/include/cwindoweventhandler.hxx index c414abadb..574c24b55 100644 --- a/NxWidgets/libnxwidgets/include/cwindoweventhandler.hxx +++ b/NxWidgets/libnxwidgets/include/cwindoweventhandler.hxx @@ -108,9 +108,11 @@ namespace NXWidgets /** * Handle a NX window blocked event + * + * @param arg - User provided argument (see nx_block or nxtk_block) */ - virtual void handleBlockedEvent(void) { } + virtual void handleBlockedEvent(FAR void *arg) { } }; } diff --git a/NxWidgets/libnxwidgets/include/cwindoweventhandlerlist.hxx b/NxWidgets/libnxwidgets/include/cwindoweventhandlerlist.hxx index d9e17de09..035e6a7b9 100644 --- a/NxWidgets/libnxwidgets/include/cwindoweventhandlerlist.hxx +++ b/NxWidgets/libnxwidgets/include/cwindoweventhandlerlist.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -163,9 +163,11 @@ namespace NXWidgets /** * Raise an NX window blocked event. + * + * @param arg - User provided argument (see nx_block or nxtk_block) */ - void raiseBlockedEvent(void); + void raiseBlockedEvent(FAR void *arg); }; } diff --git a/NxWidgets/libnxwidgets/src/ccallback.cxx b/NxWidgets/libnxwidgets/src/ccallback.cxx index 32c5b7d64..b2256c6bb 100644 --- a/NxWidgets/libnxwidgets/src/ccallback.cxx +++ b/NxWidgets/libnxwidgets/src/ccallback.cxx @@ -211,22 +211,23 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, * callbacks can lead to bad behavior when the callback is executed. * * @param hwnd. Window handle of the blocked window - * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * @param arg1. User provided argument (see nx_openwindow, nx_requestbkgd, * nxtk_openwindow, or nxtk_opentoolbar) + * @param arg2 - User provided argument (see nx_block or nxtk_block) */ #ifdef CONFIG_NX_MULTIUSER -void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg) +void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) { - gvdbg("hwnd=%p arg=%p\n", hwnd, arg); + gvdbg("hwnd=%p arg1=%p arg2=%p\n", hwnd, arg1, arg2); - // The argument must be the CWidgetControl instance + // The first argument must be the CWidgetControl instance - CWidgetControl *This = (CWidgetControl *)arg; + CWidgetControl *This = (CWidgetControl *)arg1; // Just forward the callback to the CWidgetControl::windowBlocked method - This->windowBlocked(); + This->windowBlocked(arg2); } #endif diff --git a/NxWidgets/libnxwidgets/src/cwindoweventhandlerlist.cxx b/NxWidgets/libnxwidgets/src/cwindoweventhandlerlist.cxx index 15b2c65ff..dfdabcf08 100644 --- a/NxWidgets/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/NxWidgets/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -162,12 +162,14 @@ void CWindowEventHandlerList::raiseKeyboardEvent(void) /** * Raise an NX window blocked event. + * + * @param arg - User provided argument (see nx_block or nxtk_block) */ -void CWindowEventHandlerList::raiseBlockedEvent(void) +void CWindowEventHandlerList::raiseBlockedEvent(FAR void *arg) { for (int i = 0; i < m_eventHandlers.size(); ++i) { - m_eventHandlers.at(i)->handleBlockedEvent(); + m_eventHandlers.at(i)->handleBlockedEvent(arg); } } -- cgit v1.2.3