diff --git a/configs/sim/nx/defconfig b/configs/sim/nx/defconfig index 82bb6339142c76bcf7fac737087715139ed33706..8218088bb11ffc251365bbb5606ee6ede8b1bacf 100644 --- a/configs/sim/nx/defconfig +++ b/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/configs/sim/nx/defconfig-x11 b/configs/sim/nx/defconfig-x11 index 10e972549936d9f49bae7d979d3fb64831511c8f..5c95f8eabc701ba8da6ea91a01569892fc4866ad 100644 --- a/configs/sim/nx/defconfig-x11 +++ b/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/examples/README.txt b/examples/README.txt index f2a597800924f134c0a9498157f4e7ba1050e845..2fbb54e8f76f61c339b98fcce4a158d22f099d0c 100644 --- a/examples/README.txt +++ b/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/examples/nx/nx_internal.h b/examples/nx/nx_internal.h index d41bbf89f2a4e617ab8275dc46af3e905fcb7c4b..60ec466e2e1936f675db91ac007732c101c9726e 100644 --- a/examples/nx/nx_internal.h +++ b/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/examples/nx/nx_main.c b/examples/nx/nx_main.c index 039b1645e9e2fbbe6842fd42a38218784486c3f4..f30fef1192425d2a4f1400ff624da2b5bba83cec 100644 --- a/examples/nx/nx_main.c +++ b/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/graphics/nxmu/nx_connect.c b/graphics/nxmu/nx_connect.c index 69cf7e95a4ed7e3ca136e2765e052f66f19825b2..ac09fd9d48ab1811953a9cbd7c334ab43c62f3c4 100644 --- a/graphics/nxmu/nx_connect.c +++ b/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/graphics/nxmu/nx_mousein.c b/graphics/nxmu/nx_mousein.c index 7bd33c4a4d9174d3148b212c85d47641434970e6..3d22392c37c55d937fa4b5ae41418c8678df5066 100644 --- a/graphics/nxmu/nx_mousein.c +++ b/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/graphics/nxmu/nx_openwindow.c b/graphics/nxmu/nx_openwindow.c index 8878ffcebd3d71db9860a406bbef865d93d99885..a052515467bd3dc0a61a9716c21c9bc567f1838f 100644 --- a/graphics/nxmu/nx_openwindow.c +++ b/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/graphics/nxmu/nx_releasebkgd.c b/graphics/nxmu/nx_releasebkgd.c index 3e73ed6b8426dfa9042194e285b49a2621563340..1e6001000105be8867100dc94da739944bd5c48e 100644 --- a/graphics/nxmu/nx_releasebkgd.c +++ b/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 <spudmonkey@racsa.co.cr> diff --git a/graphics/nxmu/nx_requestbkgd.c b/graphics/nxmu/nx_requestbkgd.c index 06f21f5ddc4691ef2b522b14d3648a1f95beb3ba..f9aaf86ff6de3084739c21969cbb340985c256ae 100644 --- a/graphics/nxmu/nx_requestbkgd.c +++ b/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/graphics/nxmu/nxfe.h b/graphics/nxmu/nxfe.h index 04fdf9a40ee0c7214a31e98a44cca38d9bb72d92..9b8ff22ee970c976f353eaa008e1d24baf5412dc 100644 --- a/graphics/nxmu/nxfe.h +++ b/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/graphics/nxmu/nxmu_mouse.c b/graphics/nxmu/nxmu_mouse.c index c18fb98eb46c677ab360e341bc54610073a0e1e8..80ab60cb73fe3dec89ad8039350d3c975ad1a35b 100644 --- a/graphics/nxmu/nxmu_mouse.c +++ b/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/graphics/nxmu/nxmu_releasebkgd.c b/graphics/nxmu/nxmu_releasebkgd.c index 131a4d5bc2fe65a8c857d76ebec03f26d56ae3a7..521892b7c510ede7eaf1f517ce474ab0efac32fe 100644 --- a/graphics/nxmu/nxmu_releasebkgd.c +++ b/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 <spudmonkey@racsa.co.cr> @@ -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/graphics/nxmu/nxmu_requestbkgd.c b/graphics/nxmu/nxmu_requestbkgd.c index 6dba04a98b3227c4c02c54e7ea73c16ee3a769c9..7214c235f567613b48b01f2a0ff875bbfe3283a2 100644 --- a/graphics/nxmu/nxmu_requestbkgd.c +++ b/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/graphics/nxsu/nx_mousein.c b/graphics/nxsu/nx_mousein.c index 1c54271386071d2fa5d386c46423a6a84a3de566..2ed59e894d21f76b63b1449ddbb932f94ee2bb02 100644 --- a/graphics/nxsu/nx_mousein.c +++ b/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/graphics/nxsu/nx_releasebkgd.c b/graphics/nxsu/nx_releasebkgd.c index d73cd1e50154ddd593a26f51a6e5f9fbe96bbd66..7c4b4e1cf570b00861ee450886db80fcf3af2690 100644 --- a/graphics/nxsu/nx_releasebkgd.c +++ b/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/graphics/nxsu/nx_requestbkgd.c b/graphics/nxsu/nx_requestbkgd.c index 32eed1ab10cee7faf7cd0486595a2e672d7eaf44..5ac83a4282446a3c67165dc4a58501da220ef4c1 100644 --- a/graphics/nxsu/nx_requestbkgd.c +++ b/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/graphics/nxsu/nxsu_redrawreq.c b/graphics/nxsu/nxsu_redrawreq.c index 9952709c8e685056fdc4e5cf899b8241dfcead23..3226c0c2d33c4f295606a5ca97ab201c7a7f32f8 100644 --- a/graphics/nxsu/nxsu_redrawreq.c +++ b/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 <spudmonkey@racsa.co.cr> diff --git a/graphics/nxtk/nxtk_rawwindow.c b/graphics/nxtk/nxtk_rawwindow.c index ad241dc22e16184ee93c1dd253df77caee9cbdc2..e5e03fdf542a0e2bdf0ca5afb5261710838b0b98 100644 --- a/graphics/nxtk/nxtk_rawwindow.c +++ b/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/include/nuttx/nx.h b/include/nuttx/nx.h index 704f21468eadfb3ce8dcce466c4b3af078891338..fb4a0730834df7de0b16a353272a21d8ff534810 100644 --- a/include/nuttx/nx.h +++ b/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