Squashed commit of the following:

libs/libnx/nxme:  Add front-end, client, message handling needed for cursor support.  Still actual cursor logic yet, just message handling.

    graphics/nxmu and graphics/nxbe:  Add back-end message handling needed for cursor support.  No actual cursor logic yet, just message handling.
This commit is contained in:
Gregory Nutt
2019-04-06 14:34:56 -06:00
parent 04b723e447
commit 42e2c9139c
11 changed files with 498 additions and 35 deletions
+6
View File
@@ -44,6 +44,12 @@ ifeq ($(CONFIG_NX_RAMBACKED),y)
CSRCS += nxbe_flush.c
endif
ifeq ($(CONFIG_NX_HWCURSOR),y)
CSRCS += nxbe_cursor.c
else ifeq ($(CONFIG_NX_SWCURSOR),y)
CSRCS += nxbe_cursor.c
endif
DEPPATH += --dep-path nxbe
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxbe}
VPATH += :nxbe
+75 -3
View File
@@ -188,12 +188,25 @@ struct nxbe_clipops_s
struct nxbe_state_s
{
uint8_t flags; /* NXBE_STATE_* flags */
uint8_t flags; /* NXBE_STATE_* flags */
#if defined(CONFIG_NX_SWCURSOR) || defined(CONFIG_NX_HWCURSOR)
/* Cursor support */
struct
{
bool visible; /* True: the cursor is visible */
struct cursor_pos_s pos; /* The current cursor position */
#ifdef CONFIG_NX_SWCURSOR
FAR struct cursor_image_s image; /* Cursor image */
#endif
} cursor;
#endif
/* The window list (with the background window always at the bottom) */
FAR struct nxbe_window_s *topwnd; /* The window at the top of the display */
struct nxbe_window_s bkgd; /* The background window is always at the bottom */
FAR struct nxbe_window_s *topwnd; /* The window at the top of the display */
struct nxbe_window_s bkgd; /* The background window is always at the bottom */
/* At present, only a solid colored background is supported for refills. The
* following provides the background color. It would be nice to support
@@ -254,6 +267,65 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev);
int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be);
#if defined(CONFIG_NX_SWCURSOR) || defined(CONFIG_NX_HWCURSOR)
/****************************************************************************
* Name: nxbe_cursor_enable
*
* Description:
* Enable/disable presentation of the cursor
*
* Input Parameters:
* be - The back-end state structure instance
* enable - True: show the cursor, false: hide the cursor.
*
* Returned Value:
* None
*
****************************************************************************/
void nxbe_cursor_enable(FAR struct nxbe_state_s *be, bool enable);
/****************************************************************************
* Name: nxbe_cursor_setimage
*
* Description:
* Set the cursor image
*
* Input Parameters:
* be - The back-end state structure instance
* image - Describes the cursor image in the expected format. For a
* software cursor, this is the format used with the display. The
* format may be different if a hardware cursor is used.
*
* Returned Value:
* None
*
****************************************************************************/
#if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR)
void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
FAR struct cursor_image_s *image);
#endif
/****************************************************************************
* Name: nxcursor_setposition
*
* Description:
* Move the cursor to the specified position
*
* Input Parameters:
* be - The back-end state structure instance
* pos - The new cursor position
*
* Returned Value:
* None
*
****************************************************************************/
void nxcursor_setposition(FAR struct nxbe_state_s *be,
FAR const struct cursor_pos_s *pos);
#endif /* CONFIG_NX_SWCURSOR || CONFIG_NX_HWCURSOR */
/****************************************************************************
* Name: nxbe_closewindow
*
+117
View File
@@ -0,0 +1,117 @@
/****************************************************************************
* graphics/nxbe/nxbe_cursor.c
*
* Copyright (C) 2019 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 <assert.h>
#include "nxbe.h"
/****************************************************************************
* Public Functions
****************************************************************************/
#if defined(CONFIG_NX_SWCURSOR) || defined(CONFIG_NX_HWCURSOR)
/****************************************************************************
* Name: nxbe_cursor_enable
*
* Description:
* Enable/disable presentation of the cursor
*
* Input Parameters:
* be - The back-end state structure instance
* enable - True: show the cursor, false: hide the cursor.
*
* Returned Value:
* None
*
****************************************************************************/
void nxbe_cursor_enable(FAR struct nxbe_state_s *be, bool enable)
{
#warning Missing logic
}
/****************************************************************************
* Name: nxbe_cursor_setimage
*
* Description:
* Set the cursor image
*
* Input Parameters:
* be - The back-end state structure instance
* image - Describes the cursor image in the expected format. For a
* software cursor, this is the format used with the display. The
* format may be different if a hardware cursor is used.
*
* Returned Value:
* None
*
****************************************************************************/
#if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR)
void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
FAR struct cursor_image_s *image);
{
#warning Missing logic
}
#endif
/****************************************************************************
* Name: nxcursor_setposition
*
* Description:
* Move the cursor to the specified position
*
* Input Parameters:
* be - The back-end state structure instance
* pos - The new cursor position
*
* Returned Value:
* None
*
****************************************************************************/
void nxcursor_setposition(FAR struct nxbe_state_s *be,
FAR const struct cursor_pos_s *pos)
{
#warning Missing logic
}
#endif /* CONFIG_NX_SWCURSOR || CONFIG_NX_HWCURSOR */
+24
View File
@@ -376,6 +376,30 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
}
break;
#if defined(CONFIG_NX_SWCURSOR) || defined(CONFIG_NX_HWCURSOR)
case NX_SVRMSG_CURSOR_ENABLE: /* Enable/disable cursor */
{
FAR struct nxsvrmsg_curenable_s *enabmsg = (FAR struct nxsvrmsg_curenable_s *)buffer;
nxbe_cursor_enable(&nxwm.be, enabmsg->enable);
}
break;
#if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR)
case NX_SVRMSG_CURSOR_IMAGE: /* Set cursor image */
{
FAR struct nxsvrmsg_curimage_s *imgmsg = (FAR struct nxsvrmsg_curimage_s *)buffer;
nxbe_cursor_setimage(&nxwm.be, imgmsg->image);
}
break;
#endif
case NX_SVRMSG_CURSOR_SETPOS: /* Set cursor position */
{
FAR struct nxsvrmsg_curpos_s *posmsg = (FAR struct nxsvrmsg_curpos_s *)buffer;
nxbe_cursor_setposition(&nxwm.be, &posmsg->pos);
}
break;
#endif
case NX_SVRMSG_REQUESTBKGD: /* Give access to the background window */
{
FAR struct nxsvrmsg_requestbkgd_s *rqbgmsg = (FAR struct nxsvrmsg_requestbkgd_s *)buffer;