xref: /illumos-gate/usr/src/lib/libxcurses2/src/libc/xcurses/wattr_on.c (revision 59d65d3175825093531e82f44269d948ed510a00)
1 /*
2  * CDDL HEADER START
3  *
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
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1995-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 /* LINTLIBRARY */
28 
29 /*
30  * wattr_on.c
31  *
32  * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
33  *
34  */
35 
36 #ifdef M_RCSID
37 #ifndef lint
38 static char rcsID[] =
39 "$Header: /team/ps/sun_xcurses/archive/local_changes/xcurses/src/lib/"
40 "libxcurses/src/libc/xcurses/rcs/wattr_on.c 1.3 1998/05/28 17:10:27 "
41 "cbates Exp $";
42 #endif
43 #endif
44 
45 #include <private.h>
46 
47 #undef wattr_on
48 
49 /* ARGSUSED */
50 int
51 wattr_on(WINDOW *w, attr_t at, void *opts)
52 {
53 	w->_fg._at |= at;
54 
55 	return (OK);
56 }
57 
58 #undef wattr_off
59 
60 /* ARGSUSED */
61 int
62 wattr_off(WINDOW *w, attr_t at, void *opts)
63 {
64 	w->_fg._at &= ~at;
65 
66 	return (OK);
67 }
68 
69 #undef wattr_set
70 
71 /* ARGSUSED */
72 int
73 wattr_set(WINDOW *w, attr_t at, short co, void *opts)
74 {
75 	w->_fg._co = co;
76 	w->_fg._at = w->_bg._at | at;
77 
78 	return (OK);
79 }
80 
81 #undef wattr_get
82 
83 /* ARGSUSED */
84 int
85 wattr_get(WINDOW *w, attr_t *at, short *co, void *opts)
86 {
87 	if (at != NULL)
88 		*at = w->_fg._at;
89 
90 	if (co != NULL)
91 		*co = w->_fg._co;
92 
93 	return (OK);
94 }
95 
96 #undef wcolor_set
97 
98 /* ARGSUSED */
99 int
100 wcolor_set(WINDOW *w, short co, void *opts)
101 {
102 	w->_fg._co = co;
103 
104 	return (OK);
105 }
106 
107 #undef wstandout
108 
109 int
110 wstandout(WINDOW *w)
111 {
112 	w->_fg._at |= WA_STANDOUT;
113 
114 	return (1);
115 }
116 
117 #undef wstandend
118 
119 int
120 wstandend(WINDOW *w)
121 {
122 	w->_fg._at = WA_NORMAL;
123 
124 	return (1);
125 }
126