summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/android
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2014-07-31 13:41:51 +0300
committerBogDan Vatra <bogdan@kde.org>2014-08-01 22:12:41 +0200
commitc0c80f14afba322179ac505816cdc51267b3a6ce (patch)
tree800ec29428c7eb372f2d4739057d7aadba52037d /src/3rdparty/android
parent61179c1447eb2b3fd43ca12d8b436cd73a0872a6 (diff)
Android: Fix exceptions in ExtractStyle.java on Android L
Android L adds support for 64 bit (arm and x86) and they did lots of changes that are incompatible with old implementation. Task-number: QTBUG-40120 Change-Id: I69b78a9eed896d2ddabc1bf2a55886faeae47974 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/3rdparty/android')
-rw-r--r--src/3rdparty/android/extract.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/3rdparty/android/extract.h b/src/3rdparty/android/extract.h
index f7928e20a8..938ef9abfd 100644
--- a/src/3rdparty/android/extract.h
+++ b/src/3rdparty/android/extract.h
@@ -114,4 +114,57 @@ struct Res_png_9patch
static Res_png_9patch* deserialize(const void* data);
};
+struct Res_png_9patch20
+{
+ Res_png_9patch20() : wasDeserialized(false), numXDivs(0), numYDivs(0), numColors(0), xDivsOffset(0),
+ yDivsOffset(0),paddingLeft(0), paddingRight(0), paddingTop(0), paddingBottom(0),
+ colorsOffset(0) { }
+
+ int8_t wasDeserialized;
+ int8_t numXDivs;
+ int8_t numYDivs;
+ int8_t numColors;
+
+ // The offset (from the start of this structure) to the xDivs & yDivs
+ // array for this 9patch. To get a pointer to this array, call
+ // getXDivs or getYDivs. Note that the serialized form for 9patches places
+ // the xDivs, yDivs and colors arrays immediately after the location
+ // of the Res_png_9patch struct.
+ uint32_t xDivsOffset;
+ uint32_t yDivsOffset;
+
+ int32_t paddingLeft, paddingRight;
+ int32_t paddingTop, paddingBottom;
+
+ enum {
+ // The 9 patch segment is not a solid color.
+ NO_COLOR = 0x00000001,
+
+ // The 9 patch segment is completely transparent.
+ TRANSPARENT_COLOR = 0x00000000
+ };
+
+ // The offset (from the start of this structure) to the colors array
+ // for this 9patch.
+ uint32_t colorsOffset;
+
+ // Deserialize/Unmarshall the patch data
+ static Res_png_9patch20* deserialize(void* data);
+
+ // These tell where the next section of a patch starts.
+ // For example, the first patch includes the pixels from
+ // 0 to xDivs[0]-1 and the second patch includes the pixels
+ // from xDivs[0] to xDivs[1]-1.
+ inline int32_t* getXDivs() const {
+ return reinterpret_cast<int32_t*>(reinterpret_cast<uintptr_t>(this) + xDivsOffset);
+ }
+ inline int32_t* getYDivs() const {
+ return reinterpret_cast<int32_t*>(reinterpret_cast<uintptr_t>(this) + yDivsOffset);
+ }
+ inline uint32_t* getColors() const {
+ return reinterpret_cast<uint32_t*>(reinterpret_cast<uintptr_t>(this) + colorsOffset);
+ }
+
+} __attribute__((packed));
+
#endif