DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/hardware/serialport/serialmouse.h
00001 /*
00002  *  Copyright (C) 2002-2020  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 /* $Id: serialdummy.h,v 1.5 2009-05-27 09:15:41 qbix79 Exp $ */
00020 
00021 #ifndef INCLUDEGUARD_SERIALMOUSE_H
00022 #define INCLUDEGUARD_SERIALMOUSE_H
00023 
00024 #include "serialport.h"
00025 
00026 //#define CHECKIT_TESTPLUG
00027 
00028 class CSerialMouse : public CSerial {
00029 public:
00030         CSerialMouse(Bitu id, CommandLine* cmd);
00031         virtual ~CSerialMouse();
00032 
00033         void setRTSDTR(bool rts, bool dtr);
00034         void setRTS(bool val);
00035         void setDTR(bool val);
00036 
00037         void updatePortConfig(Bit16u, Bit8u lcr);
00038         void updateMSR();
00039         void transmitByte(Bit8u val, bool first);
00040         void setBreak(bool value);
00041         void handleUpperEvent(Bit16u type);
00042         void onMouseReset();
00043         void on_mouse_event(int delta_x,int delta_y,Bit8u buttonstate);
00044         void start_packet();
00045 
00046         Bit8u send_ack;
00047     Bit8u packet[3] = {};
00048         Bit8u packet_xmit;
00049         Bit8u mouse_buttons;    /* bit 0 = left   bit 1 = right     becomes bits 5 (L) and 4 (R) in packet[0] */
00050         Bit8u xmit_another_packet;
00051         int mouse_delta_x,mouse_delta_y;
00052 #ifdef CHECKIT_TESTPLUG
00053         Bit8u loopbackdata;
00054 #endif
00055 
00056 };
00057 
00058 #endif // INCLUDEGUARD