aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth
Commit message (Collapse)AuthorAgeFilesLines
* testsuite/synth: add a test for #1961Tristan Gingold2022-02-223-0/+73
|
* testsuite/synth: add a reproducer for #1978Tristan Gingold2022-02-212-0/+53
|
* testsuite/synth: add a test for #1968Tristan Gingold2022-02-183-0/+141
|
* testsuite/synth: add a test for #1977Tristan Gingold2022-02-172-0/+56
|
* testsuite/synth: add a test for #1972Tristan Gingold2022-02-172-0/+19
|
* testsuite/synth: add a test for #1971Tristan Gingold2022-02-162-0/+16
|
* testsuite/synth: add a test for #1962Tristan Gingold2022-02-053-0/+101
|
* testsuite/synth: add more tests for subtraction in std_logic_unsignedTristan Gingold2022-02-059-0/+163
|
* testsuite/synth: add a test for #1951Tristan Gingold2022-01-182-0/+29<
/*
 * This file is subject to the terms of the GFX License. If a copy of
 * the license was not distributed with this file, you can obtain one at:
 *
 *              http://ugfx.org/license.html
 */

/**
 * @file    include/gwin/console.h
 * @brief   GWIN Graphic window subsystem header file.
 *
 * @defgroup Console Console
 * @ingroup GWIN
 *
 * @details		GWIN allows it to create a console/terminal like window.
 *				You can simply use chprintf() to print to the terminal.
 *
 * @pre			GFX_USE_GWIN must be set to TRUE in your gfxconf.h
 * @pre			GWIN_NEED_CONSOLE must be set to TRUE in your gfxconf.h
 *
 * @{
 */

#ifndef _GWIN_CONSOLE_H
#define _GWIN_CONSOLE_H

/* This file is included within "gwin/gwin.h" */

// A console window. Supports wrapped text writing and a cursor.
typedef struct GConsoleObject {
	GWindowObject	g;
	coord_t			cx, cy;			// Cursor position

	#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
		struct GConsoleWindowStream_t {
			const struct GConsoleWindowVMT_t *vmt;
			_base_asynchronous_channel_data
			} stream;
	#endif
	
	} GConsoleObject;

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief   Create a console window.
 * @details	A console window allows text to be written.
 * @note	Text in a console window supports newlines and will wrap text as required.
 * @return  NULL if there is no resultant drawing area, otherwise a window handle.
 *
 * @param[in] gc		The GConsoleObject structure to initialise. If this is NULL the structure is dynamically allocated.
 * @param[in] pInit		The initialization parameters to use
 *
 * @note				The drawing color and the background color get set to the current defaults. If you haven't called
 * 						@p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively.
 * @note				The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
 * 						is no default font and text drawing operations will no nothing.
 * @note				On creation even if the window is visible it is not automatically cleared.
 * 						You may do that by calling @p gwinClear() (possibly after changing your background color)
 * @note				A console does not save the drawing state. It is not automatically redrawn if the window is moved or
 * 						its visibility state is changed.
 *
 * @api
 */
GHandle gwinConsoleCreate(GConsoleObject *gc, const GWindowInit *pInit);

#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
	/**
	 * @brief   Get a stream from a console window suitable for use with chprintf().
	 * @return	The stream handle or NULL if this is not a console window.
	 *
	 * @param[in] gh	The window handle (must be a console window)
	 *
	 * @note		Only useful in ChibiOS
	 *
	 * @api
	 */
	BaseSequentialStream *gwinConsoleGetStream(GHandle gh);
#endif

/**
 * @brief   Put a character at the cursor position in the window.
 * @note	Uses the current foreground color to draw the character and fills the background using the background drawing color
 *
 * @param[in] gh	The window handle (must be a console window)
 * @param[in] c		The character to draw
 *
 * @api
 */
void gwinPutChar(GHandle gh, char c);

/**
 * @brief   Put a string at the cursor position in the window. It will wrap lines as required.
 * @note	Uses the current foreground color to draw the string and fills the background using the background drawing color
 *
 * @param[in] gh	The window handle (must be a console window)
 * @param[in] str	The string to draw
 *
 * @api
 */
void gwinPutString(GHandle gh, const char *str);

/**
 * @brief   Put the character array at the cursor position in the window. It will wrap lines as required.
 * @note	Uses the current foreground color to draw the string and fills the background using the background drawing color
 *
 * @param[in] gh	The window handle (must be a console window)
 * @param[in] str	The string to draw
 * @param[in] n		The number of characters to draw
 *
 * @api
 */
void gwinPutCharArray(GHandle gh, const char *str, size_t n);

/**
 * @brief   Print a formatted string at the cursor position in the window. It will wrap lines as required.
 * @details This function implements a minimal printf() like functionality
 *          The general parameters format is: %[-][width|*][.precision|*][l|L]p.
 *          The following parameter types (p) are supported:
 *          - <b>x</b> hexadecimal integer.
 *          - <b>X</b> hexadecimal long.
 *          - <b>o</b> octal integer.
 *          - <b>O</b> octal long.
 *          - <b>d</b> decimal signed integer.
 *          - <b>D</b> decimal signed long.
 *          - <b>u</b> decimal unsigned integer.
 *          - <b>U</b> decimal unsigned long.
 *          - <b>c</b> character.
 *          - <b>s</b> string.
 * @note	Uses the current foreground color to draw the string and fills the background using the background drawing color
 *
 * @param[in] gh	The window handle (must be a console window)
 * @param[in] fmt	The format string (as per printf)
 * @param[in] ...	The format string arguments.
 *
 * @api
 */
void gwinPrintf(GHandle gh, const char *fmt, ...);

#ifdef __cplusplus
}
#endif

#endif /* _GWIN_CONSOLE_H */
/** @} */
id=3486a9d34f6cdb83e5917da9b20a6e5bf9f13b81'>testsuite/synth: add one more test for #1886Tristan Gingold2021-10-101-1/+1 | * testsuite/synth: add a test for #1886Tristan Gingold2021-10-097-0/+193 | * testsuite/synth: add a test for previous commit (for #1860)Tristan Gingold2021-09-111-0/+1 | * testsuite/synth: add a test for #1860Tristan Gingold2021-09-114-0/+24 | * testsuite/synth: add a test for #1859Tristan Gingold2021-09-113-0/+20 | * testsuite/synth: add a test for #1856Tristan Gingold2021-09-083-0/+63 | * testsuite/synth: improve test for keep attributeTristan Gingold2021-09-073-0/+104 | * testsuite/synth: add a test for previous commit. For #1850Tristan Gingold2021-09-012-0/+131 | * testsuite/synth: add a test for #1654Tristan Gingold2021-08-313-0/+132 | * testsuite/synth: add a test for #1832Tristan Gingold2021-08-292-0/+29 | * testsuite/synth: add a test for #1850Tristan Gingold2021-08-273-0/+82 | * testsuite/synth: Add a test for ghdl/ghdl-yosys-plugin#154Tristan Gingold2021-08-272-0/+58 |