gui: support string resources
storing strings in a map (for fast lookup) in resource manager
To define a string resource in <resources>:
<string name="foo">Hello</string>
To use a string, e.g.:
<text>%@foo%</text>
Not yet done: language-specific resources (should be solved not only for
strings, but for all kinds of resources - e.g. for localized images)
Change-Id: I3ba5cf5298c09e0d28a83973e9662f179271b33f
diff --git a/gui/resources.hpp b/gui/resources.hpp
index 83fc7a5..0ce9684 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -3,7 +3,11 @@
#ifndef _RESOURCE_HEADER
#define _RESOURCE_HEADER
-#include "../minzip/Zip.h"
+#include <string>
+#include <vector>
+#include <map>
+
+struct ZipArchive;
extern "C" {
#include "../minuitwrp/minui.h"
@@ -94,11 +98,13 @@
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;
private:
std::vector<FontResource*> mFonts;
std::vector<ImageResource*> mImages;
std::vector<AnimationResource*> mAnimations;
+ std::map<std::string, std::string> mStrings;
};
#endif // _RESOURCE_HEADER