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