2 /// \file m_vnc_server.cc
3 /// Mode class for the VNCServer mode
7 Copyright (C) 2005-2010, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #include "m_vnc_server.h"
25 #include "protostructs.h"
30 #include "controller.h"
36 namespace Barry
{ namespace Mode
{
38 static void HandleReceivedDataCallback(void* ctx
, Data
* data
)
40 ((VNCServer
*)ctx
)->HandleReceivedData(*data
);
43 ///////////////////////////////////////////////////////////////////////////////
44 // VNCServer Mode class
46 VNCServer::VNCServer(Controller
&con
, VNCServerDataCallback
& callback
)
47 : Mode(con
, Controller::VNCServer
),
52 VNCServer::~VNCServer()
56 void VNCServer::OnOpen()
58 std::cerr
<< "about to register interest\n";
59 m_socket
->RegisterInterest(HandleReceivedDataCallback
, this);
60 std::cerr
<< "registered interest\n";
63 ///////////////////////////////////////////////////////////////////////////////
66 void VNCServer::Send(Data
& data
)
71 void VNCServer::HandleReceivedData(Data
& data
)
73 Callback
.DataReceived(data
);
76 }} // namespace Barry::Mode