Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

maiaCommandParser.h

Go to the documentation of this file.
00001 
00002 // This code is part of the MaiaProject free software
00003 //
00004 // Keyboard and Mouse Emulator - Virtual keyboard Engine
00005 //
00006 // Copyright (c) 2002-2003 Luca Clivio <luca.clivio@maiaproject.org>
00007 // Tel. +39-347-2538040
00008 // via B.Croce 2, 20037 Paderno Dugnano (Milano) - Italy
00009 //
00010 // Developers:
00011 //    Simone Mangano <simone.mangano@maiaproject.org>
00012 //    Andrea Tosato  <andrea.tosato@maiaproject.org>
00013 //
00014 //  -----------------------------------------------------------------------------
00015 //  This program is free software; This program is free software; 
00016 //  you can redistribute it and/or modify it under the terms of the 
00017 //  GNU General Public License as published by the Free Software Foundation; 
00018 //  either version 2 of the License, or (at your option) any later version.
00019 //  but WITHOUT ANY WARRANTY; without even the implied warranty of                              
00020 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                                
00021 //  GNU General Public License for more details.                                                
00022 //  You should have received a copy of the GNU General Public License                           
00023 //  along with this program; if not, write to the Free Software                                 
00024 //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                                   
00026 
00027 
00028 #ifndef _maiaCommandParser_
00029 #define _maiaCommandParser_
00030 
00031 #include <openmaia/libopenmaia.h>
00032 #include <openmaia/libopenmaiaui.h>
00033 #include <openmaia/libopenmaiadrivers.h>
00034 
00035 #include "maiaKeyboard.h"
00036 #include "maiaOptions.h"
00037 
00038 #include <wx/wx.h>
00039 #include <wx/joystick.h>
00040 
00041 #include <iostream>
00042 
00052 class maiaCommandParser: public omUICommandParser{
00053  private:
00054   // --- variables to store actual value of options
00055 
00056   // keyboard drivers options
00057   int actionKey, upKey, downKey, leftKey, rightKey;  
00058   bool actionOnPress, grabKeys, keyboardEnabled; 
00059 
00060   // joy driver
00061   bool joystickEnabled;    
00062 
00063   // serial driver
00064   bool serialEnabled;      
00065   wxString serialPort ;    
00066 
00067 
00068   omKeyboardDriver *kbDriver;  
00069   omJoystickDriver *jDriver;   
00070   omSerialDriver *sDriver;     
00071   maiaKeyboard *keyboard;      
00072   maiaOptions *opts ;          
00073   omConnector *connector;      
00074 
00075  public:
00076   maiaCommandParser();
00077   void Init() ;
00078   void Reload();
00079   void Start() ;
00080   void Stop() ;
00081 
00082   void NotifyTCPMessage(omTCPMessage);
00083   bool ParseAction(omCommand);
00084 
00085   // message handlers
00086   void Action();
00087   void GoUp();
00088   void GoDown();
00089   void GoLeft();
00090   void GoRight();
00091 };
00092 
00093 #endif