2011-07-08 18:36:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* examples/nxtext/nxtext_popup.c
|
|
|
|
*
|
2012-05-13 17:14:53 +02:00
|
|
|
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
2011-07-08 18:36:26 +02:00
|
|
|
*
|
|
|
|
* 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 <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
2011-07-08 20:21:04 +02:00
|
|
|
#include <string.h>
|
2011-07-08 18:36:26 +02:00
|
|
|
#include <semaphore.h>
|
|
|
|
#include <errno.h>
|
2011-07-10 21:56:07 +02:00
|
|
|
#include <debug.h>
|
2011-07-08 18:36:26 +02:00
|
|
|
|
2011-07-24 22:49:01 +02:00
|
|
|
#include <nuttx/nx/nx.h>
|
|
|
|
#include <nuttx/nx/nxfonts.h>
|
2011-07-08 18:36:26 +02:00
|
|
|
|
|
|
|
#include "nxtext_internal.h"
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-10-02 22:06:11 +02:00
|
|
|
* Pre-processor Definitions
|
2011-07-08 18:36:26 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#define NBM_CACHE 8
|
|
|
|
#define NGLYPH_CACHE 8
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
static void nxpu_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
|
2011-07-08 18:36:26 +02:00
|
|
|
bool morem, FAR void *arg);
|
2011-07-08 20:21:04 +02:00
|
|
|
static void nxpu_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
|
2011-07-08 18:36:26 +02:00
|
|
|
FAR const struct nxgl_point_s *pos,
|
|
|
|
FAR const struct nxgl_rect_s *bounds,
|
|
|
|
FAR void *arg);
|
2014-07-17 00:31:31 +02:00
|
|
|
#ifdef CONFIG_NX_XYINPUT
|
2011-07-08 20:21:04 +02:00
|
|
|
static void nxpu_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
|
2011-07-08 18:36:26 +02:00
|
|
|
uint8_t buttons, FAR void *arg);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_NX_KBD
|
|
|
|
static void nxpu_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
|
2011-07-08 20:21:04 +02:00
|
|
|
FAR void *arg);
|
2011-07-08 18:36:26 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/* Pop-up NX callbacks */
|
|
|
|
|
2011-07-08 18:36:26 +02:00
|
|
|
static const struct nx_callback_s g_pucb =
|
|
|
|
{
|
|
|
|
nxpu_redraw, /* redraw */
|
|
|
|
nxpu_position /* position */
|
2014-07-17 00:31:31 +02:00
|
|
|
#ifdef CONFIG_NX_XYINPUT
|
2011-07-08 18:36:26 +02:00
|
|
|
, nxpu_mousein /* mousein */
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_NX_KBD
|
2019-03-25 20:01:52 +01:00
|
|
|
, nxpu_kbdin /* kbdin */
|
2011-07-08 18:36:26 +02:00
|
|
|
#endif
|
2019-03-25 20:01:52 +01:00
|
|
|
, NULL /* event */
|
2011-07-08 18:36:26 +02:00
|
|
|
};
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/* Pop-up state information */
|
|
|
|
|
2011-07-08 18:36:26 +02:00
|
|
|
static struct nxtext_state_s g_pustate;
|
|
|
|
#ifdef CONFIG_NX_KBD
|
|
|
|
static struct nxtext_bitmap_s g_pubm[NBM_CACHE];
|
|
|
|
static struct nxtext_glyph_s g_puglyph[NGLYPH_CACHE];
|
|
|
|
#endif
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/* Some random numbers */
|
|
|
|
|
|
|
|
static const uint8_t g_rand8[9] =
|
|
|
|
{
|
|
|
|
0x18, 0x8d, 0x60, 0x42, 0xb7, 0xc2, 0x2d, 0xea, 0x6b
|
|
|
|
};
|
|
|
|
|
2011-07-08 18:36:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_randpos
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static fb_coord_t nxpu_randpos(fb_coord_t value)
|
|
|
|
{
|
|
|
|
static uint8_t ndx = 0;
|
|
|
|
uint8_t rand8 = g_rand8[ndx];
|
|
|
|
|
|
|
|
if (++ndx >= 9)
|
|
|
|
{
|
|
|
|
ndx = 0;
|
|
|
|
}
|
2014-04-14 00:24:28 +02:00
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
return (fb_coord_t)(((uint32_t)value * (uint32_t)rand8) >> 8);
|
|
|
|
}
|
|
|
|
|
2011-07-08 18:36:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_setsize
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
static inline int nxpu_setsize(NXWINDOW hwnd, FAR struct nxgl_size_s *size)
|
2011-07-08 18:36:26 +02:00
|
|
|
{
|
|
|
|
int ret = nx_setsize(hwnd, size);
|
|
|
|
if (ret < 0)
|
|
|
|
{
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_setsize: nx_setsize failed: %d\n", errno);
|
2011-07-08 18:36:26 +02:00
|
|
|
g_exitcode = NXEXIT_NXSETSIZE;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_setposition
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
static inline int nxpu_setposition(NXWINDOW hwnd, FAR struct nxgl_point_s *pos)
|
2011-07-08 18:36:26 +02:00
|
|
|
{
|
|
|
|
int ret = nx_setposition(hwnd, pos);
|
|
|
|
if (ret < 0)
|
|
|
|
{
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_setposition: nx_setposition failed: %d\n", errno);
|
2011-07-08 18:36:26 +02:00
|
|
|
g_exitcode = NXEXIT_NXSETPOSITION;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_fillwindow
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
static inline void nxpu_fillwindow(NXWINDOW hwnd,
|
2011-07-08 18:36:26 +02:00
|
|
|
FAR const struct nxgl_rect_s *rect,
|
|
|
|
FAR struct nxtext_state_s *st)
|
|
|
|
{
|
|
|
|
int ret;
|
2014-11-25 17:32:54 +01:00
|
|
|
#ifdef CONFIG_NX_KBD
|
2011-07-08 18:36:26 +02:00
|
|
|
int i;
|
2014-11-25 17:32:54 +01:00
|
|
|
#endif
|
2011-07-08 18:36:26 +02:00
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
ret = nx_fill(hwnd, rect, st->wcolor);
|
2011-07-08 18:36:26 +02:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_fillwindow: nx_fill failed: %d\n", errno);
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Fill each character on the display (Only the characters within rect
|
|
|
|
* will actually be redrawn).
|
|
|
|
*/
|
|
|
|
|
2011-07-08 22:55:49 +02:00
|
|
|
#ifdef CONFIG_NX_KBD
|
2011-07-08 18:36:26 +02:00
|
|
|
nxtext_home(st);
|
|
|
|
for (i = 0; i < st->nchars; i++)
|
|
|
|
{
|
2011-07-27 16:43:45 +02:00
|
|
|
nxtext_fillchar(hwnd, rect, st, g_puhfont, &st->bm[i]);
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
2011-07-08 22:55:49 +02:00
|
|
|
#endif
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_redraw
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
static void nxpu_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
|
2011-07-08 18:36:26 +02:00
|
|
|
bool more, FAR void *arg)
|
|
|
|
{
|
|
|
|
FAR struct nxtext_state_s *st = (FAR struct nxtext_state_s *)arg;
|
2016-06-11 19:55:38 +02:00
|
|
|
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
|
2011-07-08 18:36:26 +02:00
|
|
|
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
|
|
|
|
more ? "true" : "false");
|
|
|
|
|
|
|
|
nxpu_fillwindow(hwnd, rect, st);
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_position
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
static void nxpu_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
|
2011-07-08 18:36:26 +02:00
|
|
|
FAR const struct nxgl_point_s *pos,
|
|
|
|
FAR const struct nxgl_rect_s *bounds,
|
|
|
|
FAR void *arg)
|
|
|
|
{
|
|
|
|
FAR struct nxtext_state_s *st = (FAR struct nxtext_state_s *)arg;
|
|
|
|
|
|
|
|
/* Report the position */
|
|
|
|
|
2016-06-11 19:55:38 +02:00
|
|
|
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
|
2011-07-10 21:56:07 +02:00
|
|
|
hwnd, size->w, size->h, pos->x, pos->y,
|
|
|
|
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
|
2011-07-08 18:36:26 +02:00
|
|
|
|
2011-07-08 22:55:49 +02:00
|
|
|
/* Save the window position and size */
|
|
|
|
|
|
|
|
st->wpos.x = pos->x;
|
|
|
|
st->wpos.y = pos->y;
|
2011-07-08 18:36:26 +02:00
|
|
|
|
|
|
|
st->wsize.w = size->w;
|
|
|
|
st->wsize.h = size->h;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_mousein
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-07-17 00:31:31 +02:00
|
|
|
#ifdef CONFIG_NX_XYINPUT
|
2011-07-08 20:21:04 +02:00
|
|
|
static void nxpu_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
|
2011-07-08 18:36:26 +02:00
|
|
|
uint8_t buttons, FAR void *arg)
|
|
|
|
{
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_mousein: hwnd=%p pos=(%d,%d) button=%02x\n",
|
|
|
|
hwnd, pos->x, pos->y, buttons);
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_puts
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static inline void nxpu_puts(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
|
|
|
|
uint8_t nch, FAR const uint8_t *ch)
|
|
|
|
{
|
|
|
|
nxtext_home(st);
|
|
|
|
while (nch--)
|
|
|
|
{
|
2011-07-27 16:43:45 +02:00
|
|
|
nxtext_putc(hwnd, st, g_puhfont, *ch++);
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_kbdin
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NX_KBD
|
|
|
|
static void nxpu_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
|
|
|
|
FAR void *arg)
|
|
|
|
{
|
|
|
|
FAR struct nxtext_state_s *st = (FAR struct nxtext_state_s *)arg;
|
2016-06-11 19:55:38 +02:00
|
|
|
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
|
2011-07-08 18:36:26 +02:00
|
|
|
nxpu_puts(hwnd, st, nch, ch);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_initstate
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static inline void nxpu_initstate(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_NX_KBD
|
|
|
|
FAR const struct nx_font_s *fontset;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Initialize the color (used for redrawing the window) */
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
memset(&g_pustate, 0, sizeof(struct nxtext_state_s));
|
2011-07-08 18:36:26 +02:00
|
|
|
g_pustate.wcolor[0] = CONFIG_EXAMPLES_NXTEXT_PUCOLOR;
|
|
|
|
g_pustate.fcolor[0] = CONFIG_EXAMPLES_NXTEXT_PUFONTCOLOR;
|
|
|
|
|
|
|
|
/* Get information about the font set being used and save this in the
|
|
|
|
* state structure
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef CONFIG_NX_KBD
|
2011-07-27 16:43:45 +02:00
|
|
|
fontset = nxf_getfontset(g_puhfont);
|
2011-07-08 18:36:26 +02:00
|
|
|
g_pustate.fheight = fontset->mxheight;
|
|
|
|
g_pustate.fwidth = fontset->mxwidth;
|
|
|
|
g_pustate.spwidth = fontset->spwidth;
|
|
|
|
|
|
|
|
/* Set up the text caches */
|
|
|
|
|
|
|
|
g_pustate.maxchars = NBM_CACHE;
|
|
|
|
g_pustate.maxglyphs = NGLYPH_CACHE;
|
|
|
|
g_pustate.bm = g_pubm;
|
|
|
|
g_pustate.glyph = g_puglyph;
|
|
|
|
|
|
|
|
/* Set the first display position */
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
nxtext_home(&g_pustate);
|
2011-07-08 18:36:26 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_open
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
NXWINDOW nxpu_open(void)
|
2011-07-08 18:36:26 +02:00
|
|
|
{
|
2011-07-08 20:21:04 +02:00
|
|
|
NXWINDOW hwnd;
|
2011-07-08 18:36:26 +02:00
|
|
|
struct nxgl_size_s size;
|
|
|
|
struct nxgl_point_s pt;
|
2011-07-08 20:21:04 +02:00
|
|
|
int ret;
|
2011-07-08 18:36:26 +02:00
|
|
|
|
|
|
|
/* Create a pop-up window */
|
|
|
|
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_open: Create pop-up\n");
|
2011-07-08 18:36:26 +02:00
|
|
|
nxpu_initstate();
|
|
|
|
|
2019-03-13 19:32:54 +01:00
|
|
|
hwnd = nx_openwindow(g_hnx, 0, &g_pucb, (FAR void *)&g_pustate);
|
2016-06-11 19:55:38 +02:00
|
|
|
ginfo("hwnd=%p\n", hwnd);
|
2011-07-08 18:36:26 +02:00
|
|
|
|
|
|
|
if (!hwnd)
|
|
|
|
{
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_open: nx_openwindow failed: %d\n", errno);
|
2011-07-08 18:36:26 +02:00
|
|
|
g_exitcode = NXEXIT_NXOPENWINDOW;
|
2011-07-08 20:21:04 +02:00
|
|
|
goto errout_with_state;
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/* Select the size of the pop-up window */
|
2011-07-08 18:36:26 +02:00
|
|
|
|
|
|
|
size.w = g_xres / 4;
|
|
|
|
size.h = g_yres / 4;
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/* Select a random position for pop-up window */
|
|
|
|
|
|
|
|
pt.x = nxpu_randpos(g_xres - size.w);
|
|
|
|
pt.y = nxpu_randpos(g_yres - size.h);
|
|
|
|
|
|
|
|
/* Set the position for the pop-up window */
|
|
|
|
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_open: Set pop-up position to (%d,%d)\n", pt.x, pt.y);
|
2011-07-08 21:41:48 +02:00
|
|
|
ret = nxpu_setposition(hwnd, &pt);
|
2011-07-08 18:36:26 +02:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
goto errout_with_hwnd;
|
|
|
|
}
|
|
|
|
|
2011-07-08 21:41:48 +02:00
|
|
|
/* Set the size of the pop-up window */
|
2011-07-08 18:36:26 +02:00
|
|
|
|
2016-06-11 19:55:38 +02:00
|
|
|
ginfo("Set pop-up size to (%d,%d)\n", size.w, size.h);
|
2011-07-08 21:41:48 +02:00
|
|
|
ret = nxpu_setsize(hwnd, &size);
|
2011-07-08 18:36:26 +02:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
goto errout_with_hwnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hwnd;
|
2011-07-08 20:21:04 +02:00
|
|
|
|
|
|
|
errout_with_hwnd:
|
2020-01-02 13:09:50 +01:00
|
|
|
nx_closewindow(hwnd);
|
2011-07-08 20:21:04 +02:00
|
|
|
|
|
|
|
errout_with_state:
|
|
|
|
return NULL;
|
2011-07-08 18:36:26 +02:00
|
|
|
}
|
|
|
|
|
2011-07-08 20:21:04 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxpu_close
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int nxpu_close(NXWINDOW hwnd)
|
|
|
|
{
|
2011-07-08 22:55:49 +02:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = nx_closewindow(hwnd);
|
2011-07-08 20:21:04 +02:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
2014-10-08 16:33:00 +02:00
|
|
|
printf("nxpu_close: nx_closewindow failed: %d\n", errno);
|
2011-07-08 20:21:04 +02:00
|
|
|
g_exitcode = NXEXIT_NXCLOSEWINDOW;
|
2011-07-08 22:55:49 +02:00
|
|
|
return ret;
|
2011-07-08 20:21:04 +02:00
|
|
|
}
|
2011-07-08 22:55:49 +02:00
|
|
|
return OK;
|
2011-07-08 20:21:04 +02:00
|
|
|
}
|