| 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 #ifndef XFA_FXFA_XFA_FFAPP_H_ | 7 #ifndef XFA_FXFA_XFA_FFAPP_H_ |
| 8 #define XFA_FXFA_XFA_FFAPP_H_ | 8 #define XFA_FXFA_XFA_FFAPP_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, | 49 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, |
| 50 CPDF_Document* pPDFDoc); | 50 CPDF_Document* pPDFDoc); |
| 51 void SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr); | 51 void SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr); |
| 52 | 52 |
| 53 CXFA_FFDocHandler* GetDocHandler(); | 53 CXFA_FFDocHandler* GetDocHandler(); |
| 54 CXFA_FWLAdapterWidgetMgr* GetWidgetMgr(CFWL_WidgetMgrDelegate* pDelegate); | 54 CXFA_FWLAdapterWidgetMgr* GetWidgetMgr(CFWL_WidgetMgrDelegate* pDelegate); |
| 55 IFGAS_FontMgr* GetFDEFontMgr(); | 55 IFGAS_FontMgr* GetFDEFontMgr(); |
| 56 CXFA_FWLTheme* GetFWLTheme(); | 56 CXFA_FWLTheme* GetFWLTheme(); |
| 57 | 57 |
| 58 IXFA_AppProvider* GetAppProvider() const { return m_pProvider; } | 58 IXFA_AppProvider* GetAppProvider() const { return m_pProvider; } |
| 59 const IFWL_App* GetFWLApp() const { return m_pFWLApp.get(); } |
| 59 IFWL_AdapterTimerMgr* GetTimerMgr() const; | 60 IFWL_AdapterTimerMgr* GetTimerMgr() const; |
| 60 CXFA_FontMgr* GetXFAFontMgr() const; | 61 CXFA_FontMgr* GetXFAFontMgr() const; |
| 61 CFWL_WidgetMgrDelegate* GetWidgetMgrDelegate() const { | 62 CFWL_WidgetMgrDelegate* GetWidgetMgrDelegate() const { |
| 62 return m_pWidgetMgrDelegate; | 63 return m_pWidgetMgrDelegate; |
| 63 } | 64 } |
| 64 | 65 |
| 66 void ClearEventTargets(); |
| 67 |
| 65 protected: | 68 protected: |
| 66 std::unique_ptr<CXFA_FFDocHandler> m_pDocHandler; | 69 std::unique_ptr<CXFA_FFDocHandler> m_pDocHandler; |
| 67 IXFA_AppProvider* const m_pProvider; | 70 IXFA_AppProvider* const m_pProvider; |
| 68 | 71 |
| 69 // The fonts stored in the font manager may have been created by the default | 72 // The fonts stored in the font manager may have been created by the default |
| 70 // font manager. The GEFont::LoadFont call takes the manager as a param and | 73 // font manager. The GEFont::LoadFont call takes the manager as a param and |
| 71 // stores it internally. When you destroy the GEFont it tries to unregister | 74 // stores it internally. When you destroy the GEFont it tries to unregister |
| 72 // from the font manager and if the default font manager was destroyed first | 75 // from the font manager and if the default font manager was destroyed first |
| 73 // get get a use-after-free. The m_pFWLTheme can try to cleanup a GEFont | 76 // get get a use-after-free. The m_pFWLTheme can try to cleanup a GEFont |
| 74 // when it frees, so make sure it gets cleaned up first. That requires | 77 // when it frees, so make sure it gets cleaned up first. That requires |
| (...skipping 10 matching lines...) Expand all Loading... |
| 85 std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; | 88 std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; |
| 86 CFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; // not owned. | 89 CFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; // not owned. |
| 87 | 90 |
| 88 // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former | 91 // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former |
| 89 // may refers to theme manager and the latter refers to font manager. | 92 // may refers to theme manager and the latter refers to font manager. |
| 90 std::unique_ptr<CXFA_FWLTheme> m_pFWLTheme; | 93 std::unique_ptr<CXFA_FWLTheme> m_pFWLTheme; |
| 91 std::unique_ptr<IFWL_App> m_pFWLApp; | 94 std::unique_ptr<IFWL_App> m_pFWLApp; |
| 92 }; | 95 }; |
| 93 | 96 |
| 94 #endif // XFA_FXFA_XFA_FFAPP_H_ | 97 #endif // XFA_FXFA_XFA_FFAPP_H_ |
| OLD | NEW |