| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfPSXobjectDictionary | 1 #ifndef __DEFINED__SkPdfPSXobjectDictionary |
| 2 #define __DEFINED__SkPdfPSXobjectDictionary | 2 #define __DEFINED__SkPdfPSXobjectDictionary |
| 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 // Additional entries specific to a PostScript XObject dictionary |
| 8 class SkPdfPSXobjectDictionary : public SkPdfDictionary { | 9 class SkPdfPSXobjectDictionary : public SkPdfDictionary { |
| 9 public: | 10 public: |
| 10 virtual SkPdfObjectType getType() const { return kPSXobjectDictionary_SkPdfObj
ectType;} | 11 virtual SkPdfObjectType getType() const { return kPSXobjectDictionary_SkPdfObj
ectType;} |
| 11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kPSXobje
ctDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kPSXobje
ctDictionary_SkPdfObjectType + 1);} |
| 12 public: | 13 public: |
| 13 virtual SkPdfPSXobjectDictionary* asPSXobjectDictionary() {return this;} | 14 virtual SkPdfPSXobjectDictionary* asPSXobjectDictionary() {return this;} |
| 14 virtual const SkPdfPSXobjectDictionary* asPSXobjectDictionary() const {return
this;} | 15 virtual const SkPdfPSXobjectDictionary* asPSXobjectDictionary() 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 SkPdfPSXobjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObje
ct* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfPSXobjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObje
ct* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
| 519 | 520 |
| 520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
| 521 | 522 |
| 522 SkPdfPSXobjectDictionary& operator=(const SkPdfPSXobjectDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} | 523 SkPdfPSXobjectDictionary& operator=(const SkPdfPSXobjectDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} |
| 523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, must be |
| 526 * XObject for a PostScript XObject. |
| 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) The type of XObject that this dictionary describes; must be PS fo
r a |
| 540 * PostScript XObject. |
| 541 **/ |
| 542 bool has_Subtype() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); |
| 544 } |
| 545 |
| 531 std::string Subtype() const { | 546 std::string Subtype() const { |
| 532 std::string ret; | 547 std::string ret; |
| 533 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; | 548 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &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 ""; | 550 return ""; |
| 536 } | 551 } |
| 537 | 552 |
| 553 /** (Optional) A stream whose contents are to be used in place of the PostScript |
| 554 * XObject's stream when the target PostScript interpreter is known to support
only |
| 555 * LanguageLevel 1. |
| 556 **/ |
| 557 bool has_Level1() const { |
| 558 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Level
1", "", NULL)); |
| 559 } |
| 560 |
| 538 SkPdfStream Level1() const { | 561 SkPdfStream Level1() const { |
| 539 SkPdfStream ret; | 562 SkPdfStream ret; |
| 540 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Level1",
"", &ret)) return ret; | 563 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Level1",
"", &ret)) return ret; |
| 541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 564 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 542 return SkPdfStream(); | 565 return SkPdfStream(); |
| 543 } | 566 } |
| 544 | 567 |
| 545 }; | 568 }; |
| 546 | 569 |
| 547 #endif // __DEFINED__SkPdfPSXobjectDictionary | 570 #endif // __DEFINED__SkPdfPSXobjectDictionary |
| OLD | NEW |