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/fxfa/include/xfa_ffapp.h" | 7 #include "xfa/fxfa/include/xfa_ffapp.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider) | 66 CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider) |
67 : m_pDocHandler(nullptr), | 67 : m_pDocHandler(nullptr), |
68 m_pFWLTheme(nullptr), | 68 m_pFWLTheme(nullptr), |
69 m_pProvider(pProvider), | 69 m_pProvider(pProvider), |
70 m_pFontMgr(nullptr), | 70 m_pFontMgr(nullptr), |
71 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 71 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
72 m_pFontSource(nullptr), | 72 m_pFontSource(nullptr), |
73 #endif | 73 #endif |
74 m_pAdapterWidgetMgr(nullptr), | 74 m_pAdapterWidgetMgr(nullptr), |
75 m_pWidgetMgrDelegate(nullptr), | 75 m_pWidgetMgrDelegate(nullptr), |
76 m_pFDEFontMgr(nullptr), | 76 m_pFDEFontMgr(nullptr) { |
77 m_pAdapterThreadMgr(nullptr) { | |
78 m_pFWLApp = IFWL_App::Create(this); | 77 m_pFWLApp = IFWL_App::Create(this); |
79 FWL_SetApp(m_pFWLApp); | 78 FWL_SetApp(m_pFWLApp); |
80 m_pFWLApp->Initialize(); | 79 m_pFWLApp->Initialize(); |
81 CXFA_TimeZoneProvider::Create(); | 80 CXFA_TimeZoneProvider::Create(); |
82 } | 81 } |
83 CXFA_FFApp::~CXFA_FFApp() { | 82 CXFA_FFApp::~CXFA_FFApp() { |
84 delete m_pDocHandler; | 83 delete m_pDocHandler; |
85 if (m_pFWLApp) { | 84 if (m_pFWLApp) { |
86 m_pFWLApp->Finalize(); | 85 m_pFWLApp->Finalize(); |
87 m_pFWLApp->Release(); | 86 m_pFWLApp->Release(); |
88 delete m_pFWLApp; | 87 delete m_pFWLApp; |
89 } | 88 } |
90 if (m_pFWLTheme) | 89 if (m_pFWLTheme) |
91 m_pFWLTheme->Release(); | 90 m_pFWLTheme->Release(); |
92 delete m_pAdapterWidgetMgr; | 91 delete m_pAdapterWidgetMgr; |
93 delete m_pAdapterThreadMgr; | |
94 | 92 |
95 CXFA_TimeZoneProvider::Destroy(); | 93 CXFA_TimeZoneProvider::Destroy(); |
96 delete m_pFontMgr; | 94 delete m_pFontMgr; |
97 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 95 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
98 if (m_pFontSource) | 96 if (m_pFontSource) |
99 m_pFontSource->Release(); | 97 m_pFontSource->Release(); |
100 #endif | 98 #endif |
101 if (m_pFDEFontMgr) | 99 if (m_pFDEFontMgr) |
102 m_pFDEFontMgr->Release(); | 100 m_pFDEFontMgr->Release(); |
103 } | 101 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 #endif | 150 #endif |
153 } | 151 } |
154 return m_pFDEFontMgr; | 152 return m_pFDEFontMgr; |
155 } | 153 } |
156 CXFA_FWLTheme* CXFA_FFApp::GetFWLTheme() { | 154 CXFA_FWLTheme* CXFA_FFApp::GetFWLTheme() { |
157 if (!m_pFWLTheme) { | 155 if (!m_pFWLTheme) { |
158 m_pFWLTheme = new CXFA_FWLTheme(this); | 156 m_pFWLTheme = new CXFA_FWLTheme(this); |
159 } | 157 } |
160 return m_pFWLTheme; | 158 return m_pFWLTheme; |
161 } | 159 } |
162 IFWL_AdapterWidgetMgr* CXFA_FFApp::GetWidgetMgr( | 160 CXFA_FWLAdapterWidgetMgr* CXFA_FFApp::GetWidgetMgr( |
163 CFWL_WidgetMgrDelegate* pDelegate) { | 161 CFWL_WidgetMgrDelegate* pDelegate) { |
164 if (!m_pAdapterWidgetMgr) { | 162 if (!m_pAdapterWidgetMgr) { |
165 m_pAdapterWidgetMgr = new CXFA_FWLAdapterWidgetMgr; | 163 m_pAdapterWidgetMgr = new CXFA_FWLAdapterWidgetMgr; |
166 pDelegate->OnSetCapability(FWL_WGTMGR_DisableThread | | 164 pDelegate->OnSetCapability(FWL_WGTMGR_DisableThread | |
167 FWL_WGTMGR_DisableForm); | 165 FWL_WGTMGR_DisableForm); |
168 m_pWidgetMgrDelegate = pDelegate; | 166 m_pWidgetMgrDelegate = pDelegate; |
169 } | 167 } |
170 return m_pAdapterWidgetMgr; | 168 return m_pAdapterWidgetMgr; |
171 } | 169 } |
172 IFWL_AdapterThreadMgr* CXFA_FFApp::GetThreadMgr() { | |
173 if (!m_pAdapterThreadMgr) { | |
174 m_pAdapterThreadMgr = new CFWL_SDAdapterThreadMgr; | |
175 } | |
176 return m_pAdapterThreadMgr; | |
177 } | |
178 IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() { | 170 IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() { |
179 return m_pProvider->GetTimerMgr(); | 171 return m_pProvider->GetTimerMgr(); |
180 } | 172 } |
OLD | NEW |