aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorCameron Cawley2019-09-19 22:20:08 +0100
committerFilippos Karapetis2019-09-21 22:16:01 +0300
commit014bef9eab9fb409cfb3ec66830e033e4aaa29a9 (patch)
tree1d4dedd703446cbf1cb90a279fc186cc293f1486 /engines
parentbdd7b6baedea7455fdc1754f7c7b49fef201cc2a (diff)
downloadscummvm-rg350-014bef9eab9fb409cfb3ec66830e033e4aaa29a9.tar.gz
scummvm-rg350-014bef9eab9fb409cfb3ec66830e033e4aaa29a9.tar.bz2
scummvm-rg350-014bef9eab9fb409cfb3ec66830e033e4aaa29a9.zip
BACKENDS: Add a default clipboard implementation
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/selection.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/engines/glk/selection.cpp b/engines/glk/selection.cpp
index 756df02b09..f5ef012fd2 100644
--- a/engines/glk/selection.cpp
+++ b/engines/glk/selection.cpp
@@ -33,27 +33,23 @@ void Clipboard::clipboardStore(const Common::U32String &text) {
}
void Clipboard::clipboardSend(ClipSource source) {
- if (g_system->hasFeature(OSystem::kFeatureClipboardSupport)) {
- // Convert unicode string to standard string, since that's all ScummVM supports
- Common::String text;
- for (uint idx = 0; idx < _text.size(); ++idx)
- text += (_text[idx] <= 0x7f) ? (char)_text[idx] : '?';
+ // Convert unicode string to standard string, since that's all ScummVM supports
+ Common::String text;
+ for (uint idx = 0; idx < _text.size(); ++idx)
+ text += (_text[idx] <= 0x7f) ? (char)_text[idx] : '?';
- g_system->setTextInClipboard(text);
- }
+ g_system->setTextInClipboard(text);
}
void Clipboard::clipboardReceive(ClipSource source) {
- if (g_system->hasFeature(OSystem::kFeatureClipboardSupport)) {
- Windows &windows = *g_vm->_windows;
-
- if (g_system->hasTextInClipboard()) {
- Common::String text = g_system->getTextFromClipboard();
- for (uint idx = 0; idx < text.size(); ++idx) {
- uint c = text[idx];
- if (c != '\r' && c != '\n' && c != '\b' && c != '\t')
- windows.inputHandleKey(c);
- }
+ Windows &windows = *g_vm->_windows;
+
+ if (g_system->hasTextInClipboard()) {
+ Common::String text = g_system->getTextFromClipboard();
+ for (uint idx = 0; idx < text.size(); ++idx) {
+ uint c = text[idx];
+ if (c != '\r' && c != '\n' && c != '\b' && c != '\t')
+ windows.inputHandleKey(c);
}
}
}