Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfType2PatternDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfType2PatternDictionary 1 #ifndef __DEFINED__SkPdfType2PatternDictionary
2 #define __DEFINED__SkPdfType2PatternDictionary 2 #define __DEFINED__SkPdfType2PatternDictionary
3 3
4 #include "SkPdfUtils.h" 4 #include "SkPdfUtils.h"
5 #include "SkPdfEnums_autogen.h" 5 #include "SkPdfEnums_autogen.h"
6 #include "SkPdfArray_autogen.h" 6 #include "SkPdfArray_autogen.h"
7 #include "SkPdfDictionary_autogen.h" 7 #include "SkPdfDictionary_autogen.h"
8 8
9 // Entries in a type 2 pattern dictionary 9 // Entries in a type 2 pattern dictionary
10 class SkPdfType2PatternDictionary : public SkPdfDictionary { 10 class SkPdfType2PatternDictionary : public SkPdfDictionary {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 SkPdfType2PatternDictionary& operator=(const SkPdfType2PatternDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;} 526 SkPdfType2PatternDictionary& operator=(const SkPdfType2PatternDictionary& from ) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur n *this;}
527 527
528 /** (Optional) The type of PDF object that this dictionary describes; if present , 528 /** (Optional) The type of PDF object that this dictionary describes; if present ,
529 * must be Pattern for a pattern dictionary. 529 * must be Pattern for a pattern dictionary.
530 **/ 530 **/
531 bool has_Type() const { 531 bool has_Type() const {
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type" , "", NULL)); 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type" , "", NULL));
533 } 533 }
534 534
535 long Type() const { 535 long Type() const;
536 long ret;
537 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
538 // TODO(edisonn): warn about missing required field, assert for known good p dfs
539 return 0;
540 }
541
542 /** (Required) A code identifying the type of pattern that this dictionary de- 536 /** (Required) A code identifying the type of pattern that this dictionary de-
543 * scribes; must be 2 for a shading pattern. 537 * scribes; must be 2 for a shading pattern.
544 **/ 538 **/
545 bool has_PatternType() const { 539 bool has_PatternType() const {
546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Patte rnType", "", NULL)); 540 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Patte rnType", "", NULL));
547 } 541 }
548 542
549 long PatternType() const { 543 long PatternType() const;
550 long ret;
551 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PatternType ", "", &ret)) return ret;
552 // TODO(edisonn): warn about missing required field, assert for known good p dfs
553 return 0;
554 }
555
556 /** (Required) A shading object (see below) defining the shading pattern's gradi ent 544 /** (Required) A shading object (see below) defining the shading pattern's gradi ent
557 * fill. The contents of the dictionary consist of the entries in Table 4.25 on page 545 * fill. The contents of the dictionary consist of the entries in Table 4.25 on page
558 * 234, plus those in one of Tables 4.26 to 4.31 on pages 237 to 253. 546 * 234, plus those in one of Tables 4.26 to 4.31 on pages 237 to 253.
559 **/ 547 **/
560 bool has_Shading() const { 548 bool has_Shading() const {
561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shadi ng", "", NULL)); 549 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shadi ng", "", NULL));
562 } 550 }
563 551
564 bool isShadingADictionary() const { 552 bool isShadingADictionary() const {
565 SkPdfObject* ret = NULL; 553 SkPdfObject* ret = NULL;
566 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading" , "", &ret)) return false; 554 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading" , "", &ret)) return false;
567 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; 555 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary;
568 } 556 }
569 557
570 SkPdfDictionary* getShadingAsDictionary() const { 558 SkPdfDictionary* getShadingAsDictionary() const;
571 SkPdfDictionary* ret = NULL;
572 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shadi ng", "", &ret)) return ret;
573 // TODO(edisonn): warn about missing required field, assert for known good p dfs
574 return NULL;
575 }
576
577 bool isShadingAStream() const { 559 bool isShadingAStream() const {
578 SkPdfObject* ret = NULL; 560 SkPdfObject* ret = NULL;
579 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading" , "", &ret)) return false; 561 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading" , "", &ret)) return false;
580 return ret->podofo()->HasStream(); 562 return ret->podofo()->HasStream();
581 } 563 }
582 564
583 SkPdfStream* getShadingAsStream() const { 565 SkPdfStream* getShadingAsStream() const;
584 SkPdfStream* ret = NULL;
585 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Shading", "", &ret)) return ret;
586 // TODO(edisonn): warn about missing required field, assert for known good p dfs
587 return NULL;
588 }
589
590 /** (Optional) An array of six numbers specifying the pattern matrix (see Sectio n 566 /** (Optional) An array of six numbers specifying the pattern matrix (see Sectio n
591 * 4.6.1, "General Properties of Patterns"). Default value: the identity matrix 567 * 4.6.1, "General Properties of Patterns"). Default value: the identity matrix
592 * [1 0 0 1 0 0]. 568 * [1 0 0 1 0 0].
593 **/ 569 **/
594 bool has_Matrix() const { 570 bool has_Matrix() const {
595 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri x", "", NULL)); 571 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri x", "", NULL));
596 } 572 }
597 573
598 SkPdfArray* Matrix() const { 574 SkPdfArray* Matrix() const;
599 SkPdfArray* ret;
600 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matrix", " ", &ret)) return ret;
601 // TODO(edisonn): warn about missing required field, assert for known good p dfs
602 return NULL;
603 }
604
605 /** (Optional) A graphics state parameter dictionary (see Section 4.3.4, "Graph- 575 /** (Optional) A graphics state parameter dictionary (see Section 4.3.4, "Graph-
606 * ics State Parameter Dictionaries") containing graphics state parameters to b e 576 * ics State Parameter Dictionaries") containing graphics state parameters to b e
607 * put into effect temporarily while the shading pattern is painted. Any parame - 577 * put into effect temporarily while the shading pattern is painted. Any parame -
608 * ters that are not so specified are inherited from the graphics state that wa s in 578 * ters that are not so specified are inherited from the graphics state that wa s in
609 * effect at the beginning of the content stream in which the pattern is define d 579 * effect at the beginning of the content stream in which the pattern is define d
610 * as a resource. 580 * as a resource.
611 **/ 581 **/
612 bool has_ExtGState() const { 582 bool has_ExtGState() const {
613 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ExtGS tate", "", NULL)); 583 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ExtGS tate", "", NULL));
614 } 584 }
615 585
616 SkPdfDictionary* ExtGState() const { 586 SkPdfDictionary* ExtGState() const;
617 SkPdfDictionary* ret;
618 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ExtGS tate", "", &ret)) return ret;
619 // TODO(edisonn): warn about missing required field, assert for known good p dfs
620 return NULL;
621 }
622
623 }; 587 };
624 588
625 #endif // __DEFINED__SkPdfType2PatternDictionary 589 #endif // __DEFINED__SkPdfType2PatternDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698