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 --- 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 --------------------------- 15 files changed, 123 insertions(+), 123 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 (limited to 'xfa/fwl/core') 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