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

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

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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__SkPdfType16HalftoneDictionary 1 #ifndef __DEFINED__SkPdfType16HalftoneDictionary
2 #define __DEFINED__SkPdfType16HalftoneDictionary 2 #define __DEFINED__SkPdfType16HalftoneDictionary
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 // Additional entries specific to a type 16 halftone dictionary 9 // Additional entries specific to a type 16 halftone dictionary
10 class SkPdfType16HalftoneDictionary : public SkPdfDictionary { 10 class SkPdfType16HalftoneDictionary : public SkPdfDictionary {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 SkPdfType16HalftoneDictionary& operator=(const SkPdfType16HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r eturn *this;} 526 SkPdfType16HalftoneDictionary& operator=(const SkPdfType16HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r eturn *this;}
527 527
528 /** (Optional) The type of PDF object that this dictionary describes; if 528 /** (Optional) The type of PDF object that this dictionary describes; if
529 * present, must be Halftone for a halftone dictionary. 529 * present, must be Halftone for a halftone 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 std::string Type() const { 535 std::string Type() const;
536 std::string ret;
537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
538 // TODO(edisonn): warn about missing required field, assert for known good p dfs
539 return "";
540 }
541
542 /** (Required) A code identifying the halftone type that this dictionary 536 /** (Required) A code identifying the halftone type that this dictionary
543 * describes; must be 16 for this type of halftone. 537 * describes; must be 16 for this type of halftone.
544 **/ 538 **/
545 bool has_HalftoneType() const { 539 bool has_HalftoneType() const {
546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft oneType", "", NULL)); 540 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft oneType", "", NULL));
547 } 541 }
548 542
549 long HalftoneType() const { 543 long HalftoneType() const;
550 long ret;
551 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneTyp e", "", &ret)) return ret;
552 // TODO(edisonn): warn about missing required field, assert for known good p dfs
553 return 0;
554 }
555
556 /** (Optional) The name of the halftone dictionary. 544 /** (Optional) The name of the halftone dictionary.
557 **/ 545 **/
558 bool has_HalftoneName() const { 546 bool has_HalftoneName() const {
559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft oneName", "", NULL)); 547 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft oneName", "", NULL));
560 } 548 }
561 549
562 std::string HalftoneName() const { 550 std::string HalftoneName() const;
563 std::string ret;
564 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneN ame", "", &ret)) return ret;
565 // TODO(edisonn): warn about missing required field, assert for known good p dfs
566 return "";
567 }
568
569 /** (Required) The width of the first (or only) rectangle in the threshold 551 /** (Required) The width of the first (or only) rectangle in the threshold
570 * array, in device pixels. 552 * array, in device pixels.
571 **/ 553 **/
572 bool has_Width() const { 554 bool has_Width() const {
573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width ", "", NULL)); 555 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width ", "", NULL));
574 } 556 }
575 557
576 long Width() const { 558 long Width() const;
577 long ret;
578 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width", "", &ret)) return ret;
579 // TODO(edisonn): warn about missing required field, assert for known good p dfs
580 return 0;
581 }
582
583 /** (Required) The height of the first (or only) rectangle in the threshold 559 /** (Required) The height of the first (or only) rectangle in the threshold
584 * array, in device pixels. 560 * array, in device pixels.
585 **/ 561 **/
586 bool has_Height() const { 562 bool has_Height() const {
587 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh t", "", NULL)); 563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh t", "", NULL));
588 } 564 }
589 565
590 long Height() const { 566 long Height() const;
591 long ret;
592 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Height", "" , &ret)) return ret;
593 // TODO(edisonn): warn about missing required field, assert for known good p dfs
594 return 0;
595 }
596
597 /** (Optional) The width of the optional second rectangle in the threshold 567 /** (Optional) The width of the optional second rectangle in the threshold
598 * array, in device pixels. If this entry is present, the Height2 entry must 568 * array, in device pixels. If this entry is present, the Height2 entry must
599 * be present as well; if this entry is absent, the Height2 entry must also be 569 * be present as well; if this entry is absent, the Height2 entry must also be
600 * absent and the threshold array has only one rectangle. 570 * absent and the threshold array has only one rectangle.
601 **/ 571 **/
602 bool has_Width2() const { 572 bool has_Width2() const {
603 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width 2", "", NULL)); 573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width 2", "", NULL));
604 } 574 }
605 575
606 long Width2() const { 576 long Width2() const;
607 long ret;
608 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Width2", "" , &ret)) return ret;
609 // TODO(edisonn): warn about missing required field, assert for known good p dfs
610 return 0;
611 }
612
613 /** (Optional) The height of the optional second rectangle in the threshold 577 /** (Optional) The height of the optional second rectangle in the threshold
614 * array, in device pixels. 578 * array, in device pixels.
615 **/ 579 **/
616 bool has_Height2() const { 580 bool has_Height2() const {
617 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh t2", "", NULL)); 581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Heigh t2", "", NULL));
618 } 582 }
619 583
620 long Height2() const { 584 long Height2() const;
621 long ret;
622 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Height2", " ", &ret)) return ret;
623 // TODO(edisonn): warn about missing required field, assert for known good p dfs
624 return 0;
625 }
626
627 /** (Optional) A transfer function, which overrides the current transfer 585 /** (Optional) A transfer function, which overrides the current transfer
628 * function in the graphics state for the same component. This entry is 586 * function in the graphics state for the same component. This entry is
629 * required if the dictionary is a component of a type 5 halftone (see 587 * required if the dictionary is a component of a type 5 halftone (see
630 * "Type 5 Halftones," below) and represents either a nonprimary or 588 * "Type 5 Halftones," below) and represents either a nonprimary or
631 * nonstandard primary color component (see Section 6.3, "Transfer 589 * nonstandard primary color component (see Section 6.3, "Transfer
632 * Functions"). The name Identity may be used to specify the identity 590 * Functions"). The name Identity may be used to specify the identity
633 * function. 591 * function.
634 **/ 592 **/
635 bool has_TransferFunction() const { 593 bool has_TransferFunction() const {
636 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans ferFunction", "", NULL)); 594 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans ferFunction", "", NULL));
637 } 595 }
638 596
639 bool isTransferFunctionAFunction() const { 597 bool isTransferFunctionAFunction() const {
640 SkPdfObject* ret = NULL; 598 SkPdfObject* ret = NULL;
641 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false; 599 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false;
642 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 600 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
643 } 601 }
644 602
645 SkPdfFunction getTransferFunctionAsFunction() const { 603 SkPdfFunction getTransferFunctionAsFunction() const;
646 SkPdfFunction ret = SkPdfFunction();
647 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfe rFunction", "", &ret)) return ret;
648 // TODO(edisonn): warn about missing required field, assert for known good p dfs
649 return SkPdfFunction();
650 }
651
652 bool isTransferFunctionAName() const { 604 bool isTransferFunctionAName() const {
653 SkPdfObject* ret = NULL; 605 SkPdfObject* ret = NULL;
654 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false; 606 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false;
655 return ret->podofo()->GetDataType() == ePdfDataType_Name; 607 return ret->podofo()->GetDataType() == ePdfDataType_Name;
656 } 608 }
657 609
658 std::string getTransferFunctionAsName() const { 610 std::string getTransferFunctionAsName() const;
659 std::string ret = "";
660 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TransferFun ction", "", &ret)) return ret;
661 // TODO(edisonn): warn about missing required field, assert for known good p dfs
662 return "";
663 }
664
665 }; 611 };
666 612
667 #endif // __DEFINED__SkPdfType16HalftoneDictionary 613 #endif // __DEFINED__SkPdfType16HalftoneDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698