Debian Codegraph @

upstream/debian-trixie/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.48 2025/02/02 00:04:21 tom Exp $
31 .TH border_set 3NCURSES 2025-02-01 "ncurses 6.5" "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
76 \fBint \fIn\fB);\fR
77 \fBint mvwhline_set(WINDOW *\fIwin\fP, \fBint \fIy\fB, int \fIx\fP,
78 \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
79 .PP
80 \fBint vline_set(const cchar_t *\fIwch\fB, int \fIn\fB);\fR
81 \fBint wvline_set(WINDOW *\fIwin\fP, \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
82 \fBint mvvline_set(int \fIy\fB, int \fIx\fP, \fBconst cchar_t *\fIwch\fB,\fR
83 \fBint \fIn\fB);\fR
84 \fBint mvwvline_set(WINDOW *\fIwin\fP, \fBint \fIy\fB, int \fIx\fP,
85 \fBconst cchar_t *\fIwch\fB, int \fIn\fB);\fR
86 .fi
87 .SH DESCRIPTION
88 The
89 \fBborder_set\fP
90 and
91 \fBwborder_set\fP
92 functions draw a border around the edges of the current or specified window.
93 These functions do not change the cursor position, and do not wrap.
94 .PP
95 Other than the window, each argument is a complex character with attributes:
96 .RS
97 \fIls\fP \- left side,
98 .br
99 \fIrs\fP \- right side,
100 .br
101 \fIts\fP \- top side,
102 .br
103 \fIbs\fP \- bottom side,
104 .br
105 \fItl\fP \- top left-hand corner,
106 .br
107 \fItr\fP \- top right-hand corner,
108 .br
109 \fIbl\fP \- bottom left-hand corner, and
110 .br
111 \fIbr\fP \- bottom right-hand corner.
112 .RE
113 .PP
114 If any of these arguments is zero, then the corresponding
115 default values (defined in \fBcurses.h\fP) are used instead:
116 .RS
117 \fBWACS_VLINE\fP,
118 .br
119 \fBWACS_VLINE\fP,
120 .br
121 \fBWACS_HLINE\fP,
122 .br
123 \fBWACS_HLINE\fP,
124 .br
125 \fBWACS_ULCORNER\fP,
126 .br
127 \fBWACS_URCORNER\fP,
128 .br
129 \fBWACS_LLCORNER\fP, and
130 .br
131 \fBWACS_LRCORNER\fP.
132 .RE
133 .PP
134 \fBbox_set(\fIwin\fR, \fIverch\fB, \fIhorch\fB);\fR
135 is a shorthand for the following call:
136 .PP
137 \fBwborder_set(\fIwin\fB, \fIverch\fB, \fIverch\fB,\fR
138 \fIhorch\fB, \fIhorch\fB, NULL, NULL, NULL, NULL);\fR
139 .PP
140 The
141 \fB*line_set\fP
142 functions use
143 \fIwch\fP
144 to draw a line starting at the current cursor position in the window.
145 The line is at most \fIn\fP characters long or as many as fit into the window.
146 The current cursor position is not changed.
147 .PP
148 The
149 \fBhline_set\fP,
150 \fBmvhline_set\fP,
151 \fBmvwhline_set\fP, and
152 \fBwhline_set\fP
153 functions draw a line proceeding toward the last column of the same line.
154 .PP
155 The
156 \fBvline_set\fP,
157 \fBmvvline_set\fP,
158 \fBmvwvline_set\fP, and
159 \fBwvline_set\fP
160 functions draw a line proceeding toward the last line of the window.
161 .SH RETURN VALUE
162 Upon successful completion, these functions return
163 \fBOK\fP.
164 Otherwise, they return
165 \fBERR\fP.
166 .PP
167 Functions using a window parameter return
168 .B ERR
169 if it is null.
170 .PP
171 Functions prefixed with \*(``mv\*('' first perform cursor movement and
172 fail if the position
173 .RI ( y ,
174 .IR x )
175 is outside the window boundaries.
176 .SH NOTES
177 .BR \%border_set ","
178 .BR \%hline_set ","
179 .BR \%mvhline_set ","
180 .BR \%mvvline_set ","
181 .BR \%mvwhline_set ","
182 .BR \%mvwvline_set ","
183 and
184 .B \%vline_set
185 may be implemented as macros.
186 .SH PORTABILITY
187 X/Open Curses Issue\ 4 describes these functions.
188 It specifies no error conditions for them.
189 .SH HISTORY
190 X/Open Curses Issue\ 4 (1995) initially specified these functions.
191 .SH SEE ALSO
192 \fB\%ncurses\fP(3NCURSES),
193 \fB\%add_wch\fP(3NCURSES),
194 \fB\%border\fP(3NCURSES),
195 \fB\%outopts\fP(3NCURSES)