| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ |
| 8 #define CORE_INCLUDE_FXGE_FX_GE_H_ | 8 #define CORE_INCLUDE_FXGE_FX_GE_H_ |
| 9 | 9 |
| 10 #include "fx_dib.h" | 10 #include "fx_dib.h" |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 return FALSE; | 601 return FALSE; |
| 602 } | 602 } |
| 603 | 603 |
| 604 virtual void* GetPlatformSurface() { return NULL; } | 604 virtual void* GetPlatformSurface() { return NULL; } |
| 605 | 605 |
| 606 virtual int GetDriverType() { return 0; } | 606 virtual int GetDriverType() { return 0; } |
| 607 | 607 |
| 608 virtual void ClearDriver() {} | 608 virtual void ClearDriver() {} |
| 609 }; | 609 }; |
| 610 | 610 |
| 611 class IFX_PSOutput { |
| 612 public: |
| 613 virtual void Release() = 0; |
| 614 virtual void OutputPS(const FX_CHAR* string, int len) = 0; |
| 615 |
| 616 protected: |
| 617 virtual ~IFX_PSOutput() {} |
| 618 }; |
| 619 |
| 620 class CPSFont; |
| 621 class CFX_PSRenderer { |
| 622 public: |
| 623 CFX_PSRenderer(); |
| 624 |
| 625 ~CFX_PSRenderer(); |
| 626 |
| 627 void Init(IFX_PSOutput* pOutput, |
| 628 int ps_level, |
| 629 int width, |
| 630 int height, |
| 631 FX_BOOL bCmykOutput); |
| 632 FX_BOOL StartRendering(); |
| 633 void EndRendering(); |
| 634 |
| 635 void SaveState(); |
| 636 |
| 637 void RestoreState(FX_BOOL bKeepSaved = FALSE); |
| 638 |
| 639 void SetClip_PathFill(const CFX_PathData* pPathData, |
| 640 const CFX_Matrix* pObject2Device, |
| 641 int fill_mode); |
| 642 |
| 643 void SetClip_PathStroke(const CFX_PathData* pPathData, |
| 644 const CFX_Matrix* pObject2Device, |
| 645 const CFX_GraphStateData* pGraphState); |
| 646 |
| 647 FX_RECT GetClipBox() { return m_ClipBox; } |
| 648 |
| 649 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
| 650 const CFX_Matrix* pObject2Device, |
| 651 const CFX_GraphStateData* pGraphState, |
| 652 FX_DWORD fill_color, |
| 653 FX_DWORD stroke_color, |
| 654 int fill_mode, |
| 655 int alpha_flag = 0, |
| 656 void* pIccTransform = NULL); |
| 657 |
| 658 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 659 FX_DWORD color, |
| 660 int dest_left, |
| 661 int dest_top, |
| 662 int alpha_flag = 0, |
| 663 void* pIccTransform = NULL); |
| 664 |
| 665 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 666 FX_DWORD color, |
| 667 int dest_left, |
| 668 int dest_top, |
| 669 int dest_width, |
| 670 int dest_height, |
| 671 FX_DWORD flags, |
| 672 int alpha_flag = 0, |
| 673 void* pIccTransform = NULL); |
| 674 |
| 675 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, |
| 676 FX_DWORD color, |
| 677 const CFX_Matrix* pMatrix, |
| 678 FX_DWORD flags, |
| 679 int alpha_flag = 0, |
| 680 void* pIccTransform = NULL); |
| 681 |
| 682 FX_BOOL DrawText(int nChars, |
| 683 const FXTEXT_CHARPOS* pCharPos, |
| 684 CFX_Font* pFont, |
| 685 CFX_FontCache* pCache, |
| 686 const CFX_Matrix* pObject2Device, |
| 687 FX_FLOAT font_size, |
| 688 FX_DWORD color, |
| 689 int alpha_flag = 0, |
| 690 void* pIccTransform = NULL); |
| 691 |
| 692 private: |
| 693 IFX_PSOutput* m_pOutput; |
| 694 |
| 695 int m_PSLevel; |
| 696 |
| 697 CFX_GraphStateData m_CurGraphState; |
| 698 |
| 699 FX_BOOL m_bGraphStateSet; |
| 700 |
| 701 FX_BOOL m_bCmykOutput; |
| 702 |
| 703 FX_BOOL m_bColorSet; |
| 704 |
| 705 FX_DWORD m_LastColor; |
| 706 |
| 707 FX_RECT m_ClipBox; |
| 708 |
| 709 CFX_ArrayTemplate<CPSFont*> m_PSFontList; |
| 710 |
| 711 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; |
| 712 FX_BOOL m_bInited; |
| 713 |
| 714 void OutputPath(const CFX_PathData* pPathData, |
| 715 const CFX_Matrix* pObject2Device); |
| 716 |
| 717 void SetGraphState(const CFX_GraphStateData* pGraphState); |
| 718 |
| 719 void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform); |
| 720 |
| 721 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, |
| 722 CFX_Font* pFont, |
| 723 const FXTEXT_CHARPOS& charpos, |
| 724 int& ps_fontnum, |
| 725 int& ps_glyphindex); |
| 726 |
| 727 void WritePSBinary(const uint8_t* data, int len); |
| 728 }; |
| 729 |
| 611 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ | 730 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ |
| OLD | NEW |