Sync utf8 clipboard support

This commit is contained in:
Lauri Kasanen
2021-04-12 12:38:24 +03:00
parent 04461b9d4c
commit a1cf454f06
34 changed files with 1794 additions and 181 deletions

View File

@@ -107,6 +107,17 @@ namespace rfb {
virtual void framebufferUpdateEnd();
virtual void dataRect(const Rect& r, int encoding);
virtual void serverCutText(const char* str);
virtual void handleClipboardCaps(rdr::U32 flags,
const rdr::U32* lengths);
virtual void handleClipboardRequest(rdr::U32 flags);
virtual void handleClipboardPeek(rdr::U32 flags);
virtual void handleClipboardNotify(rdr::U32 flags);
virtual void handleClipboardProvide(rdr::U32 flags,
const size_t* lengths,
const rdr::U8* const* data);
// Methods to be overridden in a derived class
@@ -121,9 +132,43 @@ namespace rfb {
// derived class must call on to CConnection::serverInit().
virtual void serverInit();
// handleClipboardRequest() is called whenever the server requests
// the client to send over its clipboard data. It will only be
// called after the client has first announced a clipboard change
// via announceClipboard().
virtual void handleClipboardRequest();
// handleClipboardAnnounce() is called to indicate a change in the
// clipboard on the server. Call requestClipboard() to access the
// actual data.
virtual void handleClipboardAnnounce(bool available);
// handleClipboardData() is called when the server has sent over
// the clipboard data as a result of a previous call to
// requestClipboard(). Note that this function might never be
// called if the clipboard data was no longer available when the
// server received the request.
virtual void handleClipboardData(const char* data);
// Other methods
// requestClipboard() will result in a request to the server to
// transfer its clipboard data. A call to handleClipboardData()
// will be made once the data is available.
virtual void requestClipboard();
// announceClipboard() informs the server of changes to the
// clipboard on the client. The server may later request the
// clipboard data via handleClipboardRequest().
virtual void announceClipboard(bool available);
// sendClipboardData() transfers the clipboard data to the server
// and should be called whenever the server has requested the
// clipboard via handleClipboardRequest().
virtual void sendClipboardData(const char* data);
CMsgReader* reader() { return reader_; }
CMsgWriter* writer() { return writer_; }
@@ -190,6 +235,9 @@ namespace rfb {
ModifiablePixelBuffer* framebuffer;
DecodeManager decoder;
char* serverClipboard;
bool hasLocalClipboard;
};
}
#endif