deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * copy of this software and associated documentation files (the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * "Software"), to deal in the Software without restriction, including
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * without limitation the rights to use, copy, modify, merge, publish,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * distribute, and/or sell copies of the Software, and to permit persons
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * to whom the Software is furnished to do so, provided that the above
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * copyright notice(s) and this permission notice appear in all copies of
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * the Software and that both the above copyright notice(s) and this
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * permission notice appear in supporting documentation.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Except as contained in this notice, the name of a copyright holder
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * shall not be used in advertising or otherwise to promote the sale, use
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * or other dealings in this Software without prior written authorization
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * of the copyright holder.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef _XORG_SUN_KBD_H_
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define _XORG_SUN_KBD_H_
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Keyboard common implementation routines shared by "keyboard" driver
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * in sun_io.c and "kbd" driver in sun_kbd.c
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct {
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int kbdFD;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync const char * devName;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int ktype; /* Keyboard type from KIOCTYPE */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool kbdActive; /* Have we set kbd modes for X? */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int otranslation; /* Original translation mode */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int odirect; /* Original "direct" mode setting */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync unsigned char oleds; /* Original LED state */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync const char * strmod; /* Streams module pushed on kbd device */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync const char * audioDevName; /* Audio device path to use for bell
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync or NULL to use keyboard beeper */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync enum {AB_INITIALIZING, AB_NORMAL} audioState;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync const unsigned char *keyMap;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} sunKbdPrivRec, *sunKbdPrivPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* sun_kbd.c */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int sunKbdOpen (const char *devName, pointer options);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int sunKbdInit (sunKbdPrivPtr priv, int kbdFD,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync const char *devName, pointer options);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int sunKbdOn (sunKbdPrivPtr priv);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int sunKbdOff (sunKbdPrivPtr priv);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void sunKbdSoundBell (sunKbdPrivPtr priv,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int loudness, int pitch, int duration);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void sunKbdSetLeds (sunKbdPrivPtr priv, int leds);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern int sunKbdGetLeds (sunKbdPrivPtr priv);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void sunKbdSetRepeat (sunKbdPrivPtr priv, char rad);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/* sun_kbdEv.c */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include <sys/vuid_event.h>
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern void sunPostKbdEvent (int ktype, Firm_event *event);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern const unsigned char *sunGetKbdMapping(int ktype);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif