From d090aa77c4d0b31aded37128cae011b882f3dd9b Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 3 Dec 2015 03:25:30 +0300 Subject: Added NaCl messaging and clipboard functions --- src/utils/copynpaste.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/utils/copynpaste.cpp') diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp index 1f88d8abf..45729021e 100644 --- a/src/utils/copynpaste.cpp +++ b/src/utils/copynpaste.cpp @@ -470,6 +470,24 @@ static bool runxsel(std::string& text, const char *p1, const char *p2) return true; } +#elif defined __native_client__ + +#include "utils/process.h" + +bool retrieveBuffer(std::string& text, size_t& pos) +{ + NaclMessageHandle *handle = naclRegisterMessageHandler("clipboard-paste"); + naclPostMessage("clipboard-paste", ""); + std::string response = naclWaitForMessage(handle); + text.insert(pos, response); + return true; +} + +bool sendBuffer(std::string& text) +{ + naclPostMessage("clipboard-copy", text); + return true; +} #else bool retrieveBuffer(std::string&, size_t&) { -- cgit v1.2.3-70-g09d2