25 #include "libclipboard.h" 36 Impl(): clipboard(clipboard_new(nullptr)) {}
37 ~Impl() {clipboard_free(clipboard);}
41 Clipboard::Clipboard(): pimpl(make_shared<
Impl>()) {}
47 OpenClipboard(
nullptr);
48 if (HANDLE h=GetClipboardData(CF_TEXT))
50 r=
static_cast<const char*
>(GlobalLock(h));
58 auto s=clipboard_text(
pimpl->clipboard);
72 HGLOBAL h=GlobalAlloc(GMEM_MOVEABLE, text.length()+1);
73 LPTSTR hh=
static_cast<LPTSTR
>(GlobalLock(h));
76 strcpy(hh,text.c_str());
78 if (SetClipboardData(CF_TEXT, h)==
nullptr)
86 clipboard_clear(
pimpl->clipboard, LCB_CLIPBOARD);
88 clipboard_set_text(
pimpl->clipboard, text.c_str());
std::string getClipboard() const
return clipboard contents as UTF8 text
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
std::shared_ptr< Impl > pimpl
void putClipboard(const std::string &) const
puts UTF8 text string on clipboard