2015-01-16 19:37:16 +00:00
|
|
|
#include "platform/platform.h"
|
2020-12-31 20:44:39 +00:00
|
|
|
#ifndef TORQUE_SDL
|
2020-08-11 22:13:56 +00:00
|
|
|
bool Platform::openWebBrowser(const char* webAddress)
|
2015-01-16 19:37:16 +00:00
|
|
|
{
|
2020-08-11 22:13:56 +00:00
|
|
|
String startingURL(webAddress);
|
|
|
|
|
String filteredURL;
|
2020-08-11 19:51:46 +00:00
|
|
|
|
2020-08-11 22:27:52 +00:00
|
|
|
U32 length = startingURL.length();
|
|
|
|
|
for(U32 i = 0; i < length; i++)
|
2020-08-11 22:13:56 +00:00
|
|
|
{
|
|
|
|
|
filteredURL = filteredURL + '\\' + startingURL[i];
|
|
|
|
|
}
|
2020-08-11 19:51:46 +00:00
|
|
|
|
2020-08-11 22:13:56 +00:00
|
|
|
String runCommand = "URL=" + filteredURL + "; xdg-open $URL > /dev/null 2> /dev/null";
|
2020-08-11 19:51:46 +00:00
|
|
|
|
2020-08-11 22:27:52 +00:00
|
|
|
S32 statusCode;
|
2020-08-11 22:13:56 +00:00
|
|
|
statusCode = system(runCommand.c_str());
|
2020-08-11 19:51:46 +00:00
|
|
|
|
2020-08-11 22:13:56 +00:00
|
|
|
if(statusCode == 0)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2020-08-11 19:51:46 +00:00
|
|
|
|
2020-08-11 22:13:56 +00:00
|
|
|
return false;
|
2015-01-16 19:37:16 +00:00
|
|
|
}
|
2020-12-31 20:44:39 +00:00
|
|
|
#endif
|
2015-01-16 19:37:16 +00:00
|
|
|
#ifdef TORQUE_DEDICATED
|
|
|
|
|
// XA: New class for the unix unicode font
|
|
|
|
|
class PlatformFont;
|
|
|
|
|
PlatformFont *createPlatformFont(const char *name, dsize_t size, U32 charset /* = TGE_ANSI_CHARSET */) { return NULL; }
|
|
|
|
|
#endif
|