diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-18 16:48:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-18 16:48:16 -0700 |
commit | 4e903136cf0f02578c0e47c6738b633c96814b62 (patch) | |
tree | f6c85bfe408c728b9b2dbfcaf60316912945643d /xfa/fwl/core/fwl_appimp.cpp | |
parent | f328d0d378b8df8a3416988d96c34f1d3f9d26d1 (diff) | |
download | pdfium-4e903136cf0f02578c0e47c6738b633c96814b62.tar.xz |
Merge IFWL_App and FWL_AppImp together
The IFWL_App class just acts as a proxy to the FWL_AppImp code. This Cl removes
FWL_AppImp and merges the code back up to IFWL_App, simplifying the
object hierarchy.
Review-Url: https://codereview.chromium.org/2430563003
Diffstat (limited to 'xfa/fwl/core/fwl_appimp.cpp')
-rw-r--r-- | xfa/fwl/core/fwl_appimp.cpp | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/xfa/fwl/core/fwl_appimp.cpp b/xfa/fwl/core/fwl_appimp.cpp deleted file mode 100644 index 2df579ca38..0000000000 --- a/xfa/fwl/core/fwl_appimp.cpp +++ /dev/null @@ -1,117 +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/fwl_appimp.h" - -#include "xfa/fwl/core/cfwl_widgetmgr.h" -#include "xfa/fwl/core/fwl_noteimp.h" -#include "xfa/fwl/core/ifwl_app.h" -#include "xfa/fwl/core/ifwl_widget.h" -#include "xfa/fxfa/app/xfa_fwladapter.h" - -IFWL_App* IFWL_App::Create(CXFA_FFApp* pAdapter) { - IFWL_App* pApp = new IFWL_App; - pApp->SetImpl(new CFWL_AppImp(pApp, pAdapter)); - return pApp; -} - -IFWL_App::IFWL_App() {} - -IFWL_App::~IFWL_App() {} - -void IFWL_App::Release() {} - -FWL_Error IFWL_App::Initialize() { - return static_cast<CFWL_AppImp*>(GetImpl())->Initialize(); -} - -FWL_Error IFWL_App::Finalize() { - return static_cast<CFWL_AppImp*>(GetImpl())->Finalize(); -} - -CXFA_FFApp* IFWL_App::GetAdapterNative() { - return static_cast<CFWL_AppImp*>(GetImpl())->GetAdapterNative(); -} - -CFWL_WidgetMgr* IFWL_App::GetWidgetMgr() { - return static_cast<CFWL_AppImp*>(GetImpl())->GetWidgetMgr(); -} - -IFWL_ThemeProvider* IFWL_App::GetThemeProvider() { - return static_cast<CFWL_AppImp*>(GetImpl())->GetThemeProvider(); -} - -void IFWL_App::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { - static_cast<CFWL_AppImp*>(GetImpl())->SetThemeProvider(pThemeProvider); -} - -void IFWL_App::Exit(int32_t iExitCode) { - static_cast<CFWL_AppImp*>(GetImpl())->Exit(iExitCode); -} - -CFWL_NoteDriver* IFWL_App::GetNoteDriver() const { - return static_cast<CFWL_AppImp*>(GetImpl())->GetNoteDriver(); -} - -CFWL_AppImp::CFWL_AppImp(IFWL_App* pIface, CXFA_FFApp* pAdapter) - : m_pAdapterNative(pAdapter), - m_pThemeProvider(nullptr), - m_pNoteDriver(new CFWL_NoteDriver), - m_pIface(pIface) {} - -CFWL_AppImp::~CFWL_AppImp() { - CFWL_ToolTipContainer::DeleteInstance(); -} - -FWL_Error CFWL_AppImp::Initialize() { - if (!m_pWidgetMgr) { - m_pWidgetMgr.reset(new CFWL_WidgetMgr(m_pAdapterNative)); - } - return FWL_Error::Succeeded; -} -FWL_Error CFWL_AppImp::Finalize() { - m_pWidgetMgr.reset(); - return FWL_Error::Succeeded; -} -CXFA_FFApp* CFWL_AppImp::GetAdapterNative() const { - return m_pAdapterNative; -} -CXFA_FWLAdapterWidgetMgr* FWL_GetAdapterWidgetMgr() { - return CFWL_WidgetMgr::GetInstance()->GetAdapterWidgetMgr(); -} -CFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() const { - return m_pWidgetMgr.get(); -} - -void CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { - m_pThemeProvider = pThemeProvider; -} - -void CFWL_AppImp::Exit(int32_t iExitCode) { - while (m_pNoteDriver->PopNoteLoop()) { - continue; - } -} - -IFWL_ThemeProvider* CFWL_AppImp::GetThemeProvider() const { - return m_pThemeProvider; -} - -CXFA_FFApp* FWL_GetAdapterNative() { - IFWL_App* pApp = FWL_GetApp(); - if (!pApp) - return nullptr; - return pApp->GetAdapterNative(); -} - -static IFWL_App* g_theApp = nullptr; -IFWL_App* FWL_GetApp() { - return g_theApp; -} - -void FWL_SetApp(IFWL_App* pApp) { - g_theApp = pApp; -} |