📄 cref.txt
字号:
SLsmg_fill_region SYNOPSIS Fill a rectangular region with a character USAGE void SLsmg_fill_region (r, c, nr, nc, ch) int r int c unsigned int nr unsigned int nc unsigned char ch DESCRIPTION The `SLsmg_fill_region' function may be used to a rectangular region with the character `ch' in the current color. The rectangle's upper left corner is at row `r' and column `c', and spans `nr' rows and `nc' columns. The position of the virtual cursor will be left at (`r', `c'). SEE ALSO SLsmg_write_char, SLsmg_set_color--------------------------------------------------------------SLsmg_set_char_set SYNOPSIS Turn on or off line drawing characters USAGE void SLsmg_set_char_set (int a); DESCRIPTION `SLsmg_set_char_set' may be used to select or deselect the line drawing character set as the current character set. If `a' is non-zero, the line drawing character set will be selected. Otherwise, the standard character set will be selected. NOTES There is no guarantee that this function will actually enable the use of line drawing characters. All it does is cause subsequent characters to be rendered using the terminal's alternate character set. Such character sets usually contain line drawing characters. SEE ALSO SLsmg_write_char, SLtt_get_terminfo--------------------------------------------------------------int SLsmg_Scroll_Hash_Border; SYNOPSIS Set the size of the border for the scroll hash USAGE int SLsmg_Scroll_Hash_Border = 0; DESCRIPTION This variable may be used to ignore the characters that occur at the beginning and the end of a row when performing the hash calculation to determine whether or not a line has scrolled. The default value is zero which means that all the characters on a line will be used. SEE ALSO SLsmg_refresh--------------------------------------------------------------SLsmg_suspend_smg SYNOPSIS Suspend screen management USAGE int SLsmg_suspend_smg (void) DESCRIPTION `SLsmg_suspend_smg' can be used to suspend the state of the screen management facility during suspension of the program. Use of this function will reset the display back to its default state. The funtion `SLsmg_resume_smg' should be called after suspension. It returns zero upon success, or -1 upon error. This function is similar to `SLsmg_reset_smg' except that the state of the display prior to calling `SLsmg_suspend_smg' is saved. SEE ALSO SLsmg_resume_smg, SLsmg_reset_smg--------------------------------------------------------------SLsmg_resume_smg SYNOPSIS Resume screen management USAGE int SLsmg_resume_smg (void) DESCRIPTION `SLsmg_resume_smg' should be called after `SLsmg_suspend_smg' to redraw the display exactly like it was before `SLsmg_suspend_smg' was called. It returns zero upon success, or -1 upon error. SEE ALSO SLsmg_suspend_smg--------------------------------------------------------------SLsmg_erase_eol SYNOPSIS Erase to the end of the row USAGE void SLsmg_erase_eol (void); DESCRIPTION `SLsmg_erase_eol' erases all characters from the current position to the end of the line. The newly created space is given the color of the current color. This function has no effect on the position of the virtual cursor. SEE ALSO SLsmg_gotorc, SLsmg_erase_eos, SLsmg_fill_region--------------------------------------------------------------SLsmg_gotorc SYNOPSIS Move the virtual cursor USAGE void SLsmg_gotorc (int r, int c) DESCRIPTION The `SLsmg_gotorc' function moves the virtual cursor to the row `r' and column `c'. The first row and first column is specified by `r = 0' and `c = 0'. SEE ALSO SLsmg_refresh--------------------------------------------------------------SLsmg_erase_eos SYNOPSIS Erase to the end of the screen USAGE void SLsmg_erase_eos (void); DESCRIPTION The `SLsmg_erase_eos' is like `SLsmg_erase_eol' except that it erases all text from the current position to the end of the display. The current color will be used to set the background of the erased area. SEE ALSO SLsmg_erase_eol--------------------------------------------------------------SLsmg_reverse_video SYNOPSIS Set the current color to 1 USAGE void SLsmg_reverse_video (void); DESCRIPTION This function is nothing more than `SLsmg_set_color(1)'. SEE ALSO SLsmg_set_color--------------------------------------------------------------SLsmg_set_color (int) SYNOPSIS Set the current color USAGE void SLsmg_set_color (int c); DESCRIPTION `SLsmg_set_color' is used to set the current color. The parameter `c' is really a color object descriptor. Actual foreground and background colors as well as other visual attributes may be associated with a color descriptor via the `SLtt_set_color' function. EXAMPLE This example defines color `7' to be green foreground on black background and then displays some text in this color: SLtt_set_color (7, NULL, "green", "black"); SLsmg_set_color (7); SLsmg_write_string ("Hello"); SLsmg_refresh (); NOTES It is important to understand that the screen managment routines know nothing about the actual colors associated with a color descriptor. Only the descriptor itself is used by the `SLsmg' routines. The lower level `SLtt' interface converts the color descriptors to actual colors. Thus SLtt_set_color (7, NULL, "green", "black"); SLsmg_set_color (7); SLsmg_write_string ("Hello"); SLtt_set_color (7, NULL, "red", "blue"); SLsmg_write_string ("World"); SLsmg_refresh (); will result in `"hello"' displayed in red on blue and _not_ green on black. SEE ALSO SLtt_set_color, SLtt_set_color_object--------------------------------------------------------------SLsmg_normal_video SYNOPSIS Set the current color to 0 USAGE void SLsmg_normal_video (void); DESCRIPTION `SLsmg_normal_video' sets the current color descriptor to `0'. SEE ALSO SLsmg_set_color--------------------------------------------------------------SLsmg_printf SYNOPSIS Format a string on the virtual display USAGE void SLsmg_printf (char *fmt, ...) DESCRIPTION `SLsmg_printf' format a `printf' style variable argument list and writes it on the virtual display. The virtual cursor will be moved to the end of the string. SEE ALSO SLsmg_write_string, SLsmg_vprintf--------------------------------------------------------------SLsmg_vprintf SYNOPSIS Format a string on the virtual display USAGE void SLsmg_vprintf (char *fmt, va_list ap) DESCRIPTION `SLsmg_vprintf' formats a string in the manner of _vprintf_ and writes the result to the display. The virtual cursor is advanced to the end of the string. SEE ALSO SLsmg_write_string, SLsmg_printf--------------------------------------------------------------SLsmg_write_string SYNOPSIS Write a character string on the display USAGE void SLsmg_write_string (char *s) DESCRIPTION The function `SLsmg_write_string' displays the string `s' on the virtual display at the current position and moves the position to the end of the string. SEE ALSO SLsmg_printf, SLsmg_write_nstring--------------------------------------------------------------SLsmg_write_nstring SYNOPSIS Write the first n characters of a string on the display USAGE void SLsmg_write_nstring (char *s, unsigned int n); DESCRIPTION `SLsmg_write_nstring' writes the first `n' characters of `s' to this virtual display. If the length of the string `s' is less than `n', the spaces will used until `n' characters have been written. `s' can be `NULL', in which case `n' spaces will be written. SEE ALSO SLsmg_write_string, SLsmg_write_nchars--------------------------------------------------------------SLsmg_write_char SYNOPSIS Write a character to the virtual display USAGE void SLsmg_write_char (char ch); DESCRIPTION `SLsmg_write_char' writes the character `ch' to the virtual display. SEE ALSO SLsmg_write_nchars, SLsmg_write_string--------------------------------------------------------------SLsmg_write_nchars SYNOPSIS Write n characters to the virtual display USAGE void SLsmg_write_nchars (char *s, unsigned int n); DESCRIPTION `SLsmg_write_nchars' writes at most `n' characters from the string `s' to the display. If the length of `s' is less than `n', the whole length of the string will get written. This function differs from `SLsmg_write_nstring' in that `SLsmg_write_nstring' will pad the string to write exactly `n' characters. `SLsmg_write_nchars' does not perform any padding. SEE ALSO SLsmg_write_nchars, SLsmg_write_nstring--------------------------------------------------------------SLsmg_write_wrapped_string SYNOPSIS Write a string to the display with wrapping USAGE void SLsmg_write_wrapped_string (s, r, c, nr, nc, fill) char *s int r, c unsigned int nr, nc int fill DESCRIPTION `SLsmg_write_wrapped_string' writes the string `s' to the virtual display. The string will be confined to the rectangular region whose upper right corner is at row `r' and column `c', and consists of `nr' rows and `nc' columns. The string will be wrapped at the boundaries of the box. If `fill' is non-zero, the last line to which characters have been written will get padded with spaces. NOTES This function does not wrap on word boundaries. However, it will wrap when a newline charater is encountered. SEE ALSO SLsmg_write_string--------------------------------------------------------------SLsmg_cls SYNOPSIS Clear the virtual display USAGE void SLsmg_cls (void) DESCRIPTION `SLsmg_cls' erases the virtual display using the current color. This will cause the physical display to get cleared the next time `SLsmg_refresh' is called. NOTES This function is not the same as SLsmg_gotorc (0,0); SLsmg_erase_eos (); since these statements do not guarantee that the physical screen will get cleared. SEE ALSO SLsmg_refresh, SLsmg_erase_eos--------------------------------------------------------------SLsmg_refresh SYNOPSIS Update physical screen USAGE void SLsmg_refresh (void) DESCRIPTION The `SLsmg_refresh' function updates the physical display to look like the virtual display. SEE ALSO SLsmg_suspend_smg, SLsmg_init_smg, SLsmg_reset_smg--------------------------------------------------------------SLsmg_touch_lines SYNOPSIS Mark lines on the virtual display for redisplay USAGE void SLsmg_touch_lines (int r, unsigned int nr) DESCRIPTION `SLsmg_touch_lines' marks the `nr' lines on the virtual display starting at row `r' for redisplay upon the next call to `SLsmg_refresh'. NOTES This function should rarely be called, if ever. If you find that you need to call this function, then your application should be modified to properly use the `SLsmg' screen management routines. This function is provided only for curses compatibility. SEE ALSO SLsmg_refresh--------------------------------------------------------------SLsmg_init_smg SYNOPSIS Initialize the var{SLsmg USAGE int SLsmg_init_smg (void) DESCRIPTION The `SLsmg_init_smg' function initializes the `SLsmg' screen management routines. Specifically, this function allocates space for the virtual display and calls `SLtt_init_video' to put the terminal's physical display in the proper state. It is up to the caller to make sure that the `SLtt' routines are initialized via `SLtt_get_terminfo' before calling `SLsmg_init_smg'. This function should also be called any time the size of the physical display has changed so that it can reallocate a new virtual display to match the physical display. It returns zero upon success, or -1 upon failure. SEE ALSO SLsmg_reset_smg--------------------------------------------------------------SLsmg_reset_smg SYNOPSIS Reset the var{SLsmg
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -