Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: xfa/src/fwl/src/core/fwl_appimp.cpp

Issue 1707433002: IFWL_App::Create() always passed adapter, "fuel" adapter unused (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/include/fwl/adapter/fwl_adapternative.h ('k') | xfa/src/fwl/src/core/include/fwl_appimp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/src/foxitlib.h" 7 #include "xfa/src/foxitlib.h"
8 #include "xfa/src/fwl/src/core/include/fwl_targetimp.h" 8 #include "xfa/src/fwl/src/core/include/fwl_targetimp.h"
9 #include "xfa/src/fwl/src/core/include/fwl_threadimp.h" 9 #include "xfa/src/fwl/src/core/include/fwl_threadimp.h"
10 #include "xfa/src/fwl/src/core/include/fwl_noteimp.h" 10 #include "xfa/src/fwl/src/core/include/fwl_noteimp.h"
(...skipping 21 matching lines...) Expand all
32 return static_cast<CFWL_AppImp*>(GetImpl())->GetThemeProvider(); 32 return static_cast<CFWL_AppImp*>(GetImpl())->GetThemeProvider();
33 } 33 }
34 FWL_ERR IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { 34 FWL_ERR IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
35 return static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider); 35 return static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider);
36 } 36 }
37 FWL_ERR IFWL_App::Exit(int32_t iExitCode) { 37 FWL_ERR IFWL_App::Exit(int32_t iExitCode) {
38 return static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode); 38 return static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode);
39 } 39 }
40 40
41 CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter) 41 CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, IFWL_AdapterNative* pAdapter)
42 : CFWL_NoteThreadImp(pIface), m_pWidgetMgr(NULL), m_pThemeProvider(NULL) { 42 : CFWL_NoteThreadImp(pIface),
43 if (!pAdapter) { 43 m_pAdapterNative(pAdapter),
44 pAdapter = FWL_CreateFuelAdapterNative(); 44 m_pThemeProvider(nullptr) {}
45 m_bFuelAdapter = TRUE; 45
46 } else {
47 m_bFuelAdapter = FALSE;
48 }
49 m_pAdapterNative = pAdapter;
50 }
51 CFWL_AppImp::~CFWL_AppImp() { 46 CFWL_AppImp::~CFWL_AppImp() {
52 CFWL_ToolTipContainer::DeleteInstance(); 47 CFWL_ToolTipContainer::DeleteInstance();
53 if (m_bFuelAdapter) {
54 FWL_ReleaseFuelAdapterNative(m_pAdapterNative);
55 m_pAdapterNative = NULL;
56 }
57 if (m_pWidgetMgr) {
58 delete m_pWidgetMgr;
59 m_pWidgetMgr = NULL;
60 }
61 } 48 }
49
62 FWL_ERR CFWL_AppImp::Initialize() { 50 FWL_ERR CFWL_AppImp::Initialize() {
63 if (!m_pWidgetMgr) { 51 if (!m_pWidgetMgr) {
64 m_pWidgetMgr = new CFWL_WidgetMgr(m_pAdapterNative); 52 m_pWidgetMgr.reset(new CFWL_WidgetMgr(m_pAdapterNative));
65 } 53 }
66 return FWL_ERR_Succeeded; 54 return FWL_ERR_Succeeded;
67 } 55 }
68 FWL_ERR CFWL_AppImp::Finalize() { 56 FWL_ERR CFWL_AppImp::Finalize() {
69 delete m_pWidgetMgr; 57 m_pWidgetMgr.reset();
70 m_pWidgetMgr = NULL;
71 return FWL_ERR_Succeeded; 58 return FWL_ERR_Succeeded;
72 } 59 }
73 IFWL_AdapterNative* CFWL_AppImp::GetAdapterNative() { 60 IFWL_AdapterNative* CFWL_AppImp::GetAdapterNative() const {
74 return m_pAdapterNative; 61 return m_pAdapterNative;
75 } 62 }
76 IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr() { 63 IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr() {
77 return static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()) 64 return static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr())
78 ->GetAdapterWidgetMgr(); 65 ->GetAdapterWidgetMgr();
79 } 66 }
80 IFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() { 67 IFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() const {
81 return m_pWidgetMgr; 68 return m_pWidgetMgr.get();
82 } 69 }
83 FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { 70 FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
84 m_pThemeProvider = pThemeProvider; 71 m_pThemeProvider = pThemeProvider;
85 return FWL_ERR_Succeeded; 72 return FWL_ERR_Succeeded;
86 } 73 }
87 FWL_ERR CFWL_AppImp::Exit(int32_t iExitCode) { 74 FWL_ERR CFWL_AppImp::Exit(int32_t iExitCode) {
88 while (m_pNoteDriver->PopNoteLoop()) 75 while (m_pNoteDriver->PopNoteLoop())
89 ; 76 ;
90 return m_pWidgetMgr->GetAdapterWidgetMgr()->Exit(0); 77 return m_pWidgetMgr->GetAdapterWidgetMgr()->Exit(0);
91 } 78 }
92 IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() { 79 IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() const {
93 return m_pThemeProvider; 80 return m_pThemeProvider;
94 } 81 }
95 IFWL_AdapterNative* FWL_GetAdapterNative() { 82 IFWL_AdapterNative* FWL_GetAdapterNative() {
96 IFWL_App* pApp = FWL_GetApp(); 83 IFWL_App* pApp = FWL_GetApp();
97 if (!pApp) 84 if (!pApp)
98 return NULL; 85 return NULL;
99 return pApp->GetAdapterNative(); 86 return pApp->GetAdapterNative();
100 } 87 }
101 IFWL_ThemeProvider* FWL_GetThemeProvider() { 88 IFWL_ThemeProvider* FWL_GetThemeProvider() {
102 return NULL; 89 return NULL;
(...skipping 11 matching lines...) Expand all
114 IFWL_NoteThread* pNoteTread = pWidget->GetOwnerThread(); 101 IFWL_NoteThread* pNoteTread = pWidget->GetOwnerThread();
115 if (!pNoteTread) 102 if (!pNoteTread)
116 return FWL_ERR_Succeeded; 103 return FWL_ERR_Succeeded;
117 CFWL_NoteDriver* pNoteDriver = 104 CFWL_NoteDriver* pNoteDriver =
118 static_cast<CFWL_NoteDriver*>(pNoteTread->GetNoteDriver()); 105 static_cast<CFWL_NoteDriver*>(pNoteTread->GetNoteDriver());
119 if (!pNoteTread) 106 if (!pNoteTread)
120 return FWL_ERR_Succeeded; 107 return FWL_ERR_Succeeded;
121 pNoteDriver->NotifyFullScreenMode(pWidget, bFullScreen); 108 pNoteDriver->NotifyFullScreenMode(pWidget, bFullScreen);
122 return FWL_GetAdapterWidgetMgr()->SetFullScreen(pWidget, bFullScreen); 109 return FWL_GetAdapterWidgetMgr()->SetFullScreen(pWidget, bFullScreen);
123 } 110 }
OLDNEW
« no previous file with comments | « xfa/include/fwl/adapter/fwl_adapternative.h ('k') | xfa/src/fwl/src/core/include/fwl_appimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698