1 /* 2 * Simulator of microcontrollers (eventcl.h) 3 * 4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. 5 * 6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu 7 * 8 */ 9 10 /* This file is part of microcontroller simulator: ucsim. 11 12 UCSIM is free software; you can redistribute it and/or modify 13 it under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2 of the License, or 15 (at your option) any later version. 16 17 UCSIM is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 You should have received a copy of the GNU General Public License 23 along with UCSIM; see the file COPYING. If not, write to the Free 24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. */ 26 /*@1@*/ 27 28 #ifndef EVENTCL_HEADER 29 #define EVENTCL_HEADER 30 31 #include "ddconfig.h" 32 33 #if FD_HEADER_OK 34 # include HEADER_FD 35 #endif 36 37 #include "pobjcl.h" 38 39 #include "viewcl.h" 40 41 42 #define EV_NOTHING 0x0000 43 #define EV_MOUSE_DOWN 0x0001 44 #define EV_MOUSE_UP 0x0002 45 #define EV_MOUSE_MOVE 0x0004 46 #define EV_MOUSE_AUTO 0x0008 47 #define EV_KEY 0x0010 48 #define EV_COMMAND 0x0100 49 #define EV_BROADCAST 0x0200 50 51 // cathegories 52 #define EV_MOUSE (EV_MOUSE_DOWN|EV_MOUSE_UP|EV_MOUSE_MOVE|EV_MOUSE_AUTO) 53 #define EV_KEYBOARD EV_KEY 54 #define EV_MESSAGE 0xff00 55 56 #define CMD_QUIT 0 57 58 struct t_event { 59 int what; 60 union { 61 wchar_t key; 62 struct { 63 int cmd; 64 long param; 65 } msg; 66 } event; 67 }; 68 69 70 class cl_input_src: public cl_base 71 { 72 public: 73 FILE *file; 74 class cl_view *view; 75 cl_input_src(FILE *ifile, class cl_view *iview); 76 }; 77 78 class cl_gin: public cl_base 79 { 80 public: 81 fd_set in_set; 82 int max_fdes; 83 cl_list *inputs; 84 public: 85 cl_gin(void); 86 ~cl_gin(void); 87 88 virtual int add_input(FILE *ifile, class cl_view *iview); 89 virtual class cl_input_src *get_input_src(int fdes); 90 virtual int get_event(struct t_event *event); 91 }; 92 93 94 #endif 95 96 /* End of gui.src/eventcl.h */ 97