1 /* Copyright (C) 1992-1998 The Geometry Center 2 * Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips 3 * 4 * This file is part of Geomview. 5 * 6 * Geomview is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU Lesser General Public License as published 8 * by the Free Software Foundation; either version 2, or (at your option) 9 * any later version. 10 * 11 * Geomview is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with Geomview; see the file COPYING. If not, write 18 * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, 19 * USA, or visit http://www.gnu.org. 20 */ 21 22 23 /* Authors: Stuart Levy, Tamara Munzner, Mark Phillips */ 24 25 #ifndef _EVENT_H 26 #define _EVENT_H 27 28 #include <stdio.h> 29 #include "common.h" 30 31 typedef struct { 32 PFI motionproc; /* current motion proc */ 33 char *epath; /* pathname of external motion program*/ 34 FILE *efp; 35 Pool *epool; /* stream for communication to extern motion program */ 36 int epid; /* pid of external motion pgm, or 0 if none */ 37 } EventState; 38 39 extern EventState estate; 40 41 /* 42 * For keyboard keys, dev number = ascii value 43 * 44 * Other dev number: 45 */ 46 47 #define ELEFTMOUSE 500 48 #define EMIDDLEMOUSE 501 49 #define ERIGHTMOUSE 502 50 /* 51 * values for mouse events: 52 * 1: button went down 53 * -1: button dragged while down 54 * 0: button went up 55 */ 56 57 #define EDRAW 503 58 59 #define EMODEENTER 504 60 #define EMODEEXIT 505 61 62 #define EPICK 506 63 #define EUISELECT 507 64 65 #define PICKWORLD 0 66 #define PICKOBJECT 1 67 68 /* State of buttons, maintained in event.c and potentially usable by 69 * motion or other modules. 70 */ 71 extern struct button { 72 char shift; 73 char ctrl; 74 char left, middle, right; 75 } button; 76 77 extern void event_init(); 78 79 extern void MainLoop(); 80 extern void print_help(); 81 82 extern float elapsed(float *since, float *nextsince); 83 84 #endif /* ! _EVENT_H */ 85 86