X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/dadd9c1fc18bd05c84a357b56e945b5829b3bd95..30275038bb13ac252ffe19c89f9f8a5526541f0f:/AaptAssets.h diff --git a/AaptAssets.h b/AaptAssets.h index 6ab0ae5..26500a3 100644 --- a/AaptAssets.h +++ b/AaptAssets.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include "ZipFile.h" #include "Bundle.h" #include "SourcePos.h" @@ -30,11 +30,14 @@ enum { AXIS_MNC, AXIS_LANGUAGE, AXIS_REGION, + AXIS_SCREENLAYOUTSIZE, + AXIS_SCREENLAYOUTLONG, AXIS_ORIENTATION, AXIS_DENSITY, AXIS_TOUCHSCREEN, AXIS_KEYSHIDDEN, AXIS_KEYBOARD, + AXIS_NAVHIDDEN, AXIS_NAVIGATION, AXIS_SCREENSIZE, AXIS_VERSION @@ -55,11 +58,14 @@ public: String8 mnc; String8 locale; String8 vendor; + String8 screenLayoutSize; + String8 screenLayoutLong; String8 orientation; String8 density; String8 touchscreen; String8 keysHidden; String8 keyboard; + String8 navHidden; String8 navigation; String8 screenSize; String8 version; @@ -71,12 +77,15 @@ public: static bool getMccName(const char* name, ResTable_config* out = NULL); static bool getMncName(const char* name, ResTable_config* out = NULL); static bool getLocaleName(const char* name, ResTable_config* out = NULL); + static bool getScreenLayoutSizeName(const char* name, ResTable_config* out = NULL); + static bool getScreenLayoutLongName(const char* name, ResTable_config* out = NULL); static bool getOrientationName(const char* name, ResTable_config* out = NULL); static bool getDensityName(const char* name, ResTable_config* out = NULL); static bool getTouchscreenName(const char* name, ResTable_config* out = NULL); static bool getKeysHiddenName(const char* name, ResTable_config* out = NULL); static bool getKeyboardName(const char* name, ResTable_config* out = NULL); static bool getNavigationName(const char* name, ResTable_config* out = NULL); + static bool getNavHiddenName(const char* name, ResTable_config* out = NULL); static bool getScreenSizeName(const char* name, ResTable_config* out = NULL); static bool getVersionName(const char* name, ResTable_config* out = NULL); @@ -125,7 +134,9 @@ public: { //printf("new AaptFile created %s\n", (const char*)sourceFile); } - virtual ~AaptFile() { } + virtual ~AaptFile() { + free(mData); + } const String8& getPath() const { return mPath; } const AaptGroupEntry& getGroupEntry() const { return mGroupEntry; } @@ -441,14 +452,22 @@ private: AaptSymbolEntry mDefSymbol; }; +class ResourceTypeSet : public RefBase, + public KeyedVector > +{ +public: + ResourceTypeSet(); +}; + + /** * Asset hierarchy being operated on. */ class AaptAssets : public AaptDir { public: - AaptAssets() : AaptDir(String8(), String8()), mHaveIncludedAssets(false) { } - virtual ~AaptAssets() { } + AaptAssets() : AaptDir(String8(), String8()), mHaveIncludedAssets(false), mRes(NULL) { } + virtual ~AaptAssets() { delete mRes; } const String8& getPackage() const { return mPackage; } void setPackage(const String8& package) { mPackage = package; mSymbolsPrivatePackage = package; } @@ -466,6 +485,8 @@ public: const sp& file, const String8& resType); + void addGroupEntry(const AaptGroupEntry& entry) { mGroupEntries.add(entry); } + ssize_t slurpFromArgs(Bundle* bundle); virtual ssize_t slurpFullTree(Bundle* bundle, @@ -490,6 +511,14 @@ public: void print() const; inline const Vector >& resDirs() { return mDirs; } + sp resDir(const String8& name); + + inline sp getOverlay() { return mOverlay; } + inline void setOverlay(sp& overlay) { mOverlay = overlay; } + + inline KeyedVector >* getResources() { return mRes; } + inline void + setResources(KeyedVector >* res) { delete mRes; mRes = res; } private: String8 mPackage; @@ -501,6 +530,9 @@ private: bool mHaveIncludedAssets; AssetManager mIncludedAssets; + + sp mOverlay; + KeyedVector >* mRes; }; #endif // __AAPT_ASSETS_H