Merge branch 'vendor/LIBARCHIVE'
[dragonfly.git] / lib / libncurses / man / curs_slk.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2000,2003 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_slk.3x,v 1.12 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_slk.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_slk 3X ""
32 .SH NAME
33 \fBslk_init\fR, \fBslk_set\fR, \fBslk_refresh\fR,
34 \fBslk_noutrefresh\fR, \fBslk_label\fR,
35 \fBslk_clear\fR, \fBslk_restore\fR, \fBslk_touch\fR,
36 \fBslk_attron\fR, \fBslk_attrset\fR, \fBslk_attroff\fR,
37 \fBslk_attr_on\fR, \fBslk_attr_set\fR, \fBslk_attr_off\fR,
38 \fBslk_attr\fR, \fBslk_color\fR - \fBcurses\fR soft label routines
39 .SH SYNOPSIS
40 \fB#include <curses.h>\fR
41
42 \fBint slk_init(int fmt);\fR
43 .br
44 \fBint slk_set(int labnum, const char *label, int fmt);\fR
45 .br
46 \fBint slk_refresh(void);\fR
47 .br
48 \fBint slk_noutrefresh(void);\fR
49 .br
50 \fBchar *slk_label(int labnum);\fR
51 .br
52 \fBint slk_clear(void);\fR
53 .br
54 \fBint slk_restore(void);\fR
55 .br
56 \fBint slk_touch(void);\fR
57 .br
58 \fBint slk_attron(const chtype attrs);\fR
59 .br
60 \fBint slk_attroff(const chtype attrs);\fR
61 .br
62 \fBint slk_attrset(const chtype attrs);\fR
63 .br
64 \fBint slk_attr_on(attr_t attrs, void* opts);\fR
65 .br
66 \fBint slk_attr_off(const attr_t attrs, void * opts);\fR
67 .br
68 \fBint slk_attr_set(const attr_t attrs,\fR
69 .br
70         \fBshort color_pair_number, void* opts);\fR
71 .br
72 \fBattr_t slk_attr(void);\fR
73 .br
74 \fBint slk_color(short color_pair_number);\fR
75 .br
76 .SH DESCRIPTION
77 The slk* functions manipulate the set of soft function-key labels that exist on
78 many terminals.  For those terminals that do not have soft labels,
79 \fBcurses\fR takes over the bottom line of \fBstdscr\fR, reducing the size of
80 \fBstdscr\fR and the variable \fBLINES\fR.  \fBcurses\fR standardizes on eight
81 labels of up to eight characters each. In addition to this, the ncurses
82 implementation supports a mode where it simulates 12 labels of up to five
83 characters each. This is most common for todays PC like enduser devices.
84 Please note that ncurses simulates this mode by taking over up to two lines at
85 the bottom of the screen, it doesn't try to use any hardware support for this
86 mode.
87
88 The \fBslk_init\fR routine must be called before \fBinitscr\fR or \fBnewterm\fR
89 is called.  If \fBinitscr\fR eventually uses a line from \fBstdscr\fR to
90 emulate the soft labels, then \fIfmt\fR determines how the labels are arranged
91 on the screen.  Setting \fIfmt\fR to \fB0\fR indicates a 3-2-3 arrangement of
92 the labels, \fB1\fR indicates a 4-4 arrangement and \fB2\fR indicates the
93 PC like 4-4-4 mode. If \fBfmt\fR is set to \fB3\fR, it is again the PC like
94 4-4-4 mode, but in addition an index line is generated, helping the user to
95 identify the key numbers easily.
96
97 The \fBslk_set\fR routine requires \fIlabnum\fR to be a label number,
98 from \fB1\fR to \fB8\fR (resp. \fB12\fR); \fIlabel\fR must be the string
99 to be put on the label, up to eight (resp. five) characters in length.
100 A null string or a null pointer sets up a blank label. \fIfmt\fR is either
101 \fB0\fR, \fB1\fR, or \fB2\fR, indicating whether the label is  to be
102 left-justified, centered, or right-justified, respectively, within the
103 label.
104
105 The \fBslk_refresh\fR and \fBslk_noutrefresh\fR routines correspond to
106 the \fBwrefresh\fR and \fBwnoutrefresh\fR routines.
107
108 The \fBslk_label\fR routine returns the current label for label number
109 \fIlabnum\fR, with leading and trailing blanks stripped.
110
111 The \fBslk_clear\fR routine clears the soft labels from the screen.
112
113 The \fBslk_restore\fR routine restores the soft labels to the screen
114 after a \fBslk_clear\fR has been performed.
115
116 The \fBslk_touch\fR routine forces all the soft labels to be output
117 the next time a \fBslk_noutrefresh\fR is performed.
118
119 The \fBslk_attron\fR, \fBslk_attrset\fR, \fBslk_attroff\fR and \fBslk_attr\fR
120 routines correspond to \fBattron\fR, \fBattrset\fR, \fBattroff\fR and \fBattr_get\fR.
121 They have an effect only if soft labels are simulated on the bottom line of
122 the screen.  The default highlight for soft keys is A_STANDOUT (as in
123 System V curses, which does not document this fact).
124
125 The \fBslk_color\fR routine corresponds to \fBcolor_set\fR. It has an effect only
126 if soft labels are simulated on the bottom line of the screen.
127
128 .SH RETURN VALUE
129 These routines return \fBERR\fR upon failure and OK (SVr4 specifies only "an
130 integer value other than \fBERR\fR") upon successful completion. \fBslk_attr\fR
131 returns the attribute used for the soft keys.
132
133 \fBslk_label\fR returns \fBNULL\fR on error.
134 .SH NOTES
135 Most applications would use \fBslk_noutrefresh\fR because a
136 \fBwrefresh\fR is likely to follow soon.
137 .SH PORTABILITY
138 The XSI Curses standard, Issue 4, describes these functions.  It changes the
139 argument type of the attribute-manipulation functions \fBslk_attron\fR,
140 \fBslk_attroff\fR, \fBslk_attrset\fR to be \fBattr_t\fR, and adds \fBconst\fR
141 qualifiers. The format codes \fB2\fR and \fB3\fR for \fBslk_init()\fR and the
142 function \fBslk_attr\fR are specific to ncurses.
143 .SH SEE ALSO
144 \fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X)
145 .\"#
146 .\"# The following sets edit modes for GNU EMACS
147 .\"# Local Variables:
148 .\"# mode:nroff
149 .\"# fill-column:79
150 .\"# End: