add desktop:📋:available function

So gui elements can determine if we actually have clipboard
support compiled in.
This commit is contained in:
Chris Beck 2014-10-18 20:48:19 -04:00
parent a77786348d
commit 007da9fef4
2 changed files with 26 additions and 0 deletions

View file

@ -427,6 +427,11 @@ std::string copy_from_clipboard(const bool mouse)
return "";
}
bool available()
{
return true;
}
} // end namespace clipboard
} // end namespace desktop
@ -507,6 +512,12 @@ std::string copy_from_clipboard(const bool)
return unicode_cast<std::string>(ustring);
}
bool available()
{
return true;
}
} // end namespace clipboard
} // end namespace desktop
@ -600,6 +611,11 @@ void handle_system_event(const SDL_Event& /*event*/)
{
}
bool available()
{
return true;
}
} // end namespace clipboard
} // end namespace desktop
@ -625,6 +641,11 @@ void handle_system_event(const SDL_Event& /*event*/)
{
}
bool available()
{
return false;
}
} // end namespace clipboard
} // end namespace desktop

View file

@ -46,6 +46,11 @@ std::string copy_from_clipboard(const bool mouse);
void handle_system_event(const SDL_Event& ev);
/**
* Whether wesnoth was compiled with support for a clipboard.
*/
bool available();
} // end namespace clipboard
} // end namespace desktop