]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_border.3x
ncurses 6.2 - patch 20200919
[ncurses.git] / man / curs_border.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
3 .\" Copyright 1998-2007,2010 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_border.3x,v 1.25 2020/02/02 23:34:34 tom Exp $
31 .TH curs_border 3X ""
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .na
37 .hy 0
38 .SH NAME
39 \fBborder\fR,
40 \fBwborder\fR,
41 \fBbox\fR,
42 \fBhline\fR,
43 \fBwhline\fR,
44 \fBvline\fR,
45 \fBwvline\fR,
46 \fBmvhline\fR,
47 \fBmvwhline\fR,
48 \fBmvvline\fR,
49 \fBmvwvline\fR \- create \fBcurses\fR borders, horizontal and vertical lines
50 .ad
51 .hy
52 .SH SYNOPSIS
53 \fB#include <curses.h>\fR
54 .br
55 \fBint border(chtype ls, chtype rs, chtype ts, chtype bs,\fR
56    \fBchtype tl, chtype tr, chtype bl, chtype br);\fR
57 .br
58 \fBint wborder(WINDOW *win, chtype ls, chtype rs,\fR
59    \fBchtype ts, chtype bs, chtype tl, chtype tr,\fR
60    \fBchtype bl, chtype br);\fR
61 .br
62 \fBint box(WINDOW *win, chtype verch, chtype horch);\fR
63 .br
64 \fBint hline(chtype ch, int n);\fR
65 .br
66 \fBint whline(WINDOW *win, chtype ch, int n);\fR
67 .br
68 \fBint vline(chtype ch, int n);\fR
69 .br
70 \fBint wvline(WINDOW *win, chtype ch, int n);\fR
71 .br
72 \fBint mvhline(int y, int x, chtype ch, int n);\fR
73 .br
74 \fBint mvwhline(WINDOW *, int y, int x, chtype ch, int n);\fR
75 .br
76 \fBint mvvline(int y, int x, chtype ch, int n);\fR
77 .br
78 \fBint mvwvline(WINDOW *, int y, int x, chtype ch, int n);\fR
79 .br
80 .SH DESCRIPTION
81 The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines
82 draw a box around the edges of a window.
83 Other than the window, each argument is a character with attributes:
84 .sp
85 .RS
86 \fIls\fR \- left side,
87 .br
88 \fIrs\fR \- right side,
89 .br
90 \fIts\fR \- top side,
91 .br
92 \fIbs\fR \- bottom side,
93 .br
94 \fItl\fR \- top left-hand corner,
95 .br
96 \fItr\fR \- top right-hand corner,
97 .br
98 \fIbl\fR \- bottom left-hand corner, and
99 .br
100 \fIbr\fR \- bottom right-hand corner.
101 .RE
102 .PP
103 If any of these arguments is zero, then the corresponding
104 default values (defined in \fBcurses.h\fR) are used instead:
105 .sp
106 .RS
107 \fBACS_VLINE\fR,
108 .br
109 \fBACS_VLINE\fR,
110 .br
111 \fBACS_HLINE\fR,
112 .br
113 \fBACS_HLINE\fR,
114 .br
115 \fBACS_ULCORNER\fR,
116 .br
117 \fBACS_URCORNER\fR,
118 .br
119 \fBACS_LLCORNER\fR,
120 .br
121 \fBACS_LRCORNER\fR.
122 .RE
123 .PP
124 \fBbox(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIhorch\fR\fB)\fR is a shorthand
125 for the following call: \fBwborder(\fR\fIwin\fR\fB,\fR \fIverch\fR\fB,\fR
126 \fIverch\fR\fB,\fR \fIhorch\fR\fB,\fR \fIhorch\fR\fB, 0, 0, 0, 0)\fR.
127 .PP
128 The \fBhline\fR and \fBwhline\fR functions draw a horizontal (left to right)
129 line using \fIch\fR starting at the current cursor position in the window.
130 The
131 current cursor position is not changed.
132 The line is at most \fIn\fR characters
133 long, or as many as fit into the window.
134 .PP
135 The \fBvline\fR and \fBwvline\fR functions draw a vertical (top to bottom) line
136 using \fIch\fR starting at the current cursor position in the window.
137 The
138 current cursor position is not changed.
139 The line is at most \fIn\fR characters
140 long, or as many as fit into the window.
141 .SH RETURN VALUE
142 All routines return the integer \fBOK\fR.
143 The SVr4.0 manual says "or a
144 non-negative integer if \fBimmedok\fR is set", but this appears to be an error.
145 .PP
146 X/Open does not define any error conditions.
147 This implementation returns an error
148 if the window pointer is null.
149 .PP
150 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
151 \fBwmove\fP, and return an error if the position is outside the window,
152 or if the window pointer is null.
153 .SH NOTES
154 The borders generated by these functions are \fIinside\fR borders (this
155 is also true of SVr4 curses, though the fact is not documented).
156 .PP
157 Note that \fBborder\fR and \fBbox\fR may be macros.
158 .SH PORTABILITY
159 These functions are described in the XSI Curses standard, Issue 4.
160 The standard specifies that they return \fBERR\fR on failure,
161 but specifies no error conditions.
162 .SH SEE ALSO
163 \fBcurses\fR(3X), \fBcurs_outopts\fR(3X).