Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_border.3x,v 1.22 2010/12/04 18:36:44 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .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 Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 44 | \fBmvwvline\fR \- create \fBcurses\fR borders, horizontal and vertical lines |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 45 | .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 |
| 76 | The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines |
| 77 | draw a box around the edges of a window. |
| 78 | Other than the window, each argument is a character with attributes: |
| 79 | .sp |
| 80 | .RS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 81 | \fIls\fR \- left side, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 82 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 83 | \fIrs\fR \- right side, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 85 | \fIts\fR \- top side, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 86 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 87 | \fIbs\fR \- bottom side, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 88 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 89 | \fItl\fR \- top left-hand corner, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 90 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 91 | \fItr\fR \- top right-hand corner, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 92 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 93 | \fIbl\fR \- bottom left-hand corner, and |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 94 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 95 | \fIbr\fR \- bottom right-hand corner. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 96 | .RE |
| 97 | .PP |
| 98 | If any of these arguments is zero, then the corresponding |
| 99 | default 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 |
| 120 | for 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 |
| 123 | The \fBhline\fR and \fBwhline\fR functions draw a horizontal (left to right) |
| 124 | line using \fIch\fR starting at the current cursor position in the window. The |
| 125 | current cursor position is not changed. The line is at most \fIn\fR characters |
| 126 | long, or as many as fit into the window. |
| 127 | .PP |
| 128 | The \fBvline\fR and \fBwvline\fR functions draw a vertical (top to bottom) line |
| 129 | using \fIch\fR starting at the current cursor position in the window. The |
| 130 | current cursor position is not changed. The line is at most \fIn\fR characters |
| 131 | long, or as many as fit into the window. |
| 132 | .SH RETURN VALUE |
| 133 | All routines return the integer \fBOK\fR. The SVr4.0 manual says "or a |
| 134 | non-negative integer if \fBimmedok\fR is set", but this appears to be an error. |
| 135 | .PP |
| 136 | X/Open does not define any error conditions. |
| 137 | This implementation returns an error |
| 138 | if the window pointer is null. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 139 | .PP |
| 140 | Functions with a "mv" prefix first perform a cursor movement using |
| 141 | \fBwmove\fP, and return an error if the position is outside the window, |
| 142 | or if the window pointer is null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 143 | .SH NOTES |
| 144 | The borders generated by these functions are \fIinside\fR borders (this |
| 145 | is also true of SVr4 curses, though the fact is not documented). |
| 146 | .PP |
| 147 | Note that \fBborder\fR and \fBbox\fR may be macros. |
| 148 | .SH PORTABILITY |
| 149 | These functions are described in the XSI Curses standard, Issue 4. |
| 150 | The standard specifies that they return \fBERR\fR on failure, |
| 151 | but specifies no error conditions. |
| 152 | .SH SEE ALSO |
| 153 | \fBcurses\fR(3X), \fBcurs_outopts\fR(3X). |