You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.7 KiB
69 lines
1.7 KiB
|
15 years ago
|
|
||
|
15 years ago
|
#include "setup/LanguageEntry.hpp"
|
||
|
15 years ago
|
|
||
|
|
#include <sstream>
|
||
|
|
#include <iconv.h>
|
||
|
15 years ago
|
|
||
|
|
#include "util/LoadingUtils.hpp"
|
||
|
|
#include "util/Output.hpp"
|
||
|
15 years ago
|
|
||
|
|
void convert(iconv_t converter, const std::string & from, std::string & to);
|
||
|
|
|
||
|
|
void LanguageEntry::load(std::istream & is, const InnoVersion & version) {
|
||
|
|
|
||
|
15 years ago
|
if(version >= INNO_VERSION(4, 0, 0)) {
|
||
|
|
is >> EncodedString(name, version.codepage());
|
||
|
|
} else {
|
||
|
|
name = "default";
|
||
|
|
}
|
||
|
15 years ago
|
|
||
|
15 years ago
|
is >> EncodedString(languageName, (version >= INNO_VERSION(4, 2, 2)) ? 1200 : 1252);
|
||
|
15 years ago
|
|
||
|
15 years ago
|
is >> EncodedString(dialogFontName, version.codepage());
|
||
|
|
is >> EncodedString(titleFontName, version.codepage());
|
||
|
|
is >> EncodedString(welcomeFontName, version.codepage());
|
||
|
|
is >> EncodedString(copyrightFontName, version.codepage());
|
||
|
15 years ago
|
|
||
|
15 years ago
|
if(version >= INNO_VERSION(4, 0, 0)) {
|
||
|
|
is >> BinaryString(data);
|
||
|
|
}
|
||
|
15 years ago
|
|
||
|
|
if(version >= INNO_VERSION(4, 0, 1)) {
|
||
|
|
is >> AnsiString(licenseText);
|
||
|
|
is >> AnsiString(infoBeforeText);
|
||
|
|
is >> AnsiString(infoAfterText);
|
||
|
|
} else {
|
||
|
|
licenseText.clear(), infoBeforeText.clear(), infoAfterText.clear();
|
||
|
|
}
|
||
|
|
|
||
|
|
languageId = loadNumber<u32>(is);
|
||
|
|
|
||
|
|
if(version >= INNO_VERSION(4, 2, 2) && (version < INNO_VERSION(5, 3, 0) || !version.unicode)) {
|
||
|
15 years ago
|
codepage = loadNumber<u32>(is);
|
||
|
15 years ago
|
} else {
|
||
|
15 years ago
|
codepage = 0;
|
||
|
|
}
|
||
|
|
if(!codepage) {
|
||
|
|
codepage = version.codepage();
|
||
|
15 years ago
|
}
|
||
|
|
|
||
|
|
dialogFontSize = loadNumber<u32>(is);
|
||
|
|
|
||
|
|
if(version < INNO_VERSION(4, 1, 0)) {
|
||
|
|
dialogFontStandardHeight = loadNumber<u32>(is);
|
||
|
|
} else {
|
||
|
|
dialogFontStandardHeight = 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
titleFontSize = loadNumber<u32>(is);
|
||
|
|
welcomeFontSize = loadNumber<u32>(is);
|
||
|
|
copyrightFontSize = loadNumber<u32>(is);
|
||
|
|
|
||
|
|
if(version >= INNO_VERSION(5, 2, 3)) {
|
||
|
|
rightToLeft = ::load<u8>(is);
|
||
|
|
} else {
|
||
|
|
rightToLeft = false;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|