xref: /netbsd/lib/libcurses/curses_border.3 (revision c4a72b64)
1.\"	$NetBSD: curses_border.3,v 1.1 2002/10/21 13:55:10 blymn Exp $
2.\"
3.\" Copyright (c) 2002
4.\"	Brett Lymn (blymn@netbsd.org, brett_lymn@yahoo.com.au)
5.\"
6.\" This code is donated to the NetBSD Foundation by the Author.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. The name of the Author may not be used to endorse or promote
17.\"    products derived from this software without specific prior written
18.\"    permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"
33.Dd August 12, 2002
34.Dt CURSES_BORDER 3
35.Os
36.Sh NAME
37.Nm curses_border ,
38.Nm border ,
39.Nm box ,
40.Nm wborder
41.Nd curses border drawing routines
42.Sh LIBRARY
43.Lb libcurses
44.Sh SYNOPSIS
45.Fd #include \*[Lt]curses.h\*[Gt]
46.Ft int
47.Fo border
48.Fa "chtype ls"
49.Fa "chtype rs"
50.Fa "chtype ts"
51.Fa "chtype bs"
52.Fa "chtype tl"
53.Fa "chtype tr"
54.Fa "chtype bl"
55.Fa "chtype br"
56.Fc
57.Ft int
58.Fn box "WINDOW *win" "chtype vertical" "chtype horizontal"
59.Ft int
60.Fo wborder
61.Fa "WINDOW *win"
62.Fa "chtype ls"
63.Fa "chtype rs"
64.Fa "chtype ts"
65.Fa "chtype bs"
66.Fa "chtype tl"
67.Fa "chtype tr"
68.Fa "chtype bl"
69.Fa "chtype br"
70.Fc
71.Sh DESCRIPTION
72These functions draw borders around
73.Dv stdscr
74or around the specified window.
75.Pp
76The
77.Fn border
78function draws a border around
79.Dv stdscr
80using the characters given as arguments to the function.
81The
82.Fa ls ,
83.Fa rs ,
84.Fa ts
85and
86.Fa bs
87are the characters used to draw the left, right, top and bottom sides,
88respectively.
89The
90.Fa tl ,
91.Fa tr ,
92.Fa bl
93and
94.Fa br
95are the characters used to draw the top-left, top-right, bottom-left
96and bottom-right corners, respectively.
97If any of the characters have a text portion that is 0 then a default
98alternate character set character is used for that character.
99Note that even though the text portion of the argument is 0, the argument
100can still be used to specify the attributes for that portion of the border.
101The following table shows the default characters for each argument:
102.Pp
103.Bl -column "ls" -offset indent
104.It ls	ACS_VLINE
105.It rs	ACS_VLINE
106.It ts	ACS_HLINE
107.It bs	ACS_HLINE
108.It tl	ACS_ULCORNER
109.It tr	ACS_URCORNER
110.It bl	ACS_LLCORNER
111.It br	ACS_LRCORNER
112.El
113.Pp
114.Fn wborder
115is the same as
116.Fn border
117excepting that the border is drawn around the specified window.
118.Pp
119The
120.Fn box
121command draws a box around the window given in
122.Fa win
123using the
124.Fa vertical
125character for the vertical lines and the
126.Fa horiztonal
127character for the horizontal lines.
128The corner characters of this box will be the defaults as described for
129.Fn border
130above.
131Passing characters with text portion that is 0 to
132.Fn box
133will result in the same defaults as those for
134.Fn border
135as described above.
136.Sh RETURN VALUES
137Functions returning pointers will return
138.Dv NULL
139if an error is detected.
140The functions that return an int will return one of the following
141values:
142.Pp
143.Bl -tag -width ERR -compact
144.It Er OK
145The function completed successfully.
146.It Er ERR
147An error occurred in the function.
148.El
149.Sh SEE ALSO
150.Xr curses_attributes 3 ,
151.Xr curses_line 3
152.Sh STANDARDS
153The
154.Nx
155Curses library complies with the X/Open Curses specification, part of the
156Single Unix Specification.
157.Sh HISTORY
158The Curses package appeared in
159.Bx 4.0 .
160