00001 /* 00002 * This file is part of Micole Architecture 00003 * 00004 * Copyright (C) 2007 Micole partners 00005 * 00006 * Micole Architecture is free software: you can redistribute it 00007 * and/or modify it under the terms of the GNU Lesser General 00008 * Public License as published by the Free Software Foundation, 00009 * either version 3 of the License, or (at your option) any 00010 * later version. 00011 * 00012 * Micole Architecture is distributed in the hope that it will be 00013 * useful, * but WITHOUT ANY WARRANTY; without even the implied 00014 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00015 * PURPOSE. See the GNU Lesser General Public License for more 00016 * details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with Micole Architecture. If not, see 00020 * <http://www.gnu.org/licenses/>. 00021 */ 00022 00023 #include "stdafx.h" 00024 #include "VTPlayerSenderAgent.h" 00025 #include "MicoleStringStream.h" 00026 00027 00028 VTPlayerSenderAgent::VTPlayerSenderAgent() 00029 :MicoleAgent("VTPlayerSenderAgent","SenderAgent") 00030 { 00031 sendMessage("VTPlayer Sender Agent Started"); 00032 VTPMouseController::getInstance()->setListener(this); 00033 VTPMouseController::getInstance()->run(); 00034 } 00035 00036 VTPlayerSenderAgent::VTPlayerSenderAgent(const VTPlayerSenderAgent &) 00037 :MicoleAgent("VTPlayerSenderAgent","SenderAgent") 00038 { 00039 } 00040 00041 VTPlayerSenderAgent::~VTPlayerSenderAgent() 00042 { 00043 sendMessage("VTPlayer Sender Agent Stopped"); 00044 } 00045 00046 void VTPlayerSenderAgent::onMouseMove(int posx, int posy) 00047 { 00048 MicoleStringStream s; 00049 s<< "IN VTP : pos=(" << posx << ", "<< posy << ");"; 00050 sendMessage(s.str()); 00051 } 00052 00053 bool VTPlayerSenderAgent::onPressed(int button) 00054 { 00055 MicoleStringStream s; 00056 s<< "IN VTP : press=(" << button << ");"; 00057 00058 sendMessage(s.str()); 00059 return true; 00060 } 00061 00062 bool VTPlayerSenderAgent::onReleased(int button) 00063 { 00064 MicoleStringStream s; 00065 s<< "IN VTP : release=(" << button << ");"; 00066 sendMessage(s.str()); 00067 return true; 00068 }