blob: 5a58e9db5583506b6dc10db38b35319ed84027b3 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_border.3x,v 1.22 2010/12/04 18:36:44 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH curs_border 3X ""
31.na
32.hy 0
33.SH NAME
34\fBborder\fR,
35\fBwborder\fR,
36\fBbox\fR,
37\fBhline\fR,
38\fBwhline\fR,
39\fBvline\fR,
40\fBwvline\fR,
41\fBmvhline\fR,
42\fBmvwhline\fR,
43\fBmvvline\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010044\fBmvwvline\fR \- create \fBcurses\fR borders, horizontal and vertical lines
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053045.ad
46.hy
47.SH SYNOPSIS
48\fB#include <curses.h>\fR
49.br
50\fBint border(chtype ls, chtype rs, chtype ts, chtype bs,\fR
51 \fBchtype tl, chtype tr, chtype bl, chtype br);\fR
52.br
53\fBint wborder(WINDOW *win, chtype ls, chtype rs,\fR
54 \fBchtype ts, chtype bs, chtype tl, chtype tr,\fR
55 \fBchtype bl, chtype br);\fR
56.br
57\fBint box(WINDOW *win, chtype verch, chtype horch);\fR
58.br
59\fBint hline(chtype ch, int n);\fR
60.br
61\fBint whline(WINDOW *win, chtype ch, int n);\fR
62.br
63\fBint vline(chtype ch, int n);\fR
64.br
65\fBint wvline(WINDOW *win, chtype ch, int n);\fR
66.br
67\fBint mvhline(int y, int x, chtype ch, int n);\fR
68.br
69\fBint mvwhline(WINDOW *, int y, int x, chtype ch, int n);\fR
70.br
71\fBint mvvline(int y, int x, chtype ch, int n);\fR
72.br
73\fBint mvwvline(WINDOW *, int y, int x, chtype ch, int n);\fR
74.br
75.SH DESCRIPTION
76The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines
77draw a box around the edges of a window.
78Other than the window, each argument is a character with attributes:
79.sp
80.RS
Steve Kondikae271bc2015-11-15 02:50:53 +010081\fIls\fR \- left side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082.br
Steve Kondikae271bc2015-11-15 02:50:53 +010083\fIrs\fR \- right side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053084.br
Steve Kondikae271bc2015-11-15 02:50:53 +010085\fIts\fR \- top side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053086.br
Steve Kondikae271bc2015-11-15 02:50:53 +010087\fIbs\fR \- bottom side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053088.br
Steve Kondikae271bc2015-11-15 02:50:53 +010089\fItl\fR \- top left-hand corner,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090.br
Steve Kondikae271bc2015-11-15 02:50:53 +010091\fItr\fR \- top right-hand corner,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053092.br
Steve Kondikae271bc2015-11-15 02:50:53 +010093\fIbl\fR \- bottom left-hand corner, and
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053094.br
Steve Kondikae271bc2015-11-15 02:50:53 +010095\fIbr\fR \- bottom right-hand corner.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053096.RE
97.PP
98If any of these arguments is zero, then the corresponding
99default values (defined in \fBcurses.h\fR) are used instead:
100.sp
101.RS
102\fBACS_VLINE\fR,
103.br
104\fBACS_VLINE\fR,
105.br
106\fBACS_HLINE\fR,
107.br
108\fBACS_HLINE\fR,
109.br
110\fBACS_ULCORNER\fR,
111.br
112\fBACS_URCORNER\fR,
113.br
114\fBACS_LLCORNER\fR,
115.br
116\fBACS_LRCORNER\fR.
117.RE
118.PP
119\fBbox(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIhorch\fR\fB)\fR is a shorthand
120for the following call: \fBwborder(\fR\fIwin\fR\fB,\fR \fIverch\fR\fB,\fR
121\fIverch\fR\fB,\fR \fIhorch\fR\fB,\fR \fIhorch\fR\fB, 0, 0, 0, 0)\fR.
122.PP
123The \fBhline\fR and \fBwhline\fR functions draw a horizontal (left to right)
124line using \fIch\fR starting at the current cursor position in the window. The
125current cursor position is not changed. The line is at most \fIn\fR characters
126long, or as many as fit into the window.
127.PP
128The \fBvline\fR and \fBwvline\fR functions draw a vertical (top to bottom) line
129using \fIch\fR starting at the current cursor position in the window. The
130current cursor position is not changed. The line is at most \fIn\fR characters
131long, or as many as fit into the window.
132.SH RETURN VALUE
133All routines return the integer \fBOK\fR. The SVr4.0 manual says "or a
134non-negative integer if \fBimmedok\fR is set", but this appears to be an error.
135.PP
136X/Open does not define any error conditions.
137This implementation returns an error
138if the window pointer is null.
Steve Kondikae271bc2015-11-15 02:50:53 +0100139.PP
140Functions with a "mv" prefix first perform a cursor movement using
141\fBwmove\fP, and return an error if the position is outside the window,
142or if the window pointer is null.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530143.SH NOTES
144The borders generated by these functions are \fIinside\fR borders (this
145is also true of SVr4 curses, though the fact is not documented).
146.PP
147Note that \fBborder\fR and \fBbox\fR may be macros.
148.SH PORTABILITY
149These functions are described in the XSI Curses standard, Issue 4.
150The standard specifies that they return \fBERR\fR on failure,
151but specifies no error conditions.
152.SH SEE ALSO
153\fBcurses\fR(3X), \fBcurs_outopts\fR(3X).