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/fwl/core/cfwl_notedriver.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/fwl/core/cfwl_notedriver.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_notedriver.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/xfa/fwl/core/cfwl_notedriver.cpp b/xfa/fwl/core/cfwl_notedriver.cpp index 06d8fd5df9..00a0b3e4b7 100644 --- a/xfa/fwl/core/cfwl_notedriver.cpp +++ b/xfa/fwl/core/cfwl_notedriver.cpp @@ -91,9 +91,7 @@ bool CFWL_NoteDriver::SetFocus(CFWL_Widget* pFocus, bool bNotify) { CFWL_Widget* pPrev = m_pFocus; m_pFocus = pFocus; if (pPrev) { - CFWL_MsgKillFocus ms; - ms.m_pDstTarget = pPrev; - ms.m_pSrcTarget = pPrev; + CFWL_MsgKillFocus ms(pPrev, pPrev); if (bNotify) ms.m_dwExtend = 1; @@ -107,8 +105,7 @@ bool CFWL_NoteDriver::SetFocus(CFWL_Widget* pFocus, bool bNotify) { if (pForm) pForm->SetSubFocus(pFocus); - CFWL_MsgSetFocus ms; - ms.m_pDstTarget = pFocus; + CFWL_MsgSetFocus ms(nullptr, pFocus); if (bNotify) ms.m_dwExtend = 1; if (IFWL_WidgetDelegate* pDelegate = pFocus->GetDelegate()) @@ -222,34 +219,34 @@ void CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) { if (!DispatchMessage(pMessage, pMessageForm)) return; - if (pMessage->GetClassID() == CFWL_MessageType::Mouse) + if (pMessage->GetType() == CFWL_Message::Type::Mouse) MouseSecondary(pMessage); } bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, CFWL_Widget* pMessageForm) { - switch (pMessage->GetClassID()) { - case CFWL_MessageType::SetFocus: { + switch (pMessage->GetType()) { + case CFWL_Message::Type::SetFocus: { if (!DoSetFocus(pMessage, pMessageForm)) return false; break; } - case CFWL_MessageType::KillFocus: { + case CFWL_Message::Type::KillFocus: { if (!DoKillFocus(pMessage, pMessageForm)) return false; break; } - case CFWL_MessageType::Key: { + case CFWL_Message::Type::Key: { if (!DoKey(pMessage, pMessageForm)) return false; break; } - case CFWL_MessageType::Mouse: { + case CFWL_Message::Type::Mouse: { if (!DoMouse(pMessage, pMessageForm)) return false; break; } - case CFWL_MessageType::MouseWheel: { + case CFWL_Message::Type::MouseWheel: { if (!DoWheel(pMessage, pMessageForm)) return false; break; @@ -416,8 +413,7 @@ void CFWL_NoteDriver::MouseSecondary(CFWL_Message* pMessage) { CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); if (m_pHover) { - CFWL_MsgMouse msLeave; - msLeave.m_pDstTarget = m_pHover; + CFWL_MsgMouse msLeave(nullptr, m_pHover); msLeave.m_fx = pMsg->m_fx; msLeave.m_fy = pMsg->m_fy; pTarget->TransformTo(m_pHover, msLeave.m_fx, msLeave.m_fy); @@ -432,8 +428,7 @@ void CFWL_NoteDriver::MouseSecondary(CFWL_Message* pMessage) { } m_pHover = pTarget; - CFWL_MsgMouse msHover; - msHover.m_pDstTarget = pTarget; + CFWL_MsgMouse msHover(nullptr, pTarget); msHover.m_fx = pMsg->m_fx; msHover.m_fy = pMsg->m_fy; msHover.m_dwFlags = 0; |