diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-28 10:51:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 10:51:13 -0700 |
commit | 7322343b9322b93d97077575f95a00dcca3f0451 (patch) | |
tree | 36337e0a2aff2147a9067477f982496129f0f7a1 /xfa/fwl/core/fwl_formimp.cpp | |
parent | e6ebf7af7ea94d48091be300cec84b499d3b8ae0 (diff) | |
download | pdfium-7322343b9322b93d97077575f95a00dcca3f0451.tar.xz |
More FWL interface cleanup.
This CL merges the IFWL_Target class into IFWL_Widget and IFWL_Thread into
IFWL_App. The IFWL_WidgetMgrDelegate, IFWL_NoteDriver and IFWL_NotThread are
removed in favour of their concrete classes.
Review-Url: https://codereview.chromium.org/1921853006
Diffstat (limited to 'xfa/fwl/core/fwl_formimp.cpp')
-rw-r--r-- | xfa/fwl/core/fwl_formimp.cpp | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp index e31f7e8202..815aca974c 100644 --- a/xfa/fwl/core/fwl_formimp.cpp +++ b/xfa/fwl/core/fwl_formimp.cpp @@ -14,8 +14,6 @@ #include "xfa/fwl/core/cfwl_themetext.h" #include "xfa/fwl/core/fwl_appimp.h" #include "xfa/fwl/core/fwl_noteimp.h" -#include "xfa/fwl/core/fwl_targetimp.h" -#include "xfa/fwl/core/fwl_threadimp.h" #include "xfa/fwl/core/fwl_widgetimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" @@ -389,12 +387,14 @@ FWL_ERR CFWL_FormImp::SetFormSize(FWL_FORMSIZE eFormSize) { return FWL_ERR_Succeeded; } IFWL_Widget* CFWL_FormImp::DoModal() { - IFWL_Thread* pThread = GetOwnerThread(); - if (!pThread) - return NULL; - IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); + IFWL_App* pApp = GetOwnerApp(); + if (!pApp) + return nullptr; + + CFWL_NoteDriver* pDriver = pApp->GetNoteDriver(); if (!pDriver) - return NULL; + return nullptr; + m_pNoteLoop = new CFWL_NoteLoop(this); pDriver->PushNoteLoop(m_pNoteLoop); m_bDoModalFlag = TRUE; @@ -417,13 +417,15 @@ FWL_ERR CFWL_FormImp::EndDoModal() { m_bDoModalFlag = FALSE; #if (_FX_OS_ == _FX_MACOSX_) m_pNoteLoop->EndModalLoop(); - IFWL_Thread* pThread = GetOwnerThread(); - if (!pThread) + IFWL_App* pApp = GetOwnerApp(); + if (!pApp) return FWL_ERR_Indefinite; + CFWL_NoteDriver* pDriver = - static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); + static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); if (!pDriver) return FWL_ERR_Indefinite; + pDriver->PopNoteLoop(); SetStates(FWL_WGTSTATE_Invisible, TRUE); return FWL_ERR_Succeeded; @@ -745,23 +747,27 @@ void CFWL_FormImp::ReSetSysBtn() { } } void CFWL_FormImp::RegisterForm() { - IFWL_Thread* pThread = GetOwnerThread(); - if (!pThread) + IFWL_App* pApp = GetOwnerApp(); + if (!pApp) return; + CFWL_NoteDriver* pDriver = - static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); + static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); if (!pDriver) return; + pDriver->RegisterForm(this); } void CFWL_FormImp::UnRegisterForm() { - IFWL_Thread* pThread = GetOwnerThread(); - if (!pThread) + IFWL_App* pApp = GetOwnerApp(); + if (!pApp) return; + CFWL_NoteDriver* pDriver = - static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); + static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); if (!pDriver) return; + pDriver->UnRegisterForm(this); } FX_BOOL CFWL_FormImp::IsDoModal() { @@ -888,9 +894,9 @@ int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { switch (pMessage->GetClassID()) { case CFWL_MessageType::Activate: { m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated; - IFWL_Thread* pThread = m_pOwner->GetOwnerThread(); + IFWL_App* pApp = m_pOwner->GetOwnerApp(); CFWL_NoteDriver* pDriver = - static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); + static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); CFWL_WidgetImp* pSubFocusImp = m_pOwner->GetSubFocus(); IFWL_Widget* pSubFocus = pSubFocusImp ? pSubFocusImp->GetInterface() : nullptr; @@ -902,9 +908,9 @@ int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { } case CFWL_MessageType::Deactivate: { m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Deactivated; - IFWL_Thread* pThread = m_pOwner->GetOwnerThread(); + IFWL_App* pApp = m_pOwner->GetOwnerApp(); CFWL_NoteDriver* pDriver = - static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); + static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); CFWL_WidgetImp* pSubFocusImp = m_pOwner->GetSubFocus(); IFWL_Widget* pSubFocus = pSubFocusImp ? pSubFocusImp->GetInterface() : nullptr; |