diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-07 17:01:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-07 17:01:58 -0800 |
commit | 4614b45a6592530c4cd930f139c366ce20d359f4 (patch) | |
tree | 72a6098a19945cfbdf0877e6e2ba02323ebde33f /xfa/fxfa/app/xfa_fffield.cpp | |
parent | 248cb27e64b3a25230f53fc2f4ab9d483facc5f9 (diff) | |
download | pdfium-4614b45a6592530c4cd930f139c366ce20d359f4.tar.xz |
Cleanup FWL Event and Message code.
This CL removes any CFWL_Evt classes for which nothing was listening to the
events. For events with no parameters the override class was removed and
the event type passed into CFWL_Event which is used instead. Any event or
message parameters which are un-read have been removed.
Review-Url: https://codereview.chromium.org/2530993002
Diffstat (limited to 'xfa/fxfa/app/xfa_fffield.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_fffield.cpp | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index 43efb5ee90..689a0b5469 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -349,10 +349,8 @@ bool CXFA_FFField::OnMouseEnter() { if (!m_pNormalWidget) { return false; } - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::Enter; - ms.m_pDstTarget = m_pNormalWidget; - ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return true; } @@ -360,9 +358,8 @@ bool CXFA_FFField::OnMouseExit() { if (!m_pNormalWidget) { return false; } - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::Leave; - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -387,13 +384,12 @@ bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return false; } SetButtonDown(true); - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -405,13 +401,12 @@ bool CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return false; } SetButtonDown(false); - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -419,13 +414,12 @@ bool CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { return false; } - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -433,13 +427,12 @@ bool CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { return false; } - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::Move; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -450,14 +443,13 @@ bool CXFA_FFField::OnMouseWheel(uint32_t dwFlags, if (!m_pNormalWidget) { return false; } - CFWL_MsgMouseWheel ms; + CFWL_MsgMouseWheel ms(nullptr, m_pNormalWidget); ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); ms.m_fDeltaX = zDelta; ms.m_fDeltaY = 0; - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -473,13 +465,13 @@ bool CXFA_FFField::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return false; } SetButtonDown(true); - CFWL_MsgMouse ms; + + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::RightButtonDown; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -491,13 +483,12 @@ bool CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return false; } SetButtonDown(false); - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::RightButtonUp; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -505,13 +496,12 @@ bool CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { return false; } - CFWL_MsgMouse ms; + CFWL_MsgMouse ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk; ms.m_dwFlags = dwFlags; ms.m_fx = fx; ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); - ms.m_pDstTarget = m_pNormalWidget; TranslateFWLMessage(&ms); return true; } @@ -521,9 +511,7 @@ bool CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { if (!m_pNormalWidget) { return false; } - CFWL_MsgSetFocus ms; - ms.m_pDstTarget = m_pNormalWidget; - ms.m_pSrcTarget = nullptr; + CFWL_MsgSetFocus ms(nullptr, m_pNormalWidget); TranslateFWLMessage(&ms); m_dwStatus |= XFA_WidgetStatus_Focused; AddInvalidateRect(); @@ -533,9 +521,7 @@ bool CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { if (!m_pNormalWidget) { return CXFA_FFWidget::OnKillFocus(pNewWidget); } - CFWL_MsgKillFocus ms; - ms.m_pDstTarget = m_pNormalWidget; - ms.m_pSrcTarget = nullptr; + CFWL_MsgKillFocus ms(nullptr, m_pNormalWidget); TranslateFWLMessage(&ms); m_dwStatus &= ~XFA_WidgetStatus_Focused; AddInvalidateRect(); @@ -546,12 +532,10 @@ bool CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { return false; } - CFWL_MsgKey ms; + CFWL_MsgKey ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_KeyCommand::KeyDown; ms.m_dwFlags = dwFlags; ms.m_dwKeyCode = dwKeyCode; - ms.m_pDstTarget = m_pNormalWidget; - ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return true; } @@ -559,12 +543,10 @@ bool CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { return false; } - CFWL_MsgKey ms; + CFWL_MsgKey ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_KeyCommand::KeyUp; ms.m_dwFlags = dwFlags; ms.m_dwKeyCode = dwKeyCode; - ms.m_pDstTarget = m_pNormalWidget; - ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return true; } @@ -581,12 +563,10 @@ bool CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { return false; } - CFWL_MsgKey ms; + CFWL_MsgKey ms(nullptr, m_pNormalWidget); ms.m_dwCmd = FWL_KeyCommand::Char; ms.m_dwFlags = dwFlags; ms.m_dwKeyCode = dwChar; - ms.m_pDstTarget = m_pNormalWidget; - ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); return true; } @@ -779,8 +759,8 @@ void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { void CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) {} void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { - switch (pEvent->GetClassID()) { - case CFWL_EventType::Mouse: { + switch (pEvent->GetType()) { + case CFWL_Event::Type::Mouse: { CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent; if (event->m_dwCmd == FWL_MouseCommand::Enter) { CXFA_EventParam eParam; @@ -805,7 +785,7 @@ void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { } break; } - case CFWL_EventType::Click: { + case CFWL_Event::Type::Click: { CXFA_EventParam eParam; eParam.m_eType = XFA_EVENT_Click; eParam.m_pTarget = m_pDataAcc; |