From d64372989fcb4e5af66f437ad7b8be343cb1aa67 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 22 Nov 2016 15:42:07 -0800 Subject: Rename IFWL_Timer and IFWL_TimerInfo These twho files are not interfaces. Renamed to be CFWL to signify they are concrete implementations. Review-Url: https://codereview.chromium.org/2526513002 --- BUILD.gn | 8 ++--- fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp | 46 +++++++++++++++++++++-------- fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h | 19 ++++-------- xfa/fwl/core/cfwl_timer.cpp | 31 +++++++++++++++++++ xfa/fwl/core/cfwl_timer.h | 27 +++++++++++++++++ xfa/fwl/core/cfwl_timerinfo.cpp | 13 ++++++++ xfa/fwl/core/cfwl_timerinfo.h | 27 +++++++++++++++++ xfa/fwl/core/ifwl_adaptertimermgr.h | 8 ++--- xfa/fwl/core/ifwl_caret.cpp | 6 ++-- xfa/fwl/core/ifwl_caret.h | 8 ++--- xfa/fwl/core/ifwl_scrollbar.cpp | 6 ++-- xfa/fwl/core/ifwl_scrollbar.h | 8 ++--- xfa/fwl/core/ifwl_spinbutton.cpp | 6 ++-- xfa/fwl/core/ifwl_spinbutton.h | 8 ++--- xfa/fwl/core/ifwl_timer.cpp | 31 ------------------- xfa/fwl/core/ifwl_timer.h | 27 ----------------- xfa/fwl/core/ifwl_timerinfo.cpp | 13 -------- xfa/fwl/core/ifwl_timerinfo.h | 27 ----------------- 18 files changed, 165 insertions(+), 154 deletions(-) create mode 100644 xfa/fwl/core/cfwl_timer.cpp create mode 100644 xfa/fwl/core/cfwl_timer.h create mode 100644 xfa/fwl/core/cfwl_timerinfo.cpp create mode 100644 xfa/fwl/core/cfwl_timerinfo.h delete mode 100644 xfa/fwl/core/ifwl_timer.cpp delete mode 100644 xfa/fwl/core/ifwl_timer.h delete mode 100644 xfa/fwl/core/ifwl_timerinfo.cpp delete mode 100644 xfa/fwl/core/ifwl_timerinfo.h diff --git a/BUILD.gn b/BUILD.gn index 81b2c61733..9e58f5a8ac 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1260,6 +1260,10 @@ if (pdf_enable_xfa) { "xfa/fwl/core/cfwl_themepart.cpp", "xfa/fwl/core/cfwl_themepart.h", "xfa/fwl/core/cfwl_themetext.h", + "xfa/fwl/core/cfwl_timer.cpp", + "xfa/fwl/core/cfwl_timer.h", + "xfa/fwl/core/cfwl_timerinfo.cpp", + "xfa/fwl/core/cfwl_timerinfo.h", "xfa/fwl/core/cfwl_widget.cpp", "xfa/fwl/core/cfwl_widget.h", "xfa/fwl/core/cfwl_widgetmgr.cpp", @@ -1311,10 +1315,6 @@ if (pdf_enable_xfa) { "xfa/fwl/core/ifwl_spinbutton.cpp", "xfa/fwl/core/ifwl_spinbutton.h", "xfa/fwl/core/ifwl_themeprovider.h", - "xfa/fwl/core/ifwl_timer.cpp", - "xfa/fwl/core/ifwl_timer.h", - "xfa/fwl/core/ifwl_timerinfo.cpp", - "xfa/fwl/core/ifwl_timerinfo.h", "xfa/fwl/core/ifwl_widget.cpp", "xfa/fwl/core/ifwl_widget.h", "xfa/fwl/core/ifwl_widgetdelegate.h", diff --git a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp index 5a9ae95be7..39aa72be87 100644 --- a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp +++ b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp @@ -6,17 +6,33 @@ #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h" +#include #include #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/fsdk_define.h" +namespace { + +class CFWL_FWLAdapterTimerInfo : public CFWL_TimerInfo { + public: + CFWL_FWLAdapterTimerInfo(IFWL_AdapterTimerMgr* mgr, + int32_t event, + CFWL_Timer* timer) + : CFWL_TimerInfo(mgr), idEvent(event), pTimer(timer) {} + + int32_t idEvent; + CFWL_Timer* pTimer; +}; + +} // namespace + std::vector* CXFA_FWLAdapterTimerMgr::s_TimerArray = nullptr; -void CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer, +void CXFA_FWLAdapterTimerMgr::Start(CFWL_Timer* pTimer, uint32_t dwElapse, bool bImmediately, - IFWL_TimerInfo** pTimerInfo) { + CFWL_TimerInfo** pTimerInfo) { if (!m_pFormFillEnv) return; @@ -24,22 +40,24 @@ void CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer, if (!s_TimerArray) s_TimerArray = new std::vector; - s_TimerArray->push_back(new CFWL_TimerInfo(this, id_event, pTimer)); - *pTimerInfo = s_TimerArray->back(); + *pTimerInfo = new CFWL_FWLAdapterTimerInfo(this, id_event, pTimer); + s_TimerArray->push_back(*pTimerInfo); } -void CXFA_FWLAdapterTimerMgr::Stop(IFWL_TimerInfo* pTimerInfo) { +void CXFA_FWLAdapterTimerMgr::Stop(CFWL_TimerInfo* pTimerInfo) { if (!pTimerInfo || !m_pFormFillEnv) return; - CFWL_TimerInfo* pInfo = static_cast(pTimerInfo); + CFWL_FWLAdapterTimerInfo* pInfo = + static_cast(pTimerInfo); m_pFormFillEnv->KillTimer(pInfo->idEvent); - if (s_TimerArray) { - auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo); - if (it != s_TimerArray->end()) { - s_TimerArray->erase(it); - delete pInfo; - } + if (!s_TimerArray) + return; + + auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo); + if (it != s_TimerArray->end()) { + s_TimerArray->erase(it); + delete pInfo; } } @@ -48,7 +66,9 @@ void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) { if (!s_TimerArray) return; - for (CFWL_TimerInfo* pInfo : *s_TimerArray) { + for (const auto info : *s_TimerArray) { + CFWL_FWLAdapterTimerInfo* pInfo = + static_cast(info); if (pInfo->idEvent == idEvent) { pInfo->pTimer->Run(pInfo); break; diff --git a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h index 9f529fcbc8..3904ba5300 100644 --- a/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h +++ b/fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h @@ -7,24 +7,23 @@ #ifndef FPDFSDK_FPDFXFA_CXFA_FWLADAPTERTIMERMGR_H_ #define FPDFSDK_FPDFXFA_CXFA_FWLADAPTERTIMERMGR_H_ +#include #include #include "fpdfsdk/fpdfxfa/cpdfxfa_context.h" +#include "xfa/fwl/core/cfwl_timerinfo.h" #include "xfa/fwl/core/ifwl_adaptertimermgr.h" -#include "xfa/fwl/core/ifwl_timerinfo.h" - -struct CFWL_TimerInfo; class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { public: explicit CXFA_FWLAdapterTimerMgr(CPDFSDK_FormFillEnvironment* pFormFillEnv) : m_pFormFillEnv(pFormFillEnv) {} - void Start(IFWL_Timer* pTimer, + void Start(CFWL_Timer* pTimer, uint32_t dwElapse, bool bImmediately, - IFWL_TimerInfo** pTimerInfo) override; - void Stop(IFWL_TimerInfo* pTimerInfo) override; + CFWL_TimerInfo** pTimerInfo) override; + void Stop(CFWL_TimerInfo* pTimerInfo) override; protected: static void TimerProc(int32_t idEvent); @@ -33,12 +32,4 @@ class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr { CPDFSDK_FormFillEnvironment* const m_pFormFillEnv; }; -struct CFWL_TimerInfo : public IFWL_TimerInfo { - CFWL_TimerInfo(IFWL_AdapterTimerMgr* mgr, int32_t event, IFWL_Timer* timer) - : IFWL_TimerInfo(mgr), idEvent(event), pTimer(timer) {} - - int32_t idEvent; - IFWL_Timer* pTimer; -}; - #endif // FPDFSDK_FPDFXFA_CXFA_FWLADAPTERTIMERMGR_H_ diff --git a/xfa/fwl/core/cfwl_timer.cpp b/xfa/fwl/core/cfwl_timer.cpp new file mode 100644 index 0000000000..289996e672 --- /dev/null +++ b/xfa/fwl/core/cfwl_timer.cpp @@ -0,0 +1,31 @@ +// Copyright 2014 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 + +#include "xfa/fwl/core/cfwl_timer.h" + +#include "xfa/fwl/core/cfwl_timerinfo.h" +#include "xfa/fwl/core/ifwl_adaptertimermgr.h" +#include "xfa/fwl/core/ifwl_app.h" +#include "xfa/fwl/core/ifwl_widget.h" +#include "xfa/fxfa/xfa_ffapp.h" + +CFWL_TimerInfo* CFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) { + const IFWL_App* pApp = m_pWidget->GetOwnerApp(); + if (!pApp) + return nullptr; + + CXFA_FFApp* pAdapterNative = pApp->GetAdapterNative(); + if (!pAdapterNative) + return nullptr; + + IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr(); + if (!pAdapterTimerMgr) + return nullptr; + + CFWL_TimerInfo* pTimerInfo = nullptr; + pAdapterTimerMgr->Start(this, dwElapse, bImmediately, &pTimerInfo); + return pTimerInfo; +} diff --git a/xfa/fwl/core/cfwl_timer.h b/xfa/fwl/core/cfwl_timer.h new file mode 100644 index 0000000000..2f91e783c8 --- /dev/null +++ b/xfa/fwl/core/cfwl_timer.h @@ -0,0 +1,27 @@ +// Copyright 2014 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_CFWL_TIMER_H_ +#define XFA_FWL_CORE_CFWL_TIMER_H_ + +#include "core/fxcrt/fx_system.h" + +class CFWL_TimerInfo; +class IFWL_Widget; + +class CFWL_Timer { + public: + explicit CFWL_Timer(IFWL_Widget* parent) : m_pWidget(parent) {} + virtual ~CFWL_Timer() {} + + virtual void Run(CFWL_TimerInfo* hTimer) = 0; + CFWL_TimerInfo* StartTimer(uint32_t dwElapse, bool bImmediately); + + protected: + IFWL_Widget* m_pWidget; // Not owned. +}; + +#endif // XFA_FWL_CORE_CFWL_TIMER_H_ diff --git a/xfa/fwl/core/cfwl_timerinfo.cpp b/xfa/fwl/core/cfwl_timerinfo.cpp new file mode 100644 index 0000000000..8322a1d6aa --- /dev/null +++ b/xfa/fwl/core/cfwl_timerinfo.cpp @@ -0,0 +1,13 @@ +// 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 + +#include "xfa/fwl/core/cfwl_timerinfo.h" + +#include "xfa/fwl/core/ifwl_adaptertimermgr.h" + +void CFWL_TimerInfo::StopTimer() { + m_pMgr->Stop(this); +} diff --git a/xfa/fwl/core/cfwl_timerinfo.h b/xfa/fwl/core/cfwl_timerinfo.h new file mode 100644 index 0000000000..5365d38305 --- /dev/null +++ b/xfa/fwl/core/cfwl_timerinfo.h @@ -0,0 +1,27 @@ +// 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_CFWL_TIMERINFO_H_ +#define XFA_FWL_CORE_CFWL_TIMERINFO_H_ + +#include "core/fxcrt/fx_system.h" + +class IFWL_AdapterTimerMgr; + +class CFWL_TimerInfo { + public: + explicit CFWL_TimerInfo(IFWL_AdapterTimerMgr* mgr) : m_pMgr(mgr) { + ASSERT(mgr); + } + virtual ~CFWL_TimerInfo() {} + + void StopTimer(); + + private: + IFWL_AdapterTimerMgr* m_pMgr; // Not owned. +}; + +#endif // XFA_FWL_CORE_CFWL_TIMERINFO_H_ diff --git a/xfa/fwl/core/ifwl_adaptertimermgr.h b/xfa/fwl/core/ifwl_adaptertimermgr.h index ad54f46312..0e07052e65 100644 --- a/xfa/fwl/core/ifwl_adaptertimermgr.h +++ b/xfa/fwl/core/ifwl_adaptertimermgr.h @@ -7,15 +7,15 @@ #ifndef XFA_FWL_CORE_IFWL_ADAPTERTIMERMGR_H_ #define XFA_FWL_CORE_IFWL_ADAPTERTIMERMGR_H_ -#include "xfa/fwl/core/ifwl_timer.h" +#include "xfa/fwl/core/cfwl_timer.h" class IFWL_AdapterTimerMgr { public: - virtual void Start(IFWL_Timer* pTimer, + virtual void Start(CFWL_Timer* pTimer, uint32_t dwElapse, bool bImmediately, - IFWL_TimerInfo** pTimerInfo) = 0; - virtual void Stop(IFWL_TimerInfo* pTimerInfo) = 0; + CFWL_TimerInfo** pTimerInfo) = 0; + virtual void Stop(CFWL_TimerInfo* pTimerInfo) = 0; }; #endif // XFA_FWL_CORE_IFWL_ADAPTERTIMERMGR_H_ diff --git a/xfa/fwl/core/ifwl_caret.cpp b/xfa/fwl/core/ifwl_caret.cpp index 5dcebc1cbb..fb5d5e54a1 100644 --- a/xfa/fwl/core/ifwl_caret.cpp +++ b/xfa/fwl/core/ifwl_caret.cpp @@ -11,9 +11,9 @@ #include "third_party/base/ptr_util.h" #include "xfa/fwl/core/cfwl_notedriver.h" #include "xfa/fwl/core/cfwl_themebackground.h" +#include "xfa/fwl/core/cfwl_timerinfo.h" #include "xfa/fwl/core/cfwl_widgetproperties.h" #include "xfa/fwl/core/ifwl_themeprovider.h" -#include "xfa/fwl/core/ifwl_timerinfo.h" namespace { @@ -92,9 +92,9 @@ void IFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics, DrawWidget(pGraphics, pMatrix); } -IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : IFWL_Timer(pCaret) {} +IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : CFWL_Timer(pCaret) {} -void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) { +void IFWL_Caret::Timer::Run(CFWL_TimerInfo* pTimerInfo) { IFWL_Caret* pCaret = static_cast(m_pWidget); pCaret->SetStates(FWL_STATE_CAT_HightLight, !(pCaret->GetStates() & FWL_STATE_CAT_HightLight)); diff --git a/xfa/fwl/core/ifwl_caret.h b/xfa/fwl/core/ifwl_caret.h index d75a662175..57d0025a6b 100644 --- a/xfa/fwl/core/ifwl_caret.h +++ b/xfa/fwl/core/ifwl_caret.h @@ -9,7 +9,7 @@ #include -#include "xfa/fwl/core/ifwl_timer.h" +#include "xfa/fwl/core/cfwl_timer.h" #include "xfa/fwl/core/ifwl_widget.h" #include "xfa/fxgraphics/cfx_color.h" @@ -36,12 +36,12 @@ class IFWL_Caret : public IFWL_Widget { void ShowCaret(bool bFlag = true); private: - class Timer : public IFWL_Timer { + class Timer : public CFWL_Timer { public: explicit Timer(IFWL_Caret* pCaret); ~Timer() override {} - void Run(IFWL_TimerInfo* hTimer) override; + void Run(CFWL_TimerInfo* hTimer) override; }; friend class IFWL_Caret::Timer; @@ -50,7 +50,7 @@ class IFWL_Caret : public IFWL_Widget { const CFX_Matrix* pMatrix); std::unique_ptr m_pTimer; - IFWL_TimerInfo* m_pTimerInfo; // not owned. + CFWL_TimerInfo* m_pTimerInfo; // not owned. }; #endif // XFA_FWL_CORE_IFWL_CARET_H_ diff --git a/xfa/fwl/core/ifwl_scrollbar.cpp b/xfa/fwl/core/ifwl_scrollbar.cpp index b4d6b5076a..6732e94a9a 100644 --- a/xfa/fwl/core/ifwl_scrollbar.cpp +++ b/xfa/fwl/core/ifwl_scrollbar.cpp @@ -16,8 +16,8 @@ #include "xfa/fwl/core/cfwl_notedriver.h" #include "xfa/fwl/core/cfwl_themebackground.h" #include "xfa/fwl/core/cfwl_themepart.h" +#include "xfa/fwl/core/cfwl_timerinfo.h" #include "xfa/fwl/core/ifwl_themeprovider.h" -#include "xfa/fwl/core/ifwl_timerinfo.h" #define FWL_SCROLLBAR_Elapse 500 #define FWL_SCROLLBAR_MinThumb 5 @@ -550,9 +550,9 @@ void IFWL_ScrollBar::DoMouseHover(int32_t iItem, Repaint(&rtItem); } -IFWL_ScrollBar::Timer::Timer(IFWL_ScrollBar* pToolTip) : IFWL_Timer(pToolTip) {} +IFWL_ScrollBar::Timer::Timer(IFWL_ScrollBar* pToolTip) : CFWL_Timer(pToolTip) {} -void IFWL_ScrollBar::Timer::Run(IFWL_TimerInfo* pTimerInfo) { +void IFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { IFWL_ScrollBar* pButton = static_cast(m_pWidget); if (pButton->m_pTimerInfo) diff --git a/xfa/fwl/core/ifwl_scrollbar.h b/xfa/fwl/core/ifwl_scrollbar.h index 06306c3c74..b6f2b02732 100644 --- a/xfa/fwl/core/ifwl_scrollbar.h +++ b/xfa/fwl/core/ifwl_scrollbar.h @@ -11,8 +11,8 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fwl/core/cfwl_evtscroll.h" +#include "xfa/fwl/core/cfwl_timer.h" #include "xfa/fwl/core/cfwl_widgetproperties.h" -#include "xfa/fwl/core/ifwl_timer.h" #include "xfa/fwl/core/ifwl_widget.h" class IFWL_Widget; @@ -56,12 +56,12 @@ class IFWL_ScrollBar : public IFWL_Widget { void SetTrackPos(FX_FLOAT fTrackPos); private: - class Timer : public IFWL_Timer { + class Timer : public CFWL_Timer { public: explicit Timer(IFWL_ScrollBar* pToolTip); ~Timer() override {} - void Run(IFWL_TimerInfo* pTimerInfo) override; + void Run(CFWL_TimerInfo* pTimerInfo) override; }; friend class IFWL_ScrollBar::Timer; @@ -118,7 +118,7 @@ class IFWL_ScrollBar : public IFWL_Widget { void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); - IFWL_TimerInfo* m_pTimerInfo; + CFWL_TimerInfo* m_pTimerInfo; FX_FLOAT m_fRangeMin; FX_FLOAT m_fRangeMax; FX_FLOAT m_fPageSize; diff --git a/xfa/fwl/core/ifwl_spinbutton.cpp b/xfa/fwl/core/ifwl_spinbutton.cpp index b77c259de9..9706a41461 100644 --- a/xfa/fwl/core/ifwl_spinbutton.cpp +++ b/xfa/fwl/core/ifwl_spinbutton.cpp @@ -15,9 +15,9 @@ #include "xfa/fwl/core/cfwl_msgmouse.h" #include "xfa/fwl/core/cfwl_notedriver.h" #include "xfa/fwl/core/cfwl_themebackground.h" +#include "xfa/fwl/core/cfwl_timerinfo.h" #include "xfa/fwl/core/cfwl_widgetproperties.h" #include "xfa/fwl/core/ifwl_themeprovider.h" -#include "xfa/fwl/core/ifwl_timerinfo.h" namespace { @@ -374,9 +374,9 @@ void IFWL_SpinButton::OnKeyDown(CFWL_MsgKey* pMsg) { } IFWL_SpinButton::Timer::Timer(IFWL_SpinButton* pToolTip) - : IFWL_Timer(pToolTip) {} + : CFWL_Timer(pToolTip) {} -void IFWL_SpinButton::Timer::Run(IFWL_TimerInfo* pTimerInfo) { +void IFWL_SpinButton::Timer::Run(CFWL_TimerInfo* pTimerInfo) { IFWL_SpinButton* pButton = static_cast(m_pWidget); if (!pButton->m_pTimerInfo) diff --git a/xfa/fwl/core/ifwl_spinbutton.h b/xfa/fwl/core/ifwl_spinbutton.h index bc4f3ab1a8..157c1411db 100644 --- a/xfa/fwl/core/ifwl_spinbutton.h +++ b/xfa/fwl/core/ifwl_spinbutton.h @@ -10,7 +10,7 @@ #include #include "xfa/fwl/core/cfwl_event.h" -#include "xfa/fwl/core/ifwl_timer.h" +#include "xfa/fwl/core/cfwl_timer.h" #include "xfa/fwl/core/ifwl_widget.h" #include "xfa/fxfa/cxfa_eventparam.h" @@ -38,12 +38,12 @@ class IFWL_SpinButton : public IFWL_Widget { const CFX_Matrix* pMatrix) override; private: - class Timer : public IFWL_Timer { + class Timer : public CFWL_Timer { public: explicit Timer(IFWL_SpinButton* pToolTip); ~Timer() override {} - void Run(IFWL_TimerInfo* pTimerInfo) override; + void Run(CFWL_TimerInfo* pTimerInfo) override; }; friend class IFWL_SpinButton::Timer; @@ -69,7 +69,7 @@ class IFWL_SpinButton : public IFWL_Widget { uint32_t m_dwDnState; int32_t m_iButtonIndex; bool m_bLButtonDwn; - IFWL_TimerInfo* m_pTimerInfo; + CFWL_TimerInfo* m_pTimerInfo; IFWL_SpinButton::Timer m_Timer; }; diff --git a/xfa/fwl/core/ifwl_timer.cpp b/xfa/fwl/core/ifwl_timer.cpp deleted file mode 100644 index e2436dcc34..0000000000 --- a/xfa/fwl/core/ifwl_timer.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 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 - -#include "xfa/fwl/core/ifwl_timer.h" - -#include "xfa/fwl/core/ifwl_adaptertimermgr.h" -#include "xfa/fwl/core/ifwl_app.h" -#include "xfa/fwl/core/ifwl_timerinfo.h" -#include "xfa/fwl/core/ifwl_widget.h" -#include "xfa/fxfa/xfa_ffapp.h" - -IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) { - const IFWL_App* pApp = m_pWidget->GetOwnerApp(); - if (!pApp) - return nullptr; - - CXFA_FFApp* pAdapterNative = pApp->GetAdapterNative(); - if (!pAdapterNative) - return nullptr; - - IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr(); - if (!pAdapterTimerMgr) - return nullptr; - - IFWL_TimerInfo* pTimerInfo = nullptr; - pAdapterTimerMgr->Start(this, dwElapse, bImmediately, &pTimerInfo); - return pTimerInfo; -} diff --git a/xfa/fwl/core/ifwl_timer.h b/xfa/fwl/core/ifwl_timer.h deleted file mode 100644 index 848c16a717..0000000000 --- a/xfa/fwl/core/ifwl_timer.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 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_TIMER_H_ -#define XFA_FWL_CORE_IFWL_TIMER_H_ - -#include "core/fxcrt/fx_system.h" - -class IFWL_TimerInfo; -class IFWL_Widget; - -class IFWL_Timer { - public: - explicit IFWL_Timer(IFWL_Widget* parent) : m_pWidget(parent) {} - virtual ~IFWL_Timer() {} - - virtual void Run(IFWL_TimerInfo* hTimer) = 0; - IFWL_TimerInfo* StartTimer(uint32_t dwElapse, bool bImmediately); - - protected: - IFWL_Widget* m_pWidget; // Not owned. -}; - -#endif // XFA_FWL_CORE_IFWL_TIMER_H_ diff --git a/xfa/fwl/core/ifwl_timerinfo.cpp b/xfa/fwl/core/ifwl_timerinfo.cpp deleted file mode 100644 index a130eea453..0000000000 --- a/xfa/fwl/core/ifwl_timerinfo.cpp +++ /dev/null @@ -1,13 +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 - -#include "xfa/fwl/core/ifwl_timerinfo.h" - -#include "xfa/fwl/core/ifwl_adaptertimermgr.h" - -void IFWL_TimerInfo::StopTimer() { - m_pMgr->Stop(this); -} diff --git a/xfa/fwl/core/ifwl_timerinfo.h b/xfa/fwl/core/ifwl_timerinfo.h deleted file mode 100644 index 9a18ddd567..0000000000 --- a/xfa/fwl/core/ifwl_timerinfo.h +++ /dev/null @@ -1,27 +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_TIMERINFO_H_ -#define XFA_FWL_CORE_IFWL_TIMERINFO_H_ - -#include "core/fxcrt/fx_system.h" - -class IFWL_AdapterTimerMgr; - -class IFWL_TimerInfo { - public: - explicit IFWL_TimerInfo(IFWL_AdapterTimerMgr* mgr) : m_pMgr(mgr) { - ASSERT(mgr); - } - virtual ~IFWL_TimerInfo() {} - - void StopTimer(); - - private: - IFWL_AdapterTimerMgr* m_pMgr; // Not owned. -}; - -#endif // XFA_FWL_CORE_IFWL_TIMERINFO_H_ -- cgit v1.2.3