/*
 * @(#)evq_ioctl.h 1.1 90/11/16
 */

/*
 * Copyright (c) 1989 by Sun Microsystems, Inc.
 */

#ifndef	evq_ioctl_DEFINED
#define	evq_ioctl_DEFINED

/*
 * The header file defines the ioctl calls made to the Event Queue driver.
 */

/*
 * Locator behavior (Scaling & Button order)
 */
#define	EVQGETBUTTONORDER _IOR(g, 1, int)
#define	EVQSETBUTTONORDER _IOW(g, 2, int)
	/* Get / Set the apparent order of buttons on the mouse */	
#define	EVQGETSCALING _IOR(g, 3, Ev_scale_list)
#define	EVQSETSCALING _IOW(g, 4, Ev_scale_list)
	/* Get / Set the scaling used on the mouse */	

/*
 * Vuid state probe.
 */
#define	EVQGETVUIDVALUE	_IOWR(g, 5, struct firm_event)
	/* Copy in *firm_event to determine id, place value in firm_event
	value field and copy out *firm_event (0 is default result). */

/*
 * Device creation, inquiry and deletion.
 */
struct	input_device {
	int	id;			/* fd (or number) of input device
					   or -1 */
	char	name[SCR_NAMESIZE];	/* name of input device */
};

struct	usrdesktop {
	struct screen udt_scr;		/* screen device */
	struct input_device udt_kbd;	/* keyboard device */
	struct input_device udt_ms;	/* mouse device */
};

/*
 * Neighbor screen info
 */
struct neighbor {
	int 	id;		/* id of screen to get neighbors */
	int	neighbors[SCR_POSITIONS]; /* neigbor screens */
};

#define	EVQ_NODEV	-1	/* special fd meaning no device */
#define	EVQSETQUEUE	_IOW(g, 6, struct usrdesktop)
#define EVQADDSCREEN    _IOW(g, 7, struct usrdesktop)
#define EVQSETSCREEN	_IOW(g, 8, struct neighbor)
#define EVQGETSCREEN    _IOR(g, 9, int)
#define EVQDESTROY	_IO(g, 10)
#define	EVQSETKBD	_IOW(g, 11, struct usrdesktop)
#define	EVQSETMS	_IOW(g, 12, struct usrdesktop)
#define	EVQSETINPUTDEV	_IOW(g, 13, struct input_device)
	/* Copies in input_device which identifies the input device.
	The kernel sends an ioctl to make it send firm events.
	The device's unread input is flushed.  User process starts
	reading from the device.  The input device is opened before
	making this call (obviously) and the id field is set to the
	file descriptor.  The name is used to identify the device
	on subsequent calls.  If id is -1 then the device indicated
	by name is reset (to firm events or native mode, flush unread
	input) and no longer read by user process. */
#define	EVQGETINPUTDEV	_IOWR(g, 14, struct input_device)
	/* Copies in input_device and (depending on id) returns some
	information about an input device.  If id is -1 then the
	device indicated by name is checked for existence (as far as
	user process is concerned).  If it exists then ioctl returns 0,
	but if it doesn't then errno is set to ENODEV.  If id is some
	small positive decimal then the idth input device's name is
	returned in name.  This is used for enumerated the input devices
	being used.  errno is set to ENODEV if id doesn't correspond
	to an open input device. */

/*
 * Multi-mask input control.
 */
#define EVQGETKBDMASK   _IOR(g, 15, struct inputmask)
        /* Copy out *inputmask for kbd mask */
#define EVQGETPICKMASK  _IOR(g, 16, struct inputmask)
        /* Copy out *inputmask for pick mask */
#define EVQSETKBDMASK   _IOW(g, 17, struct inputmask)
        /* Copy in *inputmask and set kbd input mask */
#define EVQSETPICKMASK  _IOW(g, 18, struct inputmask)
        /* Copy in *inputmask and set pick input mask */

struct mouseposition {
        short   msp_x, msp_y;
};

/*
 * Mouse cursor operations.
 */
#define EVQSETMOUSE     _IOW(g, 19, struct mouseposition)
        /* Copy in *mouseposition and set mouse relative to window.

/*
 * Debugging utilities
 */
#define	EVQPRINT	_IO(g, 20)
	/* Print the event queue's data structure on the console.*/

#endif	evq_ioctl_DEFINED

