pax_global_header00006660000000000000000000000064104240076320014510gustar00rootroot0000000000000052 comment=a2ff41b5721803eda53ef54bc5c7e3593724be1e libXxf86misc-1.0.3/000075500000000000000000000000001042400763200137755ustar00rootroot00000000000000libXxf86misc-1.0.3/.cvsignore000064400000000000000000000002721042400763200157760ustar00rootroot00000000000000aclocal.m4 autom4te.cache compile config.guess config.log config.status config.sub configure depcomp install-sh libtool ltmain.sh Makefile Makefile.in missing mkinstalldirs xxf86misc.pc libXxf86misc-1.0.3/COPYING000064400000000000000000000024511042400763200150320ustar00rootroot00000000000000Copyright (c) 1995, 1996 The XFree86 Project, Inc All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the XFree86 Project shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the XFree86 Project. libXxf86misc-1.0.3/ChangeLog000064400000000000000000000030641042400763200155520ustar00rootroot000000000000002006-04-26 Adam Jackson * configure.ac: Bump to 1.0.1 2006-02-12 Alan Coopersmith * man/Makefile.am: Bug #5628 Shadow pages not created correctly when MANDIR & MANSUFFIX don't match. 2005-12-14 Kevin E. Martin * configure.ac: Update package version number for final X11R7 release candidate. 2005-12-06 Kevin E. Martin * man/Makefile.am: Change *man_SOURCES ==> *man_PRE to fix autotools warnings. 2005-12-03 Kevin E. Martin * configure.ac: Update package version number for X11R7 RC3 release. 2005-12-02 Kevin E. Martin * configure.ac: * src/Makefile.am: Add check and cflags for malloc(0) returning NULL. 2005-11-19 Kevin E. Martin * xxf86misc.pc.in: Update pkgconfig files to separate library build-time dependencies from application build-time dependencies. 2005-10-18 Kevin E. Martin * configure.ac: Update package version number for RC1 release. 2005-10-11 Alan Coopersmith * configure.ac: * man/Makefile.am: Use sed to put version number in man page Add shadow man pages for man pages that document multiple functions. 2005-07-08 Keith Packard * .cvsignore: * man/.cvsignore: * src/.cvsignore: * src/Makefile.am: Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory libXxf86misc-1.0.3/Makefile.am000064400000000000000000000001751042400763200160340ustar00rootroot00000000000000SUBDIRS = src man pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xxf86misc.pc EXTRA_DIST = xxf86misc.pc.in autogen.sh libXxf86misc-1.0.3/autogen.sh000075500000000000000000000003041042400763200157730ustar00rootroot00000000000000#! /bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? $srcdir/configure --enable-maintainer-mode "$@" libXxf86misc-1.0.3/configure.ac000064400000000000000000000007661042400763200162740ustar00rootroot00000000000000AC_PREREQ([2.57]) AC_INIT(libXxf86misc, 1.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXxf86misc) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE AM_CONFIG_HEADER(src/config.h) # Check for progs AC_PROG_CC AC_PROG_LIBTOOL # Checks for pkg-config packages PKG_CHECK_MODULES(XXF86MISC, xproto x11 xextproto xext xf86miscproto) XORG_CHECK_MALLOC_ZERO XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION AC_OUTPUT([Makefile src/Makefile man/Makefile xxf86misc.pc]) libXxf86misc-1.0.3/man/000075500000000000000000000000001042400763200145505ustar00rootroot00000000000000libXxf86misc-1.0.3/man/.cvsignore000064400000000000000000000000321042400763200165430ustar00rootroot00000000000000Makefile Makefile.in *.3* libXxf86misc-1.0.3/man/Makefile.am000064400000000000000000000051571042400763200166140ustar00rootroot00000000000000# $Id$ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation. # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the copyright holders shall # not be used in advertising or otherwise to promote the sale, use or # other dealings in this Software without prior written authorization # from the copyright holders. # libmandir = $(LIB_MAN_DIR) LIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%) libman_PRE = XF86Misc.man BUILT_SOURCES = shadows.DONE EXTRA_DIST = $(libman_PRE) CLEANFILES = $(libman_DATA) $(BUILT_SOURCES) libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@) \ $(XF86Misc_shadows:=.@LIB_MAN_SUFFIX@) SED = sed # Strings to replace in man pages XORGRELSTRING = @PACKAGE_STRING@ XORGMANNAME = X Version 11 MAN_SUBSTS = \ -e 's/__vendorversion__/"$(XORGRELSTRING)" "$(XORGMANNAME)"/' \ -e 's/__xconfigfile__/xorg.conf/g' \ -e 's/__appmansuffix__/$(APP_MAN_SUFFIX)/g' \ -e 's/__libmansuffix__/$(LIB_MAN_SUFFIX)/g' \ -e 's/__filemansuffix__/$(FILE_MAN_SUFFIX)/g' SUFFIXES = .$(LIB_MAN_SUFFIX) .man .man.$(LIB_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ # Generate man page shadow files (Replaces InstallManPageAliases from Imake) XF86Misc_shadows = \ XF86MiscQueryExtension \ XF86MiscQueryVersion \ XF86MiscGetSaver \ XF86MiscSetSaver \ XF86MiscGetMouseSettings \ XF86MiscSetMouseSettings \ XF86MiscGetKbdSettings \ XF86MiscSetKbdSettings shadows.DONE: -rm -f $(XF86Misc_shadows:=.@LIB_MAN_SUFFIX@) (for i in $(XF86Misc_shadows:=.@LIB_MAN_SUFFIX@) ; do \ echo .so man$(LIB_MAN_DIR_SUFFIX)/XF86Misc.$(LIB_MAN_SUFFIX) > $$i; \ done) libXxf86misc-1.0.3/man/XF86Misc.man000064400000000000000000000150211042400763200165530ustar00rootroot00000000000000.\" $XdotOrg$ .\" $TOG: XF86Misc.man /main/7 1997/07/19 10:30:32 kaleb $ .\" .\" .\" .\" Copyright (c) 1996 Joe Moss, The XFree86 Project .\" .\" $XFree86: xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man,v 3.12 2002/12/22 00:46:54 dawes Exp $ .de ZN .ie t \fB\^\\$1\^\fR\\$2 .el \fI\^\\$1\^\fP\\$2 .. .TH XF86MISC __libmansuffix__ __vendorversion__ "X FUNCTIONS" .SH NAME XF86MiscQueryExtension, XF86MiscQueryVersion, XF86MiscGetMouseSettings, XF86MiscSetMouseSettings, XF86MiscGetKbdSettings, XF86MiscSetKbdSettings \- Extension library for the XFree86-Misc X extension. .SH SYNTAX .nf .LP \&#include .LP Bool XF86MiscQueryExtension( Display *\fIdisplay\fP\^, int *\fIevent_base_return\fP\^, int *\fIerror_base_return\fP\^); .LP Bool XF86MiscQueryVersion( Display *\fIdisplay\fP\^, int *\fImajor_version_return\fP\^, int *\fIminor_version_return\fP\^); .ig .LP Status XF86MiscGetSaver( Display *\fIdisplay\fP\^, int \fIscreen\fP\^, int *\fIsuspend_time_return\fP\^, int *\fIoff_time_return\fP\^); .LP Status XF86MiscSetSaver( Display *\fIdisplay\fP\^, int \fIscreen\fP\^, int \fIsuspend_time\fP\^, int \fIoff_time\fP\^); .. .LP Status XF86MiscGetMouseSettings( Display *\fIdisplay\fP\^, XF86MiscMouseSettings *\fImseinfo\fP\^); .LP Status XF86MiscSetMouseSettings( Display *\fIdisplay\fP\^, XF86MiscMouseSettings *\fImseinfo\fP\^); .LP Status XF86MiscGetKbdSettings( Display *\fIdisplay\fP\^, XF86MiscKbdSettings *\fIkbdinfo\fP\^); .LP Status XF86MiscSetKbdSettings( Display *\fIdisplay\fP\^, XF86MiscKbdSettings *\fIkbdinfo\fP\^); .fi .SH ARGUMENTS .IP \fIdisplay\fP 2i Specifies the connection to the X server. .IP \fIscreen\fP 2i Specifies which screen number the setting apply to. .IP \fIevent_base_return\fP 2i Returns the base event number for the extension. .IP \fIerror_base_return\fP 2i Returns the base error number for the extension. .IP \fImajor_version_return\fP 2i Returns the major version number of the extension. .IP \fIminor_version_return\fP 2i Returns the minor version number of the extension. .ig .IP \fIsuspend_time_return\fP 2i Returns the number of seconds of idle time the server will wait before activating the monitor's suspend mode. .IP \fIoff_time_return\fP 2i Returns the number of seconds of idle time the server will wait before causing the monitor to powerdown. .IP \fIsuspend_time\fP 2i Specifies the number of seconds of idle time the server should wait before activating the monitor's suspend mode. .IP \fIoff_time\fP 2i Specifies the number of seconds of idle time the server should wait before causing the monitor to powerdown. .. .IP \fImseinfo\fP 2i Specifies a structure which contains the mouse parameters. .IP \fIkbdinfo\fP 2i Specifies a structure which contains the keyboard parameters. .SH STRUCTURES .nf .ta 3i \fIMouse:\fP typedef struct { char *device; /\(** returned path to device */ int type; /\(** mouse protocol */ int baudrate; /\(** 1200, 2400, 4800, or 9600 */ int samplerate; /\(** samples per second */ int resolution; /\(** resolution, count per inch */ int buttons; /\(** number of buttons */ Bool emulate3buttons; /\(** Button1+Button3 -> Button2 ? */ int emulate3timeout; /\(** in milliseconds */ Bool chordmiddle; /\(** Button1+Button3 == Button2 ? */ int flags; /\(** Device open flags */ } XF86MiscMouseSettings; .LP \fIKeyboard:\fP typedef struct { int type; /\(** of keyboard: 84-key, 101-key, Xqueue */ int rate; /\(** repeat rate */ int delay; /\(** delay until repeat starts */ Bool servnumlock; /\(** Server handles NumLock ? */ } XF86MiscKbdSettings; .fi .SH DESCRIPTION These functions provide an interface to the \fIXFree86-Misc\fP extension which allows various server settings to be queried and changed dynamically. Applications that use these functions must be linked with .ZN -lXxf86misc .SS "POWER-SAVER FUNCTIONS" The .ZN XF86MiscGetSaver and .ZN XF86MiscSetSaver functions have been removed. This functionality is now provided by the DPMS extension. .SS "MOUSE FUNCTIONS" Mouse parameters can be queried using the function .ZN XF86MiscGetMouseSettings . The structure pointed to by its second argument is filled in with the current mouse settings. .PP Not all fields are valid in all cases. For example, when the protocol indicates a bus mouse (i.e. the type field has value .ZN MTYPE_BUSMOUSE as defined in .ZN xf86misc.h ), then the value in the .ZN baudrate field should be ignored as it does not apply to bus mice. .PP The .ZN samplerate field contains the resolution in lines per inch when using the Hitachi tablet protocol. .PP The device field of the structure points to dynamically allocated storage which should be freed by the caller. .PP Any of the fields of the structure can be altered and then passed to the .ZN XF86MiscSetMouseSettings function to change their value in the server, with the following restrictions: .RS 5 .IP 1) 3 The device can not be changed .IP 2) 3 The protocol can not be changed to or from Xqueue or OsMouse .IP 3) 3 The buttons field can not be changed .IP 4) 3 Invalid combinations of parameters are not allowed .RE .PP The server will generate an error if any of the above is attempted, except the first \- the contents of the device field are simply ignored. .PP A change of the protocol causes the device to be closed and reopened. Changes to the baud rate, sample rate, resolution or flags, when applicable to the selected protocol, also cause a reopen of the device. A reopen can be forced by using the MF_REOPEN flag, except in the case of the OsMouse and Xqueue protocols which ignore all attempts to reopen the device. .SS "KEYBOARD FUNCTIONS" The .ZN XF86MiscGetKbdSettings function allows you to retrieve the current keyboard-related settings from the server. .PP Using the .ZN XF86MiscSetKbdSettings function, the keyboard autorepeat delay and rate can be set. Requests to change the .ZN type and .ZN servnumlock fields are ignored (except for checking for an invalid keyboard type). This is expected to change in a future release. .SS "OTHER FUNCTIONS" Two functions, .ZN XF86MiscQueryExtension and .ZN XF86MiscQueryVersion , are provided which allow the client to query some information regarding the extension itself. .SH PREDEFINED VALUES The header file .ZN X11/extensions/xf86misc.h contains definitions for .IP \fBMTYPE_\fP* 1i Mouse protocols .IP \fBKTYPE_\fP* 1i Keyboard types .IP \fBMF_\fP* 1i Mouse flags .SH "SEE ALSO" xset(__appmansuffix__), __xconfigfile__(__filemansuffix__) .SH AUTHORS Joe Moss and David Dawes, The XFree86 Project, Inc. libXxf86misc-1.0.3/src/000075500000000000000000000000001042400763200145645ustar00rootroot00000000000000libXxf86misc-1.0.3/src/.cvsignore000064400000000000000000000001241042400763200165610ustar00rootroot00000000000000config.h config.h.in .deps .libs libXxf86misc.la *.lo Makefile Makefile.in stamp-h1 libXxf86misc-1.0.3/src/Makefile.am000064400000000000000000000003321042400763200166160ustar00rootroot00000000000000lib_LTLIBRARIES = libXxf86misc.la libXxf86misc_la_SOURCES = XF86Misc.c AM_CFLAGS = $(XXF86MISC_CFLAGS) $(MALLOC_ZERO_CFLAGS) libXxf86misc_la_LIBADD = $(XXF86MISC_LIBS) libXxf86misc_la_LDFLAGS = -version-number 1:1:0 libXxf86misc-1.0.3/src/XF86Misc.c000064400000000000000000000262371042400763200162510ustar00rootroot00000000000000/* $XFree86: xc/lib/Xxf86misc/XF86Misc.c,v 3.12 2002/11/20 04:04:57 dawes Exp $ */ /* * Copyright (c) 1995, 1996 The XFree86 Project, Inc */ /* THIS IS NOT AN X CONSORTIUM STANDARD */ #define NEED_EVENTS #define NEED_REPLIES #include #include #include #include static XExtensionInfo _xf86misc_info_data; static XExtensionInfo *xf86misc_info = &_xf86misc_info_data; static char *xf86misc_extension_name = XF86MISCNAME; #define XF86MiscCheckExtension(dpy,i,val) \ XextCheckExtension (dpy, i, xf86misc_extension_name, val) /***************************************************************************** * * * private utility routines * * * *****************************************************************************/ static int close_display(Display *dpy, XExtCodes *codes); static /* const */ XExtensionHooks xf86misc_extension_hooks = { NULL, /* create_gc */ NULL, /* copy_gc */ NULL, /* flush_gc */ NULL, /* free_gc */ NULL, /* create_font */ NULL, /* free_font */ close_display, /* close_display */ NULL, /* wire_to_event */ NULL, /* event_to_wire */ NULL, /* error */ NULL, /* error_string */ }; static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86misc_info, xf86misc_extension_name, &xf86misc_extension_hooks, 0, NULL) static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86misc_info) /***************************************************************************** * * * public XFree86-Misc Extension routines * * * *****************************************************************************/ Bool XF86MiscQueryExtension (dpy, event_basep, error_basep) Display *dpy; int *event_basep, *error_basep; { XExtDisplayInfo *info = find_display (dpy); if (XextHasExtension(info)) { *event_basep = info->codes->first_event; *error_basep = info->codes->first_error; return True; } else { return False; } } Bool XF86MiscQueryVersion(dpy, majorVersion, minorVersion) Display* dpy; int* majorVersion; int* minorVersion; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscQueryVersionReply rep; xXF86MiscQueryVersionReq *req; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscQueryVersion, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscQueryVersion; if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); return False; } *majorVersion = rep.majorVersion; *minorVersion = rep.minorVersion; UnlockDisplay(dpy); SyncHandle(); if (*majorVersion > 0 || *minorVersion > 5) XF86MiscSetClientVersion(dpy); return True; } Bool XF86MiscSetClientVersion(Display *dpy) { XExtDisplayInfo *info = find_display(dpy); xXF86MiscSetClientVersionReq *req; XF86MiscCheckExtension(dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscSetClientVersion, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscSetClientVersion; req->major = XF86MISC_MAJOR_VERSION; req->minor = XF86MISC_MINOR_VERSION; UnlockDisplay(dpy); SyncHandle(); return True; } Bool XF86MiscGetMouseSettings(dpy, mouseinfo) Display* dpy; XF86MiscMouseSettings *mouseinfo; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscGetMouseSettingsReply rep; xXF86MiscGetMouseSettingsReq *req; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscGetMouseSettings, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscGetMouseSettings; if (!_XReply(dpy, (xReply *)&rep, (SIZEOF(xXF86MiscGetMouseSettingsReply) - SIZEOF(xReply))>>2, xFalse)) { UnlockDisplay(dpy); SyncHandle(); return False; } mouseinfo->type = rep.mousetype; mouseinfo->baudrate = rep.baudrate; mouseinfo->samplerate = rep.samplerate; mouseinfo->resolution = rep.resolution; mouseinfo->buttons = rep.buttons; mouseinfo->emulate3buttons = rep.emulate3buttons; mouseinfo->emulate3timeout = rep.emulate3timeout; mouseinfo->chordmiddle = rep.chordmiddle; mouseinfo->flags = rep.flags; if (rep.devnamelen > 0) { if (!(mouseinfo->device = Xcalloc(rep.devnamelen + 1, 1))) { _XEatData(dpy, (rep.devnamelen+3) & ~3); Xfree(mouseinfo->device); return False; } _XReadPad(dpy, mouseinfo->device, rep.devnamelen); } else mouseinfo->device = NULL; UnlockDisplay(dpy); SyncHandle(); return True; } Bool XF86MiscGetKbdSettings(dpy, kbdinfo) Display* dpy; XF86MiscKbdSettings *kbdinfo; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscGetKbdSettingsReply rep; xXF86MiscGetKbdSettingsReq *req; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscGetKbdSettings, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscGetKbdSettings; if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); return False; } kbdinfo->type = rep.kbdtype; kbdinfo->rate = rep.rate; kbdinfo->delay = rep.delay; kbdinfo->servnumlock = rep.servnumlock; UnlockDisplay(dpy); SyncHandle(); return True; } Bool XF86MiscSetMouseSettings(dpy, mouseinfo) Display* dpy; XF86MiscMouseSettings *mouseinfo; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscSetMouseSettingsReq *req; int majorVersion, minorVersion; XF86MiscCheckExtension (dpy, info, False); XF86MiscQueryVersion(dpy, &majorVersion, &minorVersion); LockDisplay(dpy); GetReq(XF86MiscSetMouseSettings, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscSetMouseSettings; req->mousetype = mouseinfo->type; req->baudrate = mouseinfo->baudrate; req->samplerate = mouseinfo->samplerate; req->resolution = mouseinfo->resolution; req->buttons = mouseinfo->buttons; req->emulate3buttons = mouseinfo->emulate3buttons; req->emulate3timeout = mouseinfo->emulate3timeout; req->chordmiddle = mouseinfo->chordmiddle; req->flags = mouseinfo->flags; if (majorVersion > 0 || minorVersion > 5) { int len; if ((len = strlen(mouseinfo->device))) { req->devnamelen = len + 1; len = (req->devnamelen + 3) >> 2; SetReqLen(req,len,len); Data(dpy, mouseinfo->device, req->devnamelen); } } UnlockDisplay(dpy); SyncHandle(); return True; } Bool XF86MiscSetKbdSettings(dpy, kbdinfo) Display* dpy; XF86MiscKbdSettings *kbdinfo; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscSetKbdSettingsReq *req; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscSetKbdSettings, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscSetKbdSettings; req->kbdtype = kbdinfo->type; req->rate = kbdinfo->rate; req->delay = kbdinfo->delay; req->servnumlock = kbdinfo->servnumlock; UnlockDisplay(dpy); SyncHandle(); return True; } int XF86MiscSetGrabKeysState(dpy, enable) Display* dpy; Bool enable; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscSetGrabKeysStateReply rep; xXF86MiscSetGrabKeysStateReq *req; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscSetGrabKeysState, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscSetGrabKeysState; req->enable = enable; if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); return 0; } UnlockDisplay(dpy); SyncHandle(); return rep.status; } Bool XF86MiscGetFilePaths(dpy, filpaths) Display* dpy; XF86MiscFilePaths *filpaths; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscGetFilePathsReply rep; xXF86MiscGetFilePathsReq *req; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscGetFilePaths, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscGetFilePaths; if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); return False; } if (rep.configlen) { if (!(filpaths->configfile = Xcalloc(rep.configlen + 1, 1))) { _XEatData(dpy, ((rep.configlen+3) & ~3) + ((rep.modulelen+3) & ~3) + ((rep.loglen+3) & ~3)); return False; } } if (rep.modulelen) { if (!(filpaths->modulepath = Xcalloc(rep.modulelen + 1, 1))) { _XEatData(dpy, ((rep.configlen+3) & ~3) + ((rep.modulelen+3) & ~3) + ((rep.loglen+3) & ~3)); if (filpaths->configfile) Xfree(filpaths->configfile); return False; } } if (rep.loglen) { if (!(filpaths->logfile = Xcalloc(rep.loglen + 1, 1))) { _XEatData(dpy, ((rep.configlen+3) & ~3) + ((rep.modulelen+3) & ~3) + ((rep.loglen+3) & ~3)); if (filpaths->configfile) Xfree(filpaths->configfile); if (filpaths->modulepath) Xfree(filpaths->modulepath); return False; } } if (rep.configlen) _XReadPad(dpy, filpaths->configfile, rep.configlen); else filpaths->configfile = ""; if (rep.modulelen) _XReadPad(dpy, filpaths->modulepath, rep.modulelen); else filpaths->modulepath = ""; if (rep.loglen) _XReadPad(dpy, filpaths->logfile, rep.loglen); else filpaths->logfile = ""; UnlockDisplay(dpy); SyncHandle(); return True; } Status XF86MiscPassMessage(dpy, screen, msgtype, msgval, retmsg) Display* dpy; int screen; const char* msgtype; const char* msgval; char** retmsg; { XExtDisplayInfo *info = find_display (dpy); xXF86MiscPassMessageReply rep; xXF86MiscPassMessageReq *req; int len; XF86MiscCheckExtension (dpy, info, False); LockDisplay(dpy); GetReq(XF86MiscPassMessage, req); req->reqType = info->codes->major_opcode; req->xf86miscReqType = X_XF86MiscPassMessage; req->screen = screen; if ((len = strlen(msgtype))) { req->typelen = len + 1; len = (req->typelen + 3) >> 2; SetReqLen(req,len,len); Data(dpy, msgtype, req->typelen); } if ((len = strlen(msgval))) { req->vallen = len + 1; len = (req->vallen + 3) >> 2; SetReqLen(req,len,len); Data(dpy, msgval, req->vallen); } if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); return BadImplementation; } if (rep.mesglen) { if (!(*retmsg = Xcalloc(rep.mesglen + 1, 1))) { _XEatData(dpy, ((rep.mesglen+3) & ~3)); return BadAlloc; } _XReadPad(dpy, *retmsg, rep.mesglen); } UnlockDisplay(dpy); SyncHandle(); return rep.status; } libXxf86misc-1.0.3/xxf86misc.pc.in000064400000000000000000000004131042400763200165630ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Xxf86misc Description: XFree86 Misc Extension Library Version: @VERSION@ Requires: xf86miscproto Requires.private: x11 xext Cflags: -I${includedir} Libs: -L${libdir} -lXxf86misc