Moved clipboard changed event to CClientProxy because only it

and CServer use it.  CServerProxy instead makes a direct call
to CClient, like it does for most other messages.
This commit is contained in:
crs
2004-02-29 17:28:51 +00:00
parent 1ccb92b888
commit c3135b1b1c
7 changed files with 21 additions and 34 deletions

View File

@@ -21,8 +21,9 @@
// CClientProxy
//
CEvent::Type CClientProxy::s_readyEvent = CEvent::kUnknown;
CEvent::Type CClientProxy::s_disconnectedEvent = CEvent::kUnknown;
CEvent::Type CClientProxy::s_readyEvent = CEvent::kUnknown;
CEvent::Type CClientProxy::s_disconnectedEvent = CEvent::kUnknown;
CEvent::Type CClientProxy::s_clipboardChangedEvent= CEvent::kUnknown;
CClientProxy::CClientProxy(const CString& name, IStream* stream) :
m_name(name),
@@ -72,6 +73,13 @@ CClientProxy::getDisconnectedEvent()
"CClientProxy::disconnected");
}
CEvent::Type
CClientProxy::getClipboardChangedEvent()
{
return CEvent::registerTypeOnce(s_clipboardChangedEvent,
"CClientProxy::clipboardChanged");
}
void*
CClientProxy::getEventTarget() const
{

View File

@@ -64,6 +64,14 @@ public:
*/
static CEvent::Type getDisconnectedEvent();
//! Get clipboard changed event type
/*!
Returns the clipboard changed event type. This is sent whenever the
contents of the clipboard has changed. The data is a pointer to a
IScreen::CClipboardInfo.
*/
static CEvent::Type getClipboardChangedEvent();
//@}
// IScreen
@@ -100,6 +108,7 @@ private:
static CEvent::Type s_readyEvent;
static CEvent::Type s_disconnectedEvent;
static CEvent::Type s_clipboardChangedEvent;
};
#endif

View File

@@ -1425,7 +1425,7 @@ CServer::addClient(IClient* client)
client->getEventTarget(),
new TMethodEventJob<CServer>(this,
&CServer::handleClipboardGrabbed, client));
EVENTQUEUE->adoptHandler(IScreen::getClipboardChangedEvent(),
EVENTQUEUE->adoptHandler(CClientProxy::getClipboardChangedEvent(),
client->getEventTarget(),
new TMethodEventJob<CServer>(this,
&CServer::handleClipboardChanged, client));
@@ -1454,7 +1454,7 @@ CServer::removeClient(IClient* client)
client->getEventTarget());
EVENTQUEUE->removeHandler(IScreen::getClipboardGrabbedEvent(),
client->getEventTarget());
EVENTQUEUE->removeHandler(IScreen::getClipboardChangedEvent(),
EVENTQUEUE->removeHandler(CClientProxy::getClipboardChangedEvent(),
client->getEventTarget());
// remove from list