include: nuttx: nx: nxstyle fixes

Nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea
2021-01-26 11:52:52 +01:00
committed by Xiang Xiao
parent 95ed9fc576
commit 90ffb03903
7 changed files with 114 additions and 75 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ extern "C"
#endif
/****************************************************************************
* Public Functions
* Public Functions Definitions
****************************************************************************/
#undef EXTERN
+3 -10
View File
@@ -61,7 +61,7 @@ extern "C"
#endif
/****************************************************************************
* Public Functions
* Public Functions Defintions
****************************************************************************/
/* The current software cursor implementation is only available under the
@@ -90,10 +90,6 @@ extern "C"
# define CONFIG_NX_NOCURSOR 1
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/* For cursor controllers that support custem cursor images, this structure
* is used to provide the cursor image.
*
@@ -115,10 +111,6 @@ struct nx_cursorimage_s
FAR const uint8_t *image; /* Pointer to bitmap image data */
};
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nxcursor_enable
*
@@ -164,7 +156,8 @@ int nxcursor_enable(NXHANDLE hnd, bool enable);
****************************************************************************/
#if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR)
int nxcursor_setimage(NXHANDLE hnd, FAR const struct nx_cursorimage_s *image);
int nxcursor_setimage(NXHANDLE hnd,
FAR const struct nx_cursorimage_s *image);
#endif
/****************************************************************************
+20 -12
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* include/nuttx/nx/nxfonts.h
*
* Copyright (C) 2008, 2009, 2011, 2015, 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009, 2011, 2015, 2017 Gregory Nutt.
* All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +53,7 @@
****************************************************************************/
/* Font Definitions *********************************************************/
/* Select the default font. If no fonts are selected, then a compilation
* error is likely down the road.
*/
@@ -208,19 +210,20 @@
****************************************************************************/
/* Font Types ***************************************************************/
/* Font IDs */
enum nx_fontid_e
{
FONTID_DEFAULT = 0 /* The default font */
/* Monospace fonts */
/* Monospace fonts */
#ifdef CONFIG_NXFONT_MONO5X8
, FONTID_MONO5X8 = 18 /* The 5x8 monospace font */
#endif
/* Sans Serif fonts */
/* Sans Serif fonts */
#ifdef CONFIG_NXFONT_SANS17X22
, FONTID_SANS17X22 = 14 /* The 17x22 sans serif font */
@@ -246,7 +249,7 @@ enum nx_fontid_e
, FONTID_SANS39X48 = 4 /* The 39x48 sans serif font */
#endif
/* Sans Serif bold fonts */
/* Sans Serif bold fonts */
#ifdef CONFIG_NXFONT_SANS17X23B
, FONTID_SANS17X23B = 16 /* The 17x23 sans bold font */
@@ -268,7 +271,7 @@ enum nx_fontid_e
, FONTID_SANS40X49B = 7 /* The 40x49 sans bold font */
#endif
/* Serif fonts */
/* Serif fonts */
#ifdef CONFIG_NXFONT_SERIF22X29
, FONTID_SERIF22X29 = 8 /* The 22x29 serif font */
@@ -282,7 +285,7 @@ enum nx_fontid_e
, FONTID_SERIF38X48 = 10 /* The 38x48 serif font */
#endif
/* Serif bold fonts */
/* Serif bold fonts */
#ifdef CONFIG_NXFONT_SERIF22X28B
, FONTID_SERIF22X28B = 11 /* The 22x28 serif bold font */
@@ -296,7 +299,7 @@ enum nx_fontid_e
, FONTID_SERIF38X49B = 13 /* The 38x49 serif bold font */
#endif
/* Pixel fonts */
/* Pixel fonts */
#ifdef CONFIG_NXFONT_PIXEL_UNICODE
, FONTID_PIXEL_UNICODE = 19 /* Pixel UniCode font */
@@ -306,7 +309,7 @@ enum nx_fontid_e
, FONTID_PIXEL_LCD_MACHINE = 20 /* Pixel lcd machine font */
#endif
/* X11 misc fixed fonts */
/* X11 misc fixed fonts */
#ifdef CONFIG_NXFONT_X11_MISC_FIXED_4X6
, FONTID_X11_MISC_FIXED_4X6 = 21 /* X11 misc fixed 4x6 */
@@ -456,6 +459,7 @@ struct nx_fontpackage_s
};
/* Font Cache ***************************************************************/
/* Opaque handle used to reference a font cache */
typedef FAR void *FCACHE;
@@ -536,7 +540,8 @@ FAR const struct nx_font_s *nxf_getfontset(NXHANDLE handle);
*
****************************************************************************/
FAR const struct nx_fontbitmap_s *nxf_getbitmap(NXHANDLE handle, uint16_t ch);
FAR const struct nx_fontbitmap_s *nxf_getbitmap(NXHANDLE handle,
uint16_t ch);
/****************************************************************************
* Name: nxf_convert_*bpp
@@ -624,7 +629,8 @@ FCACHE nxf_cache_connect(enum nx_fontid_e fontid,
* font handler is invalid upon return in either case.
*
* Input Parameters:
* fhandle - A font cache handler previously returned by nxf_cache_connect();
* fhandle - A font cache handler previously returned by
* nxf_cache_connect();
*
* Returned Value:
* None
@@ -641,7 +647,8 @@ void nxf_cache_disconnect(FCACHE fhandle);
* cache.
*
* Input Parameters:
* fhandle - A font cache handle previously returned by nxf_cache_connect();
* fhandle - A font cache handle previously returned by
* nxf_cache_connect();
*
* Returned Value:
* Zero (OK) is returned if the metrics were
@@ -667,7 +674,8 @@ NXHANDLE nxf_cache_getfonthandle(FCACHE fhandle);
*
****************************************************************************/
FAR const struct nxfonts_glyph_s *nxf_cache_getglyph(FCACHE fhandle, uint8_t ch);
FAR const struct nxfonts_glyph_s *nxf_cache_getglyph(FCACHE fhandle,
uint8_t ch);
#undef EXTERN
#if defined(__cplusplus)
+38 -19
View File
@@ -151,7 +151,7 @@ enum nxmsg_e
NX_SVRMSG_RAISE, /* Move the window to the top */
NX_SVRMSG_LOWER, /* Move the window to the bottom */
NX_SVRMSG_MODAL, /* Select/de-slect window modal state */
NX_SVRMSG_SETVISIBILITY, /* Show or hide a window */
NX_SVRMSG_SETVISIBILITY, /* Show or hide a window */
NX_SVRMSG_SETPIXEL, /* Set a single pixel in the window with a color */
NX_SVRMSG_FILL, /* Fill a rectangle in the window with a color */
NX_SVRMSG_GETRECTANGLE, /* Get a rectangular region in the window */
@@ -200,7 +200,9 @@ struct nxclimsg_redraw_s
bool more; /* true: more redraw messages follow */
};
/* This message informs the client of the new size or position of the window */
/* This message informs the client of the new size
* or position of the window
*/
struct nxclimsg_newposition_s
{
@@ -247,9 +249,10 @@ struct nxclimsg_event_s
/* Client-to-Server Message Structures **************************************/
/* The generic message structure. All server messages begin with this form. Also
* messages that have no additional data fields use this structure. This includes:
* NX_SVRMSG_CONNECT and NX_SVRMSG_DISCONNECT.
/* The generic message structure.
* All server messages begin with this form.
* Also messages that have no additional data fields use this structure.
* This includes: NX_SVRMSG_CONNECT and NX_SVRMSG_DISCONNECT.
*/
struct nxsvrmsg_s /* Generic server message */
@@ -333,8 +336,9 @@ struct nxsvrmsg_requestbkgd_s
{
uint32_t msgid; /* NX_SVRMSG_REQUESTBKGD */
FAR struct nxmu_conn_s *conn; /* The specific connection sending the message */
FAR const struct nx_callback_s *cb; /* Event handling callbacks */
FAR void *arg; /* Client argument used with callbacks */
FAR void *arg; /* Client argument used with callbacks */
};
/* This message informs the server that client wishes to close a window */
@@ -344,7 +348,9 @@ struct nxsvrmsg_releasebkgd_s
uint32_t msgid; /* NX_SVRMSG_RELEASEBKGD */
};
/* This message informs the server that the size or position of the window has changed */
/* This message informs the server that the size
* or position of the window has changed
*/
struct nxsvrmsg_setposition_s
{
@@ -353,7 +359,9 @@ struct nxsvrmsg_setposition_s
FAR struct nxgl_point_s pos; /* The new window position */
};
/* This message informs the server that the size or position of the window has changed */
/* This message informs the server that the size
* or position of the window has changed
*/
struct nxsvrmsg_setsize_s
{
@@ -362,7 +370,9 @@ struct nxsvrmsg_setsize_s
FAR struct nxgl_size_s size; /* The new window size */
};
/* This message informs the server that the size or position of the window has changed */
/* This message informs the server that the size
* or position of the window has changed
*/
struct nxsvrmsg_getposition_s
{
@@ -370,7 +380,9 @@ struct nxsvrmsg_getposition_s
FAR struct nxbe_window_s *wnd; /* The window whose position/size has changed */
};
/* This message informs the server to raise this window to the top of the display */
/* This message informs the server to raise this window to
* the top of the display
*/
struct nxsvrmsg_raise_s
{
@@ -378,7 +390,9 @@ struct nxsvrmsg_raise_s
FAR struct nxbe_window_s *wnd; /* The window to be raised */
};
/* This message informs the server to lower this window to the bottom of the display */
/* This message informs the server to lower this window to
* the bottom of the display
*/
struct nxsvrmsg_lower_s
{
@@ -415,6 +429,7 @@ struct nxsvrmsg_setpixel_s
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 */
};
@@ -425,6 +440,7 @@ struct nxsvrmsg_fill_s
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 */
};
@@ -449,6 +465,7 @@ struct nxsvrmsg_filltrapezoid_s
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 */
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]; /* Color to use in the fill */
};
@@ -469,7 +486,9 @@ struct nxsvrmsg_bitmap_s
uint32_t msgid; /* NX_SVRMSG_BITMAP */
FAR struct nxbe_window_s *wnd; /* The window with will receive the bitmap image */
struct nxgl_rect_s dest; /* Destination location of the bitmap in the window */
FAR const void *src[CONFIG_NX_NPLANES]; /* The start of the source image. */
struct nxgl_point_s origin; /* Offset into the source image data */
unsigned int stride; /* The width of the full source image in pixels. */
sem_t *sem_done; /* Semaphore to report when command is done. */
@@ -479,13 +498,13 @@ 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 */
};
/* This message reports a new mouse event from a hardware controller attached to
* the server as a regular client (this message may have even been sent from an
* interrupt handler).
/* This message reports a new mouse event from a hardware controller
* attached to the server as a regular client (this message may have
* even been sent from an interrupt handler).
*/
#ifdef CONFIG_NX_XYINPUT
@@ -497,9 +516,9 @@ struct nxsvrmsg_mousein_s
};
#endif
/* This message reports a new keyboard event from a hardware controller attached to
* some kind of keypad (this message may have even been sent from an
* interrupt handler).
/* This message reports a new keyboard event from a hardware controller
* attached to some kind of keypad (this message may have even been sent
* from an interrupt handler).
*/
#ifdef CONFIG_NX_KBD
@@ -534,7 +553,7 @@ extern "C"
#endif
/****************************************************************************
* Public Functions
* Public Functions Definitions
****************************************************************************/
/****************************************************************************
+19 -13
View File
@@ -68,25 +68,28 @@
* Output text/graphics options:
*
* CONFIG_NXTERM_BPP
* Currently, NxTerm supports only a single pixel depth. This
* configuration setting must be provided to support that single pixel depth.
* Currently, NxTerm supports only a single pixel depth.
* This configuration setting must be provided to support that single
* pixel depth.
* Default: The smallest enabled pixel depth. (see CONFIG_NX_DISABLE_*BPP)
* CONFIG_NXTERM_CURSORCHAR
* The bitmap code to use as the cursor. Default '_'
* CONFIG_NXTERM_MXCHARS
* NxTerm needs to remember every character written to the console so
* that it can redraw the window. This setting determines the size of some
* internal memory allocations used to hold the character data. Default: 128.
* internal memory allocations used to hold the character data.
* Default: 128.
* CONFIG_NXTERM_CACHESIZE
* NxTerm supports caching of rendered fonts. This font caching is required
* for two reasons: (1) First, it improves text performance, but more
* importantly (2) it preserves the font memory. Since the NX server runs on
* a separate server thread, it requires that the rendered font memory persist
* until the server has a chance to render the font. (NOTE: There is still
* inherently a race condition in this!). Unfortunately, the font cache would
* be quite large if all fonts were saved. The CONFIG_NXTERM_CACHESIZE setting
* will control the size of the font cache (in number of glyphs). Only that
* number of the most recently used glyphs will be retained. Default: 16.
* importantly (2) it preserves the font memory. Since the NX server runs
* on a separate server thread, it requires that the rendered font memory
* persist until the server has a chance to render the font. (NOTE: There
* is still inherently a race condition in this!). Unfortunately, the font
* cache would be quite large if all fonts were saved.
* The CONFIG_NXTERM_CACHESIZE setting will control the size of the font
* cache (in number of glyphs). Only that number of the most recently
* used glyphs will be retained. Default: 16.
* CONFIG_NXTERM_LINESEPARATION
* This the space (in rows) between each row of test. Default: 0
* CONFIG_NXTERM_NOWRAP
@@ -154,8 +157,11 @@
# define CONFIG_NXTERM_BPP 8
# elif !defined(CONFIG_NX_DISABLE_16BPP)
# define CONFIG_NXTERM_BPP 16
//#elif !defined(CONFIG_NX_DISABLE_24BPP)
//# define CONFIG_NXTERM_BPP 24
/* #elif !defined(CONFIG_NX_DISABLE_24BPP)
* # define CONFIG_NXTERM_BPP 24
*/
# elif !defined(CONFIG_NX_DISABLE_32BPP)
# define CONFIG_NXTERM_BPP 32
# else
@@ -325,7 +331,7 @@ NXTERM nx_register(NXWINDOW hwnd, FAR struct nxterm_window_s *wndo,
* the boardctl(BOARDIOC_NXTERM) interface.
*
* Input Parameters:
* hfwnd - A handle that will be used to access the window. The window must
* hfwnd - A handle that will be used to access the window. The window must
* persist and this handle must be valid for the life of the NX console.
* wndo - Describes the window and font to be used. The information in
* this structure is copied and the original need not persist after
+29 -17
View File
@@ -47,6 +47,7 @@
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_NXTK_BORDERWIDTH
@@ -321,8 +322,8 @@ int nxtk_raise(NXTKWINDOW hfwnd);
* 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
@@ -393,7 +394,8 @@ bool nxtk_ishidden(NXTKWINDOW hfwnd);
* Name: nxtk_fillwindow
*
* Description:
* Fill the specified rectangle in the client window with the specified color
* Fill the specified rectangle in the client window with the specified
* color
*
* Input Parameters:
* hfwnd - The window handle returned by nxtk_openwindow
@@ -437,7 +439,8 @@ int nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
* Name: nxtk_filltrapwindow
*
* Description:
* Fill the specified trapezoid in the client window with the specified color
* Fill the specified trapezoid in the client window with the specified
* color
*
* Input Parameters:
* hfwnd - The window handle returned by nxtk_openwindow
@@ -474,9 +477,11 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd,
*
****************************************************************************/
int nxtk_drawlinewindow(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector,
int nxtk_drawlinewindow(NXTKWINDOW hfwnd,
FAR struct nxgl_vector_s *vector,
nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES], uint8_t caps);
nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
uint8_t caps);
/****************************************************************************
* Name: nxtk_drawcirclewindow
@@ -527,7 +532,8 @@ int nxtk_fillcirclewindow(NXWINDOW hfwnd,
* 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.
@@ -559,8 +565,8 @@ int nxtk_movewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
* src - The start of the source image(s). This is an array source
* images of size CONFIG_NX_NPLANES.
* origin - The origin of the upper, left-most corner of the full bitmap.
* Both dest and origin are in sub-window coordinates, however, the
* origin may lie outside of the sub-window display.
* Both dest and origin are in sub-window coordinates, however,
* the origin may lie outside of the sub-window display.
* stride - The width of the full source image in pixels.
*
* Returned Value:
@@ -583,7 +589,8 @@ int nxtk_bitmapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest,
* hfwnd - The handle returned by nxtk_openwindow
* height - The requested 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.
*
* Returned Value:
* OK on success; ERROR on failure with errno set appropriately
@@ -636,7 +643,8 @@ int nxtk_toolbarbounds(NXTKWINDOW hfwnd, FAR struct nxgl_rect_s *bounds);
* Name: nxtk_filltoolbar
*
* Description:
* Fill the specified rectangle in the toolbar sub-window with the specified color
* Fill the specified rectangle in the toolbar sub-window with the specified
* color
*
* Input Parameters:
* hfwnd - The handle returned by nxtk_openwindow
@@ -680,7 +688,8 @@ int nxtk_gettoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
* Name: nxtk_filltraptoolbar
*
* Description:
* Fill the specified trapezoid in the toolbar sub-window with the specified color
* Fill the specified trapezoid in the toolbar sub-window with the specified
* color
*
* Input Parameters:
* hfwnd - The handle returned by nxtk_openwindow
@@ -718,9 +727,11 @@ int nxtk_filltraptoolbar(NXTKWINDOW hfwnd,
*
****************************************************************************/
int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector,
int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd,
FAR struct nxgl_vector_s *vector,
nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES], uint8_t caps);
nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
uint8_t caps);
/****************************************************************************
* Name: nxtk_drawcircletoolbar
@@ -771,7 +782,8 @@ int nxtk_fillcircletoolbar(NXWINDOW hfwnd,
* 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
@@ -803,8 +815,8 @@ int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
* will receive the bit map.
* src - The start of the source image.
* origin - The origin of the upper, left-most corner of the full bitmap.
* Both dest and origin are in sub-window coordinates, however, the
* origin may lie outside of the sub-window display.
* Both dest and origin are in sub-window coordinates, however,
* the origin may lie outside of the sub-window display.
* stride - The width of the full source image in bytes.
*
* Returned Value:
+4 -3
View File
@@ -106,9 +106,10 @@ struct nxgl_vector_s
struct nxgl_point_s pt2; /* End position */
};
/* Describes a run, i.e., a horizontal line. Note that the start/end positions
* have fractional precision. This is necessary for good joining of trapezoids
* when a more complex shape is decomposed into trapezoids.
/* Describes a run, i.e., a horizontal line.
* Note that the start/end positions have fractional precision.
* This is necessary for good joining of trapezoids when a more complex
* shape is decomposed into trapezoids.
*/
struct nxgl_run_s