From 0cecf3c5982814e25ec000f22cb42a7f195be9d8 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 3 Oct 2009 17:45:34 +0000 Subject: [PATCH] Add a stub class for Windows.. whoever fills this in should take over the license. Originally committed to SVN as r3612. --- aegisub/reporter/platform.cpp | 5 +- aegisub/reporter/platform_windows.cpp | 84 +++++++++++++++++++++++++++ aegisub/reporter/platform_windows.h | 47 +++++++++++++++ aegisub/reporter/report.cpp | 4 +- 4 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 aegisub/reporter/platform_windows.cpp create mode 100644 aegisub/reporter/platform_windows.h diff --git a/aegisub/reporter/platform.cpp b/aegisub/reporter/platform.cpp index b16481474..8bfd4b788 100644 --- a/aegisub/reporter/platform.cpp +++ b/aegisub/reporter/platform.cpp @@ -28,6 +28,7 @@ #endif #include "include/platform.h" +#include "platform_windows.h" #include "platform_unix.h" #include "platform_unix_bsd.h" #include "platform_unix_linux.h" @@ -45,7 +46,9 @@ extern "C" { /// @brief Constructor. Platform* Platform::GetPlatform() { -#ifdef __UNIX__ +#if defined(__WINDOWS__) + Platform *p = new PlatformWindows; +#elif defined(__UNIX__) # if defined(__FREEBSD__) Platform *p = new PlatformUnixBSD; # elif defined(__LINUX__) diff --git a/aegisub/reporter/platform_windows.cpp b/aegisub/reporter/platform_windows.cpp new file mode 100644 index 000000000..a6f08fc21 --- /dev/null +++ b/aegisub/reporter/platform_windows.cpp @@ -0,0 +1,84 @@ +// Copyright (c) 2009, Amar Takhar +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// +// $Id: platform_unix.cpp 3592 2009-09-27 04:15:41Z greg $ + +/// @file platform_unix.cpp +/// @brief Unix Platform extension. +/// @ingroup unix + +#ifndef R_PRECOMP +#include +#include +#include +#endif + +#include "include/platform.h" +#include "platform_windows.h" + +wxString PlatformWindows::OSVersion() { + return ""; +} + +wxString PlatformWindows::DesktopEnvironment() { + return wxTheApp->GetTraits()->GetDesktopEnvironment(); +} + +wxString PlatformWindows::CPUId() { + return ""; +}; + +wxString PlatformWindows::CPUSpeed() { + return ""; +}; + +wxString PlatformWindows::CPUCores() { + return ""; +}; + +wxString PlatformWindows::CPUCount() { + return ""; +}; + +wxString PlatformWindows::CPUFeatures() { + return ""; +}; + +wxString PlatformWindows::CPUFeatures2() { + return ""; +}; + +wxString PlatformWindows::Memory() { + return ""; +}; + +wxString PlatformWindows::ServicePack() { + return ""; +}; + +wxString PlatformWindows::GraphicsVersion() { + return ""; +}; + +wxString PlatformWindows::DShowFilters() { + return ""; +}; + +wxString PlatformWindows::AntiVirus() { + return ""; +}; + +wxString PlatformWindows::Firewall() { + return ""; +}; diff --git a/aegisub/reporter/platform_windows.h b/aegisub/reporter/platform_windows.h new file mode 100644 index 000000000..6496fa232 --- /dev/null +++ b/aegisub/reporter/platform_windows.h @@ -0,0 +1,47 @@ +// Copyright (c) 2009, Amar Takhar +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// +// $Id: platform_unix.h 3592 2009-09-27 04:15:41Z greg $ + +/// @file platform_unix.h +/// @see platform_unix.cpp +/// @ingroup unix + +class Platform; + +/// @brief General Unix functions. +class PlatformWindows : public Platform { +public: + PlatformWindows() {}; + virtual ~PlatformWindows() {}; + wxString OSVersion(); + wxString DesktopEnvironment(); + + // Hardware + virtual wxString CPUId(); + virtual wxString CPUSpeed(); + virtual wxString CPUCores(); + virtual wxString CPUCount(); + virtual wxString CPUFeatures(); + virtual wxString CPUFeatures2(); + virtual wxString Memory(); + + // Windows Specific + virtual wxString ServicePack(); + virtual wxString GraphicsVersion(); + virtual wxString DShowFilters(); + virtual wxString AntiVirus(); + virtual wxString Firewall(); + virtual wxString DLLVersions(); +}; diff --git a/aegisub/reporter/report.cpp b/aegisub/reporter/report.cpp index 1d775a0f1..26b373e4b 100644 --- a/aegisub/reporter/report.cpp +++ b/aegisub/reporter/report.cpp @@ -111,8 +111,8 @@ Report::XMLReport Report::ReportCreate() { Add(doc.windows, "sp", p->ServicePack()); Add(doc.windows, "graphicsver", p->DriverGraphicsVersion()); Add(doc.windows, "dshowfilter", p->DirectShowFilters()); - //Add(doc.windows, "antivirus", p->()); - //Add(doc.windows, "firewall", p->()); + Add(doc.windows, "antivirus", p->AntiVirus()); + Add(doc.windows, "firewall", p->Firewall()); Add(doc.windows, "dll", p->DLLVersions()); #endif