| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkPdfNativeObject_DEFINED | 8 #ifndef SkPdfNativeObject_DEFINED |
| 9 #define SkPdfNativeObject_DEFINED | 9 #define SkPdfNativeObject_DEFINED |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 SkMatrix SkMatrixFromPdfMatrix(double array[6]); | 31 SkMatrix SkMatrixFromPdfMatrix(double array[6]); |
| 32 | 32 |
| 33 | 33 |
| 34 #define kFilteredStreamBit 0 | 34 #define kFilteredStreamBit 0 |
| 35 #define kUnfilteredStreamBit 1 | 35 #define kUnfilteredStreamBit 1 |
| 36 #define kOwnedStreamBit 2 | 36 #define kOwnedStreamBit 2 |
| 37 | 37 |
| 38 class SkPdfNativeObject { | 38 class SkPdfNativeObject { |
| 39 public: | 39 public: |
| 40 enum ObjectType { | 40 enum ObjectType { |
| 41 kInvalid_PdfObjectType, | 41 // The type will have only one of these values, but for error reporting
, we make it an enum |
| 42 // so it can easily report that something was expected to be one of a f
ew types |
| 43 kInvalid_PdfObjectType = 1 << 1, |
| 42 | 44 |
| 43 kBoolean_PdfObjectType, | 45 kBoolean_PdfObjectType = 1 << 2, |
| 44 kInteger_PdfObjectType, | 46 kInteger_PdfObjectType = 1 << 3, |
| 45 kReal_PdfObjectType, | 47 kReal_PdfObjectType = 1 << 4, |
| 46 kString_PdfObjectType, | 48 _kNumber_PdfObjectType = kInteger_PdfObjectType | kReal_PdfObjectType, |
| 47 kHexString_PdfObjectType, | 49 kString_PdfObjectType = 1 << 5, |
| 48 kName_PdfObjectType, | 50 kHexString_PdfObjectType = 1 << 6, |
| 49 kKeyword_PdfObjectType, | 51 _kAnyString_PdfObjectType = kString_PdfObjectType | kHexString_PdfObjec
tType, |
| 50 //kStream_PdfObjectType, // attached to a Dictionary | 52 kName_PdfObjectType = 1 << 7, |
| 51 kArray_PdfObjectType, | 53 kKeyword_PdfObjectType = 1 << 8, |
| 52 kDictionary_PdfObjectType, | 54 _kStream_PdfObjectType = 1 << 9, // attached to a Dictionary, do not
use |
| 53 kNull_PdfObjectType, | 55 kArray_PdfObjectType = 1 << 10, |
| 56 kDictionary_PdfObjectType = 1 << 11, |
| 57 kNull_PdfObjectType = 1 << 12, |
| 54 | 58 |
| 55 // TODO(edisonn): after the pdf has been loaded completely, resolve all
references | 59 // TODO(edisonn): after the pdf has been loaded completely, resolve all
references |
| 56 // try the same thing with delayed loaded ... | 60 // try the same thing with delayed loaded ... |
| 57 kReference_PdfObjectType, | 61 kReference_PdfObjectType = 1 << 13, |
| 58 | 62 |
| 59 kUndefined_PdfObjectType, // per 1.4 spec, if the same key appear twic
e in the dictionary, the value is undefined | 63 kUndefined_PdfObjectType = 1 << 14, // per 1.4 spec, if the same key a
ppear twice in the dictionary, the value is undefined |
| 64 |
| 65 _kObject_PdfObjectType = -1, |
| 60 }; | 66 }; |
| 61 | 67 |
| 62 enum DataType { | 68 enum DataType { |
| 63 kEmpty_Data, | 69 kEmpty_Data, |
| 64 kFont_Data, | 70 kFont_Data, |
| 65 kBitmap_Data, | 71 kBitmap_Data, |
| 66 }; | 72 }; |
| 67 | 73 |
| 68 private: | 74 private: |
| 69 // TODO(edisonn): assert reset operations while in rendering! | 75 // TODO(edisonn): assert reset operations while in rendering! |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 SkPdfName() : SkPdfNativeObject() { | 1230 SkPdfName() : SkPdfNativeObject() { |
| 1225 SkPdfNativeObject::makeName((const unsigned char*)"", this PUT_TRACK_PAR
AMETERS_SRC); | 1231 SkPdfNativeObject::makeName((const unsigned char*)"", this PUT_TRACK_PAR
AMETERS_SRC); |
| 1226 } | 1232 } |
| 1227 public: | 1233 public: |
| 1228 SkPdfName(char* name) : SkPdfNativeObject() { | 1234 SkPdfName(char* name) : SkPdfNativeObject() { |
| 1229 this->makeName((const unsigned char*)name, this PUT_TRACK_PARAMETERS_SRC
); | 1235 this->makeName((const unsigned char*)name, this PUT_TRACK_PARAMETERS_SRC
); |
| 1230 } | 1236 } |
| 1231 }; | 1237 }; |
| 1232 | 1238 |
| 1233 #endif // SkPdfNativeObject | 1239 #endif // SkPdfNativeObject |
| OLD | NEW |