Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/include/IOKit/hidsystem/IOHIDTypes.h

Source at commit 296 created 12 years 10 months ago.
By ifabio, add i386 folder
1/*
2 * @APPLE_LICENSE_HEADER_START@
3 *
4 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/******************************************************************************
24ev_types.h
25Data types for the events status driver.
26This file contains public API.
27mpaque 11Oct91
28
29Copyright 1991 NeXT Computer, Inc.
30
31Modified:
32
33******************************************************************************/
34
35#ifndef _DEV_EV_TYPES_H
36#define _DEV_EV_TYPES_H
37
38#include <mach/boolean.h>
39#include <IOKit/IOSharedLock.h>
40#include <IOKit/graphics/IOGraphicsTypes.h>
41
42/* Shared memory versions */
43#define EVENT_SYSTEM_VERSION 2
44
45/* Maximum length of SetMouseScaling arrays */
46#define NX_MAXMOUSESCALINGS 20
47
48typedef struct evsioKeymapping/* Match old struct names in kernel */
49{
50 int size;
51 char *mapping;
52} NXKeyMapping;
53
54typedef struct evsioMouseScaling/* Match old struct names in kernel */
55{
56 int numScaleLevels;
57 short scaleThresholds[NX_MAXMOUSESCALINGS];
58 short scaleFactors[NX_MAXMOUSESCALINGS];
59} NXMouseScaling;
60
61typedef enum {
62 NX_OneButton,
63 NX_LeftButton,
64 NX_RightButton
65} NXMouseButton;
66
67/*
68 * NXEventSystemInfo() information structures. These are designed to
69 * allow for expansion.
70 *
71 * The current implementation of NXEventSystemInfo() uses an ioctl call.
72 * THIS WILL CHANGE.
73 */
74
75/*
76 * Generic query max size and typedefs.
77 *
78 *The maximum size is selected to support anticipated future extensions
79 *of request flavors. Certain flavors planned for future releases may
80 *require roughtly 800 ints to represent. We allow a little extra, in
81 *case further growth is needed.
82 */
83typedef int *NXEventSystemInfoType;
84#define NX_EVS_INFO_MAX(1024)/* Max array size */
85typedef int NXEventSystemInfoData[NX_EVS_INFO_MAX];
86
87/* Event System Devices query */
88#define NX_EVS_DEVICE_MAX16
89
90/* Interface types */
91#define NX_EVS_DEVICE_INTERFACE_OTHER0
92#define NX_EVS_DEVICE_INTERFACE_NeXT1 // NeXT custom, in older sys
93#define NX_EVS_DEVICE_INTERFACE_ADB2 // NeXT/fruit keybds/mice
94#define NX_EVS_DEVICE_INTERFACE_ACE3 // For x86 PC keyboards
95#define NX_EVS_DEVICE_INTERFACE_SERIAL_ACE4 // For PC serial mice
96#define NX_EVS_DEVICE_INTERFACE_BUS_ACE5 // For PC bus mice
97#define NX_EVS_DEVICE_INTERFACE_HIL6 // For HIL hp keyboard
98#define NX_EVS_DEVICE_INTERFACE_TYPE57 // For Sun Type5 keyboard
99
100/*
101 * Note! if any new interface types are added above, the following
102 * definition of the number of interfaces supported must reflect this.
103 * This is used in the libkeymap project (storemap.c module) which needs
104 * to be cognizant of the number of new devices coming online
105 * via support for heterogeneous architecture platforms.
106 * e.g., PCs, HP's HIL, Sun's Type5 keyboard,...
107 */
108#define NUM_SUPPORTED_INTERFACES(NX_EVS_DEVICE_INTERFACE_TYPE5 + 1)
109// Other, NeXT, ADB, ACE,...
110
111/* Device types */
112#define NX_EVS_DEVICE_TYPE_OTHER0
113#define NX_EVS_DEVICE_TYPE_KEYBOARD1
114#define NX_EVS_DEVICE_TYPE_MOUSE2// Relative position devices
115#define NX_EVS_DEVICE_TYPE_TABLET3// Absolute position devices
116
117typedef struct {
118intinterface;/* NeXT, ADB, other */
119intinterface_addr;/* Device address on the interface */
120intdev_type;/* Keyboard, mouse, tablet, other */
121intid;/* manufacturer's device handler ID */
122} NXEventSystemDevice;
123
124typedef struct {
125NXEventSystemDevicedev[NX_EVS_DEVICE_MAX];
126} NXEventSystemDeviceList;
127
128#define __OLD_NX_EVS_DEVICE_INFO1
129#define NX_EVS_DEVICE_INFO"Evs_EventDeviceInfo"
130#define NX_EVS_DEVICE_INFO_COUNT \
131(sizeof (NXEventSystemDeviceList) / sizeof (int))
132
133/*
134 * Types used in evScreen protocol compliant operations.
135 */
136
137typedef enum {EVNOP, EVHIDE, EVSHOW, EVMOVE, EVLEVEL} EvCmd; /* Cursor state */
138
139#define EV_SCREEN_MIN_BRIGHTNESS0
140#define EV_SCREEN_MAX_BRIGHTNESS64
141/* Scale should lie between MIN_BRIGHTNESS and MAX_BRIGHTNESS */
142#define EV_SCALE_BRIGHTNESS( scale, datum ) \
143((((UInt32)(datum))*((UInt32)scale)) >> 6)
144
145/*
146 * Definition of a tick, as a time in milliseconds. This controls how
147 * often the event system periodic jobs are run. All actual tick times
148 * are derived from the nanosecond timer. These values are typically used
149 * as part of computing mouse velocity for acceleration purposes.
150 */
151#define EV_TICK_TIME16/* 16 milliseconds */
152#define EV_TICKS_PER_SEC(1000/EV_TICK_TIME)/* ~ 62 Hz */
153
154/* Mouse Button bits, as passed from an EventSrc to the Event Driver */
155#define EV_RB(0x01)
156#define EV_LB(0x04)
157#define EV_MOUSEBUTTONMASK(EV_LB | EV_RB)
158
159/* Tablet Pressure Constants, as passed from an EventSrc to the Event Driver */
160#define EV_MINPRESSURE 0
161#define EV_MAXPRESSURE 255
162
163/* Cursor size in pixels */
164#define EV_CURSOR_WIDTH16
165#define EV_CURSOR_HEIGHT16
166
167
168#define kAppleOnboardGUID 0x0610000000000000ULL
169
170#endif /* !_DEV_EV_TYPES_H */
171
172

Archive Download this file

Revision: 296