summaryrefslogtreecommitdiff
path: root/nuttx/graphics/nxsu
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 /nuttx/graphics/nxsu
parentca596c87bd2de1e98e124b717681758301145787 (diff)
downloadnuttx-212ec1530e550b6d4a4a5088dc45a8f8315e3e20.tar.gz
nuttx-212ec1530e550b6d4a4a5088dc45a8f8315e3e20.tar.bz2
nuttx-212ec1530e550b6d4a4a5088dc45a8f8315e3e20.zip
Move graphics/nxtk to libnx/nxtk
Diffstat (limited to 'nuttx/graphics/nxsu')
-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
6 files changed, 106 insertions, 45 deletions
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);
}
}
-
-