blob: 2a5e72c141e25d21c25601ad9a3c49b6f4b69f9c [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 1998-2007,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: curs_border.3x,v 1.49 2024/04/20 21:20:07 tom Exp $
31.TH curs_border 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "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.\}
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053042.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040043\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 \-
54draw borders and lines in a \fIcurses\fR window of characters
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040056.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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053077.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040078The \fBborder\fP, \fBwborder\fP and \fBbox\fP routines
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053079draw a box around the edges of a window.
80Other than the window, each argument is a character with attributes:
81.sp
82.RS
micky3879b9f5e72025-07-08 18:04:53 -040083\fIls\fP \- left side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053084.br
micky3879b9f5e72025-07-08 18:04:53 -040085\fIrs\fP \- right side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053086.br
micky3879b9f5e72025-07-08 18:04:53 -040087\fIts\fP \- top side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053088.br
micky3879b9f5e72025-07-08 18:04:53 -040089\fIbs\fP \- bottom side,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090.br
micky3879b9f5e72025-07-08 18:04:53 -040091\fItl\fP \- top left-hand corner,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053092.br
micky3879b9f5e72025-07-08 18:04:53 -040093\fItr\fP \- top right-hand corner,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053094.br
micky3879b9f5e72025-07-08 18:04:53 -040095\fIbl\fP \- bottom left-hand corner, and
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053096.br
micky3879b9f5e72025-07-08 18:04:53 -040097\fIbr\fP \- bottom right-hand corner.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053098.RE
99.PP
100If any of these arguments is zero, then the corresponding
micky3879b9f5e72025-07-08 18:04:53 -0400101default values (defined in \fBcurses.h\fP) are used instead:
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530102.sp
103.RS
micky3879b9f5e72025-07-08 18:04:53 -0400104\fBACS_VLINE\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530105.br
micky3879b9f5e72025-07-08 18:04:53 -0400106\fBACS_VLINE\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530107.br
micky3879b9f5e72025-07-08 18:04:53 -0400108\fBACS_HLINE\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530109.br
micky3879b9f5e72025-07-08 18:04:53 -0400110\fBACS_HLINE\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530111.br
micky3879b9f5e72025-07-08 18:04:53 -0400112\fBACS_ULCORNER\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530113.br
micky3879b9f5e72025-07-08 18:04:53 -0400114\fBACS_URCORNER\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530115.br
micky3879b9f5e72025-07-08 18:04:53 -0400116\fBACS_LLCORNER\fP,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530117.br
micky3879b9f5e72025-07-08 18:04:53 -0400118\fBACS_LRCORNER\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530119.RE
120.PP
micky3879b9f5e72025-07-08 18:04:53 -0400121\fBbox(\fIwin\fB, \fIverch\fB, \fIhorch\fB)\fR is a shorthand
122for the following call: \fBwborder(\fIwin\fB,\fR \fIverch\fB,\fR
123\fIverch\fB,\fR \fIhorch\fB,\fR \fIhorch\fB, 0, 0, 0, 0)\fR.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530124.PP
micky3879b9f5e72025-07-08 18:04:53 -0400125The \fBhline\fP and \fBwhline\fP functions draw a horizontal (left to right)
126line using \fIch\fP starting at the current cursor position in the window.
127The
128current cursor position is not changed.
129The line is at most \fIn\fP characters
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530130long, or as many as fit into the window.
131.PP
micky3879b9f5e72025-07-08 18:04:53 -0400132The \fBvline\fP and \fBwvline\fP functions draw a vertical (top to bottom) line
133using \fIch\fP starting at the current cursor position in the window.
134The
135current cursor position is not changed.
136The line is at most \fIn\fP characters
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530137long, or as many as fit into the window.
138.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -0400139All routines return the integer \fBOK\fP.
140The SVr4.0 manual says
141\*(``or a non-negative integer if \fB\%immedok\fP is set\*('',
142but this appears to be an error.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530143.PP
micky3879b9f5e72025-07-08 18:04:53 -0400144X/Open Curses does not specify any error conditions.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530145This implementation returns an error
146if the window pointer is null.
Steve Kondikae271bc2015-11-15 02:50:53 +0100147.PP
micky3879b9f5e72025-07-08 18:04:53 -0400148Functions prefixed with \*(``mv\*('' first perform cursor movement and
149fail if the position
150.RI ( y ,
151.IR x )
152is outside the window boundaries.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530153.SH NOTES
micky3879b9f5e72025-07-08 18:04:53 -0400154The borders generated by these functions are \fIinside\fP borders (this
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530155is also true of SVr4 curses, though the fact is not documented).
156.PP
micky3879b9f5e72025-07-08 18:04:53 -0400157Note that \fBborder\fP and \fBbox\fP may be macros.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530158.SH PORTABILITY
micky3879b9f5e72025-07-08 18:04:53 -0400159These functions are described in X/Open Curses, Issue 4.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530160.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400161\fB\%curses\fP(3X),
162\fB\%curs_outopts\fP(3X)