From 0c4acf3a3f314e2fc862047847ae47e519964f50 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Mar 2012 17:19:17 +0000 Subject: [PATCH] NX console should only be available if NX multi-user mode is enabled git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4535 42af7a65-404d-4744-a932-0658087f49c3 --- configs/sim/README.txt | 3 +++ graphics/nxmu/Make.defs | 6 +++--- graphics/nxmu/nx_setpixel.c | 11 ++++++----- graphics/nxmu/nxmu_server.c | 11 +++++------ include/nuttx/nx/nxconsole.h | 14 +++++++++++++- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/configs/sim/README.txt b/configs/sim/README.txt index 2a65300d97..58ce7d9ba2 100644 --- a/configs/sim/README.txt +++ b/configs/sim/README.txt @@ -374,6 +374,9 @@ nx11 -CONFIG_NXCONSOLE=n +CONFIG_NXCONSOLE=y + -CONFIG_NX_MULTIUSER=n + +CONFIG_NX_MULTIUSER=y + Comment out the following in the appconfig file: -CONFIGURED_APPS += examples/nx diff --git a/graphics/nxmu/Make.defs b/graphics/nxmu/Make.defs index 6be702f111..6b4295290a 100644 --- a/graphics/nxmu/Make.defs +++ b/graphics/nxmu/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # graphics/nxmu/Make.defs # -# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,10 +36,10 @@ NX_ASRCS = NXAPI_CSRCS = nx_bitmap.c nx_closewindow.c nx_connect.c nx_disconnect.c \ nx_eventhandler.c nx_eventnotify.c nx_fill.c nx_filltrapezoid.c \ - nx_getposition.nx_getrectanble.c nx_kbdchin.c nx_kbdin.c nx_lower.c \ + nx_getposition.c nx_getrectangle.c nx_kbdchin.c nx_kbdin.c nx_lower.c \ nx_mousein.c nx_move.c nx_openwindow.c nx_raise.c \ nx_releasebkgd.c nx_requestbkgd.c nx_setpixel.c nx_setsize.c \ - nx_setbgcolor.c nx_setposition.c nx_drawcircle.c nx_drawline.c + nx_setbgcolor.c nx_setposition.c nx_drawcircle.c nx_drawline.c \ nx_fillcircle.c NXMU_CSRCS = nxmu_constructwindow.c nxmu_kbdin.c nxmu_mouse.c \ nxmu_openwindow.c nxmu_redrawreq.c nxmu_releasebkgd.c \ diff --git a/graphics/nxmu/nx_setpixel.c b/graphics/nxmu/nx_setpixel.c index f4cc170532..35617646e2 100644 --- a/graphics/nxmu/nx_setpixel.c +++ b/graphics/nxmu/nx_setpixel.c @@ -85,12 +85,12 @@ * col - The color to use in the set * * Return: - * None + * OK on success; ERROR on failure with errno set appropriately * ****************************************************************************/ -void nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos, - nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) +int nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos, + nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) { FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd; struct nxsvrmsg_setpixel_s outmsg; @@ -99,7 +99,7 @@ void nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos, #ifdef CONFIG_DEBUG if (!wnd || !wnd->conn || !pos || !color) { - errno = EINVAL; + set_errno(EINVAL); return ERROR; } #endif @@ -108,8 +108,9 @@ void nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos, outmsg.msgid = NX_SVRMSG_SETPIXEL; outmsg.wnd = wnd; + outmsg.pos.x = pos->x; + outmsg.pos.y = pos->y; - nxgl_vectcopy(&outmsg.pos, pos); nxgl_colorcopy(outmsg.color, color); /* Forward the fill command to the server */ diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c index aa545c18f7..9cd9e578a9 100644 --- a/graphics/nxmu/nxmu_server.c +++ b/graphics/nxmu/nxmu_server.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nxmu_server.c * - * Copyright (C) 2008-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -180,9 +180,8 @@ static inline void nxmu_shutdown(FAR struct nxfe_state_s *fe) * Name: nxmu_setup ****************************************************************************/ -static inline int nxmu_lcdsetup(FAR const char *mqname, - FAR NX_DRIVERTYPE *dev, - FAR struct nxfe_state_s *fe) +static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, + FAR struct nxfe_state_s *fe) { struct mq_attr attr; int ret; @@ -435,8 +434,8 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) case NX_SVRMSG_SETPIXEL: /* Set a single pixel in the window with a color */ { - FAR struct nxsvrmsg_setpixel_s *setmsg = (FAR struct nxsvrmsg_fill_s *)buffer; - nxbe_setpixel(fillmsg->wnd, &setmsg->pos, setmsg->color); + FAR struct nxsvrmsg_setpixel_s *setmsg = (FAR struct nxsvrmsg_setpixel_s *)buffer; + nxbe_setpixel(setmsg->wnd, &setmsg->pos, setmsg->color); } break; diff --git a/include/nuttx/nx/nxconsole.h b/include/nuttx/nx/nxconsole.h index bf2c321607..0a66e4c032 100644 --- a/include/nuttx/nx/nxconsole.h +++ b/include/nuttx/nx/nxconsole.h @@ -51,7 +51,19 @@ * Pre-processor definitions ****************************************************************************/ /* Configuration ************************************************************/ -/* CONFIG_NXCONSOLE +/* Nx Console prerequistes */ + +#ifndef CONFIG_NX +# warning "NX is not enabled (CONFIG_NX) +#endif + +#ifndef CONFIG_NX_MULTIUSER +# warning "NX Console requires multi-user support (CONFIG_NX_MULTIUSER)" +#endif + +/* Nx Console configuration options: + * + * CONFIG_NXCONSOLE * Enables building of the NxConsole driver. * CONFIG_NXCONSOLE_BPP * Currently, NxConsole supports only a single pixel depth. This