|
|
1.1 root 1: #ifndef lint
2: static char *rcsid_util_c = "$Header: util.c,v 10.1 86/11/19 10:44:43 jg Exp $";
3: #endif lint
4: /* Copyright 1985 Massachusetts Institute of Technology */
5:
6: /* util.c - Various utilities
7: *
8: * SoundBell Generate audible bell
9: * SetKeyClick Control key click
10: * SetAutoRepeat Control auto repeat
11: * SetLockLED Control Lock LED
12: * SetVideo Disable/enable video
13: * QueryShape Determine shapes
14: * ResolveColors Does nothing
15: * StoreColors Does nothing
16: *
17: * Author:
18: * Scott Bates
19: * Brown University
20: * IRIS, Box 1946
21: * Providence, RI 02912
22: *
23: *
24: * Copyright (c) 1986 Brown University
25: *
26: * Permission to use, copy, modify and distribute this software and its
27: * documentation for any purpose and without fee is hereby granted, provided
28: * that the above copyright notice appear in all copies, and that both
29: * that copyright notice and this permission notice appear in supporting
30: * documentation, and that the name of Brown University not be used in
31: * advertising or publicity pertaining to distribution of the software
32: * without specific, written prior permission. Brown University makes no
33: * representations about the suitability of this software for any purpose.
34: * It is provided "as-is" without express or implied warranty.
35: */
36:
37: #include "private.h"
38: #include "bitblt.h"
39:
40: /*
41: * Sound bell, volume between 0 (quiet) and 7 (loud)
42: */
43:
44: SoundBell (volume)
45: int volume;
46: {
47: #ifdef TRACE_X
48: fprintf(stderr, "In SoundBell\n");
49: fflush(stderr);
50: #endif TRACE_X
51: if (volume > 0)
52: ioctl (xdev, QIOCBELL, (caddr_t)&volume);
53: }
54:
55: /*
56: * Set key click, volume between -1 (default), 0 (off) and 8 (loud)
57: */
58:
59: SetKeyClick (volume)
60: int volume;
61: {
62: #ifdef TRACE_X
63: fprintf(stderr, "In SetKeyClick\n");
64: fflush(stderr);
65: #endif TRACE_X
66: ioctl (xdev, QIOCCLICK, (caddr_t)&volume);
67: }
68:
69: /*
70: * Set autorepeat on or off
71: */
72:
73: SetAutoRepeat (onoff)
74: int onoff;
75: {
76: #ifdef TRACE_X
77: fprintf(stderr, "In SetAutoRepeat\n");
78: fflush(stderr);
79: #endif TRACE_X
80: ioctl (xdev, QIOCAUTOREP, (caddr_t)&onoff);
81: }
82:
83: /*
84: * Enable/disable video
85: */
86:
87: /*ARGSUSED*/
88: SetVideo(onoff)
89: int onoff;
90: {
91: #ifdef TRACE_X
92: fprintf(stderr, "In SetVideo\n");
93: fflush(stderr);
94: #endif TRACE_X
95: return(0);
96: }
97:
98: /*
99: * Determine shapes of cursor and tile
100: */
101:
102: QueryShape (shape, width, height)
103: int shape;
104: register short *width, *height;
105: {
106: #ifdef TRACE_X
107: fprintf(stderr, "In QueryShape\n");
108: fflush(stderr);
109: #endif TRACE_X
110:
111: switch (shape) {
112: case CursorShape:
113: if (*width > CURSOR_WIDTH)
114: *width = CURSOR_WIDTH;
115: if (*height > CURSOR_HEIGHT)
116: *height = CURSOR_HEIGHT;
117: break;
118: case TileShape:
119: *width = *height = TILE_SIZE;
120: break;
121: }
122: }
123:
124: /*
125: * Turn caps lock on or off
126: */
127:
128: SetLockLED (onoff)
129: int onoff;
130: {
131: #ifdef TRACE_X
132: fprintf(stderr, "In SetLockLED\n");
133: fflush(stderr);
134: #endif TRACE_X
135: ioctl (xdev, (onoff) ? QIOCSETCAPSL : QIOCCLRCAPSL, (caddr_t) 0);
136: }
137:
138: /*ARGSUSED*/
139: ResolveColor (red, green, blue)
140: u_short *red, *green, *blue;
141: {
142: #ifdef TRACE_X
143: fprintf(stderr, "In ResolveColor\n");
144: fflush(stderr);
145: #endif TRACE_X
146: }
147:
148: /*ARGSUSED*/
149: StoreColors (count, entries)
150: int count;
151: ColorDef *entries;
152: {
153: #ifdef TRACE_X
154: fprintf(stderr, "In StoreColors\n");
155: fflush(stderr);
156: #endif TRACE_X
157: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.