diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2015-10-28 18:44:49 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2015-12-19 15:31:01 +0100 |
commit | 74db157b9406594a549a70415668dd6cbe17d1d3 (patch) | |
tree | d47451181a77cc1b03a55d63d49a9fecc98eb044 /gui/pages.hpp | |
parent | gui: stock theme rework (diff) | |
download | android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.tar android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.tar.gz android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.tar.bz2 android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.tar.lz android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.tar.xz android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.tar.zst android_bootable_recovery-74db157b9406594a549a70415668dd6cbe17d1d3.zip |
Diffstat (limited to 'gui/pages.hpp')
-rw-r--r-- | gui/pages.hpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gui/pages.hpp b/gui/pages.hpp index 018c2cab2..5dcc9e0b5 100644 --- a/gui/pages.hpp +++ b/gui/pages.hpp @@ -6,7 +6,9 @@ #include "../minzip/Zip.h" #include <vector> #include <map> +#include <string> #include "rapidxml.hpp" +#include "gui.hpp" using namespace rapidxml; enum TOUCH_STATE { @@ -27,12 +29,18 @@ struct COLOR { : red(r), green(g), blue(b), alpha(a) {} }; +struct language_struct { + std::string filename; + std::string displayvalue; +}; + +extern std::vector<language_struct> Language_List; + // Utility Functions int ConvertStrToColor(std::string str, COLOR* color); int gui_forceRender(void); int gui_changePage(std::string newPage); int gui_changeOverlay(std::string newPage); -std::string gui_parse_text(string inText); class Resource; class ResourceManager; @@ -82,7 +90,8 @@ public: virtual ~PageSet(); public: - int Load(ZipArchive* package, char* xmlFile); + int LoadLanguage(char* languageFile, ZipArchive* package); + int Load(ZipArchive* package, char* xmlFile, char* languageFile); int CheckInclude(ZipArchive* package, xml_document<> *parentDoc); Page* FindPage(std::string name); @@ -103,6 +112,7 @@ public: int NotifyVarChange(std::string varName, std::string value); std::vector<xml_node<>*> styles; + void AddStringResource(std::string resource_source, std::string resource_name, std::string value); protected: int LoadPages(xml_node<>* pages); @@ -121,6 +131,8 @@ class PageManager public: // Used by GUI static char* LoadFileToBuffer(std::string filename, ZipArchive* package); + static void LoadLanguageList(ZipArchive* package); + static void LoadLanguage(std::string filename); static int LoadPackage(std::string name, std::string package, std::string startpage); static PageSet* SelectPackage(std::string name); static int ReloadPackage(std::string name, std::string package); @@ -155,9 +167,14 @@ public: static HardwareKeyboard *GetHardwareKeyboard(); static xml_node<>* FindStyle(std::string name); + static void AddStringResource(std::string resource_source, std::string resource_name, std::string value); protected: static PageSet* FindPackage(std::string name); + static void LoadLanguageListDir(std::string dir); + static void Translate_Partition(const char* path, const char* resource_name, const char* default_value); + static void Translate_Partition(const char* path, const char* resource_name, const char* default_value, const char* storage_resource_name, const char* storage_default_value); + static void Translate_Partition_Display_Names(); protected: static std::map<std::string, PageSet*> mPageSets; |