mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Add Clipboard Support
This commit is contained in:
parent
ee8780fe30
commit
08a858acf0
|
@ -2074,6 +2074,31 @@ namespace MiniEngine
|
|||
delete pimpl;
|
||||
}
|
||||
|
||||
int SetClipboardText(const std::string& str)
|
||||
{
|
||||
return SDL_SetClipboardText(str.c_str());
|
||||
}
|
||||
|
||||
std::string GetClipboardText()
|
||||
{
|
||||
char* pstr=SDL_GetClipboardText();
|
||||
if(pstr==nullptr)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string s(pstr);
|
||||
SDL_free(pstr);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
bool HasClipboardText()
|
||||
{
|
||||
return SDL_HasClipboardText()==SDL_TRUE;
|
||||
}
|
||||
|
||||
}/// End of namespace MiniEngine
|
||||
|
||||
/// The Following Functions are not avaliable in Visual Studio
|
||||
|
|
|
@ -650,6 +650,10 @@ namespace MiniEngine
|
|||
impl* pimpl;
|
||||
};
|
||||
|
||||
int SetClipboardText(const std::string& str);
|
||||
std::string GetClipboardText();
|
||||
bool HasClipboardText();
|
||||
|
||||
}/// End of namespace MiniEngine
|
||||
|
||||
std::string UTF8ToGBK(std::string UTF8String);
|
||||
|
|
Loading…
Reference in New Issue
Block a user