summaryrefslogtreecommitdiffstats
path: root/gui/resources.hpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-10-28 18:44:49 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-12-19 15:31:01 +0100
commit74db157b9406594a549a70415668dd6cbe17d1d3 (patch)
treed47451181a77cc1b03a55d63d49a9fecc98eb044 /gui/resources.hpp
parentgui: stock theme rework (diff)
downloadandroid_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/resources.hpp')
-rw-r--r--gui/resources.hpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/gui/resources.hpp b/gui/resources.hpp
index 0eb32674d..ce06d9679 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -6,6 +6,7 @@
#include <string>
#include <vector>
#include <map>
+#include "rapidxml.hpp"
struct ZipArchive;
@@ -49,10 +50,19 @@ public:
public:
void* GetResource() { return this ? mFont : NULL; }
int GetHeight() { return gr_getMaxFontHeight(this ? mFont : NULL); }
+ void Override(xml_node<>* node, ZipArchive* pZip);
protected:
void* mFont;
Type m_type;
+
+private:
+ void LoadFont(xml_node<>* node, ZipArchive* pZip);
+ void DeleteFont();
+
+private:
+ int origFontSize;
+ void* origFont;
};
class ImageResource : public Resource
@@ -92,19 +102,26 @@ class ResourceManager
public:
ResourceManager();
virtual ~ResourceManager();
- void LoadResources(xml_node<>* resList, ZipArchive* pZip);
+ void AddStringResource(std::string resource_source, std::string resource_name, std::string value);
+ void LoadResources(xml_node<>* resList, ZipArchive* pZip, std::string resource_source);
public:
FontResource* FindFont(const std::string& name) const;
ImageResource* FindImage(const std::string& name) const;
AnimationResource* FindAnimation(const std::string& name) const;
std::string FindString(const std::string& name) const;
+ std::string FindString(const std::string& name, const std::string& default_string) const;
+ void DumpStrings() const;
private:
+ struct string_resource_struct {
+ std::string value;
+ std::string source;
+ };
std::vector<FontResource*> mFonts;
std::vector<ImageResource*> mImages;
std::vector<AnimationResource*> mAnimations;
- std::map<std::string, std::string> mStrings;
+ std::map<std::string, string_resource_struct> mStrings;
};
#endif // _RESOURCE_HEADER