1// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/src/foxitlib.h"
8CFWL_App::CFWL_App() : m_pIface(IFWL_App::Create(nullptr)), m_pTheme(nullptr) {}
9CFWL_App::~CFWL_App() {
10  if (m_pTheme) {
11    m_pTheme->Finalize();
12    delete m_pTheme;
13    m_pTheme = NULL;
14  }
15  m_pIface->Release();
16}
17FWL_ERR CFWL_App::Initialize() {
18  m_pTheme = new CFWL_Theme;
19  m_pTheme->Initialize();
20  m_pIface->SetThemeProvider(m_pTheme);
21  return m_pIface->Initialize();
22}
23FWL_ERR CFWL_App::Exit(int32_t iExitCode) {
24  if (!m_pIface)
25    return FWL_ERR_Indefinite;
26  return m_pIface->Exit(iExitCode);
27}
28