]> git.saurik.com Git - android/aapt.git/commitdiff
am 9fc20b0e: Merge change 8126 into donut
authorAndroid (Google) Code Review <android-gerrit@google.com>
Wed, 22 Jul 2009 02:03:53 +0000 (19:03 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Wed, 22 Jul 2009 02:03:53 +0000 (19:03 -0700)
Merge commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf'

* commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf':
  First pass at reworking screen density/size APIs.

1  2 
AaptAssets.h

diff --combined AaptAssets.h
index e8c739558a6bdafae088090b6732c3a31e3770e1,63afe5ce174e6f80a8f1986c1e57277ffc40de3c..57243496f12d8ec3494aea623b5295c9ebdb0f29
@@@ -15,7 -15,7 +15,7 @@@
  #include <utils/String8.h>
  #include <utils/Vector.h>
  #include <utils/RefBase.h>
 -#include <utils/ZipFile.h>
 +#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<String8,sp<AaptGroup> >
 +{
 +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; }
      
      inline KeyedVector<String8, sp<ResourceTypeSet> >* getResources() { return mRes; }
      inline void 
 -        setResources(KeyedVector<String8, sp<ResourceTypeSet> >* res) { mRes = res; }
 +        setResources(KeyedVector<String8, sp<ResourceTypeSet> >* res) { delete mRes; mRes = res; }
  
  private:
      String8 mPackage;