MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetText

Method SetText

Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp:1222–1245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1220}
1221
1222void SDLClipboard::SetText(const StringView& text)
1223{
1224 if (CommandLine::Options.Headless.IsTrue())
1225 return;
1226 auto mainWindow = Engine::MainWindow;
1227 if (!mainWindow)
1228 return;
1229
1230 if (X11Impl::xDisplay)
1231 {
1232 X11Impl::ClipboardText.Set(text.Get(), text.Length());
1233 X11Impl::ClipboardData.Clear();
1234 X11Impl::ClipboardFiles.Clear();
1235
1236 X11::Window window = (X11::Window)(mainWindow->GetNativePtr());
1237 X11::XSetSelectionOwner(X11Impl::xDisplay, X11Impl::xAtomClipboard, window, CurrentTime); // CLIPBOARD
1238 //X11::XSetSelectionOwner(xDisplay, xAtomPrimary, window, CurrentTime); // XA_PRIMARY
1239 X11::XFlush(X11Impl::xDisplay);
1240 }
1241 else
1242 {
1243 SDL_SetClipboardText(StringAnsi(text).GetText());
1244 }
1245}
1246
1247void SDLClipboard::SetRawData(const Span<byte>& data)
1248{

Callers

nothing calls this directly

Calls 8

StringAnsiFunction · 0.50
IsTrueMethod · 0.45
SetMethod · 0.45
GetMethod · 0.45
LengthMethod · 0.45
ClearMethod · 0.45
GetNativePtrMethod · 0.45
GetTextMethod · 0.45

Tested by

no test coverage detected