3 Copyright 1989, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
27 /* RANDOM CRUFT! THIS HAS NO OFFICIAL X CONSORTIUM BLESSING */
32 #include <X11/Xlibint.h>
33 #include <X11/extensions/MITMisc.h>
34 #include <X11/extensions/mitmiscproto.h>
35 #include <X11/extensions/Xext.h>
36 #include <X11/extensions/extutil.h>
38 static XExtensionInfo _mit_info_data;
39 static XExtensionInfo *mit_info = &_mit_info_data;
40 static const char *mit_extension_name = MITMISCNAME;
42 #define MITCheckExtension(dpy,i,val) \
43 XextCheckExtension (dpy, i, mit_extension_name, val)
45 /*****************************************************************************
47 * private utility routines *
49 *****************************************************************************/
51 static int close_display(Display *dpy, XExtCodes *codes);
52 static /* const */ XExtensionHooks mit_extension_hooks = {
57 NULL, /* create_font */
59 close_display, /* close_display */
60 NULL, /* wire_to_event */
61 NULL, /* event_to_wire */
63 NULL /* error_string */
66 static XEXT_GENERATE_FIND_DISPLAY (find_display, mit_info, mit_extension_name,
67 &mit_extension_hooks, MITMiscNumberEvents,
70 static XEXT_GENERATE_CLOSE_DISPLAY (close_display, mit_info)
73 /*****************************************************************************
77 *****************************************************************************/
79 Bool XMITMiscQueryExtension (Display *dpy, int *event_basep, int *error_basep)
81 XExtDisplayInfo *info = find_display (dpy);
83 if (XextHasExtension(info)) {
84 *event_basep = info->codes->first_event;
85 *error_basep = info->codes->first_error;
93 Status XMITMiscSetBugMode(Display *dpy, Bool onOff)
95 XExtDisplayInfo *info = find_display (dpy);
96 register xMITSetBugModeReq *req;
98 MITCheckExtension (dpy, info, 0);
101 GetReq(MITSetBugMode, req);
102 req->reqType = info->codes->major_opcode;
103 req->mitReqType = X_MITSetBugMode;
110 Bool XMITMiscGetBugMode(Display *dpy)
112 XExtDisplayInfo *info = find_display (dpy);
113 register xMITGetBugModeReq *req;
114 xMITGetBugModeReply rep;
116 MITCheckExtension (dpy, info, 0);
119 GetReq(MITGetBugMode, req);
120 req->reqType = info->codes->major_opcode;
121 req->mitReqType = X_MITGetBugMode;
122 if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {