]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_border_set.3x
ncurses 6.2 - patch 20200212
[ncurses.git] / man / curs_border_set.3x
1 .\"***************************************************************************
2 .\" Copyright 2019,2020 Thomas E. Dickey                                     *
3 .\" Copyright 2002-2011,2012 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_set.3x,v 1.13 2020/02/02 23:34:34 tom Exp $
31 .TH curs_border_set 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_set\fR,
40 \fBwborder_set\fR,
41 \fBbox_set\fR,
42 \fBhline_set\fR,
43 \fBwhline_set\fR,
44 \fBmvhline_set\fR,
45 \fBmvwhline_set\fR,
46 \fBvline_set\fR,
47 \fBwvline_set\fR,
48 \fBmvvline_set\fR,
49 \fBmvwvline_set\fR \- create \fBcurses\fR borders or lines using complex characters and renditions
50 .ad
51 .hy
52 .SH SYNOPSIS
53 .PP
54 \fB#include <curses.h>\fR
55 .sp
56 \fBint border_set(\fR
57    \fBconst cchar_t *\fR\fIls\fR, \fBconst cchar_t *\fR\fIrs\fR,
58    \fBconst cchar_t *\fR\fIts\fR, \fBconst cchar_t *\fR\fIbs\fR,
59    \fBconst cchar_t *\fR\fItl\fR, \fBconst cchar_t *\fR\fItr\fR,
60    \fBconst cchar_t *\fR\fIbl\fR, \fBconst cchar_t *\fR\fIbr\fR
61 \fB);\fR
62 .br
63 \fBint wborder_set(\fR
64    \fBWINDOW *win\fR,
65    \fBconst cchar_t *\fR\fIls\fR, \fBconst cchar_t *\fR\fIrs\fR,
66    \fBconst cchar_t *\fR\fIts\fR, \fBconst cchar_t *\fR\fIbs\fR,
67    \fBconst cchar_t *\fR\fItl\fR, \fBconst cchar_t *\fR\fItr\fR,
68    \fBconst cchar_t *\fR\fIbl\fR, \fBconst cchar_t *\fR\fIbr\fR\fB);\fR
69 .br
70 \fBint box_set(\fR
71    \fBWINDOW *win\fR,
72    \fBconst cchar_t *\fR\fIverch\fR,
73    \fBconst cchar_t *\fR\fIhorch\fR\fB);\fR
74 .br
75 \fBint hline_set(\fR
76    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
77 .br
78 \fBint whline_set(\fR
79    \fBWINDOW *\fR\fIwin\fR,
80    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
81 .br
82 \fBint mvhline_set(\fR
83    \fBint \fR\fIy\fR, \fBint \fR\fIx\fR,
84    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
85 .br
86 \fBint mvwhline_set(\fR
87    \fBWINDOW *\fR\fIwin\fR,
88    \fBint \fR\fIy\fR, \fBint \fR\fIx\fR,
89    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
90 .br
91 \fBint vline_set(\fR
92    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
93 .br
94 \fBint wvline_set(\fR
95    \fBWINDOW *\fR\fIwin\fR,
96    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
97 .br
98 \fBint mvvline_set(\fR
99    \fBint \fR\fIy\fR, \fBint \fR\fIx\fR,
100    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
101 .br
102 \fBint mvwvline_set(\fR
103    \fBWINDOW *\fR\fIwin\fR,
104    \fBint \fR\fIy\fR, \fBint \fR\fIx\fR,
105    \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR
106 .br
107 .SH DESCRIPTION
108 .PP
109 The
110 \fBborder_set\fR
111 and
112 \fBwborder_set\fR
113 functions draw a border around the edges of the current or specified window.
114 These functions do not change the cursor position, and do not wrap.
115 .PP
116 Other than the window, each argument is a complex character with attributes:
117 .RS
118 \fIls\fR \- left side,
119 .br
120 \fIrs\fR \- right side,
121 .br
122 \fIts\fR \- top side,
123 .br
124 \fIbs\fR \- bottom side,
125 .br
126 \fItl\fR \- top left-hand corner,
127 .br
128 \fItr\fR \- top right-hand corner,
129 .br
130 \fIbl\fR \- bottom left-hand corner, and
131 .br
132 \fIbr\fR \- bottom right-hand corner.
133 .RE
134 .PP
135 If any of these arguments is zero, then the corresponding
136 default values (defined in \fBcurses.h\fR) are used instead:
137 .RS
138 \fBWACS_VLINE\fR,
139 .br
140 \fBWACS_VLINE\fR,
141 .br
142 \fBWACS_HLINE\fR,
143 .br
144 \fBWACS_HLINE\fR,
145 .br
146 \fBWACS_ULCORNER\fR,
147 .br
148 \fBWACS_URCORNER\fR,
149 .br
150 \fBWACS_LLCORNER\fR, and
151 .br
152 \fBWACS_LRCORNER\fR.
153 .RE
154 .PP
155 \fBbox_set(\fR\fIwin\fR, \fIverch\fR\fB, \fR\fIhorch\fR\fB);\fR
156 is a shorthand for the following call:
157 .PP
158 \fBwborder_set(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIverch\fR\fB,\fR
159     \fIhorch\fR\fB, \fR\fIhorch\fR\fB, NULL, NULL, NULL, NULL);\fR
160 .PP
161 The
162 \fB*line_set\fR
163 functions use
164 \fIwch\fR
165 to draw a line starting at the current cursor position in the window.
166 The line is at most \fIn\fR characters long or as many as fit into the window.
167 The current cursor position is not changed.
168 .PP
169 The
170 \fBhline_set\fR,
171 \fBmvhline_set\fR,
172 \fBmvwhline_set\fR, and
173 \fBwhline_set\fR
174 functions draw a line proceeding toward the last column of the same line.
175 .PP
176 The
177 \fBvline_set\fR,
178 \fBmvvline_set\fR,
179 \fBmvwvline_set\fR, and
180 \fBwvline_set\fR
181 functions draw a line proceeding toward the last line of the window.
182 .br
183 .SH NOTES
184 .PP
185 Note that
186 \fBborder_set\fR,
187 \fBhline_set\fR,
188 \fBmvhline_set\fR,
189 \fBmvvline_set\fR,
190 \fBmvwhline_set\fR,
191 \fBmvwvline_set\fR, and
192 \fBvline_set\fR
193 may be macros.
194 .br
195 .SH RETURN VALUE
196 .PP
197 Upon successful completion, these functions return
198 \fBOK\fR.
199 Otherwise, they return
200 \fBERR\fR.
201 .PP
202 Functions using a window parameter return an error if it is null.
203 .PP
204 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
205 \fBwmove\fP, and return an error if the position is outside the window,
206 or if the window pointer is null.
207 .SH SEE ALSO
208 \fBncurses\fR(3X),
209 \fBcurs_add_wch\fR(3X),
210 \fBcurs_border\fR(3X),
211 \fBcurs_outopts\fR(3X)