| 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/fwl_appimp.h" | 7 #include "xfa/fwl/core/fwl_appimp.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/core/fwl_noteimp.h" | 9 #include "xfa/fwl/core/fwl_noteimp.h" |
| 10 #include "xfa/fwl/core/fwl_targetimp.h" | |
| 11 #include "xfa/fwl/core/fwl_threadimp.h" | |
| 12 #include "xfa/fwl/core/fwl_widgetmgrimp.h" | 10 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
| 13 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" | 11 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" |
| 14 #include "xfa/fwl/core/ifwl_app.h" | 12 #include "xfa/fwl/core/ifwl_app.h" |
| 15 #include "xfa/fwl/core/ifwl_widget.h" | 13 #include "xfa/fwl/core/ifwl_widget.h" |
| 16 | 14 |
| 17 IFWL_App* IFWL_App::Create(IFWL_AdapterNative* pAdapter) { | 15 IFWL_App* IFWL_App::Create(IFWL_AdapterNative* pAdapter) { |
| 18 IFWL_App* pApp = new IFWL_App; | 16 IFWL_App* pApp = new IFWL_App; |
| 19 pApp->SetImpl(new CFWL_AppImp(pApp, pAdapter)); | 17 pApp->SetImpl(new CFWL_AppImp(pApp, pAdapter)); |
| 20 return pApp; | 18 return pApp; |
| 21 } | 19 } |
| 20 |
| 21 void IFWL_App::Release() {} |
| 22 |
| 22 FWL_ERR IFWL_App::Initialize() { | 23 FWL_ERR IFWL_App::Initialize() { |
| 23 return static_cast<CFWL_AppImp*>(GetImpl())->Initialize(); | 24 return static_cast<CFWL_AppImp*>(GetImpl())->Initialize(); |
| 24 } | 25 } |
| 26 |
| 25 FWL_ERR IFWL_App::Finalize() { | 27 FWL_ERR IFWL_App::Finalize() { |
| 26 return static_cast<CFWL_AppImp*>(GetImpl())->Finalize(); | 28 return static_cast<CFWL_AppImp*>(GetImpl())->Finalize(); |
| 27 } | 29 } |
| 30 |
| 28 IFWL_AdapterNative* IFWL_App::GetAdapterNative() { | 31 IFWL_AdapterNative* IFWL_App::GetAdapterNative() { |
| 29 return static_cast<CFWL_AppImp*>(GetImpl())->GetAdapterNative(); | 32 return static_cast<CFWL_AppImp*>(GetImpl())->GetAdapterNative(); |
| 30 } | 33 } |
| 34 |
| 31 IFWL_WidgetMgr* IFWL_App::GetWidgetMgr() { | 35 IFWL_WidgetMgr* IFWL_App::GetWidgetMgr() { |
| 32 return static_cast<CFWL_AppImp*>(GetImpl())->GetWidgetMgr(); | 36 return static_cast<CFWL_AppImp*>(GetImpl())->GetWidgetMgr(); |
| 33 } | 37 } |
| 38 |
| 34 IFWL_ThemeProvider* IFWL_App::GetThemeProvider() { | 39 IFWL_ThemeProvider* IFWL_App::GetThemeProvider() { |
| 35 return static_cast<CFWL_AppImp*>(GetImpl())->GetThemeProvider(); | 40 return static_cast<CFWL_AppImp*>(GetImpl())->GetThemeProvider(); |
| 36 } | 41 } |
| 42 |
| 37 FWL_ERR IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { | 43 FWL_ERR IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { |
| 38 return static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider); | 44 return static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider); |
| 39 } | 45 } |
| 46 |
| 40 FWL_ERR IFWL_App::Exit(int32_t iExitCode) { | 47 FWL_ERR IFWL_App::Exit(int32_t iExitCode) { |
| 41 return static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode); | 48 return static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode); |
| 42 } | 49 } |
| 43 | 50 |
| 51 CFWL_NoteDriver* IFWL_App::GetNoteDriver() const { |
| 52 return static_cast<CFWL_AppImp*>(GetImpl())->GetNoteDriver(); |
| 53 } |
| 54 |
| 44 CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter) | 55 CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter) |
| 45 : CFWL_ThreadImp(pIface), | 56 : m_pAdapterNative(pAdapter), |
| 46 m_pAdapterNative(pAdapter), | 57 m_pThemeProvider(nullptr), |
| 47 m_pThemeProvider(nullptr) {} | 58 m_pNoteDriver(new CFWL_NoteDriver), |
| 59 m_pIface(pIface) {} |
| 48 | 60 |
| 49 CFWL_AppImp::~CFWL_AppImp() { | 61 CFWL_AppImp::~CFWL_AppImp() { |
| 50 CFWL_ToolTipContainer::DeleteInstance(); | 62 CFWL_ToolTipContainer::DeleteInstance(); |
| 51 } | 63 } |
| 52 | 64 |
| 53 FWL_ERR CFWL_AppImp::Initialize() { | 65 FWL_ERR CFWL_AppImp::Initialize() { |
| 54 if (!m_pWidgetMgr) { | 66 if (!m_pWidgetMgr) { |
| 55 m_pWidgetMgr.reset(new CFWL_WidgetMgr(m_pAdapterNative)); | 67 m_pWidgetMgr.reset(new CFWL_WidgetMgr(m_pAdapterNative)); |
| 56 } | 68 } |
| 57 return FWL_ERR_Succeeded; | 69 return FWL_ERR_Succeeded; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return NULL; | 101 return NULL; |
| 90 return pApp->GetAdapterNative(); | 102 return pApp->GetAdapterNative(); |
| 91 } | 103 } |
| 92 static IFWL_App* _theApp = NULL; | 104 static IFWL_App* _theApp = NULL; |
| 93 IFWL_App* FWL_GetApp() { | 105 IFWL_App* FWL_GetApp() { |
| 94 return _theApp; | 106 return _theApp; |
| 95 } | 107 } |
| 96 void FWL_SetApp(IFWL_App* pApp) { | 108 void FWL_SetApp(IFWL_App* pApp) { |
| 97 _theApp = pApp; | 109 _theApp = pApp; |
| 98 } | 110 } |
| OLD | NEW |