aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/XSelection.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unix/x0vncserver/XSelection.cxx')
-rw-r--r--unix/x0vncserver/XSelection.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/unix/x0vncserver/XSelection.cxx b/unix/x0vncserver/XSelection.cxx
index c724d2ac..5de171d1 100644
--- a/unix/x0vncserver/XSelection.cxx
+++ b/unix/x0vncserver/XSelection.cxx
@@ -17,19 +17,23 @@
*/
#include <X11/Xatom.h>
-#include <rfb/Configuration.h>
-#include <rfb/LogWriter.h>
-#include <rfb/util.h>
+
+#include <core/Configuration.h>
+#include <core/LogWriter.h>
+#include <core/string.h>
+
#include <x0vncserver/XSelection.h>
-rfb::BoolParameter setPrimary("SetPrimary",
- "Set the PRIMARY as well as the CLIPBOARD selection",
- true);
-rfb::BoolParameter sendPrimary("SendPrimary",
- "Send the PRIMARY as well as the CLIPBOARD selection",
- true);
+core::BoolParameter
+ setPrimary("SetPrimary",
+ "Set the PRIMARY as well as the CLIPBOARD selection",
+ true);
+core::BoolParameter
+ sendPrimary("SendPrimary",
+ "Send the PRIMARY as well as the CLIPBOARD selection",
+ true);
-static rfb::LogWriter vlog("XSelection");
+static core::LogWriter vlog("XSelection");
XSelection::XSelection(Display* dpy_, XSelectionHandler* handler_)
: TXWindow(dpy_, 1, 1, nullptr), handler(handler_), announcedSelection(None)
@@ -89,7 +93,7 @@ bool XSelection::selectionRequest(Window requestor, Atom selection, Atom target,
return false;
if (target == XA_STRING) {
- std::string latin1 = rfb::utf8ToLatin1(clientData.data(), clientData.length());
+ std::string latin1 = core::utf8ToLatin1(clientData.data(), clientData.length());
XChangeProperty(dpy, requestor, property, XA_STRING, 8, PropModeReplace,
(unsigned char*)latin1.data(), latin1.length());
return true;
@@ -184,11 +188,11 @@ void XSelection::selectionNotify(XSelectionEvent* ev, Atom type, int format,
return;
if (type == xaUTF8_STRING) {
- std::string result = rfb::convertLF((char*)data, nitems);
+ std::string result = core::convertLF((char*)data, nitems);
handler->handleXSelectionData(result.c_str());
} else if (type == XA_STRING) {
- std::string result = rfb::convertLF((char*)data, nitems);
- result = rfb::latin1ToUTF8(result.data(), result.length());
+ std::string result = core::convertLF((char*)data, nitems);
+ result = core::latin1ToUTF8(result.data(), result.length());
handler->handleXSelectionData(result.c_str());
}
}