bool CClipboard::setText(int callbackID, const Json::Value& parameters) { // fetch member 'text' of parameters Json::Value text_JSON; FetchObject(parameters, "text", text_JSON); // fetch string std::string text; FetchString(text_JSON, text); // call s3e code if (!s3eClipboardAvailable()) { // call fail callback clipboardError(callbackID); return true; } if (s3eClipboardSetText(text.c_str()) == S3E_RESULT_ERROR) { // call fail callback clipboardError(callbackID); return true; } // call success callback with text clipboardSuccess(callbackID, text.c_str()); return true; }
static void ImGui_Marmalade_SetClipboardText(const char* text) { if (s3eClipboardAvailable()) s3eClipboardSetText(text); }