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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 ms.m_dwCmd = FWL_MouseCommand::Leave; | 364 ms.m_dwCmd = FWL_MouseCommand::Leave; |
365 ms.m_pDstTarget = m_pNormalWidget; | 365 ms.m_pDstTarget = m_pNormalWidget; |
366 TranslateFWLMessage(&ms); | 366 TranslateFWLMessage(&ms); |
367 return true; | 367 return true; |
368 } | 368 } |
369 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { | 369 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { |
370 if (!m_pNormalWidget) { | 370 if (!m_pNormalWidget) { |
371 return; | 371 return; |
372 } | 372 } |
373 CFX_RectF rtWidget; | 373 CFX_RectF rtWidget; |
374 m_pNormalWidget->GetWidgetRect(rtWidget); | 374 m_pNormalWidget->GetWidgetRect(rtWidget, false); |
375 fx -= rtWidget.left; | 375 fx -= rtWidget.left; |
376 fy -= rtWidget.top; | 376 fy -= rtWidget.top; |
377 } | 377 } |
378 bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 378 bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
379 if (!m_pNormalWidget) { | 379 if (!m_pNormalWidget) { |
380 return false; | 380 return false; |
381 } | 381 } |
382 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || | 382 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || |
383 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 383 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
384 return false; | 384 return false; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 return FWL_WidgetHit::Border; | 606 return FWL_WidgetHit::Border; |
607 } | 607 } |
608 bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { | 608 bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { |
609 return true; | 609 return true; |
610 } | 610 } |
611 bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { | 611 bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { |
612 if (!m_pNormalWidget) { | 612 if (!m_pNormalWidget) { |
613 return false; | 613 return false; |
614 } | 614 } |
615 CFX_RectF rtWidget; | 615 CFX_RectF rtWidget; |
616 m_pNormalWidget->GetWidgetRect(rtWidget); | 616 m_pNormalWidget->GetWidgetRect(rtWidget, false); |
617 if (rtWidget.Contains(fx, fy)) { | 617 if (rtWidget.Contains(fx, fy)) { |
618 return true; | 618 return true; |
619 } | 619 } |
620 return false; | 620 return false; |
621 } | 621 } |
622 void CXFA_FFField::LayoutCaption() { | 622 void CXFA_FFField::LayoutCaption() { |
623 CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); | 623 CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); |
624 if (!pCapTextLayout) | 624 if (!pCapTextLayout) |
625 return; | 625 return; |
626 | 626 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); | 812 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); |
813 break; | 813 break; |
814 } | 814 } |
815 default: | 815 default: |
816 break; | 816 break; |
817 } | 817 } |
818 } | 818 } |
819 | 819 |
820 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 820 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
821 const CFX_Matrix* pMatrix) {} | 821 const CFX_Matrix* pMatrix) {} |
OLD | NEW |