| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfType5HalftoneDictionary | 1 #ifndef __DEFINED__SkPdfType5HalftoneDictionary |
| 2 #define __DEFINED__SkPdfType5HalftoneDictionary | 2 #define __DEFINED__SkPdfType5HalftoneDictionary |
| 3 | 3 |
| 4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
| 5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
| 6 #include "SkPdfDictionary_autogen.h" | 6 #include "SkPdfDictionary_autogen.h" |
| 7 | 7 |
| 8 // Entries in a type 5 halftone dictionary |
| 8 class SkPdfType5HalftoneDictionary : public SkPdfDictionary { | 9 class SkPdfType5HalftoneDictionary : public SkPdfDictionary { |
| 9 public: | 10 public: |
| 10 virtual SkPdfObjectType getType() const { return kType5HalftoneDictionary_SkPd
fObjectType;} | 11 virtual SkPdfObjectType getType() const { return kType5HalftoneDictionary_SkPd
fObjectType;} |
| 11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType5Ha
lftoneDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType5Ha
lftoneDictionary_SkPdfObjectType + 1);} |
| 12 public: | 13 public: |
| 13 virtual SkPdfType5HalftoneDictionary* asType5HalftoneDictionary() {return this
;} | 14 virtual SkPdfType5HalftoneDictionary* asType5HalftoneDictionary() {return this
;} |
| 14 virtual const SkPdfType5HalftoneDictionary* asType5HalftoneDictionary() const
{return this;} | 15 virtual const SkPdfType5HalftoneDictionary* asType5HalftoneDictionary() const
{return this;} |
| 15 | 16 |
| 16 private: | 17 private: |
| 17 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} | 18 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 515 |
| 515 public: | 516 public: |
| 516 private: | 517 private: |
| 517 public: | 518 public: |
| 518 SkPdfType5HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const Pdf
Object* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfType5HalftoneDictionary(const PdfMemDocument* podofoDoc = NULL, const Pdf
Object* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
| 519 | 520 |
| 520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
| 521 | 522 |
| 522 SkPdfType5HalftoneDictionary& operator=(const SkPdfType5HalftoneDictionary& fr
om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret
urn *this;} | 523 SkPdfType5HalftoneDictionary& operator=(const SkPdfType5HalftoneDictionary& fr
om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret
urn *this;} |
| 523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, |
| 526 * must be Halftone for a halftone dictionary. |
| 527 **/ |
| 528 bool has_Type() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 530 } |
| 531 |
| 524 std::string Type() const { | 532 std::string Type() const { |
| 525 std::string ret; | 533 std::string ret; |
| 526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; |
| 527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 535 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 528 return ""; | 536 return ""; |
| 529 } | 537 } |
| 530 | 538 |
| 539 /** (Required) A code identifying the halftone type that this dictionary describ
es; |
| 540 * must be 5 for this type of halftone. |
| 541 **/ |
| 542 bool has_HalftoneType() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneType", "", NULL)); |
| 544 } |
| 545 |
| 531 double HalftoneType() const { | 546 double HalftoneType() const { |
| 532 double ret; | 547 double ret; |
| 533 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneT
ype", "", &ret)) return ret; | 548 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneT
ype", "", &ret)) return ret; |
| 534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 549 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 535 return 0; | 550 return 0; |
| 536 } | 551 } |
| 537 | 552 |
| 553 /** (Optional) The name of the halftone dictionary. |
| 554 **/ |
| 555 bool has_HalftoneName() const { |
| 556 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneName", "", NULL)); |
| 557 } |
| 558 |
| 538 std::string HalftoneName() const { | 559 std::string HalftoneName() const { |
| 539 std::string ret; | 560 std::string ret; |
| 540 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneN
ame", "", &ret)) return ret; | 561 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneN
ame", "", &ret)) return ret; |
| 541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 562 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 542 return ""; | 563 return ""; |
| 543 } | 564 } |
| 544 | 565 |
| 566 /** (Required, one per colorant) The halftone corresponding to the colorant or |
| 567 * color component named by the key. The halftone may be of any type other |
| 568 * than 5. Note that the key must be a name object; strings are not permitted,
as |
| 569 * they are in type 5 PostScript halftone dictionaries. |
| 570 **/ |
| 545 /* | 571 /* |
| 546 bool has_[any_colorant_name]() const { | 572 bool has_[any_colorant_name]() const { |
| 547 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", NULL)); | 573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", NULL)); |
| 548 } | 574 } |
| 575 |
| 549 bool is[any_colorant_name]ADictionary() const { | 576 bool is[any_colorant_name]ADictionary() const { |
| 550 SkPdfObject* ret = NULL; | 577 SkPdfObject* ret = NULL; |
| 551 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; | 578 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; |
| 552 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 579 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
| 553 } | 580 } |
| 554 | 581 |
| 555 SkPdfDictionary* get[any_colorant_name]AsDictionary() const { | 582 SkPdfDictionary* get[any_colorant_name]AsDictionary() const { |
| 556 SkPdfDictionary* ret = NULL; | 583 SkPdfDictionary* ret = NULL; |
| 557 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", &ret)) return ret; | 584 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", &ret)) return ret; |
| 558 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 585 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 559 return NULL; | 586 return NULL; |
| 560 } | 587 } |
| 561 | 588 |
| 562 bool is[any_colorant_name]AStream() const { | 589 bool is[any_colorant_name]AStream() const { |
| 563 SkPdfObject* ret = NULL; | 590 SkPdfObject* ret = NULL; |
| 564 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; | 591 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; |
| 565 return ret->podofo()->HasStream(); | 592 return ret->podofo()->HasStream(); |
| 566 } | 593 } |
| 567 | 594 |
| 568 SkPdfStream get[any_colorant_name]AsStream() const { | 595 SkPdfStream get[any_colorant_name]AsStream() const { |
| 569 SkPdfStream ret = SkPdfStream(); | 596 SkPdfStream ret = SkPdfStream(); |
| 570 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_colo
rant_name]", "", &ret)) return ret; | 597 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_colo
rant_name]", "", &ret)) return ret; |
| 571 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 598 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 572 return SkPdfStream(); | 599 return SkPdfStream(); |
| 573 } | 600 } |
| 574 | 601 |
| 575 */ | 602 */ |
| 603 /** (Required) A halftone to be used for any colorant or color component that |
| 604 * does not have an entry of its own. The value may not be a type 5 halftone. I
f |
| 605 * there are any nonprimary colorants, the default halftone must have a transfe
r |
| 606 * function. |
| 607 **/ |
| 608 bool has_Default() const { |
| 609 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Defau
lt", "", NULL)); |
| 610 } |
| 611 |
| 576 bool isDefaultADictionary() const { | 612 bool isDefaultADictionary() const { |
| 577 SkPdfObject* ret = NULL; | 613 SkPdfObject* ret = NULL; |
| 578 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; | 614 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; |
| 579 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 615 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
| 580 } | 616 } |
| 581 | 617 |
| 582 SkPdfDictionary* getDefaultAsDictionary() const { | 618 SkPdfDictionary* getDefaultAsDictionary() const { |
| 583 SkPdfDictionary* ret = NULL; | 619 SkPdfDictionary* ret = NULL; |
| 584 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Defau
lt", "", &ret)) return ret; | 620 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Defau
lt", "", &ret)) return ret; |
| 585 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 621 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 586 return NULL; | 622 return NULL; |
| 587 } | 623 } |
| 588 | 624 |
| 589 bool isDefaultAStream() const { | 625 bool isDefaultAStream() const { |
| 590 SkPdfObject* ret = NULL; | 626 SkPdfObject* ret = NULL; |
| 591 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; | 627 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; |
| 592 return ret->podofo()->HasStream(); | 628 return ret->podofo()->HasStream(); |
| 593 } | 629 } |
| 594 | 630 |
| 595 SkPdfStream getDefaultAsStream() const { | 631 SkPdfStream getDefaultAsStream() const { |
| 596 SkPdfStream ret = SkPdfStream(); | 632 SkPdfStream ret = SkPdfStream(); |
| 597 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default",
"", &ret)) return ret; | 633 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default",
"", &ret)) return ret; |
| 598 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 634 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 599 return SkPdfStream(); | 635 return SkPdfStream(); |
| 600 } | 636 } |
| 601 | 637 |
| 602 }; | 638 }; |
| 603 | 639 |
| 604 #endif // __DEFINED__SkPdfType5HalftoneDictionary | 640 #endif // __DEFINED__SkPdfType5HalftoneDictionary |
| OLD | NEW |