blob: b2a4a9ab6f98d49b17807699c1d3634c587de8c2 [file] [log] [blame]
// Copyright 2016 The Android Open Source Project
//
// This software is licensed under the terms of the GNU General Public
// License version 2, as published by the Free Software Foundation, and
// may be copied, distributed, and modified under those terms.
//
// 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.
#include "android/emulation/control/clipboard_agent.h"
#include "android/emulation/ClipboardPipe.h"
static void set_guest_clipboard_callback(
void(*cb)(const uint8_t*, size_t)) {
android::emulation::ClipboardPipe::setGuestClipboardCallback(cb);
}
static void set_guest_clipboard_contents(const uint8_t* buf, size_t len) {
const auto pipe =
android::emulation::ClipboardPipe::Service::getPipe();
if (pipe) {
pipe->setGuestClipboardContents(buf, len);
}
}
static const QAndroidClipboardAgent clipboardAgent = {
.setGuestClipboardCallback = set_guest_clipboard_callback,
.setGuestClipboardContents = set_guest_clipboard_contents
};
extern "C" const QAndroidClipboardAgent* const gQAndroidClipboardAgent =
&clipboardAgent;