mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[client] clipboard: expose shared headers
This commit is contained in:
77
client/include/core/clipboard.h
Normal file
77
client/include/core/clipboard.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Looking Glass
|
||||
* Copyright © 2017-2026 The Looking Glass Authors
|
||||
* https://looking-glass.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _H_LG_CLIENT_CLIPBOARD_
|
||||
#define _H_LG_CLIENT_CLIPBOARD_
|
||||
|
||||
#include "interface/clipboard.h"
|
||||
|
||||
bool lgClipboard_init(void);
|
||||
void lgClipboard_free(void);
|
||||
void lgClipboard_setLocalAvailable(bool available);
|
||||
|
||||
void lgClipboard_setFallback(const LG_ClipboardOps * ops, void * opaque);
|
||||
/* Drop functions remove a dead endpoint without invoking it. */
|
||||
void lgClipboard_dropFallback(void);
|
||||
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_notifyFiles(uint64_t dataset);
|
||||
LG_ClipboardResult lgClipboard_dataBegin(LG_ClipboardRequest request,
|
||||
LG_ClipboardData type, uint64_t sizeHint);
|
||||
LG_ClipboardResult lgClipboard_dataChunk(LG_ClipboardRequest request,
|
||||
uint64_t offset, const void * data, size_t size);
|
||||
LG_ClipboardResult lgClipboard_dataEnd(LG_ClipboardRequest request,
|
||||
uint64_t finalSize);
|
||||
void lgClipboard_data(LG_ClipboardRequest request,
|
||||
LG_ClipboardData type, const void * data, size_t size);
|
||||
void lgClipboard_abort(LG_ClipboardRequest request);
|
||||
/* request is published before provider dispatch. Its storage must remain
|
||||
* valid until this function returns and may be observed by stream callbacks
|
||||
* before then. */
|
||||
bool lgClipboard_requestStream(LG_ClipboardData type,
|
||||
const LG_ClipboardStreamOps * stream, void * opaque,
|
||||
LG_ClipboardRequest * request);
|
||||
bool lgClipboard_requestReady(LG_ClipboardRequest request);
|
||||
bool lgClipboard_request(LG_ClipboardData type,
|
||||
LG_ClipboardReplyFn replyFn, void * opaque);
|
||||
|
||||
/* File-dataset transport entry points used by clipboard_files.c. */
|
||||
bool lgClipboard_fileAcquire(uint64_t dataset, uint64_t acquisition);
|
||||
bool lgClipboard_fileAcquired(uint64_t dataset, uint64_t acquisition,
|
||||
LG_ClipboardFileError error);
|
||||
bool lgClipboard_fileRelease(uint64_t dataset, uint64_t acquisition);
|
||||
bool lgClipboard_fileRequest(const LG_ClipboardFileRequest * request);
|
||||
LG_ClipboardResult lgClipboard_fileDataBegin(
|
||||
const LG_ClipboardFileRequest * request, uint64_t sizeHint);
|
||||
LG_ClipboardResult lgClipboard_fileDataChunk(
|
||||
const LG_ClipboardFileRequest * request, uint64_t responseOffset,
|
||||
const void * data, size_t size);
|
||||
LG_ClipboardResult lgClipboard_fileDataEnd(
|
||||
const LG_ClipboardFileRequest * request, uint64_t finalSize);
|
||||
bool lgClipboard_fileCancel(uint64_t dataset, uint64_t request,
|
||||
LG_ClipboardFileError reason);
|
||||
void lgClipboard_fileRemoteReady(uint64_t dataset);
|
||||
void lgClipboard_fileRemoteFailed(uint64_t dataset);
|
||||
|
||||
#endif
|
||||
86
client/include/core/clipboard_files.h
Normal file
86
client/include/core/clipboard_files.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* Looking Glass
|
||||
* Copyright © 2017-2026 The Looking Glass Authors
|
||||
* https://looking-glass.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _H_LG_CLIENT_CLIPBOARD_FILES_
|
||||
#define _H_LG_CLIENT_CLIPBOARD_FILES_
|
||||
|
||||
#include "interface/clipboard.h"
|
||||
|
||||
bool lgClipboardFiles_init(void);
|
||||
void lgClipboardFiles_free(void);
|
||||
|
||||
/* Desktop backends install a local file selection after reading one of the
|
||||
* standard URI clipboard representations. The payload is copied. */
|
||||
bool lgClipboardFiles_setLocal(const char * mime,
|
||||
const void * data, size_t size);
|
||||
void lgClipboardFiles_clearLocal(void);
|
||||
|
||||
/* Returns an allocated desktop representation for the current guest offer. */
|
||||
bool lgClipboardFiles_getRemote(const char * mime,
|
||||
char ** data, size_t * size);
|
||||
uint64_t lgClipboardFiles_remotePresentationAcquire(void);
|
||||
bool lgClipboardFiles_getRemotePresentation(uint64_t presentation,
|
||||
const char * mime, char ** data, size_t * size);
|
||||
void lgClipboardFiles_remotePresentationDelivered(uint64_t presentation);
|
||||
void lgClipboardFiles_remotePresentationRelease(uint64_t presentation);
|
||||
bool lgClipboardFiles_remoteReady(uint64_t dataset);
|
||||
|
||||
/* Events delivered by the active clipboard transport. */
|
||||
bool lgClipboardFiles_remoteOffer(uint64_t dataset);
|
||||
void lgClipboardFiles_remoteClear(void);
|
||||
void lgClipboardFiles_providerUnavailable(void);
|
||||
void lgClipboardFiles_remoteAcquired(uint64_t dataset,
|
||||
uint64_t acquisition, LG_ClipboardFileError error);
|
||||
LG_ClipboardResult lgClipboardFiles_remoteDataBegin(
|
||||
const LG_ClipboardFileRequest * request, uint64_t sizeHint);
|
||||
LG_ClipboardResult lgClipboardFiles_remoteDataChunk(
|
||||
const LG_ClipboardFileRequest * request, uint64_t responseOffset,
|
||||
const void * data, size_t size);
|
||||
LG_ClipboardResult lgClipboardFiles_remoteDataEnd(
|
||||
const LG_ClipboardFileRequest * request, uint64_t finalSize);
|
||||
void lgClipboardFiles_remoteCancel(uint64_t dataset,
|
||||
uint64_t request, LG_ClipboardFileError reason);
|
||||
|
||||
void lgClipboardFiles_localAcquire(uint64_t dataset,
|
||||
uint64_t acquisition);
|
||||
void lgClipboardFiles_localRelease(uint64_t dataset,
|
||||
uint64_t acquisition);
|
||||
void lgClipboardFiles_localRequest(
|
||||
const LG_ClipboardFileRequest * request);
|
||||
void lgClipboardFiles_localCancel(uint64_t dataset,
|
||||
uint64_t request, LG_ClipboardFileError reason);
|
||||
void lgClipboardFiles_localReady(uint64_t request);
|
||||
|
||||
#ifdef ENABLE_TESTS
|
||||
bool lgClipboardFiles_testInit(uint64_t nonce);
|
||||
bool lgClipboardFiles_testFuseStopWake(void);
|
||||
bool lgClipboardFiles_testUnsentRemoteOwnership(void);
|
||||
size_t lgClipboardFiles_testRemoteDatasetCount(void);
|
||||
void lgClipboardFiles_testExpireRemoteDeliveries(void);
|
||||
bool lgClipboardFiles_testBeginRemoteLookup(uint64_t presentation);
|
||||
void lgClipboardFiles_testEndRemoteLookup(uint64_t presentation);
|
||||
bool lgClipboardFiles_testRemoteRead(uint64_t presentation,
|
||||
uint64_t node, uint64_t offset, uint32_t length);
|
||||
void lgClipboardFiles_testForceLocalEof(void);
|
||||
bool lgClipboardFiles_testLocalRequest(
|
||||
const LG_ClipboardFileRequest * request);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user