mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-09 05:13:36 +08:00
sending a sequence number with enter messages. screens use that sequence number in clipboard grab and data messages. the server uses the sequence number to order messages across clients. also changed secondary screens to send clipboard updates on leaving (or when grab occurs when not active) instead of on a query from the server. primary effectively does the same. the query message has been removed.
66 lines
1.2 KiB
C++
66 lines
1.2 KiB
C++
#ifndef CCLIENT_H
|
|
#define CCLIENT_H
|
|
|
|
#include "CMutex.h"
|
|
#include "CString.h"
|
|
#include "BasicTypes.h"
|
|
#include "ClipboardTypes.h"
|
|
#include "IClipboard.h"
|
|
|
|
class CNetworkAddress;
|
|
class IInputStream;
|
|
class IOutputStream;
|
|
class ISecondaryScreen;
|
|
|
|
class CClient {
|
|
public:
|
|
CClient(const CString& clientName);
|
|
~CClient();
|
|
|
|
// manipulators
|
|
|
|
void run(const CNetworkAddress& serverAddress);
|
|
|
|
// handle events on client's screen
|
|
void onClipboardChanged(ClipboardID);
|
|
|
|
// accessors
|
|
|
|
|
|
private:
|
|
void runSession(void*);
|
|
|
|
// open/close the primary screen
|
|
void openSecondaryScreen();
|
|
void closeSecondaryScreen();
|
|
|
|
// message handlers
|
|
void onEnter();
|
|
void onLeave();
|
|
void onGrabClipboard();
|
|
void onScreenSaver();
|
|
void onQueryInfo();
|
|
void onSetClipboard();
|
|
void onKeyDown();
|
|
void onKeyRepeat();
|
|
void onKeyUp();
|
|
void onMouseDown();
|
|
void onMouseUp();
|
|
void onMouseMove();
|
|
void onMouseWheel();
|
|
|
|
private:
|
|
CMutex m_mutex;
|
|
CString m_name;
|
|
IInputStream* m_input;
|
|
IOutputStream* m_output;
|
|
ISecondaryScreen* m_screen;
|
|
const CNetworkAddress* m_serverAddress;
|
|
bool m_active;
|
|
UInt32 m_seqNum;
|
|
bool m_ownClipboard[kClipboardEnd];
|
|
IClipboard::Time m_timeClipboard[kClipboardEnd];
|
|
};
|
|
|
|
#endif
|