1 /* $NetBSD: qevent.h,v 1.3 1999/06/20 17:58:56 ragge Exp $ */ 2 /*- 3 * Copyright (c) 1982, 1986 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by the University of 17 * California, Berkeley and its contributors. 18 * 4. Neither the name of the University nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)qevent.h 7.1 (Berkeley) 5/9/91 35 */ 36 37 /************************************************************************ 38 * * 39 * Copyright (c) 1985 by * 40 * Digital Equipment Corporation, Maynard, MA * 41 * All rights reserved. * 42 * * 43 * This software is furnished under a license and may be used and * 44 * copied only in accordance with the terms of such license and * 45 * with the inclusion of the above copyright notice. This * 46 * software or any other copies thereof may not be provided or * 47 * otherwise made available to any other person. No title to and * 48 * ownership of the software is hereby transferred. * 49 * * 50 * The information in this software is subject to change without * 51 * notice and should not be construed as a commitment by Digital * 52 * Equipment Corporation. * 53 * * 54 * Digital assumes no responsibility for the use or reliability * 55 * of its software on equipment which is not supplied by Digital. * 56 * * 57 ************************************************************************/ 58 59 /* 60 * Event queue entries 61 */ 62 63 #ifndef _QEVENT_ 64 #define _QEVENT_ 65 66 typedef struct _vs_event { 67 unsigned short vse_x; /* x position */ 68 unsigned short vse_y; /* y position */ 69 unsigned short vse_time;/* 10 millisecond units (button only) */ 70 char vse_type; /* button or motion? */ 71 unsigned char vse_key; /* the key (button only) */ 72 char vse_direction; /* which direction (button only) */ 73 char vse_device; /* which device (button only) */ 74 } vsEvent; 75 76 /* vse_type field */ 77 #define VSE_BUTTON 0 /* button moved */ 78 #define VSE_MMOTION 1 /* mouse moved */ 79 #define VSE_TMOTION 2 /* tablet moved */ 80 81 /* vse_direction field */ 82 #define VSE_KBTUP 0 /* up */ 83 #define VSE_KBTDOWN 1 /* down */ 84 #define VSE_KBTRAW 2 /* undetermined */ 85 86 /* vse_device field */ 87 #define VSE_NULL 0 /* NULL event (for QD_GETEVENT ret) */ 88 #define VSE_MOUSE 1 /* mouse */ 89 #define VSE_DKB 2 /* main keyboard */ 90 #define VSE_TABLET 3 /* graphics tablet */ 91 #define VSE_AUX 4 /* auxiliary */ 92 #define VSE_CONSOLE 5 /* console */ 93 94 /* The event queue */ 95 96 typedef struct _vs_eventqueue { 97 vsEvent *events; /* input event buffer */ 98 int size; /* size of event buffer */ 99 int head; /* index into events */ 100 int tail; /* index into events */ 101 } vsEventQueue; 102 103 /* mouse cursor position */ 104 105 typedef struct _vs_cursor { 106 short x; 107 short y; 108 } vsCursor; 109 110 /* mouse motion rectangle */ 111 112 typedef struct _vs_box { 113 short bottom; 114 short right; 115 short left; 116 short top; 117 } vsBox; 118 119 #endif /*_QEVENT_*/ 120