OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
| 7 #include "xfa/fwl/core/ifwl_timer.h" |
| 8 |
7 #include "xfa/fwl/core/ifwl_adaptertimermgr.h" | 9 #include "xfa/fwl/core/ifwl_adaptertimermgr.h" |
8 #include "xfa/fwl/core/ifwl_app.h" | 10 #include "xfa/fwl/core/ifwl_app.h" |
9 #include "xfa/fwl/core/ifwl_timer.h" | 11 #include "xfa/fwl/core/ifwl_timerinfo.h" |
10 #include "xfa/fwl/core/ifwl_widget.h" | 12 #include "xfa/fwl/core/ifwl_widget.h" |
11 #include "xfa/fxfa/xfa_ffapp.h" | 13 #include "xfa/fxfa/xfa_ffapp.h" |
12 | 14 |
13 IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) { | 15 IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) { |
14 const IFWL_App* pApp = m_pWidget->GetOwnerApp(); | 16 const IFWL_App* pApp = m_pWidget->GetOwnerApp(); |
15 if (!pApp) | 17 if (!pApp) |
16 return nullptr; | 18 return nullptr; |
17 | 19 |
18 CXFA_FFApp* pAdapterNative = pApp->GetAdapterNative(); | 20 CXFA_FFApp* pAdapterNative = pApp->GetAdapterNative(); |
19 if (!pAdapterNative) | 21 if (!pAdapterNative) |
20 return nullptr; | 22 return nullptr; |
21 | 23 |
22 IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr(); | 24 IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr(); |
23 if (!pAdapterTimerMgr) | 25 if (!pAdapterTimerMgr) |
24 return nullptr; | 26 return nullptr; |
25 | 27 |
26 IFWL_TimerInfo* pTimerInfo = nullptr; | 28 IFWL_TimerInfo* pTimerInfo = nullptr; |
27 pAdapterTimerMgr->Start(this, dwElapse, bImmediately, &pTimerInfo); | 29 pAdapterTimerMgr->Start(this, dwElapse, bImmediately, &pTimerInfo); |
28 return pTimerInfo; | 30 return pTimerInfo; |
29 } | 31 } |
30 | |
31 void IFWL_TimerInfo::StopTimer() { | |
32 m_pMgr->Stop(this); | |
33 } | |
OLD | NEW |