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_fffield.h" | 7 #include "xfa/fxfa/app/xfa_fffield.h" |
8 | 8 |
9 #include "xfa/fwl/core/cfwl_edit.h" | 9 #include "xfa/fwl/core/cfwl_edit.h" |
10 #include "xfa/fwl/core/cfwl_evtmouse.h" | 10 #include "xfa/fwl/core/cfwl_evtmouse.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 GetRotateMatrix(mtRotate); | 63 GetRotateMatrix(mtRotate); |
64 if (pMatrix) { | 64 if (pMatrix) { |
65 mtRotate.Concat(*pMatrix); | 65 mtRotate.Concat(*pMatrix); |
66 } | 66 } |
67 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); | 67 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); |
68 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); | 68 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); |
69 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); | 69 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); |
70 RenderCaption(pGS, &mtRotate); | 70 RenderCaption(pGS, &mtRotate); |
71 DrawHighlight(pGS, &mtRotate, dwStatus, false); | 71 DrawHighlight(pGS, &mtRotate, dwStatus, false); |
72 CFX_RectF rtWidget; | 72 CFX_RectF rtWidget; |
73 m_pNormalWidget->GetWidgetRect(rtWidget); | 73 m_pNormalWidget->GetWidgetRect(rtWidget, false); |
74 CFX_Matrix mt; | 74 CFX_Matrix mt; |
75 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); | 75 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); |
76 mt.Concat(mtRotate); | 76 mt.Concat(mtRotate); |
77 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget, pGS, &mt); | 77 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget, pGS, &mt); |
78 } | 78 } |
79 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, | 79 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, |
80 CFX_Matrix* pMatrix, | 80 CFX_Matrix* pMatrix, |
81 uint32_t dwStatus, | 81 uint32_t dwStatus, |
82 bool bEllipse) { | 82 bool bEllipse) { |
83 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 83 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 CFWL_MsgMouse ms(nullptr, m_pNormalWidget); | 361 CFWL_MsgMouse ms(nullptr, m_pNormalWidget); |
362 ms.m_dwCmd = FWL_MouseCommand::Leave; | 362 ms.m_dwCmd = FWL_MouseCommand::Leave; |
363 TranslateFWLMessage(&ms); | 363 TranslateFWLMessage(&ms); |
364 return true; | 364 return true; |
365 } | 365 } |
366 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { | 366 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { |
367 if (!m_pNormalWidget) { | 367 if (!m_pNormalWidget) { |
368 return; | 368 return; |
369 } | 369 } |
370 CFX_RectF rtWidget; | 370 CFX_RectF rtWidget; |
371 m_pNormalWidget->GetWidgetRect(rtWidget); | 371 m_pNormalWidget->GetWidgetRect(rtWidget, false); |
372 fx -= rtWidget.left; | 372 fx -= rtWidget.left; |
373 fy -= rtWidget.top; | 373 fy -= rtWidget.top; |
374 } | 374 } |
375 bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 375 bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
376 if (!m_pNormalWidget) { | 376 if (!m_pNormalWidget) { |
377 return false; | 377 return false; |
378 } | 378 } |
379 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || | 379 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || |
380 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 380 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
381 return false; | 381 return false; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 return FWL_WidgetHit::Border; | 586 return FWL_WidgetHit::Border; |
587 } | 587 } |
588 bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { | 588 bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { |
589 return true; | 589 return true; |
590 } | 590 } |
591 bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { | 591 bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { |
592 if (!m_pNormalWidget) { | 592 if (!m_pNormalWidget) { |
593 return false; | 593 return false; |
594 } | 594 } |
595 CFX_RectF rtWidget; | 595 CFX_RectF rtWidget; |
596 m_pNormalWidget->GetWidgetRect(rtWidget); | 596 m_pNormalWidget->GetWidgetRect(rtWidget, false); |
597 if (rtWidget.Contains(fx, fy)) { | 597 if (rtWidget.Contains(fx, fy)) { |
598 return true; | 598 return true; |
599 } | 599 } |
600 return false; | 600 return false; |
601 } | 601 } |
602 void CXFA_FFField::LayoutCaption() { | 602 void CXFA_FFField::LayoutCaption() { |
603 CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); | 603 CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); |
604 if (!pCapTextLayout) | 604 if (!pCapTextLayout) |
605 return; | 605 return; |
606 | 606 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); | 792 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); |
793 break; | 793 break; |
794 } | 794 } |
795 default: | 795 default: |
796 break; | 796 break; |
797 } | 797 } |
798 } | 798 } |
799 | 799 |
800 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 800 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
801 const CFX_Matrix* pMatrix) {} | 801 const CFX_Matrix* pMatrix) {} |
OLD | NEW |