From 253067c782955380bbf66ac0475dc954375b1ff4 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sat, 17 Aug 2013 13:40:51 +0200 Subject: Move all the things (YES. Move them.) Also, implemented some basic modlist logic, to be wired up. --- CMakeLists.txt | 128 +- backend/BaseInstance.cpp | 181 --- backend/BaseInstance.h | 143 -- backend/BaseInstance_p.h | 14 - backend/BaseUpdate.cpp | 13 - backend/BaseUpdate.h | 50 - backend/CMakeLists.txt | 120 -- backend/IconListModel.cpp | 163 -- backend/IconListModel.h | 33 - backend/InstanceFactory.cpp | 113 -- backend/InstanceFactory.h | 81 - backend/InstanceVersion.h | 69 - backend/LegacyForge.cpp | 57 - backend/LegacyForge.h | 25 - backend/LegacyInstance.cpp | 229 --- backend/LegacyInstance.h | 85 - backend/LegacyInstance_p.h | 10 - backend/LegacyUpdate.cpp | 381 ----- backend/LegacyUpdate.h | 68 - backend/MinecraftProcess.cpp | 169 -- backend/MinecraftProcess.h | 88 - backend/MinecraftVersion.h | 78 - backend/Mod.cpp | 264 --- backend/Mod.h | 69 - backend/ModList.cpp | 418 ----- backend/ModList.h | 75 - backend/NostalgiaInstance.cpp | 12 - backend/NostalgiaInstance.h | 10 - backend/OneSixAssets.cpp | 162 -- backend/OneSixAssets.h | 22 - backend/OneSixInstance.cpp | 211 --- backend/OneSixInstance.h | 32 - backend/OneSixInstance_p.h | 9 - backend/OneSixUpdate.cpp | 169 -- backend/OneSixUpdate.h | 55 - backend/OneSixVersion.cpp | 132 -- backend/OneSixVersion.h | 212 --- backend/VersionFactory.cpp | 195 --- backend/VersionFactory.h | 24 - backend/libmmc_config.h | 24 - backend/lists/InstVersionList.cpp | 129 -- backend/lists/InstVersionList.h | 122 -- backend/lists/InstanceList.cpp | 232 --- backend/lists/InstanceList.h | 92 -- backend/lists/LwjglVersionList.cpp | 206 --- backend/lists/LwjglVersionList.h | 119 -- backend/lists/MinecraftVersionList.cpp | 300 ---- backend/lists/MinecraftVersionList.h | 84 - backend/net/DownloadJob.cpp | 138 -- backend/net/DownloadJob.h | 51 - backend/net/JobQueue.h | 180 -- backend/net/NetWorker.cpp | 12 - backend/net/NetWorker.h | 20 - backend/tasks/LoginTask.cpp | 111 -- backend/tasks/LoginTask.h | 59 - backend/tasks/Task.cpp | 85 - backend/tasks/Task.h | 67 - depends/classparser/CMakeLists.txt | 41 + depends/classparser/include/classparser_config.h | 23 + depends/classparser/include/javautils.h | 29 + depends/classparser/src/annotations.cpp | 83 + depends/classparser/src/annotations.h | 252 +++ depends/classparser/src/classfile.h | 153 ++ depends/classparser/src/constants.h | 212 +++ depends/classparser/src/errors.h | 6 + depends/classparser/src/javaendian.h | 62 + depends/classparser/src/javautils.cpp | 81 + depends/classparser/src/membuffer.h | 64 + depends/groupview/CMakeLists.txt | 41 + .../include/categorizedsortfilterproxymodel.h | 175 ++ depends/groupview/include/categorizedview.h | 332 ++++ depends/groupview/include/categorydrawer.h | 179 ++ depends/groupview/include/groupview_config.h | 27 + .../src/categorizedsortfilterproxymodel.cpp | 168 ++ .../src/categorizedsortfilterproxymodel_p.h | 48 + depends/groupview/src/categorizedview.cpp | 1713 ++++++++++++++++++++ depends/groupview/src/categorizedview_p.h | 159 ++ depends/groupview/src/categorydrawer.cpp | 231 +++ depends/launcher/CMakeLists.txt | 23 + depends/launcher/MCFrame.java | 123 ++ depends/launcher/MultiMCLauncher.java | 331 ++++ depends/launcher/UseJava.cmake | 881 ++++++++++ depends/launcher/UseJavaClassFilelist.cmake | 52 + depends/launcher/UseJavaSymlinks.cmake | 32 + depends/launcher/net/minecraft/Launcher.java | 154 ++ .../org/simplericity/macify/eawt/Application.java | 176 ++ .../macify/eawt/ApplicationAdapter.java | 48 + .../simplericity/macify/eawt/ApplicationEvent.java | 25 + .../macify/eawt/ApplicationListener.java | 27 + .../macify/eawt/DefaultApplication.java | 418 +++++ depends/patchlib/CMakeLists.txt | 14 + depends/patchlib/LICENSE-bzip2 | 42 + depends/patchlib/blocksort.c | 1095 +++++++++++++ depends/patchlib/bspatch.c | 303 ++++ depends/patchlib/bspatch.h | 27 + depends/patchlib/bzlib.c | 1579 ++++++++++++++++++ depends/patchlib/bzlib.h | 283 ++++ depends/patchlib/bzlib_private.h | 510 ++++++ depends/patchlib/compress.c | 672 ++++++++ depends/patchlib/crctable.c | 104 ++ depends/patchlib/decompress.c | 646 ++++++++ depends/patchlib/huffman.c | 205 +++ depends/patchlib/randtable.c | 84 + depends/quazip/CMakeLists.txt | 28 + depends/quazip/JlCompress.cpp | 516 ++++++ depends/quazip/JlCompress.h | 123 ++ depends/quazip/crypt.h | 135 ++ depends/quazip/ioapi.h | 77 + depends/quazip/qioapi.cpp | 146 ++ depends/quazip/quaadler32.cpp | 28 + depends/quazip/quaadler32.h | 29 + depends/quazip/quachecksum32.h | 54 + depends/quazip/quacrc32.cpp | 28 + depends/quazip/quacrc32.h | 26 + depends/quazip/quagzipfile.cpp | 141 ++ depends/quazip/quagzipfile.h | 35 + depends/quazip/quaziodevice.cpp | 283 ++++ depends/quazip/quaziodevice.h | 27 + depends/quazip/quazip.cpp | 554 +++++++ depends/quazip/quazip.h | 411 +++++ depends/quazip/quazip_global.h | 55 + depends/quazip/quazipdir.cpp | 507 ++++++ depends/quazip/quazipdir.h | 171 ++ depends/quazip/quazipfile.cpp | 488 ++++++ depends/quazip/quazipfile.h | 442 +++++ depends/quazip/quazipfileinfo.h | 66 + depends/quazip/quazipnewinfo.cpp | 51 + depends/quazip/quazipnewinfo.h | 102 ++ depends/quazip/unzip.c | 1603 ++++++++++++++++++ depends/quazip/unzip.h | 356 ++++ depends/quazip/zip.c | 1281 +++++++++++++++ depends/quazip/zip.h | 245 +++ depends/settings/CMakeLists.txt | 51 + depends/settings/include/basicsettingsobject.h | 44 + depends/settings/include/inifile.h | 38 + depends/settings/include/inisettingsobject.h | 60 + depends/settings/include/keyring.h | 92 ++ depends/settings/include/libsettings_config.h | 27 + depends/settings/include/overridesetting.h | 43 + depends/settings/include/setting.h | 114 ++ depends/settings/include/settingsobject.h | 192 +++ depends/settings/src/basicsettingsobject.cpp | 46 + depends/settings/src/inifile.cpp | 86 + depends/settings/src/inisettingsobject.cpp | 62 + depends/settings/src/keyring.cpp | 63 + depends/settings/src/overridesetting.cpp | 30 + depends/settings/src/setting.cpp | 54 + depends/settings/src/settingsobject.cpp | 144 ++ depends/settings/src/stubkeyring.cpp | 104 ++ depends/settings/src/stubkeyring.h | 41 + depends/util/CMakeLists.txt | 51 + depends/util/include/apputils.h | 21 + depends/util/include/cmdutils.h | 259 +++ depends/util/include/libutil_config.h | 27 + depends/util/include/osutils.h | 29 + depends/util/include/pathutils.h | 37 + depends/util/include/siglist.h | 129 ++ depends/util/include/siglist_impl.h | 156 ++ depends/util/include/userutils.h | 19 + depends/util/src/cmdutils.cpp | 484 ++++++ depends/util/src/osutils.cpp | 19 + depends/util/src/pathutils.cpp | 94 ++ depends/util/src/userutils.cpp | 123 ++ gui/IconPickerDialog.cpp | 2 +- gui/LegacyModEditDialog.cpp | 36 + gui/LegacyModEditDialog.h | 59 + gui/LegacyModEditDialog.ui | 281 ++++ gui/consolewindow.h | 2 +- gui/instancemodel.cpp | 4 +- gui/instancemodel.h | 2 +- gui/legacymodeditdialog.cpp | 35 - gui/legacymodeditdialog.h | 62 - gui/legacymodeditdialog.ui | 281 ---- gui/lwjglselectdialog.cpp | 2 +- gui/mainwindow.cpp | 31 +- gui/mainwindow.h | 6 +- gui/modeditdialog.cpp | 2 +- gui/modeditdialog.h | 2 +- gui/modeditdialog.ui | 2 +- gui/newinstancedialog.cpp | 12 +- gui/newinstancedialog.h | 2 +- gui/taskdialog.cpp | 2 +- gui/versionselectdialog.cpp | 6 +- gui/versionselectdialog.h | 2 +- java/annotations.cpp | 83 - java/annotations.h | 252 --- java/classfile.h | 153 -- java/constants.h | 212 --- java/errors.h | 6 - java/javaendian.h | 62 - java/javautils.cpp | 81 - java/javautils.h | 28 - java/membuffer.h | 64 - java/test.cpp | 35 - launcher/CMakeLists.txt | 23 - launcher/MCFrame.java | 123 -- launcher/MultiMCLauncher.java | 331 ---- launcher/UseJava.cmake | 881 ---------- launcher/UseJavaClassFilelist.cmake | 52 - launcher/UseJavaSymlinks.cmake | 32 - launcher/net/minecraft/Launcher.java | 154 -- .../org/simplericity/macify/eawt/Application.java | 176 -- .../macify/eawt/ApplicationAdapter.java | 48 - .../simplericity/macify/eawt/ApplicationEvent.java | 25 - .../macify/eawt/ApplicationListener.java | 27 - .../macify/eawt/DefaultApplication.java | 418 ----- libgroupview/CMakeLists.txt | 41 - .../include/categorizedsortfilterproxymodel.h | 175 -- libgroupview/include/categorizedview.h | 332 ---- libgroupview/include/categorydrawer.h | 179 -- libgroupview/include/libgroupview_config.h | 27 - .../src/categorizedsortfilterproxymodel.cpp | 168 -- .../src/categorizedsortfilterproxymodel_p.h | 48 - libgroupview/src/categorizedview.cpp | 1713 -------------------- libgroupview/src/categorizedview_p.h | 159 -- libgroupview/src/categorydrawer.cpp | 231 --- libsettings/CMakeLists.txt | 51 - libsettings/include/basicsettingsobject.h | 44 - libsettings/include/inifile.h | 38 - libsettings/include/inisettingsobject.h | 60 - libsettings/include/keyring.h | 92 -- libsettings/include/libsettings_config.h | 27 - libsettings/include/overridesetting.h | 43 - libsettings/include/setting.h | 114 -- libsettings/include/settingsobject.h | 192 --- libsettings/src/basicsettingsobject.cpp | 46 - libsettings/src/inifile.cpp | 86 - libsettings/src/inisettingsobject.cpp | 62 - libsettings/src/keyring.cpp | 63 - libsettings/src/overridesetting.cpp | 30 - libsettings/src/setting.cpp | 54 - libsettings/src/settingsobject.cpp | 144 -- libsettings/src/stubkeyring.cpp | 104 -- libsettings/src/stubkeyring.h | 41 - libutil/CMakeLists.txt | 51 - libutil/include/apputils.h | 21 - libutil/include/cmdutils.h | 259 --- libutil/include/libutil_config.h | 27 - libutil/include/osutils.h | 29 - libutil/include/pathutils.h | 37 - libutil/include/siglist.h | 129 -- libutil/include/siglist_impl.h | 156 -- libutil/include/userutils.h | 19 - libutil/src/cmdutils.cpp | 484 ------ libutil/src/osutils.cpp | 19 - libutil/src/pathutils.cpp | 94 -- libutil/src/userutils.cpp | 123 -- logic/BaseInstance.cpp | 181 +++ logic/BaseInstance.h | 145 ++ logic/BaseInstance_p.h | 14 + logic/BaseUpdate.cpp | 13 + logic/BaseUpdate.h | 49 + logic/CMakeLists.txt | 24 + logic/IconListModel.cpp | 163 ++ logic/IconListModel.h | 33 + logic/InstanceFactory.cpp | 113 ++ logic/InstanceFactory.h | 80 + logic/InstanceVersion.h | 68 + logic/LegacyForge.cpp | 57 + logic/LegacyForge.h | 25 + logic/LegacyInstance.cpp | 274 ++++ logic/LegacyInstance.h | 95 ++ logic/LegacyInstance_p.h | 15 + logic/LegacyUpdate.cpp | 381 +++++ logic/LegacyUpdate.h | 67 + logic/MinecraftProcess.cpp | 169 ++ logic/MinecraftProcess.h | 86 + logic/MinecraftVersion.h | 76 + logic/Mod.cpp | 264 +++ logic/Mod.h | 71 + logic/ModList.cpp | 472 ++++++ logic/ModList.h | 67 + logic/NostalgiaInstance.cpp | 12 + logic/NostalgiaInstance.h | 10 + logic/OneSixAssets.cpp | 162 ++ logic/OneSixAssets.h | 22 + logic/OneSixInstance.cpp | 218 +++ logic/OneSixInstance.h | 34 + logic/OneSixInstance_p.h | 9 + logic/OneSixUpdate.cpp | 169 ++ logic/OneSixUpdate.h | 54 + logic/OneSixVersion.cpp | 132 ++ logic/OneSixVersion.h | 212 +++ logic/VersionFactory.cpp | 195 +++ logic/VersionFactory.h | 24 + logic/lists/InstVersionList.cpp | 129 ++ logic/lists/InstVersionList.h | 121 ++ logic/lists/InstanceList.cpp | 232 +++ logic/lists/InstanceList.h | 91 ++ logic/lists/LwjglVersionList.cpp | 206 +++ logic/lists/LwjglVersionList.h | 117 ++ logic/lists/MinecraftVersionList.cpp | 300 ++++ logic/lists/MinecraftVersionList.h | 83 + logic/net/DownloadJob.cpp | 138 ++ logic/net/DownloadJob.h | 51 + logic/net/JobQueue.h | 180 ++ logic/net/NetWorker.cpp | 12 + logic/net/NetWorker.h | 20 + logic/tasks/LoginTask.cpp | 111 ++ logic/tasks/LoginTask.h | 58 + logic/tasks/Task.cpp | 85 + logic/tasks/Task.h | 65 + main.cpp | 6 +- patchlib/CMakeLists.txt | 14 - patchlib/LICENSE-bzip2 | 42 - patchlib/blocksort.c | 1095 ------------- patchlib/bspatch.c | 303 ---- patchlib/bspatch.h | 27 - patchlib/bzlib.c | 1579 ------------------ patchlib/bzlib.h | 283 ---- patchlib/bzlib_private.h | 510 ------ patchlib/compress.c | 672 -------- patchlib/crctable.c | 104 -- patchlib/decompress.c | 646 -------- patchlib/huffman.c | 205 --- patchlib/randtable.c | 84 - quazip/CMakeLists.txt | 28 - quazip/JlCompress.cpp | 516 ------ quazip/JlCompress.h | 123 -- quazip/crypt.h | 135 -- quazip/ioapi.h | 77 - quazip/qioapi.cpp | 146 -- quazip/quaadler32.cpp | 28 - quazip/quaadler32.h | 29 - quazip/quachecksum32.h | 54 - quazip/quacrc32.cpp | 28 - quazip/quacrc32.h | 26 - quazip/quagzipfile.cpp | 141 -- quazip/quagzipfile.h | 35 - quazip/quaziodevice.cpp | 283 ---- quazip/quaziodevice.h | 27 - quazip/quazip.cpp | 554 ------- quazip/quazip.h | 411 ----- quazip/quazip_global.h | 55 - quazip/quazipdir.cpp | 507 ------ quazip/quazipdir.h | 171 -- quazip/quazipfile.cpp | 488 ------ quazip/quazipfile.h | 442 ----- quazip/quazipfileinfo.h | 66 - quazip/quazipnewinfo.cpp | 51 - quazip/quazipnewinfo.h | 102 -- quazip/unzip.c | 1603 ------------------ quazip/unzip.h | 356 ---- quazip/zip.c | 1281 --------------- quazip/zip.h | 245 --- 345 files changed, 29446 insertions(+), 29377 deletions(-) delete mode 100644 backend/BaseInstance.cpp delete mode 100644 backend/BaseInstance.h delete mode 100644 backend/BaseInstance_p.h delete mode 100644 backend/BaseUpdate.cpp delete mode 100644 backend/BaseUpdate.h delete mode 100644 backend/CMakeLists.txt delete mode 100644 backend/IconListModel.cpp delete mode 100644 backend/IconListModel.h delete mode 100644 backend/InstanceFactory.cpp delete mode 100644 backend/InstanceFactory.h delete mode 100644 backend/InstanceVersion.h delete mode 100644 backend/LegacyForge.cpp delete mode 100644 backend/LegacyForge.h delete mode 100644 backend/LegacyInstance.cpp delete mode 100644 backend/LegacyInstance.h delete mode 100644 backend/LegacyInstance_p.h delete mode 100644 backend/LegacyUpdate.cpp delete mode 100644 backend/LegacyUpdate.h delete mode 100644 backend/MinecraftProcess.cpp delete mode 100644 backend/MinecraftProcess.h delete mode 100644 backend/MinecraftVersion.h delete mode 100644 backend/Mod.cpp delete mode 100644 backend/Mod.h delete mode 100644 backend/ModList.cpp delete mode 100644 backend/ModList.h delete mode 100644 backend/NostalgiaInstance.cpp delete mode 100644 backend/NostalgiaInstance.h delete mode 100644 backend/OneSixAssets.cpp delete mode 100644 backend/OneSixAssets.h delete mode 100644 backend/OneSixInstance.cpp delete mode 100644 backend/OneSixInstance.h delete mode 100644 backend/OneSixInstance_p.h delete mode 100644 backend/OneSixUpdate.cpp delete mode 100644 backend/OneSixUpdate.h delete mode 100644 backend/OneSixVersion.cpp delete mode 100644 backend/OneSixVersion.h delete mode 100644 backend/VersionFactory.cpp delete mode 100644 backend/VersionFactory.h delete mode 100644 backend/libmmc_config.h delete mode 100644 backend/lists/InstVersionList.cpp delete mode 100644 backend/lists/InstVersionList.h delete mode 100644 backend/lists/InstanceList.cpp delete mode 100644 backend/lists/InstanceList.h delete mode 100644 backend/lists/LwjglVersionList.cpp delete mode 100644 backend/lists/LwjglVersionList.h delete mode 100644 backend/lists/MinecraftVersionList.cpp delete mode 100644 backend/lists/MinecraftVersionList.h delete mode 100644 backend/net/DownloadJob.cpp delete mode 100644 backend/net/DownloadJob.h delete mode 100644 backend/net/JobQueue.h delete mode 100644 backend/net/NetWorker.cpp delete mode 100644 backend/net/NetWorker.h delete mode 100644 backend/tasks/LoginTask.cpp delete mode 100644 backend/tasks/LoginTask.h delete mode 100644 backend/tasks/Task.cpp delete mode 100644 backend/tasks/Task.h create mode 100644 depends/classparser/CMakeLists.txt create mode 100644 depends/classparser/include/classparser_config.h create mode 100644 depends/classparser/include/javautils.h create mode 100644 depends/classparser/src/annotations.cpp create mode 100644 depends/classparser/src/annotations.h create mode 100644 depends/classparser/src/classfile.h create mode 100644 depends/classparser/src/constants.h create mode 100644 depends/classparser/src/errors.h create mode 100644 depends/classparser/src/javaendian.h create mode 100644 depends/classparser/src/javautils.cpp create mode 100644 depends/classparser/src/membuffer.h create mode 100644 depends/groupview/CMakeLists.txt create mode 100644 depends/groupview/include/categorizedsortfilterproxymodel.h create mode 100644 depends/groupview/include/categorizedview.h create mode 100644 depends/groupview/include/categorydrawer.h create mode 100644 depends/groupview/include/groupview_config.h create mode 100644 depends/groupview/src/categorizedsortfilterproxymodel.cpp create mode 100644 depends/groupview/src/categorizedsortfilterproxymodel_p.h create mode 100644 depends/groupview/src/categorizedview.cpp create mode 100644 depends/groupview/src/categorizedview_p.h create mode 100644 depends/groupview/src/categorydrawer.cpp create mode 100644 depends/launcher/CMakeLists.txt create mode 100644 depends/launcher/MCFrame.java create mode 100644 depends/launcher/MultiMCLauncher.java create mode 100644 depends/launcher/UseJava.cmake create mode 100644 depends/launcher/UseJavaClassFilelist.cmake create mode 100644 depends/launcher/UseJavaSymlinks.cmake create mode 100644 depends/launcher/net/minecraft/Launcher.java create mode 100644 depends/launcher/org/simplericity/macify/eawt/Application.java create mode 100644 depends/launcher/org/simplericity/macify/eawt/ApplicationAdapter.java create mode 100644 depends/launcher/org/simplericity/macify/eawt/ApplicationEvent.java create mode 100644 depends/launcher/org/simplericity/macify/eawt/ApplicationListener.java create mode 100644 depends/launcher/org/simplericity/macify/eawt/DefaultApplication.java create mode 100644 depends/patchlib/CMakeLists.txt create mode 100644 depends/patchlib/LICENSE-bzip2 create mode 100644 depends/patchlib/blocksort.c create mode 100644 depends/patchlib/bspatch.c create mode 100644 depends/patchlib/bspatch.h create mode 100644 depends/patchlib/bzlib.c create mode 100644 depends/patchlib/bzlib.h create mode 100644 depends/patchlib/bzlib_private.h create mode 100644 depends/patchlib/compress.c create mode 100644 depends/patchlib/crctable.c create mode 100644 depends/patchlib/decompress.c create mode 100644 depends/patchlib/huffman.c create mode 100644 depends/patchlib/randtable.c create mode 100644 depends/quazip/CMakeLists.txt create mode 100644 depends/quazip/JlCompress.cpp create mode 100644 depends/quazip/JlCompress.h create mode 100644 depends/quazip/crypt.h create mode 100644 depends/quazip/ioapi.h create mode 100644 depends/quazip/qioapi.cpp create mode 100644 depends/quazip/quaadler32.cpp create mode 100644 depends/quazip/quaadler32.h create mode 100644 depends/quazip/quachecksum32.h create mode 100644 depends/quazip/quacrc32.cpp create mode 100644 depends/quazip/quacrc32.h create mode 100644 depends/quazip/quagzipfile.cpp create mode 100644 depends/quazip/quagzipfile.h create mode 100644 depends/quazip/quaziodevice.cpp create mode 100644 depends/quazip/quaziodevice.h create mode 100644 depends/quazip/quazip.cpp create mode 100644 depends/quazip/quazip.h create mode 100644 depends/quazip/quazip_global.h create mode 100644 depends/quazip/quazipdir.cpp create mode 100644 depends/quazip/quazipdir.h create mode 100644 depends/quazip/quazipfile.cpp create mode 100644 depends/quazip/quazipfile.h create mode 100644 depends/quazip/quazipfileinfo.h create mode 100644 depends/quazip/quazipnewinfo.cpp create mode 100644 depends/quazip/quazipnewinfo.h create mode 100644 depends/quazip/unzip.c create mode 100644 depends/quazip/unzip.h create mode 100644 depends/quazip/zip.c create mode 100644 depends/quazip/zip.h create mode 100644 depends/settings/CMakeLists.txt create mode 100644 depends/settings/include/basicsettingsobject.h create mode 100644 depends/settings/include/inifile.h create mode 100644 depends/settings/include/inisettingsobject.h create mode 100644 depends/settings/include/keyring.h create mode 100644 depends/settings/include/libsettings_config.h create mode 100644 depends/settings/include/overridesetting.h create mode 100644 depends/settings/include/setting.h create mode 100644 depends/settings/include/settingsobject.h create mode 100644 depends/settings/src/basicsettingsobject.cpp create mode 100644 depends/settings/src/inifile.cpp create mode 100644 depends/settings/src/inisettingsobject.cpp create mode 100644 depends/settings/src/keyring.cpp create mode 100644 depends/settings/src/overridesetting.cpp create mode 100644 depends/settings/src/setting.cpp create mode 100644 depends/settings/src/settingsobject.cpp create mode 100644 depends/settings/src/stubkeyring.cpp create mode 100644 depends/settings/src/stubkeyring.h create mode 100644 depends/util/CMakeLists.txt create mode 100644 depends/util/include/apputils.h create mode 100644 depends/util/include/cmdutils.h create mode 100644 depends/util/include/libutil_config.h create mode 100644 depends/util/include/osutils.h create mode 100644 depends/util/include/pathutils.h create mode 100644 depends/util/include/siglist.h create mode 100644 depends/util/include/siglist_impl.h create mode 100644 depends/util/include/userutils.h create mode 100644 depends/util/src/cmdutils.cpp create mode 100644 depends/util/src/osutils.cpp create mode 100644 depends/util/src/pathutils.cpp create mode 100644 depends/util/src/userutils.cpp create mode 100644 gui/LegacyModEditDialog.cpp create mode 100644 gui/LegacyModEditDialog.h create mode 100644 gui/LegacyModEditDialog.ui delete mode 100644 gui/legacymodeditdialog.cpp delete mode 100644 gui/legacymodeditdialog.h delete mode 100644 gui/legacymodeditdialog.ui delete mode 100644 java/annotations.cpp delete mode 100644 java/annotations.h delete mode 100644 java/classfile.h delete mode 100644 java/constants.h delete mode 100644 java/errors.h delete mode 100644 java/javaendian.h delete mode 100644 java/javautils.cpp delete mode 100644 java/javautils.h delete mode 100644 java/membuffer.h delete mode 100644 java/test.cpp delete mode 100644 launcher/CMakeLists.txt delete mode 100644 launcher/MCFrame.java delete mode 100644 launcher/MultiMCLauncher.java delete mode 100644 launcher/UseJava.cmake delete mode 100644 launcher/UseJavaClassFilelist.cmake delete mode 100644 launcher/UseJavaSymlinks.cmake delete mode 100644 launcher/net/minecraft/Launcher.java delete mode 100644 launcher/org/simplericity/macify/eawt/Application.java delete mode 100644 launcher/org/simplericity/macify/eawt/ApplicationAdapter.java delete mode 100644 launcher/org/simplericity/macify/eawt/ApplicationEvent.java delete mode 100644 launcher/org/simplericity/macify/eawt/ApplicationListener.java delete mode 100644 launcher/org/simplericity/macify/eawt/DefaultApplication.java delete mode 100644 libgroupview/CMakeLists.txt delete mode 100644 libgroupview/include/categorizedsortfilterproxymodel.h delete mode 100644 libgroupview/include/categorizedview.h delete mode 100644 libgroupview/include/categorydrawer.h delete mode 100644 libgroupview/include/libgroupview_config.h delete mode 100644 libgroupview/src/categorizedsortfilterproxymodel.cpp delete mode 100644 libgroupview/src/categorizedsortfilterproxymodel_p.h delete mode 100644 libgroupview/src/categorizedview.cpp delete mode 100644 libgroupview/src/categorizedview_p.h delete mode 100644 libgroupview/src/categorydrawer.cpp delete mode 100644 libsettings/CMakeLists.txt delete mode 100644 libsettings/include/basicsettingsobject.h delete mode 100644 libsettings/include/inifile.h delete mode 100644 libsettings/include/inisettingsobject.h delete mode 100644 libsettings/include/keyring.h delete mode 100644 libsettings/include/libsettings_config.h delete mode 100644 libsettings/include/overridesetting.h delete mode 100644 libsettings/include/setting.h delete mode 100644 libsettings/include/settingsobject.h delete mode 100644 libsettings/src/basicsettingsobject.cpp delete mode 100644 libsettings/src/inifile.cpp delete mode 100644 libsettings/src/inisettingsobject.cpp delete mode 100644 libsettings/src/keyring.cpp delete mode 100644 libsettings/src/overridesetting.cpp delete mode 100644 libsettings/src/setting.cpp delete mode 100644 libsettings/src/settingsobject.cpp delete mode 100644 libsettings/src/stubkeyring.cpp delete mode 100644 libsettings/src/stubkeyring.h delete mode 100644 libutil/CMakeLists.txt delete mode 100644 libutil/include/apputils.h delete mode 100644 libutil/include/cmdutils.h delete mode 100644 libutil/include/libutil_config.h delete mode 100644 libutil/include/osutils.h delete mode 100644 libutil/include/pathutils.h delete mode 100644 libutil/include/siglist.h delete mode 100644 libutil/include/siglist_impl.h delete mode 100644 libutil/include/userutils.h delete mode 100644 libutil/src/cmdutils.cpp delete mode 100644 libutil/src/osutils.cpp delete mode 100644 libutil/src/pathutils.cpp delete mode 100644 libutil/src/userutils.cpp create mode 100644 logic/BaseInstance.cpp create mode 100644 logic/BaseInstance.h create mode 100644 logic/BaseInstance_p.h create mode 100644 logic/BaseUpdate.cpp create mode 100644 logic/BaseUpdate.h create mode 100644 logic/CMakeLists.txt create mode 100644 logic/IconListModel.cpp create mode 100644 logic/IconListModel.h create mode 100644 logic/InstanceFactory.cpp create mode 100644 logic/InstanceFactory.h create mode 100644 logic/InstanceVersion.h create mode 100644 logic/LegacyForge.cpp create mode 100644 logic/LegacyForge.h create mode 100644 logic/LegacyInstance.cpp create mode 100644 logic/LegacyInstance.h create mode 100644 logic/LegacyInstance_p.h create mode 100644 logic/LegacyUpdate.cpp create mode 100644 logic/LegacyUpdate.h create mode 100644 logic/MinecraftProcess.cpp create mode 100644 logic/MinecraftProcess.h create mode 100644 logic/MinecraftVersion.h create mode 100644 logic/Mod.cpp create mode 100644 logic/Mod.h create mode 100644 logic/ModList.cpp create mode 100644 logic/ModList.h create mode 100644 logic/NostalgiaInstance.cpp create mode 100644 logic/NostalgiaInstance.h create mode 100644 logic/OneSixAssets.cpp create mode 100644 logic/OneSixAssets.h create mode 100644 logic/OneSixInstance.cpp create mode 100644 logic/OneSixInstance.h create mode 100644 logic/OneSixInstance_p.h create mode 100644 logic/OneSixUpdate.cpp create mode 100644 logic/OneSixUpdate.h create mode 100644 logic/OneSixVersion.cpp create mode 100644 logic/OneSixVersion.h create mode 100644 logic/VersionFactory.cpp create mode 100644 logic/VersionFactory.h create mode 100644 logic/lists/InstVersionList.cpp create mode 100644 logic/lists/InstVersionList.h create mode 100644 logic/lists/InstanceList.cpp create mode 100644 logic/lists/InstanceList.h create mode 100644 logic/lists/LwjglVersionList.cpp create mode 100644 logic/lists/LwjglVersionList.h create mode 100644 logic/lists/MinecraftVersionList.cpp create mode 100644 logic/lists/MinecraftVersionList.h create mode 100644 logic/net/DownloadJob.cpp create mode 100644 logic/net/DownloadJob.h create mode 100644 logic/net/JobQueue.h create mode 100644 logic/net/NetWorker.cpp create mode 100644 logic/net/NetWorker.h create mode 100644 logic/tasks/LoginTask.cpp create mode 100644 logic/tasks/LoginTask.h create mode 100644 logic/tasks/Task.cpp create mode 100644 logic/tasks/Task.h delete mode 100644 patchlib/CMakeLists.txt delete mode 100644 patchlib/LICENSE-bzip2 delete mode 100644 patchlib/blocksort.c delete mode 100644 patchlib/bspatch.c delete mode 100644 patchlib/bspatch.h delete mode 100644 patchlib/bzlib.c delete mode 100644 patchlib/bzlib.h delete mode 100644 patchlib/bzlib_private.h delete mode 100644 patchlib/compress.c delete mode 100644 patchlib/crctable.c delete mode 100644 patchlib/decompress.c delete mode 100644 patchlib/huffman.c delete mode 100644 patchlib/randtable.c delete mode 100644 quazip/CMakeLists.txt delete mode 100644 quazip/JlCompress.cpp delete mode 100644 quazip/JlCompress.h delete mode 100644 quazip/crypt.h delete mode 100644 quazip/ioapi.h delete mode 100644 quazip/qioapi.cpp delete mode 100644 quazip/quaadler32.cpp delete mode 100644 quazip/quaadler32.h delete mode 100644 quazip/quachecksum32.h delete mode 100644 quazip/quacrc32.cpp delete mode 100644 quazip/quacrc32.h delete mode 100644 quazip/quagzipfile.cpp delete mode 100644 quazip/quagzipfile.h delete mode 100644 quazip/quaziodevice.cpp delete mode 100644 quazip/quaziodevice.h delete mode 100644 quazip/quazip.cpp delete mode 100644 quazip/quazip.h delete mode 100644 quazip/quazip_global.h delete mode 100644 quazip/quazipdir.cpp delete mode 100644 quazip/quazipdir.h delete mode 100644 quazip/quazipfile.cpp delete mode 100644 quazip/quazipfile.h delete mode 100644 quazip/quazipfileinfo.h delete mode 100644 quazip/quazipnewinfo.cpp delete mode 100644 quazip/quazipnewinfo.h delete mode 100644 quazip/unzip.c delete mode 100644 quazip/unzip.h delete mode 100644 quazip/zip.c delete mode 100644 quazip/zip.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d907e152..84d8a6f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,33 +43,28 @@ find_package(ZLIB REQUIRED) ######## Included Libs ######## # Add quazip -add_subdirectory(quazip) -include_directories(quazip ${ZLIB_INCLUDE_DIRS}) +add_subdirectory(depends/quazip) +include_directories(depends/quazip ${ZLIB_INCLUDE_DIRS}) # Add bspatch -add_subdirectory(patchlib) -include_directories(patchlib) +add_subdirectory(depends/patchlib) +include_directories(depends/patchlib) # Add the java launcher -add_subdirectory(launcher) - +add_subdirectory(depends/launcher) ######## MultiMC Libs ######## # Add the util library. -add_subdirectory(libutil) +add_subdirectory(depends/util) include_directories(${LIBUTIL_INCLUDE_DIR}) # Add the settings library. -add_subdirectory(libsettings) +add_subdirectory(depends/settings) include_directories(${LIBSETTINGS_INCLUDE_DIR}) -# Add the instance library. -add_subdirectory(backend) -include_directories(${LIBMULTIMC_INCLUDE_DIR}) - # Add the group view library. -add_subdirectory(libgroupview) +add_subdirectory(depends/groupview) include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) @@ -164,7 +159,6 @@ AppSettings.h gui/mainwindow.h gui/modeditdialog.h -gui/legacymodeditdialog.h gui/settingsdialog.h gui/newinstancedialog.h gui/logindialog.h @@ -178,14 +172,51 @@ gui/versionselectdialog.h gui/lwjglselectdialog.h gui/instancesettings.h gui/IconPickerDialog.h - -java/annotations.h -java/classfile.h -java/constants.h -java/javaendian.h -java/errors.h -java/javautils.h -java/membuffer.h +gui/LegacyModEditDialog.h + +# Base classes and infrastructure +logic/InstanceVersion.h +logic/MinecraftVersion.h +logic/InstanceFactory.h +logic/BaseUpdate.h +logic/BaseInstance.h +logic/BaseInstance_p.h +logic/MinecraftProcess.h +logic/Mod.h +logic/ModList.h + +# network stuffs +logic/net/DownloadJob.h +logic/net/JobQueue.h +logic/net/NetWorker.h + +# legacy instances +logic/LegacyInstance.h +logic/LegacyInstance_p.h +logic/LegacyUpdate.h +logic/LegacyForge.h + +# 1.6 instances +logic/OneSixAssets.h +logic/OneSixInstance.h +logic/OneSixInstance_p.h +logic/OneSixUpdate.h +logic/OneSixVersion.h +logic/VersionFactory.h + +# Nostalgia +logic/NostalgiaInstance.h + +# Lists +logic/lists/InstanceList.h +logic/lists/InstVersionList.h +logic/lists/MinecraftVersionList.h +logic/lists/LwjglVersionList.h +logic/IconListModel.h + +# Tasks +logic/tasks/Task.h +logic/tasks/LoginTask.h ) @@ -197,7 +228,6 @@ AppSettings.cpp gui/mainwindow.cpp gui/modeditdialog.cpp -gui/legacymodeditdialog.cpp gui/settingsdialog.cpp gui/newinstancedialog.cpp gui/logindialog.cpp @@ -211,9 +241,45 @@ gui/versionselectdialog.cpp gui/lwjglselectdialog.cpp gui/instancesettings.cpp gui/IconPickerDialog.cpp - -java/javautils.cpp -java/annotations.cpp +gui/LegacyModEditDialog.cpp + +# Base classes and infrastructure +logic/InstanceFactory.cpp +logic/BaseUpdate.cpp +logic/BaseInstance.cpp +logic/MinecraftProcess.cpp +logic/Mod.cpp +logic/ModList.cpp + +# network stuffs - to be moved into a depend lib ~_~ +logic/net/NetWorker.cpp +logic/net/DownloadJob.cpp + +# legacy instances +logic/LegacyInstance.cpp +logic/LegacyUpdate.cpp +logic/LegacyForge.cpp + +# 1.6 instances +logic/OneSixAssets.cpp +logic/OneSixInstance.cpp +logic/OneSixVersion.cpp +logic/OneSixUpdate.cpp +logic/VersionFactory.cpp + +# Nostalgia +logic/NostalgiaInstance.cpp + +# Lists +logic/lists/InstanceList.cpp +logic/lists/InstVersionList.cpp +logic/lists/MinecraftVersionList.cpp +logic/lists/LwjglVersionList.cpp +logic/IconListModel.cpp + +# Tasks +logic/tasks/Task.cpp +logic/tasks/LoginTask.cpp ) @@ -221,7 +287,6 @@ java/annotations.cpp SET(MULTIMC_UIS gui/mainwindow.ui gui/modeditdialog.ui -gui/legacymodeditdialog.ui gui/settingsdialog.ui gui/newinstancedialog.ui gui/logindialog.ui @@ -233,6 +298,7 @@ gui/versionselectdialog.ui gui/lwjglselectdialog.ui gui/instancesettings.ui gui/IconPickerDialog.ui +gui/LegacyModEditDialog.ui ) @@ -270,11 +336,9 @@ ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 ${MULTIMC_SOURCES} ${MULTIMC_HEADERS} ${MULTIMC_UI} ${MULTIMC_QRC} ${MULTIMC_RCS}) # Link -QT5_USE_MODULES(MultiMC Widgets Network WebKitWidgets) -TARGET_LINK_LIBRARIES(MultiMC quazip patchlib -libUtil libSettings backend libGroupView -${MultiMC_LINK_ADDITIONAL_LIBS}) -ADD_DEPENDENCIES(MultiMC MultiMCLauncher libUtil libSettings backend libGroupView) +QT5_USE_MODULES(MultiMC Widgets Network WebKitWidgets Xml) +TARGET_LINK_LIBRARIES(MultiMC quazip patchlib libUtil libSettings libGroupView ${MultiMC_LINK_ADDITIONAL_LIBS}) +ADD_DEPENDENCIES(MultiMC MultiMCLauncher libUtil libSettings libGroupView) option(BUILD_KEYRING_TEST "Build the simple keyring test binary" OFF) diff --git a/backend/BaseInstance.cpp b/backend/BaseInstance.cpp deleted file mode 100644 index 951b403a..00000000 --- a/backend/BaseInstance.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "BaseInstance.h" -#include "BaseInstance_p.h" - -#include - -#include "inisettingsobject.h" -#include "setting.h" -#include "overridesetting.h" - -#include "pathutils.h" -#include - - -BaseInstance::BaseInstance( BaseInstancePrivate* d_in, - const QString& rootDir, - SettingsObject* settings_obj, - QObject* parent - ) -:inst_d(d_in), QObject(parent) -{ - I_D(BaseInstance); - d->m_settings = settings_obj; - d->m_rootDir = rootDir; - - settings().registerSetting(new Setting("name", "Unnamed Instance")); - settings().registerSetting(new Setting("iconKey", "default")); - settings().registerSetting(new Setting("notes", "")); - settings().registerSetting(new Setting("lastLaunchTime", 0)); - - // Java Settings - settings().registerSetting(new Setting("OverrideJava", false)); - settings().registerSetting(new OverrideSetting("JavaPath", globalSettings->getSetting("JavaPath"))); - settings().registerSetting(new OverrideSetting("JvmArgs", globalSettings->getSetting("JvmArgs"))); - - // Custom Commands - settings().registerSetting(new Setting("OverrideCommands", false)); - settings().registerSetting(new OverrideSetting("PreLaunchCommand", globalSettings->getSetting("PreLaunchCommand"))); - settings().registerSetting(new OverrideSetting("PostExitCommand", globalSettings->getSetting("PostExitCommand"))); - - // Window Size - settings().registerSetting(new Setting("OverrideWindow", false)); - settings().registerSetting(new OverrideSetting("LaunchMaximized", globalSettings->getSetting("LaunchMaximized"))); - settings().registerSetting(new OverrideSetting("MinecraftWinWidth", globalSettings->getSetting("MinecraftWinWidth"))); - settings().registerSetting(new OverrideSetting("MinecraftWinHeight", globalSettings->getSetting("MinecraftWinHeight"))); - - // Memory - settings().registerSetting(new Setting("OverrideMemory", false)); - settings().registerSetting(new OverrideSetting("MinMemAlloc", globalSettings->getSetting("MinMemAlloc"))); - settings().registerSetting(new OverrideSetting("MaxMemAlloc", globalSettings->getSetting("MaxMemAlloc"))); - - // Auto login - settings().registerSetting(new Setting("OverrideLogin", false)); - settings().registerSetting(new OverrideSetting("AutoLogin", globalSettings->getSetting("AutoLogin"))); - - // Console - settings().registerSetting(new Setting("OverrideConsole", false)); - settings().registerSetting(new OverrideSetting("ShowConsole", globalSettings->getSetting("ShowConsole"))); - settings().registerSetting(new OverrideSetting("AutoCloseConsole", globalSettings->getSetting("AutoCloseConsole"))); -} - -QString BaseInstance::id() const -{ - return QFileInfo(instanceRoot()).fileName(); -} - -QString BaseInstance::instanceType() const -{ - I_D(BaseInstance); - return d->m_settings->get("InstanceType").toString(); -} - - -QString BaseInstance::instanceRoot() const -{ - I_D(BaseInstance); - return d->m_rootDir; -} - -QString BaseInstance::minecraftRoot() const -{ - QFileInfo mcDir(PathCombine(instanceRoot(), "minecraft")); - QFileInfo dotMCDir(PathCombine(instanceRoot(), ".minecraft")); - - if (dotMCDir.exists() && !mcDir.exists()) - return dotMCDir.filePath(); - else - return mcDir.filePath(); -} - -InstanceList *BaseInstance::instList() const -{ - if (parent()->inherits("InstanceList")) - return (InstanceList *)parent(); - else - return NULL; -} - -InstVersionList *BaseInstance::versionList() const -{ - return &MinecraftVersionList::getMainList(); -} - -SettingsObject &BaseInstance::settings() const -{ - I_D(BaseInstance); - return *d->m_settings; -} - -qint64 BaseInstance::lastLaunch() const -{ - I_D(BaseInstance); - return d->m_settings->get ( "lastLaunchTime" ).value(); -} -void BaseInstance::setLastLaunch ( qint64 val ) -{ - I_D(BaseInstance); - d->m_settings->set ( "lastLaunchTime", val ); - emit propertiesChanged ( this ); -} - -void BaseInstance::setGroup ( QString val ) -{ - I_D(BaseInstance); - d->m_group = val; - emit propertiesChanged ( this ); -} -QString BaseInstance::group() const -{ - I_D(BaseInstance); - return d->m_group; -} - -void BaseInstance::setNotes ( QString val ) -{ - I_D(BaseInstance); - d->m_settings->set ( "notes", val ); -} -QString BaseInstance::notes() const -{ - I_D(BaseInstance); - return d->m_settings->get ( "notes" ).toString(); -} - -void BaseInstance::setIconKey ( QString val ) -{ - I_D(BaseInstance); - d->m_settings->set ( "iconKey", val ); - emit propertiesChanged ( this ); -} -QString BaseInstance::iconKey() const -{ - I_D(BaseInstance); - return d->m_settings->get ( "iconKey" ).toString(); -} - -void BaseInstance::setName ( QString val ) -{ - I_D(BaseInstance); - d->m_settings->set ( "name", val ); - emit propertiesChanged ( this ); -} -QString BaseInstance::name() const -{ - I_D(BaseInstance); - return d->m_settings->get ( "name" ).toString(); -} diff --git a/backend/BaseInstance.h b/backend/BaseInstance.h deleted file mode 100644 index 05f3ce00..00000000 --- a/backend/BaseInstance.h +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include - -#include "inifile.h" -#include "lists/InstVersionList.h" - -#include "libmmc_config.h" - -class BaseUpdate; -class MinecraftProcess; -class OneSixUpdate; -class InstanceList; -class BaseInstancePrivate; - -/*! - * \brief Base class for instances. - * This class implements many functions that are common between instances and - * provides a standard interface for all instances. - * - * To create a new instance type, create a new class inheriting from this class - * and implement the pure virtual functions. - */ -class LIBMULTIMC_EXPORT BaseInstance : public QObject -{ - Q_OBJECT -protected: - /// no-touchy! - BaseInstance(BaseInstancePrivate * d, const QString &rootDir, SettingsObject * settings, QObject *parent = 0); -public: - /// virtual destructor to make sure the destruction is COMPLETE - virtual ~BaseInstance() {}; - - /// The instance's ID. The ID SHALL be determined by MMC internally. The ID IS guaranteed to be unique. - QString id() const; - - /// get the type of this instance - QString instanceType() const; - - /// Path to the instance's root directory. - QString instanceRoot() const; - - /// Path to the instance's minecraft directory. - QString minecraftRoot() const; - - QString name() const; - void setName(QString val); - - QString iconKey() const; - void setIconKey(QString val); - - QString notes() const; - void setNotes(QString val); - - QString group() const; - void setGroup(QString val); - - virtual QString intendedVersionId() const = 0; - virtual bool setIntendedVersionId(QString version) = 0; - - /*! - * The instance's current version. - * This value represents the instance's current version. If this value is - * different from the intendedVersion, the instance should be updated. - * \warning Don't change this value unless you know what you're doing. - */ - virtual QString currentVersionId() const = 0; - //virtual void setCurrentVersionId(QString val) = 0; - - /*! - * Whether or not Minecraft should be downloaded when the instance is launched. - */ - virtual bool shouldUpdate() const = 0; - virtual void setShouldUpdate(bool val) = 0; - - /** - * Gets the time that the instance was last launched. - * Stored in milliseconds since epoch. - */ - qint64 lastLaunch() const; - /// Sets the last launched time to 'val' milliseconds since epoch - void setLastLaunch(qint64 val = QDateTime::currentMSecsSinceEpoch()); - - /*! - * \brief Gets the instance list that this instance is a part of. - * Returns NULL if this instance is not in a list - * (the parent is not an InstanceList). - * \return A pointer to the InstanceList containing this instance. - */ - InstanceList *instList() const; - - /*! - * \brief Gets a pointer to this instance's version list. - * \return A pointer to the available version list for this instance. - */ - virtual InstVersionList *versionList() const; - - /*! - * \brief Gets this instance's settings object. - * This settings object stores instance-specific settings. - * \return A pointer to this instance's settings object. - */ - virtual SettingsObject &settings() const; - - /// returns a valid update task if update is needed, NULL otherwise - virtual BaseUpdate* doUpdate() = 0; - - /// returns a valid minecraft process, ready for launch - virtual MinecraftProcess* prepareForLaunch(QString user, QString session) = 0; - - /// do any necessary cleanups after the instance finishes. also runs before 'prepareForLaunch' - virtual void cleanupAfterRun() = 0; -signals: - /*! - * \brief Signal emitted when properties relevant to the instance view change - */ - void propertiesChanged(BaseInstance * inst); - -protected: - QSharedPointer inst_d; -}; - -// pointer for lazy people -typedef QSharedPointer InstancePtr; - diff --git a/backend/BaseInstance_p.h b/backend/BaseInstance_p.h deleted file mode 100644 index a30916a4..00000000 --- a/backend/BaseInstance_p.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once -#include -#include - -class BaseInstance; - -#define I_D(Class) Class##Private * const d = (Class##Private * const) inst_d.data() - -struct BaseInstancePrivate -{ - QString m_rootDir; - QString m_group; - SettingsObject *m_settings; -}; \ No newline at end of file diff --git a/backend/BaseUpdate.cpp b/backend/BaseUpdate.cpp deleted file mode 100644 index b086ab14..00000000 --- a/backend/BaseUpdate.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "BaseUpdate.h" - -BaseUpdate::BaseUpdate ( BaseInstance* inst, QObject* parent ) : Task ( parent ) -{ - m_inst = inst; -} - -void BaseUpdate::updateDownloadProgress(qint64 current, qint64 total) -{ - // The progress on the current file is current / total - float currentDLProgress = (float) current / (float) total; - setProgress((int)(currentDLProgress * 100)); // convert to percentage -} \ No newline at end of file diff --git a/backend/BaseUpdate.h b/backend/BaseUpdate.h deleted file mode 100644 index b7d2017e..00000000 --- a/backend/BaseUpdate.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -#include "net/DownloadJob.h" - -#include "tasks/Task.h" -#include "libmmc_config.h" - -class MinecraftVersion; -class BaseInstance; - -/*! - * The game update task is the task that handles downloading instances' files. - */ -class LIBMULTIMC_EXPORT BaseUpdate : public Task -{ - Q_OBJECT -public: - explicit BaseUpdate(BaseInstance *inst, QObject *parent = 0); - - virtual void executeTask() = 0; - -protected slots: - //virtual void error(const QString &msg); - void updateDownloadProgress(qint64 current, qint64 total); - -protected: - JobListQueue download_queue; - BaseInstance *m_inst; -}; - - diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt deleted file mode 100644 index 7a92d5cf..00000000 --- a/backend/CMakeLists.txt +++ /dev/null @@ -1,120 +0,0 @@ -project(libMultiMC) - -set(CMAKE_AUTOMOC ON) - -# Find Qt -find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Xml REQUIRED) - -# Include Qt headers. -include_directories(${Qt5Base_INCLUDE_DIRS}) -include_directories(${Qt5Network_INCLUDE_DIRS}) - -# Include utility library. -include_directories(${CMAKE_SOURCE_DIR}/libutil/include) - -# Include settings library. -include_directories(${CMAKE_SOURCE_DIR}/libsettings/include) - -SET(LIBINST_HEADERS -libmmc_config.h - -# Base classes and infrastructure -InstanceVersion.h -MinecraftVersion.h -InstanceFactory.h -BaseUpdate.h -BaseInstance.h -BaseInstance_p.h -MinecraftProcess.h -Mod.h -ModList.h - -# network stuffs -net/DownloadJob.h -net/JobQueue.h -net/NetWorker.h - -# legacy instances -LegacyInstance.h -LegacyInstance_p.h -LegacyUpdate.h -LegacyForge.h - -# 1.6 instances -OneSixAssets.h -OneSixInstance.h -OneSixInstance_p.h -OneSixUpdate.h -OneSixVersion.h -VersionFactory.h - -# Nostalgia -NostalgiaInstance.h - -# Lists -lists/InstanceList.h -lists/InstVersionList.h -lists/MinecraftVersionList.h -lists/LwjglVersionList.h -IconListModel.h - -# Tasks -tasks/Task.h -tasks/LoginTask.h -) - -SET(LIBINST_SOURCES -# Base classes and infrastructure -InstanceFactory.cpp -BaseUpdate.cpp -BaseInstance.cpp -MinecraftProcess.cpp -Mod.cpp -ModList.cpp - -# network stuffs -net/NetWorker.cpp -net/DownloadJob.cpp - -# legacy instances -LegacyInstance.cpp -LegacyUpdate.cpp -LegacyForge.cpp - -# 1.6 instances -OneSixAssets.cpp -OneSixInstance.cpp -OneSixVersion.cpp -OneSixUpdate.cpp -VersionFactory.cpp - -# Nostalgia -NostalgiaInstance.cpp - -# Lists -lists/InstanceList.cpp -lists/InstVersionList.cpp -lists/MinecraftVersionList.cpp -lists/LwjglVersionList.cpp -IconListModel.cpp - -# Tasks -tasks/Task.cpp -tasks/LoginTask.cpp -) - -# Set the include dir path. -SET(LIBMULTIMC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE) - -# Include self. -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_BINARY_DIR}/include) - -add_definitions(-DLIBMULTIMC_LIBRARY) - -add_library(backend SHARED ${LIBINST_SOURCES} ${LIBINST_HEADERS}) -qt5_use_modules(backend Core Network Xml) -target_link_libraries(backend libUtil libSettings quazip) - diff --git a/backend/IconListModel.cpp b/backend/IconListModel.cpp deleted file mode 100644 index 2d2fb6cf..00000000 --- a/backend/IconListModel.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include "IconListModel.h" -#include -#include -#include -#include - -#define MAX_SIZE 1024 -IconList* IconList::m_Instance = 0; -QMutex IconList::mutex; - -struct entry -{ - QString key; - QString name; - QIcon icon; - bool is_builtin; -}; - -class Private : public QObject -{ - Q_OBJECT -public: - QMap index; - QVector icons; - Private() - { - } -}; - - -IconList::IconList() : QAbstractListModel(), d(new Private()) -{ - QDir instance_icons(":/icons/instances/"); - auto file_info_list = instance_icons.entryInfoList(QDir::Files, QDir::Name); - for(auto file_info: file_info_list) - { - QString key = file_info.baseName(); - addIcon(key, key, file_info.absoluteFilePath(), true); - } - - // FIXME: get from settings - ensurePathExists("icons/"); - QDir user_icons("icons/"); - file_info_list = user_icons.entryInfoList(QDir::Files, QDir::Name); - for(auto file_info: file_info_list) - { - QString filename = file_info.absoluteFilePath(); - QString key = file_info.baseName(); - addIcon(key, key, filename); - } -} - -IconList::~IconList() -{ - delete d; - d = nullptr; -} - -QVariant IconList::data ( const QModelIndex& index, int role ) const -{ - if(!index.isValid()) - return QVariant(); - - int row = index.row(); - - if(row < 0 || row >= d->icons.size()) - return QVariant(); - - switch(role) - { - case Qt::DecorationRole: - return d->icons[row].icon; - case Qt::DisplayRole: - return d->icons[row].name; - case Qt::UserRole: - return d->icons[row].key; - default: - return QVariant(); - } -} - -int IconList::rowCount ( const QModelIndex& parent ) const -{ - return d->icons.size(); -} - -bool IconList::addIcon ( QString key, QString name, QString path, bool is_builtin ) -{ - auto iter = d->index.find(key); - if(iter != d->index.end()) - { - if(d->icons[*iter].is_builtin) return false; - - QIcon icon(path); - if(icon.isNull()) return false; - - // replace the icon - d->icons[*iter] = {key, name, icon, is_builtin}; - return true; - } - else - { - QIcon icon(path); - if(icon.isNull()) return false; - - // add a new icon - d->icons.push_back({key, name, icon, is_builtin}); - d->index[key] = d->icons.size() - 1; - return true; - } -} - - -QIcon IconList::getIcon ( QString key ) -{ - int icon_index = getIconIndex(key); - - if(icon_index != -1) - return d->icons[icon_index].icon; - - // Fallback for icons that don't exist. - icon_index = getIconIndex("infinity"); - - if(icon_index != -1) - return d->icons[icon_index].icon; - return QIcon(); -} - -int IconList::getIconIndex ( QString key ) -{ - if(key == "default") - key = "infinity"; - - auto iter = d->index.find(key); - if(iter != d->index.end()) - return *iter; - - - return -1; -} - - -void IconList::drop() -{ - mutex.lock(); - delete m_Instance; - m_Instance = 0; - mutex.unlock(); -} - -IconList* IconList::instance() -{ - if ( !m_Instance ) - { - mutex.lock(); - if ( !m_Instance ) - m_Instance = new IconList; - mutex.unlock(); - } - return m_Instance; -} - -#include "IconListModel.moc" \ No newline at end of file diff --git a/backend/IconListModel.h b/backend/IconListModel.h deleted file mode 100644 index 31b05e64..00000000 --- a/backend/IconListModel.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include -#include - -class Private; - -class IconList : public QAbstractListModel -{ -public: - static IconList* instance(); - static void drop(); - QIcon getIcon ( QString key ); - int getIconIndex ( QString key ); - - virtual QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const; - virtual int rowCount ( const QModelIndex& parent = QModelIndex() ) const; - - bool addIcon(QString key, QString name, QString path, bool is_builtin = false); - - -private: - virtual ~IconList(); - IconList(); - // hide copy constructor - IconList ( const IconList & ) = delete; - // hide assign op - IconList& operator= ( const IconList & ) = delete; - static IconList* m_Instance; - static QMutex mutex; - Private* d; -}; diff --git a/backend/InstanceFactory.cpp b/backend/InstanceFactory.cpp deleted file mode 100644 index f3511157..00000000 --- a/backend/InstanceFactory.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright 2013 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "InstanceFactory.h" - -#include -#include - -#include "BaseInstance.h" -#include "LegacyInstance.h" -#include "OneSixInstance.h" -#include "NostalgiaInstance.h" -#include "InstanceVersion.h" -#include "MinecraftVersion.h" - -#include "inifile.h" -#include -#include - -#include "pathutils.h" - -InstanceFactory InstanceFactory::loader; - -InstanceFactory::InstanceFactory() : - QObject(NULL) -{ - -} - -InstanceFactory::InstLoadError InstanceFactory::loadInstance(BaseInstance *&inst, const QString &instDir) -{ - auto m_settings = new INISettingsObject(PathCombine(instDir, "instance.cfg")); - - m_settings->registerSetting(new Setting("InstanceType", "Legacy")); - - QString inst_type = m_settings->get("InstanceType").toString(); - - //FIXME: replace with a map lookup, where instance classes register their types - if(inst_type == "Legacy") - { - inst = new LegacyInstance(instDir, m_settings, this); - } - else if(inst_type == "OneSix") - { - inst = new OneSixInstance(instDir, m_settings, this); - } - else if(inst_type == "Nostalgia") - { - inst = new NostalgiaInstance(instDir, m_settings, this); - } - else - { - return InstanceFactory::UnknownLoadError; - } - return NoLoadError; -} - - -InstanceFactory::InstCreateError InstanceFactory::createInstance( BaseInstance*& inst, InstVersionPtr version, const QString& instDir ) -{ - QDir rootDir(instDir); - - qDebug(instDir.toUtf8()); - if (!rootDir.exists() && !rootDir.mkpath(".")) - { - return InstanceFactory::CantCreateDir; - } - auto mcVer = version.dynamicCast(); - if(!mcVer) - return InstanceFactory::NoSuchVersion; - - auto m_settings = new INISettingsObject(PathCombine(instDir, "instance.cfg")); - m_settings->registerSetting(new Setting("InstanceType", "Legacy")); - - switch(mcVer->type) - { - case MinecraftVersion::Legacy: - m_settings->set("InstanceType", "Legacy"); - inst = new