📄 intov.html
字号:
is ISO/IEC 10646-1:1993.<p>A complex character can be written to the screen; if it does not include aspacing character, any non-spacing characters are associated with thespacing complex character that exists at the specified screen position. Whenthe application reads information back from the screen, it obtains spacingcomplex characters.<p>The<b>cchar_t</b>data type represents a complex character and its rendition.When a<b>cchar_t</b>represents a non-spacing complex character (that is, when there is no spacingcharacter within the complex character), then its rendition is not used; whenit is written to the screen, it uses the rendition specified by the spacingcharacter already displayed.<p>An object of type <b>cchar_t</b> can be initialised using<i><a href="setcchar.html">setcchar()</a></i>and its contents can be extracted using<i><a href="getcchar.html">getcchar()</a></i>.The behaviour of functions that take a <b>cchar_t</b> input argument isundefined if the application provides a <b>cchar_t</b> value that was notinitialised in this way or obtained from a Cursesfunction that has a <b>cchar_t</b> output argument.<h4><a name = "tag_001_003_006"> </a>Window Properties</h4><xref type="3" name="wprops"></xref>Associated with each window are the following properties that affect theplacing of characters into the window (see<xref href=wrendition><a href="#tag_001_004_004">Rendition of Characters Placed into a Window</a></xref>).<h5><a name = "tag_001_003_006_001"> </a>Window Rendition</h5>Each window has a rendition, which is combined with the rendition component ofthe window's background property described below.<h5><a name = "tag_001_003_006_002"> </a>Window Background</h5>Each window has a background property. The background property specifies:<ul><p><li>A spacing complex character (the background character) that will be used in avariety of situations where visible information is deleted from the screen.<p><li>A rendition to use in displaying the background character in thosesituations, and in other situations specified in<xref href=wrendition><a href="#tag_001_004_004">Rendition of Characters Placed into a Window</a></xref>.<p></ul><h3><a name = "tag_001_004"> </a>Conceptual Operations</h3><xref type="2" name="displaymodel"></xref><h4><a name = "tag_001_004_001"> </a>Screen Addressing</h4>Many Curses functions use a coordinate pair. In the<b>DESCRIPTION</b>,coordinate locations are represented as (<i>y</i>, <i>x</i>) since the <i>y</i>argument always precedes the <i>x</i> argument in the function call.These coordinates denote a line/column position, not a character position.<p>The coordinate <i>y</i> always refers to the row (of the window), and <i>x</i>always refers to the column. The first row and the first column is number 0,not 1.The position (0, 0) is the window's<i>origin</i>.<p>For example, for terminals that display the ISO 8859-1 character set (withleft-to-right writing), (0, 0) represents the upper left-hand corner of thescreen.<p>Functions that start with<i>mv</i>take arguments that specify a (<i>y</i>, <i>x</i>) position and move the cursor(as though<i><a href="move.html">move()</a></i>were called) before performing the requested action. As part of the requestedaction, further cursor movement may occur, specified on the respectivereference manual page.<h4><a name = "tag_001_004_002"> </a>Basic Character Operations</h4><h5><a name = "tag_001_004_002_001"> </a>Adding (Overwriting)</h5>The Curses functions that contain the word add, such as<i><a href="addch.html">addch()</a></i>,actually specify one or more characters to replace (overwrite) charactersalready in the window.If these functions specify only non-spacingcharacters, they are appended to a spacing character already in the window;see also<xref href=zerowidth><a href="#tag_001_003_005">Non-spacing Characters</a></xref>.<p>When replacing a multi-column character with a character that requires fewercolumns, the new character is added starting at the specified or impliedcolumn position. All columns that the former multi-column characteroccupied that the new character does not require are <i>orphaned columns</i>,which are filled using the background character and rendition.<p>Replacing a character with a character that requires more columns alsoreplaces one or more subsequent characters on the line. This process may alsoproduce orphaned columns.<h5><a name = "tag_001_004_002_002"> </a>Truncation, Wrapping and Scrolling</h5><xref type="5" name="truncation"></xref><p>If the application specifies a character or a string of characterssuch that writing them to a window would extend beyond the end of the line(for example, if the application tries to deposit any multi-column characterat the last column in a line), the behaviour depends on whether the function supports line wrapping:<ul><p><li>If the function does not wrap, it fails.<p><li>If the function wraps, then it places one or more characters in the window atthe start of the next line, beginning with the first characterthat would not completely fit on the original line.<p>If the final character on the line is a multi-column character that does notcompletely fit on the line, the entire character wraps to the next line andcolumns at the end of the original line may be orphaned.<p>If the original line was the last line in the window, the wrap may cause ascroll to occur:<ul><p><li>If scrolling is enabled, a scroll occurs. The contents of the first line ofthe window are lost. The contents of each remaining line in the window moveto the previous line. The last line of the window is filled with anycharacters that wrapped. Any remaining space on the last line isfilled with the background character and rendition.<p><li>If scrolling is disabled, any characters that would extend beyondthe last column of the last line are truncated.<p></ul><p>The<i><a href="scrollok.html">scrollok()</a></i>function enables and disables scrolling.<p></ul><p>Some <i>add</i> functions move the cursor just beyond the end of the lastcharacter added. If this position is beyond the end of a line, it causeswrapping and scrolling under the conditions specified in the second bulletabove.<h5><a name = "tag_001_004_002_003"> </a>Insertion</h5>Insertion functions (such as<i><a href="insch.html">insch()</a></i>)insert characters immediately before the character at the specified or impliedcursor position.<p>The insertion shifts all characters that were formerly at or beyond thecursor position on the cursor line toward the end of that line. Thedisposition of the characters that would thus extend beyond the end of theline depends on whether the function supports wrapping:<ul><p><li>If the function does not wrap, those characters are removed from the window.This may produce orphaned columns.<p><li>If the function supports wrapping, the effect is as described above in<xref href=truncation><a href="#tag_001_004_002_002">Truncation, Wrapping and Scrolling</a></xref>(except that the overwriting discussed in the final dash is an insertion).<p></ul><p>If multi-column characters are displayed, some cursor positions are within amulti-column character but not at the beginning of a character. Any requestto insert data at a position that is not the beginning of a multi-columncharacter will be adjusted so that the actual cursor position is at thebeginning of the multi-column character in which the requested position occurs.<p>There are no warning indications relative to cursor relocation.The application should not maintain an image of the cursor position, sincethis constitutes placing terminal-specific information in the application anddefeats the purpose of using Curses.<p>Portable applications cannot assume that a cursor position specified in aninsert function is a reusable indication of the actual cursor position.<h5><a name = "tag_001_004_002_004"> </a>Deletion</h5>Deletion functions (such as<i><a href="delch.html">delch()</a></i>)delete the simple or complex character at the specified or implied cursor position, no matter which column of the character this is. All column positions are replaced bythe background character and rendition and the cursor is not relocated.If a character-deletion operation would cause a previous wrapping operation tobe undone, then the results are unspecified.<h5><a name = "tag_001_004_002_005"> </a>Window Operations</h5>Overlapping a window (that is, placing one window on top of another)and overwriting a window(that is, copying the contents of one window into another) followsthe operation of overwriting multi-column glyphs around its edge. Any orphaned columns are handled as in thecharacter operations.<h5><a name = "tag_001_004_002_006"> </a>Characters that Straddle the Subwindow Border</h5>A subwindow can be defined such that multi-column characters straddle thesubwindow border. The character operations deal with these straddlingcharacters as follows:<ul><p><li>Reading the subwindow with a function such as<i><a href="in_wch.html">in_wch()</a></i>reads the entire straddling character.<p><li>Adding, inserting or deleting in the subwindow deletes the entire straddlingcharacter before the requested operation begins and does not relocate thecursor.<p><li>Scrolling lines in the subwindow has the following effects:<ul><p><li>A straddling character at the start of the line is completely erased beforethe scroll operation begins.<p><li>A straddling character at the end of the line moves in the direction of thescroll and continues to straddle the subwindow border. Column positionsoutside the subwindow at the straddling character's former position areorphaned unless another straddling character scrolls into those positions.<p></ul><p></ul><p>If the application calls a function such as<i><a href="border.html">border()</a></i>,the above situations do not occur because writing the border on the subwindowdeletes any straddling characters.<p>In the above cases involving multi-column characters, operations confined to asubwindow can modify the screen outside the subwindow. Therefore, saving asubwindow, performing operations within the subwindow, and then restoring thesubwindow may disturb the appearance of the screen. To overcome theseeffects (for example, for pop-up windows), the application should refreshthe entire screen.<h4><a name = "tag_001_004_003"> </a>Special Characters</h4><xref type="3" name="specialchars"></xref>Some functions process special characters as specified below.<p>In functions that do not move the cursor based on theinformation placed in the window, these special characters would only be usedwithin a string in order to affect the placement of subsequent characters; thecursor movement specified below does not persist in the visible cursor beyondthe end of the operation. In functions that do move the cursor, these specialcharacters can be used to affect the placement of subsequent characters and toachieve movement of the visible cursor.<dl compact><dt><backspace><dd><index term="backspace, special processing"></index>Unless the cursor was already in column 0, <backspace> moves the cursor onecolumn toward the start of the current line and any characters after the<backspace> are added or inserted starting there.<dt><carriage return><dd><br>Unless the cursor was already in column 0, <carriage return> moves the cursorto the start of the current line. Any characters after the <carriage return>are added or inserted starting there.<dt><newline><dd><index term="newline, special processing"></index>In an add operation, Curses adds the background character into successivecolumns until reaching the end of the line. Scrolling occurs as described in<xref href=truncation><a href="#tag_001_004_002_002">Truncation, Wrapping and Scrolling</a></xref>.Any characters after the <newline> character are added, starting at thestart of the new line.In an insert operation, <newline> erases the remainder of the currentline with the background character, effectively a<i><a href="wclrtoeol.html">wclrtoeol()</a></i>,andmoves the cursor to the start of a new line. When scrolling is enabled, advancing the cursor to a new line may cause scrolling asdescribed in<xref href=truncation><a href="#tag_001_004_002_002">Truncation, Wrapping and Scrolling</a></xref>.Any characters after the <newline> character are inserted at the start of the newline.The<i><a href="filter.html">filter()</a></i>function may inhibit this processing.<dt><tab><dd>Tab characters in text move subsequent characters to the next horizontal tabstop. By default, tab stops are in column 0, 8, 16, and so on.In an insert or add operation, Curses inserts or adds, respectively, thebackground character into successive columns until reaching the next tab stop.If there are no more tab stops in the current line, wrapping and scrolling
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -