| 287 | } |
| 288 | |
| 289 | DFHACK_EXPORT bool DFHack::setClipboardTextCp437Multiline(string text) { |
| 290 | if (!g_sdl_handle) |
| 291 | return false; |
| 292 | vector<string> lines; |
| 293 | split_string(&lines, text, "\n"); |
| 294 | std::ostringstream str; |
| 295 | for (size_t idx = 0; idx < lines.size(); ++idx) { |
| 296 | str << DF2UTF(lines[idx]); |
| 297 | if (idx < lines.size() - 1) { |
| 298 | #ifdef WIN32 |
| 299 | str << "\r\n"; |
| 300 | #else |
| 301 | str << "\n"; |
| 302 | #endif |
| 303 | } |
| 304 | } |
| 305 | return 0 == DFHack::DFSDL::DFSDL_SetClipboardText(str.str().c_str()); |
| 306 | } |
| 307 | |
| 308 | // Queue to run callbacks on the render thread. |
| 309 | // Semantics loosely based on SDL3's SDL_RunOnMainThread |
nothing calls this directly
no test coverage detected