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 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "core/include/fxcrt/fx_ext.h" | 9 #include "core/include/fxcrt/fx_ext.h" |
10 #include "fpdfsdk/include/fsdk_baseannot.h" | 10 #include "fpdfsdk/include/fsdk_baseannot.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 } | 530 } |
531 | 531 |
532 void CPDFSDK_Annot::SetTabOrder(int iTabOrder) { | 532 void CPDFSDK_Annot::SetTabOrder(int iTabOrder) { |
533 m_nTabOrder = iTabOrder; | 533 m_nTabOrder = iTabOrder; |
534 } | 534 } |
535 | 535 |
536 CPDF_Dictionary* CPDFSDK_BAAnnot::GetAnnotDict() const { | 536 CPDF_Dictionary* CPDFSDK_BAAnnot::GetAnnotDict() const { |
537 return m_pAnnot->GetAnnotDict(); | 537 return m_pAnnot->GetAnnotDict(); |
538 } | 538 } |
539 | 539 |
540 void CPDFSDK_BAAnnot::SetRect(const CPDF_Rect& rect) { | 540 void CPDFSDK_BAAnnot::SetRect(const CFX_FloatRect& rect) { |
541 ASSERT(rect.right - rect.left >= GetMinWidth()); | 541 ASSERT(rect.right - rect.left >= GetMinWidth()); |
542 ASSERT(rect.top - rect.bottom >= GetMinHeight()); | 542 ASSERT(rect.top - rect.bottom >= GetMinHeight()); |
543 | 543 |
544 m_pAnnot->GetAnnotDict()->SetAtRect("Rect", rect); | 544 m_pAnnot->GetAnnotDict()->SetAtRect("Rect", rect); |
545 } | 545 } |
546 | 546 |
547 CPDF_Rect CPDFSDK_BAAnnot::GetRect() const { | 547 CFX_FloatRect CPDFSDK_BAAnnot::GetRect() const { |
548 CPDF_Rect rect; | 548 CFX_FloatRect rect; |
549 m_pAnnot->GetRect(rect); | 549 m_pAnnot->GetRect(rect); |
550 return rect; | 550 return rect; |
551 } | 551 } |
552 | 552 |
553 CFX_ByteString CPDFSDK_BAAnnot::GetType() const { | 553 CFX_ByteString CPDFSDK_BAAnnot::GetType() const { |
554 return m_pAnnot->GetSubType(); | 554 return m_pAnnot->GetSubType(); |
555 } | 555 } |
556 | 556 |
557 CFX_ByteString CPDFSDK_BAAnnot::GetSubType() const { | 557 CFX_ByteString CPDFSDK_BAAnnot::GetSubType() const { |
558 return ""; | 558 return ""; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255)); | 828 color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255)); |
829 | 829 |
830 return TRUE; | 830 return TRUE; |
831 } | 831 } |
832 } | 832 } |
833 | 833 |
834 return FALSE; | 834 return FALSE; |
835 } | 835 } |
836 | 836 |
837 void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, | 837 void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, |
838 const CPDF_Rect& rcBBox, | 838 const CFX_FloatRect& rcBBox, |
839 const CFX_Matrix& matrix, | 839 const CFX_Matrix& matrix, |
840 const CFX_ByteString& sContents, | 840 const CFX_ByteString& sContents, |
841 const CFX_ByteString& sAPState) { | 841 const CFX_ByteString& sAPState) { |
842 CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP"); | 842 CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP"); |
843 | 843 |
844 if (!pAPDict) { | 844 if (!pAPDict) { |
845 pAPDict = new CPDF_Dictionary; | 845 pAPDict = new CPDF_Dictionary; |
846 m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict); | 846 m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict); |
847 } | 847 } |
848 | 848 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 979 |
980 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | 980 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { |
981 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; | 981 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; |
982 } | 982 } |
983 | 983 |
984 #ifdef PDF_ENABLE_XFA | 984 #ifdef PDF_ENABLE_XFA |
985 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { | 985 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { |
986 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; | 986 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; |
987 } | 987 } |
988 #endif // PDF_ENABLE_XFA | 988 #endif // PDF_ENABLE_XFA |
OLD | NEW |