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 "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 7 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
8 #include "fpdfsdk/include/fsdk_actionhandler.h" | 8 #include "fpdfsdk/include/fsdk_actionhandler.h" |
9 #include "fpdfsdk/include/fsdk_baseannot.h" | 9 #include "fpdfsdk/include/fsdk_baseannot.h" |
10 #include "fpdfsdk/include/fsdk_baseform.h" | 10 #include "fpdfsdk/include/fsdk_baseform.h" |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged) { | 833 void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged) { |
834 CPDF_FormField* pFormField = GetFormField(); | 834 CPDF_FormField* pFormField = GetFormField(); |
835 ASSERT(pFormField != NULL); | 835 ASSERT(pFormField != NULL); |
836 | 836 |
837 ASSERT(m_pInterForm != NULL); | 837 ASSERT(m_pInterForm != NULL); |
838 | 838 |
839 m_pInterForm->ResetFieldAppearance(pFormField, NULL, bValueChanged); | 839 m_pInterForm->ResetFieldAppearance(pFormField, NULL, bValueChanged); |
840 } | 840 } |
841 | 841 |
842 void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice, | 842 void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice, |
843 const CPDF_Matrix* pUser2Device, | 843 const CFX_Matrix* pUser2Device, |
844 CPDF_Annot::AppearanceMode mode, | 844 CPDF_Annot::AppearanceMode mode, |
845 const CPDF_RenderOptions* pOptions) { | 845 const CPDF_RenderOptions* pOptions) { |
846 int nFieldType = GetFieldType(); | 846 int nFieldType = GetFieldType(); |
847 | 847 |
848 if ((nFieldType == FIELDTYPE_CHECKBOX || | 848 if ((nFieldType == FIELDTYPE_CHECKBOX || |
849 nFieldType == FIELDTYPE_RADIOBUTTON) && | 849 nFieldType == FIELDTYPE_RADIOBUTTON) && |
850 mode == CPDF_Annot::Normal && | 850 mode == CPDF_Annot::Normal && |
851 !IsWidgetAppearanceValid(CPDF_Annot::Normal)) { | 851 !IsWidgetAppearanceValid(CPDF_Annot::Normal)) { |
852 CFX_PathData pathData; | 852 CFX_PathData pathData; |
853 | 853 |
(...skipping 28 matching lines...) Expand all Loading... |
882 if (m_pInterForm->IsNeedHighLight(nFieldType)) { | 882 if (m_pInterForm->IsNeedHighLight(nFieldType)) { |
883 CPDF_Rect rc = GetRect(); | 883 CPDF_Rect rc = GetRect(); |
884 FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType); | 884 FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType); |
885 uint8_t alpha = m_pInterForm->GetHighlightAlpha(); | 885 uint8_t alpha = m_pInterForm->GetHighlightAlpha(); |
886 | 886 |
887 CFX_FloatRect rcDevice; | 887 CFX_FloatRect rcDevice; |
888 ASSERT(m_pInterForm->GetDocument()); | 888 ASSERT(m_pInterForm->GetDocument()); |
889 CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()->GetEnv(); | 889 CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()->GetEnv(); |
890 if (!pEnv) | 890 if (!pEnv) |
891 return; | 891 return; |
892 CFX_AffineMatrix page2device; | 892 CFX_Matrix page2device; |
893 pPageView->GetCurrentMatrix(page2device); | 893 pPageView->GetCurrentMatrix(page2device); |
894 page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom), | 894 page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom), |
895 rcDevice.left, rcDevice.bottom); | 895 rcDevice.left, rcDevice.bottom); |
896 page2device.Transform(((FX_FLOAT)rc.right), ((FX_FLOAT)rc.top), | 896 page2device.Transform(((FX_FLOAT)rc.right), ((FX_FLOAT)rc.top), |
897 rcDevice.right, rcDevice.top); | 897 rcDevice.right, rcDevice.top); |
898 | 898 |
899 rcDevice.Normalize(); | 899 rcDevice.Normalize(); |
900 | 900 |
901 FX_ARGB argb = ArgbEncode((int)alpha, color); | 901 FX_ARGB argb = ArgbEncode((int)alpha, color); |
902 FX_RECT rcDev((int)rcDevice.left, (int)rcDevice.top, (int)rcDevice.right, | 902 FX_RECT rcDev((int)rcDevice.left, (int)rcDevice.top, (int)rcDevice.right, |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 default: | 1824 default: |
1825 nBorderStyle = PBS_SOLID; | 1825 nBorderStyle = PBS_SOLID; |
1826 break; | 1826 break; |
1827 } | 1827 } |
1828 | 1828 |
1829 return CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, | 1829 return CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, |
1830 crLeftTop, crRightBottom, nBorderStyle, | 1830 crLeftTop, crRightBottom, nBorderStyle, |
1831 dsBorder); | 1831 dsBorder); |
1832 } | 1832 } |
1833 | 1833 |
1834 CPDF_Matrix CPDFSDK_Widget::GetMatrix() const { | 1834 CFX_Matrix CPDFSDK_Widget::GetMatrix() const { |
1835 CPDF_Matrix mt; | 1835 CFX_Matrix mt; |
1836 CPDF_FormControl* pControl = GetFormControl(); | 1836 CPDF_FormControl* pControl = GetFormControl(); |
1837 ASSERT(pControl != NULL); | 1837 ASSERT(pControl != NULL); |
1838 | 1838 |
1839 CPDF_Rect rcAnnot = GetRect(); | 1839 CPDF_Rect rcAnnot = GetRect(); |
1840 FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left; | 1840 FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left; |
1841 FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom; | 1841 FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom; |
1842 | 1842 |
1843 switch (abs(pControl->GetRotation() % 360)) { | 1843 switch (abs(pControl->GetRotation() % 360)) { |
1844 case 0: | 1844 case 0: |
1845 default: | 1845 default: |
1846 mt = CPDF_Matrix(1, 0, 0, 1, 0, 0); | 1846 mt = CFX_Matrix(1, 0, 0, 1, 0, 0); |
1847 break; | 1847 break; |
1848 case 90: | 1848 case 90: |
1849 mt = CPDF_Matrix(0, 1, -1, 0, fWidth, 0); | 1849 mt = CFX_Matrix(0, 1, -1, 0, fWidth, 0); |
1850 break; | 1850 break; |
1851 case 180: | 1851 case 180: |
1852 mt = CPDF_Matrix(-1, 0, 0, -1, fWidth, fHeight); | 1852 mt = CFX_Matrix(-1, 0, 0, -1, fWidth, fHeight); |
1853 break; | 1853 break; |
1854 case 270: | 1854 case 270: |
1855 mt = CPDF_Matrix(0, -1, 1, 0, 0, fHeight); | 1855 mt = CFX_Matrix(0, -1, 1, 0, 0, fHeight); |
1856 break; | 1856 break; |
1857 } | 1857 } |
1858 | 1858 |
1859 return mt; | 1859 return mt; |
1860 } | 1860 } |
1861 | 1861 |
1862 CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const { | 1862 CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const { |
1863 CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0); | 1863 CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0); |
1864 | 1864 |
1865 CPDF_FormControl* pFormCtrl = GetFormControl(); | 1865 CPDF_FormControl* pFormCtrl = GetFormControl(); |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3140 break; | 3140 break; |
3141 } | 3141 } |
3142 } | 3142 } |
3143 } | 3143 } |
3144 | 3144 |
3145 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { | 3145 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { |
3146 CPDF_Rect rcAnnot; | 3146 CPDF_Rect rcAnnot; |
3147 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); | 3147 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); |
3148 return rcAnnot; | 3148 return rcAnnot; |
3149 } | 3149 } |
OLD | NEW |