msreg.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Software mouse registers
*/
#ifndef _SYS_MSREG_H
#define _SYS_MSREG_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SunOS4.0 4.24 */
#ifdef __cplusplus
extern "C" {
#endif
/*
* Mouse sample.
*/
struct mouseinfo {
char mi_x; /* current X coordinate */
char mi_y; /* current Y coordinate */
char mi_z; /* current wheel */
char mi_buttons; /* set of buttons that are currently down */
};
/*
* Circular buffer storing mouse events.
*/
struct mousebuf {
short mb_size; /* size (in mouseinfo units) of buf */
short mb_off; /* current offset in buffer */
};
struct ms_softc {
short ms_bufbytes; /* buffer size (in bytes) */
short ms_flags; /* currently unused */
short ms_oldoff; /* index into mousebuf */
short ms_eventstate; /* current event being generated */
short ms_readformat; /* format of read stream */
short ms_vuidaddr; /* vuid addr for MS_VUID_FORMAT */
char ms_prevbuttons; /* button state as of last message */
/* sent upstream */
};
#define EVENT_X 0 /* generating delta-X event */
#define EVENT_BUT(i) (i + 1)
#ifdef _KERNEL
/* Get mouse buffer ptr so (window system in particular) can chase */
/* around buffer to get events. */
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MSREG_H */