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

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfType10HalftoneDictionary_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__SkPdfType10HalftoneDictionary 1 #ifndef __DEFINED__SkPdfType10HalftoneDictionary
2 #define __DEFINED__SkPdfType10HalftoneDictionary 2 #define __DEFINED__SkPdfType10HalftoneDictionary
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 10 halftone dictionary 9 // Additional entries specific to a type 10 halftone dictionary
10 class SkPdfType10HalftoneDictionary : public SkPdfDictionary { 10 class SkPdfType10HalftoneDictionary : public SkPdfDictionary {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 SkPdfType10HalftoneDictionary& operator=(const SkPdfType10HalftoneDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r eturn *this;} 526 SkPdfType10HalftoneDictionary& operator=(const SkPdfType10HalftoneDictionary& 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 10 for this type of halftone. 537 * describes; must be 10 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 side of square X, in device pixels; see below. 551 /** (Required) The side of square X, in device pixels; see below.
570 **/ 552 **/
571 bool has_Xsquare() const { 553 bool has_Xsquare() const {
572 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Xsqua re", "", NULL)); 554 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Xsqua re", "", NULL));
573 } 555 }
574 556
575 long Xsquare() const { 557 long Xsquare() const;
576 long ret;
577 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Xsquare", " ", &ret)) return ret;
578 // TODO(edisonn): warn about missing required field, assert for known good p dfs
579 return 0;
580 }
581
582 /** (Required) The side of square Y, in device pixels; see below. 558 /** (Required) The side of square Y, in device pixels; see below.
583 **/ 559 **/
584 bool has_Ysquare() const { 560 bool has_Ysquare() const {
585 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ysqua re", "", NULL)); 561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ysqua re", "", NULL));
586 } 562 }
587 563
588 long Ysquare() const { 564 long Ysquare() const;
589 long ret;
590 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ysquare", " ", &ret)) return ret;
591 // TODO(edisonn): warn about missing required field, assert for known good p dfs
592 return 0;
593 }
594
595 /** (Optional) A transfer function, which overrides the current transfer 565 /** (Optional) A transfer function, which overrides the current transfer
596 * function in the graphics state for the same component. This entry is 566 * function in the graphics state for the same component. This entry is
597 * required if the dictionary is a component of a type 5 halftone (see 567 * required if the dictionary is a component of a type 5 halftone (see
598 * "Type 5 Halftones" on page 400) and represents either a nonprimary 568 * "Type 5 Halftones" on page 400) and represents either a nonprimary
599 * or nonstandard primary color component (see Section 6.3, "Transfer 569 * or nonstandard primary color component (see Section 6.3, "Transfer
600 * Functions"). The name Identity may be used to specify the identity 570 * Functions"). The name Identity may be used to specify the identity
601 * function. 571 * function.
602 **/ 572 **/
603 bool has_TransferFunction() const { 573 bool has_TransferFunction() const {
604 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans ferFunction", "", NULL)); 574 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans ferFunction", "", NULL));
605 } 575 }
606 576
607 bool isTransferFunctionAFunction() const { 577 bool isTransferFunctionAFunction() const {
608 SkPdfObject* ret = NULL; 578 SkPdfObject* ret = NULL;
609 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false; 579 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false;
610 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 580 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
611 } 581 }
612 582
613 SkPdfFunction getTransferFunctionAsFunction() const { 583 SkPdfFunction getTransferFunctionAsFunction() const;
614 SkPdfFunction ret = SkPdfFunction();
615 if (FunctionFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfe rFunction", "", &ret)) return ret;
616 // TODO(edisonn): warn about missing required field, assert for known good p dfs
617 return SkPdfFunction();
618 }
619
620 bool isTransferFunctionAName() const { 584 bool isTransferFunctionAName() const {
621 SkPdfObject* ret = NULL; 585 SkPdfObject* ret = NULL;
622 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false; 586 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Transfer Function", "", &ret)) return false;
623 return ret->podofo()->GetDataType() == ePdfDataType_Name; 587 return ret->podofo()->GetDataType() == ePdfDataType_Name;
624 } 588 }
625 589
626 std::string getTransferFunctionAsName() const { 590 std::string getTransferFunctionAsName() const;
627 std::string ret = "";
628 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TransferFun ction", "", &ret)) return ret;
629 // TODO(edisonn): warn about missing required field, assert for known good p dfs
630 return "";
631 }
632
633 }; 591 };
634 592
635 #endif // __DEFINED__SkPdfType10HalftoneDictionary 593 #endif // __DEFINED__SkPdfType10HalftoneDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698