4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #pragma ident "%Z%%M% %I% %E% SMI"
44 #include <sys/types.h>
45 #include "curses_inc.h"
47 extern int outchcount
;
50 * These routines short-circuit much of the innards of curses in order to get
51 * a single character output to the screen quickly! It is used by waddch().
55 _quick_echo(WINDOW
*win
, chtype ch
)
58 short SPy
= y
+ win
->_begy
+ win
->_yoffset
;
59 short SPx
= (win
->_curx
- 1) + win
->_begx
;
60 chtype rawc
= _CHAR(ch
), rawattrs
= _ATTR(ch
);
62 if ((curscr
->_flags
& _CANT_BE_IMMED
) ||
63 (win
->_flags
& _WINCHANGED
) ||
64 (win
->_clear
) || (curscr
->_clear
) ||
65 (_virtscr
->_flags
& _WINCHANGED
) ||
66 (SPy
> ((LINES
+ SP
->Yabove
) - 1)) || (SPx
> (COLS
- 1)) ||
67 (SP
->slk
&& (SP
->slk
->_changed
== TRUE
))) {
68 win
->_flags
|= _WINCHANGED
;
69 return (wrefresh(win
));
73 win
->_firstch
[y
] = _INFINITY
;
75 /* If the cursor is not in the right place, put it there! */
76 if ((SPy
!= curscr
->_cury
) || (SPx
!= curscr
->_curx
)) {
77 (void) mvcur(curscr
->_cury
, curscr
->_curx
, SPy
, SPx
);
80 curscr
->_curx
= SPx
+ 1;
81 _CURHASH
[SPy
] = _NOHASH
;
83 if (SPx
> _ENDNS
[SPy
])
85 if (SPx
< _BEGNS
[SPy
])
88 _virtscr
->_y
[SPy
][SPx
] = curscr
->_y
[SPy
][SPx
] = ch
;
90 if (rawattrs
!= curscr
->_attrs
)
91 _VIDS(rawattrs
, curscr
->_attrs
);
98 (void) _outch((char) rawc
);
99 (void) fflush(SP
->term_file
);