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 "xfa/src/fxfa/src/app/xfa_fffield.h" | 7 #include "xfa/src/fxfa/src/app/xfa_fffield.h" |
8 | 8 |
9 #include "xfa/include/fwl/basewidget/fwl_edit.h" | 9 #include "xfa/include/fwl/basewidget/fwl_edit.h" |
10 #include "xfa/include/fwl/core/fwl_widgetmgr.h" | 10 #include "xfa/include/fwl/core/fwl_widgetmgr.h" |
11 #include "xfa/include/fwl/lightwidget/edit.h" | 11 #include "xfa/include/fwl/lightwidget/edit.h" |
12 #include "xfa/include/fwl/lightwidget/picturebox.h" | 12 #include "xfa/include/fwl/lightwidget/picturebox.h" |
13 #include "xfa/src/fxfa/src/app/xfa_ffapp.h" | 13 #include "xfa/src/fxfa/src/app/xfa_ffapp.h" |
14 #include "xfa/src/fxfa/src/app/xfa_ffdoc.h" | 14 #include "xfa/src/fxfa/src/app/xfa_ffdoc.h" |
15 #include "xfa/src/fxfa/src/app/xfa_ffdocview.h" | 15 #include "xfa/src/fxfa/src/app/xfa_ffdocview.h" |
16 #include "xfa/src/fxfa/src/app/xfa_ffpageview.h" | 16 #include "xfa/src/fxfa/src/app/xfa_ffpageview.h" |
17 #include "xfa/src/fxfa/src/app/xfa_ffwidget.h" | 17 #include "xfa/src/fxfa/src/app/xfa_ffwidget.h" |
18 #include "xfa/src/fxfa/src/app/xfa_fwltheme.h" | 18 #include "xfa/src/fxfa/src/app/xfa_fwltheme.h" |
19 #include "xfa/src/fxfa/src/app/xfa_textlayout.h" | 19 #include "xfa/src/fxfa/src/app/xfa_textlayout.h" |
20 | 20 |
21 CXFA_FFField::CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) | 21 CXFA_FFField::CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) |
22 : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(NULL) { | 22 : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(NULL) { |
23 m_rtUI.Set(0, 0, 0, 0); | 23 m_rtUI.Set(0, 0, 0, 0); |
24 m_rtCaption.Set(0, 0, 0, 0); | 24 m_rtCaption.Set(0, 0, 0, 0); |
25 } | 25 } |
26 CXFA_FFField::~CXFA_FFField() { | 26 CXFA_FFField::~CXFA_FFField() { |
27 CXFA_FFField::UnloadWidget(); | 27 CXFA_FFField::UnloadWidget(); |
28 } | 28 } |
| 29 |
29 FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox, | 30 FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox, |
30 FX_DWORD dwStatus, | 31 FX_DWORD dwStatus, |
31 FX_BOOL bDrawFocus) { | 32 FX_BOOL bDrawFocus) { |
32 if (bDrawFocus) { | 33 if (!bDrawFocus) |
33 XFA_ELEMENT type = (XFA_ELEMENT)m_pDataAcc->GetUIType(); | 34 return CXFA_FFWidget::GetBBox(rtBox, dwStatus); |
34 if (type == XFA_ELEMENT_Button || type == XFA_ELEMENT_CheckButton || | 35 |
35 type == XFA_ELEMENT_ImageEdit || type == XFA_ELEMENT_Signature || | 36 XFA_ELEMENT type = (XFA_ELEMENT)m_pDataAcc->GetUIType(); |
36 type == XFA_ELEMENT_ChoiceList) { | 37 if (type == XFA_ELEMENT_Button || type == XFA_ELEMENT_CheckButton || |
37 rtBox = m_rtUI; | 38 type == XFA_ELEMENT_ImageEdit || type == XFA_ELEMENT_Signature || |
38 CFX_Matrix mt; | 39 type == XFA_ELEMENT_ChoiceList) { |
39 GetRotateMatrix(mt); | 40 rtBox = m_rtUI; |
40 mt.TransformRect(rtBox); | 41 CFX_Matrix mt; |
41 return TRUE; | 42 GetRotateMatrix(mt); |
42 } | 43 mt.TransformRect(rtBox); |
43 return FALSE; | 44 return TRUE; |
44 } | 45 } |
45 #ifndef _XFA_EMB | 46 return FALSE; |
46 return CXFA_FFWidget::GetBBox(rtBox, dwStatus); | |
47 #endif | |
48 GetRectWithoutRotate(rtBox); | |
49 if (m_pNormalWidget) { | |
50 CFX_RectF rtWidget; | |
51 m_pNormalWidget->GetWidgetRect(rtWidget); | |
52 rtBox.Union(rtWidget); | |
53 } | |
54 CFX_Matrix mt; | |
55 GetRotateMatrix(mt); | |
56 mt.TransformRect(rtBox); | |
57 return TRUE; | |
58 } | 47 } |
| 48 |
59 void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, | 49 void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, |
60 CFX_Matrix* pMatrix, | 50 CFX_Matrix* pMatrix, |
61 FX_DWORD dwStatus, | 51 FX_DWORD dwStatus, |
62 int32_t iRotate) { | 52 int32_t iRotate) { |
63 if (!IsMatchVisibleStatus(dwStatus)) { | 53 if (!IsMatchVisibleStatus(dwStatus)) { |
64 return; | 54 return; |
65 } | 55 } |
66 CFX_Matrix mtRotate; | 56 CFX_Matrix mtRotate; |
67 GetRotateMatrix(mtRotate); | 57 GetRotateMatrix(mtRotate); |
68 if (pMatrix) { | 58 if (pMatrix) { |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 break; | 826 break; |
837 } | 827 } |
838 default: {} | 828 default: {} |
839 } | 829 } |
840 return FWL_ERR_Succeeded; | 830 return FWL_ERR_Succeeded; |
841 } | 831 } |
842 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 832 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
843 const CFX_Matrix* pMatrix) { | 833 const CFX_Matrix* pMatrix) { |
844 return FWL_ERR_Succeeded; | 834 return FWL_ERR_Succeeded; |
845 } | 835 } |
OLD | NEW |