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/fxfa/app/xfa_ffsignature.h" | 7 #include "xfa/fxfa/app/xfa_ffsignature.h" |
8 | 8 |
9 #include "xfa/fxfa/app/xfa_fffield.h" | 9 #include "xfa/fxfa/app/xfa_fffield.h" |
10 #include "xfa/fxfa/xfa_ffdoc.h" | 10 #include "xfa/fxfa/xfa_ffdoc.h" |
11 #include "xfa/fxfa/xfa_ffpageview.h" | 11 #include "xfa/fxfa/xfa_ffpageview.h" |
12 #include "xfa/fxfa/xfa_ffwidget.h" | 12 #include "xfa/fxfa/xfa_ffwidget.h" |
13 | 13 |
14 CXFA_FFSignature::CXFA_FFSignature(CXFA_FFPageView* pPageView, | 14 CXFA_FFSignature::CXFA_FFSignature(CXFA_FFPageView* pPageView, |
15 CXFA_WidgetAcc* pDataAcc) | 15 CXFA_WidgetAcc* pDataAcc) |
16 : CXFA_FFField(pPageView, pDataAcc) {} | 16 : CXFA_FFField(pPageView, pDataAcc) {} |
17 CXFA_FFSignature::~CXFA_FFSignature() {} | 17 CXFA_FFSignature::~CXFA_FFSignature() {} |
18 FX_BOOL CXFA_FFSignature::LoadWidget() { | 18 bool CXFA_FFSignature::LoadWidget() { |
19 return CXFA_FFField::LoadWidget(); | 19 return CXFA_FFField::LoadWidget(); |
20 } | 20 } |
21 void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, | 21 void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, |
22 CFX_Matrix* pMatrix, | 22 CFX_Matrix* pMatrix, |
23 uint32_t dwStatus) { | 23 uint32_t dwStatus) { |
24 if (!IsMatchVisibleStatus(dwStatus)) { | 24 if (!IsMatchVisibleStatus(dwStatus)) { |
25 return; | 25 return; |
26 } | 26 } |
27 CFX_Matrix mtRotate; | 27 CFX_Matrix mtRotate; |
28 GetRotateMatrix(mtRotate); | 28 GetRotateMatrix(mtRotate); |
29 if (pMatrix) { | 29 if (pMatrix) { |
30 mtRotate.Concat(*pMatrix); | 30 mtRotate.Concat(*pMatrix); |
31 } | 31 } |
32 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); | 32 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); |
33 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); | 33 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); |
34 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); | 34 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); |
35 RenderCaption(pGS, &mtRotate); | 35 RenderCaption(pGS, &mtRotate); |
36 DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); | 36 DrawHighlight(pGS, &mtRotate, dwStatus, false); |
37 } | 37 } |
38 | 38 |
39 FX_BOOL CXFA_FFSignature::OnMouseEnter() { | 39 bool CXFA_FFSignature::OnMouseEnter() { |
40 return FALSE; | 40 return false; |
41 } | 41 } |
42 FX_BOOL CXFA_FFSignature::OnMouseExit() { | 42 bool CXFA_FFSignature::OnMouseExit() { |
43 return FALSE; | 43 return false; |
44 } | 44 } |
45 FX_BOOL CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags, | 45 bool CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags, |
46 FX_FLOAT fx, | 46 FX_FLOAT fx, |
47 FX_FLOAT fy) { | 47 FX_FLOAT fy) { |
48 return FALSE; | 48 return false; |
49 } | 49 } |
50 FX_BOOL CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags, | 50 bool CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
51 FX_FLOAT fx, | 51 return false; |
52 FX_FLOAT fy) { | |
53 return FALSE; | |
54 } | 52 } |
55 FX_BOOL CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags, | 53 bool CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags, |
56 FX_FLOAT fx, | |
57 FX_FLOAT fy) { | |
58 return FALSE; | |
59 } | |
60 FX_BOOL CXFA_FFSignature::OnMouseMove(uint32_t dwFlags, | |
61 FX_FLOAT fx, | |
62 FX_FLOAT fy) { | |
63 return FALSE; | |
64 } | |
65 FX_BOOL CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags, | |
66 int16_t zDelta, | |
67 FX_FLOAT fx, | 54 FX_FLOAT fx, |
68 FX_FLOAT fy) { | 55 FX_FLOAT fy) { |
69 return FALSE; | 56 return false; |
70 } | 57 } |
71 FX_BOOL CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags, | 58 bool CXFA_FFSignature::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
72 FX_FLOAT fx, | 59 return false; |
73 FX_FLOAT fy) { | |
74 return FALSE; | |
75 } | 60 } |
76 FX_BOOL CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags, | 61 bool CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags, |
77 FX_FLOAT fx, | 62 int16_t zDelta, |
78 FX_FLOAT fy) { | 63 FX_FLOAT fx, |
79 return FALSE; | 64 FX_FLOAT fy) { |
| 65 return false; |
80 } | 66 } |
81 FX_BOOL CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags, | 67 bool CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags, |
82 FX_FLOAT fx, | 68 FX_FLOAT fx, |
83 FX_FLOAT fy) { | 69 FX_FLOAT fy) { |
84 return FALSE; | 70 return false; |
85 } | 71 } |
86 FX_BOOL CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { | 72 bool CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
87 return FALSE; | 73 return false; |
88 } | 74 } |
89 FX_BOOL CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { | 75 bool CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags, |
90 return FALSE; | 76 FX_FLOAT fx, |
| 77 FX_FLOAT fy) { |
| 78 return false; |
91 } | 79 } |
92 FX_BOOL CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) { | 80 bool CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { |
93 return FALSE; | 81 return false; |
| 82 } |
| 83 bool CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { |
| 84 return false; |
| 85 } |
| 86 bool CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) { |
| 87 return false; |
94 } | 88 } |
95 FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { | 89 FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { |
96 if (m_pNormalWidget) { | 90 if (m_pNormalWidget) { |
97 FX_FLOAT ffx = fx, ffy = fy; | 91 FX_FLOAT ffx = fx, ffy = fy; |
98 FWLToClient(ffx, ffy); | 92 FWLToClient(ffx, ffy); |
99 if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown) | 93 if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown) |
100 return FWL_WidgetHit::Client; | 94 return FWL_WidgetHit::Client; |
101 } | 95 } |
102 CFX_RectF rtBox; | 96 CFX_RectF rtBox; |
103 GetRectWithoutRotate(rtBox); | 97 GetRectWithoutRotate(rtBox); |
104 if (!rtBox.Contains(fx, fy)) | 98 if (!rtBox.Contains(fx, fy)) |
105 return FWL_WidgetHit::Unknown; | 99 return FWL_WidgetHit::Unknown; |
106 if (m_rtCaption.Contains(fx, fy)) | 100 if (m_rtCaption.Contains(fx, fy)) |
107 return FWL_WidgetHit::Titlebar; | 101 return FWL_WidgetHit::Titlebar; |
108 return FWL_WidgetHit::Client; | 102 return FWL_WidgetHit::Client; |
109 } | 103 } |
110 FX_BOOL CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { | 104 bool CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { |
111 return FALSE; | 105 return false; |
112 } | 106 } |
OLD | NEW |