<!--
****************************************************************************
- * Copyright (c) 1998-2010,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_slk.3x,v 1.23 2016/10/15 17:02:31 tom Exp @
+ * @Id: curs_slk.3x,v 1.29 2017/03/18 01:00:30 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
<STRONG>int</STRONG> <STRONG>slk_init(int</STRONG> <STRONG>fmt);</STRONG>
+
<STRONG>int</STRONG> <STRONG>slk_set(int</STRONG> <STRONG>labnum,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*label,</STRONG> <STRONG>int</STRONG> <STRONG>fmt);</STRONG>
+ <STRONG>int</STRONG> <STRONG>slk_wset(int</STRONG> <STRONG>labnum,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*label,</STRONG> <STRONG>int</STRONG> <STRONG>fmt);</STRONG>
+
+ <STRONG>char</STRONG> <STRONG>*slk_label(int</STRONG> <STRONG>labnum);</STRONG>
+
<STRONG>int</STRONG> <STRONG>slk_refresh(void);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_noutrefresh(void);</STRONG>
- <STRONG>char</STRONG> <STRONG>*slk_label(int</STRONG> <STRONG>labnum);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_clear(void);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_restore(void);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_touch(void);</STRONG>
+
<STRONG>int</STRONG> <STRONG>slk_attron(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_attroff(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_attrset(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_attr_on(attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
<STRONG>int</STRONG> <STRONG>slk_attr_off(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG> <STRONG>opts);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_attr_set(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>short</STRONG> <STRONG>color_pair,</STRONG>
- <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
+ <STRONG>int</STRONG> <STRONG>slk_attr_set(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>short</STRONG> <STRONG>pair,</STRONG> <STRONG>void*</STRONG>
+ <STRONG>opts);</STRONG>
+
<STRONG>attr_t</STRONG> <STRONG>slk_attr(void);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <STRONG>color_pair);</STRONG>
- <STRONG>int</STRONG> <STRONG>slk_wset(int</STRONG> <STRONG>labnum,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*label,</STRONG> <STRONG>int</STRONG> <STRONG>fmt);</STRONG>
+
+ <STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <STRONG>pair);</STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
eight characters each. In addition to this, the ncurses
implementation supports a mode where it simulates 12 la-
bels of up to five characters each. This is useful for
- today's PC-like enduser devices. ncurses simulates this
- mode by taking over up to two lines at the bottom of the
- screen; it does not try to use any hardware support for
- this mode.
+ PC-like enduser devices. ncurses simulates this mode by
+ taking over up to two lines at the bottom of the screen;
+ it does not try to use any hardware support for this mode.
- The <STRONG>slk_init</STRONG> routine must be called before <STRONG>initscr</STRONG> or
+
+</PRE><H3><a name="h3-Initialization">Initialization</a></H3><PRE>
+ The <STRONG>slk_init</STRONG> routine must be called before <STRONG>initscr</STRONG> or
<STRONG>newterm</STRONG> is called. If <STRONG>initscr</STRONG> eventually uses a line from
<STRONG>stdscr</STRONG> to emulate the soft labels, then <EM>fmt</EM> determines how
the labels are arranged on the screen:
- <STRONG>0</STRONG> indicates a 3-2-3 arrangement of the labels.
+ <STRONG>0</STRONG> indicates a 3-2-3 arrangement of the labels.
+
+ <STRONG>1</STRONG> indicates a 4-4 arrangement
- <STRONG>1</STRONG> indicates a 4-4 arrangement
+ <STRONG>2</STRONG> indicates the PC-like 4-4-4 mode.
- <STRONG>2</STRONG> indicates the PC-like 4-4-4 mode.
+ <STRONG>3</STRONG> is again the PC-like 4-4-4 mode, but in addition an
+ index line is generated, helping the user to identi-
+ fy the key numbers easily.
- <STRONG>3</STRONG> is again the PC-like 4-4-4 mode, but in addition
- an index line is generated, helping the user to
- identify the key numbers easily.
- The <STRONG>slk_set</STRONG> routine (and the <STRONG>slk_wset</STRONG> routine for the
+</PRE><H3><a name="h3-Labels">Labels</a></H3><PRE>
+ The <STRONG>slk_set</STRONG> routine (and the <STRONG>slk_wset</STRONG> routine for the
wide-character library) has three parameters:
- <EM>labnum</EM>
- is the label number, from <STRONG>1</STRONG> to <STRONG>8</STRONG> (12 for <EM>fmt</EM>
- in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>);
+ <EM>labnum</EM>
+ is the label number, from <STRONG>1</STRONG> to <STRONG>8</STRONG> (12 for <EM>fmt</EM> in
+ <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>);
+
+ <EM>label</EM>
+ is be the string to put on the label, up to eight
+ (five for <EM>fmt</EM> in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>) characters in
+ length. A null string or a null pointer sets up a
+ blank label.
- <EM>label</EM>
- is be the string to put on the label, up to
- eight (five for <EM>fmt</EM> in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>)
- characters in length. A null string or a null
- pointer sets up a blank label.
+ <EM>fmt</EM> is either <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG>, indicating whether the label
+ is to be left-justified, centered, or right-justi-
+ fied, respectively, within the label.
+
+ The <STRONG>slk_label</STRONG> routine returns the current label for label
+ number <EM>labnum</EM>, with leading and trailing blanks stripped.
- <EM>fmt</EM> is either <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG>, indicating whether the
- label is to be left-justified, centered, or
- right-justified, respectively, within the la-
- bel.
+</PRE><H3><a name="h3-Screen-updates">Screen updates</a></H3><PRE>
The <STRONG>slk_refresh</STRONG> and <STRONG>slk_noutrefresh</STRONG> routines correspond to
the <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> routines.
- The <STRONG>slk_label</STRONG> routine returns the current label for label
- number <EM>labnum</EM>, with leading and trailing blanks stripped.
-
The <STRONG>slk_clear</STRONG> routine clears the soft labels from the
screen.
The <STRONG>slk_touch</STRONG> routine forces all the soft labels to be
output the next time a <STRONG>slk_noutrefresh</STRONG> is performed.
+
+</PRE><H3><a name="h3-Video-attributes">Video attributes</a></H3><PRE>
The <STRONG>slk_attron</STRONG>, <STRONG>slk_attrset</STRONG>, <STRONG>slk_attroff</STRONG> and <STRONG>slk_attr</STRONG> rou-
tines correspond to <STRONG>attron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>attroff</STRONG> and <STRONG>attr_get</STRONG>.
They have an effect only if soft labels are simulated on
soft keys is A_STANDOUT (as in System V curses, which does
not document this fact).
+
+</PRE><H3><a name="h3-Colors">Colors</a></H3><PRE>
The <STRONG>slk_color</STRONG> routine corresponds to <STRONG>color_set</STRONG>. It has an
effect only if soft labels are simulated on the bottom
line of the screen.
X/Open defines no error conditions. In this implementa-
tion
- <STRONG>slk_attr</STRONG>
- returns the attribute used for the soft keys.
+ <STRONG>slk_attr</STRONG>
+ returns the attribute used for the soft keys.
- <STRONG>slk_attroff</STRONG>, <STRONG>slk_attron</STRONG>, <STRONG>slk_clear</STRONG>,
- <STRONG>slk_noutrefresh</STRONG>, <STRONG>slk_refresh</STRONG>, <STRONG>slk_touch</STRONG>
- return an error if the terminal or the soft-
- keys were not initialized.
+ <STRONG>slk_attroff</STRONG>, <STRONG>slk_attron</STRONG>, <STRONG>slk_clear</STRONG>, <STRONG>slk_noutrefresh</STRONG>,
+ <STRONG>slk_refresh</STRONG>, <STRONG>slk_touch</STRONG>
+ return an error if the terminal or the softkeys
+ were not initialized.
- <STRONG>slk_attrset</STRONG>
- returns an error if the terminal or the soft-
- keys were not initialized.
+ <STRONG>slk_attrset</STRONG>
+ returns an error if the terminal or the softkeys
+ were not initialized.
- <STRONG>slk_attr_set</STRONG>
- returns an error if the terminal or the soft-
- keys were not initialized, or the color pair
- is outside the range 0..COLOR_PAIRS-1, or opts
- is not null.
+ <STRONG>slk_attr_set</STRONG>
+ returns an error if the terminal or the softkeys
+ were not initialized, or the color pair is outside
+ the range 0..COLOR_PAIRS-1, or opts is not null.
- <STRONG>slk_color</STRONG>
- returns an error if the terminal or the soft-
- keys were not initialized, or the color pair
- is outside the range 0..COLOR_PAIRS-1.
+ <STRONG>slk_color</STRONG>
+ returns an error if the terminal or the softkeys
+ were not initialized, or the color pair is outside
+ the range 0..COLOR_PAIRS-1.
- <STRONG>slk_init</STRONG>
- returns an error if the format parameter is
- outside the range 0..3.
+ <STRONG>slk_init</STRONG>
+ returns an error if the format parameter is out-
+ side the range 0..3.
- <STRONG>slk_label</STRONG>
- returns <STRONG>NULL</STRONG> on error.
+ <STRONG>slk_label</STRONG>
+ returns <STRONG>NULL</STRONG> on error.
- <STRONG>slk_set</STRONG>
- returns an error if the terminal or the soft-
- keys were not initialized, or the <EM>labnum</EM> pa-
- rameter is outside the range of label counts,
- or if the format parameter is outside the
- range 0..2, or if memory for the labels cannot
- be allocated.
+ <STRONG>slk_set</STRONG>
+ returns an error if the terminal or the softkeys
+ were not initialized, or the <EM>labnum</EM> parameter is
+ outside the range of label counts, or if the for-
+ mat parameter is outside the range 0..2, or if
+ memory for the labels cannot be allocated.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- The XSI Curses standard, Issue 4, describes these func-
- tions. It changes the argument type of the attribute-ma-
- nipulation functions <STRONG>slk_attron</STRONG>, <STRONG>slk_attroff</STRONG>, <STRONG>slk_attrset</STRONG>
- to be <STRONG>attr_t</STRONG>, and adds <STRONG>const</STRONG> qualifiers. The format codes
- <STRONG>2</STRONG> and <STRONG>3</STRONG> for <STRONG>slk_init</STRONG> and the function <STRONG>slk_attr</STRONG> are specif-
- ic to ncurses.
+ The XSI Curses standard, Issue 4, described the soft-key
+ functions, with some differences from SVr4 curses:
+
+ <STRONG>o</STRONG> It added functions like the SVr4 the attribute-manipu-
+ lation functions <STRONG>slk_attron</STRONG>, <STRONG>slk_attroff</STRONG>, <STRONG>slk_attrset</STRONG>
+ which use <STRONG>attr_t</STRONG> parameters, along with a reserved
+ <EM>opts</EM> parameter.
+
+ One of these new functions (<STRONG>slk_attr_set</STRONG>) also has a
+ color-pair parameter.
+
+ <STRONG>o</STRONG> It added <STRONG>const</STRONG> qualifiers to parameters (unnecessari-
+ ly), and
+
+ <STRONG>o</STRONG> It added <STRONG>slk_color</STRONG>.
+
+ The format codes <STRONG>2</STRONG> and <STRONG>3</STRONG> for <STRONG>slk_init</STRONG> and the function
+ <STRONG>slk_attr</STRONG> are specific to ncurses.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<ul>
<li><a href="#h2-NAME">NAME</a></li>
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
-<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
+<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
+<ul>
+<li><a href="#h3-Initialization">Initialization</a></li>
+<li><a href="#h3-Labels">Labels</a></li>
+<li><a href="#h3-Screen-updates">Screen updates</a></li>
+<li><a href="#h3-Video-attributes">Video attributes</a></li>
+<li><a href="#h3-Colors">Colors</a></li>
+</ul>
+</li>
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
<li><a href="#h2-NOTES">NOTES</a></li>
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>