mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
VirtualGui: Fixed to compile
This commit is contained in:
parent
f086ac0935
commit
796a9b8f78
1 changed files with 3 additions and 25 deletions
|
|
@ -53,21 +53,17 @@ void AppendClipboardText(const String& s)
|
|||
|
||||
void AppendClipboardUnicodeText(const WString& s)
|
||||
{
|
||||
AppendClipboard("wtext", (byte *)~s, sizeof(wchar) * s.GetLength());
|
||||
AppendClipboardText(s.ToString());
|
||||
}
|
||||
|
||||
const char *ClipFmtsText()
|
||||
{
|
||||
return "wtext;text";
|
||||
return "text";
|
||||
}
|
||||
|
||||
String GetString(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
if(clip.Accept("wtext")) {
|
||||
String s = ~clip;
|
||||
return WString((const wchar *)~s, strlen__((const wchar *)~s)).ToString();
|
||||
}
|
||||
if(clip.IsAvailable("text"))
|
||||
return ~clip;
|
||||
return Null;
|
||||
|
|
@ -76,10 +72,6 @@ String GetString(PasteClip& clip)
|
|||
WString GetWString(PasteClip& clip)
|
||||
{
|
||||
GuiLock __;
|
||||
if(clip.Accept("wtext")) {
|
||||
String s = ~clip;
|
||||
return WString((const wchar *)~s, strlen__((const wchar *)~s));
|
||||
}
|
||||
if(clip.IsAvailable("text"))
|
||||
return (~clip).ToWString();
|
||||
return Null;
|
||||
|
|
@ -96,29 +88,20 @@ static String sText(const Value& data)
|
|||
return data;
|
||||
}
|
||||
|
||||
static String sWText(const Value& data)
|
||||
{
|
||||
return Unicode__(WString(data));
|
||||
}
|
||||
|
||||
void Append(VectorMap<String, ClipData>& data, const String& text)
|
||||
{
|
||||
data.GetAdd("text", ClipData(text, sText));
|
||||
data.GetAdd("wtext", ClipData(text, sWText));
|
||||
}
|
||||
|
||||
void Append(VectorMap<String, ClipData>& data, const WString& text)
|
||||
{
|
||||
data.GetAdd("text", ClipData(text, sText));
|
||||
data.GetAdd("wtext", ClipData(text, sWText));
|
||||
}
|
||||
|
||||
String GetTextClip(const WString& text, const String& fmt)
|
||||
{
|
||||
if(fmt == "text")
|
||||
return text.ToString();
|
||||
if(fmt == "wtext")
|
||||
return Unicode__(text);
|
||||
return Null;
|
||||
}
|
||||
|
||||
|
|
@ -126,8 +109,6 @@ String GetTextClip(const String& text, const String& fmt)
|
|||
{
|
||||
if(fmt == "text")
|
||||
return text;
|
||||
if(fmt == "wtext")
|
||||
return Unicode__(text.ToWString());
|
||||
return Null;
|
||||
}
|
||||
|
||||
|
|
@ -139,9 +120,6 @@ String ReadClipboardText()
|
|||
|
||||
WString ReadClipboardUnicodeText()
|
||||
{
|
||||
String w = ReadClipboard("wtext");
|
||||
if(w.GetCount())
|
||||
return WString((const wchar *)~w, w.GetLength() / 2);
|
||||
return ReadClipboard("text").ToWString();
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +130,7 @@ bool IsClipboardAvailable(const char *id)
|
|||
|
||||
bool IsClipboardAvailableText()
|
||||
{
|
||||
return IsClipboardAvailable("text") || IsClipboardAvailable("wtext");
|
||||
return IsClipboardAvailable("text");
|
||||
}
|
||||
|
||||
const char *ClipFmtsImage()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue