1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate /* 28*7c478bd9Sstevel@tonic-gate * Software mouse registers 29*7c478bd9Sstevel@tonic-gate */ 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gate #ifndef _SYS_MSREG_H 32*7c478bd9Sstevel@tonic-gate #define _SYS_MSREG_H 33*7c478bd9Sstevel@tonic-gate 34*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* SunOS4.0 4.24 */ 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 38*7c478bd9Sstevel@tonic-gate #include <sys/types32.h> 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 41*7c478bd9Sstevel@tonic-gate extern "C" { 42*7c478bd9Sstevel@tonic-gate #endif 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate /* 45*7c478bd9Sstevel@tonic-gate * Mouse sample. 46*7c478bd9Sstevel@tonic-gate */ 47*7c478bd9Sstevel@tonic-gate struct mouseinfo { 48*7c478bd9Sstevel@tonic-gate char mi_x; /* current X coordinate */ 49*7c478bd9Sstevel@tonic-gate char mi_y; /* current Y coordinate */ 50*7c478bd9Sstevel@tonic-gate char mi_z; /* current wheel */ 51*7c478bd9Sstevel@tonic-gate char mi_buttons; /* set of buttons that are currently down */ 52*7c478bd9Sstevel@tonic-gate #define MS_HW_BUT1 0x4 /* left button position */ 53*7c478bd9Sstevel@tonic-gate #define MS_HW_BUT2 0x2 /* middle button position */ 54*7c478bd9Sstevel@tonic-gate #define MS_HW_BUT3 0x1 /* right button position */ 55*7c478bd9Sstevel@tonic-gate struct timeval32 mi_time; /* timestamp */ 56*7c478bd9Sstevel@tonic-gate }; 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate /* 59*7c478bd9Sstevel@tonic-gate * Circular buffer storing mouse events. 60*7c478bd9Sstevel@tonic-gate */ 61*7c478bd9Sstevel@tonic-gate struct mousebuf { 62*7c478bd9Sstevel@tonic-gate short mb_size; /* size (in mouseinfo units) of buf */ 63*7c478bd9Sstevel@tonic-gate short mb_off; /* current offset in buffer */ 64*7c478bd9Sstevel@tonic-gate struct mouseinfo mb_info[1]; /* however many samples */ 65*7c478bd9Sstevel@tonic-gate }; 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate struct ms_softc { 68*7c478bd9Sstevel@tonic-gate struct mousebuf *ms_buf; /* pointer to mouse buffer */ 69*7c478bd9Sstevel@tonic-gate short ms_bufbytes; /* buffer size (in bytes) */ 70*7c478bd9Sstevel@tonic-gate short ms_flags; /* currently unused */ 71*7c478bd9Sstevel@tonic-gate short ms_oldoff; /* index into mousebuf */ 72*7c478bd9Sstevel@tonic-gate short ms_eventstate; /* current event being generated */ 73*7c478bd9Sstevel@tonic-gate short ms_readformat; /* format of read stream */ 74*7c478bd9Sstevel@tonic-gate #define MS_3BYTE_FORMAT VUID_NATIVE /* 3 byte format (buts/x/y) */ 75*7c478bd9Sstevel@tonic-gate #define MS_VUID_FORMAT VUID_FIRM_EVENT /* vuid Firm_event format */ 76*7c478bd9Sstevel@tonic-gate short ms_vuidaddr; /* vuid addr for MS_VUID_FORMAT */ 77*7c478bd9Sstevel@tonic-gate char ms_prevbuttons; /* button state as of last message */ 78*7c478bd9Sstevel@tonic-gate /* sent upstream */ 79*7c478bd9Sstevel@tonic-gate }; 80*7c478bd9Sstevel@tonic-gate 81*7c478bd9Sstevel@tonic-gate #define EVENT_X 0 /* generating delta-X event */ 82*7c478bd9Sstevel@tonic-gate #define EVENT_Y 1 /* generating delta-Y event */ 83*7c478bd9Sstevel@tonic-gate #define EVENT_BUT1 2 /* generating button 1 event */ 84*7c478bd9Sstevel@tonic-gate #define EVENT_BUT2 3 /* generating button 2 event */ 85*7c478bd9Sstevel@tonic-gate #define EVENT_BUT3 4 /* generating button 3 event */ 86*7c478bd9Sstevel@tonic-gate #define EVENT_BUT4 5 /* generating button 4 event */ 87*7c478bd9Sstevel@tonic-gate #define EVENT_BUT5 6 /* generating button 5 event */ 88*7c478bd9Sstevel@tonic-gate #define EVENT_BUT6 7 /* generating button 6 event */ 89*7c478bd9Sstevel@tonic-gate #define EVENT_BUT7 8 /* generating button 7 event */ 90*7c478bd9Sstevel@tonic-gate #define EVENT_BUT8 9 /* generating button 8 event */ 91*7c478bd9Sstevel@tonic-gate #define EVENT_BUT9 10 /* generating button 9 event */ 92*7c478bd9Sstevel@tonic-gate #define EVENT_BUT10 11 /* generating button 10 event */ 93*7c478bd9Sstevel@tonic-gate #define EVENT_WHEEL 12 /* generating wheel event */ 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate #define EVENT_BUT(i) (i + 1) 96*7c478bd9Sstevel@tonic-gate 97*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL 98*7c478bd9Sstevel@tonic-gate #define MSIOGETBUF _IOWR('m', 1, int) /* MSIOGETBUF is OBSOLETE */ 99*7c478bd9Sstevel@tonic-gate /* Get mouse buffer ptr so (window system in particular) can chase */ 100*7c478bd9Sstevel@tonic-gate /* around buffer to get events. */ 101*7c478bd9Sstevel@tonic-gate #endif 102*7c478bd9Sstevel@tonic-gate 103*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 104*7c478bd9Sstevel@tonic-gate } 105*7c478bd9Sstevel@tonic-gate #endif 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate #endif /* _SYS_MSREG_H */ 108