forked from mia/Aegisub
Convert rest of the values to JSON.
Originally committed to SVN as r5114.
This commit is contained in:
parent
4118580bb6
commit
7514812a25
5 changed files with 42 additions and 52 deletions
|
@ -67,25 +67,20 @@ public:
|
|||
|
||||
// From <wx/gdicmn.h>
|
||||
|
||||
/// Is the display colour
|
||||
/// @return true/false
|
||||
/// @retval 1, 0
|
||||
int DisplayColour();
|
||||
|
||||
/// Display depth
|
||||
/// @return Depth
|
||||
/// @return Integer
|
||||
wxString DisplayDepth();
|
||||
int DisplayDepth();
|
||||
|
||||
/// Display size
|
||||
/// @return Size delimited by a space.
|
||||
/// @retval "w h"
|
||||
wxString DisplaySize();
|
||||
const char* DisplaySize();
|
||||
|
||||
/// Pixels per inch
|
||||
/// @return PPI
|
||||
/// @retval Integer
|
||||
wxString DisplayPPI();
|
||||
const char* DisplayPPI();
|
||||
|
||||
// Misc
|
||||
|
||||
|
@ -181,22 +176,22 @@ public:
|
|||
/// OpenGL vendor
|
||||
/// @return Vendor
|
||||
/// @retval Any
|
||||
virtual wxString OpenGLVendor();
|
||||
virtual std::string OpenGLVendor();
|
||||
|
||||
/// OpenGL renderer
|
||||
/// @return Renderer
|
||||
/// @retval Any
|
||||
virtual wxString OpenGLRenderer();
|
||||
virtual std::string OpenGLRenderer();
|
||||
|
||||
/// OpenGL version
|
||||
/// @return Renderer version
|
||||
/// @retval Any
|
||||
virtual wxString OpenGLVersion();
|
||||
virtual std::string OpenGLVersion();
|
||||
|
||||
/// OpenGL extensions
|
||||
/// @return OpenGL extensions
|
||||
/// @retval Space delimited list of extensions
|
||||
virtual wxString OpenGLExt();
|
||||
virtual std::string OpenGLExt();
|
||||
//@}
|
||||
|
||||
/// @name Windows
|
||||
|
@ -262,7 +257,7 @@ public:
|
|||
/// Desktop environment
|
||||
/// @return Environment
|
||||
/// @retval Gnome, KDE, WindowMaker...
|
||||
virtual wxString DesktopEnvironment()=0;
|
||||
virtual const char* DesktopEnvironment()=0;
|
||||
#endif
|
||||
//@}
|
||||
|
||||
|
@ -313,6 +308,6 @@ private:
|
|||
/// Retrieve OpenGL video information.
|
||||
/// @param which Requested information
|
||||
/// @return Video info.
|
||||
wxString GetVideoInfo(enum Platform::VideoInfo which);
|
||||
std::string GetVideoInfo(enum Platform::VideoInfo which);
|
||||
|
||||
};
|
||||
|
|
|
@ -75,7 +75,7 @@ void Platform::Init() {
|
|||
* @brief Gather video adapter information via OpenGL
|
||||
*
|
||||
*/
|
||||
wxString Platform::GetVideoInfo(enum Platform::VideoInfo which) {
|
||||
std::string Platform::GetVideoInfo(enum Platform::VideoInfo which) {
|
||||
int attList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
||||
wxGLCanvas *glc = new wxGLCanvas(wxTheApp->GetTopWindow(), wxID_ANY, attList, wxDefaultPosition, wxDefaultSize);
|
||||
wxGLContext *ctx = new wxGLContext(glc, 0);
|
||||
|
@ -86,22 +86,22 @@ wxString Platform::GetVideoInfo(enum Platform::VideoInfo which) {
|
|||
|
||||
switch (which) {
|
||||
case VIDEO_EXT:
|
||||
value = wxString(glGetString(GL_EXTENSIONS));
|
||||
return reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
|
||||
break;
|
||||
case VIDEO_RENDERER:
|
||||
value = wxString(glGetString(GL_RENDERER));
|
||||
return reinterpret_cast<const char*>(glGetString(GL_RENDERER));
|
||||
break;
|
||||
case VIDEO_VENDOR:
|
||||
value = wxString(glGetString(GL_VENDOR));
|
||||
return reinterpret_cast<const char*>(glGetString(GL_VENDOR));
|
||||
break;
|
||||
case VIDEO_VERSION:
|
||||
value = wxString(glGetString(GL_VERSION));
|
||||
return reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
delete ctx;
|
||||
delete glc;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
const char* Platform::ArchName() {
|
||||
|
@ -120,23 +120,19 @@ const char* Platform::Endian() {
|
|||
return plat.GetEndiannessName().c_str();
|
||||
};
|
||||
|
||||
int Platform::DisplayColour() {
|
||||
return wxColourDisplay();
|
||||
//wxString::Format(L"%d", wxColourDisplay());
|
||||
|
||||
int Platform::DisplayDepth() {
|
||||
return wxDisplayDepth();
|
||||
}
|
||||
|
||||
wxString Platform::DisplayDepth() {
|
||||
return wxString::Format(L"%d", wxDisplayDepth());
|
||||
}
|
||||
|
||||
wxString Platform::DisplaySize() {
|
||||
const char* Platform::DisplaySize() {
|
||||
int x, y;
|
||||
wxDisplaySize(&x, &y);
|
||||
return wxString::Format(L"%d %d", x, y);
|
||||
return wxString::Format(L"%d %d", x, y).c_str();
|
||||
}
|
||||
|
||||
wxString Platform::DisplayPPI() {
|
||||
return wxString::Format(L"%d %d", wxGetDisplayPPI().GetWidth(), wxGetDisplayPPI().GetHeight());
|
||||
const char* Platform::DisplayPPI() {
|
||||
return wxString::Format(L"%d %d", wxGetDisplayPPI().GetWidth(), wxGetDisplayPPI().GetHeight()).c_str();
|
||||
}
|
||||
|
||||
const char* Platform::wxVersion() {
|
||||
|
@ -166,24 +162,24 @@ std::string Platform::Signature() {
|
|||
}
|
||||
|
||||
#ifdef __UNIX__
|
||||
wxString Platform::DesktopEnvironment() {
|
||||
const char* Platform::DesktopEnvironment() {
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
|
||||
wxString Platform::OpenGLVendor() {
|
||||
std::string Platform::OpenGLVendor() {
|
||||
return GetVideoInfo(VIDEO_VENDOR);
|
||||
}
|
||||
|
||||
wxString Platform::OpenGLRenderer() {
|
||||
std::string Platform::OpenGLRenderer() {
|
||||
return GetVideoInfo(VIDEO_RENDERER);
|
||||
}
|
||||
|
||||
wxString Platform::OpenGLVersion() {
|
||||
std::string Platform::OpenGLVersion() {
|
||||
return GetVideoInfo(VIDEO_VERSION);
|
||||
}
|
||||
|
||||
wxString Platform::OpenGLExt() {
|
||||
std::string Platform::OpenGLExt() {
|
||||
return GetVideoInfo(VIDEO_EXT);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ const std::string PlatformUnix::OSVersion() {
|
|||
return "";
|
||||
}
|
||||
|
||||
wxString PlatformUnix::DesktopEnvironment() {
|
||||
return wxTheApp->GetTraits()->GetDesktopEnvironment();
|
||||
const char* PlatformUnix::DesktopEnvironment() {
|
||||
return wxTheApp->GetTraits()->GetDesktopEnvironment().c_str();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
PlatformUnix() {};
|
||||
virtual ~PlatformUnix() {};
|
||||
const std::string OSVersion();
|
||||
wxString DesktopEnvironment();
|
||||
const char* DesktopEnvironment();
|
||||
|
||||
// Hardware
|
||||
virtual std::string CPUId() { return ""; }
|
||||
|
|
|
@ -95,18 +95,17 @@ Report::XMLReport Report::ReportCreate() {
|
|||
|
||||
|
||||
json::Object display;
|
||||
// display["Depth"] = json::Number(p->DisplayDepth());
|
||||
// display["Colour"] = json::Number(p->DisplayColour());
|
||||
// display["Size"] = json::String(p->DisplaySize());
|
||||
// display["Pixels Per Inch"] = json::Number(p->DisplayPPI());
|
||||
display["Depth"] = json::Number(p->DisplayDepth());
|
||||
display["Size"] = json::String(p->DisplaySize());
|
||||
display["Pixels Per Inch"] = json::String(p->DisplayPPI());
|
||||
|
||||
|
||||
// json::Object gl;
|
||||
// gl["Vendor"] = json::String(p->OpenGLVendor());
|
||||
// gl["Renderer"] = json::String(p->OpenGLRenderer());
|
||||
// gl["Version"] = json::String(p->OpenGLVersion());
|
||||
// gl["Extensions"] = json::String(p->OpenGLExt());
|
||||
// display["OpenGL"] = gl;
|
||||
json::Object gl;
|
||||
gl["Vendor"] = json::String(p->OpenGLVendor());
|
||||
gl["Renderer"] = json::String(p->OpenGLRenderer());
|
||||
gl["Version"] = json::String(p->OpenGLVersion());
|
||||
gl["Extensions"] = json::String(p->OpenGLExt());
|
||||
display["OpenGL"] = gl;
|
||||
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
@ -122,8 +121,8 @@ Report::XMLReport Report::ReportCreate() {
|
|||
|
||||
#ifdef __UNIX__
|
||||
json::Object u_nix;
|
||||
// u_nix["Desktop Environment"] = json::String(p->DesktopEnvironment());
|
||||
// u_nix["Libraries"] = json::String(p->UnixLibraries());
|
||||
u_nix["Desktop Environment"] = json::String(p->DesktopEnvironment());
|
||||
u_nix["Libraries"] = json::String(p->UnixLibraries());
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
|
Loading…
Reference in a new issue