OLD | NEW |
1 #ifndef __DEFINED__SkPdfType2PatternDictionary | 1 #ifndef __DEFINED__SkPdfType2PatternDictionary |
2 #define __DEFINED__SkPdfType2PatternDictionary | 2 #define __DEFINED__SkPdfType2PatternDictionary |
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 2 pattern dictionary |
8 class SkPdfType2PatternDictionary : public SkPdfDictionary { | 9 class SkPdfType2PatternDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kType2PatternDictionary_SkPdf
ObjectType;} | 11 virtual SkPdfObjectType getType() const { return kType2PatternDictionary_SkPdf
ObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType2Pa
tternDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType2Pa
tternDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfType2PatternDictionary* asType2PatternDictionary() {return this;} | 14 virtual SkPdfType2PatternDictionary* asType2PatternDictionary() {return this;} |
14 virtual const SkPdfType2PatternDictionary* asType2PatternDictionary() const {r
eturn this;} | 15 virtual const SkPdfType2PatternDictionary* asType2PatternDictionary() const {r
eturn 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 SkPdfType2PatternDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfType2PatternDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfType2PatternDictionary& operator=(const SkPdfType2PatternDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | 523 SkPdfType2PatternDictionary& operator=(const SkPdfType2PatternDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} |
523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, |
| 526 * must be Pattern for a pattern dictionary. |
| 527 **/ |
| 528 bool has_Type() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 530 } |
| 531 |
524 long Type() const { | 532 long Type() const { |
525 long ret; | 533 long ret; |
526 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | 534 if (LongFromDictionary(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 0; | 536 return 0; |
529 } | 537 } |
530 | 538 |
| 539 /** (Required) A code identifying the type of pattern that this dictionary de- |
| 540 * scribes; must be 2 for a shading pattern. |
| 541 **/ |
| 542 bool has_PatternType() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Patte
rnType", "", NULL)); |
| 544 } |
| 545 |
531 long PatternType() const { | 546 long PatternType() const { |
532 long ret; | 547 long ret; |
533 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PatternType
", "", &ret)) return ret; | 548 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PatternType
", "", &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 /** (Required) A shading object (see below) defining the shading pattern's gradi
ent |
| 554 * fill. The contents of the dictionary consist of the entries in Table 4.25 on
page |
| 555 * 234, plus those in one of Tables 4.26 to 4.31 on pages 237 to 253. |
| 556 **/ |
| 557 bool has_Shading() const { |
| 558 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shadi
ng", "", NULL)); |
| 559 } |
| 560 |
538 bool isShadingADictionary() const { | 561 bool isShadingADictionary() const { |
539 SkPdfObject* ret = NULL; | 562 SkPdfObject* ret = NULL; |
540 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading"
, "", &ret)) return false; | 563 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading"
, "", &ret)) return false; |
541 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 564 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
542 } | 565 } |
543 | 566 |
544 SkPdfDictionary* getShadingAsDictionary() const { | 567 SkPdfDictionary* getShadingAsDictionary() const { |
545 SkPdfDictionary* ret = NULL; | 568 SkPdfDictionary* ret = NULL; |
546 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shadi
ng", "", &ret)) return ret; | 569 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shadi
ng", "", &ret)) return ret; |
547 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 570 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
548 return NULL; | 571 return NULL; |
549 } | 572 } |
550 | 573 |
551 bool isShadingAStream() const { | 574 bool isShadingAStream() const { |
552 SkPdfObject* ret = NULL; | 575 SkPdfObject* ret = NULL; |
553 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading"
, "", &ret)) return false; | 576 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading"
, "", &ret)) return false; |
554 return ret->podofo()->HasStream(); | 577 return ret->podofo()->HasStream(); |
555 } | 578 } |
556 | 579 |
557 SkPdfStream getShadingAsStream() const { | 580 SkPdfStream getShadingAsStream() const { |
558 SkPdfStream ret = SkPdfStream(); | 581 SkPdfStream ret = SkPdfStream(); |
559 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading",
"", &ret)) return ret; | 582 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading",
"", &ret)) return ret; |
560 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 583 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
561 return SkPdfStream(); | 584 return SkPdfStream(); |
562 } | 585 } |
563 | 586 |
| 587 /** (Optional) An array of six numbers specifying the pattern matrix (see Sectio
n |
| 588 * 4.6.1, "General Properties of Patterns"). Default value: the identity matrix |
| 589 * [1 0 0 1 0 0]. |
| 590 **/ |
| 591 bool has_Matrix() const { |
| 592 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri
x", "", NULL)); |
| 593 } |
| 594 |
564 SkPdfArray Matrix() const { | 595 SkPdfArray Matrix() const { |
565 SkPdfArray ret; | 596 SkPdfArray ret; |
566 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "
", &ret)) return ret; | 597 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", "
", &ret)) return ret; |
567 // 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 |
568 return SkPdfArray(); | 599 return SkPdfArray(); |
569 } | 600 } |
570 | 601 |
| 602 /** (Optional) A graphics state parameter dictionary (see Section 4.3.4, "Graph- |
| 603 * ics State Parameter Dictionaries") containing graphics state parameters to b
e |
| 604 * put into effect temporarily while the shading pattern is painted. Any parame
- |
| 605 * ters that are not so specified are inherited from the graphics state that wa
s in |
| 606 * effect at the beginning of the content stream in which the pattern is define
d |
| 607 * as a resource. |
| 608 **/ |
| 609 bool has_ExtGState() const { |
| 610 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ExtGS
tate", "", NULL)); |
| 611 } |
| 612 |
571 SkPdfDictionary* ExtGState() const { | 613 SkPdfDictionary* ExtGState() const { |
572 SkPdfDictionary* ret; | 614 SkPdfDictionary* ret; |
573 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ExtGS
tate", "", &ret)) return ret; | 615 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ExtGS
tate", "", &ret)) return ret; |
574 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 616 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
575 return NULL; | 617 return NULL; |
576 } | 618 } |
577 | 619 |
578 }; | 620 }; |
579 | 621 |
580 #endif // __DEFINED__SkPdfType2PatternDictionary | 622 #endif // __DEFINED__SkPdfType2PatternDictionary |
OLD | NEW |