summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_app.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-28 10:51:13 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 10:51:13 -0700
commit7322343b9322b93d97077575f95a00dcca3f0451 (patch)
tree36337e0a2aff2147a9067477f982496129f0f7a1 /xfa/fwl/core/ifwl_app.h
parente6ebf7af7ea94d48091be300cec84b499d3b8ae0 (diff)
downloadpdfium-7322343b9322b93d97077575f95a00dcca3f0451.tar.xz
More FWL interface cleanup.
This CL merges the IFWL_Target class into IFWL_Widget and IFWL_Thread into IFWL_App. The IFWL_WidgetMgrDelegate, IFWL_NoteDriver and IFWL_NotThread are removed in favour of their concrete classes. Review-Url: https://codereview.chromium.org/1921853006
Diffstat (limited to 'xfa/fwl/core/ifwl_app.h')
-rw-r--r--xfa/fwl/core/ifwl_app.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/xfa/fwl/core/ifwl_app.h b/xfa/fwl/core/ifwl_app.h
index 3fb0940ed4..53dc35d33a 100644
--- a/xfa/fwl/core/ifwl_app.h
+++ b/xfa/fwl/core/ifwl_app.h
@@ -7,19 +7,33 @@
#ifndef XFA_FWL_CORE_IFWL_APP_H_
#define XFA_FWL_CORE_IFWL_APP_H_
+// The FWL thread/app code contains three parallel classes, which reference each
+// other via pointers as follows:
+//
+// m_pIface m_pImpl
+// CXFA_FFApp ------------> IFWL_App -----------> CFWL_AppImp
+// <-----------
+// m_pIface
+
+#include <memory>
+
#include "core/fxcrt/include/fx_string.h"
-#include "xfa/fwl/core/ifwl_thread.h"
+#include "xfa/fwl/core/fwl_appimp.h"
+#include "xfa/fwl/core/fwl_error.h"
+class CFWL_NoteDriver;
class IFWL_AdapterNative;
+class IFWL_AdapterWidgetMgr;
+class IFWL_ThemeProvider;
class IFWL_Widget;
class IFWL_WidgetMgr;
-class IFWL_ThemeProvider;
-class IFWL_AdapterWidgetMgr;
-class IFWL_App : public IFWL_Thread {
+class IFWL_App {
public:
static IFWL_App* Create(IFWL_AdapterNative* pAdapter);
+ virtual ~IFWL_App() {}
+
FWL_ERR Initialize();
FWL_ERR Finalize();
IFWL_AdapterNative* GetAdapterNative();
@@ -28,8 +42,20 @@ class IFWL_App : public IFWL_Thread {
FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
FWL_ERR Exit(int32_t iExitCode);
+ // These call into polymorphic methods in the impl; no need to override.
+ void Release();
+
+ CFWL_AppImp* GetImpl() const { return m_pImpl.get(); }
+
+ // Takes ownership of |pImpl|.
+ void SetImpl(CFWL_AppImp* pImpl) { m_pImpl.reset(pImpl); }
+
+ CFWL_NoteDriver* GetNoteDriver() const;
+
private:
IFWL_App() {}
+
+ std::unique_ptr<CFWL_AppImp> m_pImpl;
};
IFWL_App* FWL_GetApp();