]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_border.3x
ncurses 6.1 - patch 20191228
[ncurses.git] / man / curs_border.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_border.3x,v 1.24 2019/11/30 21:06:30 tom Exp $
30 .TH curs_border 3X ""
31 .ie \n(.g .ds `` \(lq
32 .el       .ds `` ``
33 .ie \n(.g .ds '' \(rq
34 .el       .ds '' ''
35 .na
36 .hy 0
37 .SH NAME
38 \fBborder\fR,
39 \fBwborder\fR,
40 \fBbox\fR,
41 \fBhline\fR,
42 \fBwhline\fR,
43 \fBvline\fR,
44 \fBwvline\fR,
45 \fBmvhline\fR,
46 \fBmvwhline\fR,
47 \fBmvvline\fR,
48 \fBmvwvline\fR \- create \fBcurses\fR borders, horizontal and vertical lines
49 .ad
50 .hy
51 .SH SYNOPSIS
52 \fB#include <curses.h>\fR
53 .br
54 \fBint border(chtype ls, chtype rs, chtype ts, chtype bs,\fR
55    \fBchtype tl, chtype tr, chtype bl, chtype br);\fR
56 .br
57 \fBint wborder(WINDOW *win, chtype ls, chtype rs,\fR
58    \fBchtype ts, chtype bs, chtype tl, chtype tr,\fR
59    \fBchtype bl, chtype br);\fR
60 .br
61 \fBint box(WINDOW *win, chtype verch, chtype horch);\fR
62 .br
63 \fBint hline(chtype ch, int n);\fR
64 .br
65 \fBint whline(WINDOW *win, chtype ch, int n);\fR
66 .br
67 \fBint vline(chtype ch, int n);\fR
68 .br
69 \fBint wvline(WINDOW *win, chtype ch, int n);\fR
70 .br
71 \fBint mvhline(int y, int x, chtype ch, int n);\fR
72 .br
73 \fBint mvwhline(WINDOW *, int y, int x, chtype ch, int n);\fR
74 .br
75 \fBint mvvline(int y, int x, chtype ch, int n);\fR
76 .br
77 \fBint mvwvline(WINDOW *, int y, int x, chtype ch, int n);\fR
78 .br
79 .SH DESCRIPTION
80 The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines
81 draw a box around the edges of a window.
82 Other than the window, each argument is a character with attributes:
83 .sp
84 .RS
85 \fIls\fR \- left side,
86 .br
87 \fIrs\fR \- right side,
88 .br
89 \fIts\fR \- top side,
90 .br
91 \fIbs\fR \- bottom side,
92 .br
93 \fItl\fR \- top left-hand corner,
94 .br
95 \fItr\fR \- top right-hand corner,
96 .br
97 \fIbl\fR \- bottom left-hand corner, and
98 .br
99 \fIbr\fR \- bottom right-hand corner.
100 .RE
101 .PP
102 If any of these arguments is zero, then the corresponding
103 default values (defined in \fBcurses.h\fR) are used instead:
104 .sp
105 .RS
106 \fBACS_VLINE\fR,
107 .br
108 \fBACS_VLINE\fR,
109 .br
110 \fBACS_HLINE\fR,
111 .br
112 \fBACS_HLINE\fR,
113 .br
114 \fBACS_ULCORNER\fR,
115 .br
116 \fBACS_URCORNER\fR,
117 .br
118 \fBACS_LLCORNER\fR,
119 .br
120 \fBACS_LRCORNER\fR.
121 .RE
122 .PP
123 \fBbox(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIhorch\fR\fB)\fR is a shorthand
124 for the following call: \fBwborder(\fR\fIwin\fR\fB,\fR \fIverch\fR\fB,\fR
125 \fIverch\fR\fB,\fR \fIhorch\fR\fB,\fR \fIhorch\fR\fB, 0, 0, 0, 0)\fR.
126 .PP
127 The \fBhline\fR and \fBwhline\fR functions draw a horizontal (left to right)
128 line using \fIch\fR starting at the current cursor position in the window.
129 The
130 current cursor position is not changed.
131 The line is at most \fIn\fR characters
132 long, or as many as fit into the window.
133 .PP
134 The \fBvline\fR and \fBwvline\fR functions draw a vertical (top to bottom) line
135 using \fIch\fR starting at the current cursor position in the window.
136 The
137 current cursor position is not changed.
138 The line is at most \fIn\fR characters
139 long, or as many as fit into the window.
140 .SH RETURN VALUE
141 All routines return the integer \fBOK\fR.
142 The SVr4.0 manual says "or a
143 non-negative integer if \fBimmedok\fR is set", but this appears to be an error.
144 .PP
145 X/Open does not define any error conditions.
146 This implementation returns an error
147 if the window pointer is null.
148 .PP
149 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
150 \fBwmove\fP, and return an error if the position is outside the window,
151 or if the window pointer is null.
152 .SH NOTES
153 The borders generated by these functions are \fIinside\fR borders (this
154 is also true of SVr4 curses, though the fact is not documented).
155 .PP
156 Note that \fBborder\fR and \fBbox\fR may be macros.
157 .SH PORTABILITY
158 These functions are described in the XSI Curses standard, Issue 4.
159 The standard specifies that they return \fBERR\fR on failure,
160 but specifies no error conditions.
161 .SH SEE ALSO
162 \fBcurses\fR(3X), \fBcurs_outopts\fR(3X).