summaryrefslogtreecommitdiffstats
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-19 01:01:00 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-19 01:01:00 +0000
commitab09896759b037d2466d1fda706016d618c50ef8 (patch)
treeb60235b0a038088298aa0f5497411fcb453c424d /nuttx
parent3f31a6667c712f2bde22eb0ca6e05c7b96964124 (diff)
NxWM: Add a missing part of the message blocking logic
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4748 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/graphics/nxmu/nx_block.c5
-rw-r--r--nuttx/graphics/nxmu/nx_eventhandler.c2
-rw-r--r--nuttx/graphics/nxmu/nxfe.h2
-rw-r--r--nuttx/graphics/nxmu/nxmu_server.c5
-rw-r--r--nuttx/include/nuttx/nx/nx.h9
-rw-r--r--nuttx/include/nuttx/nx/nxtk.h4
6 files changed, 19 insertions, 8 deletions
diff --git a/nuttx/graphics/nxmu/nx_block.c b/nuttx/graphics/nxmu/nx_block.c
index 10dad8b94a..2f069f0962 100644
--- a/nuttx/graphics/nxmu/nx_block.c
+++ b/nuttx/graphics/nxmu/nx_block.c
@@ -94,13 +94,15 @@
*
* Input Parameters:
* wnd - The window to be blocked
+ * arg - An argument that will accompany the block messages (This is arg2
+ * in the blocked callback).
*
* Return:
* OK on success; ERROR on failure with errno set appropriately
*
****************************************************************************/
-int nx_block(NXWINDOW hwnd)
+int nx_block(NXWINDOW hwnd, FAR void *arg)
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_blocked_s outmsg;
@@ -132,6 +134,7 @@ int nx_block(NXWINDOW hwnd)
outmsg.msgid = NX_SVRMSG_BLOCKED;
outmsg.wnd = wnd;
+ outmsg.arg = arg;
/* Send the window message via nxmu_sendserver (vs. nxmu_sendwindow) so
* that it will not be blocked.
diff --git a/nuttx/graphics/nxmu/nx_eventhandler.c b/nuttx/graphics/nxmu/nx_eventhandler.c
index 75300b2481..944bb12d11 100644
--- a/nuttx/graphics/nxmu/nx_eventhandler.c
+++ b/nuttx/graphics/nxmu/nx_eventhandler.c
@@ -245,7 +245,7 @@ int nx_eventhandler(NXHANDLE handle)
DEBUGASSERT(wnd);
if (wnd->cb->blocked)
{
- wnd->cb->blocked((NXWINDOW)wnd, wnd->arg);
+ wnd->cb->blocked((NXWINDOW)wnd, wnd->arg, blocked->arg);
}
}
break;
diff --git a/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h
index a70e635f58..8b6a21ef48 100644
--- a/nuttx/graphics/nxmu/nxfe.h
+++ b/nuttx/graphics/nxmu/nxfe.h
@@ -258,6 +258,7 @@ struct nxclimsg_blocked_s
{
uint32_t msgid; /* NX_CLIMSG_BLOCKED */
FAR struct nxbe_window_s *wnd; /* The window that is blocked */
+ FAR void *arg; /* User argument */
};
/* Client-to-Server Message Structures **************************************/
@@ -299,6 +300,7 @@ struct nxsvrmsg_blocked_s
{
uint32_t msgid; /* NX_SVRMSG_BLOCKED */
FAR struct nxbe_window_s *wnd; /* The window that is blocked */
+ FAR void *arg; /* User argument */
};
/* This message requests the server to create a new window */
diff --git a/nuttx/graphics/nxmu/nxmu_server.c b/nuttx/graphics/nxmu/nxmu_server.c
index c412b14924..2730e0ea28 100644
--- a/nuttx/graphics/nxmu/nxmu_server.c
+++ b/nuttx/graphics/nxmu/nxmu_server.c
@@ -154,13 +154,14 @@ static inline void nxmu_shutdown(FAR struct nxfe_state_s *fe)
* Name: nxmu_blocked
****************************************************************************/
-static inline void nxmu_blocked(FAR struct nxbe_window_s *wnd)
+static inline void nxmu_blocked(FAR struct nxbe_window_s *wnd, FAR void *arg)
{
struct nxclimsg_blocked_s outmsg;
int ret;
outmsg.msgid = NX_CLIMSG_BLOCKED;
outmsg.wnd = wnd;
+ outmsg.arg = arg;
ret = nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_blocked_s));
if (ret < 0)
@@ -380,7 +381,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
case NX_SVRMSG_BLOCKED: /* Block messsages to a window */
{
FAR struct nxsvrmsg_blocked_s *blocked = (FAR struct nxsvrmsg_blocked_s *)buffer;
- nxmu_blocked(blocked->wnd);
+ nxmu_blocked(blocked->wnd, blocked->arg);
}
break;
diff --git a/nuttx/include/nuttx/nx/nx.h b/nuttx/include/nuttx/nx/nx.h
index 4a228de253..153c34a3e5 100644
--- a/nuttx/include/nuttx/nx/nx.h
+++ b/nuttx/include/nuttx/nx/nx.h
@@ -209,8 +209,9 @@ struct nx_callback_s
*
* Input Parameters:
* hwnd - Window handle of the blocked window
- * arg - User provided argument (see nx_openwindow, nx_requestbkgd,
+ * arg1 - User provided argument (see nx_openwindow, nx_requestbkgd,
* nxtk_openwindow, or nxtk_opentoolbar)
+ * arg2 - User provided argument (see nx_block or nxtk_block)
*
* Returned Value:
* None
@@ -218,7 +219,7 @@ struct nx_callback_s
**************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
- void (*blocked)(NXWINDOW hwnd, FAR void *arg);
+ void (*blocked)(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2);
#endif
};
@@ -487,6 +488,8 @@ EXTERN int nx_closewindow(NXWINDOW hwnd);
*
* Input Parameters:
* wnd - The window to be blocked
+ * arg - An argument that will accompany the block messages (This is arg2
+ * in the blocked callback).
*
* Return:
* OK on success; ERROR on failure with errno set appropriately
@@ -494,7 +497,7 @@ EXTERN int nx_closewindow(NXWINDOW hwnd);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN int nx_block(NXWINDOW hwnd);
+EXTERN int nx_block(NXWINDOW hwnd, FAR void *arg);
#endif
/****************************************************************************
diff --git a/nuttx/include/nuttx/nx/nxtk.h b/nuttx/include/nuttx/nx/nxtk.h
index a69d177759..60080e47fc 100644
--- a/nuttx/include/nuttx/nx/nxtk.h
+++ b/nuttx/include/nuttx/nx/nxtk.h
@@ -173,6 +173,8 @@ EXTERN int nxtk_closewindow(NXTKWINDOW hfwnd);
*
* Input Parameters:
* hfwnd - The window to be blocked
+ * arg - An argument that will accompany the block messages (This is arg2
+ * in the blocked callback).
*
* Return:
* OK on success; ERROR on failure with errno set appropriately
@@ -180,7 +182,7 @@ EXTERN int nxtk_closewindow(NXTKWINDOW hfwnd);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN int nxtk_block(NXTKWINDOW hfwnd);
+EXTERN int nxtk_block(NXTKWINDOW hfwnd, FAR void *arg);
#endif
/****************************************************************************