Debian Codegraph @

upstream/debian-unstable/man3/border_set.3ncurses

raw
1 .\"***************************************************************************
2 .\" Copyright 2019-2024,2025 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.50 2025/10/21 00:10:56 tom Exp $
31 .TH border_set 3NCURSES 2025-10-20 "ncurses 6.6" "Library calls"
32 .ie \n(.g \{\
33 .ds `` \(lq
34 .ds '' \(rq
35 .\}
36 .el \{\
37 .ie t .ds `` ``
38 .el .ds `` ""
39 .ie t .ds '' ''
40 .el .ds '' ""
41 .\}
42 .SH NAME
43 \fB\%border_set\fP,
44 \fB\%wborder_set\fP,
45 \fB\%box_set\fP,
46 \fB\%hline_set\fP,
47 \fB\%whline_set\fP,
48 \fB\%mvhline_set\fP,
49 \fB\%mvwhline_set\fP,
50 \fB\%vline_set\fP,
51 \fB\%wvline_set\fP,
52 \fB\%mvvline_set\fP,
53 \fB\%mvwvline_set\fP \-
54 draw borders and lines in a \fIcurses\fR window of wide characters
55 .SH SYNOPSIS
56 .nf
57 \fB#include <curses.h>
58 .PP
59 \fBint border_set(const cchar_t *\fIls\fB, const cchar_t *\fIrs\fP,
60 \fBconst cchar_t *\fIts\fB, const cchar_t *\fIbs\fP,
61 \fBconst cchar_t *\fItl\fB, const cchar_t *\fItr\fP,
62 \fBconst cchar_t *\fIbl\fB, const cchar_t *\fIbr\fB);\fR
63 .br
64 \fBint wborder_set(\fBWINDOW *\fIwin\fP,
65 \fBconst cchar_t *\fIls\fB, const cchar_t *\fIrs\fP,
66 \fBconst cchar_t *\fIts\fB, const cchar_t *\fIbs\fP,
67 \fBconst cchar_t *\fItl\fB, const cchar_t *\fItr\fP,
68 \fBconst cchar_t *\fIbl\fB, const cchar_t *\fIbr\fB);\fR
69 .PP
70 \fBint box_set(\fBWINDOW *\fIwin\fP, \fBconst cchar_t *\fIverch\fP,
71 \fBconst cchar_t *\fIhorch\fB);\fR
72 .PP
73 \fBint hline_set(const cchar_t *\fIwch\fB, int \fIn\fB);\fR
74 \fBint whline_set(WINDOW *\fIwin\fP, \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
75 \fBint mvhline_set(int \fIy\fB, int \fIx\fP, \fBconst cchar_t *\fIwch\fB,\fR \fBint \fIn\fB);\fR
76 \fBint mvwhline_set(WINDOW *\fIwin\fP, \fBint \fIy\fB, int \fIx\fP,
77 \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
78 .PP
79 \fBint vline_set(const cchar_t *\fIwch\fB, int \fIn\fB);\fR
80 \fBint wvline_set(WINDOW *\fIwin\fP, \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
81 \fBint mvvline_set(int \fIy\fB, int \fIx\fP, \fBconst cchar_t *\fIwch\fB,\fR \fBint \fIn\fB);\fR
82 \fBint mvwvline_set(WINDOW *\fIwin\fP, \fBint \fIy\fB, int \fIx\fP,
83 \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
84 .fi
85 .SH DESCRIPTION
86 The
87 \fBborder_set\fP
88 and
89 \fBwborder_set\fP
90 functions draw a border around the edges of the current or specified window.
91 These functions do not change the cursor position, and do not wrap.
92 .PP
93 Other than the window, each argument is a complex character with attributes:
94 .RS
95 \fIls\fP \- left side,
96 .br
97 \fIrs\fP \- right side,
98 .br
99 \fIts\fP \- top side,
100 .br
101 \fIbs\fP \- bottom side,
102 .br
103 \fItl\fP \- top left-hand corner,
104 .br
105 \fItr\fP \- top right-hand corner,
106 .br
107 \fIbl\fP \- bottom left-hand corner, and
108 .br
109 \fIbr\fP \- bottom right-hand corner.
110 .RE
111 .PP
112 If any of these arguments is zero, then the corresponding
113 default values (defined in \fBcurses.h\fP) are used instead:
114 .RS
115 \fBWACS_VLINE\fP,
116 .br
117 \fBWACS_VLINE\fP,
118 .br
119 \fBWACS_HLINE\fP,
120 .br
121 \fBWACS_HLINE\fP,
122 .br
123 \fBWACS_ULCORNER\fP,
124 .br
125 \fBWACS_URCORNER\fP,
126 .br
127 \fBWACS_LLCORNER\fP, and
128 .br
129 \fBWACS_LRCORNER\fP.
130 .RE
131 .PP
132 \fBbox_set(\fIwin\fR, \fIverch\fB, \fIhorch\fB);\fR
133 is a shorthand for the following call:
134 .PP
135 \fBwborder_set(\fIwin\fB, \fIverch\fB, \fIverch\fB,\fR
136 \fIhorch\fB, \fIhorch\fB, NULL, NULL, NULL, NULL);\fR
137 .PP
138 The
139 \fB*line_set\fP
140 functions use
141 \fIwch\fP
142 to draw a line starting at the current cursor position in the window.
143 The line is at most \fIn\fP characters long or as many as fit into the window.
144 The current cursor position is not changed.
145 .PP
146 The
147 \fBhline_set\fP,
148 \fBmvhline_set\fP,
149 \fBmvwhline_set\fP, and
150 \fBwhline_set\fP
151 functions draw a line proceeding toward the last column of the same line.
152 .PP
153 The
154 \fBvline_set\fP,
155 \fBmvvline_set\fP,
156 \fBmvwvline_set\fP, and
157 \fBwvline_set\fP
158 functions draw a line proceeding toward the last line of the window.
159 .SH RETURN VALUE
160 Upon successful completion, these functions return
161 \fBOK\fP.
162 Otherwise, they return
163 \fBERR\fP.
164 .PP
165 Functions using a window parameter return
166 .B ERR
167 if it is null.
168 .PP
169 Functions prefixed with \*(``mv\*('' first perform cursor movement and
170 fail if the position
171 .RI ( y ,
172 .IR x )
173 is outside the window boundaries.
174 .SH NOTES
175 .BR \%border_set ","
176 .BR \%hline_set ","
177 .BR \%mvhline_set ","
178 .BR \%mvvline_set ","
179 .BR \%mvwhline_set ","
180 .BR \%mvwvline_set ","
181 and
182 .B \%vline_set
183 may be implemented as macros.
184 .SH PORTABILITY
185 X/Open Curses Issue\ 4 describes these functions.
186 It specifies no error conditions for them.
187 .SH HISTORY
188 X/Open Curses Issue\ 4 (1995) initially specified these functions.
189 .SH SEE ALSO
190 \fB\%ncurses\fP(3NCURSES),
191 \fB\%add_wch\fP(3NCURSES),
192 \fB\%border\fP(3NCURSES),
193 \fB\%outopts\fP(3NCURSES)