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 --- nuttx/graphics/nxmu/nx_block.c | 5 ++++- nuttx/graphics/nxmu/nx_eventhandler.c | 2 +- nuttx/graphics/nxmu/nxfe.h | 2 ++ nuttx/graphics/nxmu/nxmu_server.c | 5 +++-- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'nuttx/graphics/nxmu') diff --git a/nuttx/graphics/nxmu/nx_block.c b/nuttx/graphics/nxmu/nx_block.c index 10dad8b94..2f069f096 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 75300b248..944bb12d1 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 a70e635f5..8b6a21ef4 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 c412b1492..2730e0ea2 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; -- cgit v1.2.3