From 0f895f0ed4b2370af37d91c0ecb7649d914ed147 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 1 Dec 2008 22:13:03 +0000 Subject: Fixed for multi-user NX mode git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1386 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/sim/nx/defconfig | 23 +++++++++++++++++++++++ nuttx/configs/sim/nx/defconfig-x11 | 23 +++++++++++++++++++++++ nuttx/examples/README.txt | 25 +++++++++++++++++++++++++ nuttx/examples/nx/nx_internal.h | 5 ++++- nuttx/examples/nx/nx_main.c | 23 ++++++++++++++++++++++- nuttx/graphics/nxmu/nx_connect.c | 2 +- nuttx/graphics/nxmu/nx_mousein.c | 12 ++++++------ nuttx/graphics/nxmu/nx_openwindow.c | 2 +- nuttx/graphics/nxmu/nx_releasebkgd.c | 2 +- nuttx/graphics/nxmu/nx_requestbkgd.c | 5 ++++- nuttx/graphics/nxmu/nxfe.h | 17 ++++++++++------- nuttx/graphics/nxmu/nxmu_mouse.c | 23 ++++++++++++++++------- nuttx/graphics/nxmu/nxmu_releasebkgd.c | 3 ++- nuttx/graphics/nxmu/nxmu_requestbkgd.c | 7 +++++-- nuttx/graphics/nxsu/nx_mousein.c | 2 +- nuttx/graphics/nxsu/nx_releasebkgd.c | 3 ++- nuttx/graphics/nxsu/nx_requestbkgd.c | 7 +++++-- nuttx/graphics/nxsu/nxsu_redrawreq.c | 2 +- nuttx/graphics/nxtk/nxtk_rawwindow.c | 2 +- nuttx/include/nuttx/nx.h | 9 ++++++--- 20 files changed, 159 insertions(+), 38 deletions(-) diff --git a/nuttx/configs/sim/nx/defconfig b/nuttx/configs/sim/nx/defconfig index 82bb63391..8218088bb 100644 --- a/nuttx/configs/sim/nx/defconfig +++ b/nuttx/configs/sim/nx/defconfig @@ -429,6 +429,29 @@ CONFIG_EXAMPLES_NSH_FATSECTSIZE=512 CONFIG_EXAMPLES_NSH_FATNSECTORS=1024 CONFIG_EXAMPLES_NSH_FATMOUNTPT=/tmp +# +# Settings for examples/nx +# +# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- +# buffer driver for use in the test. Default: 0 +# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default: ' '. +# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default: '1' +# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default: '2' +# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating +# the NX server. Default 2048 +# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80 +# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120 +# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with +# nx_eventnotify(). Default: 4 +CONFIG_EXAMPLES_NX_VPLANE=0 +#CONFIG_EXAMPLES_NX_BGCOLOR +#CONFIG_EXAMPLES_NX_COLOR1 +#CONFIG_EXAMPLES_NX_COLOR2 +CONFIG_EXAMPLES_NX_STACKSIZE=8192 +CONFIG_EXAMPLES_NX_CLIENTPRIO=80 +CONFIG_EXAMPLES_NX_SERVERPRIO=120 +CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 + # # Settings for examples/mount CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" diff --git a/nuttx/configs/sim/nx/defconfig-x11 b/nuttx/configs/sim/nx/defconfig-x11 index 10e972549..5c95f8eab 100644 --- a/nuttx/configs/sim/nx/defconfig-x11 +++ b/nuttx/configs/sim/nx/defconfig-x11 @@ -429,6 +429,29 @@ CONFIG_EXAMPLES_NSH_FATSECTSIZE=512 CONFIG_EXAMPLES_NSH_FATNSECTORS=1024 CONFIG_EXAMPLES_NSH_FATMOUNTPT=/tmp +# +# Settings for examples/nx +# +# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- +# buffer driver for use in the test. Default: 0 +# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default: ' '. +# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default: '1' +# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default: '2' +# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating +# the NX server. Default 2048 +# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80 +# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120 +# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with +# nx_eventnotify(). Default: 4 +CONFIG_EXAMPLES_NX_VPLANE=0 +#CONFIG_EXAMPLES_NX_BGCOLOR +#CONFIG_EXAMPLES_NX_COLOR1 +#CONFIG_EXAMPLES_NX_COLOR2 +CONFIG_EXAMPLES_NX_STACKSIZE=8192 +CONFIG_EXAMPLES_NX_CLIENTPRIO=80 +CONFIG_EXAMPLES_NX_SERVERPRIO=120 +CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 + # # Settings for examples/mount CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" diff --git a/nuttx/examples/README.txt b/nuttx/examples/README.txt index f2a597800..2fbb54e8f 100644 --- a/nuttx/examples/README.txt +++ b/nuttx/examples/README.txt @@ -54,6 +54,31 @@ examples/nsh someday be a great NuttX application debugger. NSH is described in its own README located at examples/nsh/README.txt +examples/nx +^^^^^^^^^^^ + + This directory contains a simple test of a subset of the NX APIs + defined in include/nuttx/nx.h. The following configuration options + can be selected: + + CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- + buffer driver for use in the test. Default: 0 + CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default: ' '. + CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default: '1' + CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default: '2' + + This test can be performed with either the single-user version of + NX or with the multiple user version of NX selected with CONFIG_NX_MULTIUSER. + If CONFIG_NX_MULTIUSER is defined, then the following configuration + options also apply: + + CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating + the NX server. Default 2048 + CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80 + CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120 + CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with + nx_eventnotify(). Default: 4 + examples/null ^^^^^^^^^^^^^ diff --git a/nuttx/examples/nx/nx_internal.h b/nuttx/examples/nx/nx_internal.h index d41bbf89f..60ec466e2 100644 --- a/nuttx/examples/nx/nx_internal.h +++ b/nuttx/examples/nx/nx_internal.h @@ -97,8 +97,11 @@ # ifndef CONFIG_EXAMPLES_NX_STACKSIZE # define CONFIG_EXAMPLES_NX_STACKSIZE 2048 # endif +# ifndef CONFIG_EXAMPLES_NX_CLIENTPRIO +# define CONFIG_EXAMPLES_NX_CLIENTPRIO 80 +# endif # ifndef CONFIG_EXAMPLES_NX_SERVERPRIO -# define CONFIG_EXAMPLES_NX_SERVERPRIO 100 +# define CONFIG_EXAMPLES_NX_SERVERPRIO 120 # endif # ifndef CONFIG_EXAMPLES_NX_NOTIFYSIGNO # define CONFIG_EXAMPLES_NX_NOTIFYSIGNO 4 diff --git a/nuttx/examples/nx/nx_main.c b/nuttx/examples/nx/nx_main.c index 039b1645e..f30fef119 100644 --- a/nuttx/examples/nx/nx_main.c +++ b/nuttx/examples/nx/nx_main.c @@ -485,7 +485,28 @@ static inline int nxeg_muinitialize(void) while (!g_connected) { - (void)sem_wait(&g_semevent); + /* Assuming that the incoming message queue is configured non-blocking, + * we can poll the event handler here. This accounts for the case where + * the server is higher prioirty than the client. In that case, the + * server will have already responded to the connection request BEFORE + * the nx_eventnotify was called. + */ + + ret = nx_eventhandler(g_hnx); + if (ret == 0) + { + /* If a message was received, then we are connected */ + + g_connected = TRUE; + } + + /* Otherwise, we will have to wait for the event handler to wake up up + * when we really are connected. + */ + else + { + (void)sem_wait(&g_semevent); + } } } else diff --git a/nuttx/graphics/nxmu/nx_connect.c b/nuttx/graphics/nxmu/nx_connect.c index 69cf7e95a..ac09fd9d4 100644 --- a/nuttx/graphics/nxmu/nx_connect.c +++ b/nuttx/graphics/nxmu/nx_connect.c @@ -110,7 +110,7 @@ static uint32 g_nxcid = 1; * ****************************************************************************/ -NXHANDLE nx_connectionstance(FAR const char *svrmqname) +NXHANDLE nx_connectinstance(FAR const char *svrmqname) { FAR struct nxfe_conn_s *conn; struct nxsvrmsg_s msg; diff --git a/nuttx/graphics/nxmu/nx_mousein.c b/nuttx/graphics/nxmu/nx_mousein.c index 7bd33c4a4..3d22392c3 100644 --- a/nuttx/graphics/nxmu/nx_mousein.c +++ b/nuttx/graphics/nxmu/nx_mousein.c @@ -85,17 +85,17 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, ubyte buttons) { FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle; - struct nxsvrmsg_mousein_s outmsg; + struct nxsvrmsg_mousein_s outmsg; int ret; /* Inform the server that this client no longer exists */ - msg.msgid = NX_SVRMSG_MOUSEIN; - msg.pt.x = x; - msg.pt.y = y; - msg.buttons = buttons; + outmsg.msgid = NX_SVRMSG_MOUSEIN; + outmsg.pt.x = x; + outmsg.pt.y = y; + outmsg.buttons = buttons; - ret = mq_send(conn->c_cwrmq, &outmsg, sizeof(struct nxsvrmsg_mousein_s), NX_SVRMSG_PRIO); + ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_mousein_s), NX_SVRMSG_PRIO); if (ret < 0) { gdbg("mq_send failed: %d\n", errno); diff --git a/nuttx/graphics/nxmu/nx_openwindow.c b/nuttx/graphics/nxmu/nx_openwindow.c index 8878ffceb..a05251546 100644 --- a/nuttx/graphics/nxmu/nx_openwindow.c +++ b/nuttx/graphics/nxmu/nx_openwindow.c @@ -95,7 +95,7 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb, int ret; #ifdef CONFIG_DEBUG - if (!conn || !cb) + if (!handle || !cb) { errno = EINVAL; return NULL; diff --git a/nuttx/graphics/nxmu/nx_releasebkgd.c b/nuttx/graphics/nxmu/nx_releasebkgd.c index 3e73ed6b8..1e6001000 100644 --- a/nuttx/graphics/nxmu/nx_releasebkgd.c +++ b/nuttx/graphics/nxmu/nx_releasebkgd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * graphics/nxsu/nx_releasebkgd.c + * graphics/nxmu/nx_releasebkgd.c * * Copyright (C) 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nuttx/graphics/nxmu/nx_requestbkgd.c b/nuttx/graphics/nxmu/nx_requestbkgd.c index 06f21f5dd..f9aaf86ff 100644 --- a/nuttx/graphics/nxmu/nx_requestbkgd.c +++ b/nuttx/graphics/nxmu/nx_requestbkgd.c @@ -104,13 +104,15 @@ * Input Parameters: * handle - The handle returned by nx_connect * cb - Callbacks to use for processing background window events + * arg - User provided argument (see nx_openwindow, nx_constructwindow) * * Return: * OK: Success; ERROR of failure with errno set appropriately. * ****************************************************************************/ -int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb) +int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb, + FAR void *arg) { FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle; struct nxsvrmsg_requestbkgd_s outmsg; @@ -129,6 +131,7 @@ int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb) outmsg.msgid = NX_SVRMSG_REQUESTBKGD; outmsg.conn = conn; outmsg.cb = cb; + outmsg.arg = arg; ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_requestbkgd_s), NX_SVRMSG_PRIO); if (ret < 0) diff --git a/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h index 04fdf9a40..9b8ff22ee 100644 --- a/nuttx/graphics/nxmu/nxfe.h +++ b/nuttx/graphics/nxmu/nxfe.h @@ -231,7 +231,7 @@ struct nxclimsg_mousein_s FAR struct nxbe_window_s *wnd; /* The handle of window receiving mouse input */ struct nxgl_point_s pos; /* Mouse X/Y position */ ubyte buttons; /* Mouse button set */ -} +}; #endif /* This message reports a new keypad event to a particular window */ @@ -282,6 +282,7 @@ struct nxsvrmsg_requestbkgd_s uint32 msgid; /* NX_SVRMSG_REQUESTBKGD */ FAR struct nxfe_conn_s *conn; /* The specific connection sending the message */ FAR const struct nx_callback_s *cb; /* Event handling callbacks */ + FAR void *arg; /* Client argument used with callbacks */ }; /* This message informs the server that client wishes to close a window */ @@ -392,9 +393,9 @@ struct nxsvrmsg_setbgcolor_s struct nxsvrmsg_mousein_s { uint32 msgid; /* NX_SVRMSG_MOUSEIN */ - struct nx_point_x pt; /* Mouse X/Y position */ + struct nxgl_point_s pt; /* Mouse X/Y position */ ubyte buttons; /* Mouse button set */ -} +}; #endif /* This message reports a new keyboard event from a hardware controller attached to @@ -408,7 +409,7 @@ struct nxsvrmsg_kbdin_s uint32 msgid; /* NX_SVRMSG_KBDIN */ ubyte nch /* Number of characters received */ ubyte ch[1]; /* Array of received characters */ -} +}; #endif /**************************************************************************** @@ -505,6 +506,7 @@ EXTERN void nxmu_openwindow(FAR struct nxbe_state_s *be, * conn - The client containing connection information [IN] * be - The server state structure [IN] * cb - Callbacks used to process window events + * arg - User provided argument (see nx_openwindow, nx_constructwindow) * * Return: * None @@ -513,7 +515,8 @@ EXTERN void nxmu_openwindow(FAR struct nxbe_state_s *be, EXTERN void nxmu_requestbkgd(FAR struct nxfe_conn_s *conn, FAR struct nxbe_state_s *be, - FAR const struct nx_callback_s *cb); + FAR const struct nx_callback_s *cb, + FAR void *arg); /**************************************************************************** * Name: nxmu_releasebkgd @@ -594,8 +597,8 @@ EXTERN int nxmu_mousereport(struct nxbe_window_s *wnd); ****************************************************************************/ #ifdef CONFIG_NX_MOUSE -EXTERN nxmu_mousein(FAR struct nxfe_state_s *fe, - FAR const struct nxgl_point_s *pos, int button); +EXTERN int nxmu_mousein(FAR struct nxfe_state_s *fe, + FAR const struct nxgl_point_s *pos, int button); #endif /**************************************************************************** diff --git a/nuttx/graphics/nxmu/nxmu_mouse.c b/nuttx/graphics/nxmu/nxmu_mouse.c index c18fb98eb..80ab60cb7 100644 --- a/nuttx/graphics/nxmu/nxmu_mouse.c +++ b/nuttx/graphics/nxmu/nxmu_mouse.c @@ -130,7 +130,7 @@ int nxmu_mousereport(struct nxbe_window_s *wnd) outmsg.buttons = g_mbutton; nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->origin); - ret = mq_send(wnd->conn->swrmq, outmsg, + ret = mq_send(wnd->conn->swrmq, &outmsg, sizeof(struct nxclimsg_mousein_s), NX_SVRMSG_PRIO); if (ret < 0) { @@ -155,8 +155,8 @@ int nxmu_mousereport(struct nxbe_window_s *wnd) * ****************************************************************************/ -void nxmu_mousein(FAR struct nxfe_state_s *fe, - FAR const struct nxgl_point_s *pos, int buttons) +int nxmu_mousein(FAR struct nxfe_state_s *fe, + FAR const struct nxgl_point_s *pos, int buttons) { struct nxbe_window_s *wnd; nxgl_coord_t x = pos->x; @@ -193,7 +193,6 @@ void nxmu_mousein(FAR struct nxfe_state_s *fe, g_mpos.y = y; g_mbutton = buttons; - /* Pick the window to receive the mouse event. Start with * the top window and go down. Step with the first window * that gets the mouse report @@ -201,13 +200,23 @@ void nxmu_mousein(FAR struct nxfe_state_s *fe, for (wnd = fe->be.topwnd; wnd; wnd = wnd->below) { - ret = nxsu_mousereport(wnd); - if (ret == 0) + /* The background window normally has no callback structure + * (unless a client has taken control of the background via + * nx_requestbkgd()). + */ + + if (wnd->cb) { - break; + ret = nxmu_mousereport(wnd); + if (ret == 0) + { + break; + } } } } + + return OK; } #endif /* CONFIG_NX_MOUSE */ diff --git a/nuttx/graphics/nxmu/nxmu_releasebkgd.c b/nuttx/graphics/nxmu/nxmu_releasebkgd.c index 131a4d5bc..521892b7c 100644 --- a/nuttx/graphics/nxmu/nxmu_releasebkgd.c +++ b/nuttx/graphics/nxmu/nxmu_releasebkgd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * graphics/nxsu/nxmu_releasebkgd.c + * graphics/nxmu/nxmu_releasebkgd.c * * Copyright (C) 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -101,6 +101,7 @@ void nxmu_releasebkgd(FAR struct nxfe_state_s *fe) */ be->bkgd.cb = NULL; + be->bkgd.arg = NULL; be->bkgd.conn = &fe->conn; /* Redraw the background window */ diff --git a/nuttx/graphics/nxmu/nxmu_requestbkgd.c b/nuttx/graphics/nxmu/nxmu_requestbkgd.c index 6dba04a98..7214c235f 100644 --- a/nuttx/graphics/nxmu/nxmu_requestbkgd.c +++ b/nuttx/graphics/nxmu/nxmu_requestbkgd.c @@ -81,6 +81,7 @@ * conn - The client containing connection information [IN] * be - The server state structure [IN] * cb - Callbacks used to process window events + * arg - User provided argument (see nx_openwindow, nx_constructwindow) * * Return: * None @@ -89,7 +90,8 @@ void nxmu_requestbkgd(FAR struct nxfe_conn_s *conn, FAR struct nxbe_state_s *be, - FAR const struct nx_callback_s *cb) + FAR const struct nx_callback_s *cb, + FAR void *arg) { #ifdef CONFIG_DEBUG if (!conn || !be || !cb) @@ -103,6 +105,7 @@ void nxmu_requestbkgd(FAR struct nxfe_conn_s *conn, */ be->bkgd.cb = cb; + be->bkgd.arg = arg; be->bkgd.conn = conn; /* Report the size/position of the background window to the client */ @@ -116,7 +119,7 @@ void nxmu_requestbkgd(FAR struct nxfe_conn_s *conn, /* Provide the mouse settings */ #ifdef CONFIG_NX_MOUSE - nxsu_mousereport(&be->bkgd); + nxmu_mousereport(&be->bkgd); #endif } diff --git a/nuttx/graphics/nxsu/nx_mousein.c b/nuttx/graphics/nxsu/nx_mousein.c index 1c5427138..2ed59e894 100644 --- a/nuttx/graphics/nxsu/nx_mousein.c +++ b/nuttx/graphics/nxsu/nx_mousein.c @@ -96,7 +96,7 @@ void nxsu_mouseinit(int x, int y) } /**************************************************************************** - * Name: nxmu_mousereport + * Name: nxsu_mousereport * * Description: * Report mouse position info to the specified window diff --git a/nuttx/graphics/nxsu/nx_releasebkgd.c b/nuttx/graphics/nxsu/nx_releasebkgd.c index d73cd1e50..7c4b4e1cf 100644 --- a/nuttx/graphics/nxsu/nx_releasebkgd.c +++ b/nuttx/graphics/nxsu/nx_releasebkgd.c @@ -100,7 +100,8 @@ int nx_releasebkgd(NXWINDOW hwnd) /* Restore the NX background window callbacks */ - be->bkgd.cb = &g_bkgdcb; + be->bkgd.cb = &g_bkgdcb; + be->bkgd.arg = NULL; /* Redraw the background window */ diff --git a/nuttx/graphics/nxsu/nx_requestbkgd.c b/nuttx/graphics/nxsu/nx_requestbkgd.c index 32eed1ab1..5ac83a428 100644 --- a/nuttx/graphics/nxsu/nx_requestbkgd.c +++ b/nuttx/graphics/nxsu/nx_requestbkgd.c @@ -103,13 +103,15 @@ * Input Parameters: * handle - The handle returned by nx_connect * cb - Callbacks to use for processing background window events + * arg - User provided argument (see nx_openwindow, nx_constructwindow) * * Return: * OK on success; ERROR on failure with errno set appropriately * ****************************************************************************/ -int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb) +int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb, + FAR void *arg) { FAR struct nxfe_state_s *fe = (FAR struct nxfe_state_s *)handle; FAR struct nxbe_state_s *be = &fe->be; @@ -124,7 +126,8 @@ int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb) /* Replace the NX background windo callbacks with the client's callbacks */ - be->bkgd.cb = cb; + be->bkgd.cb = cb; + be->bkgd.arg = arg; /* Report the size/position of the background window to the client */ diff --git a/nuttx/graphics/nxsu/nxsu_redrawreq.c b/nuttx/graphics/nxsu/nxsu_redrawreq.c index 9952709c8..3226c0c2d 100644 --- a/nuttx/graphics/nxsu/nxsu_redrawreq.c +++ b/nuttx/graphics/nxsu/nxsu_redrawreq.c @@ -1,5 +1,5 @@ /**************************************************************************** - * graphics/nxmu/nxsu_redrawreq.c + * graphics/nxsu/nxsu_redrawreq.c * * Copyright (C) 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nuttx/graphics/nxtk/nxtk_rawwindow.c b/nuttx/graphics/nxtk/nxtk_rawwindow.c index ad241dc22..e5e03fdf5 100644 --- a/nuttx/graphics/nxtk/nxtk_rawwindow.c +++ b/nuttx/graphics/nxtk/nxtk_rawwindow.c @@ -81,7 +81,7 @@ struct nxtk_rawwindow_s static void nxtk_close(NXTWINDOW hwnd) { FAR struct nxtk_rawwindow_s *this = (FAR struct nxtk_rawwindow_s *)hwnd; - nx_close(this->hwnd); + nx_closewindow(this->hwnd); free(this); } diff --git a/nuttx/include/nuttx/nx.h b/nuttx/include/nuttx/nx.h index 704f21468..fb4a07308 100644 --- a/nuttx/include/nuttx/nx.h +++ b/nuttx/include/nuttx/nx.h @@ -256,8 +256,8 @@ EXTERN int nx_runinstance(FAR const char *mqname, FAR struct fb_vtable_s *fb); ****************************************************************************/ #ifdef CONFIG_NX_MULTIUSER -EXTERN NXHANDLE nx_connectionstance(FAR const char *svrmqname); -# define nx_connect(cb) nx_connectionstance(NX_DEFAULT_SERVER_MQNAME) +EXTERN NXHANDLE nx_connectinstance(FAR const char *svrmqname); +# define nx_connect(cb) nx_connectinstance(NX_DEFAULT_SERVER_MQNAME) #endif /**************************************************************************** @@ -458,13 +458,16 @@ EXTERN int nx_closewindow(NXWINDOW hwnd); * Input Parameters: * handle - The handle returned by nx_connect * cb - Callbacks to use for processing background window events + * arg - User provided argument (see nx_openwindow, nx_constructwindow) * * Return: * OK on success; ERROR on failure with errno set appropriately * ****************************************************************************/ -EXTERN int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb); +EXTERN int nx_requestbkgd(NXHANDLE handle, + FAR const struct nx_callback_s *cb, + FAR void *arg); /**************************************************************************** * Name: nx_releasebkgd -- cgit v1.2.3