aboutsummaryrefslogtreecommitdiff
path: root/depends
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-08-17 13:40:51 +0200
committerPetr Mrázek <peterix@gmail.com>2013-08-17 13:40:51 +0200
commit253067c782955380bbf66ac0475dc954375b1ff4 (patch)
treeca97e231fd3a764256d95b5fc8d08fc25ff72161 /depends
parent77e80665422c4e97e2286418ab55e20c4030023b (diff)
downloadPrismLauncher-253067c782955380bbf66ac0475dc954375b1ff4.tar.gz
PrismLauncher-253067c782955380bbf66ac0475dc954375b1ff4.tar.bz2
PrismLauncher-253067c782955380bbf66ac0475dc954375b1ff4.zip
Move all the things (YES. Move them.)
Also, implemented some basic modlist logic, to be wired up.
Diffstat (limited to 'depends')
-rw-r--r--depends/classparser/CMakeLists.txt41
-rw-r--r--depends/classparser/include/classparser_config.h23
-rw-r--r--depends/classparser/include/javautils.h29
-rw-r--r--depends/classparser/src/annotations.cpp83
-rw-r--r--depends/classparser/src/annotations.h252
-rw-r--r--depends/classparser/src/classfile.h153
-rw-r--r--depends/classparser/src/constants.h212
-rw-r--r--depends/classparser/src/errors.h6
-rw-r--r--depends/classparser/src/javaendian.h62
-rw-r--r--depends/classparser/src/javautils.cpp81
-rw-r--r--depends/classparser/src/membuffer.h64
-rw-r--r--depends/groupview/CMakeLists.txt41
-rw-r--r--depends/groupview/include/categorizedsortfilterproxymodel.h175
-rw-r--r--depends/groupview/include/categorizedview.h332
-rw-r--r--depends/groupview/include/categorydrawer.h179
-rw-r--r--depends/groupview/include/groupview_config.h27
-rw-r--r--depends/groupview/src/categorizedsortfilterproxymodel.cpp168
-rw-r--r--depends/groupview/src/categorizedsortfilterproxymodel_p.h48
-rw-r--r--depends/groupview/src/categorizedview.cpp1713
-rw-r--r--depends/groupview/src/categorizedview_p.h159
-rw-r--r--depends/groupview/src/categorydrawer.cpp231
-rw-r--r--depends/launcher/CMakeLists.txt23
-rw-r--r--depends/launcher/MCFrame.java123
-rw-r--r--depends/launcher/MultiMCLauncher.java331
-rw-r--r--depends/launcher/UseJava.cmake881
-rw-r--r--depends/launcher/UseJavaClassFilelist.cmake52
-rw-r--r--depends/launcher/UseJavaSymlinks.cmake32
-rw-r--r--depends/launcher/net/minecraft/Launcher.java154
-rw-r--r--depends/launcher/org/simplericity/macify/eawt/Application.java176
-rw-r--r--depends/launcher/org/simplericity/macify/eawt/ApplicationAdapter.java48
-rw-r--r--depends/launcher/org/simplericity/macify/eawt/ApplicationEvent.java25
-rw-r--r--depends/launcher/org/simplericity/macify/eawt/ApplicationListener.java27
-rw-r--r--depends/launcher/org/simplericity/macify/eawt/DefaultApplication.java418
-rw-r--r--depends/patchlib/CMakeLists.txt14
-rw-r--r--depends/patchlib/LICENSE-bzip242
-rw-r--r--depends/patchlib/blocksort.c1095
-rw-r--r--depends/patchlib/bspatch.c303
-rw-r--r--depends/patchlib/bspatch.h27
-rw-r--r--depends/patchlib/bzlib.c1579
-rw-r--r--depends/patchlib/bzlib.h283
-rw-r--r--depends/patchlib/bzlib_private.h510
-rw-r--r--depends/patchlib/compress.c672
-rw-r--r--depends/patchlib/crctable.c104
-rw-r--r--depends/patchlib/decompress.c646
-rw-r--r--depends/patchlib/huffman.c205
-rw-r--r--depends/patchlib/randtable.c84
-rw-r--r--depends/quazip/CMakeLists.txt28
-rw-r--r--depends/quazip/JlCompress.cpp516
-rw-r--r--depends/quazip/JlCompress.h123
-rw-r--r--depends/quazip/crypt.h135
-rw-r--r--depends/quazip/ioapi.h77
-rw-r--r--depends/quazip/qioapi.cpp146
-rw-r--r--depends/quazip/quaadler32.cpp28
-rw-r--r--depends/quazip/quaadler32.h29
-rw-r--r--depends/quazip/quachecksum32.h54
-rw-r--r--depends/quazip/quacrc32.cpp28
-rw-r--r--depends/quazip/quacrc32.h26
-rw-r--r--depends/quazip/quagzipfile.cpp141
-rw-r--r--depends/quazip/quagzipfile.h35
-rw-r--r--depends/quazip/quaziodevice.cpp283
-rw-r--r--depends/quazip/quaziodevice.h27
-rw-r--r--depends/quazip/quazip.cpp554
-rw-r--r--depends/quazip/quazip.h411
-rw-r--r--depends/quazip/quazip_global.h55
-rw-r--r--depends/quazip/quazipdir.cpp507
-rw-r--r--depends/quazip/quazipdir.h171
-rw-r--r--depends/quazip/quazipfile.cpp488
-rw-r--r--depends/quazip/quazipfile.h442
-rw-r--r--depends/quazip/quazipfileinfo.h66
-rw-r--r--depends/quazip/quazipnewinfo.cpp51
-rw-r--r--depends/quazip/quazipnewinfo.h102
-rw-r--r--depends/quazip/unzip.c1603
-rw-r--r--depends/quazip/unzip.h356
-rw-r--r--depends/quazip/zip.c1281
-rw-r--r--depends/quazip/zip.h245
-rw-r--r--depends/settings/CMakeLists.txt51
-rw-r--r--depends/settings/include/basicsettingsobject.h44
-rw-r--r--depends/settings/include/inifile.h38
-rw-r--r--depends/settings/include/inisettingsobject.h60
-rw-r--r--depends/settings/include/keyring.h92
-rw-r--r--depends/settings/include/libsettings_config.h27
-rw-r--r--depends/settings/include/overridesetting.h43
-rw-r--r--depends/settings/include/setting.h114
-rw-r--r--depends/settings/include/settingsobject.h192
-rw-r--r--depends/settings/src/basicsettingsobject.cpp46
-rw-r--r--depends/settings/src/inifile.cpp86
-rw-r--r--depends/settings/src/inisettingsobject.cpp62
-rw-r--r--depends/settings/src/keyring.cpp63
-rw-r--r--depends/settings/src/overridesetting.cpp30
-rw-r--r--depends/settings/src/setting.cpp54
-rw-r--r--depends/settings/src/settingsobject.cpp144
-rw-r--r--depends/settings/src/stubkeyring.cpp104
-rw-r--r--depends/settings/src/stubkeyring.h41
-rw-r--r--depends/util/CMakeLists.txt51
-rw-r--r--depends/util/include/apputils.h21
-rw-r--r--depends/util/include/cmdutils.h259
-rw-r--r--depends/util/include/libutil_config.h27
-rw-r--r--depends/util/include/osutils.h29
-rw-r--r--depends/util/include/pathutils.h37
-rw-r--r--depends/util/include/siglist.h129
-rw-r--r--depends/util/include/siglist_impl.h156
-rw-r--r--depends/util/include/userutils.h19
-rw-r--r--depends/util/src/cmdutils.cpp484
-rw-r--r--depends/util/src/osutils.cpp19
-rw-r--r--depends/util/src/pathutils.cpp94
-rw-r--r--depends/util/src/userutils.cpp123
106 files changed, 22680 insertions, 0 deletions
diff --git a/depends/classparser/CMakeLists.txt b/depends/classparser/CMakeLists.txt
new file mode 100644
index 00000000..5a48e002
--- /dev/null
+++ b/depends/classparser/CMakeLists.txt
@@ -0,0 +1,41 @@
+project(classparser)
+
+set(CMAKE_AUTOMOC ON)
+
+# Find Qt
+find_package(Qt5Core REQUIRED)
+
+# Include Qt headers.
+include_directories(${Qt5Base_INCLUDE_DIRS})
+
+SET(CLASSPARSER_HEADERS
+include/classparser_config.h
+
+# Public headers
+include/javautils.h
+
+# Private headers
+src/annotations.h
+src/classfile.h
+src/constants.h
+src/errors.h
+src/javaendian.h
+src/membuffer.h
+)
+
+SET(CLASSPARSER_SOURCES
+src/javautils.cpp
+src/annotations.cpp
+)
+
+# Set the include dir path.
+SET(LIBGROUPVIEW_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
+
+# Include self.
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+include_directories(${CMAKE_BINARY_DIR}/include)
+
+add_definitions(-DCLASSPARSER_LIBRARY)
+
+add_library(classparser SHARED ${CLASSPARSER_SOURCES} ${CLASSPARSER_HEADERS})
+qt5_use_modules(classparser Core)
diff --git a/depends/classparser/include/classparser_config.h b/depends/classparser/include/classparser_config.h
new file mode 100644
index 00000000..fe6a2ab9
--- /dev/null
+++ b/depends/classparser/include/classparser_config.h
@@ -0,0 +1,23 @@
+/* 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 <QtCore/QtGlobal>
+
+#ifdef CLASSPARSER_LIBRARY
+# define CLASSPARSER_EXPORT Q_DECL_EXPORT
+#else
+# define CLASSPARSER_EXPORT Q_DECL_IMPORT
+#endif
+
diff --git a/depends/classparser/include/javautils.h b/depends/classparser/include/javautils.h
new file mode 100644
index 00000000..63e5ec26
--- /dev/null
+++ b/depends/classparser/include/javautils.h
@@ -0,0 +1,29 @@
+/* Copyright 2013 MultiMC Contributors
+ *
+ * Authors: Orochimarufan <orochimarufan.x3@gmail.com>
+ *
+ * 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 <QString>
+#include "classparser_config.h"
+
+#define MCVer_Unknown "Unknown"
+
+namespace javautils
+{
+ /**
+ * @brief Get the version from a minecraft.jar by parsing its class files. Expensive!
+ */
+ QString GetMinecraftJarVersion(QString jar);
+}
diff --git a/depends/classparser/src/annotations.cpp b/depends/classparser/src/annotations.cpp
new file mode 100644
index 00000000..fc0c98fa
--- /dev/null
+++ b/depends/classparser/src/annotations.cpp
@@ -0,0 +1,83 @@
+#include "classfile.h"
+#include "annotations.h"
+#include <sstream>
+
+namespace java
+{
+ std::string annotation::toString()
+ {
+ std::ostringstream ss;
+ ss << "Annotation type : " << type_index << " - " << pool[type_index].str_data << std::endl;
+ ss << "Contains " << name_val_pairs.size() << " pairs:" << std::endl;
+ for(unsigned i = 0; i < name_val_pairs.size(); i++)
+ {
+ std::pair<uint16_t, element_value *> &val = name_val_pairs[i];
+ auto name_idx = val.first;
+ ss << pool[name_idx].str_data << "(" << name_idx << ")" << " = " << val.second->toString() << std::endl;
+ }
+ return ss.str();
+ }
+
+ annotation * annotation::read (util::membuffer& input, constant_pool& pool)
+ {
+ uint16_t type_index = 0;
+ input.read_be(type_index);
+ annotation * ann = new annotation(type_index,pool);
+
+ uint16_t num_pairs = 0;
+ input.read_be(num_pairs);
+ while(num_pairs)
+ {
+ uint16_t name_idx = 0;
+ // read name index
+ input.read_be(name_idx);
+ auto elem = element_value::readElementValue(input,pool);
+ // read value
+ ann->add_pair(name_idx, elem);
+ num_pairs --;
+ }
+ return ann;
+ }
+
+ element_value* element_value::readElementValue ( util::membuffer& input, java::constant_pool& pool )
+ {
+ element_value_type type = INVALID;
+ input.read(type);
+ uint16_t index = 0;
+ uint16_t index2 = 0;
+ std::vector <element_value *> vals;
+ switch (type)
+ {
+ case PRIMITIVE_BYTE:
+ case PRIMITIVE_CHAR:
+ case PRIMITIVE_DOUBLE:
+ case PRIMITIVE_FLOAT:
+ case PRIMITIVE_INT:
+ case PRIMITIVE_LONG:
+ case PRIMITIVE_SHORT:
+ case PRIMITIVE_BOOLEAN:
+ case STRING:
+ input.read_be(index);
+ return new element_value_simple(type, index, pool);
+ case ENUM_CONSTANT:
+ input.read_be(index);
+ input.read_be(index2);
+ return new element_value_enum(type, index, index2, pool);
+ case CLASS: // Class
+ input.read_be(index);
+ return new element_value_class(type, index, pool);
+ case ANNOTATION: // Annotation
+ // FIXME: runtime visibility info needs to be passed from parent
+ return new element_value_annotation(ANNOTATION, annotation::read(input, pool), pool);
+ case ARRAY: // Array
+ input.read_be(index);
+ for (int i = 0; i < index; i++)
+ {
+ vals.push_back(element_value::readElementValue(input, pool));
+ }
+ return new element_value_array(ARRAY, vals, pool);
+ default:
+ throw new java::classfile_exception();
+ }
+ }
+} \ No newline at end of file
diff --git a/depends/classparser/src/annotations.h b/depends/classparser/src/annotations.h
new file mode 100644
index 00000000..b115dc0b
--- /dev/null
+++ b/depends/classparser/src/annotations.h
@@ -0,0 +1,252 @@
+#pragma once
+#include "classfile.h"
+#include <map>
+#include <vector>
+
+namespace java
+{
+ enum element_value_type : uint8_t
+ {
+ INVALID = 0,
+ STRING = 's',