initial revision of synergy. currently semi-supports X windows
on unix, but client screens don't simulate events other than mouse move. also not supporting clipboard at all yet and the main app is just a temporary framework to test with. must clean up protocol and communication.
This commit is contained in:
58
CSocket.cpp
Normal file
58
CSocket.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
#include "CSocket.h"
|
||||
#include "IJob.h"
|
||||
|
||||
//
|
||||
// CSocket
|
||||
//
|
||||
|
||||
CSocket::CSocket() : m_readJob(NULL), m_writeJob(NULL)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
CSocket::~CSocket()
|
||||
{
|
||||
delete m_readJob;
|
||||
delete m_writeJob;
|
||||
}
|
||||
|
||||
void CSocket::setReadJob(IJob* adoptedJob)
|
||||
{
|
||||
delete m_readJob;
|
||||
m_readJob = adoptedJob;
|
||||
onJobChanged();
|
||||
}
|
||||
|
||||
void CSocket::setWriteJob(IJob* adoptedJob)
|
||||
{
|
||||
delete m_writeJob;
|
||||
m_writeJob = adoptedJob;
|
||||
onJobChanged();
|
||||
}
|
||||
|
||||
void CSocket::onJobChanged()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void CSocket::runReadJob()
|
||||
{
|
||||
if (m_readJob)
|
||||
m_readJob->run();
|
||||
}
|
||||
|
||||
void CSocket::runWriteJob()
|
||||
{
|
||||
if (m_writeJob)
|
||||
m_writeJob->run();
|
||||
}
|
||||
|
||||
bool CSocket::hasReadJob() const
|
||||
{
|
||||
return (m_readJob != NULL);
|
||||
}
|
||||
|
||||
bool CSocket::hasWriteJob() const
|
||||
{
|
||||
return (m_writeJob != NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user