1*95e1ffb1Schristos /* $NetBSD: qevent.h,v 1.6 2005/12/11 12:23:29 christos Exp $ */ 29484404eSragge /*- 39484404eSragge * Copyright (c) 1982, 1986 The Regents of the University of California. 49484404eSragge * All rights reserved. 59484404eSragge * 69484404eSragge * Redistribution and use in source and binary forms, with or without 79484404eSragge * modification, are permitted provided that the following conditions 89484404eSragge * are met: 99484404eSragge * 1. Redistributions of source code must retain the above copyright 109484404eSragge * notice, this list of conditions and the following disclaimer. 119484404eSragge * 2. Redistributions in binary form must reproduce the above copyright 129484404eSragge * notice, this list of conditions and the following disclaimer in the 139484404eSragge * documentation and/or other materials provided with the distribution. 14aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 159484404eSragge * may be used to endorse or promote products derived from this software 169484404eSragge * without specific prior written permission. 179484404eSragge * 189484404eSragge * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 199484404eSragge * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 209484404eSragge * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 219484404eSragge * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 229484404eSragge * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 239484404eSragge * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 249484404eSragge * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 259484404eSragge * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 269484404eSragge * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 279484404eSragge * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 289484404eSragge * SUCH DAMAGE. 299484404eSragge * 309484404eSragge * @(#)qevent.h 7.1 (Berkeley) 5/9/91 319484404eSragge */ 329484404eSragge 339484404eSragge /************************************************************************ 349484404eSragge * * 359484404eSragge * Copyright (c) 1985 by * 369484404eSragge * Digital Equipment Corporation, Maynard, MA * 379484404eSragge * All rights reserved. * 389484404eSragge * * 399484404eSragge * This software is furnished under a license and may be used and * 409484404eSragge * copied only in accordance with the terms of such license and * 419484404eSragge * with the inclusion of the above copyright notice. This * 429484404eSragge * software or any other copies thereof may not be provided or * 439484404eSragge * otherwise made available to any other person. No title to and * 449484404eSragge * ownership of the software is hereby transferred. * 459484404eSragge * * 469484404eSragge * The information in this software is subject to change without * 479484404eSragge * notice and should not be construed as a commitment by Digital * 489484404eSragge * Equipment Corporation. * 499484404eSragge * * 509484404eSragge * Digital assumes no responsibility for the use or reliability * 519484404eSragge * of its software on equipment which is not supplied by Digital. * 529484404eSragge * * 539484404eSragge ************************************************************************/ 549484404eSragge 559484404eSragge /* 569484404eSragge * Event queue entries 579484404eSragge */ 589484404eSragge 599484404eSragge #ifndef _QEVENT_ 609484404eSragge #define _QEVENT_ 619484404eSragge 629484404eSragge typedef struct _vs_event { 639484404eSragge unsigned short vse_x; /* x position */ 649484404eSragge unsigned short vse_y; /* y position */ 659484404eSragge unsigned short vse_time;/* 10 millisecond units (button only) */ 669484404eSragge char vse_type; /* button or motion? */ 679484404eSragge unsigned char vse_key; /* the key (button only) */ 689484404eSragge char vse_direction; /* which direction (button only) */ 699484404eSragge char vse_device; /* which device (button only) */ 709484404eSragge } vsEvent; 719484404eSragge 729484404eSragge /* vse_type field */ 739484404eSragge #define VSE_BUTTON 0 /* button moved */ 749484404eSragge #define VSE_MMOTION 1 /* mouse moved */ 759484404eSragge #define VSE_TMOTION 2 /* tablet moved */ 769484404eSragge 779484404eSragge /* vse_direction field */ 789484404eSragge #define VSE_KBTUP 0 /* up */ 799484404eSragge #define VSE_KBTDOWN 1 /* down */ 809484404eSragge #define VSE_KBTRAW 2 /* undetermined */ 819484404eSragge 829484404eSragge /* vse_device field */ 839484404eSragge #define VSE_NULL 0 /* NULL event (for QD_GETEVENT ret) */ 849484404eSragge #define VSE_MOUSE 1 /* mouse */ 859484404eSragge #define VSE_DKB 2 /* main keyboard */ 869484404eSragge #define VSE_TABLET 3 /* graphics tablet */ 879484404eSragge #define VSE_AUX 4 /* auxiliary */ 889484404eSragge #define VSE_CONSOLE 5 /* console */ 899484404eSragge 909484404eSragge /* The event queue */ 919484404eSragge 929484404eSragge typedef struct _vs_eventqueue { 939484404eSragge vsEvent *events; /* input event buffer */ 949484404eSragge int size; /* size of event buffer */ 959484404eSragge int head; /* index into events */ 969484404eSragge int tail; /* index into events */ 979484404eSragge } vsEventQueue; 989484404eSragge 999484404eSragge /* mouse cursor position */ 1009484404eSragge 1019484404eSragge typedef struct _vs_cursor { 1029484404eSragge short x; 1039484404eSragge short y; 1049484404eSragge } vsCursor; 1059484404eSragge 1069484404eSragge /* mouse motion rectangle */ 1079484404eSragge 1089484404eSragge typedef struct _vs_box { 1099484404eSragge short bottom; 1109484404eSragge short right; 1119484404eSragge short left; 1129484404eSragge short top; 1139484404eSragge } vsBox; 1149484404eSragge 1159484404eSragge #endif /*_QEVENT_*/ 116