[client] clipboard: add transport provider interface
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

Route clipboard exchange through a provider interface. Connected
transports take priority while SPICE remains the fallback.

Track asynchronous X11 and Wayland transfers by request, preserving
clipboard ownership across provider changes.

Use PureSpice clipboard status notifications for capability and
lifecycle updates.
This commit is contained in:
Geoffrey McRae
2026-08-09 20:10:46 +10:00
parent 0da4bfa8dd
commit 4c53f5b9f8
22 changed files with 2287 additions and 539 deletions

View File

@@ -18,13 +18,26 @@
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <purespice.h>
#include "interface/displayserver.h"
#ifndef _H_LG_CLIENT_CLIPBOARD_
#define _H_LG_CLIENT_CLIPBOARD_
LG_ClipboardData cb_spiceTypeToLGType(const PSDataType type);
PSDataType cb_lgTypeToSpiceType(const LG_ClipboardData type);
#include "interface/clipboard.h"
void cb_spiceNotice(const PSDataType type);
void cb_spiceData(const PSDataType type, uint8_t * buffer, uint32_t size);
void cb_spiceRelease(void);
void cb_spiceRequest(const PSDataType type);
void lgClipboard_init(void);
void lgClipboard_free(void);
void lgClipboard_setLocalAvailable(bool available);
void lgClipboard_setFallback(const LG_ClipboardOps * ops, void * opaque);
void lgClipboard_setTransport(const LG_ClipboardOps * ops, void * opaque);
void lgClipboard_dropTransport(void);
void lgClipboard_release(void);
void lgClipboard_notifyTypes(
const LG_ClipboardData types[], size_t count);
void lgClipboard_data(LG_ClipboardRequest request,
LG_ClipboardData type, const void * data, size_t size);
void lgClipboard_abort(LG_ClipboardRequest request);
bool lgClipboard_request(LG_ClipboardData type,
LG_ClipboardReplyFn replyFn, void * opaque);
#endif