chgkbd.c revision 05b261ec
11.11Sandvar/************************************************************
21.1Scherry
31.1ScherryCopyright 1989, 1998  The Open Group
41.1Scherry
51.1ScherryPermission to use, copy, modify, distribute, and sell this software and its
61.1Scherrydocumentation for any purpose is hereby granted without fee, provided that
71.1Scherrythe above copyright notice appear in all copies and that both that
81.1Scherrycopyright notice and this permission notice appear in supporting
91.1Scherrydocumentation.
101.1Scherry
111.1ScherryThe above copyright notice and this permission notice shall be included in
121.1Scherryall copies or substantial portions of the Software.
131.1Scherry
141.1ScherryTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
151.1ScherryIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161.1ScherryFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
171.1ScherryOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
181.1ScherryAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
191.1ScherryCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
201.1Scherry
211.1ScherryExcept as contained in this notice, the name of The Open Group shall not be
221.1Scherryused in advertising or otherwise to promote the sale, use or other dealings
231.1Scherryin this Software without prior written authorization from The Open Group.
241.1Scherry
251.1ScherryCopyright 1989 by Hewlett-Packard Company, Palo Alto, California.
261.1Scherry
271.1Scherry			All Rights Reserved
281.1Scherry
291.1ScherryPermission to use, copy, modify, and distribute this software and its
301.1Scherrydocumentation for any purpose and without fee is hereby granted,
311.1Scherryprovided that the above copyright notice appear in all copies and that
321.1Scherryboth that copyright notice and this permission notice appear in
331.1Scherrysupporting documentation, and that the name of Hewlett-Packard not be
341.11Sandvarused in advertising or publicity pertaining to distribution of the
351.2Scherrysoftware without specific, written prior permission.
361.2Scherry
371.2ScherryHEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
381.2ScherryALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
391.2ScherryHEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
401.2ScherryANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
411.2ScherryWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
421.2ScherryARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
431.2ScherrySOFTWARE.
441.2Scherry
451.2Scherry********************************************************/
461.2Scherry
471.2Scherry/***********************************************************************
481.2Scherry *
491.2Scherry * Extension function to change the keyboard device.
501.2Scherry *
511.2Scherry */
521.2Scherry
531.2Scherry#define	 NEED_EVENTS
541.2Scherry#define	 NEED_REPLIES
551.2Scherry#ifdef HAVE_DIX_CONFIG_H
561.1Scherry#include <dix-config.h>
571.1Scherry#endif
581.1Scherry
591.1Scherry#include <X11/X.h>	/* for inputstr.h    */
601.1Scherry#include <X11/Xproto.h>	/* Request macro     */
611.1Scherry#include "inputstr.h"	/* DeviceIntPtr      */
621.1Scherry#include <X11/extensions/XI.h>
631.1Scherry#include <X11/extensions/XIproto.h>
641.1Scherry#include "XIstubs.h"
651.1Scherry#include "globals.h"
661.1Scherry#include "extnsionst.h"
671.1Scherry
681.1Scherry#include "exevents.h"
691.1Scherry#include "exglobals.h"
701.1Scherry
711.1Scherry#include "chgkbd.h"
721.1Scherry#include "chgptr.h"
731.1Scherry
741.1Scherry/***********************************************************************
751.1Scherry *
761.1Scherry * This procedure changes the keyboard device.
771.1Scherry *
781.1Scherry */
791.1Scherry
801.1Scherryint
811.1ScherrySProcXChangeKeyboardDevice(ClientPtr client)
821.1Scherry{
831.1Scherry    char n;
841.2Scherry
851.1Scherry    REQUEST(xChangeKeyboardDeviceReq);
861.1Scherry    swaps(&stuff->length, n);
871.1Scherry    REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
881.1Scherry    return (ProcXChangeKeyboardDevice(client));
891.1Scherry}
901.1Scherry
911.1Scherry/***********************************************************************
921.1Scherry *
931.1Scherry * This procedure is invoked to swap the request bytes if the server and
941.1Scherry * client have a different byte order.
951.1Scherry *
961.1Scherry */
971.1Scherry
981.1Scherryint
991.1ScherryProcXChangeKeyboardDevice(ClientPtr client)
1001.1Scherry{
1011.1Scherry    REQUEST(xChangeKeyboardDeviceReq);
1021.1Scherry    REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
1031.1Scherry
1041.1Scherry    SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
1051.1Scherry                      BadDevice);
1061.1Scherry    return Success;
1071.1Scherry}
1081.1Scherry