Permalink
Browse files

Major 1.3 updates

  • Loading branch information...
Benjamin Dobell
Benjamin Dobell committed Jul 5, 2011
1 parent 35cfa39 commit b6ffa766b21fe2c985437aa80824a3cd4c384de8
Showing with 6,333 additions and 1,816 deletions.
  1. +571 −0 heimdall-frontend/Source/FirmwareInfo.cpp
  2. +286 −0 heimdall-frontend/Source/FirmwareInfo.h
  3. +65 −0 heimdall-frontend/Source/PackageData.cpp
  4. +77 −0 heimdall-frontend/Source/PackageData.h
  5. +345 −0 heimdall-frontend/Source/Packaging.cpp
  6. +110 −0 heimdall-frontend/Source/Packaging.h
  7. +1 −1 heimdall-frontend/Source/aboutform.cpp
  8. +3 −3 heimdall-frontend/Source/aboutform.h
  9. +7 −7 heimdall-frontend/Source/main.cpp
  10. +580 −392 heimdall-frontend/Source/mainwindow.cpp
  11. +62 −23 heimdall-frontend/Source/mainwindow.h
  12. +11 −14 heimdall-frontend/aboutform.ui
  13. +22 −14 heimdall-frontend/heimdall-frontend.vcxproj
  14. +18 −0 heimdall-frontend/heimdall-frontend.vcxproj.filters
  15. +428 −0 heimdall-frontend/include/zconf.h
  16. +1,613 −0 heimdall-frontend/include/zlib.h
  17. BIN heimdall-frontend/lib/win32/zlib.lib
  18. +878 −494 heimdall-frontend/mainwindow.ui
  19. +11 −13 heimdall/heimdall.vcxproj
  20. +3 −9 heimdall/heimdall.vcxproj.filters
  21. +181 −126 heimdall/source/BridgeManager.cpp
  22. +4 −3 heimdall/source/BridgeManager.h
  23. +409 −0 heimdall/source/Interface.cpp
  24. +255 −0 heimdall/source/Interface.h
  25. +0 −325 heimdall/source/InterfaceManager.cpp
  26. +0 −123 heimdall/source/InterfaceManager.h
  27. +1 −1 heimdall/source/OutboundPacket.h
  28. +171 −171 heimdall/source/main.cpp
  29. +47 −75 heimdall/source/PitData.cpp → libpit/Source/libpit.cpp
  30. +22 −21 heimdall/source/PitData.h → libpit/Source/libpit.h
  31. +119 −0 libpit/libpit.vcxproj
  32. +19 −0 libpit/libpit.vcxproj.filters
  33. +14 −1 msvc2010.sln

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,286 @@
+/* Copyright (c) 2010 Benjamin Dobell, Glass Echidna
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.*/
+
+#ifndef FIRMWAREINFO_H
+#define FIRMWAREINFO_H
+
+// Qt
+#include <QFile>
+#include <QString>
+#include <QXmlStreamReader>
+
+namespace HeimdallFrontend
+{
+ class DeviceInfo
+ {
+ private:
+
+ QString manufacturer;
+ QString product;
+ QString name;
+
+ public:
+
+ DeviceInfo();
+ DeviceInfo(const QString& manufacturer, const QString& product, const QString& name);
+
+ bool ParseXml(QXmlStreamReader& xml);
+
+ const QString& GetManufacturer(void) const
+ {
+ return (manufacturer);
+ }
+
+ void SetManufacturer(const QString& manufacturer)
+ {
+ this->manufacturer = manufacturer;
+ }
+
+ const QString& GetProduct(void) const
+ {
+ return (product);
+ }
+
+ void SetProduct(const QString& product)
+ {
+ this->product = product;
+ }
+
+ const QString& GetName(void) const
+ {
+ return (name);
+ }
+
+ void SetName(const QString& name)
+ {
+ this->name = name;
+ }
+ };
+
+ class PlatformInfo
+ {
+ private:
+
+ QString name;
+ QString version;
+
+ public:
+
+ PlatformInfo();
+
+ void Clear(void);
+ bool IsCleared(void) const;
+
+ bool ParseXml(QXmlStreamReader& xml);
+
+ const QString& GetName(void) const
+ {
+ return (name);
+ }
+
+ void SetName(const QString& name)
+ {
+ this->name = name;
+ }
+
+ const QString& GetVersion(void) const
+ {
+ return (version);
+ }
+
+ void SetVersion(const QString& version)
+ {
+ this->version = version;
+ }
+ };
+
+ class FileInfo
+ {
+ private:
+
+ unsigned int partitionId;
+ QString filename;
+
+ public:
+
+ FileInfo();
+ FileInfo(unsigned int partitionId, const QString& filename);
+
+ bool ParseXml(QXmlStreamReader& xml);
+
+ unsigned int GetPartitionId(void) const
+ {
+ return (partitionId);
+ }
+
+ void SetPartitionId(unsigned int partitionId)
+ {
+ this->partitionId = partitionId;
+ }
+
+ const QString& GetFilename(void) const
+ {
+ return (filename);
+ }
+
+ void SetFilename(const QString& filename)
+ {
+ this->filename = filename;
+ }
+ };
+
+ class FirmwareInfo
+ {
+ public:
+
+ enum
+ {
+ kVersion = 1
+ };
+
+ private:
+
+ QString name;
+ QString version;
+ PlatformInfo platformInfo;
+
+ QList<QString> developers;
+ QString url;
+ QString donateUrl;
+
+ QList<DeviceInfo> deviceInfos;
+
+ QString pitFilename;
+ bool repartition;
+
+ QList<FileInfo> fileInfos;
+
+ public:
+
+ FirmwareInfo();
+
+ void Clear(void);
+ bool IsCleared(void) const;
+
+ bool ParseXml(QXmlStreamReader& xml);
+
+ const QString& GetName(void) const
+ {
+ return (name);
+ }
+
+ void SetName(const QString& name)
+ {
+ this->name = name;
+ }
+
+ const QString& GetVersion(void) const
+ {
+ return (version);
+ }
+
+ void SetVersion(const QString& version)
+ {
+ this->version = version;
+ }
+
+ const PlatformInfo& GetPlatformInfo(void) const
+ {
+ return (platformInfo);
+ }
+
+ PlatformInfo& GetPlatformInfo(void)
+ {
+ return (platformInfo);
+ }
+
+ const QList<QString>& GetDevelopers(void) const
+ {
+ return (developers);
+ }
+
+ QList<QString>& GetDevelopers(void)
+ {
+ return (developers);
+ }
+
+ const QString& GetUrl(void) const
+ {
+ return (url);
+ }
+
+ void SetUrl(const QString& url)
+ {
+ this->url = url;
+ }
+
+ const QString& GetDonateUrl(void) const
+ {
+ return (donateUrl);
+ }
+
+ void SetDonateUrl(const QString& donateUrl)
+ {
+ this->donateUrl = donateUrl;
+ }
+
+ const QList<DeviceInfo>& GetDeviceInfos(void) const
+ {
+ return (deviceInfos);
+ }
+
+ QList<DeviceInfo>& GetDeviceInfos(void)
+ {
+ return (deviceInfos);
+ }
+
+ const QString& GetPitFilename(void) const
+ {
+ return (pitFilename);
+ }
+
+ void SetPitFilename(const QString& pitFilename)
+ {
+ this->pitFilename = pitFilename;
+ }
+
+ bool GetRepartition(void) const
+ {
+ return (repartition);
+ }
+
+ void SetRepartition(bool repartition)
+ {
+ this->repartition = repartition;
+ }
+
+ const QList<FileInfo>& GetFileInfos(void) const
+ {
+ return (fileInfos);
+ }
+
+ QList<FileInfo>& GetFileInfos(void)
+ {
+ return (fileInfos);
+ }
+ };
+}
+
+#endif
@@ -0,0 +1,65 @@
+/* Copyright (c) 2010 Benjamin Dobell, Glass Echidna
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.*/
+
+// Heimdall Frontend
+#include "PackageData.h"
+
+using namespace HeimdallFrontend;
+
+PackageData::PackageData()
+{
+}
+
+PackageData::~PackageData()
+{
+ for (int i = 0; i < files.length(); i++)
+ delete files[i];
+}
+
+void PackageData::Clear(void)
+{
+ firmwareInfo.Clear();
+
+ for (int i = 0; i < files.length(); i++)
+ delete files[i];
+
+ files.clear();
+}
+
+bool PackageData::ReadFirmwareInfo(QFile *file)
+{
+ if (!file->open(QFile::ReadOnly))
+ {
+ // TODO: Error
+ return (false);
+ }
+
+ QXmlStreamReader xml(file);
+ bool success = firmwareInfo.ParseXml(xml);
+
+ file->close();
+
+ return (success);
+}
+
+bool PackageData::IsCleared(void) const
+{
+ return (firmwareInfo.IsCleared() && files.isEmpty());
+}
Oops, something went wrong.

0 comments on commit b6ffa76

Please sign in to comment.