b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.5tsi Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (c) 2002-2003 by The XFree86 Project, Inc.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * copy of this software and associated documentation files (the "Software"),
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * to deal in the Software without restriction, including without limitation
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * and/or sell copies of the Software, and to permit persons to whom the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Software is furnished to do so, subject to the following conditions:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The above copyright notice and this permission notice shall be included in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * all copies or substantial portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OTHER DEALINGS IN THE SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Except as contained in this notice, the name of the copyright holder(s)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * and author(s) shall not be used in advertising or otherwise to promote
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the sale, use or other dealings in this Software without prior written
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * authorization from the copyright holder(s) and author(s).
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Author: Ivan Pascal.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "xf86Xinput.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncBool ATScancode(InputInfoPtr pInfo, int *scanCode);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Public interface to OS-specific keyboard support. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*KbdInitProc)(InputInfoPtr pInfo, int what);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*KbdOnProc)(InputInfoPtr pInfo, int what);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*KbdOffProc)(InputInfoPtr pInfo, int what);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*BellProc)(InputInfoPtr pInfo,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int loudness, int pitch, int duration);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*SetLedsProc)(InputInfoPtr pInfo, int leds);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*GetLedsProc)(InputInfoPtr pInfo);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*SetKbdRepeatProc)(InputInfoPtr pInfo, char rad);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*KbdGetMappingProc)(InputInfoPtr pInfo,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KeySymsPtr pKeySyms, CARD8* pModMap);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*GetSpecialKeyProc)(InputInfoPtr pInfo, int scanCode);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef Bool (*SpecialKeyProc)(InputInfoPtr pInfo,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int key, Bool down, int modifiers);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*RemapScanCodeProc)(InputInfoPtr pInfo, int *scanCode);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef Bool (*OpenKeyboardProc)(InputInfoPtr pInfo);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef void (*PostEventProc)(InputInfoPtr pInfo,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned int key, Bool down);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int begin;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int end;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned char *map;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} TransMapRec, *TransMapPtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KbdInitProc KbdInit;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KbdOnProc KbdOn;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KbdOffProc KbdOff;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BellProc Bell;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync SetLedsProc SetLeds;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync GetLedsProc GetLeds;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync SetKbdRepeatProc SetKbdRepeat;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KbdGetMappingProc KbdGetMapping;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync RemapScanCodeProc RemapScanCode;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync GetSpecialKeyProc GetSpecialKey;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync SpecialKeyProc SpecialKey;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync OpenKeyboardProc OpenKeyboard;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PostEventProc PostEvent;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int rate;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int delay;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int bell_pitch;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int bell_duration;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool autoRepeat;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long leds;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long xledsMask;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned long keyLeds;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int scanPrefix;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool vtSwitchSupported;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool CustomKeycodes;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool noXkb;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool isConsole;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync TransMapPtr scancodeMap;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync TransMapPtr specialMap;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /* os specific */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer private;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int kbdType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int consType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int wsKbdType;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool sunKbd;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool Panix106;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} KbdDevRec, *KbdDevPtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef enum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PROT_STD,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PROT_XQUEUE,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PROT_WSCONS,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PROT_USB,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PROT_UNKNOWN_KBD
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} KbdProtocolId;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync const char *name;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync KbdProtocolId id;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} KbdProtocolRec;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncBool xf86OSKbdPreInit(InputInfoPtr pInfo);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Adjust this when the kbd interface changes. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * History:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * 1.0.0 - Initial version.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define OS_KBD_VERSION_MAJOR 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define OS_KBD_VERSION_MINOR 0
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define OS_KBD_VERSION_PATCH 0
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define OS_KBD_VERSION_CURRENT \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync BUILTIN_INTERFACE_VERSION_NUMERIC(OS_KBD_VERSION_MAJOR, \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync OS_KBD_VERSION_MINOR, \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync OS_KBD_VERSION_PATCH)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync