| 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_ffdoc.h" | 9 #include "xfa/fxfa/app/xfa_ffdoc.h" |
| 10 #include "xfa/fxfa/app/xfa_fffield.h" | 10 #include "xfa/fxfa/app/xfa_fffield.h" |
| 11 #include "xfa/fxfa/app/xfa_ffpageview.h" | 11 #include "xfa/fxfa/app/xfa_ffpageview.h" |
| 12 #include "xfa/fxfa/app/xfa_ffwidget.h" | 12 #include "xfa/fxfa/app/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 FX_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 FX_DWORD dwStatus, | 23 uint32_t dwStatus, |
| 24 int32_t iRotate) { | 24 int32_t iRotate) { |
| 25 if (!IsMatchVisibleStatus(dwStatus)) { | 25 if (!IsMatchVisibleStatus(dwStatus)) { |
| 26 return; | 26 return; |
| 27 } | 27 } |
| 28 CFX_Matrix mtRotate; | 28 CFX_Matrix mtRotate; |
| 29 GetRotateMatrix(mtRotate); | 29 GetRotateMatrix(mtRotate); |
| 30 if (pMatrix) { | 30 if (pMatrix) { |
| 31 mtRotate.Concat(*pMatrix); | 31 mtRotate.Concat(*pMatrix); |
| 32 } | 32 } |
| 33 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); | 33 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); |
| 34 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); | 34 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); |
| 35 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); | 35 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); |
| 36 RenderCaption(pGS, &mtRotate); | 36 RenderCaption(pGS, &mtRotate); |
| 37 DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); | 37 DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); |
| 38 CFX_RectF rtWidget = m_rtUI; | 38 CFX_RectF rtWidget = m_rtUI; |
| 39 IXFA_DocProvider* pDocProvider = m_pDataAcc->GetDoc()->GetDocProvider(); | 39 IXFA_DocProvider* pDocProvider = m_pDataAcc->GetDoc()->GetDocProvider(); |
| 40 FXSYS_assert(pDocProvider); | 40 FXSYS_assert(pDocProvider); |
| 41 pDocProvider->RenderCustomWidget(this, pGS, &mtRotate, rtWidget); | 41 pDocProvider->RenderCustomWidget(this, pGS, &mtRotate, rtWidget); |
| 42 } | 42 } |
| 43 FX_BOOL CXFA_FFSignature::OnMouseEnter() { | 43 FX_BOOL CXFA_FFSignature::OnMouseEnter() { |
| 44 return FALSE; | 44 return FALSE; |
| 45 } | 45 } |
| 46 FX_BOOL CXFA_FFSignature::OnMouseExit() { | 46 FX_BOOL CXFA_FFSignature::OnMouseExit() { |
| 47 return FALSE; | 47 return FALSE; |
| 48 } | 48 } |
| 49 FX_BOOL CXFA_FFSignature::OnLButtonDown(FX_DWORD dwFlags, | 49 FX_BOOL CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags, |
| 50 FX_FLOAT fx, | 50 FX_FLOAT fx, |
| 51 FX_FLOAT fy) { | 51 FX_FLOAT fy) { |
| 52 return FALSE; | 52 return FALSE; |
| 53 } | 53 } |
| 54 FX_BOOL CXFA_FFSignature::OnLButtonUp(FX_DWORD dwFlags, | 54 FX_BOOL CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags, |
| 55 FX_FLOAT fx, | 55 FX_FLOAT fx, |
| 56 FX_FLOAT fy) { | 56 FX_FLOAT fy) { |
| 57 return FALSE; | 57 return FALSE; |
| 58 } | 58 } |
| 59 FX_BOOL CXFA_FFSignature::OnLButtonDblClk(FX_DWORD dwFlags, | 59 FX_BOOL CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags, |
| 60 FX_FLOAT fx, | 60 FX_FLOAT fx, |
| 61 FX_FLOAT fy) { | 61 FX_FLOAT fy) { |
| 62 return FALSE; | 62 return FALSE; |
| 63 } | 63 } |
| 64 FX_BOOL CXFA_FFSignature::OnMouseMove(FX_DWORD dwFlags, | 64 FX_BOOL CXFA_FFSignature::OnMouseMove(uint32_t dwFlags, |
| 65 FX_FLOAT fx, | 65 FX_FLOAT fx, |
| 66 FX_FLOAT fy) { | 66 FX_FLOAT fy) { |
| 67 return FALSE; | 67 return FALSE; |
| 68 } | 68 } |
| 69 FX_BOOL CXFA_FFSignature::OnMouseWheel(FX_DWORD dwFlags, | 69 FX_BOOL CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags, |
| 70 int16_t zDelta, | 70 int16_t zDelta, |
| 71 FX_FLOAT fx, | 71 FX_FLOAT fx, |
| 72 FX_FLOAT fy) { | 72 FX_FLOAT fy) { |
| 73 return FALSE; | 73 return FALSE; |
| 74 } | 74 } |
| 75 FX_BOOL CXFA_FFSignature::OnRButtonDown(FX_DWORD dwFlags, | 75 FX_BOOL CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags, |
| 76 FX_FLOAT fx, | 76 FX_FLOAT fx, |
| 77 FX_FLOAT fy) { | 77 FX_FLOAT fy) { |
| 78 return FALSE; | 78 return FALSE; |
| 79 } | 79 } |
| 80 FX_BOOL CXFA_FFSignature::OnRButtonUp(FX_DWORD dwFlags, | 80 FX_BOOL CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags, |
| 81 FX_FLOAT fx, | 81 FX_FLOAT fx, |
| 82 FX_FLOAT fy) { | 82 FX_FLOAT fy) { |
| 83 return FALSE; | 83 return FALSE; |
| 84 } | 84 } |
| 85 FX_BOOL CXFA_FFSignature::OnRButtonDblClk(FX_DWORD dwFlags, | 85 FX_BOOL CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags, |
| 86 FX_FLOAT fx, | 86 FX_FLOAT fx, |
| 87 FX_FLOAT fy) { | 87 FX_FLOAT fy) { |
| 88 return FALSE; | 88 return FALSE; |
| 89 } | 89 } |
| 90 FX_BOOL CXFA_FFSignature::OnKeyDown(FX_DWORD dwKeyCode, FX_DWORD dwFlags) { | 90 FX_BOOL CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { |
| 91 return FALSE; | 91 return FALSE; |
| 92 } | 92 } |
| 93 FX_BOOL CXFA_FFSignature::OnKeyUp(FX_DWORD dwKeyCode, FX_DWORD dwFlags) { | 93 FX_BOOL CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { |
| 94 return FALSE; | 94 return FALSE; |
| 95 } | 95 } |
| 96 FX_BOOL CXFA_FFSignature::OnChar(FX_DWORD dwChar, FX_DWORD dwFlags) { | 96 FX_BOOL CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) { |
| 97 return FALSE; | 97 return FALSE; |
| 98 } | 98 } |
| 99 FX_DWORD CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { | 99 uint32_t CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 100 if (m_pNormalWidget) { | 100 if (m_pNormalWidget) { |
| 101 FX_FLOAT ffx = fx, ffy = fy; | 101 FX_FLOAT ffx = fx, ffy = fy; |
| 102 FWLToClient(ffx, ffy); | 102 FWLToClient(ffx, ffy); |
| 103 FX_DWORD dwWidgetHit = m_pNormalWidget->HitTest(ffx, ffy); | 103 uint32_t dwWidgetHit = m_pNormalWidget->HitTest(ffx, ffy); |
| 104 if (dwWidgetHit != FWL_WGTHITTEST_Unknown) { | 104 if (dwWidgetHit != FWL_WGTHITTEST_Unknown) { |
| 105 return FWL_WGTHITTEST_Client; | 105 return FWL_WGTHITTEST_Client; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 CFX_RectF rtBox; | 108 CFX_RectF rtBox; |
| 109 GetRectWithoutRotate(rtBox); | 109 GetRectWithoutRotate(rtBox); |
| 110 if (!rtBox.Contains(fx, fy)) { | 110 if (!rtBox.Contains(fx, fy)) { |
| 111 return FWL_WGTHITTEST_Unknown; | 111 return FWL_WGTHITTEST_Unknown; |
| 112 } | 112 } |
| 113 if (m_rtCaption.Contains(fx, fy)) { | 113 if (m_rtCaption.Contains(fx, fy)) { |
| 114 return FWL_WGTHITTEST_Titlebar; | 114 return FWL_WGTHITTEST_Titlebar; |
| 115 } | 115 } |
| 116 return FWL_WGTHITTEST_Client; | 116 return FWL_WGTHITTEST_Client; |
| 117 } | 117 } |
| 118 FX_BOOL CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { | 118 FX_BOOL CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { |
| 119 return FALSE; | 119 return FALSE; |
| 120 } | 120 } |
| OLD | NEW |