]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_border.3x
ncurses 6.4 - patch 20231125
[ncurses.git] / man / curs_border.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2022,2023 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.43 2023/11/25 11:31:27 tom Exp $
31 .TH curs_border 3X 2023-11-25 "ncurses 6.4" "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\fP,
44 \fB\%wborder\fP,
45 \fB\%box\fP,
46 \fB\%hline\fP,
47 \fB\%whline\fP,
48 \fB\%vline\fP,
49 \fB\%wvline\fP,
50 \fB\%mvhline\fP,
51 \fB\%mvwhline\fP,
52 \fB\%mvvline\fP,
53 \fB\%mvwvline\fP \-
54 draw borders and lines in a \fIcurses\fR window of characters
55 .SH SYNOPSIS
56 .nf
57 \fB#include <curses.h>
58 .PP
59 \fBint border(chtype \fIls\fP, chtype \fIrs\fP, chtype \fIts\fP, chtype \fIbs\fP,
60            \fBchtype \fItl\fB, chtype \fItr\fB, chtype \fIbl\fB, chtype \fIbr\fB);\fR
61 \fBint wborder(WINDOW *\fIwin\fB, chtype \fIls\fB, chtype \fIrs\fB,\fR
62             \fBchtype \fIts\fB, chtype \fIbs\fB, chtype \fItl\fB, chtype \fItr\fB,\fR
63             \fBchtype \fIbl\fB, chtype \fIbr\fB);\fR
64 .PP
65 \fBint box(WINDOW *\fIwin\fB, chtype \fIverch\fB, chtype \fIhorch\fB);\fR
66 .PP
67 \fBint hline(chtype \fIch\fB, int \fIn\fB);\fR
68 \fBint whline(WINDOW *\fIwin\fB, chtype \fIch\fB, int \fIn\fB);\fR
69 \fBint vline(chtype \fIch\fB, int \fIn\fB);\fR
70 \fBint wvline(WINDOW *\fIwin\fB, chtype \fIch\fB, int \fIn\fB);\fR
71 .PP
72 \fBint mvhline(int \fIy\fB, int \fIx\fB, chtype \fIch\fB, int \fIn\fB);\fR
73 \fBint mvwhline(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB, chtype \fIch\fB, int \fIn\fB);\fR
74 \fBint mvvline(int \fIy\fB, int \fIx\fB, chtype \fIch\fB, int \fIn\fB);\fR
75 \fBint mvwvline(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB, chtype \fIch\fB, int \fIn\fB);\fR
76 .fi
77 .SH DESCRIPTION
78 The \fBborder\fP, \fBwborder\fP and \fBbox\fP routines
79 draw a box around the edges of a window.
80 Other than the window, each argument is a character with attributes:
81 .sp
82 .RS
83 \fIls\fP \- left side,
84 .br
85 \fIrs\fP \- right side,
86 .br
87 \fIts\fP \- top side,
88 .br
89 \fIbs\fP \- bottom side,
90 .br
91 \fItl\fP \- top left-hand corner,
92 .br
93 \fItr\fP \- top right-hand corner,
94 .br
95 \fIbl\fP \- bottom left-hand corner, and
96 .br
97 \fIbr\fP \- bottom right-hand corner.
98 .RE
99 .PP
100 If any of these arguments is zero, then the corresponding
101 default values (defined in \fBcurses.h\fP) are used instead:
102 .sp
103 .RS
104 \fBACS_VLINE\fP,
105 .br
106 \fBACS_VLINE\fP,
107 .br
108 \fBACS_HLINE\fP,
109 .br
110 \fBACS_HLINE\fP,
111 .br
112 \fBACS_ULCORNER\fP,
113 .br
114 \fBACS_URCORNER\fP,
115 .br
116 \fBACS_LLCORNER\fP,
117 .br
118 \fBACS_LRCORNER\fP.
119 .RE
120 .PP
121 \fBbox(\fIwin\fB, \fIverch\fB, \fIhorch\fB)\fR is a shorthand
122 for the following call: \fBwborder(\fIwin\fB,\fR \fIverch\fB,\fR
123 \fIverch\fB,\fR \fIhorch\fB,\fR \fIhorch\fB, 0, 0, 0, 0)\fR.
124 .PP
125 The \fBhline\fP and \fBwhline\fP functions draw a horizontal (left to right)
126 line using \fIch\fP starting at the current cursor position in the window.
127 The
128 current cursor position is not changed.
129 The line is at most \fIn\fP characters
130 long, or as many as fit into the window.
131 .PP
132 The \fBvline\fP and \fBwvline\fP functions draw a vertical (top to bottom) line
133 using \fIch\fP starting at the current cursor position in the window.
134 The
135 current cursor position is not changed.
136 The line is at most \fIn\fP characters
137 long, or as many as fit into the window.
138 .SH RETURN VALUE
139 All routines return the integer \fBOK\fP.
140 The SVr4.0 manual says "or a
141 non-negative integer if \fBimmedok\fP is set", but this appears to be an error.
142 .PP
143 X/Open does not define any error conditions.
144 This implementation returns an error
145 if the window pointer is null.
146 .PP
147 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
148 \fBwmove\fP, and return an error if the position is outside the window,
149 or if the window pointer is null.
150 .SH NOTES
151 The borders generated by these functions are \fIinside\fP borders (this
152 is also true of SVr4 curses, though the fact is not documented).
153 .PP
154 Note that \fBborder\fP and \fBbox\fP may be macros.
155 .SH PORTABILITY
156 These functions are described in the XSI Curses standard, Issue 4.
157 .SH SEE ALSO
158 \fB\%curses\fP(3X),
159 \fB\%curs_outopts\fP(3X)