From 7adef41ed27ced7e18ee649a3d4f27a3cc00c51f Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 18 Apr 2016 06:49:02 -0700 Subject: Fold the FWL NoteThread classes up to the Thread classes. The NoteThread classes only contained one member and don't provide any added clarity. This CL moves the NoteDriver up to the Thread classes and removes the NoteThread classes. Review URL: https://codereview.chromium.org/1887703003 --- BUILD.gn | 1 - xfa.gyp | 1 - xfa/fwl/basewidget/fwl_comboboximp.cpp | 6 +++--- xfa/fwl/core/fwl_appimp.cpp | 4 ++-- xfa/fwl/core/fwl_appimp.h | 2 +- xfa/fwl/core/fwl_formimp.cpp | 12 ++++++------ xfa/fwl/core/fwl_noteimp.cpp | 4 ++-- xfa/fwl/core/fwl_noteimp.h | 2 +- xfa/fwl/core/fwl_threadimp.cpp | 17 +++-------------- xfa/fwl/core/fwl_threadimp.h | 22 ++++++++-------------- xfa/fwl/core/fwl_widgetimp.cpp | 22 +++++++++++----------- xfa/fwl/core/fwl_widgetimp.h | 10 +++++----- xfa/fwl/core/fwl_widgetmgrimp.cpp | 6 +++--- xfa/fwl/core/ifwl_app.h | 4 ++-- xfa/fwl/core/ifwl_notedriver.h | 4 ++-- xfa/fwl/core/ifwl_notethread.h | 19 ------------------- xfa/fwl/core/ifwl_thread.h | 8 +++----- xfa/fwl/core/ifwl_widget.h | 8 ++++---- xfa/fwl/lightwidget/cfwl_widget.cpp | 10 +++++----- 19 files changed, 61 insertions(+), 101 deletions(-) delete mode 100644 xfa/fwl/core/ifwl_notethread.h diff --git a/BUILD.gn b/BUILD.gn index 3fb5374975..a286d12c11 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1065,7 +1065,6 @@ if (pdf_enable_xfa) { "xfa/fwl/core/ifwl_form.h", "xfa/fwl/core/ifwl_notedriver.h", "xfa/fwl/core/ifwl_noteloop.h", - "xfa/fwl/core/ifwl_notethread.h", "xfa/fwl/core/ifwl_panel.h", "xfa/fwl/core/ifwl_target.h", "xfa/fwl/core/ifwl_themeprovider.h", diff --git a/xfa.gyp b/xfa.gyp index 8e050f7569..e2cedd08ed 100644 --- a/xfa.gyp +++ b/xfa.gyp @@ -210,7 +210,6 @@ "xfa/fwl/core/ifwl_form.h", "xfa/fwl/core/ifwl_notedriver.h", "xfa/fwl/core/ifwl_noteloop.h", - "xfa/fwl/core/ifwl_notethread.h", "xfa/fwl/core/ifwl_panel.h", "xfa/fwl/core/ifwl_target.h", "xfa/fwl/core/ifwl_themeprovider.h", diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp index 66d749a382..f066436622 100644 --- a/xfa/fwl/basewidget/fwl_comboboximp.cpp +++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp @@ -23,8 +23,8 @@ #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_notethread.h" #include "xfa/fwl/core/ifwl_themeprovider.h" +#include "xfa/fwl/core/ifwl_thread.h" // static IFWL_ComboBox* IFWL_ComboBox::Create( @@ -1773,7 +1773,7 @@ FWL_ERR CFWL_ComboProxyImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, return FWL_ERR_Succeeded; } void CFWL_ComboProxyImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { - IFWL_NoteThread* pThread = m_pForm->GetOwnerThread(); + IFWL_Thread* pThread = m_pForm->GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = @@ -1792,7 +1792,7 @@ void CFWL_ComboProxyImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { } void CFWL_ComboProxyImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { m_bLButtonDown = FALSE; - IFWL_NoteThread* pThread = m_pForm->GetOwnerThread(); + IFWL_Thread* pThread = m_pForm->GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = diff --git a/xfa/fwl/core/fwl_appimp.cpp b/xfa/fwl/core/fwl_appimp.cpp index 2cff349f82..8492be791f 100644 --- a/xfa/fwl/core/fwl_appimp.cpp +++ b/xfa/fwl/core/fwl_appimp.cpp @@ -42,7 +42,7 @@ FWL_ERR IFWL_App::Exit(int32_t iExitCode) { } CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter) - : CFWL_NoteThreadImp(pIface), + : CFWL_ThreadImp(pIface), m_pAdapterNative(pAdapter), m_pThemeProvider(nullptr) {} @@ -102,7 +102,7 @@ void FWL_SetApp(IFWL_App* pApp) { FWL_ERR FWL_SetFullScreen(IFWL_Widget* pWidget, FX_BOOL bFullScreen) { if (!pWidget) return FWL_ERR_Succeeded; - IFWL_NoteThread* pNoteTread = pWidget->GetOwnerThread(); + IFWL_Thread* pNoteTread = pWidget->GetOwnerThread(); if (!pNoteTread) return FWL_ERR_Succeeded; CFWL_NoteDriver* pNoteDriver = diff --git a/xfa/fwl/core/fwl_appimp.h b/xfa/fwl/core/fwl_appimp.h index f9ccabf9bc..a7130602fd 100644 --- a/xfa/fwl/core/fwl_appimp.h +++ b/xfa/fwl/core/fwl_appimp.h @@ -17,7 +17,7 @@ class IFWL_WidgetMgr; class IFWL_ThemeProvider; class IFWL_App; -class CFWL_AppImp : public CFWL_NoteThreadImp { +class CFWL_AppImp : public CFWL_ThreadImp { public: CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter); virtual ~CFWL_AppImp(); diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp index 919f85f532..3ed6eef95b 100644 --- a/xfa/fwl/core/fwl_formimp.cpp +++ b/xfa/fwl/core/fwl_formimp.cpp @@ -384,7 +384,7 @@ FWL_ERR CFWL_FormImp::SetFormSize(FWL_FORMSIZE eFormSize) { return FWL_ERR_Succeeded; } IFWL_Widget* CFWL_FormImp::DoModal() { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return NULL; IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); @@ -412,7 +412,7 @@ FWL_ERR CFWL_FormImp::EndDoModal() { m_bDoModalFlag = FALSE; #if (_FX_OS_ == _FX_MACOSX_) m_pNoteLoop->EndModalLoop(); - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return FWL_ERR_Indefinite; CFWL_NoteDriver* pDriver = @@ -739,7 +739,7 @@ void CFWL_FormImp::ReSetSysBtn() { } } void CFWL_FormImp::RegisterForm() { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = @@ -749,7 +749,7 @@ void CFWL_FormImp::RegisterForm() { pDriver->RegisterForm(this); } void CFWL_FormImp::UnRegisterForm() { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = @@ -878,7 +878,7 @@ int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { switch (dwMsgCode) { case FWL_MSGHASH_Activate: { m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated; - IFWL_NoteThread* pThread = m_pOwner->GetOwnerThread(); + IFWL_Thread* pThread = m_pOwner->GetOwnerThread(); CFWL_NoteDriver* pDriver = static_cast(pThread->GetNoteDriver()); CFWL_WidgetImp* pSubFocusImp = m_pOwner->GetSubFocus(); @@ -892,7 +892,7 @@ int32_t CFWL_FormImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { } case FWL_MSGHASH_Deactivate: { m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Deactivated; - IFWL_NoteThread* pThread = m_pOwner->GetOwnerThread(); + IFWL_Thread* pThread = m_pOwner->GetOwnerThread(); CFWL_NoteDriver* pDriver = static_cast(pThread->GetNoteDriver()); CFWL_WidgetImp* pSubFocusImp = m_pOwner->GetSubFocus(); diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp index 05963bba81..7de0465a1b 100644 --- a/xfa/fwl/core/fwl_noteimp.cpp +++ b/xfa/fwl/core/fwl_noteimp.cpp @@ -64,7 +64,7 @@ FWL_ERR CFWL_NoteLoop::SetMainForm(CFWL_WidgetImp* pForm) { void CFWL_NoteLoop::GenerateCommondEvent(uint32_t dwCommand) { CFWL_EvtMenuCommand ev; ev.m_iCommand = dwCommand; - IFWL_NoteThread* pThread = m_pForm->GetOwnerThread(); + IFWL_Thread* pThread = m_pForm->GetOwnerThread(); if (!pThread) return; IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); @@ -165,7 +165,7 @@ FWL_ERR CFWL_NoteDriver::UnregisterEventTarget(IFWL_Widget* pListener) { void CFWL_NoteDriver::ClearEventTargets(FX_BOOL bRemoveAll) { ClearInvalidEventTargets(bRemoveAll); } -IFWL_NoteThread* CFWL_NoteDriver::GetOwnerThread() const { +IFWL_Thread* CFWL_NoteDriver::GetOwnerThread() const { return FWL_GetApp(); } FWL_ERR CFWL_NoteDriver::PushNoteLoop(IFWL_NoteLoop* pNoteLoop) { diff --git a/xfa/fwl/core/fwl_noteimp.h b/xfa/fwl/core/fwl_noteimp.h index d1d611a5d7..a0af7ea91e 100644 --- a/xfa/fwl/core/fwl_noteimp.h +++ b/xfa/fwl/core/fwl_noteimp.h @@ -58,7 +58,7 @@ class CFWL_NoteDriver : public IFWL_NoteDriver { uint32_t dwFilter = FWL_EVENT_ALL_MASK) override; FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) override; void ClearEventTargets(FX_BOOL bRemoveAll) override; - IFWL_NoteThread* GetOwnerThread() const override; + IFWL_Thread* GetOwnerThread() const override; FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) override; IFWL_NoteLoop* PopNoteLoop() override; IFWL_Widget* GetFocus() override; diff --git a/xfa/fwl/core/fwl_threadimp.cpp b/xfa/fwl/core/fwl_threadimp.cpp index bc58a76f04..d6036b7e3d 100644 --- a/xfa/fwl/core/fwl_threadimp.cpp +++ b/xfa/fwl/core/fwl_threadimp.cpp @@ -9,23 +9,12 @@ #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/ifwl_notethread.h" +#include "xfa/fwl/core/ifwl_thread.h" void IFWL_Thread::Release() { delete m_pImpl; } -IFWL_NoteDriver* IFWL_NoteThread::GetNoteDriver() { - return static_cast(GetImpl())->GetNoteDriver(); -} - -CFWL_NoteThreadImp::CFWL_NoteThreadImp(IFWL_NoteThread* pIface) - : CFWL_ThreadImp(pIface), m_pNoteDriver(new CFWL_NoteDriver) {} - -CFWL_NoteThreadImp::~CFWL_NoteThreadImp() { - delete m_pNoteDriver; -} - -IFWL_NoteDriver* CFWL_NoteThreadImp::GetNoteDriver() { - return m_pNoteDriver; +IFWL_NoteDriver* IFWL_Thread::GetNoteDriver() const { + return static_cast(GetImpl())->GetNoteDriver(); } diff --git a/xfa/fwl/core/fwl_threadimp.h b/xfa/fwl/core/fwl_threadimp.h index e1787d9d31..d10d493899 100644 --- a/xfa/fwl/core/fwl_threadimp.h +++ b/xfa/fwl/core/fwl_threadimp.h @@ -7,33 +7,27 @@ #ifndef XFA_FWL_CORE_FWL_THREADIMP_H_ #define XFA_FWL_CORE_FWL_THREADIMP_H_ +#include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/ifwl_thread.h" -class CFWL_NoteDriver; class IFWL_NoteDriver; class IFWL_NoteThread; class CFWL_ThreadImp { public: - virtual ~CFWL_ThreadImp() {} + CFWL_ThreadImp(IFWL_Thread* pIface) + : m_pNoteDriver(new CFWL_NoteDriver), m_pIface(pIface) {} + + virtual ~CFWL_ThreadImp() { delete m_pNoteDriver; } + IFWL_Thread* GetInterface() const { return m_pIface; } + IFWL_NoteDriver* GetNoteDriver() const { return m_pNoteDriver; } protected: - CFWL_ThreadImp(IFWL_Thread* pIface) : m_pIface(pIface) {} + CFWL_NoteDriver* const m_pNoteDriver; private: IFWL_Thread* const m_pIface; }; -class CFWL_NoteThreadImp : public CFWL_ThreadImp { - public: - CFWL_NoteThreadImp(IFWL_NoteThread* pIface); - virtual ~CFWL_NoteThreadImp(); - - virtual IFWL_NoteDriver* GetNoteDriver(); - - protected: - CFWL_NoteDriver* const m_pNoteDriver; -}; - #endif // XFA_FWL_CORE_FWL_THREADIMP_H_ diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp index 0f895eb5d2..ad75483fe4 100644 --- a/xfa/fwl/core/fwl_widgetimp.cpp +++ b/xfa/fwl/core/fwl_widgetimp.cpp @@ -134,7 +134,7 @@ FWL_ERR IFWL_Widget::SetDataProvider(IFWL_DataProvider* pDataProvider) { IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) { return static_cast(GetImpl())->SetDelegate(pDelegate); } -IFWL_NoteThread* IFWL_Widget::GetOwnerThread() const { +IFWL_Thread* IFWL_Widget::GetOwnerThread() const { return static_cast(GetImpl())->GetOwnerThread(); } CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) { @@ -150,7 +150,7 @@ FWL_ERR CFWL_WidgetImp::Initialize() { IFWL_AdapterThreadMgr* pAdapterThread = pAdapter->GetThreadMgr(); if (!pAdapterThread) return FWL_ERR_Indefinite; - SetOwnerThread(static_cast( + SetOwnerThread(static_cast( pAdapterThread->GetCurrentThread()->GetImpl())); IFWL_Widget* pParent = m_pProperties->m_pParent; m_pWidgetMgr->InsertWidget(pParent, m_pInterface); @@ -497,10 +497,10 @@ IFWL_WidgetDelegate* CFWL_WidgetImp::SetDelegate( m_pCurDelegate = pDelegate; return pOldDelegate; } -IFWL_NoteThread* CFWL_WidgetImp::GetOwnerThread() const { - return static_cast(m_pOwnerThread->GetInterface()); +IFWL_Thread* CFWL_WidgetImp::GetOwnerThread() const { + return static_cast(m_pOwnerThread->GetInterface()); } -FWL_ERR CFWL_WidgetImp::SetOwnerThread(CFWL_NoteThreadImp* pOwnerThread) { +FWL_ERR CFWL_WidgetImp::SetOwnerThread(CFWL_ThreadImp* pOwnerThread) { m_pOwnerThread = pOwnerThread; return FWL_ERR_Succeeded; } @@ -682,7 +682,7 @@ void CFWL_WidgetImp::CalcTextRect(const CFX_WideString& wsText, void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) { if (m_pWidgetMgr->IsFormDisabled()) return; - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = @@ -697,7 +697,7 @@ void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) { } } void CFWL_WidgetImp::SetGrab(FX_BOOL bSet) { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = @@ -813,7 +813,7 @@ FX_BOOL CFWL_WidgetImp::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) { } void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, uint32_t dwFilter) { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); @@ -822,7 +822,7 @@ void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, pNoteDriver->RegisterEventTarget(m_pInterface, pEventSource, dwFilter); } void CFWL_WidgetImp::UnregisterEventTarget() { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); @@ -847,7 +847,7 @@ void CFWL_WidgetImp::DispatchEvent(CFWL_Event* pEvent) { pDelegate->OnProcessEvent(pEvent); return; } - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); @@ -914,7 +914,7 @@ void CFWL_WidgetImp::DrawEdge(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } void CFWL_WidgetImp::NotifyDriver() { - IFWL_NoteThread* pThread = GetOwnerThread(); + IFWL_Thread* pThread = GetOwnerThread(); if (!pThread) return; CFWL_NoteDriver* pDriver = diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h index e7520d6c87..bd9be7edc5 100644 --- a/xfa/fwl/core/fwl_widgetimp.h +++ b/xfa/fwl/core/fwl_widgetimp.h @@ -14,11 +14,11 @@ #include "xfa/fwl/core/ifwl_widgetdelegate.h" class CFWL_MsgKey; -class CFWL_NoteThreadImp; +class CFWL_ThreadImp; class CFWL_WidgetImpProperties; class CFWL_WidgetMgr; class IFWL_DataProvider; -class IFWL_NoteThread; +class IFWL_Thread; class IFWL_ThemeProvider; class IFWL_Widget; @@ -62,8 +62,8 @@ class CFWL_WidgetImp : public CFWL_TargetImp { virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); - virtual IFWL_NoteThread* GetOwnerThread() const; - FWL_ERR SetOwnerThread(CFWL_NoteThreadImp* pOwnerThread); + virtual IFWL_Thread* GetOwnerThread() const; + FWL_ERR SetOwnerThread(CFWL_ThreadImp* pOwnerThread); IFWL_Widget* GetInterface() const; void SetInterface(IFWL_Widget* pInterface); CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); @@ -142,7 +142,7 @@ class CFWL_WidgetImp : public CFWL_TargetImp { friend class CFWL_WidgetImpDelegate; CFWL_WidgetMgr* m_pWidgetMgr; - CFWL_NoteThreadImp* m_pOwnerThread; + CFWL_ThreadImp* m_pOwnerThread; CFWL_WidgetImpProperties* m_pProperties; CFX_PrivateData* m_pPrivateData; IFWL_WidgetDelegate* m_pDelegate; diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp index e0ffd9c7b9..e6ca4091e5 100644 --- a/xfa/fwl/core/fwl_widgetmgrimp.cpp +++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp @@ -696,11 +696,11 @@ int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { if (!pMessage->m_pDstTarget) return 0; IFWL_Widget* pDstWidget = pMessage->m_pDstTarget; - IFWL_NoteThread* pNoteThread = pDstWidget->GetOwnerThread(); - if (!pNoteThread) + IFWL_Thread* pThread = pDstWidget->GetOwnerThread(); + if (!pThread) return 0; CFWL_NoteDriver* pNoteDriver = - static_cast(pNoteThread->GetNoteDriver()); + static_cast(pThread->GetNoteDriver()); if (!pNoteDriver) return 0; if (m_pWidgetMgr->IsThreadEnabled()) { diff --git a/xfa/fwl/core/ifwl_app.h b/xfa/fwl/core/ifwl_app.h index ed1fd673b2..d969c4b35c 100644 --- a/xfa/fwl/core/ifwl_app.h +++ b/xfa/fwl/core/ifwl_app.h @@ -8,7 +8,7 @@ #define XFA_FWL_CORE_IFWL_APP_H_ #include "core/fxcrt/include/fx_string.h" -#include "xfa/fwl/core/ifwl_notethread.h" +#include "xfa/fwl/core/ifwl_thread.h" class IFWL_AdapterNative; class IFWL_Widget; @@ -16,7 +16,7 @@ class IFWL_WidgetMgr; class IFWL_ThemeProvider; class IFWL_AdapterWidgetMgr; -class IFWL_App : public IFWL_NoteThread { +class IFWL_App : public IFWL_Thread { public: static IFWL_App* Create(IFWL_AdapterNative* pAdapter); diff --git a/xfa/fwl/core/ifwl_notedriver.h b/xfa/fwl/core/ifwl_notedriver.h index 64b4a634b9..783bebcd10 100644 --- a/xfa/fwl/core/ifwl_notedriver.h +++ b/xfa/fwl/core/ifwl_notedriver.h @@ -22,7 +22,7 @@ class CFWL_Message; class CFWL_Note; class IFWL_NoteLoop; -class IFWL_NoteThread; +class IFWL_Thread; class IFWL_Widget; class IFWL_NoteDriver { @@ -36,7 +36,7 @@ class IFWL_NoteDriver { uint32_t dwFilter = FWL_EVENT_ALL_MASK) = 0; virtual FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) = 0; virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0; - virtual IFWL_NoteThread* GetOwnerThread() const = 0; + virtual IFWL_Thread* GetOwnerThread() const = 0; virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) = 0; virtual IFWL_NoteLoop* PopNoteLoop() = 0; virtual IFWL_Widget* GetFocus() = 0; diff --git a/xfa/fwl/core/ifwl_notethread.h b/xfa/fwl/core/ifwl_notethread.h deleted file mode 100644 index 30a29b5a9c..0000000000 --- a/xfa/fwl/core/ifwl_notethread.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_CORE_IFWL_NOTETHREAD_H_ -#define XFA_FWL_CORE_IFWL_NOTETHREAD_H_ - -#include "xfa/fwl/core/ifwl_thread.h" - -class IFWL_NoteDriver; - -class IFWL_NoteThread : public IFWL_Thread { - public: - IFWL_NoteDriver* GetNoteDriver(); -}; - -#endif // XFA_FWL_CORE_IFWL_NOTETHREAD_H_ diff --git a/xfa/fwl/core/ifwl_thread.h b/xfa/fwl/core/ifwl_thread.h index d05aa6da0c..b41b988d6e 100644 --- a/xfa/fwl/core/ifwl_thread.h +++ b/xfa/fwl/core/ifwl_thread.h @@ -14,12 +14,8 @@ // (nonesuch) IFWL_Thread ----------> CFWL_ThreadImp // | <---------- | // A m_pIface A -// | | -// (nonesuch) IFWL_NoteThread CFWL_NoteThreadImp -// | | -// A A // m_pIface | | -// CFWL_App --------------> IFWL_App CFWL_AppImp +// CXFA_FFApp ------------> IFWL_App CFWL_AppImp // #include "xfa/fwl/core/fwl_error.h" @@ -35,6 +31,8 @@ class IFWL_Thread { CFWL_ThreadImp* GetImpl() const { return m_pImpl; } void SetImpl(CFWL_ThreadImp* pImpl) { m_pImpl = pImpl; } + IFWL_NoteDriver* GetNoteDriver() const; + protected: virtual ~IFWL_Thread() {} diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h index d8e757ac59..3540a3c87c 100644 --- a/xfa/fwl/core/ifwl_widget.h +++ b/xfa/fwl/core/ifwl_widget.h @@ -7,16 +7,16 @@ #ifndef XFA_FWL_CORE_IFWL_WIDGET_H_ #define XFA_FWL_CORE_IFWL_WIDGET_H_ -#include "xfa/fwl/core/fwl_error.h" +#include "core/fxcrt/include/fx_basic.h" #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_system.h" -#include "core/fxcrt/include/fx_basic.h" +#include "xfa/fwl/core/fwl_error.h" #include "xfa/fwl/core/ifwl_target.h" class CFX_Graphics; class IFWL_DataProvider; class IFWL_Form; -class IFWL_NoteThread; +class IFWL_Thread; class IFWL_ThemeProvider; class IFWL_WidgetDelegate; @@ -54,7 +54,7 @@ class IFWL_Widget : public IFWL_Target { FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); - IFWL_NoteThread* GetOwnerThread() const; + IFWL_Thread* GetOwnerThread() const; CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); }; diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp index 1f4512e381..071940fe36 100644 --- a/xfa/fwl/lightwidget/cfwl_widget.cpp +++ b/xfa/fwl/lightwidget/cfwl_widget.cpp @@ -13,8 +13,8 @@ #include "xfa/fwl/core/fwl_targetimp.h" #include "xfa/fwl/core/fwl_widgetimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" -#include "xfa/fwl/core/ifwl_notethread.h" #include "xfa/fwl/core/ifwl_themeprovider.h" +#include "xfa/fwl/core/ifwl_thread.h" IFWL_Widget* CFWL_Widget::GetWidget() { return m_pIface; @@ -242,7 +242,7 @@ FWL_ERR CFWL_Widget::Repaint(const CFX_RectF* pRect) { FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) { if (!m_pIface) return FWL_ERR_Indefinite; - IFWL_NoteThread* pThread = m_pIface->GetOwnerThread(); + IFWL_Thread* pThread = m_pIface->GetOwnerThread(); if (!pThread) return FWL_ERR_Indefinite; IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); @@ -261,7 +261,7 @@ FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) { FWL_ERR CFWL_Widget::SetGrab(FX_BOOL bSet) { if (!m_pIface) return FWL_ERR_Indefinite; - IFWL_NoteThread* pThread = m_pIface->GetOwnerThread(); + IFWL_Thread* pThread = m_pIface->GetOwnerThread(); if (!pThread) return FWL_ERR_Indefinite; IFWL_NoteDriver* pDriver = pThread->GetNoteDriver(); @@ -275,7 +275,7 @@ void CFWL_Widget::RegisterEventTarget(CFWL_Widget* pEventSource, uint32_t dwFilter) { if (!m_pIface) return; - IFWL_NoteThread* pThread = m_pIface->GetOwnerThread(); + IFWL_Thread* pThread = m_pIface->GetOwnerThread(); if (!pThread) return; IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); @@ -292,7 +292,7 @@ void CFWL_Widget::DispatchEvent(CFWL_Event* pEvent) { if (m_pIface->GetOuter()) { return; } - IFWL_NoteThread* pThread = m_pIface->GetOwnerThread(); + IFWL_Thread* pThread = m_pIface->GetOwnerThread(); if (!pThread) return; IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); -- cgit v1.2.3