Annotation of 43BSDReno/share/doc/ps1/18.curses/doc.III, revision 1.1

1.1     ! root        1: .\" Copyright (c) 1980 The Regents of the University of California.
        !             2: .\" All rights reserved.
        !             3: .\"
        !             4: .\" Redistribution and use in source and binary forms are permitted
        !             5: .\" provided that the above copyright notice and this paragraph are
        !             6: .\" duplicated in all such forms and that any documentation,
        !             7: .\" advertising materials, and other materials related to such
        !             8: .\" distribution and use acknowledge that the software was developed
        !             9: .\" by the University of California, Berkeley.  The name of the
        !            10: .\" University may not be used to endorse or promote products derived
        !            11: .\" from this software without specific prior written permission.
        !            12: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
        !            13: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
        !            14: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            15: .\"
        !            16: .\"    @(#)doc.III     6.2 (Berkeley) 3/17/89
        !            17: .\"
        !            18: .Ds
        !            19: .Fd baudrate "" \*m
        !            20: .De
        !            21: Returns the output baud rate of the terminal.
        !            22: This is a system dependent constant
        !            23: (defined in
        !            24: .b <sys/tty.h>
        !            25: on BSD systems,
        !            26: which is included by
        !            27: .b <curses.h> ).
        !            28: .Ds
        !            29: .Fd delwin win
        !            30: WINDOW *win;
        !            31: .De
        !            32: Deletes the window from existence.
        !            33: All resources are freed for future use by
        !            34: .b calloc (3).
        !            35: If a window has a
        !            36: .Fn subwin
        !            37: allocated window inside of it,
        !            38: deleting the outer window
        !            39: the subwindow is not affected,
        !            40: even though this does invalidate it.
        !            41: Therefore,
        !            42: subwindows should be deleted before their
        !            43: outer windows are.
        !            44: .Ds
        !            45: .Fd endwin
        !            46: .De
        !            47: Finish up window routines before exit.
        !            48: This restores the terminal to the state it was before
        !            49: .Fn initscr
        !            50: (or
        !            51: .Fn gettmode
        !            52: and
        !            53: .Fn setterm )
        !            54: was called.
        !            55: It should always be called before exiting.
        !            56: It does not exit.
        !            57: This is especially useful for resetting tty stats
        !            58: when trapping rubouts via
        !            59: .b signal (2).
        !            60: .Ds
        !            61: .Fd erasechar "" \*m
        !            62: .De
        !            63: Returns the erase character
        !            64: for the terminal,
        !            65: .i i.e. ,
        !            66: the character used by the user to erase a single character from the input.
        !            67: .Ds
        !            68: .Fd getcap str "" "char *"
        !            69: char   *str;
        !            70: .De
        !            71: Return a pointer to the
        !            72: .b termcap
        !            73: capability described by
        !            74: .Vn str
        !            75: (see
        !            76: .b termcap (5)
        !            77: for details).
        !            78: .Ds
        !            79: .Fd getyx win\*,y\*,x \*m
        !            80: WINDOW *win;
        !            81: int    y\*,x;
        !            82: .De
        !            83: Puts the current \*y of
        !            84: .Vn win
        !            85: in the variables
        !            86: .Vn y
        !            87: and
        !            88: .Vn x .
        !            89: Since it is a macro,
        !            90: not a function,
        !            91: you do not pass the address
        !            92: of
        !            93: .Vn y
        !            94: and
        !            95: .Vn x .
        !            96: .Ds
        !            97: .Fd inch "" \*m
        !            98: .Fd winch win \*m
        !            99: WINDOW *win;
        !           100: .De
        !           101: Returns the character at the current \*(y
        !           102: on the given window.
        !           103: This does not make any changes to the window.
        !           104: .Ds
        !           105: .Fd initscr
        !           106: .De
        !           107: Initialize the screen routines.
        !           108: This must be called before any of the screen routines are used.
        !           109: It initializes the terminal-type data and such,
        !           110: and without it none of the routines can operate.
        !           111: If standard input is not a tty,
        !           112: it sets the specifications to the terminal
        !           113: whose name is pointed to by
        !           114: .Vn Def\*_term
        !           115: (initialy "dumb").
        !           116: If the boolean
        !           117: .Vn My\*_term
        !           118: is true,
        !           119: .Vn Def\*_term
        !           120: is always used.
        !           121: If the system supports the
        !           122: .b TIOCGWINSZ
        !           123: .Fn ioctl "" "" 2
        !           124: call,
        !           125: it is used to get the number of lines and columns for the terminal,
        !           126: otherwise it is taken from the
        !           127: .b termcap
        !           128: description.
        !           129: .Ds
        !           130: .Fd killchar "" \*m
        !           131: .De
        !           132: Returns the line kill character
        !           133: for the terminal,
        !           134: .i i.e. ,
        !           135: the character used by the user to erase an entire line from the input.
        !           136: .Ds
        !           137: .Fd leaveok win\*,boolf \*m
        !           138: WINDOW *win;
        !           139: bool   boolf;
        !           140: .De
        !           141: Sets the boolean flag for leaving the cursor after the last change.
        !           142: If
        !           143: .Vn boolf
        !           144: is TRUE,
        !           145: the cursor will be left after the last update on the terminal,
        !           146: and the current \*y for
        !           147: .Vn win
        !           148: will be changed accordingly.
        !           149: If it is FALSE,
        !           150: it will be moved to the current \*y.
        !           151: This flag
        !           152: (initialy FALSE)
        !           153: retains its value until changed by the user.
        !           154: .Ds
        !           155: .Fd longname termbuf\*,name
        !           156: char   *termbuf\*,*name;
        !           157: .Fd fullname termbuf\*,name
        !           158: char   *termbuf\*,*name;
        !           159: .De
        !           160: .Fn longname
        !           161: fills in
        !           162: .Vn name
        !           163: with the long name of the terminal described by the
        !           164: .b termcap
        !           165: entry in
        !           166: .Vn termbuf .
        !           167: It is generally of little use,
        !           168: but is nice for telling the user in a readable format what terminal
        !           169: we think he has.
        !           170: This is available in the global variable
        !           171: .Vn ttytype .
        !           172: .Vn termbuf
        !           173: is usually set via the termlib routine
        !           174: .Fn tgetent .
        !           175: .Fn fullname
        !           176: is the same as
        !           177: .Fn longname ,
        !           178: except that it gives the fullest name given in the entry,
        !           179: which can be quite verbose.
        !           180: .Ds
        !           181: .Fd mvwin win\*,y\*,x
        !           182: WINDOW *win;
        !           183: int    y, x;
        !           184: .De
        !           185: Move the home position of the window
        !           186: .Vn win
        !           187: from its current starting coordinates
        !           188: to
        !           189: .Vn y\*,x ). (
        !           190: If that would put part or all of the window
        !           191: off the edge of the terminal screen,
        !           192: .Fn mvwin
        !           193: returns ERR and does not change anything.
        !           194: For subwindows,
        !           195: .Fn mvwin
        !           196: also returns ERR if you attempt to move it off its main window.
        !           197: If you move a main window,
        !           198: all subwindows are moved along with it.
        !           199: .Ds
        !           200: .Fd newwin lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *"
        !           201: int    lines\*,cols\*,begin\*_y\*,begin\*_x;
        !           202: .De
        !           203: Create a new window with
        !           204: .Vn lines
        !           205: lines and
        !           206: .Vn cols
        !           207: columns starting at position
        !           208: .Vn begin\*_y\*,begin\*_x ). (
        !           209: If either
        !           210: .Vn lines
        !           211: or
        !           212: .Vn cols
        !           213: is 0 (zero),
        !           214: that dimension will be set to
        !           215: .Vn "LINES \- begin\*_y" ) (
        !           216: or
        !           217: .Vn "COLS \- begin\*_x" ) (
        !           218: respectively.
        !           219: Thus, to get a new window of dimensions
        !           220: .Vn LINES
        !           221: \(mu
        !           222: .Vn COLS ,
        !           223: use
        !           224: .Fn newwin . "" 0\*,0\*,0\*,0
        !           225: .Ds
        !           226: .Fd nl "" \*m
        !           227: .Fd nonl "" \*m
        !           228: .De
        !           229: Set or unset the terminal to/from nl mode,
        !           230: .i i.e. ,
        !           231: start/stop the system from mapping
        !           232: .b <RETURN>
        !           233: to
        !           234: .b <LINE-FEED> .
        !           235: If the mapping is not done,
        !           236: .Fn refresh
        !           237: can do more optimization,
        !           238: so it is recommended, but not required, to turn it off.
        !           239: .Ds
        !           240: .Fd scrollok win\*,boolf \*m
        !           241: WINDOW *win;
        !           242: bool   boolf;
        !           243: .De
        !           244: Set the scroll flag for the given window.
        !           245: If
        !           246: .Vn boolf
        !           247: is FALSE, scrolling is not allowed.
        !           248: This is its default setting.
        !           249: .Ds
        !           250: .Fd touchline win\*,y\*,startx\*,endx
        !           251: WINDOW *win;
        !           252: int    y\*,startx\*,endx;
        !           253: .De
        !           254: This function performs a function similar to
        !           255: .Fn touchwin
        !           256: on a single line.
        !           257: It marks the first change for the given line
        !           258: to be
        !           259: .Vn startx ,
        !           260: if it is before the current first change mark,
        !           261: and
        !           262: the last change mark is set to be
        !           263: .Vn endx
        !           264: if it is currently less than
        !           265: .Vn endx .
        !           266: .Ds
        !           267: .Fd touchoverlap win1\*,win2
        !           268: WINDOW *win1, *win2;
        !           269: .De
        !           270: Touch the window
        !           271: .Vn win2
        !           272: in the area which overlaps with
        !           273: .Vn win1 .
        !           274: If they do not overlap,
        !           275: no changes are made.
        !           276: .Ds
        !           277: .Fd touchwin win
        !           278: WINDOW *win;
        !           279: .De
        !           280: Make it appear that the every location on the window
        !           281: has been changed.
        !           282: This is usually only needed for refreshes with overlapping windows.
        !           283: .Ds
        !           284: .Fd subwin win\*,lines\*,cols\*,begin\*_y\*,begin\*_x "" "WINDOW *"
        !           285: WINDOW *win;
        !           286: int    lines\*,cols\*,begin\*_y\*,begin\*_x;
        !           287: .De
        !           288: Create a new window with
        !           289: .Vn lines
        !           290: lines and
        !           291: .Vn cols
        !           292: columns starting at position
        !           293: .Vn begin\*_y\*,begin\*_x ) (
        !           294: inside the window
        !           295: .i win .
        !           296: This means that any change made to either window
        !           297: in the area covered
        !           298: by the subwindow will be made on both windows.
        !           299: .Vn begin\*_y\*,begin\*_x
        !           300: are specified relative to the overall screen,
        !           301: not the relative (0\*,0) of
        !           302: .Vn win .
        !           303: If either
        !           304: .Vn lines
        !           305: or
        !           306: .Vn cols
        !           307: is 0 (zero),
        !           308: that dimension will be set to
        !           309: .Vn "LINES \- begin\*_y" ) (
        !           310: or
        !           311: .Vn "COLS \- begin\*_x" ) (
        !           312: respectively.
        !           313: .Ds
        !           314: .Fd unctrl ch \*m
        !           315: char   ch;
        !           316: .De
        !           317: This is actually a debug function for the library,
        !           318: but it is of general usefulness.
        !           319: It returns a string which is a representation of
        !           320: .Vn ch .
        !           321: Control characters become their upper-case equivalents preceded by a "^".
        !           322: Other letters stay just as they are.
        !           323: To use
        !           324: .Fn unctrl ,
        !           325: you may have to have
        !           326: .b #include\ <unctrl.h>
        !           327: in your file.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.