1 /************************************************************
2 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
4 Permission to use, copy, modify, and distribute this
5 software and its documentation for any purpose and without
6 fee is hereby granted, provided that the above copyright
7 notice appear in all copies and that both that copyright
8 notice and this permission notice appear in supporting
9 documentation, and that the name of Silicon Graphics not be
10 used in advertising or publicity pertaining to distribution
11 of the software without specific prior written permission.
12 Silicon Graphics makes no representation about the suitability
13 of this software for any purpose. It is provided "as is"
14 without any express or implied warranty.
16 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
23 THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 ********************************************************/
32 #include <X11/extensions/XKBproto.h>
33 #include "XKBlibint.h"
37 XkbDeviceBell( Display * dpy,
45 register xkbBellReq *req;
48 if ((dpy->flags & XlibDisplayNoXkb) ||
49 (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
54 req->reqType = xkbi->codes->major_opcode;
55 req->xkbReqType = X_kbBell;
56 req->deviceSpec = deviceID;
57 req->window = (CARD32)window;
58 req->bellClass = (CARD16)bellClass;
59 req->bellID = (CARD16)bellID;
60 req->percent = percent;
61 req->forceSound = False;
62 req->eventOnly = False;
65 req->name = (CARD32)name;
66 req->pad1= 0; req->pad2= 0;
73 XkbForceDeviceBell( Display * dpy,
79 register xkbBellReq *req;
82 if ((dpy->flags & XlibDisplayNoXkb) ||
83 (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
88 req->reqType = xkbi->codes->major_opcode;
89 req->xkbReqType = X_kbBell;
90 req->deviceSpec = deviceID;
91 req->window = (CARD32)None;
92 req->bellClass = (CARD16)bellClass;
93 req->bellID = (CARD16)bellID;
94 req->percent = percent;
95 req->forceSound = True;
96 req->eventOnly = False;
100 req->pad1= 0; req->pad2= 0;
107 XkbDeviceBellEvent( Display * dpy,
115 register xkbBellReq *req;
118 if ((dpy->flags & XlibDisplayNoXkb) ||
119 (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
122 xkbi = dpy->xkb_info;
124 req->reqType = xkbi->codes->major_opcode;
125 req->xkbReqType = X_kbBell;
126 req->deviceSpec = deviceID;
127 req->window = (CARD32)window;
128 req->bellClass = (CARD16)bellClass;
129 req->bellID = (CARD16)bellID;
130 req->percent = percent;
131 req->forceSound = False;
132 req->eventOnly = True;
135 req->name = (CARD32)name;
136 req->pad1= 0; req->pad2= 0;
143 XkbBell(Display *dpy,Window window,int percent,Atom name)
145 if ((dpy->flags & XlibDisplayNoXkb) ||
146 (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL))) {
150 return XkbDeviceBell(dpy,window,XkbUseCoreKbd,XkbDfltXIClass,XkbDfltXIId,
155 XkbForceBell(Display *dpy,int percent)
157 if ((dpy->flags & XlibDisplayNoXkb) ||
158 (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL))) {
162 return XkbForceDeviceBell(dpy,XkbUseCoreKbd,XkbDfltXIClass,XkbDfltXIId,
167 XkbBellEvent(Display *dpy,Window window,int percent,Atom name)
169 if ((dpy->flags & XlibDisplayNoXkb) ||
170 (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL))) {
173 /* class 0 = KbdFeedbackClass (X Input Extension) */
174 return XkbDeviceBellEvent(dpy,window,XkbUseCoreKbd,
175 XkbDfltXIClass,XkbDfltXIId,