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