mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-28 05:36:02 +03:00
c5f6b34d85
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.
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#ifndef CCLIPBOARD_H
|
|
#define CCLIPBOARD_H
|
|
|
|
//
|
|
// CClipboard -- stores clipboard data in a memory buffer
|
|
//
|
|
|
|
#include "IClipboard.h"
|
|
#include "CString.h"
|
|
|
|
class CClipboard : public IClipboard {
|
|
public:
|
|
CClipboard();
|
|
virtual ~CClipboard();
|
|
|
|
// manipulators
|
|
|
|
// unmarshall clipboard data
|
|
void unmarshall(const CString& data, Time);
|
|
|
|
// accessors
|
|
|
|
// marshall clipboard data
|
|
CString marshall() const;
|
|
|
|
// IClipboard overrides
|
|
virtual bool open(Time);
|
|
virtual void close();
|
|
virtual void add(EFormat, const CString& data);
|
|
virtual Time getTime() const;
|
|
virtual bool has(EFormat) const;
|
|
virtual CString get(EFormat) const;
|
|
|
|
// accessors
|
|
|
|
// transfer all the data in one clipboard to another. the
|
|
// clipboards can be of any concrete clipboard type (and
|
|
// they don't have to be the same type). this also sets
|
|
// the timestamp to time, if provided, or the time in src.
|
|
static void copy(IClipboard* dst, const IClipboard* src);
|
|
static void copy(IClipboard* dst, const IClipboard* src, Time);
|
|
|
|
private:
|
|
UInt32 readUInt32(const char*) const;
|
|
void writeUInt32(CString*, UInt32) const;
|
|
|
|
private:
|
|
Time m_time;
|
|
bool m_added[kNumFormats];
|
|
CString m_data[kNumFormats];
|
|
};
|
|
|
|
#endif
|