From: Android (Google) Code Review Date: Wed, 22 Jul 2009 02:03:53 +0000 (-0700) Subject: am 9fc20b0e: Merge change 8126 into donut X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/9a85f8dc1a692abb68293f2586cfc5b35979f92a?hp=-c am 9fc20b0e: Merge change 8126 into donut Merge commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf' * commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf': First pass at reworking screen density/size APIs. --- 9a85f8dc1a692abb68293f2586cfc5b35979f92a diff --combined AaptAssets.h index e8c7395,63afe5c..5724349 --- a/AaptAssets.h +++ b/AaptAssets.h @@@ -15,7 -15,7 +15,7 @@@ #include #include #include -#include +#include "ZipFile.h" #include "Bundle.h" #include "SourcePos.h" @@@ -30,6 -30,8 +30,8 @@@ enum AXIS_MNC, AXIS_LANGUAGE, AXIS_REGION, + AXIS_SCREENLAYOUTSIZE, + AXIS_SCREENLAYOUTLONG, AXIS_ORIENTATION, AXIS_DENSITY, AXIS_TOUCHSCREEN, @@@ -37,7 -39,6 +39,6 @@@ AXIS_KEYBOARD, AXIS_NAVIGATION, AXIS_SCREENSIZE, - AXIS_SCREENLAYOUT, AXIS_VERSION }; @@@ -56,6 -57,8 +57,8 @@@ public String8 mnc; String8 locale; String8 vendor; + String8 screenLayoutSize; + String8 screenLayoutLong; String8 orientation; String8 density; String8 touchscreen; @@@ -63,7 -66,6 +66,6 @@@ String8 keyboard; String8 navigation; String8 screenSize; - String8 screenLayout; String8 version; bool initFromDirName(const char* dir, String8* resType); @@@ -73,6 -75,8 +75,8 @@@ 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); @@@ -80,7 -84,6 +84,6 @@@ static bool getKeyboardName(const char* name, ResTable_config* out = NULL); static bool getNavigationName(const char* name, ResTable_config* out = NULL); static bool getScreenSizeName(const char* name, ResTable_config* out = NULL); - static bool getScreenLayoutName(const char* name, ResTable_config* out = NULL); static bool getVersionName(const char* name, ResTable_config* out = NULL); int compare(const AaptGroupEntry& o) const; @@@ -128,9 -131,7 +131,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; } @@@ -446,13 -447,7 +449,13 @@@ private AaptSymbolEntry mDefSymbol; }; -class ResourceTypeSet; +class ResourceTypeSet : public RefBase, + public KeyedVector > +{ +public: + ResourceTypeSet(); +}; + /** * Asset hierarchy being operated on. @@@ -460,8 -455,8 +463,8 @@@ 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; } @@@ -509,7 -504,7 +512,7 @@@ inline KeyedVector >* getResources() { return mRes; } inline void - setResources(KeyedVector >* res) { mRes = res; } + setResources(KeyedVector >* res) { delete mRes; mRes = res; } private: String8 mPackage;