diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-16 07:01:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-16 07:01:26 -0800 |
commit | 72f957a0bafaf7c9628980e404c471b54f42de8f (patch) | |
tree | 1b6764bfdb0f87c01843397f16f191906d6810ec /xfa/fwl/core/fwl_noteimp.cpp | |
parent | f35650c8778522345d8a639f42add2874ffe44dd (diff) | |
download | pdfium-72f957a0bafaf7c9628980e404c471b54f42de8f.tar.xz |
Cleaning up nits in fwl/core files.chromium/2922
This Cl cleans up the nits in the first set of cfwl_* files. The unused Event
and Message classes are removed.
Review-Url: https://codereview.chromium.org/2505703003
Diffstat (limited to 'xfa/fwl/core/fwl_noteimp.cpp')
-rw-r--r-- | xfa/fwl/core/fwl_noteimp.cpp | 92 |
1 files changed, 2 insertions, 90 deletions
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp index f04d38d81b..716aa24e5f 100644 --- a/xfa/fwl/core/fwl_noteimp.cpp +++ b/xfa/fwl/core/fwl_noteimp.cpp @@ -232,15 +232,6 @@ bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm) { bool bRet = false; switch (pMessage->GetClassID()) { - case CFWL_MessageType::Activate: { - bRet = DoActivate(static_cast<CFWL_MsgActivate*>(pMessage), pMessageForm); - break; - } - case CFWL_MessageType::Deactivate: { - bRet = DoDeactivate(static_cast<CFWL_MsgDeactivate*>(pMessage), - pMessageForm); - break; - } case CFWL_MessageType::SetFocus: { bRet = DoSetFocus(static_cast<CFWL_MsgSetFocus*>(pMessage), pMessageForm); break; @@ -262,24 +253,6 @@ bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, bRet = DoWheel(static_cast<CFWL_MsgMouseWheel*>(pMessage), pMessageForm); break; } - case CFWL_MessageType::Size: { - bRet = DoSize(static_cast<CFWL_MsgSize*>(pMessage)); - break; - } - case CFWL_MessageType::Cursor: { - bRet = true; - break; - } - case CFWL_MessageType::WindowMove: { - bRet = DoWindowMove(static_cast<CFWL_MsgWindowMove*>(pMessage), - pMessageForm); - break; - } - case CFWL_MessageType::DropFiles: { - bRet = - DoDragFiles(static_cast<CFWL_MsgDropFiles*>(pMessage), pMessageForm); - break; - } default: { bRet = true; break; @@ -294,43 +267,6 @@ bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage, return bRet; } -bool CFWL_NoteDriver::DoActivate(CFWL_MsgActivate* pMsg, - IFWL_Widget* pMessageForm) { - pMsg->m_pDstTarget = pMessageForm; - return !!(pMsg->m_pDstTarget->GetStates() & FWL_WGTSTATE_Deactivated); -} - -bool CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg, - IFWL_Widget* pMessageForm) { - int32_t iTrackLoop = m_noteLoopQueue.GetSize(); - if (iTrackLoop <= 0) - return false; - if (iTrackLoop == 1) { - if (pMessageForm->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"))) { - return false; - } - if (pMsg->m_pSrcTarget && - pMsg->m_pSrcTarget->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"))) { - return false; - } - if (pMsg->m_pSrcTarget && - pMsg->m_pSrcTarget->GetClassID() == FWL_Type::ToolTip) { - return false; - } - return true; - } - IFWL_Widget* pDst = pMsg->m_pDstTarget; - if (!pDst) - return false; -#if (_FX_OS_ == _FX_MACOSX_) - if (pDst == pMessageForm && pDst->IsInstance(L"FWL_FORMPROXY")) { - return true; - } -#endif - return pDst != pMessageForm && - !pDst->IsInstance(FX_WSTRC(L"FWL_FORMPROXY")) && - !pMessageForm->IsInstance(FX_WSTRC(L"FWL_FORMPROXY")); -} bool CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm) { CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr(); @@ -444,23 +380,7 @@ bool CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg, pMsg->m_pDstTarget = pDst; return true; } -bool CFWL_NoteDriver::DoSize(CFWL_MsgSize* pMsg) { - CFWL_WidgetMgr* pWidgetMgr = - pMsg->m_pDstTarget->GetOwnerApp()->GetWidgetMgr(); - if (!pWidgetMgr) - return false; - pWidgetMgr->NotifySizeChanged(pMsg->m_pDstTarget, (FX_FLOAT)pMsg->m_iWidth, - (FX_FLOAT)pMsg->m_iHeight); - return true; -} -bool CFWL_NoteDriver::DoWindowMove(CFWL_MsgWindowMove* pMsg, - IFWL_Widget* pMessageForm) { - return pMsg->m_pDstTarget == pMessageForm; -} -bool CFWL_NoteDriver::DoDragFiles(CFWL_MsgDropFiles* pMsg, - IFWL_Widget* pMessageForm) { - return pMsg->m_pDstTarget == pMessageForm; -} + bool CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm) { CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr(); @@ -512,9 +432,6 @@ void CFWL_NoteDriver::MouseSecondary(CFWL_MsgMouse* pMsg) { DispatchMessage(&msHover, nullptr); } bool CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) { - if (pMessage->GetClassID() == CFWL_MessageType::Post) - return true; - int32_t iCount = m_noteLoopQueue.GetSize(); for (int32_t i = 0; i < iCount; i++) { CFWL_NoteLoop* pNoteLoop = static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[i]); @@ -591,8 +508,7 @@ bool CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) { IFWL_Widget* pSource = nullptr; uint32_t dwFilter = 0; m_eventSources.GetNextAssoc(pos, (void*&)pSource, dwFilter); - if (pSource == pEvent->m_pSrcTarget || - pEvent->GetClassID() == CFWL_EventType::Idle) { + if (pSource == pEvent->m_pSrcTarget) { if (IsFilterEvent(pEvent, dwFilter)) { pDelegate->OnProcessEvent(pEvent); return true; @@ -617,14 +533,10 @@ bool CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, case CFWL_EventType::SetFocus: case CFWL_EventType::KillFocus: return !!(dwFilter & FWL_EVENT_FOCUSCHANGED_MASK); - case CFWL_EventType::Draw: - return !!(dwFilter & FWL_EVENT_DRAW_MASK); case CFWL_EventType::Close: return !!(dwFilter & FWL_EVENT_CLOSE_MASK); case CFWL_EventType::SizeChanged: return !!(dwFilter & FWL_EVENT_SIZECHANGED_MASK); - case CFWL_EventType::Idle: - return !!(dwFilter & FWL_EVENT_IDLE_MASK); default: return !!(dwFilter & FWL_EVENT_CONTROL_MASK); } |