summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-12-28 11:33:21 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-12-28 11:33:21 -0600
commit212ec1530e550b6d4a4a5088dc45a8f8315e3e20 (patch)
tree2c408648cfd4f41a22c8fbb891472c7d93eb5cd0
parentca596c87bd2de1e98e124b717681758301145787 (diff)
downloadnuttx-212ec1530e550b6d4a4a5088dc45a8f8315e3e20.tar.gz
nuttx-212ec1530e550b6d4a4a5088dc45a8f8315e3e20.tar.bz2
nuttx-212ec1530e550b6d4a4a5088dc45a8f8315e3e20.zip
Move graphics/nxtk to libnx/nxtk
-rw-r--r--nuttx/ChangeLog1
-rw-r--r--nuttx/Documentation/NXGraphicsSubsystem.html7
-rw-r--r--nuttx/graphics/Makefile8
-rw-r--r--nuttx/graphics/README.txt4
-rw-r--r--nuttx/graphics/nxmu/nxfe.h33
-rw-r--r--nuttx/graphics/nxmu/nxmu_redrawreq.c1
-rw-r--r--nuttx/graphics/nxmu/nxmu_server.c9
-rw-r--r--nuttx/graphics/nxsu/Make.defs7
-rw-r--r--nuttx/graphics/nxsu/nx_constructwindow.c (renamed from nuttx/graphics/nxsu/nxsu_constructwindow.c)10
-rw-r--r--nuttx/graphics/nxsu/nx_openwindow.c4
-rw-r--r--nuttx/graphics/nxsu/nx_redrawreq.c93
-rw-r--r--nuttx/graphics/nxsu/nxfe.h31
-rw-r--r--nuttx/graphics/nxsu/nxsu_redrawreq.c6
-rw-r--r--nuttx/include/nuttx/nx/nx.h158
-rw-r--r--nuttx/include/nuttx/nx/nxmu.h26
-rw-r--r--nuttx/libnx/Makefile1
-rw-r--r--nuttx/libnx/nxmu/Make.defs5
-rw-r--r--nuttx/libnx/nxmu/nx_constructwindow.c (renamed from nuttx/libnx/nxmu/nxmu_constructwindow.c)10
-rw-r--r--nuttx/libnx/nxmu/nx_openwindow.c4
-rw-r--r--nuttx/libnx/nxmu/nx_redrawreq.c111
-rw-r--r--nuttx/libnx/nxtk/Make.defs (renamed from nuttx/graphics/nxtk/Make.defs)42
-rw-r--r--nuttx/libnx/nxtk/nxtk_bitmaptoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c)4
-rw-r--r--nuttx/libnx/nxtk/nxtk_bitmapwindow.c (renamed from nuttx/graphics/nxtk/nxtk_bitmapwindow.c)4
-rw-r--r--nuttx/libnx/nxtk/nxtk_block.c (renamed from nuttx/graphics/nxtk/nxtk_block.c)7
-rw-r--r--nuttx/libnx/nxtk/nxtk_closetoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_closetoolbar.c)10
-rw-r--r--nuttx/libnx/nxtk/nxtk_closewindow.c (renamed from nuttx/graphics/nxtk/nxtk_closewindow.c)6
-rw-r--r--nuttx/libnx/nxtk/nxtk_containerclip.c (renamed from nuttx/graphics/nxtk/nxtk_containerclip.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_drawcircletoolbar.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_drawcirclewindow.c (renamed from nuttx/graphics/nxtk/nxtk_drawcirclewindow.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_drawframe.c (renamed from nuttx/graphics/nxtk/nxtk_drawframe.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_drawlinetoolbar.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_drawlinewindow.c (renamed from nuttx/graphics/nxtk/nxtk_drawlinewindow.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_events.c (renamed from nuttx/graphics/nxtk/nxtk_events.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_fillcircletoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_fillcircletoolbar.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_fillcirclewindow.c (renamed from nuttx/graphics/nxtk/nxtk_fillcirclewindow.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_filltoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_filltoolbar.c)7
-rw-r--r--nuttx/libnx/nxtk/nxtk_filltraptoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_filltraptoolbar.c)15
-rw-r--r--nuttx/libnx/nxtk/nxtk_filltrapwindow.c (renamed from nuttx/graphics/nxtk/nxtk_filltrapwindow.c)14
-rw-r--r--nuttx/libnx/nxtk/nxtk_fillwindow.c (renamed from nuttx/graphics/nxtk/nxtk_fillwindow.c)7
-rw-r--r--nuttx/libnx/nxtk/nxtk_getposition.c (renamed from nuttx/graphics/nxtk/nxtk_getposition.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_gettoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_gettoolbar.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_getwindow.c (renamed from nuttx/graphics/nxtk/nxtk_getwindow.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_internal.h (renamed from nuttx/graphics/nxtk/nxtk_internal.h)64
-rw-r--r--nuttx/libnx/nxtk/nxtk_lower.c (renamed from nuttx/graphics/nxtk/nxtk_lower.c)9
-rw-r--r--nuttx/libnx/nxtk/nxtk_movetoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_movetoolbar.c)10
-rw-r--r--nuttx/libnx/nxtk/nxtk_movewindow.c (renamed from nuttx/graphics/nxtk/nxtk_movewindow.c)10
-rw-r--r--nuttx/libnx/nxtk/nxtk_opentoolbar.c (renamed from nuttx/graphics/nxtk/nxtk_opentoolbar.c)15
-rw-r--r--nuttx/libnx/nxtk/nxtk_openwindow.c (renamed from nuttx/graphics/nxtk/nxtk_openwindow.c)19
-rw-r--r--nuttx/libnx/nxtk/nxtk_raise.c (renamed from nuttx/graphics/nxtk/nxtk_raise.c)9
-rw-r--r--nuttx/libnx/nxtk/nxtk_setposition.c (renamed from nuttx/graphics/nxtk/nxtk_setposition.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_setsize.c (renamed from nuttx/graphics/nxtk/nxtk_setsize.c)7
-rw-r--r--nuttx/libnx/nxtk/nxtk_setsubwindows.c (renamed from nuttx/graphics/nxtk/nxtk_setsubwindows.c)2
-rw-r--r--nuttx/libnx/nxtk/nxtk_subwindowclip.c (renamed from nuttx/graphics/nxtk/nxtk_subwindowclip.c)5
-rw-r--r--nuttx/libnx/nxtk/nxtk_subwindowmove.c (renamed from nuttx/graphics/nxtk/nxtk_subwindowmove.c)12
-rw-r--r--nuttx/libnx/nxtk/nxtk_toolbarbounds.c (renamed from nuttx/graphics/nxtk/nxtk_toolbarbounds.c)6
55 files changed, 531 insertions, 326 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 74978df50..d9edffaf7 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -6329,4 +6329,5 @@
* Move libc/nx, nxmu, and nxglib to a new library, libnx. The NX
graphics is not properly a part of libc (2013-12-28).
* Move graphics/nxfonts to libnx/nxfonts (2013-12-28).
+ * Move graphics/nxtk to libnx/nxtk (2013-12-28).
diff --git a/nuttx/Documentation/NXGraphicsSubsystem.html b/nuttx/Documentation/NXGraphicsSubsystem.html
index 4aa754b6c..744607154 100644
--- a/nuttx/Documentation/NXGraphicsSubsystem.html
+++ b/nuttx/Documentation/NXGraphicsSubsystem.html
@@ -3196,19 +3196,18 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
The multi-user front-end is selected when <code>CONFIG_NX_MULTIUSER</code> is defined
in the NuttX configuration file.
- <dt><code>graphics/nxfonts</code>
+ <dt><code>libnx/nxfonts</code>
<dd>This is where the NXFONTS implementation resides.
This is a relatively low-level set of charset set/glyph management APIs.
See <code>include/nuttx/nx/nxfonts.h</code>.
- <dt><code>graphics/nxtk</code>
+ <dt><code>libnx/nxtk</code>
<dd>This is where the NXTOOLKIT implementation resides.
This toolkit is built on top of NX and works with either the single-user or multi-user NX version.
See <code>include/nuttx/nx/nxtk.h</code>.
<dt><code>nuttx/../nxwidgets</code>
- <dd>The <a href="NxWidgets.html">NxWidgets</a> code is provided as a separate package located outside of the
- NuttX source tree (probably at this location).
+ <dd>The <a href="NxWidgets.html">NxWidgets</a> code is provided as a separate package located outside of the NuttX source tree (probably at this location).
<dt><code>graphics/nxconsole</code>
<dd>The NxConsole driver is built on top of NX and works with either the single-user or multi-user NX version.
diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile
index c3abfb0c6..b63a05312 100644
--- a/nuttx/graphics/Makefile
+++ b/nuttx/graphics/Makefile
@@ -59,10 +59,6 @@ DEPPATH += --dep-path nxsu
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxsu}
endif
-include nxtk/Make.defs
-DEPPATH += --dep-path nxtk
-CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxtk}
-
ifeq ($(CONFIG_NXCONSOLE),y)
include nxconsole/Make.defs
DEPPATH += --dep-path nxconsole
@@ -81,9 +77,9 @@ OBJS = $(AOBJS) $(COBJS)
BIN = libgraphics$(LIBEXT)
ifeq ($(CONFIG_NX_MULTIUSER),y)
-VPATH = nxglib:nxbe:nxmu:nxtk:nxconsole
+VPATH = nxglib:nxbe:nxmu:nxconsole
else
-VPATH = nxglib:nxbe:nxsu:nxtk:nxconsole
+VPATH = nxglib:nxbe:nxsu:nxconsole
endif
all: mklibgraphics
diff --git a/nuttx/graphics/README.txt b/nuttx/graphics/README.txt
index 9f3bdbe4e..c9f8442b5 100644
--- a/nuttx/graphics/README.txt
+++ b/nuttx/graphics/README.txt
@@ -99,11 +99,11 @@ libnx/nxmu
queue to serialize window operations from many threads. The multi-user front-end
is selected when CONFIG_NX_MULTIUSER is defined in the NuttX configuration file.
-graphics/nxfonts
+libnx/nxfonts
This is where the NXFONTS implementation resides. This is a relatively low-
level set of charset set/glyph management APIs. See include/nuttx/nx/nxfonts.h
-graphics/nxtk
+libnx/nxtk
This is where the NXTOOLKIT implementation resides. This toolkit is built on
top of NX and works with either the single-user or multi-user NX version. See
include/nuttx/nx/nxtk.h
diff --git a/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h
index 34d680b2a..42e768267 100644
--- a/nuttx/graphics/nxmu/nxfe.h
+++ b/nuttx/graphics/nxmu/nxfe.h
@@ -96,39 +96,6 @@ extern "C"
****************************************************************************/
/****************************************************************************
- * Name: nxfe_constructwindow
- *
- * Description:
- * This function is the same a nx_openwindow EXCEPT that the client provides
- * the window structure instance. nx_constructwindow will initialize the
- * the pre-allocated window structure for use by NX. This function is
- * provided in addition to nx_open window in order to support a kind of
- * inheritance: The caller's window structure may include extensions that
- * are not visible to NX.
- *
- * NOTE: wnd must have been allocated using kmalloc() (or related allocators)
- * Once provided to nxfe_constructwindow() that memory is owned and managed
- * by NX. On certain error conditions or when the window is closed, NX will
- * free the window.
- *
- * Input Parameters:
- * handle - The handle returned by nx_connect
- * wnd - The pre-allocated window structure.
- * cb - Callbacks used to process window events
- * arg - User provided value that will be returned with NX callbacks.
- *
- * Return:
- * OK on success; ERROR on failure with errno set appropriately. In the
- * case of ERROR, NX will have deallocated the pre-allocated window.
- *
- ****************************************************************************/
-
-int nxfe_constructwindow(NXHANDLE handle,
- FAR struct nxbe_window_s *wnd,
- FAR const struct nx_callback_s *cb,
- FAR void *arg);
-
-/****************************************************************************
* Name: nxmu_sendclient
*
* Description:
diff --git a/nuttx/graphics/nxmu/nxmu_redrawreq.c b/nuttx/graphics/nxmu/nxmu_redrawreq.c
index f54aa85a7..ef0fe1914 100644
--- a/nuttx/graphics/nxmu/nxmu_redrawreq.c
+++ b/nuttx/graphics/nxmu/nxmu_redrawreq.c
@@ -90,4 +90,3 @@ void nxfe_redrawreq(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s
(void)nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_redraw_s));
}
-
diff --git a/nuttx/graphics/nxmu/nxmu_server.c b/nuttx/graphics/nxmu/nxmu_server.c
index cfaa5bbf5..2f7e54564 100644
--- a/nuttx/graphics/nxmu/nxmu_server.c
+++ b/nuttx/graphics/nxmu/nxmu_server.c
@@ -509,7 +509,14 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
break;
#endif
- /* Messages sent to the backgound window ***************************/
+ case NX_SVRMSG_REDRAWREQ: /* Request re-drawing of rectangular region */
+ {
+ FAR struct nxsvrmsg_redrawreq_s *redrawmsg = (FAR struct nxsvrmsg_redrawreq_s *)buffer;
+ nxfe_redrawreq(redrawmsg->wnd, &redrawmsg->rect);
+ }
+ break;
+
+ /* Messages sent to the background window **************************/
case NX_CLIMSG_REDRAW: /* Re-draw the background window */
{
diff --git a/nuttx/graphics/nxsu/Make.defs b/nuttx/graphics/nxsu/Make.defs
index cf668d93c..93abe9d81 100644
--- a/nuttx/graphics/nxsu/Make.defs
+++ b/nuttx/graphics/nxsu/Make.defs
@@ -38,6 +38,7 @@ NX_ASRCS =
NX_CSRCS = nx_bitmap.c nx_close.c nx_closewindow.c nx_fill.c
NX_CSRCS += nx_filltrapezoid.c nx_getposition.c nx_getrectangle.c nx_kbdchin.c
NX_CSRCS += nx_kbdin.c nx_lower.c nx_mousein.c nx_move.c nx_open.c
-NX_CSRCS += nx_openwindow.c nx_raise.c nx_releasebkgd.c nx_requestbkgd.c
-NX_CSRCS += nx_setpixel.c nx_setsize.c nx_setbgcolor.c nx_setposition.c
-NX_CSRCS += nxsu_constructwindow.c nxsu_redrawreq.c nxsu_reportposition.c
+NX_CSRCS += nx_openwindow.c nx_raise.c nx_redrawreq.c nx_releasebkgd.c
+NX_CSRCS += nx_requestbkgd.c nx_setpixel.c nx_setsize.c nx_setbgcolor.c
+NX_CSRCS += nx_setposition.c nxsu_constructwindow.c nxsu_redrawreq.c
+NX_CSRCS += nxsu_reportposition.c
diff --git a/nuttx/graphics/nxsu/nxsu_constructwindow.c b/nuttx/graphics/nxsu/nx_constructwindow.c
index 46b010cee..b77025dcf 100644
--- a/nuttx/graphics/nxsu/nxsu_constructwindow.c
+++ b/nuttx/graphics/nxsu/nx_constructwindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxsu/nx_openwindow.c
+ * graphics/nxsu/nx_constructwindow.c
*
* Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -73,7 +73,7 @@
****************************************************************************/
/****************************************************************************
- * Name: nxfe_constructwindow
+ * Name: nx_constructwindow
*
* Description:
* This function is the same a nx_openwindow EXCEPT that the client provides
@@ -84,7 +84,7 @@
* are not visible to NX.
*
* NOTE: wnd must have been allocated using kmalloc() (or related allocators)
- * Once provided to nxfe_constructwindow() that memory is owned and managed
+ * Once provided to nx_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free the window.
*
@@ -100,8 +100,8 @@
*
****************************************************************************/
-int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
- FAR const struct nx_callback_s *cb, FAR void *arg)
+int nx_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
+ 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;
diff --git a/nuttx/graphics/nxsu/nx_openwindow.c b/nuttx/graphics/nxsu/nx_openwindow.c
index b002f1566..83851d94e 100644
--- a/nuttx/graphics/nxsu/nx_openwindow.c
+++ b/nuttx/graphics/nxsu/nx_openwindow.c
@@ -112,9 +112,9 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb,
return NULL;
}
- /* Then let nxfe_constructwindow do the rest */
+ /* Then let nx_constructwindow do the rest */
- ret = nxfe_constructwindow(handle, wnd, cb, arg);
+ ret = nx_constructwindow(handle, wnd, cb, arg);
if (ret < 0)
{
/* An error occurred, the window has been freed */
diff --git a/nuttx/graphics/nxsu/nx_redrawreq.c b/nuttx/graphics/nxsu/nx_redrawreq.c
new file mode 100644
index 000000000..2980990e0
--- /dev/null
+++ b/nuttx/graphics/nxsu/nx_redrawreq.c
@@ -0,0 +1,93 @@
+/****************************************************************************
+ * graphics/nxsu/nx_redrawreq.c
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/nx/nx.h>
+#include "nxfe.h"
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: nx_redrawreq
+ *
+ * Descripton:
+ * This will cause a NX re-draw callback to the client that owns the
+ * window. This is not normally called from user code, but may be
+ * used within middle-ware layers when redrawing is needed.
+ *
+ * Input Parameters:
+ * hwnd - Window handle
+ * rect - The rectangle that needs to be re-drawn (in window relative
+ * coordinates)
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void nx_redrawreq(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
+{
+ nxfe_redrawreq((FAR struct nxbe_window_s *)hwnd, rect);
+}
diff --git a/nuttx/graphics/nxsu/nxfe.h b/nuttx/graphics/nxsu/nxfe.h
index cd76dd16f..5bbfb040b 100644
--- a/nuttx/graphics/nxsu/nxfe.h
+++ b/nuttx/graphics/nxsu/nxfe.h
@@ -94,37 +94,6 @@ EXTERN const struct nx_callback_s g_bkgdcb;
****************************************************************************/
/****************************************************************************
- * Name: nxfe_constructwindow
- *
- * Description:
- * This function is the same a nx_openwindow EXCEPT that the client provides
- * the window structure instance. nx_constructwindow will initialize the
- * the pre-allocated window structure for use by NX. This function is
- * provided in addition to nx_open window in order to support a kind of
- * inheritance: The caller's window structure may include extensions that
- * are not visible to NX.
- *
- * NOTE: wnd must have been allocated using kmalloc() (or related allocators)
- * Once provided to nxfe_constructwindow() that memory is owned and managed
- * by NX. On certain error conditions or when the window is closed, NX will
- * free the window.
- *
- * Input Parameters:
- * handle - The handle returned by nx_connect
- * wnd - The pre-allocated window structure.
- * cb - Callbacks used to process window events
- * arg - User provided value that will be returned with NX callbacks.
- *
- * Return:
- * OK on success; ERROR on failure with errno set appropriately. In the
- * case of ERROR, NX will have deallocated the pre-allocated window.
- *
- ****************************************************************************/
-
-int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
- FAR const struct nx_callback_s *cb, FAR void *arg);
-
-/****************************************************************************
* Name: nxfe_redrawreq
*
* Descripton:
diff --git a/nuttx/graphics/nxsu/nxsu_redrawreq.c b/nuttx/graphics/nxsu/nxsu_redrawreq.c
index 21845f16f..b0116870b 100644
--- a/nuttx/graphics/nxsu/nxsu_redrawreq.c
+++ b/nuttx/graphics/nxsu/nxsu_redrawreq.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxsu/nxsu_redrawreq.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009,2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -73,7 +73,7 @@
/****************************************************************************
* Name: nxfe_redrawreq
*
- * Descripton:
+ * Description:
* Request the client that has this window to redraw the rectangular region.
*
****************************************************************************/
@@ -100,5 +100,3 @@ void nxfe_redrawreq(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s
wnd->cb->redraw((NXWINDOW)wnd, &relrect, false, wnd->arg);
}
}
-
-
diff --git a/nuttx/include/nuttx/nx/nx.h b/nuttx/include/nuttx/nx/nx.h
index 3b8cc49f4..016a30f73 100644
--- a/nuttx/include/nuttx/nx/nx.h
+++ b/nuttx/include/nuttx/nx/nx.h
@@ -230,7 +230,8 @@ struct nx_callback_s
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
-extern "C" {
+extern "C"
+{
#else
#define EXTERN extern
#endif
@@ -264,7 +265,7 @@ extern "C" {
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev);
+int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev);
# define nx_run(dev) nx_runinstance(NX_DEFAULT_SERVER_MQNAME, dev)
#endif
@@ -298,7 +299,7 @@ EXTERN int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN NXHANDLE nx_connectinstance(FAR const char *svrmqname);
+NXHANDLE nx_connectinstance(FAR const char *svrmqname);
# define nx_connect(cb) nx_connectinstance(NX_DEFAULT_SERVER_MQNAME)
#endif
@@ -323,7 +324,7 @@ EXTERN NXHANDLE nx_connectinstance(FAR const char *svrmqname);
****************************************************************************/
#ifndef CONFIG_NX_MULTIUSER
-EXTERN NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev);
+NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev);
#endif
/****************************************************************************
@@ -345,7 +346,7 @@ EXTERN NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN void nx_disconnect(NXHANDLE handle);
+void nx_disconnect(NXHANDLE handle);
#endif
/****************************************************************************
@@ -366,7 +367,7 @@ EXTERN void nx_disconnect(NXHANDLE handle);
****************************************************************************/
#ifndef CONFIG_NX_MULTIUSER
-EXTERN void nx_close(NXHANDLE handle);
+void nx_close(NXHANDLE handle);
#endif
/****************************************************************************
@@ -397,7 +398,7 @@ EXTERN void nx_close(NXHANDLE handle);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN int nx_eventhandler(NXHANDLE handle);
+int nx_eventhandler(NXHANDLE handle);
#else
# define nx_eventhandler(handle) (OK)
#endif
@@ -423,7 +424,7 @@ EXTERN int nx_eventhandler(NXHANDLE handle);
****************************************************************************/
#if defined(CONFIG_NX_MULTIUSER) && !defined(CONFIG_DISABLE_SIGNALS)
-EXTERN int nx_eventnotify(NXHANDLE handle, int signo);
+int nx_eventnotify(NXHANDLE handle, int signo);
#else
# define nx_eventnotify(handle, signo) (OK)
#endif
@@ -445,9 +446,8 @@ EXTERN int nx_eventnotify(NXHANDLE handle, int signo);
*
****************************************************************************/
-EXTERN NXWINDOW nx_openwindow(NXHANDLE handle,
- FAR const struct nx_callback_s *cb,
- FAR void *arg);
+NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb,
+ FAR void *arg);
/****************************************************************************
* Name: nx_closewindow
@@ -463,7 +463,7 @@ EXTERN NXWINDOW nx_openwindow(NXHANDLE handle,
*
****************************************************************************/
-EXTERN int nx_closewindow(NXWINDOW hwnd);
+int nx_closewindow(NXWINDOW hwnd);
/****************************************************************************
* Name: nx_block
@@ -497,7 +497,7 @@ EXTERN int nx_closewindow(NXWINDOW hwnd);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
-EXTERN int nx_block(NXWINDOW hwnd, FAR void *arg);
+int nx_block(NXWINDOW hwnd, FAR void *arg);
#endif
/****************************************************************************
@@ -540,9 +540,8 @@ EXTERN int nx_block(NXWINDOW hwnd, FAR void *arg);
*
****************************************************************************/
-EXTERN int nx_requestbkgd(NXHANDLE handle,
- FAR const struct nx_callback_s *cb,
- FAR void *arg);
+int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb,
+ FAR void *arg);
/****************************************************************************
* Name: nx_releasebkgd
@@ -559,7 +558,7 @@ EXTERN int nx_requestbkgd(NXHANDLE handle,
*
****************************************************************************/
-EXTERN int nx_releasebkgd(NXWINDOW hwnd);
+int nx_releasebkgd(NXWINDOW hwnd);
/****************************************************************************
* Name: nx_getposition
@@ -577,7 +576,7 @@ EXTERN int nx_releasebkgd(NXWINDOW hwnd);
*
****************************************************************************/
-EXTERN int nx_getposition(NXWINDOW hwnd);
+int nx_getposition(NXWINDOW hwnd);
/****************************************************************************
* Name: nx_setposition
@@ -594,7 +593,7 @@ EXTERN int nx_getposition(NXWINDOW hwnd);
*
****************************************************************************/
-EXTERN int nx_setposition(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos);
+int nx_setposition(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos);
/****************************************************************************
* Name: nx_setsize
@@ -611,7 +610,7 @@ EXTERN int nx_setposition(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos);
*
****************************************************************************/
-EXTERN int nx_setsize(NXWINDOW hwnd, FAR const struct nxgl_size_s *size);
+int nx_setsize(NXWINDOW hwnd, FAR const struct nxgl_size_s *size);
/****************************************************************************
* Name: nx_raise
@@ -627,7 +626,7 @@ EXTERN int nx_setsize(NXWINDOW hwnd, FAR const struct nxgl_size_s *size);
*
****************************************************************************/
-EXTERN int nx_raise(NXWINDOW hwnd);
+int nx_raise(NXWINDOW hwnd);
/****************************************************************************
* Name: nx_lower
@@ -643,7 +642,7 @@ EXTERN int nx_raise(NXWINDOW hwnd);
*
****************************************************************************/
-EXTERN int nx_lower(NXWINDOW hwnd);
+int nx_lower(NXWINDOW hwnd);
/****************************************************************************
* Name: nx_setpixel
@@ -662,8 +661,8 @@ EXTERN int nx_lower(NXWINDOW hwnd);
*
****************************************************************************/
-EXTERN int 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]);
/****************************************************************************
* Name: nx_fill
@@ -681,8 +680,8 @@ EXTERN int nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
*
****************************************************************************/
-EXTERN int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
- nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
+ nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nx_getrectangle
@@ -710,9 +709,9 @@ EXTERN int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
-EXTERN int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
- unsigned int plane, FAR uint8_t *dest,
- unsigned int deststride);
+int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
+ unsigned int plane, FAR uint8_t *dest,
+ unsigned int deststride);
/****************************************************************************
* Name: nx_filltrapezoid
@@ -731,9 +730,9 @@ EXTERN int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
-EXTERN int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip,
- FAR const struct nxgl_trapezoid_s *trap,
- nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip,
+ FAR const struct nxgl_trapezoid_s *trap,
+ nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nx_drawline
@@ -754,8 +753,8 @@ EXTERN int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip,
*
****************************************************************************/
-EXTERN int nx_drawline(NXWINDOW hwnd, FAR struct nxgl_vector_s *vector,
- nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+int nx_drawline(NXWINDOW hwnd, FAR struct nxgl_vector_s *vector,
+ nxgl_coord_t width, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nx_drawcircle
@@ -775,9 +774,9 @@ EXTERN int nx_drawline(NXWINDOW hwnd, FAR struct nxgl_vector_s *vector,
*
****************************************************************************/
-EXTERN int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
- nxgl_coord_t radius, nxgl_coord_t width,
- nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
+ nxgl_coord_t radius, nxgl_coord_t width,
+ nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nx_fillcircle
@@ -796,9 +795,9 @@ EXTERN int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
*
****************************************************************************/
-EXTERN int nx_fillcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
- nxgl_coord_t radius,
- nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+int nx_fillcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
+ nxgl_coord_t radius,
+ nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nx_setbgcolor
@@ -815,8 +814,7 @@ EXTERN int nx_fillcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
*
****************************************************************************/
-int nx_setbgcolor(NXHANDLE handle,
- nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
+int nx_setbgcolor(NXHANDLE handle, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nx_move
@@ -835,8 +833,8 @@ int nx_setbgcolor(NXHANDLE handle,
*
****************************************************************************/
-EXTERN int nx_move(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
- FAR const struct nxgl_point_s *offset);
+int nx_move(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
+ FAR const struct nxgl_point_s *offset);
/****************************************************************************
* Name: nx_bitmap
@@ -861,10 +859,9 @@ EXTERN int nx_move(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
-EXTERN int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
- FAR const void *src[CONFIG_NX_NPLANES],
- FAR const struct nxgl_point_s *origin,
- unsigned int stride);
+int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
+ FAR const void *src[CONFIG_NX_NPLANES],
+ FAR const struct nxgl_point_s *origin, unsigned int stride);
/****************************************************************************
* Name: nx_kbdin
@@ -877,8 +874,8 @@ EXTERN int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
****************************************************************************/
#ifdef CONFIG_NX_KBD
-EXTERN int nx_kbdchin(NXHANDLE handle, uint8_t ch);
-EXTERN int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch);
+int nx_kbdchin(NXHANDLE handle, uint8_t ch);
+int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch);
#endif
/****************************************************************************
@@ -892,9 +889,68 @@ EXTERN int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch);
****************************************************************************/
#ifdef CONFIG_NX_MOUSE
-EXTERN int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons);
+int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons);
#endif
+/****************************************************************************
+ * NX-Internal Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: nx_redrawreq
+ *
+ * Description:
+ * This will cause a NX re-draw callback to the client that owns the
+ * window. This is not normally called from user code, but may be
+ * used within middle-ware layers when redrawing is needed.
+ *
+ * NXTK uses this function, for example, when a change in the main window
+ * necessitates redrawing of the toolbar window.
+ *
+ * Input Parameters:
+ * hwnd - Window handle
+ * rect - The rectangle that needs to be re-drawn (in window relative
+ * coordinates)
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void nx_redrawreq(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect);
+
+/****************************************************************************
+ * Name: nx_constructwindow
+ *
+ * Description:
+ * This function is the same a nx_openwindow EXCEPT that the client provides
+ * the window structure instance. nx_constructwindow will initialize the
+ * the pre-allocated window structure for use by NX. This function is
+ * provided in addition to nx_open window in order to support a kind of
+ * inheritance: The caller's window structure may include extensions that
+ * are not visible to NX.
+ *
+ * NOTE: wnd must have been allocated using kmalloc() (or related allocators)
+ * Once provided to nx_constructwindow() that memory is owned and managed
+ * by NX. On certain error conditions or when the window is closed, NX will
+ * free the window.
+ *
+ * Input Parameters:
+ * handle - The handle returned by nx_connect
+ * wnd - The pre-allocated window structure.
+ * cb - Callbacks used to process window events
+ * arg - User provided value that will be returned with NX callbacks.
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately. In the
+ * case of ERROR, NX will have deallocated the pre-allocated window.
+ *
+ ****************************************************************************/
+
+struct nxbe_window_s; /* Forward reference */
+int nx_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
+ FAR const struct nx_callback_s *cb, FAR void *arg);
+
#undef EXTERN
#if defined(__cplusplus)
}
diff --git a/nuttx/include/nuttx/nx/nxmu.h b/nuttx/include/nuttx/nx/nxmu.h
index a6a7ac145..019a8a35f 100644
--- a/nuttx/include/nuttx/nx/nxmu.h
+++ b/nuttx/include/nuttx/nx/nxmu.h
@@ -158,6 +158,7 @@ enum nxmsg_e
NX_SVRMSG_SETBGCOLOR, /* Set the color of the background */
NX_SVRMSG_MOUSEIN, /* New mouse report from mouse client */
NX_SVRMSG_KBDIN, /* New keyboard report from keyboard client */
+ NX_SVRMSG_REDRAWREQ /* Request re-drawing of rectangular region */
};
/* Server-to-Client Message Structures **************************************/
@@ -346,7 +347,7 @@ struct nxsvrmsg_lower_s
struct nxsvrmsg_setpixel_s
{
- uint32_t msgid; /* NX_SVRMSG_SETPIXEL */
+ uint32_t msgid; /* NX_SVRMSG_SETPIXEL */
FAR struct nxbe_window_s *wnd; /* The window to fill */
struct nxgl_point_s pos; /* The position of the pixel in the window */
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]; /* Color to use in the fill */
@@ -356,7 +357,7 @@ struct nxsvrmsg_setpixel_s
struct nxsvrmsg_fill_s
{
- uint32_t msgid; /* NX_SVRMSG_FILL */
+ uint32_t msgid; /* NX_SVRMSG_FILL */
FAR struct nxbe_window_s *wnd; /* The window to fill */
struct nxgl_rect_s rect; /* The rectangle in the window to fill */
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]; /* Color to use in the fill */
@@ -366,7 +367,7 @@ struct nxsvrmsg_fill_s
struct nxsvrmsg_getrectangle_s
{
- uint32_t msgid; /* NX_SVRMSG_GETRECTANGLE */
+ uint32_t msgid; /* NX_SVRMSG_GETRECTANGLE */
FAR struct nxbe_window_s *wnd; /* The window to get from */
struct nxgl_rect_s rect; /* The rectangle in the window to get from */
unsigned int plane; /* The plane number to read */
@@ -379,7 +380,7 @@ struct nxsvrmsg_getrectangle_s
struct nxsvrmsg_filltrapezoid_s
{
- uint32_t msgid; /* NX_SVRMSG_FILLTRAP */
+ uint32_t msgid; /* NX_SVRMSG_FILLTRAP */
FAR struct nxbe_window_s *wnd; /* The window to fill */
FAR struct nxgl_rect_s clip; /* The clipping window */
struct nxgl_trapezoid_s trap; /* The trapezoidal region in the window to fill */
@@ -413,7 +414,7 @@ struct nxsvrmsg_bitmap_s
struct nxsvrmsg_setbgcolor_s
{
- uint32_t msgid; /* NX_SVRMSG_SETBGCOLOR */
+ uint32_t msgid; /* NX_SVRMSG_SETBGCOLOR */
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]; /* Color to use in the background */
};
@@ -439,12 +440,21 @@ struct nxsvrmsg_mousein_s
#ifdef CONFIG_NX_KBD
struct nxsvrmsg_kbdin_s
{
- uint32_t msgid; /* NX_SVRMSG_KBDIN */
- uint8_t nch ; /* Number of characters received */
- uint8_t ch[1]; /* Array of received characters */
+ uint32_t msgid; /* NX_SVRMSG_KBDIN */
+ uint8_t nch ; /* Number of characters received */
+ uint8_t ch[1]; /* Array of received characters */
};
#endif
+/* Request re-drawing of rectangular region */
+
+struct nxsvrmsg_redrawreq_s
+{
+ uint32_t msgid; /* NX_SVRMSG_REDRAWREQ */
+ FAR struct nxbe_window_s *wnd; /* The window to be redrawn */
+ struct nxgl_rect_s rect; /* Describes the rectangular region to be redrawn */
+};
+
/****************************************************************************
* Public Data
****************************************************************************/
diff --git a/nuttx/libnx/Makefile b/nuttx/libnx/Makefile
index 75b19aade..37a195996 100644
--- a/nuttx/libnx/Makefile
+++ b/nuttx/libnx/Makefile
@@ -57,6 +57,7 @@ include nxglib/Make.defs
include nx/Make.defs
include nxmu/Make.defs
include nxfonts/Make.defs
+include nxtk/Make.defs
BINDIR ?= bin
diff --git a/nuttx/libnx/nxmu/Make.defs b/nuttx/libnx/nxmu/Make.defs
index 2b316e772..ebf9c4f65 100644
--- a/nuttx/libnx/nxmu/Make.defs
+++ b/nuttx/libnx/nxmu/Make.defs
@@ -45,10 +45,11 @@ CSRCS += nxmu_semtake.c nx_block.c
CSRCS += nx_kbdchin.c nx_kbdin.c nx_mousein.c
CSRCS += nx_releasebkgd.c nx_requestbkgd.c nx_setbgcolor.c
-CSRCS += nxmu_sendwindow.c nx_closewindow.c nxmu_constructwindow.c
+CSRCS += nxmu_sendwindow.c nx_closewindow.c nx_constructwindow.c
CSRCS += nx_bitmap.c nx_fill.c nx_filltrapezoid.c nx_getposition.c
CSRCS += nx_getrectangle.c nx_lower.c nx_move.c nx_openwindow.c
-CSRCS += nx_raise.c nx_setpixel.c nx_setposition.c nx_setsize.c
+CSRCS += nx_raise.c nx_redrawreq.c nx_setpixel.c nx_setposition.c
+CSRCS += nx_setsize.c
# Add the nxmu/ directory to the build
diff --git a/nuttx/libnx/nxmu/nxmu_constructwindow.c b/nuttx/libnx/nxmu/nx_constructwindow.c
index e677c9eaa..888f5b608 100644
--- a/nuttx/libnx/nxmu/nxmu_constructwindow.c
+++ b/nuttx/libnx/nxmu/nx_constructwindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * libnx/nxmu/nx_openwindow.c
+ * libnx/nxmu/nx_constsructwindow.c
*
* Copyright (C) 2008, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -74,7 +74,7 @@
****************************************************************************/
/****************************************************************************
- * Name: nxfe_constructwindow
+ * Name: nx_constructwindow
*
* Description:
* This function is the same a nx_openwindow EXCEPT that the client provides
@@ -85,7 +85,7 @@
* are not visible to NX.
*
* NOTE: wnd must have been allocated using kmalloc() (or related allocators)
- * Once provided to nxfe_constructwindow() that memory is owned and managed
+ * Once provided to nx_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free the window.
*
@@ -101,8 +101,8 @@
*
****************************************************************************/
-int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
- FAR const struct nx_callback_s *cb, FAR void *arg)
+int nx_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
+ FAR const struct nx_callback_s *cb, FAR void *arg)
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
struct nxsvrmsg_openwindow_s outmsg;
diff --git a/nuttx/libnx/nxmu/nx_openwindow.c b/nuttx/libnx/nxmu/nx_openwindow.c
index c26a38087..0f331b9e5 100644
--- a/nuttx/libnx/nxmu/nx_openwindow.c
+++ b/nuttx/libnx/nxmu/nx_openwindow.c
@@ -112,9 +112,9 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb,
return NULL;
}
- /* Then let nxfe_constructwindow do the rest */
+ /* Then let nx_constructwindow do the rest */
- ret = nxfe_constructwindow(handle, wnd, cb, arg);
+ ret = nx_constructwindow(handle, wnd, cb, arg);
if (ret < 0)
{
/* An error occurred, the window has been freed */
diff --git a/nuttx/libnx/nxmu/nx_redrawreq.c b/nuttx/libnx/nxmu/nx_redrawreq.c
new file mode 100644
index 000000000..05ef8d071
--- /dev/null
+++ b/nuttx/libnx/nxmu/nx_redrawreq.c
@@ -0,0 +1,111 @@
+/****************************************************************************
+ * libnx/nxmu/nx_redrawreq.c
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/nx/nx.h>
+#include <nuttx/nx/nxbe.h>
+#include <nuttx/nx/nxmu.h>
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: nx_redrawreq
+ *
+ * Descripton:
+ * This will cause a NX re-draw callback to the client that owns the
+ * window. This is not normally called from user code, but may be
+ * used within middle-ware layers when redrawing is needed.
+ *
+ * Input Parameters:
+ * hwnd - Window handle
+ * rect - The rectangle that needs to be re-drawn (in window relative
+ * coordinates)
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void nx_redrawreq(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
+{
+ FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
+ struct nxsvrmsg_redrawreq_s outmsg;
+
+#ifdef CONFIG_DEBUG
+ if (!wnd || !rect)
+ {
+ set_errno(EINVAL);
+ return ERROR;
+ }
+#endif
+
+ /* Inform the server of the changed position */
+
+ outmsg.msgid = NX_SVRMSG_REDRAWREQ;
+ outmsg.wnd = wnd;
+ nxgl_rectcopy(&outmsg.rect, rect);
+
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_redrawreq_s));
+}
diff --git a/nuttx/graphics/nxtk/Make.defs b/nuttx/libnx/nxtk/Make.defs
index cc744309f..1800311be 100644
--- a/nuttx/graphics/nxtk/Make.defs
+++ b/nuttx/libnx/nxtk/Make.defs
@@ -1,7 +1,7 @@
############################################################################
-# graphics/nxtk/Make.defs
+# libnx/nxtk/Make.defs
#
-# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011, 2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -33,16 +33,28 @@
#
############################################################################
-NXTK_ASRCS =
-NXTKWIN_CSRCS = nxtk_openwindow.c nxtk_closewindow.c nxtk_getposition.c \
- nxtk_setposition.c nxtk_setsize.c nxtk_raise.c nxtk_lower.c \
- nxtk_fillwindow.c nxtk_getwindow.c nxtk_filltrapwindow.c \
- nxtk_movewindow.c nxtk_bitmapwindow.c nxtk_events.c \
- nxtk_setsubwindows.c nxtk_drawcirclewindow.c nxtk_drawlinewindow.c \
- nxtk_fillcirclewindow.c nxtk_block.c
-NXTKTB_CSRCS = nxtk_opentoolbar.c nxtk_closetoolbar.c nxtk_filltoolbar.c \
- nxtk_gettoolbar.c nxtk_filltraptoolbar.c nxtk_movetoolbar.c \
- nxtk_bitmaptoolbar.c nxtk_drawcircletoolbar.c nxtk_drawlinetoolbar.c \
- nxtk_fillcircletoolbar.c nxtk_toolbarbounds.c
-NXTK_CSRCS = $(NXTKWIN_CSRCS) $(NXTKTB_CSRCS) nxtk_subwindowclip.c \
- nxtk_containerclip.c nxtk_subwindowmove.c nxtk_drawframe.c
+# Expose NXTK interfaces to applications
+
+ifeq ($(CONFIG_NX),y)
+
+CSRCS += nxtk_openwindow.c nxtk_closewindow.c nxtk_getposition.c
+CSRCS += nxtk_setposition.c nxtk_setsize.c nxtk_raise.c nxtk_lower.c
+CSRCS += nxtk_fillwindow.c nxtk_getwindow.c nxtk_filltrapwindow.c
+CSRCS += nxtk_movewindow.c nxtk_bitmapwindow.c nxtk_events.c
+CSRCS += nxtk_setsubwindows.c nxtk_drawcirclewindow.c nxtk_drawlinewindow.c
+CSRCS += nxtk_fillcirclewindow.c nxtk_block.c
+
+CSRCS += nxtk_opentoolbar.c nxtk_closetoolbar.c nxtk_filltoolbar.c
+CSRCS += nxtk_gettoolbar.c nxtk_filltraptoolbar.c nxtk_movetoolbar.c
+CSRCS += nxtk_bitmaptoolbar.c nxtk_drawcircletoolbar.c nxtk_drawlinetoolbar.c
+CSRCS += nxtk_fillcircletoolbar.c nxtk_toolbarbounds.c
+
+CSRCS += nxtk_subwindowclip.c nxtk_containerclip.c nxtk_subwindowmove.c
+CSRCS += nxtk_drawframe.c
+
+# Add the nxtk/ directory to the build
+
+DEPPATH += --dep-path nxtk
+VPATH += :nxtk
+
+endif
diff --git a/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c b/nuttx/libnx/nxtk/nxtk_bitmaptoolbar.c
index 50bd5aff4..8f99267dc 100644
--- a/nuttx/graphics/nxtk/nxtk_bitmaptoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_bitmaptoolbar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_bitmaptoolbar.c
+ * libnx/nxtk/nxtk_bitmaptoolbar.c
*
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -104,7 +104,7 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest,
#ifdef CONFIG_DEBUG
if (!hfwnd || !dest || !src || !origin)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_bitmapwindow.c b/nuttx/libnx/nxtk/nxtk_bitmapwindow.c
index 6847c44d4..11956aeb1 100644
--- a/nuttx/graphics/nxtk/nxtk_bitmapwindow.c
+++ b/nuttx/libnx/nxtk/nxtk_bitmapwindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_bitmapwindow.c
+ * libnx/nxtk/nxtk_bitmapwindow.c
*
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -104,7 +104,7 @@ int nxtk_bitmapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest,
#ifdef CONFIG_DEBUG
if (!hfwnd || !dest || !src || !origin)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_block.c b/nuttx/libnx/nxtk/nxtk_block.c
index 11baf7f4f..3b089a74a 100644
--- a/nuttx/graphics/nxtk/nxtk_block.c
+++ b/nuttx/libnx/nxtk/nxtk_block.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_block.c
+ * libnx/nxtk/nxtk_block.c
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-
-#include "nxfe.h"
+#include <nuttx/nx/nxmu.h>
#ifdef CONFIG_NX_MULTIUSER
diff --git a/nuttx/graphics/nxtk/nxtk_closetoolbar.c b/nuttx/libnx/nxtk/nxtk_closetoolbar.c
index 7ad36f9d8..8f65a75a8 100644
--- a/nuttx/graphics/nxtk/nxtk_closetoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_closetoolbar.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_closetoolbar.c
+ * libnx/nxtk/nxtk_closetoolbar.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -102,10 +101,9 @@ int nxtk_closetoolbar(NXTKWINDOW hfwnd)
nxtk_setsubwindows(fwnd);
/* Then redraw the entire window, even the client window must be
- * redraw because it has changed its vertical position and size.
+ * redrawn because it has changed its vertical position and size.
*/
- nxfe_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds);
+ nx_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds);
return OK;
}
-
diff --git a/nuttx/graphics/nxtk/nxtk_closewindow.c b/nuttx/libnx/nxtk/nxtk_closewindow.c
index e80cd0c66..7bda3ff06 100644
--- a/nuttx/graphics/nxtk/nxtk_closewindow.c
+++ b/nuttx/libnx/nxtk/nxtk_closewindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_closewindow.c
+ * libnx/nxtk/nxtk_closewindow.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -92,4 +91,3 @@ int nxtk_closewindow(NXTKWINDOW hfwnd)
{
return nx_closewindow((NXWINDOW)hfwnd);
}
-
diff --git a/nuttx/graphics/nxtk/nxtk_containerclip.c b/nuttx/libnx/nxtk/nxtk_containerclip.c
index a2fbcd0f8..12dc4987b 100644
--- a/nuttx/graphics/nxtk/nxtk_containerclip.c
+++ b/nuttx/libnx/nxtk/nxtk_containerclip.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_containerclip.c
+ * libnx/nxtk/nxtk_containerclip.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_drawcircletoolbar.c b/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c
index a36ed32ee..99b1094b7 100644
--- a/nuttx/graphics/nxtk/nxtk_drawcircletoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_drawcircletoolbar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_drawcircletoolbar.c
+ * libnx/nxtk/nxtk_drawcircletoolbar.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_drawcirclewindow.c b/nuttx/libnx/nxtk/nxtk_drawcirclewindow.c
index 080e802ec..be6bc713f 100644
--- a/nuttx/graphics/nxtk/nxtk_drawcirclewindow.c
+++ b/nuttx/libnx/nxtk/nxtk_drawcirclewindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_drawcirclewindow.c
+ * libnx/nxtk/nxtk_drawcirclewindow.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_drawframe.c b/nuttx/libnx/nxtk/nxtk_drawframe.c
index 91745b323..e30377dd3 100644
--- a/nuttx/graphics/nxtk/nxtk_drawframe.c
+++ b/nuttx/libnx/nxtk/nxtk_drawframe.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_drawframe.c
+ * libnx/nxtk/nxtk_drawframe.c
*
- * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_drawlinetoolbar.c b/nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c
index f2a559d69..6a975536a 100644
--- a/nuttx/graphics/nxtk/nxtk_drawlinetoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_drawlinetoolbar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_drawlinetoolbar.c
+ * libnx/nxtk/nxtk_drawlinetoolbar.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_drawlinewindow.c b/nuttx/libnx/nxtk/nxtk_drawlinewindow.c
index a5534fa59..ba45a2dc8 100644
--- a/nuttx/graphics/nxtk/nxtk_drawlinewindow.c
+++ b/nuttx/libnx/nxtk/nxtk_drawlinewindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_drawlinewindow.c
+ * libnx/nxtk/nxtk_drawlinewindow.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_events.c b/nuttx/libnx/nxtk/nxtk_events.c
index facf92176..513bc98a8 100644
--- a/nuttx/graphics/nxtk/nxtk_events.c
+++ b/nuttx/libnx/nxtk/nxtk_events.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_events.c
+ * libnx/nxtk/nxtk_events.c
*
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_fillcircletoolbar.c b/nuttx/libnx/nxtk/nxtk_fillcircletoolbar.c
index 92dee7e27..b4ec94edd 100644
--- a/nuttx/graphics/nxtk/nxtk_fillcircletoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_fillcircletoolbar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_fillcircletoolbar.c
+ * libnx/nxtk/nxtk_fillcircletoolbar.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_fillcirclewindow.c b/nuttx/libnx/nxtk/nxtk_fillcirclewindow.c
index 5f093e035..ee59ace1e 100644
--- a/nuttx/graphics/nxtk/nxtk_fillcirclewindow.c
+++ b/nuttx/libnx/nxtk/nxtk_fillcirclewindow.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_fillcirclewindow.c
+ * libnx/nxtk/nxtk_fillcirclewindow.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_filltoolbar.c b/nuttx/libnx/nxtk/nxtk_filltoolbar.c
index 931fa7dec..13de37249 100644
--- a/nuttx/graphics/nxtk/nxtk_filltoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_filltoolbar.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_filltoolbar.c
+ * libnx/nxtk/nxtk_filltoolbar.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -98,7 +97,7 @@ int nxtk_filltoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
#ifdef CONFIG_DEBUG
if (!hfwnd || !rect || !color)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_filltraptoolbar.c b/nuttx/libnx/nxtk/nxtk_filltraptoolbar.c
index 7108f42eb..a55d05e7e 100644
--- a/nuttx/graphics/nxtk/nxtk_filltraptoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_filltraptoolbar.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_filltraptoolbar.c
+ * libnx/nxtk/nxtk_filltraptoolbar.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -89,8 +88,9 @@
*
****************************************************************************/
-int nxtk_filltraptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *trap,
- nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
+int nxtk_filltraptoolbar(NXTKWINDOW hfwnd,
+ FAR const struct nxgl_trapezoid_s *trap,
+ nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd;
struct nxgl_rect_s relclip;
@@ -98,13 +98,14 @@ int nxtk_filltraptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tr
#ifdef CONFIG_DEBUG
if (!hfwnd || !trap || !color)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
/* Perform the fill, clipping to the client window */
- nxgl_rectoffset(&relclip, &fwnd->tbrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
+ nxgl_rectoffset(&relclip, &fwnd->tbrect, -fwnd->wnd.bounds.pt1.x,
+ -fwnd->wnd.bounds.pt1.y);
return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, trap, color);
}
diff --git a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c b/nuttx/libnx/nxtk/nxtk_filltrapwindow.c
index 55c051ffd..e28f0d3bc 100644
--- a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c
+++ b/nuttx/libnx/nxtk/nxtk_filltrapwindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_filltrapwindow.c
+ * libnx/nxtk/nxtk_filltrapwindow.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -89,7 +88,8 @@
*
****************************************************************************/
-int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *trap,
+int nxtk_filltrapwindow(NXTKWINDOW hfwnd,
+ FAR const struct nxgl_trapezoid_s *trap,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd;
@@ -99,7 +99,7 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
#ifdef CONFIG_DEBUG
if (!hfwnd || !trap || !color)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
@@ -111,7 +111,9 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
fwnd->fwrect.pt1.y - fwnd->wnd.bounds.pt1.y);
/* Perform the fill, clipping to the client window */
- nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
+
+ nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.bounds.pt1.x,
+ -fwnd->wnd.bounds.pt1.y);
return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, &reltrap, color);
}
diff --git a/nuttx/graphics/nxtk/nxtk_fillwindow.c b/nuttx/libnx/nxtk/nxtk_fillwindow.c
index c76dbfbb4..77f043391 100644
--- a/nuttx/graphics/nxtk/nxtk_fillwindow.c
+++ b/nuttx/libnx/nxtk/nxtk_fillwindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_fillwindow.c
+ * libnx/nxtk/nxtk_fillwindow.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -98,7 +97,7 @@ int nxtk_fillwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
#ifdef CONFIG_DEBUG
if (!hfwnd || !rect || !color)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_getposition.c b/nuttx/libnx/nxtk/nxtk_getposition.c
index 7850f7714..a0b21bedb 100644
--- a/nuttx/graphics/nxtk/nxtk_getposition.c
+++ b/nuttx/libnx/nxtk/nxtk_getposition.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_getposition.c
+ * libnx/nxtk/nxtk_getposition.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_gettoolbar.c b/nuttx/libnx/nxtk/nxtk_gettoolbar.c
index 5b08fc840..a83a1aa3e 100644
--- a/nuttx/graphics/nxtk/nxtk_gettoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_gettoolbar.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_gettoolbar.c
+ * libnx/nxtk/nxtk_gettoolbar.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_getwindow.c b/nuttx/libnx/nxtk/nxtk_getwindow.c
index b0082874f..a91ad05fc 100644
--- a/nuttx/graphics/nxtk/nxtk_getwindow.c
+++ b/nuttx/libnx/nxtk/nxtk_getwindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_getwindow.c
+ * libnx/nxtk/nxtk_getwindow.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_internal.h b/nuttx/libnx/nxtk/nxtk_internal.h
index 3a31215d8..7a6229341 100644
--- a/nuttx/graphics/nxtk/nxtk_internal.h
+++ b/nuttx/libnx/nxtk/nxtk_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_internal.h
+ * libnx/nxtk/nxtk_internal.h
*
- * Copyright (C) 2008-2009, 2011-1021 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __GRAPHICS_NXTK_NXTK_INTERNAL_H
-#define __GRAPHICS_NXTK_NXTK_INTERNAL_H
+#ifndef __LIBNX_NXTK_NXTK_INTERNAL_H
+#define __LIBNX_NXTK_NXTK_INTERNAL_H
/****************************************************************************
* Included Files
@@ -42,9 +42,8 @@
#include <nuttx/config.h>
+#include <nuttx/nx/nxbe.h>
#include <nuttx/nx/nxtk.h>
-#include "nxbe.h"
-#include "nxfe.h"
/****************************************************************************
* Pre-processor definitions
@@ -86,20 +85,21 @@ struct nxtk_framedwindow_s
#undef EXTERN
#if defined(__cplusplus)
# define EXTERN extern "C"
-extern "C" {
+extern "C"
+{
#else
# define EXTERN extern
#endif
/* That is the callback for the framed window */
-extern FAR const struct nx_callback_s g_nxtkcb;
+EXTERN FAR const struct nx_callback_s g_nxtkcb;
/* Frame border colors */
-extern nxgl_mxpixel_t g_bordercolor1[CONFIG_NX_NPLANES];
-extern nxgl_mxpixel_t g_bordercolor2[CONFIG_NX_NPLANES];
-extern nxgl_mxpixel_t g_bordercolor3[CONFIG_NX_NPLANES];
+EXTERN nxgl_mxpixel_t g_bordercolor1[CONFIG_NX_NPLANES];
+EXTERN nxgl_mxpixel_t g_bordercolor2[CONFIG_NX_NPLANES];
+EXTERN nxgl_mxpixel_t g_bordercolor3[CONFIG_NX_NPLANES];
/****************************************************************************
* Public Function Prototypes
@@ -115,7 +115,7 @@ extern nxgl_mxpixel_t g_bordercolor3[CONFIG_NX_NPLANES];
*
****************************************************************************/
-EXTERN void nxtk_setsubwindows(FAR struct nxtk_framedwindow_s *fwnd);
+void nxtk_setsubwindows(FAR struct nxtk_framedwindow_s *fwnd);
/****************************************************************************
* Name: nxtk_subwindowclip
@@ -136,10 +136,10 @@ EXTERN void nxtk_setsubwindows(FAR struct nxtk_framedwindow_s *fwnd);
*
****************************************************************************/
-EXTERN void nxtk_subwindowclip(FAR struct nxtk_framedwindow_s *fwnd,
- FAR struct nxgl_rect_s *dest,
- FAR const struct nxgl_rect_s *src,
- FAR const struct nxgl_rect_s *bounds);
+void nxtk_subwindowclip(FAR struct nxtk_framedwindow_s *fwnd,
+ FAR struct nxgl_rect_s *dest,
+ FAR const struct nxgl_rect_s *src,
+ FAR const struct nxgl_rect_s *bounds);
/****************************************************************************
* Name: nxtk_containerclip
@@ -154,7 +154,7 @@ EXTERN void nxtk_subwindowclip(FAR struct nxtk_framedwindow_s *fwnd,
*
* Input parameters:
* fwnd - The framed window to be used
- * dest - The locaton to put the result
+ * dest - The location to put the result
* src - The src rectangle in relative container-window coordinates
* bounds - The subwindow bounds in absolute screen coordinates.
*
@@ -163,21 +163,21 @@ EXTERN void nxtk_subwindowclip(FAR struct nxtk_framedwindow_s *fwnd,
*
****************************************************************************/
-EXTERN void nxtk_containerclip(FAR struct nxtk_framedwindow_s *fwnd,
- FAR struct nxgl_rect_s *dest,
- FAR const struct nxgl_rect_s *src,
- FAR const struct nxgl_rect_s *bounds);
+void nxtk_containerclip(FAR struct nxtk_framedwindow_s *fwnd,
+ FAR struct nxgl_rect_s *dest,
+ FAR const struct nxgl_rect_s *src,
+ FAR const struct nxgl_rect_s *bounds);
/****************************************************************************
* Name: nxtk_subwindowmove
*
* Description:
- * Perform common clipping operations in preparatons for calling nx_move()
+ * Perform common clipping operations in preparation for calling nx_move()
*
* Input Parameters:
* fwnd - The framed window within which the move is to be done.
* This must have been previously created by nxtk_openwindow().
- * destrect - The loccation to receive the clipped rectangle relative
+ * destrect - The location to receive the clipped rectangle relative
* to containing window
* destoffset - The location to received the clipped offset.
* srcrect - Describes the rectangular region relative to the client
@@ -190,12 +190,12 @@ EXTERN void nxtk_containerclip(FAR struct nxtk_framedwindow_s *fwnd,
*
****************************************************************************/
-EXTERN void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd,
- FAR struct nxgl_rect_s *destrect,
- FAR struct nxgl_point_s *destoffset,
- FAR const struct nxgl_rect_s *srcrect,
- FAR const struct nxgl_point_s *srcoffset,
- FAR const struct nxgl_rect_s *bounds);
+void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd,
+ FAR struct nxgl_rect_s *destrect,
+ FAR struct nxgl_point_s *destoffset,
+ FAR const struct nxgl_rect_s *srcrect,
+ FAR const struct nxgl_point_s *srcoffset,
+ FAR const struct nxgl_rect_s *bounds);
/****************************************************************************
* Name: nxtk_drawframe
@@ -214,12 +214,12 @@ EXTERN void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd,
*
****************************************************************************/
-EXTERN int nxtk_drawframe(FAR struct nxtk_framedwindow_s *fwnd,
- FAR const struct nxgl_rect_s *bounds);
+int nxtk_drawframe(FAR struct nxtk_framedwindow_s *fwnd,
+ FAR const struct nxgl_rect_s *bounds);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
-#endif /* __GRAPHICS_NXTK_NXTK_INTERNAL_H */
+#endif /* __LIBNX_NXTK_NXTK_INTERNAL_H */
diff --git a/nuttx/graphics/nxtk/nxtk_lower.c b/nuttx/libnx/nxtk/nxtk_lower.c
index e37e020fc..de26ac509 100644
--- a/nuttx/graphics/nxtk/nxtk_lower.c
+++ b/nuttx/libnx/nxtk/nxtk_lower.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_lower.c
+ * libnx/nxtk/nxtk_lower.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -81,8 +80,8 @@
* bottom of the display.
*
* Input parameters:
- * hfwnd - the window to be lowered. This must have been previously created
- * by nxtk_openwindow().
+ * hfwnd - the window to be lowered. This must have been previously
+ * created by nxtk_openwindow().
*
* Returned value:
* OK on success; ERROR on failure with errno set appropriately
diff --git a/nuttx/graphics/nxtk/nxtk_movetoolbar.c b/nuttx/libnx/nxtk/nxtk_movetoolbar.c
index 9170394f1..b5f05c096 100644
--- a/nuttx/graphics/nxtk/nxtk_movetoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_movetoolbar.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_movetoolbar.c
+ * libnx/nxtk/nxtk_movetoolbar.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -77,7 +76,8 @@
* Name: nxtk_movetoolbar
*
* Description:
- * Move a rectangular region within the toolbar sub-window of a framed window
+ * Move a rectangular region within the toolbar sub-window of a framed
+ * window
*
* Input Parameters:
* hfwnd - The sub-window containing the toolbar within which the move is
@@ -102,7 +102,7 @@ int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
#ifdef CONFIG_DEBUG
if (!hfwnd || !rect || !offset)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_movewindow.c b/nuttx/libnx/nxtk/nxtk_movewindow.c
index 83d95b3a4..f9bbbac41 100644
--- a/nuttx/graphics/nxtk/nxtk_movewindow.c
+++ b/nuttx/libnx/nxtk/nxtk_movewindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_movewindow.c
+ * libnx/nxtk/nxtk_movewindow.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -77,7 +76,8 @@
* Name: nxtk_movewindow
*
* Description:
- * Move a rectangular region within the client sub-window of a framed window
+ * Move a rectangular region within the client sub-window of a framed
+ * window
*
* Input Parameters:
* hfwnd - The client sub-window within which the move is to be done.
@@ -101,7 +101,7 @@ int nxtk_movewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
#ifdef CONFIG_DEBUG
if (!hfwnd || !rect || !offset)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_opentoolbar.c b/nuttx/libnx/nxtk/nxtk_opentoolbar.c
index e82dbed6f..ffdf62901 100644
--- a/nuttx/graphics/nxtk/nxtk_opentoolbar.c
+++ b/nuttx/libnx/nxtk/nxtk_opentoolbar.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_opentoolbar.c
+ * libnx/nxtk/nxtk_opentoolbar.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -80,10 +79,11 @@
* Create a tool bar at the top of the specified framed window
*
* Input Parameters:
- * hfwnd - The handle returned by nxtk_openwindow
+ * hfwnd - The handle returned by nxtk_openwindow
* height - The request height of the toolbar in pixels
* cb - Callbacks used to process toolbar events
- * arg - User provided value that will be returned with toolbar callbacks.
+ * arg - User provided value that will be returned with toolbar
+ * callbacks.
*
* Return:
* OK on success; ERROR on failure with errno set appropriately
@@ -99,7 +99,7 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
#ifdef CONFIG_DEBUG
if (!hfwnd || !cb)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
@@ -118,10 +118,9 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
* redrawn because it has changed its vertical position and size.
*/
- nxfe_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds);
+ nx_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds);
/* Return the initialized toolbar reference */
return OK;
}
-
diff --git a/nuttx/graphics/nxtk/nxtk_openwindow.c b/nuttx/libnx/nxtk/nxtk_openwindow.c
index 0c77a6877..fc7ddd869 100644
--- a/nuttx/graphics/nxtk/nxtk_openwindow.c
+++ b/nuttx/libnx/nxtk/nxtk_openwindow.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_openwindow.c
+ * libnx/nxtk/nxtk_openwindow.c
*
- * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -44,9 +44,8 @@
#include <debug.h>
#include <nuttx/nx/nx.h>
-#include <nuttx/kmalloc.h>
-#include "nxfe.h"
+#include "nxcontext.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -124,17 +123,19 @@ NXTKWINDOW nxtk_openwindow(NXHANDLE handle,
#ifdef CONFIG_DEBUG
if (!handle || !cb)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return NULL;
}
#endif
/* Pre-allocate the window structure */
- fwnd = (FAR struct nxtk_framedwindow_s *)kzalloc(sizeof(struct nxtk_framedwindow_s));
+ fwnd = (FAR struct nxtk_framedwindow_s *)
+ lib_zalloc(sizeof(struct nxtk_framedwindow_s));
+
if (!fwnd)
{
- errno = ENOMEM;
+ set_errno(ENOMEM);
return NULL;
}
@@ -143,9 +144,9 @@ NXTKWINDOW nxtk_openwindow(NXHANDLE handle,
fwnd->fwcb = cb;
fwnd->fwarg = arg;
- /* Then let nxfe_constructwindow do the rest */
+ /* Then let nx_constructwindow do the rest */
- ret = nxfe_constructwindow(handle, &fwnd->wnd, &g_nxtkcb, NULL);
+ ret = nx_constructwindow(handle, &fwnd->wnd, &g_nxtkcb, NULL);
if (ret < 0)
{
/* An error occurred, the window has been freed */
diff --git a/nuttx/graphics/nxtk/nxtk_raise.c b/nuttx/libnx/nxtk/nxtk_raise.c
index f20b25899..2b54f81cb 100644
--- a/nuttx/graphics/nxtk/nxtk_raise.c
+++ b/nuttx/libnx/nxtk/nxtk_raise.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_raise.c
+ * libnx/nxtk/nxtk_raise.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -81,8 +80,8 @@
* of the display.
*
* Input parameters:
- * hfwnd - the window to be raised. This must have been previously created
- * by nxtk_openwindow().
+ * hfwnd - the window to be raised. This must have been previously
+ * created by nxtk_openwindow().
*
* Returned value:
* OK on success; ERROR on failure with errno set appropriately
diff --git a/nuttx/graphics/nxtk/nxtk_setposition.c b/nuttx/libnx/nxtk/nxtk_setposition.c
index 2a2a60665..f3ba11872 100644
--- a/nuttx/graphics/nxtk/nxtk_setposition.c
+++ b/nuttx/libnx/nxtk/nxtk_setposition.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_setposition.c
+ * libnx/nxtk/nxtk_setposition.c
*
- * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_setsize.c b/nuttx/libnx/nxtk/nxtk_setsize.c
index 332ea00b5..671aa8054 100644
--- a/nuttx/graphics/nxtk/nxtk_setsize.c
+++ b/nuttx/libnx/nxtk/nxtk_setsize.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_setsize.c
+ * libnx/nxtk/nxtk_setsize.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -98,7 +97,7 @@ int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size)
#ifdef CONFIG_DEBUG
if (!hfwnd || !size)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxtk/nxtk_setsubwindows.c b/nuttx/libnx/nxtk/nxtk_setsubwindows.c
index 143909ea4..e528f43e9 100644
--- a/nuttx/graphics/nxtk/nxtk_setsubwindows.c
+++ b/nuttx/libnx/nxtk/nxtk_setsubwindows.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * graphics/nxtk/nxtk_setsubwindows.c
+ * libnx/nxtk/nxtk_setsubwindows.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
diff --git a/nuttx/graphics/nxtk/nxtk_subwindowclip.c b/nuttx/libnx/nxtk/nxtk_subwindowclip.c
index 2dbefb648..b2688a543 100644
--- a/nuttx/graphics/nxtk/nxtk_subwindowclip.c
+++ b/nuttx/libnx/nxtk/nxtk_subwindowclip.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_subwindowclip.c
+ * libnx/nxtk/nxtk_subwindowclip.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
diff --git a/nuttx/graphics/nxtk/nxtk_subwindowmove.c b/nuttx/libnx/nxtk/nxtk_subwindowmove.c
index 3c2bb7f37..6ae737b58 100644
--- a/nuttx/graphics/nxtk/nxtk_subwindowmove.c
+++ b/nuttx/libnx/nxtk/nxtk_subwindowmove.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_subwindowmove.c
+ * libnx/nxtk/nxtk_subwindowmove.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -141,9 +140,10 @@ void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd,
}
- /* Then move the rectangle so that is relative to the containing window, not the
- * client subwindow
+ /* Then move the rectangle so that is relative to the containing window,
+ * not the client subwindow
*/
- nxgl_rectoffset(destrect, &abssrc, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
+ nxgl_rectoffset(destrect, &abssrc, -fwnd->wnd.bounds.pt1.x,
+ -fwnd->wnd.bounds.pt1.y);
}
diff --git a/nuttx/graphics/nxtk/nxtk_toolbarbounds.c b/nuttx/libnx/nxtk/nxtk_toolbarbounds.c
index ee49cb504..2f5991d70 100644
--- a/nuttx/graphics/nxtk/nxtk_toolbarbounds.c
+++ b/nuttx/libnx/nxtk/nxtk_toolbarbounds.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * graphics/nxtk/nxtk_toolbarbounds.c
+ * libnx/nxtk/nxtk_toolbarbounds.c
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,6 @@
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxtk.h>
-#include "nxfe.h"
#include "nxtk_internal.h"
/****************************************************************************
@@ -104,4 +103,3 @@ int nxtk_toolbarbounds(NXTKWINDOW hfwnd, FAR struct nxgl_rect_s *bounds)
-fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
return OK;
}
-