OLD | NEW |
(Empty) | |
| 1 #include "SkPdfGraphicsStateDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 SkString SkPdfGraphicsStateDictionary::Type(SkPdfNativeDoc* doc) { |
| 6 SkPdfNativeObject* ret = get("Type", ""); |
| 7 if (doc) {ret = doc->resolveReference(ret);} |
| 8 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 9 // TODO(edisonn): warn about missing default value for optional fields |
| 10 return SkString(); |
| 11 } |
| 12 |
| 13 bool SkPdfGraphicsStateDictionary::has_Type() const { |
| 14 return get("Type", "") != NULL; |
| 15 } |
| 16 |
| 17 double SkPdfGraphicsStateDictionary::LW(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("LW", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); |
| 21 // TODO(edisonn): warn about missing default value for optional fields |
| 22 return 0; |
| 23 } |
| 24 |
| 25 bool SkPdfGraphicsStateDictionary::has_LW() const { |
| 26 return get("LW", "") != NULL; |
| 27 } |
| 28 |
| 29 int64_t SkPdfGraphicsStateDictionary::LC(SkPdfNativeDoc* doc) { |
| 30 SkPdfNativeObject* ret = get("LC", ""); |
| 31 if (doc) {ret = doc->resolveReference(ret);} |
| 32 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 33 // TODO(edisonn): warn about missing default value for optional fields |
| 34 return 0; |
| 35 } |
| 36 |
| 37 bool SkPdfGraphicsStateDictionary::has_LC() const { |
| 38 return get("LC", "") != NULL; |
| 39 } |
| 40 |
| 41 int64_t SkPdfGraphicsStateDictionary::LJ(SkPdfNativeDoc* doc) { |
| 42 SkPdfNativeObject* ret = get("LJ", ""); |
| 43 if (doc) {ret = doc->resolveReference(ret);} |
| 44 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 45 // TODO(edisonn): warn about missing default value for optional fields |
| 46 return 0; |
| 47 } |
| 48 |
| 49 bool SkPdfGraphicsStateDictionary::has_LJ() const { |
| 50 return get("LJ", "") != NULL; |
| 51 } |
| 52 |
| 53 double SkPdfGraphicsStateDictionary::ML(SkPdfNativeDoc* doc) { |
| 54 SkPdfNativeObject* ret = get("ML", ""); |
| 55 if (doc) {ret = doc->resolveReference(ret);} |
| 56 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); |
| 57 // TODO(edisonn): warn about missing default value for optional fields |
| 58 return 0; |
| 59 } |
| 60 |
| 61 bool SkPdfGraphicsStateDictionary::has_ML() const { |
| 62 return get("ML", "") != NULL; |
| 63 } |
| 64 |
| 65 SkPdfArray* SkPdfGraphicsStateDictionary::D(SkPdfNativeDoc* doc) { |
| 66 SkPdfNativeObject* ret = get("D", ""); |
| 67 if (doc) {ret = doc->resolveReference(ret);} |
| 68 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 69 // TODO(edisonn): warn about missing default value for optional fields |
| 70 return NULL; |
| 71 } |
| 72 |
| 73 bool SkPdfGraphicsStateDictionary::has_D() const { |
| 74 return get("D", "") != NULL; |
| 75 } |
| 76 |
| 77 SkString SkPdfGraphicsStateDictionary::RI(SkPdfNativeDoc* doc) { |
| 78 SkPdfNativeObject* ret = get("RI", ""); |
| 79 if (doc) {ret = doc->resolveReference(ret);} |
| 80 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 81 // TODO(edisonn): warn about missing default value for optional fields |
| 82 return SkString(); |
| 83 } |
| 84 |
| 85 bool SkPdfGraphicsStateDictionary::has_RI() const { |
| 86 return get("RI", "") != NULL; |
| 87 } |
| 88 |
| 89 bool SkPdfGraphicsStateDictionary::OP(SkPdfNativeDoc* doc) { |
| 90 SkPdfNativeObject* ret = get("OP", ""); |
| 91 if (doc) {ret = doc->resolveReference(ret);} |
| 92 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
| 93 // TODO(edisonn): warn about missing default value for optional fields |
| 94 return false; |
| 95 } |
| 96 |
| 97 bool SkPdfGraphicsStateDictionary::has_OP() const { |
| 98 return get("OP", "") != NULL; |
| 99 } |
| 100 |
| 101 bool SkPdfGraphicsStateDictionary::op(SkPdfNativeDoc* doc) { |
| 102 SkPdfNativeObject* ret = get("op", ""); |
| 103 if (doc) {ret = doc->resolveReference(ret);} |
| 104 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
| 105 // TODO(edisonn): warn about missing default value for optional fields |
| 106 return false; |
| 107 } |
| 108 |
| 109 bool SkPdfGraphicsStateDictionary::has_op() const { |
| 110 return get("op", "") != NULL; |
| 111 } |
| 112 |
| 113 int64_t SkPdfGraphicsStateDictionary::OPM(SkPdfNativeDoc* doc) { |
| 114 SkPdfNativeObject* ret = get("OPM", ""); |
| 115 if (doc) {ret = doc->resolveReference(ret);} |
| 116 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 117 // TODO(edisonn): warn about missing default value for optional fields |
| 118 return 0; |
| 119 } |
| 120 |
| 121 bool SkPdfGraphicsStateDictionary::has_OPM() const { |
| 122 return get("OPM", "") != NULL; |
| 123 } |
| 124 |
| 125 SkPdfArray* SkPdfGraphicsStateDictionary::Font(SkPdfNativeDoc* doc) { |
| 126 SkPdfNativeObject* ret = get("Font", ""); |
| 127 if (doc) {ret = doc->resolveReference(ret);} |
| 128 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 129 // TODO(edisonn): warn about missing default value for optional fields |
| 130 return NULL; |
| 131 } |
| 132 |
| 133 bool SkPdfGraphicsStateDictionary::has_Font() const { |
| 134 return get("Font", "") != NULL; |
| 135 } |
| 136 |
| 137 SkPdfFunction SkPdfGraphicsStateDictionary::BG(SkPdfNativeDoc* doc) { |
| 138 SkPdfNativeObject* ret = get("BG", ""); |
| 139 if (doc) {ret = doc->resolveReference(ret);} |
| 140 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); |
| 141 // TODO(edisonn): warn about missing default value for optional fields |
| 142 return SkPdfFunction(); |
| 143 } |
| 144 |
| 145 bool SkPdfGraphicsStateDictionary::has_BG() const { |
| 146 return get("BG", "") != NULL; |
| 147 } |
| 148 |
| 149 bool SkPdfGraphicsStateDictionary::isBG2AFunction(SkPdfNativeDoc* doc) { |
| 150 SkPdfNativeObject* ret = get("BG2", ""); |
| 151 if (doc) {ret = doc->resolveReference(ret);} |
| 152 return ret != NULL && ret->isFunction(); |
| 153 } |
| 154 |
| 155 SkPdfFunction SkPdfGraphicsStateDictionary::getBG2AsFunction(SkPdfNativeDoc* doc
) { |
| 156 SkPdfNativeObject* ret = get("BG2", ""); |
| 157 if (doc) {ret = doc->resolveReference(ret);} |
| 158 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); |
| 159 // TODO(edisonn): warn about missing default value for optional fields |
| 160 return SkPdfFunction(); |
| 161 } |
| 162 |
| 163 bool SkPdfGraphicsStateDictionary::isBG2AName(SkPdfNativeDoc* doc) { |
| 164 SkPdfNativeObject* ret = get("BG2", ""); |
| 165 if (doc) {ret = doc->resolveReference(ret);} |
| 166 return ret != NULL && ret->isName(); |
| 167 } |
| 168 |
| 169 SkString SkPdfGraphicsStateDictionary::getBG2AsName(SkPdfNativeDoc* doc) { |
| 170 SkPdfNativeObject* ret = get("BG2", ""); |
| 171 if (doc) {ret = doc->resolveReference(ret);} |
| 172 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 173 // TODO(edisonn): warn about missing default value for optional fields |
| 174 return SkString(); |
| 175 } |
| 176 |
| 177 bool SkPdfGraphicsStateDictionary::has_BG2() const { |
| 178 return get("BG2", "") != NULL; |
| 179 } |
| 180 |
| 181 SkPdfFunction SkPdfGraphicsStateDictionary::UCR(SkPdfNativeDoc* doc) { |
| 182 SkPdfNativeObject* ret = get("UCR", ""); |
| 183 if (doc) {ret = doc->resolveReference(ret);} |
| 184 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); |
| 185 // TODO(edisonn): warn about missing default value for optional fields |
| 186 return SkPdfFunction(); |
| 187 } |
| 188 |
| 189 bool SkPdfGraphicsStateDictionary::has_UCR() const { |
| 190 return get("UCR", "") != NULL; |
| 191 } |
| 192 |
| 193 bool SkPdfGraphicsStateDictionary::isUCR2AFunction(SkPdfNativeDoc* doc) { |
| 194 SkPdfNativeObject* ret = get("UCR2", ""); |
| 195 if (doc) {ret = doc->resolveReference(ret);} |
| 196 return ret != NULL && ret->isFunction(); |
| 197 } |
| 198 |
| 199 SkPdfFunction SkPdfGraphicsStateDictionary::getUCR2AsFunction(SkPdfNativeDoc* do
c) { |
| 200 SkPdfNativeObject* ret = get("UCR2", ""); |
| 201 if (doc) {ret = doc->resolveReference(ret);} |
| 202 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); |
| 203 // TODO(edisonn): warn about missing default value for optional fields |
| 204 return SkPdfFunction(); |
| 205 } |
| 206 |
| 207 bool SkPdfGraphicsStateDictionary::isUCR2AName(SkPdfNativeDoc* doc) { |
| 208 SkPdfNativeObject* ret = get("UCR2", ""); |
| 209 if (doc) {ret = doc->resolveReference(ret);} |
| 210 return ret != NULL && ret->isName(); |
| 211 } |
| 212 |
| 213 SkString SkPdfGraphicsStateDictionary::getUCR2AsName(SkPdfNativeDoc* doc) { |
| 214 SkPdfNativeObject* ret = get("UCR2", ""); |
| 215 if (doc) {ret = doc->resolveReference(ret);} |
| 216 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 217 // TODO(edisonn): warn about missing default value for optional fields |
| 218 return SkString(); |
| 219 } |
| 220 |
| 221 bool SkPdfGraphicsStateDictionary::has_UCR2() const { |
| 222 return get("UCR2", "") != NULL; |
| 223 } |
| 224 |
| 225 bool SkPdfGraphicsStateDictionary::isTRAFunction(SkPdfNativeDoc* doc) { |
| 226 SkPdfNativeObject* ret = get("TR", ""); |
| 227 if (doc) {ret = doc->resolveReference(ret);} |
| 228 return ret != NULL && ret->isFunction(); |
| 229 } |
| 230 |
| 231 SkPdfFunction SkPdfGraphicsStateDictionary::getTRAsFunction(SkPdfNativeDoc* doc)
{ |
| 232 SkPdfNativeObject* ret = get("TR", ""); |
| 233 if (doc) {ret = doc->resolveReference(ret);} |
| 234 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); |
| 235 // TODO(edisonn): warn about missing default value for optional fields |
| 236 return SkPdfFunction(); |
| 237 } |
| 238 |
| 239 bool SkPdfGraphicsStateDictionary::isTRAArray(SkPdfNativeDoc* doc) { |
| 240 SkPdfNativeObject* ret = get("TR", ""); |
| 241 if (doc) {ret = doc->resolveReference(ret);} |
| 242 return ret != NULL && ret->isArray(); |
| 243 } |
| 244 |
| 245 SkPdfArray* SkPdfGraphicsStateDictionary::getTRAsArray(SkPdfNativeDoc* doc) { |
| 246 SkPdfNativeObject* ret = get("TR", ""); |
| 247 if (doc) {ret = doc->resolveReference(ret);} |
| 248 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 249 // TODO(edisonn): warn about missing default value for optional fields |
| 250 return NULL; |
| 251 } |
| 252 |
| 253 bool SkPdfGraphicsStateDictionary::isTRAName(SkPdfNativeDoc* doc) { |
| 254 SkPdfNativeObject* ret = get("TR", ""); |
| 255 if (doc) {ret = doc->resolveReference(ret);} |
| 256 return ret != NULL && ret->isName(); |
| 257 } |
| 258 |
| 259 SkString SkPdfGraphicsStateDictionary::getTRAsName(SkPdfNativeDoc* doc) { |
| 260 SkPdfNativeObject* ret = get("TR", ""); |
| 261 if (doc) {ret = doc->resolveReference(ret);} |
| 262 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 263 // TODO(edisonn): warn about missing default value for optional fields |
| 264 return SkString(); |
| 265 } |
| 266 |
| 267 bool SkPdfGraphicsStateDictionary::has_TR() const { |
| 268 return get("TR", "") != NULL; |
| 269 } |
| 270 |
| 271 bool SkPdfGraphicsStateDictionary::isTR2AFunction(SkPdfNativeDoc* doc) { |
| 272 SkPdfNativeObject* ret = get("TR2", ""); |
| 273 if (doc) {ret = doc->resolveReference(ret);} |
| 274 return ret != NULL && ret->isFunction(); |
| 275 } |
| 276 |
| 277 SkPdfFunction SkPdfGraphicsStateDictionary::getTR2AsFunction(SkPdfNativeDoc* doc
) { |
| 278 SkPdfNativeObject* ret = get("TR2", ""); |
| 279 if (doc) {ret = doc->resolveReference(ret);} |
| 280 if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->
isReference())) return ret->functionValue(); |
| 281 // TODO(edisonn): warn about missing default value for optional fields |
| 282 return SkPdfFunction(); |
| 283 } |
| 284 |
| 285 bool SkPdfGraphicsStateDictionary::isTR2AArray(SkPdfNativeDoc* doc) { |
| 286 SkPdfNativeObject* ret = get("TR2", ""); |
| 287 if (doc) {ret = doc->resolveReference(ret);} |
| 288 return ret != NULL && ret->isArray(); |
| 289 } |
| 290 |
| 291 SkPdfArray* SkPdfGraphicsStateDictionary::getTR2AsArray(SkPdfNativeDoc* doc) { |
| 292 SkPdfNativeObject* ret = get("TR2", ""); |
| 293 if (doc) {ret = doc->resolveReference(ret);} |
| 294 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 295 // TODO(edisonn): warn about missing default value for optional fields |
| 296 return NULL; |
| 297 } |
| 298 |
| 299 bool SkPdfGraphicsStateDictionary::isTR2AName(SkPdfNativeDoc* doc) { |
| 300 SkPdfNativeObject* ret = get("TR2", ""); |
| 301 if (doc) {ret = doc->resolveReference(ret);} |
| 302 return ret != NULL && ret->isName(); |
| 303 } |
| 304 |
| 305 SkString SkPdfGraphicsStateDictionary::getTR2AsName(SkPdfNativeDoc* doc) { |
| 306 SkPdfNativeObject* ret = get("TR2", ""); |
| 307 if (doc) {ret = doc->resolveReference(ret);} |
| 308 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 309 // TODO(edisonn): warn about missing default value for optional fields |
| 310 return SkString(); |
| 311 } |
| 312 |
| 313 bool SkPdfGraphicsStateDictionary::has_TR2() const { |
| 314 return get("TR2", "") != NULL; |
| 315 } |
| 316 |
| 317 bool SkPdfGraphicsStateDictionary::isHTADictionary(SkPdfNativeDoc* doc) { |
| 318 SkPdfNativeObject* ret = get("HT", ""); |
| 319 if (doc) {ret = doc->resolveReference(ret);} |
| 320 return ret != NULL && ret->isDictionary(); |
| 321 } |
| 322 |
| 323 SkPdfDictionary* SkPdfGraphicsStateDictionary::getHTAsDictionary(SkPdfNativeDoc*
doc) { |
| 324 SkPdfNativeObject* ret = get("HT", ""); |
| 325 if (doc) {ret = doc->resolveReference(ret);} |
| 326 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; |
| 327 // TODO(edisonn): warn about missing default value for optional fields |
| 328 return NULL; |
| 329 } |
| 330 |
| 331 bool SkPdfGraphicsStateDictionary::isHTAStream(SkPdfNativeDoc* doc) { |
| 332 SkPdfNativeObject* ret = get("HT", ""); |
| 333 if (doc) {ret = doc->resolveReference(ret);} |
| 334 return ret != NULL && ret->hasStream(); |
| 335 } |
| 336 |
| 337 SkPdfStream* SkPdfGraphicsStateDictionary::getHTAsStream(SkPdfNativeDoc* doc) { |
| 338 SkPdfNativeObject* ret = get("HT", ""); |
| 339 if (doc) {ret = doc->resolveReference(ret);} |
| 340 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); |
| 341 // TODO(edisonn): warn about missing default value for optional fields |
| 342 return NULL; |
| 343 } |
| 344 |
| 345 bool SkPdfGraphicsStateDictionary::isHTAName(SkPdfNativeDoc* doc) { |
| 346 SkPdfNativeObject* ret = get("HT", ""); |
| 347 if (doc) {ret = doc->resolveReference(ret);} |
| 348 return ret != NULL && ret->isName(); |
| 349 } |
| 350 |
| 351 SkString SkPdfGraphicsStateDictionary::getHTAsName(SkPdfNativeDoc* doc) { |
| 352 SkPdfNativeObject* ret = get("HT", ""); |
| 353 if (doc) {ret = doc->resolveReference(ret);} |
| 354 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 355 // TODO(edisonn): warn about missing default value for optional fields |
| 356 return SkString(); |
| 357 } |
| 358 |
| 359 bool SkPdfGraphicsStateDictionary::has_HT() const { |
| 360 return get("HT", "") != NULL; |
| 361 } |
| 362 |
| 363 double SkPdfGraphicsStateDictionary::FL(SkPdfNativeDoc* doc) { |
| 364 SkPdfNativeObject* ret = get("FL", ""); |
| 365 if (doc) {ret = doc->resolveReference(ret);} |
| 366 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); |
| 367 // TODO(edisonn): warn about missing default value for optional fields |
| 368 return 0; |
| 369 } |
| 370 |
| 371 bool SkPdfGraphicsStateDictionary::has_FL() const { |
| 372 return get("FL", "") != NULL; |
| 373 } |
| 374 |
| 375 double SkPdfGraphicsStateDictionary::SM(SkPdfNativeDoc* doc) { |
| 376 SkPdfNativeObject* ret = get("SM", ""); |
| 377 if (doc) {ret = doc->resolveReference(ret);} |
| 378 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); |
| 379 // TODO(edisonn): warn about missing default value for optional fields |
| 380 return 0; |
| 381 } |
| 382 |
| 383 bool SkPdfGraphicsStateDictionary::has_SM() const { |
| 384 return get("SM", "") != NULL; |
| 385 } |
| 386 |
| 387 bool SkPdfGraphicsStateDictionary::SA(SkPdfNativeDoc* doc) { |
| 388 SkPdfNativeObject* ret = get("SA", ""); |
| 389 if (doc) {ret = doc->resolveReference(ret);} |
| 390 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
| 391 // TODO(edisonn): warn about missing default value for optional fields |
| 392 return false; |
| 393 } |
| 394 |
| 395 bool SkPdfGraphicsStateDictionary::has_SA() const { |
| 396 return get("SA", "") != NULL; |
| 397 } |
| 398 |
| 399 bool SkPdfGraphicsStateDictionary::isBMAName(SkPdfNativeDoc* doc) { |
| 400 SkPdfNativeObject* ret = get("BM", ""); |
| 401 if (doc) {ret = doc->resolveReference(ret);} |
| 402 return ret != NULL && ret->isName(); |
| 403 } |
| 404 |
| 405 SkString SkPdfGraphicsStateDictionary::getBMAsName(SkPdfNativeDoc* doc) { |
| 406 SkPdfNativeObject* ret = get("BM", ""); |
| 407 if (doc) {ret = doc->resolveReference(ret);} |
| 408 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 409 // TODO(edisonn): warn about missing default value for optional fields |
| 410 return SkString(); |
| 411 } |
| 412 |
| 413 bool SkPdfGraphicsStateDictionary::isBMAArray(SkPdfNativeDoc* doc) { |
| 414 SkPdfNativeObject* ret = get("BM", ""); |
| 415 if (doc) {ret = doc->resolveReference(ret);} |
| 416 return ret != NULL && ret->isArray(); |
| 417 } |
| 418 |
| 419 SkPdfArray* SkPdfGraphicsStateDictionary::getBMAsArray(SkPdfNativeDoc* doc) { |
| 420 SkPdfNativeObject* ret = get("BM", ""); |
| 421 if (doc) {ret = doc->resolveReference(ret);} |
| 422 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; |
| 423 // TODO(edisonn): warn about missing default value for optional fields |
| 424 return NULL; |
| 425 } |
| 426 |
| 427 bool SkPdfGraphicsStateDictionary::has_BM() const { |
| 428 return get("BM", "") != NULL; |
| 429 } |
| 430 |
| 431 bool SkPdfGraphicsStateDictionary::isSMaskADictionary(SkPdfNativeDoc* doc) { |
| 432 SkPdfNativeObject* ret = get("SMask", ""); |
| 433 if (doc) {ret = doc->resolveReference(ret);} |
| 434 return ret != NULL && ret->isDictionary(); |
| 435 } |
| 436 |
| 437 SkPdfDictionary* SkPdfGraphicsStateDictionary::getSMaskAsDictionary(SkPdfNativeD
oc* doc) { |
| 438 SkPdfNativeObject* ret = get("SMask", ""); |
| 439 if (doc) {ret = doc->resolveReference(ret);} |
| 440 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; |
| 441 // TODO(edisonn): warn about missing default value for optional fields |
| 442 return NULL; |
| 443 } |
| 444 |
| 445 bool SkPdfGraphicsStateDictionary::isSMaskAName(SkPdfNativeDoc* doc) { |
| 446 SkPdfNativeObject* ret = get("SMask", ""); |
| 447 if (doc) {ret = doc->resolveReference(ret);} |
| 448 return ret != NULL && ret->isName(); |
| 449 } |
| 450 |
| 451 SkString SkPdfGraphicsStateDictionary::getSMaskAsName(SkPdfNativeDoc* doc) { |
| 452 SkPdfNativeObject* ret = get("SMask", ""); |
| 453 if (doc) {ret = doc->resolveReference(ret);} |
| 454 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); |
| 455 // TODO(edisonn): warn about missing default value for optional fields |
| 456 return SkString(); |
| 457 } |
| 458 |
| 459 bool SkPdfGraphicsStateDictionary::has_SMask() const { |
| 460 return get("SMask", "") != NULL; |
| 461 } |
| 462 |
| 463 double SkPdfGraphicsStateDictionary::CA(SkPdfNativeDoc* doc) { |
| 464 SkPdfNativeObject* ret = get("CA", ""); |
| 465 if (doc) {ret = doc->resolveReference(ret);} |
| 466 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); |
| 467 // TODO(edisonn): warn about missing default value for optional fields |
| 468 return 0; |
| 469 } |
| 470 |
| 471 bool SkPdfGraphicsStateDictionary::has_CA() const { |
| 472 return get("CA", "") != NULL; |
| 473 } |
| 474 |
| 475 double SkPdfGraphicsStateDictionary::ca(SkPdfNativeDoc* doc) { |
| 476 SkPdfNativeObject* ret = get("ca", ""); |
| 477 if (doc) {ret = doc->resolveReference(ret);} |
| 478 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); |
| 479 // TODO(edisonn): warn about missing default value for optional fields |
| 480 return 0; |
| 481 } |
| 482 |
| 483 bool SkPdfGraphicsStateDictionary::has_ca() const { |
| 484 return get("ca", "") != NULL; |
| 485 } |
| 486 |
| 487 bool SkPdfGraphicsStateDictionary::AIS(SkPdfNativeDoc* doc) { |
| 488 SkPdfNativeObject* ret = get("AIS", ""); |
| 489 if (doc) {ret = doc->resolveReference(ret);} |
| 490 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
| 491 // TODO(edisonn): warn about missing default value for optional fields |
| 492 return false; |
| 493 } |
| 494 |
| 495 bool SkPdfGraphicsStateDictionary::has_AIS() const { |
| 496 return get("AIS", "") != NULL; |
| 497 } |
| 498 |
| 499 bool SkPdfGraphicsStateDictionary::TK(SkPdfNativeDoc* doc) { |
| 500 SkPdfNativeObject* ret = get("TK", ""); |
| 501 if (doc) {ret = doc->resolveReference(ret);} |
| 502 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->boolValue(); |
| 503 // TODO(edisonn): warn about missing default value for optional fields |
| 504 return false; |
| 505 } |
| 506 |
| 507 bool SkPdfGraphicsStateDictionary::has_TK() const { |
| 508 return get("TK", "") != NULL; |
| 509 } |
| 510 |
OLD | NEW |