mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
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:
+16
-24
@@ -50,18 +50,6 @@
|
||||
|
||||
#ifndef defined(CONFIG_NX_SWCURSOR) || defined(CONFIG_NX_HWCURSOR)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
@@ -86,17 +74,21 @@ extern "C"
|
||||
* enable - True: show the cursor, false: hide the cursor.
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
* OK on success; ERROR on failure with errno set appropriately
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxcursor_enable(NXHANDLE hnd, bool enable);
|
||||
int nxcursor_enable(NXHANDLE hnd, bool enable);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxcursor_set_image
|
||||
* Name: nxcursor_setimage
|
||||
*
|
||||
* Description:
|
||||
* Set the cursor image
|
||||
* Set the cursor image.
|
||||
*
|
||||
* NOTE: The NX logic will reference the user image buffer repeatedly.
|
||||
* That image buffer must persist for as long as the NX server connection
|
||||
* persists.
|
||||
*
|
||||
* Input Parameters:
|
||||
* hnd - The server handle returned by nx_connect()
|
||||
@@ -105,30 +97,30 @@ void nxcursor_enable(NXHANDLE hnd, bool enable);
|
||||
* format may be different if a hardware cursor is used.
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
* OK on success; ERROR on failure with errno set appropriately
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR)
|
||||
void nxcursor_set_image(NXHANDLE hnd, FAR struct cursor_image_s *image);
|
||||
int nxcursor_setimage(NXHANDLE hnd, FAR struct cursor_image_s *image);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxcursor_set_position
|
||||
* Name: nxcursor_setposition
|
||||
*
|
||||
* Description:
|
||||
* Move the cursor to the specified position
|
||||
*
|
||||
* Input Parameters:
|
||||
* hnd - The server handle returned by nx_connect()
|
||||
* pos -
|
||||
* pos - The new cursor position
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
* OK on success; ERROR on failure with errno set appropriately
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxcursor_set_position(NXHANDLE hnd, FAR const struct cursor_pos_s *pos);
|
||||
int nxcursor_setposition(NXHANDLE hnd, FAR const struct cursor_pos_s *pos);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxcursor_get_position
|
||||
@@ -146,11 +138,11 @@ void nxcursor_set_position(NXHANDLE hnd, FAR const struct cursor_pos_s *pos);
|
||||
* pos - The location to return the cursor position
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
* OK on success; ERROR on failure with errno set appropriately
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxcursor_get_position(NXHANDLE hnd, FAR struct cursor_pos_s *pos);
|
||||
int nxcursor_get_position(NXHANDLE hnd, FAR struct cursor_pos_s *pos);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
||||
@@ -140,6 +140,9 @@ enum nxmsg_e
|
||||
NX_SVRMSG_CLOSEWINDOW, /* Close an existing window */
|
||||
NX_SVRMSG_BLOCKED, /* The window is blocked */
|
||||
NX_SVRMSG_SYNCH, /* Window syncrhonization request */
|
||||
NX_SVRMSG_CURSOR_ENABLE, /* Enable/disablel cursor presentation */
|
||||
NX_SVRMSG_CURSOR_IMAGE, /* Set cursor image */
|
||||
NX_SVRMSG_CURSOR_SETPOS, /* Set cursor position */
|
||||
NX_SVRMSG_REQUESTBKGD, /* Open the background window */
|
||||
NX_SVRMSG_RELEASEBKGD, /* Release the background window */
|
||||
NX_SVRMSG_SETPOSITION, /* Window position has changed */
|
||||
@@ -295,6 +298,34 @@ struct nxsvrmsg_synch_s
|
||||
FAR void *arg; /* User argument */
|
||||
};
|
||||
|
||||
#if defined(CONFIG_NX_SWCURSOR) || defined(CONFIG_NX_HWCURSOR)
|
||||
/* Enable/disable cursor */
|
||||
|
||||
struct nxsvrmsg_curenable_s
|
||||
{
|
||||
uint32_t msgid; /* NX_SVRMSG_CURSOR_ENABLE */
|
||||
bool enable; /* True: show the cursor, false: hide the cursor */
|
||||
};
|
||||
|
||||
#if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR)
|
||||
/* Set cursor image. */
|
||||
|
||||
struct nxsvrmsg_curimage_s
|
||||
{
|
||||
uint32_t msgid; /* NX_SVRMSG_CURSOR_IMAGE */
|
||||
FAR struct cursor_image_s image /* True: show the cursor, false: hide the cursor */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Set cursor position. */
|
||||
|
||||
struct nxsvrmsg_curpos_s
|
||||
{
|
||||
uint32_t msgid; /* NX_SVRMSG_CURSOR_SETPOS */
|
||||
FAR struct cursor_pos_s pos; /* The new cursor position */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* This message requests the server to create a new window */
|
||||
|
||||
struct nxsvrmsg_requestbkgd_s
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDIO_CURSOR_H
|
||||
#define __INCLUDE_NUTTX_VIDIO_CURSOR_H
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_CURSOR_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_CURSOR_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@@ -69,7 +69,7 @@ struct cursor_image_s
|
||||
{
|
||||
cursor_coord_t width; /* Width of the cursor image in pixels */
|
||||
cursor_coord_t height; /* Height of the cursor image in pixels */
|
||||
FAR const uint8_t *image; /* Pointer to image data */
|
||||
FAR const uint8_t *image; /* Pointer to bitmap image data */
|
||||
};
|
||||
|
||||
/* The following structure defines the cursor position */
|
||||
@@ -90,4 +90,4 @@ struct cursor_size_s
|
||||
cursor_coord_t w; /* Width in pixels */
|
||||
};
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDIO_CURSOR_H */
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_CURSOR_H */
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDIO_FB_H
|
||||
#define __INCLUDE_NUTTX_VIDIO_FB_H
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_FB_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_FB_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@@ -653,4 +653,4 @@ int fb_register(int display, int plane);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDIO_FB_H */
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_FB_H */
|
||||
|
||||
Reference in New Issue
Block a user