summaryrefslogtreecommitdiff
path: root/src/utils/copynpaste.cpp
diff options
context:
space:
mode:
authorVasily <danilka.pro@gmail.com>2015-12-03 03:25:30 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-03 16:18:08 +0300
commitd090aa77c4d0b31aded37128cae011b882f3dd9b (patch)
treef7957b084285916d4dbff43b9025a2c1eb439a51 /src/utils/copynpaste.cpp
parent1b47ede798838c9f50ad3175c9d05e1dfbad2474 (diff)
downloadmv-d090aa77c4d0b31aded37128cae011b882f3dd9b.tar.gz
mv-d090aa77c4d0b31aded37128cae011b882f3dd9b.tar.bz2
mv-d090aa77c4d0b31aded37128cae011b882f3dd9b.tar.xz
mv-d090aa77c4d0b31aded37128cae011b882f3dd9b.zip
Added NaCl messaging and clipboard functions
Diffstat (limited to 'src/utils/copynpaste.cpp')
-rw-r--r--src/utils/copynpaste.cpp18
1 files changed, 18 insertions, 0 deletions
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&)
{