Move xfa/include/fwl/{core,basewidget} to xfa/fwl/{core,basewidget}.

This CL moves and splits the FWL files from the core and basewidget directories
into the non-include folders.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1827923002 .
diff --git a/BUILD.gn b/BUILD.gn
index 753e5a7..862929f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -981,10 +981,32 @@
       "xfa/fwl/basewidget/fwl_tooltipctrlimp.h",
       "xfa/fwl/basewidget/fxmath_barcodeimp.cpp",
       "xfa/fwl/basewidget/fxmath_barcodeimp.h",
+      "xfa/fwl/basewidget/ifwl_barcode.h",
+      "xfa/fwl/basewidget/ifwl_caret.h",
+      "xfa/fwl/basewidget/ifwl_checkbox.h",
+      "xfa/fwl/basewidget/ifwl_combobox.h",
+      "xfa/fwl/basewidget/ifwl_datetimepicker.h",
+      "xfa/fwl/basewidget/ifwl_edit.h",
+      "xfa/fwl/basewidget/ifwl_listbox.h",
+      "xfa/fwl/basewidget/ifwl_monthcalendar.h",
+      "xfa/fwl/basewidget/ifwl_picturebox.h",
+      "xfa/fwl/basewidget/ifwl_pushbutton.h",
+      "xfa/fwl/basewidget/ifwl_scrollbar.h",
+      "xfa/fwl/basewidget/ifwl_spinbutton.h",
+      "xfa/fwl/basewidget/ifwl_tooltip.h",
+      "xfa/fwl/basewidget/ifx_barcode.h",
+      "xfa/fwl/core/cfwl_event.h",
+      "xfa/fwl/core/cfwl_message.h",
+      "xfa/fwl/core/cfwl_note.h",
+      "xfa/fwl/core/cfwl_themebackground.h",
+      "xfa/fwl/core/cfwl_themepart.h",
+      "xfa/fwl/core/cfwl_themetext.h",
+      "xfa/fwl/core/cfwl_widgetimpproperties.h",
       "xfa/fwl/core/fwl_appimp.cpp",
       "xfa/fwl/core/fwl_appimp.h",
       "xfa/fwl/core/fwl_contentimp.cpp",
       "xfa/fwl/core/fwl_contentimp.h",
+      "xfa/fwl/core/fwl_error.h",
       "xfa/fwl/core/fwl_formimp.cpp",
       "xfa/fwl/core/fwl_formimp.h",
       "xfa/fwl/core/fwl_gridimp.cpp",
@@ -994,15 +1016,42 @@
       "xfa/fwl/core/fwl_panelimp.cpp",
       "xfa/fwl/core/fwl_panelimp.h",
       "xfa/fwl/core/fwl_sdadapterimp.cpp",
+      "xfa/fwl/core/fwl_sdadapterimp.h",
       "xfa/fwl/core/fwl_targetimp.cpp",
       "xfa/fwl/core/fwl_targetimp.h",
       "xfa/fwl/core/fwl_threadimp.cpp",
       "xfa/fwl/core/fwl_threadimp.h",
       "xfa/fwl/core/fwl_timerimp.cpp",
+      "xfa/fwl/core/fwl_widgetdef.h",
       "xfa/fwl/core/fwl_widgetimp.cpp",
       "xfa/fwl/core/fwl_widgetimp.h",
       "xfa/fwl/core/fwl_widgetmgrimp.cpp",
       "xfa/fwl/core/fwl_widgetmgrimp.h",
+      "xfa/fwl/core/ifwl_adapternative.h",
+      "xfa/fwl/core/ifwl_adapterthreadmgr.h",
+      "xfa/fwl/core/ifwl_adapterwidgetmgr.h",
+      "xfa/fwl/core/ifwl_app.h",
+      "xfa/fwl/core/ifwl_content.h",
+      "xfa/fwl/core/ifwl_custom.h",
+      "xfa/fwl/core/ifwl_custompanel.h",
+      "xfa/fwl/core/ifwl_dataprovider.h",
+      "xfa/fwl/core/ifwl_form.h",
+      "xfa/fwl/core/ifwl_grid.h",
+      "xfa/fwl/core/ifwl_notedriver.h",
+      "xfa/fwl/core/ifwl_noteloop.h",
+      "xfa/fwl/core/ifwl_notethread.h",
+      "xfa/fwl/core/ifwl_panel.h",
+      "xfa/fwl/core/ifwl_proxy.h",
+      "xfa/fwl/core/ifwl_target.h",
+      "xfa/fwl/core/ifwl_themeprovider.h",
+      "xfa/fwl/core/ifwl_thread.h",
+      "xfa/fwl/core/ifwl_timer.h",
+      "xfa/fwl/core/ifwl_tooltiptarget.h",
+      "xfa/fwl/core/ifwl_widget.h",
+      "xfa/fwl/core/ifwl_widgetdelegate.h",
+      "xfa/fwl/core/ifwl_widgetmgr.h",
+      "xfa/fwl/core/ifwl_widgetmgrdelegate.h",
+      "xfa/fwl/core/include/ifwl_adaptertimermgr.h",
       "xfa/fwl/lightwidget/app.cpp",
       "xfa/fwl/lightwidget/barcode.cpp",
       "xfa/fwl/lightwidget/caret.cpp",
@@ -1433,40 +1482,6 @@
       "xfa/fxgraphics/cfx_shading.h",
       "xfa/fxgraphics/include/cfx_graphics.h",
       "xfa/fxjse/include/fxjse.h",
-      "xfa/include/fwl/adapter/fwl_adapternative.h",
-      "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h",
-      "xfa/include/fwl/adapter/fwl_adaptertimermgr.h",
-      "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h",
-      "xfa/include/fwl/adapter/fwl_sdadapterimp.h",
-      "xfa/include/fwl/basewidget/fwl_barcode.h",
-      "xfa/include/fwl/basewidget/fwl_caret.h",
-      "xfa/include/fwl/basewidget/fwl_checkbox.h",
-      "xfa/include/fwl/basewidget/fwl_combobox.h",
-      "xfa/include/fwl/basewidget/fwl_datetimepicker.h",
-      "xfa/include/fwl/basewidget/fwl_edit.h",
-      "xfa/include/fwl/basewidget/fwl_listbox.h",
-      "xfa/include/fwl/basewidget/fwl_menu.h",
-      "xfa/include/fwl/basewidget/fwl_monthcalendar.h",
-      "xfa/include/fwl/basewidget/fwl_picturebox.h",
-      "xfa/include/fwl/basewidget/fwl_pushbutton.h",
-      "xfa/include/fwl/basewidget/fwl_scrollbar.h",
-      "xfa/include/fwl/basewidget/fwl_spinbutton.h",
-      "xfa/include/fwl/basewidget/fwl_tooltipctrl.h",
-      "xfa/include/fwl/basewidget/fxmath_barcode.h",
-      "xfa/include/fwl/core/fwl_app.h",
-      "xfa/include/fwl/core/fwl_content.h",
-      "xfa/include/fwl/core/fwl_error.h",
-      "xfa/include/fwl/core/fwl_form.h",
-      "xfa/include/fwl/core/fwl_grid.h",
-      "xfa/include/fwl/core/fwl_note.h",
-      "xfa/include/fwl/core/fwl_panel.h",
-      "xfa/include/fwl/core/fwl_target.h",
-      "xfa/include/fwl/core/fwl_theme.h",
-      "xfa/include/fwl/core/fwl_thread.h",
-      "xfa/include/fwl/core/fwl_timer.h",
-      "xfa/include/fwl/core/fwl_widget.h",
-      "xfa/include/fwl/core/fwl_widgetdef.h",
-      "xfa/include/fwl/core/fwl_widgetmgr.h",
       "xfa/include/fwl/lightwidget/app.h",
       "xfa/include/fwl/lightwidget/barcode.h",
       "xfa/include/fwl/lightwidget/caret.h",
diff --git a/fpdfsdk/include/fpdfxfa/DEPS b/fpdfsdk/include/fpdfxfa/DEPS
new file mode 100644
index 0000000..f207778
--- /dev/null
+++ b/fpdfsdk/include/fpdfxfa/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+  "+xfa/fwl/core/include",
+]
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
index 545d910..f4c73c6 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
@@ -10,7 +10,7 @@
 #include <vector>
 
 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
-#include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h"
+#include "xfa/fwl/core/include/ifwl_adaptertimermgr.h"
 
 #define JS_STR_VIEWERTYPE_STANDARD L"Exchange"
 #define JS_STR_LANGUANGE L"ENU"
diff --git a/xfa.gyp b/xfa.gyp
index 2185d6e..680a724 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -35,40 +35,6 @@
         'FT2_BUILD_LIBRARY',
       ],
       "sources":[
-        "xfa/include/fwl/adapter/fwl_adapternative.h",
-        "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h",
-        "xfa/include/fwl/adapter/fwl_adaptertimermgr.h",
-        "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h",
-        "xfa/include/fwl/adapter/fwl_sdadapterimp.h",
-        "xfa/include/fwl/basewidget/fwl_barcode.h",
-        "xfa/include/fwl/basewidget/fwl_caret.h",
-        "xfa/include/fwl/basewidget/fwl_checkbox.h",
-        "xfa/include/fwl/basewidget/fwl_combobox.h",
-        "xfa/include/fwl/basewidget/fwl_datetimepicker.h",
-        "xfa/include/fwl/basewidget/fwl_edit.h",
-        "xfa/include/fwl/basewidget/fwl_listbox.h",
-        "xfa/include/fwl/basewidget/fwl_menu.h",
-        "xfa/include/fwl/basewidget/fwl_monthcalendar.h",
-        "xfa/include/fwl/basewidget/fwl_picturebox.h",
-        "xfa/include/fwl/basewidget/fwl_pushbutton.h",
-        "xfa/include/fwl/basewidget/fwl_scrollbar.h",
-        "xfa/include/fwl/basewidget/fwl_spinbutton.h",
-        "xfa/include/fwl/basewidget/fwl_tooltipctrl.h",
-        "xfa/include/fwl/basewidget/fxmath_barcode.h",
-        "xfa/include/fwl/core/fwl_app.h",
-        "xfa/include/fwl/core/fwl_content.h",
-        "xfa/include/fwl/core/fwl_error.h",
-        "xfa/include/fwl/core/fwl_form.h",
-        "xfa/include/fwl/core/fwl_grid.h",
-        "xfa/include/fwl/core/fwl_note.h",
-        "xfa/include/fwl/core/fwl_panel.h",
-        "xfa/include/fwl/core/fwl_target.h",
-        "xfa/include/fwl/core/fwl_theme.h",
-        "xfa/include/fwl/core/fwl_thread.h",
-        "xfa/include/fwl/core/fwl_timer.h",
-        "xfa/include/fwl/core/fwl_widget.h",
-        "xfa/include/fwl/core/fwl_widgetdef.h",
-        "xfa/include/fwl/core/fwl_widgetmgr.h",
         "xfa/include/fwl/lightwidget/app.h",
         "xfa/include/fwl/lightwidget/barcode.h",
         "xfa/include/fwl/lightwidget/caret.h",
@@ -220,10 +186,32 @@
         "xfa/fwl/basewidget/fwl_tooltipctrlimp.h",
         "xfa/fwl/basewidget/fxmath_barcodeimp.cpp",
         "xfa/fwl/basewidget/fxmath_barcodeimp.h",
+        "xfa/fwl/basewidget/ifwl_barcode.h",
+        "xfa/fwl/basewidget/ifwl_caret.h",
+        "xfa/fwl/basewidget/ifwl_checkbox.h",
+        "xfa/fwl/basewidget/ifwl_combobox.h",
+        "xfa/fwl/basewidget/ifwl_datetimepicker.h",
+        "xfa/fwl/basewidget/ifwl_edit.h",
+        "xfa/fwl/basewidget/ifwl_listbox.h",
+        "xfa/fwl/basewidget/ifwl_monthcalendar.h",
+        "xfa/fwl/basewidget/ifwl_picturebox.h",
+        "xfa/fwl/basewidget/ifwl_pushbutton.h",
+        "xfa/fwl/basewidget/ifwl_scrollbar.h",
+        "xfa/fwl/basewidget/ifwl_spinbutton.h",
+        "xfa/fwl/basewidget/ifwl_tooltip.h",
+        "xfa/fwl/basewidget/ifx_barcode.h",
+        "xfa/fwl/core/cfwl_event.h",
+        "xfa/fwl/core/cfwl_note.h",
+        "xfa/fwl/core/cfwl_message.h",
+        "xfa/fwl/core/cfwl_themebackground.h",
+        "xfa/fwl/core/cfwl_themepart.h",
+        "xfa/fwl/core/cfwl_themetext.h",
+        "xfa/fwl/core/cfwl_widgetimpproperties.h",
         "xfa/fwl/core/fwl_appimp.cpp",
         "xfa/fwl/core/fwl_appimp.h",
         "xfa/fwl/core/fwl_contentimp.cpp",
         "xfa/fwl/core/fwl_contentimp.h",
+        "xfa/fwl/core/fwl_error.h",
         "xfa/fwl/core/fwl_formimp.cpp",
         "xfa/fwl/core/fwl_formimp.h",
         "xfa/fwl/core/fwl_gridimp.cpp",
@@ -233,15 +221,42 @@
         "xfa/fwl/core/fwl_panelimp.cpp",
         "xfa/fwl/core/fwl_panelimp.h",
         "xfa/fwl/core/fwl_sdadapterimp.cpp",
+        "xfa/fwl/core/fwl_sdadapterimp.h",
         "xfa/fwl/core/fwl_targetimp.cpp",
         "xfa/fwl/core/fwl_targetimp.h",
         "xfa/fwl/core/fwl_threadimp.cpp",
         "xfa/fwl/core/fwl_threadimp.h",
         "xfa/fwl/core/fwl_timerimp.cpp",
+        "xfa/fwl/core/fwl_widgetdef.h",
         "xfa/fwl/core/fwl_widgetimp.cpp",
         "xfa/fwl/core/fwl_widgetimp.h",
         "xfa/fwl/core/fwl_widgetmgrimp.cpp",
         "xfa/fwl/core/fwl_widgetmgrimp.h",
+        "xfa/fwl/core/ifwl_adapternative.h",
+        "xfa/fwl/core/ifwl_adapterthreadmgr.h",
+        "xfa/fwl/core/ifwl_adapterwidgetmgr.h",
+        "xfa/fwl/core/ifwl_app.h",
+        "xfa/fwl/core/ifwl_content.h",
+        "xfa/fwl/core/ifwl_custom.h",
+        "xfa/fwl/core/ifwl_custompanel.h",
+        "xfa/fwl/core/ifwl_dataprovider.h",
+        "xfa/fwl/core/ifwl_form.h",
+        "xfa/fwl/core/ifwl_grid.h",
+        "xfa/fwl/core/ifwl_notedriver.h",
+        "xfa/fwl/core/ifwl_noteloop.h",
+        "xfa/fwl/core/ifwl_notethread.h",
+        "xfa/fwl/core/ifwl_panel.h",
+        "xfa/fwl/core/ifwl_proxy.h",
+        "xfa/fwl/core/ifwl_target.h",
+        "xfa/fwl/core/ifwl_themeprovider.h",
+        "xfa/fwl/core/ifwl_thread.h",
+        "xfa/fwl/core/ifwl_timer.h",
+        "xfa/fwl/core/ifwl_tooltiptarget.h",
+        "xfa/fwl/core/ifwl_widget.h",
+        "xfa/fwl/core/ifwl_widgetdelegate.h",
+        "xfa/fwl/core/ifwl_widgetmgr.h",
+        "xfa/fwl/core/ifwl_widgetmgrdelegate.h",
+        "xfa/fwl/core/include/ifwl_adaptertimermgr.h",
         "xfa/fwl/lightwidget/app.cpp",
         "xfa/fwl/lightwidget/barcode.cpp",
         "xfa/fwl/lightwidget/caret.cpp",
diff --git "a/xfa/fde/css/\043fde_cssstyleselector.h\043" "b/xfa/fde/css/\043fde_cssstyleselector.h\043"
deleted file mode 100644
index 9078a44..0000000
--- "a/xfa/fde/css/\043fde_cssstyleselector.h\043"
+++ /dev/null
@@ -1,901 +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
-
-#ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
-#define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
-
-#include <vector>
-
-#include "core/include/fxcrt/fx_ext.h"
-#include "xfa/fde/css/fde_css.h"
-#include "xfa/fde/css/fde_csscache.h"
-#include "xfa/fde/css/fde_cssdeclaration.h"
-#include "xfa/fgas/crt/fgas_memory.h"
-#include "xfa/fgas/crt/fgas_system.h"
-
-#define FDE_CSSUNIVERSALHASH ('*')
-
-class FDE_CSSRuleData : public CFX_Target {
- public:
-  FDE_CSSRuleData(IFDE_CSSSelector* pSel,
-                  IFDE_CSSDeclaration* pDecl,
-                  FX_DWORD dwPos);
-
-  IFDE_CSSSelector* pSelector;
-  IFDE_CSSDeclaration* pDeclaration;
-  FX_DWORD dwPriority;
-  FDE_CSSRuleData* pNext;
-};
-
-class CFDE_CSSRuleCollection : public CFX_Target {
- public:
-  CFDE_CSSRuleCollection()
-      : m_pStaticStore(nullptr),
-        m_pUniversalRules(nullptr),
-        m_pPersudoRules(nullptr),
-        m_iSelectors(0) {}
-  ~CFDE_CSSRuleCollection() { Clear(); }
-  void AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets,
-                    FX_DWORD dwMediaList,
-                    IFX_FontMgr* pFontMgr);
-  void Clear();
-
-  int32_t CountSelectors() const { return m_iSelectors; }
-  FDE_CSSRuleData* GetIDRuleData(FX_DWORD dwIDHash) {
-    void* pData;
-    return m_IDRules.Lookup((void*)(uintptr_t)dwIDHash, pData)
-               ? (FDE_CSSRuleData*)pData
-               : NULL;
-  }
-  FDE_CSSRuleData* GetTagRuleData(FX_DWORD dwTagHasn) {
-    void* pData;
-    return m_TagRules.Lookup((void*)(uintptr_t)dwTagHasn, pData)
-               ? (FDE_CSSRuleData*)pData
-               : NULL;
-  }
-  FDE_CSSRuleData* GetClassRuleData(FX_DWORD dwIDHash) {
-    void* pData;
-    return m_ClassRules.Lookup((void*)(uintptr_t)dwIDHash, pData)
-               ? (FDE_CSSRuleData*)pData
-               : NULL;
-  }
-  FDE_CSSRuleData* GetUniversalRuleData() { return m_pUniversalRules; }
-  FDE_CSSRuleData* GetPersudoRuleData() { return m_pPersudoRules; }
-  IFX_MEMAllocator* m_pStaticStore;
-
- protected:
-  void AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet,
-                    IFDE_CSSRule* pRule,
-                    FX_DWORD dwMediaList,
-                    IFX_FontMgr* pFontMgr);
-  void AddRuleTo(CFX_MapPtrToPtr& map,
-                 FX_DWORD dwKey,
-                 IFDE_CSSSelector* pSel,
-                 IFDE_CSSDeclaration* pDecl);
-  FX_BOOL AddRuleTo(FDE_CSSRuleData*& pList, FDE_CSSRuleData* pData);
-  FDE_CSSRuleData* NewRuleData(IFDE_CSSSelector* pSel,
-                               IFDE_CSSDeclaration* pDecl);
-  CFX_MapPtrToPtr m_IDRules;
-  CFX_MapPtrToPtr m_TagRules;
-  CFX_MapPtrToPtr m_ClassRules;
-  FDE_CSSRuleData* m_pUniversalRules;
-  FDE_CSSRuleData* m_pPersudoRules;
-  int32_t m_iSelectors;
-};
-class CFDE_CSSAccelerator;
-class CFDE_CSSComputedStyle;
-class CFDE_CSSStyleSelector : public IFDE_CSSStyleSelector, public CFX_Target {
- public:
-  CFDE_CSSStyleSelector();
-  ~CFDE_CSSStyleSelector();
-  virtual void Release() { delete this; }
-
-  virtual void SetFontMgr(IFX_FontMgr* pFontMgr);
-  virtual void SetDefFontSize(FX_FLOAT fFontSize);
-
-  virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType,
-                                IFDE_CSSStyleSheet* pSheet);
-  virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType,
-                                 const CFDE_CSSStyleSheetArray* pArray);
-  virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType,
-                                FDE_CSSSTYLESHEETPRIORITY ePriority);
-  virtual void UpdateStyleIndex(FX_DWORD dwMediaList);
-  virtual IFDE_CSSAccelerator* InitAccelerator();
-  virtual IFDE_CSSComputedStyle* CreateComputedStyle(
-      IFDE_CSSComputedStyle* pParentStyle);
-  virtual int32_t MatchDeclarations(
-      IFDE_CSSTagProvider* pTag,
-      CFDE_CSSDeclarationArray& matchedDecls,
-      FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE);
-  virtual void ComputeStyle(IFDE_CSSTagProvider* pTag,
-                            const IFDE_CSSDeclaration** ppDeclArray,
-                            int32_t iDeclCount,
-                            IFDE_CSSComputedStyle* pDestStyle);
-
- protected:
-  void Reset();
-  void MatchRules(FDE_CSSTagCache* pCache,
-                  FDE_CSSRuleData* pList,
-                  FDE_CSSPERSUDO ePersudoType);
-  FX_BOOL MatchSelector(FDE_CSSTagCache* pCache,
-                        IFDE_CSSSelector* pSel,
-                        FDE_CSSPERSUDO ePersudoType);
-  void AppendInlineStyle(CFDE_CSSDeclaration* pDecl,
-                         const FX_WCHAR* psz,
-                         int32_t iLen);
-  void ApplyDeclarations(FX_BOOL bPriority,
-                         const IFDE_CSSDeclaration** ppDeclArray,
-                         int32_t iDeclCount,
-                         IFDE_CSSComputedStyle* pDestStyle);
-  void ApplyProperty(FDE_CSSPROPERTY eProperty,
-                     IFDE_CSSValue* pValue,
-                     CFDE_CSSComputedStyle* pComputedStyle);
-
-  FX_FLOAT ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit,
-                       FX_FLOAT fValue,
-                       FX_FLOAT fPercentBase);
-  FX_BOOL SetLengthWithPercent(FDE_CSSLENGTH& width,
-                               FDE_CSSPRIMITIVETYPE eType,
-                               IFDE_CSSPrimitiveValue* pPrimitive,
-                               FX_FLOAT fFontSize);
-  FX_FLOAT ToFontSize(FDE_CSSPROPERTYVALUE eValue, FX_FLOAT fCurFontSize);
-  FDE_CSSDISPLAY ToDisplay(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSTEXTALIGN ToTextAlign(FDE_CSSPROPERTYVALUE eValue);
-  uint16_t ToFontWeight(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSFONTSTYLE ToFontStyle(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSBORDERSTYLE ToBorderStyle(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSVERTICALALIGN ToVerticalAlign(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSLISTSTYLETYPE ToListStyleType(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSLISTSTYLEPOSITION ToListStylePosition(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSVISIBILITY ToVisibility(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSWHITESPACE ToWhiteSpace(FDE_CSSPROPERTYVALUE eValue);
-  FX_DWORD ToTextDecoration(IFDE_CSSValueList* pList);
-  FDE_CSSTEXTTRANSFORM ToTextTransform(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSFONTVARIANT ToFontVariant(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSFLOAT ToFloat(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSCLEAR ToClear(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSWRITINGMODE ToWritingMode(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSWORDBREAK ToWordBreak(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSPAGEBREAK ToPageBreak(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSOVERFLOW ToOverflow(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSLINEBREAK ToLineBreak(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSTEXTCOMBINE ToTextCombine(FDE_CSSPROPERTYVALUE eValue);
-  FX_BOOL ToTextEmphasisMark(FDE_CSSPROPERTYVALUE eValue,
-                             FDE_CSSTEXTEMPHASISMARK& eMark);
-  FX_BOOL ToTextEmphasisFill(FDE_CSSPROPERTYVALUE eValue,
-                             FDE_CSSTEXTEMPHASISFILL& eFill);
-  FDE_CSSCURSOR ToCursor(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSPOSITION ToPosition(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSCAPTIONSIDE ToCaptionSide(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSBKGREPEAT ToBKGRepeat(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSBKGATTACHMENT ToBKGAttachment(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSRUBYALIGN ToRubyAlign(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSRUBYOVERHANG ToRubyOverhang(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSRUBYPOSITION ToRubyPosition(FDE_CSSPROPERTYVALUE eValue);
-  FDE_CSSRUBYSPAN ToRubySpan(FDE_CSSPROPERTYVALUE eValue);
-  IFX_FontMgr* m_pFontMgr;
-  FX_FLOAT m_fDefFontSize;
-  IFX_MEMAllocator* m_pRuleDataStore;
-  CFDE_CSSStyleSheetArray m_SheetGroups[FDE_CSSSTYLESHEETGROUP_MAX];
-  CFDE_CSSRuleCollection m_RuleCollection[FDE_CSSSTYLESHEETGROUP_MAX];
-  FDE_CSSSTYLESHEETGROUP m_ePriorities[FDE_CSSSTYLESHEETPRIORITY_MAX];
-  IFX_MEMAllocator* m_pInlineStyleStore;
-  IFX_MEMAllocator* m_pFixedStyleStore;
-  CFDE_CSSAccelerator* m_pAccelerator;
-  std::vector<FDE_CSSRuleData*> m_MatchedRules;
-};
-
-struct FDE_CSSCOUNTERDATA {
- public:
-  FDE_CSSCOUNTERDATA() { FXSYS_memset(this, 0, sizeof(FDE_CSSCOUNTERDATA)); }
-  FX_BOOL GetCounterIncrement(int32_t& iValue) {
-    iValue = m_iIncVal;
-    return m_bIncrement;
-  }
-  FX_BOOL GetCounterReset(int32_t& iValue) {
-    iValue = m_iResetVal;
-    return m_bReset;
-  }
-
-  const FX_WCHAR* m_pszIdent;
-  FX_BOOL m_bIncrement;
-  FX_BOOL m_bReset;
-  int32_t m_iIncVal;
-  int32_t m_iResetVal;
-};
-
-class CFDE_CSSCounterStyle {
- public:
-  CFDE_CSSCounterStyle() : m_pCounterInc(NULL), m_pCounterReset(NULL) {}
-  void SetCounterIncrementList(IFDE_CSSValueList* pList) {
-    m_pCounterInc = pList;
-    m_bIndexDirty = TRUE;
-  }
-  void SetCounterResetList(IFDE_CSSValueList* pList) {
-    m_pCounterReset = pList;
-    m_bIndexDirty = TRUE;
-  }
-  int32_t CountCounters() {
-    UpdateIndex();
-    return m_arrCounterData.GetSize();
-  }
-  FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) {
-    UpdateIndex();
-    return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue);
-  }
-  FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) {
-    UpdateIndex();
-    return m_arrCounterData.ElementAt(index).GetCounterReset(iValue);
-  }
-  const FX_WCHAR* GetCounterIdentifier(int32_t index) {
-    UpdateIndex();
-    return m_arrCounterData.ElementAt(index).m_pszIdent;
-  }
-
- protected:
-  void UpdateIndex();
-  void DoUpdateIndex(IFDE_CSSValueList* pList);
-  int32_t FindIndex(const FX_WCHAR* pszIdentifier);
-  IFDE_CSSValueList* m_pCounterInc;
-  IFDE_CSSValueList* m_pCounterReset;
-  CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData;
-  FX_BOOL m_bIndexDirty;
-};
-class CFDE_CSSInheritedData {
- public:
-  void Reset() {
-    FXSYS_memset(this, 0, sizeof(CFDE_CSSInheritedData));
-    m_LetterSpacing.Set(FDE_CSSLENGTHUNIT_Normal);
-    m_WordSpacing.Set(FDE_CSSLENGTHUNIT_Normal);
-    m_TextIndent.Set(FDE_CSSLENGTHUNIT_Point, 0);
-    m_fFontSize = 12.0f;
-    m_fLineHeight = 14.0f;
-    m_wFontWeight = 400;
-    m_dwFontColor = 0xFF000000;
-    m_iWidows = 2;
-    m_bTextEmphasisColorCurrent = TRUE;
-    m_iOrphans = 2;
-  }
-  const FX_WCHAR* m_pszListStyleImage;
-  FDE_CSSLENGTH m_LetterSpacing;
-  FDE_CSSLENGTH m_WordSpacing;
-  FDE_CSSLENGTH m_TextIndent;
-  IFDE_CSSValueList* m_pFontFamily;
-  IFDE_CSSValueList* m_pQuotes;
-  IFDE_CSSValueList* m_pCursorUris;
-  FDE_CSSCURSOR m_eCursor;
-  FX_FLOAT m_fFontSize;
-  FX_FLOAT m_fLineHeight;
-  FX_ARGB m_dwFontColor;
-  FX_ARGB m_dwTextEmphasisColor;
-  uint16_t m_wFontWeight;
-  int32_t m_iWidows;
-  int32_t m_iOrphans;
-  const FX_WCHAR* m_pszTextEmphasisCustomMark;
-  FX_DWORD m_eFontVariant : 1;
-  FX_DWORD m_eFontStyle : 1;
-  FX_DWORD m_bTextEmphasisColorCurrent : 1;
-  FX_DWORD m_eTextAligh : 2;
-  FX_DWORD m_eVisibility : 2;
-  FX_DWORD m_eWhiteSpace : 3;
-  FX_DWORD m_eTextTransform : 2;
-  FX_DWORD m_eWritingMode : 2;
-  FX_DWORD m_eWordBreak : 2;
-  FX_DWORD m_eLineBreak : 2;
-  FX_DWORD m_eTextEmphasisFill : 1;
-  FX_DWORD m_eTextEmphasisMark : 3;
-  FX_DWORD m_eCaptionSide : 3;
-
-  uint16_t m_eRubyAlign : 4;
-  uint16_t m_eRubyOverhang : 2;
-  uint16_t m_eRubyPosition : 2;
-};
-class CFDE_CSSNonInheritedData {
- public:
-  void Reset() {
-    FXSYS_memset(this, 0, sizeof(CFDE_CSSNonInheritedData));
-    m_MarginWidth = m_BorderWidth =
-        m_PaddingWidth.Set(FDE_CSSLENGTHUNIT_Point, 0);
-    m_MinBoxSize.Set(FDE_CSSLENGTHUNIT_Point, 0);
-    m_MaxBoxSize.Set(FDE_CSSLENGTHUNIT_None);
-    m_eDisplay = FDE_CSSDISPLAY_Inline;
-    m_fVerticalAlign = 0.0f;
-    m_ColumnCount.Set(FDE_CSSLENGTHUNIT_Auto);
-    m_ColumnGap.Set(FDE_CSSLENGTHUNIT_Normal);
-    m_bColumnRuleColorSame = TRUE;
-    m_ColumnWidth.Set(FDE_CSSLENGTHUNIT_Auto);
-    m_ColumnRuleWidth.Set(FDE_CSSLENGTHUNIT_Auto);
-    m_eTextCombine = FDE_CSSTEXTCOMBINE_None;
-  }
-
-  IFDE_CSSValueList* m_pContentList;
-  CFDE_CSSCounterStyle* m_pCounterStyle;
-  FDE_CSSRECT m_MarginWidth;
-  FDE_CSSRECT m_BorderWidth;
-  FDE_CSSRECT m_PaddingWidth;
-  FDE_CSSSIZE m_BoxSize;
-  FDE_CSSSIZE m_MinBoxSize;
-  FDE_CSSSIZE m_MaxBoxSize;
-  FDE_CSSPOINT m_BKGPosition;
-  const FX_WCHAR* m_pszBKGImage;
-  FX_ARGB m_dwBKGColor;
-  FX_ARGB m_dwBDRLeftColor;
-  FX_ARGB m_dwBDRTopColor;
-  FX_ARGB m_dwBDRRightColor;
-  FX_ARGB m_dwBDRBottomColor;
-  IFDE_CSSValue* m_pRubySpan;
-  FDE_CSSLENGTH m_ColumnCount;
-  FDE_CSSLENGTH m_ColumnGap;
-  FDE_CSSLENGTH m_ColumnRuleWidth;
-  FDE_CSSLENGTH m_ColumnWidth;
-  FX_ARGB m_dwColumnRuleColor;
-  FDE_CSSLENGTH m_Top;
-  FDE_CSSLENGTH m_Bottom;
-  FDE_CSSLENGTH m_Left;
-  FDE_CSSLENGTH m_Right;
-
-  FX_FLOAT m_fVerticalAlign;
-  FX_FLOAT m_fTextCombineNumber;
-  FX_DWORD m_eBDRLeftStyle : 4;
-  FX_DWORD m_eBDRTopStyle : 4;
-  FX_DWORD m_eBDRRightStyle : 4;
-  FX_DWORD m_eBDRBottomStyle : 4;
-  FX_DWORD m_eDisplay : 5;
-  FX_DWORD m_eVerticalAlign : 4;
-  FX_DWORD m_eListStyleType : 5;
-  FX_DWORD m_eColumnRuleStyle : 4;
-  FX_DWORD m_ePageBreakInside : 3;
-  FX_DWORD m_ePageBreakAfter : 3;
-  FX_DWORD m_ePageBreakBefore : 3;
-  FX_DWORD m_ePosition : 2;
-  FX_DWORD m_eBKGRepeat : 2;
-  FX_DWORD m_eFloat : 2;
-  FX_DWORD m_eClear : 2;
-  FX_DWORD m_eOverflowX : 3;
-  FX_DWORD m_eOverflowY : 3;
-  FX_DWORD m_eListStylePosition : 1;
-  FX_DWORD m_eBKGAttachment : 1;
-  FX_DWORD m_bHasMargin : 1;
-  FX_DWORD m_bHasBorder : 1;
-  FX_DWORD m_bHasPadding : 1;
-  FX_DWORD m_dwTextDecoration : 5;
-  FX_DWORD m_eTextCombine : 1;
-  FX_DWORD m_bColumnRuleColorSame : 1;
-  FX_DWORD m_bHasTextCombineNumber : 1;
-};
-class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle,
-                              public IFDE_CSSFontStyle,
-                              public IFDE_CSSBoundaryStyle,
-                              public IFDE_CSSPositionStyle,
-                              public IFDE_CSSParagraphStyle,
-                              public IFDE_CSSBackgroundStyle,
-                              public IFDE_CSSVisualStyle,
-                              public IFDE_CSSListStyle,
-                              public IFDE_CSSMultiColumnStyle,
-                              public IFDE_CSSGeneratedContentStyle,
-                              public IFDE_CSSTableStyle,
-                              public IFDE_CSSRubyStyle,
-                              public CFX_Target {
- public:
-  CFDE_CSSComputedStyle(IFX_MEMAllocator* pAlloc)
-      : m_dwRefCount(1), m_pAllocator(pAlloc) {}
-  ~CFDE_CSSComputedStyle() {}
-  virtual FX_DWORD AddRef() { return ++m_dwRefCount; }
-  virtual FX_DWORD Release() {
-    FX_DWORD dwRefCount = --m_dwRefCount;
-    if (dwRefCount == 0) {
-      if (m_NonInheritedData.m_pCounterStyle != NULL) {
-        delete m_NonInheritedData.m_pCounterStyle;
-      }
-      FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this);
-    }
-    return dwRefCount;
-  }
-
-  virtual void Reset() {
-    m_InheritedData.Reset();
-    m_NonInheritedData.Reset();
-  }
-  virtual IFDE_CSSFontStyle* GetFontStyles() const {
-    return (IFDE_CSSFontStyle * const) this;
-  }
-  virtual IFDE_CSSBoundaryStyle* GetBoundaryStyles() const {
-    return (IFDE_CSSBoundaryStyle * const) this;
-  }
-  virtual IFDE_CSSPositionStyle* GetPositionStyles() const {
-    return (IFDE_CSSPositionStyle * const) this;
-  }
-  virtual IFDE_CSSParagraphStyle* GetParagraphStyles() const {
-    return (IFDE_CSSParagraphStyle * const) this;
-  }
-  virtual IFDE_CSSBackgroundStyle* GetBackgroundStyles() const {
-    return (IFDE_CSSBackgroundStyle * const) this;
-  }
-  virtual IFDE_CSSVisualStyle* GetVisualStyles() const {
-    return (IFDE_CSSVisualStyle * const) this;
-  }
-  virtual IFDE_CSSListStyle* GetListStyles() const {
-    return (IFDE_CSSListStyle * const) this;
-  }
-  virtual IFDE_CSSTableStyle* GetTableStyle() const {
-    return (IFDE_CSSTableStyle * const) this;
-  }
-  virtual IFDE_CSSMultiColumnStyle* GetMultiColumnStyle() const {
-    return (IFDE_CSSMultiColumnStyle * const) this;
-  }
-  virtual IFDE_CSSGeneratedContentStyle* GetGeneratedContentStyle() const {
-    return (IFDE_CSSGeneratedContentStyle * const) this;
-  }
-  virtual IFDE_CSSRubyStyle* GetRubyStyle() const {
-    return (IFDE_CSSRubyStyle * const) this;
-  }
-  virtual FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName,
-                                 CFX_WideString& wsValue) const {
-    for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) {
-      if (wsName == m_CustomProperties[i]) {
-        wsValue = m_CustomProperties[i + 1];
-        return TRUE;
-      }
-    }
-    return FALSE;
-  }
-  virtual FDE_CSSRUBYALIGN GetRubyAlign() const {
-    return (FDE_CSSRUBYALIGN)m_InheritedData.m_eRubyAlign;
-  }
-  virtual FDE_CSSRUBYPOSITION GetRubyPosition() const {
-    return (FDE_CSSRUBYPOSITION)m_InheritedData.m_eRubyPosition;
-  }
-  virtual FDE_CSSRUBYOVERHANG GetRubyOverhang() const {
-    return (FDE_CSSRUBYOVERHANG)m_InheritedData.m_eRubyOverhang;
-  }
-  virtual FDE_CSSRUBYSPAN GetRubySpanType() const {
-    return m_NonInheritedData.m_pRubySpan == NULL ? FDE_CSSRUBYSPAN_None
-                                                  : FDE_CSSRUBYSPAN_Attr;
-  }
-  virtual IFDE_CSSValue* GetRubySpanAttr() const {
-    return m_NonInheritedData.m_pRubySpan;
-  }
-  virtual FDE_CSSCAPTIONSIDE GetCaptionSide() const {
-    return (FDE_CSSCAPTIONSIDE)m_InheritedData.m_eCaptionSide;
-  }
-  virtual int32_t CountCounters() {
-    return (m_NonInheritedData.m_pCounterStyle == NULL)
-               ? 0
-               : m_NonInheritedData.m_pCounterStyle->CountCounters();
-  }
-  virtual const FX_WCHAR* GetCounterIdentifier(int32_t index) {
-    return m_NonInheritedData.m_pCounterStyle->GetCounterIdentifier(index);
-  }
-  virtual FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) {
-    return m_NonInheritedData.m_pCounterStyle->GetCounterReset(index, iValue);
-  }
-  virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) {
-    return m_NonInheritedData.m_pCounterStyle->GetCounterIncrement(index,
-                                                                   iValue);
-  }
-  virtual IFDE_CSSValueList* GetContent() const {
-    return m_NonInheritedData.m_pContentList;
-  }
-  virtual int32_t CountQuotes() const {
-    return m_InheritedData.m_pQuotes == NULL
-               ? 0
-               : m_InheritedData.m_pQuotes->CountValues();
-  }
-  virtual const FX_WCHAR* GetQuotes(int32_t index) const {
-    FXSYS_assert(m_InheritedData.m_pQuotes != NULL &&
-                 m_InheritedData.m_pQuotes->CountValues() > index);
-    return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pQuotes->GetValue(
-                index)))
-        ->GetString(index);
-  }
-  virtual const FDE_CSSLENGTH& GetColumnCount() const {
-    return m_NonInheritedData.m_ColumnCount;
-  }
-  virtual const FDE_CSSLENGTH& GetColumnGap() const {
-    return m_NonInheritedData.m_ColumnGap;
-  }
-  virtual FX_ARGB GetColumnRuleColor() const {
-    return m_NonInheritedData.m_bColumnRuleColorSame
-               ? m_InheritedData.m_dwFontColor
-               : m_NonInheritedData.m_dwColumnRuleColor;
-  }
-  virtual FDE_CSSBORDERSTYLE GetColumnRuleStyle() const {
-    return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eColumnRuleStyle;
-  }
-  virtual const FDE_CSSLENGTH& GetColumnRuleWidth() const {
-    return m_NonInheritedData.m_ColumnRuleWidth;
-  }
-  virtual const FDE_CSSLENGTH& GetColumnWidth() const {
-    return m_NonInheritedData.m_ColumnWidth;
-  }
-  virtual void SetColumnCount(const FDE_CSSLENGTH& columnCount) {
-    m_NonInheritedData.m_ColumnCount = columnCount;
-  }
-  virtual void SetColumnGap(const FDE_CSSLENGTH& columnGap) {
-    m_NonInheritedData.m_ColumnGap = columnGap;
-  }
-  virtual void SetColumnRuleColor(FX_ARGB dwColumnRuleColor) {
-    m_NonInheritedData.m_dwColumnRuleColor = dwColumnRuleColor,
-    m_NonInheritedData.m_bColumnRuleColorSame = FALSE;
-  }
-  virtual void SetColumnRuleStyle(FDE_CSSBORDERSTYLE eColumnRuleStyle) {
-    m_NonInheritedData.m_eColumnRuleStyle = eColumnRuleStyle;
-  }
-  virtual void SetColumnRuleWidth(const FDE_CSSLENGTH& columnRuleWidth) {
-    m_NonInheritedData.m_ColumnRuleWidth = columnRuleWidth;
-  }
-  virtual void SetColumnWidth(const FDE_CSSLENGTH& columnWidth) {
-    m_NonInheritedData.m_ColumnWidth = columnWidth;
-  }
-  virtual int32_t CountFontFamilies() const {
-    return m_InheritedData.m_pFontFamily
-               ? m_InheritedData.m_pFontFamily->CountValues()
-               : 0;
-  }
-  virtual const FX_WCHAR* GetFontFamily(int32_t index) const {
-    return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pFontFamily->GetValue(
-                index)))
-        ->GetString(index);
-  }
-  virtual uint16_t GetFontWeight() const {
-    return m_InheritedData.m_wFontWeight;
-  }
-  virtual FDE_CSSFONTVARIANT GetFontVariant() const {
-    return (FDE_CSSFONTVARIANT)m_InheritedData.m_eFontVariant;
-  }
-  virtual FDE_CSSFONTSTYLE GetFontStyle() const {
-    return (FDE_CSSFONTSTYLE)m_InheritedData.m_eFontStyle;
-  }
-  virtual FX_FLOAT GetFontSize() const { return m_InheritedData.m_fFontSize; }
-  virtual FX_ARGB GetColor() const { return m_InheritedData.m_dwFontColor; }
-  virtual void SetFontWeight(uint16_t wFontWeight) {
-    m_InheritedData.m_wFontWeight = wFontWeight;
-  }
-  virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) {
-    m_InheritedData.m_eFontVariant = eFontVariant;
-  }
-  virtual void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) {
-    m_InheritedData.m_eFontStyle = eFontStyle;
-  }
-  virtual void SetFontSize(FX_FLOAT fFontSize) {
-    m_InheritedData.m_fFontSize = fFontSize;
-  }
-  virtual void SetColor(FX_ARGB dwFontColor) {
-    m_InheritedData.m_dwFontColor = dwFontColor;
-  }
-  virtual FX_ARGB GetBorderLeftColor() const {
-    return m_NonInheritedData.m_dwBDRLeftColor;
-  }
-  virtual FX_ARGB GetBorderTopColor() const {
-    return m_NonInheritedData.m_dwBDRTopColor;
-  }
-  virtual FX_ARGB GetBorderRightColor() const {
-    return m_NonInheritedData.m_dwBDRRightColor;
-  }
-  virtual FX_ARGB GetBorderBottomColor() const {
-    return m_NonInheritedData.m_dwBDRBottomColor;
-  }
-
-  virtual FDE_CSSBORDERSTYLE GetBorderLeftStyle() const {
-    return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRLeftStyle;
-  }
-  virtual FDE_CSSBORDERSTYLE GetBorderTopStyle() const {
-    return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRTopStyle;
-  }
-  virtual FDE_CSSBORDERSTYLE GetBorderRightStyle() const {
-    return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRRightStyle;
-  }
-  virtual FDE_CSSBORDERSTYLE GetBorderBottomStyle() const {
-    return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRBottomStyle;
-  }
-
-  virtual const FDE_CSSRECT* GetBorderWidth() const {
-    return m_NonInheritedData.m_bHasBorder ? &(m_NonInheritedData.m_BorderWidth)
-                                           : NULL;
-  }
-  virtual const FDE_CSSRECT* GetMarginWidth() const {
-    return m_NonInheritedData.m_bHasMargin ? &(m_NonInheritedData.m_MarginWidth)
-                                           : NULL;
-  }
-  virtual const FDE_CSSRECT* GetPaddingWidth() const {
-    return m_NonInheritedData.m_bHasPadding
-               ? &(m_NonInheritedData.m_PaddingWidth)
-               : NULL;
-  }
-  virtual void SetBorderLeftColor(FX_ARGB dwBorderColor) {
-    m_NonInheritedData.m_dwBDRLeftColor = dwBorderColor;
-  }
-  virtual void SetBorderTopColor(FX_ARGB dwBorderColor) {
-    m_NonInheritedData.m_dwBDRTopColor = dwBorderColor;
-  }
-  virtual void SetBorderRightColor(FX_ARGB dwBorderColor) {
-    m_NonInheritedData.m_dwBDRRightColor = dwBorderColor;
-  }
-  virtual void SetBorderBottomColor(FX_ARGB dwBorderColor) {
-    m_NonInheritedData.m_dwBDRBottomColor = dwBorderColor;
-  }
-
-  virtual void SetBorderLeftStyle(FDE_CSSBORDERSTYLE eBorderStyle) {
-    m_NonInheritedData.m_eBDRLeftStyle = eBorderStyle;
-  }
-  virtual void SetBorderTopStyle(FDE_CSSBORDERSTYLE eBorderStyle) {
-    m_NonInheritedData.m_eBDRTopStyle = eBorderStyle;
-  }
-  virtual void SetBorderRightStyle(FDE_CSSBORDERSTYLE eBorderStyle) {
-    m_NonInheritedData.m_eBDRRightStyle = eBorderStyle;
-  }
-  virtual void SetBorderBottomStyle(FDE_CSSBORDERSTYLE eBorderStyle) {
-    m_NonInheritedData.m_eBDRBottomStyle = eBorderStyle;
-  }
-
-  virtual void SetBorderWidth(const FDE_CSSRECT& rect) {
-    m_NonInheritedData.m_BorderWidth = rect;
-    m_NonInheritedData.m_bHasBorder = TRUE;
-  }
-  virtual void SetMarginWidth(const FDE_CSSRECT& rect) {
-    m_NonInheritedData.m_MarginWidth = rect;
-    m_NonInheritedData.m_bHasMargin = TRUE;
-  }
-  virtual void SetPaddingWidth(const FDE_CSSRECT& rect) {
-    m_NonInheritedData.m_PaddingWidth = rect;
-    m_NonInheritedData.m_bHasPadding = TRUE;
-  }
-  virtual FDE_CSSDISPLAY GetDisplay() const {
-    return (FDE_CSSDISPLAY)m_NonInheritedData.m_eDisplay;
-  }
-  virtual const FDE_CSSSIZE& GetBoxSize() const {
-    return m_NonInheritedData.m_BoxSize;
-  }
-  virtual const FDE_CSSSIZE& GetMinBoxSize() const {
-    return m_NonInheritedData.m_MinBoxSize;
-  }
-  virtual const FDE_CSSSIZE& GetMaxBoxSize() const {
-    return m_NonInheritedData.m_MaxBoxSize;
-  }
-  virtual FDE_CSSFLOAT GetFloat() const {
-    return (FDE_CSSFLOAT)m_NonInheritedData.m_eFloat;
-  }
-  virtual FDE_CSSCLEAR GetClear() const {
-    return (FDE_CSSCLEAR)m_NonInheritedData.m_eClear;
-  }
-  virtual FDE_CSSPOSITION GetPosition() const {
-    return (FDE_CSSPOSITION)m_NonInheritedData.m_ePosition;
-  }
-  virtual FDE_CSSLENGTH GetTop() const { return m_NonInheritedData.m_Top; }
-  virtual FDE_CSSLENGTH GetBottom() const {
-    return m_NonInheritedData.m_Bottom;
-  }
-  virtual FDE_CSSLENGTH GetLeft() const { return m_NonInheritedData.m_Left; }
-  virtual FDE_CSSLENGTH GetRight() const { return m_NonInheritedData.m_Right; }
-
-  virtual void SetDisplay(FDE_CSSDISPLAY eDisplay) {
-    m_NonInheritedData.m_eDisplay = eDisplay;
-  }
-  virtual void SetBoxSize(const FDE_CSSSIZE& size) {
-    m_NonInheritedData.m_BoxSize = size;
-  }
-  virtual void SetMinBoxSize(const FDE_CSSSIZE& size) {
-    m_NonInheritedData.m_MinBoxSize = size;
-  }
-  virtual void SetMaxBoxSize(const FDE_CSSSIZE& size) {
-    m_NonInheritedData.m_MaxBoxSize = size;
-  }
-  virtual void SetFloat(FDE_CSSFLOAT eFloat) {
-    m_NonInheritedData.m_eFloat = eFloat;
-  }
-  virtual void SetClear(FDE_CSSCLEAR eClear) {
-    m_NonInheritedData.m_eClear = eClear;
-  }
-  virtual FX_FLOAT GetLineHeight() const {
-    return m_InheritedData.m_fLineHeight;
-  }
-  virtual FDE_CSSWHITESPACE GetWhiteSpace() const {
-    return (FDE_CSSWHITESPACE)m_InheritedData.m_eWhiteSpace;
-  }
-  virtual const FDE_CSSLENGTH& GetTextIndent() const {
-    return m_InheritedData.m_TextIndent;
-  }
-  virtual FDE_CSSTEXTALIGN GetTextAlign() const {
-    return (FDE_CSSTEXTALIGN)m_InheritedData.m_eTextAligh;
-  }
-  virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const {
-    return (FDE_CSSVERTICALALIGN)m_NonInheritedData.m_eVerticalAlign;
-  }
-  virtual FX_FLOAT GetNumberVerticalAlign() const {
-    return m_NonInheritedData.m_fVerticalAlign;
-  }
-  virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const {
-    return (FDE_CSSTEXTTRANSFORM)m_InheritedData.m_eTextTransform;
-  }
-  virtual FX_DWORD GetTextDecoration() const {
-    return m_NonInheritedData.m_dwTextDecoration;
-  }
-  virtual const FDE_CSSLENGTH& GetLetterSpacing() const {
-    return m_InheritedData.m_LetterSpacing;
-  }
-  virtual const FDE_CSSLENGTH& GetWordSpacing() const {
-    return m_InheritedData.m_WordSpacing;
-  }
-  virtual FDE_CSSWRITINGMODE GetWritingMode() const {
-    return (FDE_CSSWRITINGMODE)m_InheritedData.m_eWritingMode;
-  }
-  virtual FDE_CSSWORDBREAK GetWordBreak() const {
-    return (FDE_CSSWORDBREAK)m_InheritedData.m_eWordBreak;
-  }
-  virtual int32_t GetWidows() const { return m_InheritedData.m_iWidows; }
-  virtual FX_ARGB GetTextEmphasisColor() const {
-    return m_InheritedData.m_bTextEmphasisColorCurrent
-               ? m_InheritedData.m_dwFontColor
-               : m_InheritedData.m_dwTextEmphasisColor;
-  }
-  virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const {
-    return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakBefore;
-  }
-  virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const {
-    return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakAfter;
-  }
-  virtual FDE_CSSPAGEBREAK GetPageBreakInside() const {
-    return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakInside;
-  }
-  virtual int32_t GetOrphans() const { return m_InheritedData.m_iOrphans; }
-  virtual FDE_CSSLINEBREAK GetLineBreak() const {
-    return (FDE_CSSLINEBREAK)m_InheritedData.m_eLineBreak;
-  }
-  virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const;
-  virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const {
-    return (FDE_CSSTEXTEMPHASISFILL)m_InheritedData.m_eTextEmphasisFill;
-  }
-  virtual const FX_WCHAR* GetTextEmphasisCustom() const {
-    FXSYS_assert(m_InheritedData.m_eTextEmphasisMark ==
-                 FDE_CSSTEXTEMPHASISMARK_Custom);
-    return m_InheritedData.m_pszTextEmphasisCustomMark;
-  }
-  virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const {
-    return (FDE_CSSTEXTCOMBINE)m_NonInheritedData.m_eTextCombine;
-  }
-  virtual FX_BOOL HasTextCombineNumber() const {
-    return m_NonInheritedData.m_bHasTextCombineNumber;
-  }
-  virtual FX_FLOAT GetTextCombineNumber() const {
-    FXSYS_assert(m_NonInheritedData.m_eTextCombine ==
-                 FDE_CSSTEXTCOMBINE_Horizontal);
-    return m_NonInheritedData.m_fTextCombineNumber;
-  }
-  virtual void SetLineHeight(FX_FLOAT fLineHeight) {
-    m_InheritedData.m_fLineHeight = fLineHeight;
-  }
-  virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) {
-    m_InheritedData.m_eWhiteSpace = eWhiteSpace;
-  }
-  virtual void SetTextIndent(const FDE_CSSLENGTH& textIndent) {
-    m_InheritedData.m_TextIndent = textIndent;
-  }
-  virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) {
-    m_InheritedData.m_eTextAligh = eTextAlign;
-  }
-  virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) {
-    m_NonInheritedData.m_eVerticalAlign = eVerticalAlign;
-  }
-  virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) {
-    m_NonInheritedData.m_eVerticalAlign = FDE_CSSVERTICALALIGN_Number,
-    m_NonInheritedData.m_fVerticalAlign = fAlign;
-  }
-  virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) {
-    m_InheritedData.m_eTextTransform = eTextTransform;
-  }
-  virtual void SetTextDecoration(FX_DWORD dwTextDecoration) {
-    m_NonInheritedData.m_dwTextDecoration = dwTextDecoration;
-  }
-  virtual void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) {
-    m_InheritedData.m_LetterSpacing = letterSpacing;
-  }
-  virtual void SetWordSpacing(const FDE_CSSLENGTH& wordSpacing) {
-    m_InheritedData.m_WordSpacing = wordSpacing;
-  }
-  virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) {
-    m_InheritedData.m_eWritingMode = eWritingMode;
-  }
-  virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) {
-    m_InheritedData.m_eWordBreak = eWordBreak;
-  }
-  virtual void SetWidows(int32_t iWidows) {
-    m_InheritedData.m_iWidows = iWidows;
-  }
-  virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) {
-    m_InheritedData.m_dwTextEmphasisColor = dwTextEmphasisColor,
-    m_InheritedData.m_bTextEmphasisColorCurrent = FALSE;
-  }
-  virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) {
-    m_NonInheritedData.m_ePageBreakBefore = ePageBreakBefore;
-  }
-  virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) {
-    m_NonInheritedData.m_ePageBreakAfter = ePageBreakAfter;
-  }
-  virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) {
-    m_NonInheritedData.m_ePageBreakInside = ePageBreakInside;
-  }
-  virtual void SetOrphans(int32_t iOrphans) {
-    m_InheritedData.m_iOrphans = iOrphans;
-  }
-  virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) {
-    m_InheritedData.m_eLineBreak = eLineBreak;
-  }
-  virtual FX_ARGB GetBKGColor() const {
-    return m_NonInheritedData.m_dwBKGColor;
-  }
-  virtual const FX_WCHAR* GetBKGImage() const {
-    return m_NonInheritedData.m_pszBKGImage;
-  }
-  virtual const FDE_CSSPOINT& GetBKGPosition() const {
-    return m_NonInheritedData.m_BKGPosition;
-  }
-  virtual FDE_CSSBKGREPEAT GetBKGRepeat() const {
-    return (FDE_CSSBKGREPEAT)m_NonInheritedData.m_eBKGRepeat;
-  }
-  virtual FDE_CSSBKGATTACHMENT GetBKGAttachment() const {
-    return (FDE_CSSBKGATTACHMENT)m_NonInheritedData.m_eBKGAttachment;
-  }
-  virtual void SetBKGColor(FX_ARGB dwBKGColor) {
-    m_NonInheritedData.m_dwBKGColor = dwBKGColor;
-  }
-  virtual void SetBKGPosition(const FDE_CSSPOINT& bkgPosition) {
-    m_NonInheritedData.m_BKGPosition = bkgPosition;
-  }
-  virtual FDE_CSSVISIBILITY GetVisibility() const {
-    return (FDE_CSSVISIBILITY)m_InheritedData.m_eVisibility;
-  }
-  virtual FDE_CSSOVERFLOW GetOverflowX() const {
-    return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowX;
-  }
-  virtual FDE_CSSOVERFLOW GetOverflowY() const {
-    return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowY;
-  }
-  virtual int32_t CountCursorUrls() const {
-    return m_InheritedData.m_pCursorUris == NULL
-               ? 0
-               : m_InheritedData.m_pCursorUris->CountValues();
-  }
-  virtual const FX_WCHAR* GetCursorUrl(int32_t index) const {
-    FXSYS_assert(m_InheritedData.m_pCursorUris != NULL);
-    return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pCursorUris->GetValue(
-                index)))
-        ->GetString(index);
-  }
-  virtual FDE_CSSCURSOR GetCursorType() const {
-    return m_InheritedData.m_eCursor;
-  }
-  virtual void SetVisibility(FDE_CSSVISIBILITY eVisibility) {
-    m_InheritedData.m_eVisibility = eVisibility;
-  }
-  virtual FDE_CSSLISTSTYLETYPE GetListStyleType() const {
-    return (FDE_CSSLISTSTYLETYPE)m_NonInheritedData.m_eListStyleType;
-  }
-  virtual FDE_CSSLISTSTYLEPOSITION GetListStylePosition() const {
-    return (FDE_CSSLISTSTYLEPOSITION)m_NonInheritedData.m_eListStylePosition;
-  }
-  virtual const FX_WCHAR* GetListStyleImage() const {
-    return m_InheritedData.m_pszListStyleImage;
-  }
-  virtual void SetListStyleType(FDE_CSSLISTSTYLETYPE eListStyleType) {
-    m_NonInheritedData.m_eListStyleType = eListStyleType;
-  }
-  virtual void SetListStylePosition(
-      FDE_CSSLISTSTYLEPOSITION eListStylePosition) {
-    m_NonInheritedData.m_eListStylePosition = eListStylePosition;
-  }
-  void AddCustomStyle(const CFX_WideString& wsName,
-                      const CFX_WideString& wsValue) {
-    m_CustomProperties.Add(wsName);
-    m_CustomProperties.Add(wsValue);
-  }
-  FX_DWORD m_dwRefCount;
-  IFX_MEMAllocator* m_pAllocator;
-  CFDE_CSSInheritedData m_InheritedData;
-  CFDE_CSSNonInheritedData m_NonInheritedData;
-  CFX_WideStringArray m_CustomProperties;
-};
-
-#endif  // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
diff --git a/xfa/fwl/basewidget/fwl_barcodeimp.cpp b/xfa/fwl/basewidget/fwl_barcodeimp.cpp
index 97ac8e4..1ee7313 100644
--- a/xfa/fwl/basewidget/fwl_barcodeimp.cpp
+++ b/xfa/fwl/basewidget/fwl_barcodeimp.cpp
@@ -7,10 +7,11 @@
 #include "xfa/fwl/basewidget/fwl_barcodeimp.h"
 
 #include "xfa/fwl/basewidget/fwl_editimp.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 // static
 IFWL_Barcode* IFWL_Barcode::Create(const CFWL_WidgetImpProperties& properties) {
diff --git a/xfa/fwl/basewidget/fwl_barcodeimp.h b/xfa/fwl/basewidget/fwl_barcodeimp.h
index bf7ad91..2f12782 100644
--- a/xfa/fwl/basewidget/fwl_barcodeimp.h
+++ b/xfa/fwl/basewidget/fwl_barcodeimp.h
@@ -8,9 +8,9 @@
 #define XFA_FWL_BASEWIDGET_FWL_BARCODEIMP_H_
 
 #include "xfa/fwl/basewidget/fwl_editimp.h"
-#include "xfa/include/fwl/basewidget/fwl_barcode.h"
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
-#include "xfa/include/fwl/basewidget/fxmath_barcode.h"
+#include "xfa/fwl/basewidget/ifwl_barcode.h"
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
+#include "xfa/fwl/basewidget/ifx_barcode.h"
 
 class CFWL_WidgetImpProperties;
 class CFWL_BarcodeImpDelegate;
diff --git a/xfa/fwl/basewidget/fwl_caretimp.cpp b/xfa/fwl/basewidget/fwl_caretimp.cpp
index ea7402e..cc0f548 100644
--- a/xfa/fwl/basewidget/fwl_caretimp.cpp
+++ b/xfa/fwl/basewidget/fwl_caretimp.cpp
@@ -6,11 +6,12 @@
 
 #include "xfa/fwl/basewidget/fwl_caretimp.h"
 
+#include "xfa/fwl/basewidget/ifwl_caret.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_caret.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 // static
 IFWL_Caret* IFWL_Caret::Create(const CFWL_WidgetImpProperties& properties,
diff --git a/xfa/fwl/basewidget/fwl_caretimp.h b/xfa/fwl/basewidget/fwl_caretimp.h
index dee4dd8..c4b6015 100644
--- a/xfa/fwl/basewidget/fwl_caretimp.h
+++ b/xfa/fwl/basewidget/fwl_caretimp.h
@@ -8,8 +8,8 @@
 #define XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/ifwl_timer.h"
 #include "xfa/fxgraphics/cfx_color.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
 
 class CFWL_WidgetImpProperties;
 class IFWL_Widget;
diff --git a/xfa/fwl/basewidget/fwl_checkboximp.cpp b/xfa/fwl/basewidget/fwl_checkboximp.cpp
index 5912d0e..8ab7556 100644
--- a/xfa/fwl/basewidget/fwl_checkboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_checkboximp.cpp
@@ -9,12 +9,15 @@
 #include <algorithm>
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_checkbox.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/basewidget/fwl_checkbox.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 #define FWL_CKB_CaptionMargin 5
 
diff --git a/xfa/fwl/basewidget/fwl_checkboximp.h b/xfa/fwl/basewidget/fwl_checkboximp.h
index 1f6f5f3..b5d0d15 100644
--- a/xfa/fwl/basewidget/fwl_checkboximp.h
+++ b/xfa/fwl/basewidget/fwl_checkboximp.h
@@ -9,9 +9,10 @@
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
 
+class CFWL_CheckBoxImpDelegate;
+class CFWL_MsgMouse;
 class CFWL_WidgetImpProperties;
 class IFWL_Widget;
-class CFWL_CheckBoxImpDelegate;
 
 class CFWL_CheckBoxImp : public CFWL_WidgetImp {
  public:
diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp
index 7aae6d5..5404777 100644
--- a/xfa/fwl/basewidget/fwl_comboboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp
@@ -11,6 +11,10 @@
 #include "xfa/fwl/basewidget/fwl_formproxyimp.h"
 #include "xfa/fwl/basewidget/fwl_listboximp.h"
 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_formimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
@@ -19,7 +23,8 @@
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_notethread.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 // static
 IFWL_ComboBox* IFWL_ComboBox::Create(
diff --git a/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp b/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp
index cd82dde..70f76c6 100644
--- a/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp
+++ b/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp
@@ -9,13 +9,16 @@
 #include "xfa/fwl/basewidget/fwl_editimp.h"
 #include "xfa/fwl/basewidget/fwl_formproxyimp.h"
 #include "xfa/fwl/basewidget/fwl_monthcalendarimp.h"
+#include "xfa/fwl/basewidget/ifwl_spinbutton.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
 #include "xfa/fwl/core/fwl_formimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_panelimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/basewidget/fwl_spinbutton.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 #define FWL_DTP_WIDTH 100
 #define FWL_DTP_HEIGHT 20
diff --git a/xfa/fwl/basewidget/fwl_datetimepickerimp.h b/xfa/fwl/basewidget/fwl_datetimepickerimp.h
index 4c0ebc5..9a4b920 100644
--- a/xfa/fwl/basewidget/fwl_datetimepickerimp.h
+++ b/xfa/fwl/basewidget/fwl_datetimepickerimp.h
@@ -11,11 +11,10 @@
 
 #include "xfa/fwl/basewidget/fwl_editimp.h"
 #include "xfa/fwl/basewidget/fwl_monthcalendarimp.h"
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
-#include "xfa/include/fwl/basewidget/fwl_monthcalendar.h"
-#include "xfa/include/fwl/core/fwl_form.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/basewidget/ifwl_monthcalendar.h"
+#include "xfa/fwl/core/ifwl_form.h"
 
 class CFWL_WidgetImp;
 class CFWL_WidgetImpProperties;
diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp
index a0d7074..73c7fa3 100644
--- a/xfa/fwl/basewidget/fwl_editimp.cpp
+++ b/xfa/fwl/basewidget/fwl_editimp.cpp
@@ -15,16 +15,19 @@
 #include "xfa/fwl/basewidget/fwl_caretimp.h"
 #include "xfa/fwl/basewidget/fwl_comboboximp.h"
 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h"
+#include "xfa/fwl/basewidget/ifwl_caret.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_caret.h"
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
 
 // static
 IFWL_Edit* IFWL_Edit::Create(const CFWL_WidgetImpProperties& properties,
diff --git a/xfa/fwl/basewidget/fwl_editimp.h b/xfa/fwl/basewidget/fwl_editimp.h
index 6693b8d..3dcf48e 100644
--- a/xfa/fwl/basewidget/fwl_editimp.h
+++ b/xfa/fwl/basewidget/fwl_editimp.h
@@ -11,9 +11,13 @@
 #include <vector>
 
 #include "xfa/fee/ifde_txtedtengine.h"
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
+#include "xfa/fxgraphics/cfx_path.h"
 
+class CFWL_MsgActivate;
+class CFWL_MsgDeactivate;
+class CFWL_MsgMouse;
 class CFWL_WidgetImpProperties;
 class CFWL_WidgetImpDelegate;
 class IFWL_Caret;
diff --git a/xfa/fwl/basewidget/fwl_listboximp.cpp b/xfa/fwl/basewidget/fwl_listboximp.cpp
index a748116..ad58001 100644
--- a/xfa/fwl/basewidget/fwl_listboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_listboximp.cpp
@@ -9,10 +9,14 @@
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fwl/basewidget/fwl_comboboximp.h"
 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 #define FWL_LISTBOX_ItemTextMargin 2
 
diff --git a/xfa/fwl/basewidget/fwl_listboximp.h b/xfa/fwl/basewidget/fwl_listboximp.h
index a78faf3..a4f9188 100644
--- a/xfa/fwl/basewidget/fwl_listboximp.h
+++ b/xfa/fwl/basewidget/fwl_listboximp.h
@@ -9,13 +9,16 @@
 
 #include <memory>
 
+#include "xfa/fwl/basewidget/ifwl_combobox.h"
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/basewidget/ifwl_listbox.h"
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_combobox.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
-#include "xfa/include/fwl/basewidget/fwl_listbox.h"
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
 
 class CFWL_ListBoxImpDelegate;
+class CFWL_MsgKillFocus;
+class CFWL_MsgMouse;
+class CFWL_MsgMouseWheel;
 
 class CFWL_ListBoxImp : public CFWL_WidgetImp {
  public:
diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
index e6dad35..7106601 100644
--- a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
+++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp
@@ -9,11 +9,14 @@
 #include <algorithm>
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_monthcalendar.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_monthcalendar.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 #define MONTHCAL_HSEP_HEIGHT 1
 #define MONTHCAL_VSEP_WIDTH 1
diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.h b/xfa/fwl/basewidget/fwl_monthcalendarimp.h
index c9542cb..f1c12b5 100644
--- a/xfa/fwl/basewidget/fwl_monthcalendarimp.h
+++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.h
@@ -10,9 +10,10 @@
 #include "xfa/fgas/localization/fgas_datetime.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 
+class CFWL_MonthCalendarImpDelegate;
+class CFWL_MsgMouse;
 class CFWL_WidgetImpProperties;
 class IFWL_Widget;
-class CFWL_MonthCalendarImpDelegate;
 
 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
 
diff --git a/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp b/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
index ac0055b..cb6f99d 100644
--- a/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
+++ b/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
@@ -7,10 +7,14 @@
 #include "xfa/fwl/basewidget/fwl_pushbuttonimp.h"
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_pushbutton.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_pushbutton.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 // static
 IFWL_PushButton* IFWL_PushButton::Create(
diff --git a/xfa/fwl/basewidget/fwl_pushbuttonimp.h b/xfa/fwl/basewidget/fwl_pushbuttonimp.h
index 32d8f6c..8c0d5f3 100644
--- a/xfa/fwl/basewidget/fwl_pushbuttonimp.h
+++ b/xfa/fwl/basewidget/fwl_pushbuttonimp.h
@@ -9,9 +9,10 @@
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
 
+class CFWL_MsgMouse;
 class CFWL_WidgetImpProperties;
-class IFWL_Widget;
 class CFWL_PushButtonImpDelegate;
+class IFWL_Widget;
 
 class CFWL_PushButtonImp : public CFWL_WidgetImp {
  public:
@@ -44,6 +45,7 @@
   int32_t m_iTTOAlign;
   friend class CFWL_PushButtonImpDelegate;
 };
+
 class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate {
  public:
   CFWL_PushButtonImpDelegate(CFWL_PushButtonImp* pOwner);
diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp
index 6bab12b..ad41d82 100644
--- a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp
+++ b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp
@@ -6,11 +6,14 @@
 
 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h"
 
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 #define FWL_SCROLLBAR_Elapse 500
 #define FWL_SCROLLBAR_MinThumb 5
diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.h b/xfa/fwl/basewidget/fwl_scrollbarimp.h
index 2e378a6..a06e47a 100644
--- a/xfa/fwl/basewidget/fwl_scrollbarimp.h
+++ b/xfa/fwl/basewidget/fwl_scrollbarimp.h
@@ -8,7 +8,7 @@
 #define XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
+#include "xfa/fwl/core/ifwl_timer.h"
 
 class CFWL_WidgetImpProperties;
 class IFWL_Widget;
diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
index 9493cbb..bc11d8f 100644
--- a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
+++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
@@ -6,12 +6,16 @@
 
 #include "xfa/fwl/basewidget/fwl_spinbuttonimp.h"
 
+#include "xfa/fwl/basewidget/ifwl_spinbutton.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_spinbutton.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_timer.h"
 
 #define FWL_SPN_MinWidth 18
 #define FWL_SPN_MinHeight 32
diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.h b/xfa/fwl/basewidget/fwl_spinbuttonimp.h
index d8eb596..7f04ae5 100644
--- a/xfa/fwl/basewidget/fwl_spinbuttonimp.h
+++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.h
@@ -8,10 +8,12 @@
 #define XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
+#include "xfa/fwl/core/ifwl_timer.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
-class CFWL_WidgetImpProperties;
+class CFWL_MsgMouse;
 class CFWL_SpinButtonImpDelegate;
+class CFWL_WidgetImpProperties;
 
 class CFWL_SpinButtonImp : public CFWL_WidgetImp, public IFWL_Timer {
  public:
diff --git a/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp b/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp
index 3d545e6..584e6c3 100644
--- a/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp
+++ b/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp
@@ -7,13 +7,17 @@
 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h"
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_tooltip.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_formimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_panelimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_tooltiptarget.h"
 
 // static
 IFWL_ToolTip* IFWL_ToolTip::Create(const CFWL_WidgetImpProperties& properties,
diff --git a/xfa/fwl/basewidget/fwl_tooltipctrlimp.h b/xfa/fwl/basewidget/fwl_tooltipctrlimp.h
index 42fe276..121f302 100644
--- a/xfa/fwl/basewidget/fwl_tooltipctrlimp.h
+++ b/xfa/fwl/basewidget/fwl_tooltipctrlimp.h
@@ -9,7 +9,7 @@
 
 #include "xfa/fwl/core/fwl_formimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
+#include "xfa/fwl/core/ifwl_timer.h"
 
 class CFWL_WidgetImpProperties;
 class IFWL_Widget;
diff --git a/xfa/fwl/basewidget/fxmath_barcodeimp.h b/xfa/fwl/basewidget/fxmath_barcodeimp.h
index 30fe400..bcad048 100644
--- a/xfa/fwl/basewidget/fxmath_barcodeimp.h
+++ b/xfa/fwl/basewidget/fxmath_barcodeimp.h
@@ -9,8 +9,8 @@
 
 #include "core/fxcrt/include/fx_string.h"
 #include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/basewidget/ifx_barcode.h"
 #include "xfa/fxbarcode/include/BC_Library.h"
-#include "xfa/include/fwl/basewidget/fxmath_barcode.h"
 
 class CBC_CodeBase;
 
diff --git a/xfa/include/fwl/basewidget/fwl_barcode.h b/xfa/fwl/basewidget/ifwl_barcode.h
similarity index 90%
rename from xfa/include/fwl/basewidget/fwl_barcode.h
rename to xfa/fwl/basewidget/ifwl_barcode.h
index 0d3db83..250e608 100644
--- a/xfa/include/fwl/basewidget/fwl_barcode.h
+++ b/xfa/fwl/basewidget/ifwl_barcode.h
@@ -4,11 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_BARCODE_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_BARCODE_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_BARCODE_H_
+#define XFA_FWL_BASEWIDGET_IFWL_BARCODE_H_
 
 #include "xfa/fxbarcode/include/BC_Library.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
+#include "xfa/fwl/basewidget/ifwl_edit.h"
 
 class CFWL_WidgetImpProperties;
 
@@ -60,4 +60,4 @@
   IFWL_Barcode();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_BARCODE_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_BARCODE_H_
diff --git a/xfa/include/fwl/basewidget/fwl_caret.h b/xfa/fwl/basewidget/ifwl_caret.h
similarity index 78%
rename from xfa/include/fwl/basewidget/fwl_caret.h
rename to xfa/fwl/basewidget/ifwl_caret.h
index d6144ae..5b0138f 100644
--- a/xfa/include/fwl/basewidget/fwl_caret.h
+++ b/xfa/fwl/basewidget/ifwl_caret.h
@@ -4,10 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_CARET_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_CARET_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_CARET_H_
+#define XFA_FWL_BASEWIDGET_IFWL_CARET_H_
 
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 
 #define FWL_CLASS_Caret L"FWL_CARET"
 #define FWL_CLASSHASH_Caret 671181879
@@ -29,4 +30,4 @@
   IFWL_Caret();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_CARET_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_CARET_H_
diff --git a/xfa/include/fwl/basewidget/fwl_checkbox.h b/xfa/fwl/basewidget/ifwl_checkbox.h
similarity index 90%
rename from xfa/include/fwl/basewidget/fwl_checkbox.h
rename to xfa/fwl/basewidget/ifwl_checkbox.h
index 6979a1d..3b63455 100644
--- a/xfa/include/fwl/basewidget/fwl_checkbox.h
+++ b/xfa/fwl/basewidget/ifwl_checkbox.h
@@ -4,11 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_CHECKBOX_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_CHECKBOX_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_
+#define XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_
 
-#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 
 #define FWL_CLASS_CheckBox L"FWL_CHECKBOX"
 #define FWL_CLASSHASH_CheckBox 4107183823
@@ -63,6 +65,7 @@
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged,
                     FWL_EVTHASH_CKB_CheckStateChanged)
 END_FWL_EVENT_DEF
+
 class IFWL_CheckBoxDP : public IFWL_DataProvider {
  public:
   virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0;
@@ -79,4 +82,4 @@
   IFWL_CheckBox();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_CHECKBOX_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_
diff --git a/xfa/include/fwl/basewidget/fwl_combobox.h b/xfa/fwl/basewidget/ifwl_combobox.h
similarity index 95%
rename from xfa/include/fwl/basewidget/fwl_combobox.h
rename to xfa/fwl/basewidget/ifwl_combobox.h
index 194d0b1..93efe28 100644
--- a/xfa/include/fwl/basewidget/fwl_combobox.h
+++ b/xfa/fwl/basewidget/ifwl_combobox.h
@@ -4,10 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_COMBOBOX_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_COMBOBOX_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_COMBOBOX_H_
+#define XFA_FWL_BASEWIDGET_IFWL_COMBOBOX_H_
 
-#include "xfa/include/fwl/basewidget/fwl_listbox.h"
+#include "xfa/fwl/basewidget/ifwl_listbox.h"
+#include "xfa/fxgraphics/include/cfx_graphics.h"
 
 class CFWL_WidgetImpProperties;
 class IFWL_ComboBox;
@@ -49,11 +50,6 @@
 #define FWL_PARTSTATE_CMB_Disabled (3L << 0)
 #define FWL_PARTSTATE_CMB_Selected (1L << 2)
 #define FWL_WGTCAPACITY_CMB_ComboFormHandler (FWL_WGTCAPACITY_MAX + 7)
-enum FWL_CMB_TEXTCHANGED {
-  FWL_CMB_TEXTCHANGED_Insert = 0,
-  FWL_CMB_TEXTCHANGED_Delete,
-  FWL_CMB_TEXTCHANGED_Replace,
-};
 #define FWL_EVT_CMB_DropDown L"FWL_EVENT_CMB_PreDropDown"
 #define FWL_EVT_CMB_PostDropDown L"FWL_EVENT_CMB_PostDropDown"
 #define FWL_EVT_CMB_CloseUp L"FWL_EVENT_CMB_CloseUp"
@@ -68,34 +64,49 @@
 #define FWL_EVTHASH_CMB_SelChanged 2923227784
 #define FWL_EVTHASH_CMB_HoverChanged 944325448
 #define FWL_EVTHASH_CMB_DrawItem 917354551
+
+enum FWL_CMB_TEXTCHANGED {
+  FWL_CMB_TEXTCHANGED_Insert = 0,
+  FWL_CMB_TEXTCHANGED_Delete,
+  FWL_CMB_TEXTCHANGED_Replace,
+};
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbPreDropDown, FWL_EVTHASH_CMB_PreDropDown)
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbPostDropDown, FWL_EVTHASH_CMB_PostDropDown)
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbCloseUp, FWL_EVTHASH_CMB_CloseUp)
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbEditChanged, FWL_EVTHASH_CMB_EditChanged)
 int32_t nChangeType;
 CFX_WideString wsInsert;
 CFX_WideString wsDelete;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbSelChanged, FWL_EVTHASH_CMB_SelChanged)
 CFX_Int32Array iArraySels;
 FX_BOOL bLButtonUp;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbHoverChanged, FWL_EVTHASH_CMB_HoverChanged)
 int32_t m_iCurHover;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbDrawItem, FWL_EVTHASH_CMB_DrawItem)
 CFX_Graphics* m_pGraphics;
 CFX_Matrix m_matrix;
 int32_t m_index;
 CFX_RectF m_rtItem;
 END_FWL_EVENT_DEF
+
 class IFWL_ComboBoxDP : public IFWL_ListBoxDP {
  public:
   virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget) = 0;
 };
+
 class IFWL_ComboBox : public IFWL_Widget {
  public:
   static IFWL_ComboBox* Create(const CFWL_WidgetImpProperties& properties);
@@ -138,4 +149,4 @@
   IFWL_ComboBox();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_COMBOBOX_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_COMBOBOX_H_
diff --git a/xfa/include/fwl/basewidget/fwl_datetimepicker.h b/xfa/fwl/basewidget/ifwl_datetimepicker.h
similarity index 92%
rename from xfa/include/fwl/basewidget/fwl_datetimepicker.h
rename to xfa/fwl/basewidget/ifwl_datetimepicker.h
index 7cce00e..25c6968 100644
--- a/xfa/include/fwl/basewidget/fwl_datetimepicker.h
+++ b/xfa/fwl/basewidget/ifwl_datetimepicker.h
@@ -4,11 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_DATETIMEPICKER_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_DATETIMEPICKER_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_DATETIMEPICKER_H_
+#define XFA_FWL_BASEWIDGET_IFWL_DATETIMEPICKER_H_
 
-#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 
 #define FWL_CLASS_DateTimePicker L"FWL_DATETIMEPICKER"
 #define FWL_CLASSHASH_DateTimePicker 3851176257
@@ -74,6 +76,7 @@
                            int32_t& iMonth,
                            int32_t& iDay) = 0;
 };
+
 class IFWL_DateTimePicker : public IFWL_Widget {
  public:
   static IFWL_DateTimePicker* Create(const CFWL_WidgetImpProperties& properties,
@@ -109,4 +112,4 @@
   IFWL_DateTimePicker();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_DATETIMEPICKER_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_DATETIMEPICKER_H_
diff --git a/xfa/include/fwl/basewidget/fwl_edit.h b/xfa/fwl/basewidget/ifwl_edit.h
similarity index 97%
rename from xfa/include/fwl/basewidget/fwl_edit.h
rename to xfa/fwl/basewidget/ifwl_edit.h
index 79a7a84..74b66e8 100644
--- a/xfa/include/fwl/basewidget/fwl_edit.h
+++ b/xfa/fwl/basewidget/ifwl_edit.h
@@ -4,15 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_EDIT_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_EDIT_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_EDIT_H_
+#define XFA_FWL_BASEWIDGET_IFWL_EDIT_H_
 
 #include <vector>
 
 #include "xfa/include/fwl/lightwidget/widget.h"
-
-class CFWL_WidgetImpProperties;
-class IFWL_Edit;
+#include "xfa/fwl/core/ifwl_dataprovider.h"
 
 #define FWL_CLASS_Edit L"FWL_EDIT"
 #define FWL_CLASSHASH_Edit 2893987822
@@ -59,12 +57,6 @@
 #define FWL_PARTSTATE_EDT_Normal (0L << 0)
 #define FWL_PARTSTATE_EDT_ReadOnly (1L << 0)
 #define FWL_PARTSTATE_EDT_Disable (2L << 0)
-enum FWL_EDT_TEXTCHANGED {
-  FWL_EDT_TEXTCHANGED_Insert = 0,
-  FWL_EDT_TEXTCHANGED_Delete,
-  FWL_EDT_TEXTCHANGED_Replace,
-};
-
 #define FWL_EVT_EDT_TextChanged L"FWL_EVENT_EDT_TextChanged"
 #define FWL_EVTHASH_EDT_TextChanged 1064022132
 #define FWL_EVT_EDT_PreSelfAdaption L"FWL_EVENT_PreSelfAdaption"
@@ -77,6 +69,18 @@
 #define FWL_EVTHASH_EDT_GetSuggestWords 315782791
 #define FWL_EVT_EDT_TextFull L"FWL_EVTHASH_EDT_TextFull"
 #define FWL_EVTHASH_EDT_TextFull 2158580174
+#define FWL_EDT_FIND_FLAGS_Prev (0L << 0)
+#define FWL_EDT_FIND_FLAGS_Next (1L << 0)
+#define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1)
+#define FWL_EDT_FIND_FLAGS_NoCase (1L << 2)
+
+typedef struct FWL_HEDTFIND_ { void* pData; } * FWL_HEDTFIND;
+
+enum FWL_EDT_TEXTCHANGED {
+  FWL_EDT_TEXTCHANGED_Insert = 0,
+  FWL_EDT_TEXTCHANGED_Delete,
+  FWL_EDT_TEXTCHANGED_Replace,
+};
 
 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, FWL_EVTHASH_EDT_TextChanged)
 int32_t nChangeType;
@@ -84,33 +88,36 @@
 CFX_WideString wsDelete;
 CFX_WideString wsPrevText;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, FWL_EVTHASH_EDT_TextFull)
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, FWL_EVTHASH_EDT_PreSelfAdaption)
 FX_BOOL bHSelfAdaption;
 FX_BOOL bVSelfAdaption;
 CFX_RectF rtAfterChange;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, FWL_EVTHASH_EDT_Validate)
 IFWL_Widget* pDstWidget;
 CFX_WideString wsInsert;
 FX_BOOL bValidate;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord)
 CFX_ByteString bsWord;
 FX_BOOL bCheckWord;
 END_FWL_EVENT_DEF
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords)
 FX_BOOL bSuggestWords;
 CFX_ByteString bsWord;
 std::vector<CFX_ByteString> bsArraySuggestWords;
 END_FWL_EVENT_DEF
+
+class CFWL_WidgetImpProperties;
+
 class IFWL_EditDP : public IFWL_DataProvider {};
-#define FWL_EDT_FIND_FLAGS_Prev (0L << 0)
-#define FWL_EDT_FIND_FLAGS_Next (1L << 0)
-#define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1)
-#define FWL_EDT_FIND_FLAGS_NoCase (1L << 2)
-typedef struct FWL_HEDTFIND_ { void* pData; } * FWL_HEDTFIND;
 
 class IFWL_Edit : public IFWL_Widget {
  public:
@@ -168,4 +175,4 @@
   IFWL_Edit();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_EDIT_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_
diff --git a/xfa/include/fwl/basewidget/fwl_listbox.h b/xfa/fwl/basewidget/ifwl_listbox.h
similarity index 94%
rename from xfa/include/fwl/basewidget/fwl_listbox.h
rename to xfa/fwl/basewidget/ifwl_listbox.h
index 4cf5c65..7bec4ed 100644
--- a/xfa/include/fwl/basewidget/fwl_listbox.h
+++ b/xfa/fwl/basewidget/ifwl_listbox.h
@@ -4,13 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_LISTBOX_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_LISTBOX_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_
+#define XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_
 
-#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
-
-class IFWL_ListBoxDP;
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 
 #define FWL_CLASS_ListBox L"FWL_LISTBOX"
 #define FWL_CLASSHASH_ListBox 1777358317
@@ -51,6 +51,16 @@
 #define FWL_EVTHASH_LTB_SelChanged 1701781688
 #define FWL_EVTHASH_LTB_DrawItem 1050853991
 
+typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM;
+
+class CFX_DIBitmap;
+class IFWL_ListBoxDP;
+
+struct FWL_ListBoxItemData {
+  IFWL_ListBoxDP* pDataProvider;
+  int32_t iIndex;
+};
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, FWL_EVTHASH_LTB_SelChanged)
 CFX_Int32Array iarraySels;
 END_FWL_EVENT_DEF
@@ -62,12 +72,6 @@
 CFX_RectF m_rect;
 END_FWL_EVENT_DEF
 
-typedef struct FWL_HLISTITEM_ { void* pData; } * FWL_HLISTITEM;
-struct FWL_ListBoxItemData {
-  IFWL_ListBoxDP* pDataProvider;
-  int32_t iIndex;
-};
-
 class IFWL_ListBoxDP : public IFWL_DataProvider {
  public:
   virtual int32_t CountItems(IFWL_Widget* pWidget) = 0;
@@ -108,11 +112,13 @@
                                     FWL_HLISTITEM hItem,
                                     FX_DWORD dwCheckState) = 0;
 };
+
 class IFWL_ListBoxCompare {
  public:
   virtual ~IFWL_ListBoxCompare() {}
   virtual int32_t Compare(FWL_HLISTITEM hLeft, FWL_HLISTITEM hRight) = 0;
 };
+
 class IFWL_ListBox : public IFWL_Widget {
  public:
   static IFWL_ListBox* Create(const CFWL_WidgetImpProperties& properties,
@@ -133,4 +139,4 @@
   IFWL_ListBox();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_LISTBOX_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_LISTBOX_H_
diff --git a/xfa/include/fwl/basewidget/fwl_monthcalendar.h b/xfa/fwl/basewidget/ifwl_monthcalendar.h
similarity index 93%
rename from xfa/include/fwl/basewidget/fwl_monthcalendar.h
rename to xfa/fwl/basewidget/ifwl_monthcalendar.h
index a57b815..8f9ab9a 100644
--- a/xfa/include/fwl/basewidget/fwl_monthcalendar.h
+++ b/xfa/fwl/basewidget/ifwl_monthcalendar.h
@@ -4,11 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_MONTHCALENDAR_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_MONTHCALENDAR_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_MONTHCALENDAR_H_
+#define XFA_FWL_BASEWIDGET_IFWL_MONTHCALENDAR_H_
 
-#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 
 #define FWL_CLASS_MonthCalendar L"FWL_MONTHCALENDAR"
 #define FWL_CLASSHASH_MonthCalendar 2733931374
@@ -134,4 +136,4 @@
   IFWL_MonthCalendar();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_MONTHCALENDAR_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_MONTHCALENDAR_H_
diff --git a/xfa/include/fwl/basewidget/fwl_picturebox.h b/xfa/fwl/basewidget/ifwl_picturebox.h
similarity index 84%
rename from xfa/include/fwl/basewidget/fwl_picturebox.h
rename to xfa/fwl/basewidget/ifwl_picturebox.h
index 123607a..acc34f7 100644
--- a/xfa/include/fwl/basewidget/fwl_picturebox.h
+++ b/xfa/fwl/basewidget/ifwl_picturebox.h
@@ -4,10 +4,14 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_PICTUREBOX_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_PICTUREBOX_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_PICTUREBOX_H_
+#define XFA_FWL_BASEWIDGET_IFWL_PICTUREBOX_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 #define FWL_CLASS_PictureBox L"FWL_PICTUREBOX"
 #define FWL_CLASSHASH_PictureBox 2974721741
@@ -31,6 +35,8 @@
 #define FWL_PARTSTATE_PTB_Normal (0L << 0)
 #define FWL_PARTSTATE_PTB_Disabled (1L << 0)
 
+class CFX_DIBitmap;
+
 class IFWL_PictureBoxDP : public IFWL_DataProvider {
  public:
   virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0;
@@ -50,4 +56,4 @@
   IFWL_PictureBox();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_PICTUREBOX_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_PICTUREBOX_H_
diff --git a/xfa/include/fwl/basewidget/fwl_pushbutton.h b/xfa/fwl/basewidget/ifwl_pushbutton.h
similarity index 86%
rename from xfa/include/fwl/basewidget/fwl_pushbutton.h
rename to xfa/fwl/basewidget/ifwl_pushbutton.h
index 28f9df4..400b0c1 100644
--- a/xfa/include/fwl/basewidget/fwl_pushbutton.h
+++ b/xfa/fwl/basewidget/ifwl_pushbutton.h
@@ -4,11 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_PUSHBUTTON_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_PUSHBUTTON_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_PUSHBUTTON_H_
+#define XFA_FWL_BASEWIDGET_IFWL_PUSHBUTTON_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 #define FWL_CLASS_PushButton L"FWL_PUSHBUTTON"
 #define FWL_CLASSHASH_PushButton 3521614244
@@ -40,10 +42,13 @@
 #define FWL_PARTSTATE_PSB_Focused (1L << 3)
 #define FWL_PARTSTATE_PSB_Mask (7L << 0)
 
+class CFX_DIBitmap;
+
 class IFWL_PushButtonDP : public IFWL_DataProvider {
  public:
   virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0;
 };
+
 class IFWL_PushButton : public IFWL_Widget {
  public:
   static IFWL_PushButton* Create(const CFWL_WidgetImpProperties& properties,
@@ -53,4 +58,4 @@
   IFWL_PushButton();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_PUSHBUTTON_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_PUSHBUTTON_H_
diff --git a/xfa/include/fwl/basewidget/fwl_scrollbar.h b/xfa/fwl/basewidget/ifwl_scrollbar.h
similarity index 86%
rename from xfa/include/fwl/basewidget/fwl_scrollbar.h
rename to xfa/fwl/basewidget/ifwl_scrollbar.h
index 8cd69bc..c481332 100644
--- a/xfa/include/fwl/basewidget/fwl_scrollbar.h
+++ b/xfa/fwl/basewidget/ifwl_scrollbar.h
@@ -4,10 +4,15 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_SCROLLBAR_H_
+#define XFA_FWL_BASEWIDGET_IFWL_SCROLLBAR_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 #define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR"
 #define FWL_CLASSHASH_ScrollBar 2826584844
@@ -69,4 +74,4 @@
   IFWL_ScrollBar();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_SCROLLBAR_H_
diff --git a/xfa/include/fwl/basewidget/fwl_spinbutton.h b/xfa/fwl/basewidget/ifwl_spinbutton.h
similarity index 89%
rename from xfa/include/fwl/basewidget/fwl_spinbutton.h
rename to xfa/fwl/basewidget/ifwl_spinbutton.h
index fdd27c6..f68ab0f 100644
--- a/xfa/include/fwl/basewidget/fwl_spinbutton.h
+++ b/xfa/fwl/basewidget/ifwl_spinbutton.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_SPINBUTTON_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_SPINBUTTON_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_SPINBUTTON_H_
+#define XFA_FWL_BASEWIDGET_IFWL_SPINBUTTON_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
 
@@ -24,6 +24,7 @@
 #define FWL_WGTHITTEST_SPB_DownButton (FWL_WGTHITTEST_MAX + 2)
 #define FWL_EVT_SPB_Click L"FWL_EVENT_SPB_Click"
 #define FWL_EVTHASH_SPB_Click 2927651187
+
 BEGIN_FWL_EVENT_DEF(CFWL_EvtSpbClick, FWL_EVTHASH_SPB_Click)
 FX_BOOL m_bUp;
 END_FWL_EVENT_DEF
@@ -40,4 +41,4 @@
   IFWL_SpinButton();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_SPINBUTTON_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_SPINBUTTON_H_
diff --git a/xfa/include/fwl/basewidget/fwl_tooltipctrl.h b/xfa/fwl/basewidget/ifwl_tooltip.h
similarity index 86%
rename from xfa/include/fwl/basewidget/fwl_tooltipctrl.h
rename to xfa/fwl/basewidget/ifwl_tooltip.h
index 0a775db..278544b 100644
--- a/xfa/include/fwl/basewidget/fwl_tooltipctrl.h
+++ b/xfa/fwl/basewidget/ifwl_tooltip.h
@@ -4,10 +4,10 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_TOOLTIPCTRL_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_TOOLTIPCTRL_H_
+#ifndef XFA_FWL_BASEWIDGET_IFWL_TOOLTIP_H_
+#define XFA_FWL_BASEWIDGET_IFWL_TOOLTIP_H_
 
-#include "xfa/include/fwl/core/fwl_form.h"
+#include "xfa/fwl/core/ifwl_form.h"
 
 class CFWL_WidgetImpProperties;
 class IFWL_ToolTip;
@@ -32,6 +32,7 @@
   virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0;
   virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0;
 };
+
 class IFWL_ToolTip : public IFWL_Form {
  public:
   static IFWL_ToolTip* Create(const CFWL_WidgetImpProperties& properties,
@@ -45,4 +46,4 @@
   IFWL_ToolTip();
 };
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_TOOLTIPCTRL_H_
+#endif  // XFA_FWL_BASEWIDGET_IFWL_TOOLTIP_H_
diff --git a/xfa/include/fwl/basewidget/fxmath_barcode.h b/xfa/fwl/basewidget/ifx_barcode.h
similarity index 93%
rename from xfa/include/fwl/basewidget/fxmath_barcode.h
rename to xfa/fwl/basewidget/ifx_barcode.h
index 51fd242..a44a01b 100644
--- a/xfa/include/fwl/basewidget/fxmath_barcode.h
+++ b/xfa/fwl/basewidget/ifx_barcode.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FXMATH_BARCODE_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FXMATH_BARCODE_H_
+#ifndef XFA_FWL_BASEWIDGET_IFX_BARCODE_H_
+#define XFA_FWL_BASEWIDGET_IFX_BARCODE_H_
 
 #include "core/fxcrt/include/fx_string.h"
 #include "core/fxcrt/include/fx_system.h"
@@ -59,4 +59,4 @@
 
 IFX_Barcode* FX_Barcode_Create(BC_TYPE type);
 
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FXMATH_BARCODE_H_
+#endif  // XFA_FWL_BASEWIDGET_IFX_BARCODE_H_
diff --git a/xfa/fwl/core/cfwl_event.h b/xfa/fwl/core/cfwl_event.h
new file mode 100644
index 0000000..97ca1d3
--- /dev/null
+++ b/xfa/fwl/core/cfwl_event.h
@@ -0,0 +1,145 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_EVENT_H_
+#define XFA_FWL_CORE_CFWL_EVENT_H_
+
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_string.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/cfwl_note.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+#define FWL_EVT_Mouse L"FWL_EVENT_Mouse"
+#define FWL_EVT_MouseWheel L"FWL_EVENT_MouseWheel"
+#define FWL_EVT_Key L"FWL_EVENT_Key"
+#define FWL_EVT_SetFocus L"FWL_EVENT_SetFocus"
+#define FWL_EVT_KillFocus L"FWL_EVENT_KillFocus"
+#define FWL_EVT_Click L"FWL_EVENT_Click"
+#define FWL_EVT_Draw L"FWL_EVENT_Draw"
+#define FWL_EVT_Scroll L"FWL_EVENT_Scroll"
+#define FWL_EVT_Close L"FWL_EVENT_Close"
+#define FWL_EVT_ContextMenu L"FWL_EVENT_ContextMenu"
+#define FWL_EVT_MenuCommand L"FWL_EVENT_MenuCommand"
+#define FWL_EVT_SizeChanged L"FWL_EVENT_SizeChanged"
+
+#define FWL_EVTHASH_Mouse 1765258002
+#define FWL_EVTHASH_MouseWheel 3907114407
+#define FWL_EVTHASH_Key 2408354450
+#define FWL_EVTHASH_SetFocus 3909721269
+#define FWL_EVTHASH_KillFocus 1779363253
+#define FWL_EVTHASH_Draw 2430713303
+#define FWL_EVTHASH_Click 4026328783
+#define FWL_EVTHASH_Scroll 2965158968
+#define FWL_EVTHASH_Close 4036693599
+#define FWL_EVTHASH_ContextMenu 2717307715
+#define FWL_EVTHASH_MenuCommand 497763741
+#define FWL_EVTHASH_SizeChanged 3083958510
+#define FWL_EVTHASH_Idle 839546759
+
+typedef enum {
+  FWL_EVENT_MOUSE_MASK = 1 << 0,
+  FWL_EVENT_MOUSEWHEEL_MASK = 1 << 1,
+  FWL_EVENT_KEY_MASK = 1 << 2,
+  FWL_EVENT_FOCUSCHANGED_MASK = 1 << 3,
+  FWL_EVENT_DRAW_MASK = 1 << 4,
+  FWL_EVENT_CLOSE_MASK = 1 << 5,
+  FWL_EVENT_SIZECHANGED_MASK = 1 << 6,
+  FWL_EVENT_IDLE_MASK = 1 << 7,
+  FWL_EVENT_CONTROL_MASK = 1 << 8,
+  FWL_EVENT_ALL_MASK = 0xFF
+} FWLEventMask;
+
+class CFX_Graphics;
+class IFWL_Widget;
+
+class CFWL_Event : public CFWL_Note {
+ public:
+  CFWL_Event() : CFWL_Note(TRUE) {}
+  virtual ~CFWL_Event() {}
+};
+
+#define BEGIN_FWL_EVENT_DEF(classname, eventhashcode)             \
+  class classname : public CFWL_Event {                           \
+   public:                                                        \
+    classname() : CFWL_Event() {}                                 \
+    virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
+      wsClass = L## #classname;                                   \
+      return FWL_ERR_Succeeded;                                   \
+    }                                                             \
+    virtual FX_DWORD GetClassID() const { return eventhashcode; }
+
+#define END_FWL_EVENT_DEF \
+  }                       \
+  ;  // NOLINT
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, FWL_EVTHASH_Mouse)
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+FX_DWORD m_dwFlags;
+FX_DWORD m_dwCmd;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtMouseWheel, FWL_EVTHASH_MouseWheel)
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+FX_FLOAT m_fDeltaX;
+FX_FLOAT m_fDeltaY;
+FX_DWORD m_dwFlags;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtKey, FWL_EVTHASH_Key)
+FX_DWORD m_dwKeyCode;
+FX_DWORD m_dwFlags;
+FX_DWORD m_dwCmd;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtSetFocus, FWL_EVTHASH_SetFocus)
+IFWL_Widget* m_pSetFocus;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtKillFocus, FWL_EVTHASH_KillFocus)
+IFWL_Widget* m_pKillFocus;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtDraw, FWL_EVTHASH_Draw)
+CFX_Graphics* m_pGraphics;
+IFWL_Widget* m_pWidget;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtClick, FWL_EVTHASH_Click)
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtScroll, FWL_EVTHASH_Scroll)
+FX_DWORD m_iScrollCode;
+FX_FLOAT m_fPos;
+FX_BOOL* m_pRet;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtClose, FWL_EVTHASH_Close)
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtContextMenu, FWL_EVTHASH_ContextMenu)
+FX_FLOAT m_fPosX;
+FX_FLOAT m_fPosY;
+IFWL_Widget* m_pOwner;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtMenuCommand, FWL_EVTHASH_MenuCommand)
+int32_t m_iCommand;
+void* m_pData;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, FWL_EVTHASH_SizeChanged)
+IFWL_Widget* m_pWidget;
+CFX_RectF m_rtOld;
+CFX_RectF m_rtNew;
+END_FWL_EVENT_DEF
+
+BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, FWL_EVTHASH_Idle)
+END_FWL_EVENT_DEF
+
+#endif  // XFA_FWL_CORE_CFWL_EVENT_H_
diff --git a/xfa/fwl/core/cfwl_message.h b/xfa/fwl/core/cfwl_message.h
new file mode 100644
index 0000000..f3e4a58
--- /dev/null
+++ b/xfa/fwl/core/cfwl_message.h
@@ -0,0 +1,159 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_MESSAGE_H_
+#define XFA_FWL_CORE_CFWL_MESSAGE_H_
+
+#include "core/fxcrt/include/fx_string.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/cfwl_note.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+#define FWL_MSGHASH_Activate 2410369469
+#define FWL_MSGHASH_Deactivate 1184214790
+#define FWL_MSGHASH_SetFocus 4174512504
+#define FWL_MSGHASH_KillFocus 1557903832
+#define FWL_MSGHASH_Mouse 706128309
+#define FWL_MSGHASH_MouseWheel 893703466
+#define FWL_MSGHASH_Key 3751372405
+#define FWL_MSGHASH_Cursor 3182626218
+#define FWL_MSGHASH_Size 160077735
+#define FWL_MSGHASH_WindowMove 1032269377
+#define FWL_MSGHASH_DropFiles 2004165236
+#define FWL_MSGHASH_TaskClicked 3128231086
+#define FWL_MSGHASH_Close 2977563906
+#define FWL_MSGHASH_Post 1969633074
+#define FWL_MSGHASH_WindowWillMove 2229175763
+
+#define FWL_MSG_Activate L"FWL_MESSAGE_Activate"
+#define FWL_MSG_Deactivate L"FWL_MESSAGE_Deactivate"
+#define FWL_MSG_SetFocus L"FWL_MESSAGE_SetFocus"
+#define FWL_MSG_KillFocus L"FWL_MESSAGE_KillFocus"
+#define FWL_MSG_Mouse L"FWL_MESSAGE_Mouse"
+#define FWL_MSG_MouseWheel L"FWL_MESSAGE_MouseWheel"
+#define FWL_MSG_Key L"FWL_MESSAGE_Key"
+#define FWL_MSG_Cursor L"FWL_MESSAGE_Cursor"
+#define FWL_MSG_Size L"FWL_MESSAGE_Size"
+#define FWL_MSG_WindowMove L"FWL_MESSAGE_WindowMove"
+#define FWL_MSG_DropFiles L"FWL_MESSAGE_DropFiles"
+#define FWL_MSG_TaskClicked L"FWL_MESSAGE_TaskClicked"
+#define FWL_MSG_Close L"FWL_MESSAGE_Close"
+#define FWL_MSG_Post L"FWL_MESSAGE_Post"
+#define FWL_MSG_WindowWillMove L"FWL_MESSAGE_WindowWillMove"
+
+#define FWL_MSGMOUSECMD_LButtonDown 1
+#define FWL_MSGMOUSECMD_LButtonUp 2
+#define FWL_MSGMOUSECMD_LButtonDblClk 3
+#define FWL_MSGMOUSECMD_RButtonDown 4
+#define FWL_MSGMOUSECMD_RButtonUp 5
+#define FWL_MSGMOUSECMD_RButtonDblClk 6
+#define FWL_MSGMOUSECMD_MButtonDown 7
+#define FWL_MSGMOUSECMD_MButtonUp 8
+#define FWL_MSGMOUSECMD_MButtonDblClk 9
+#define FWL_MSGMOUSECMD_MouseMove 10
+#define FWL_MSGMOUSECMD_MouseEnter 11
+#define FWL_MSGMOUSECMD_MouseLeave 12
+#define FWL_MSGMOUSECMD_MouseHover 13
+#define FWL_MSGKEYCMD_KeyDown 1
+#define FWL_MSGKEYCMD_KeyUp 2
+#define FWL_MSGKEYCMD_Char 3
+
+class IFWL_Widget;
+
+class CFWL_Message : public CFWL_Note {
+ public:
+  CFWL_Message() : CFWL_Note(FALSE) {}
+  virtual ~CFWL_Message() {}
+};
+
+#define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode)             \
+  class classname : public CFWL_Message {                         \
+   public:                                                        \
+    classname() : CFWL_Message() {}                               \
+    virtual CFWL_Note* Clone() { return new classname(*this); }   \
+    virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
+      wsClass = L## #classname;                                   \
+      return FWL_ERR_Succeeded;                                   \
+    }                                                             \
+    virtual FX_DWORD GetClassID() const { return msghashcode; }
+
+#define END_FWL_MESSAGE_DEF \
+  }                         \
+  ;  // NOLINT
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, FWL_MSGHASH_Activate)
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, FWL_MSGHASH_Deactivate)
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, FWL_MSGHASH_Mouse)
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+FX_DWORD m_dwFlags;
+FX_DWORD m_dwCmd;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouseWheel, FWL_MSGHASH_MouseWheel)
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+FX_FLOAT m_fDeltaX;
+FX_FLOAT m_fDeltaY;
+FX_DWORD m_dwFlags;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSetFocus, FWL_MSGHASH_SetFocus)
+IFWL_Widget* m_pKillFocus;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKillFocus, FWL_MSGHASH_KillFocus)
+IFWL_Widget* m_pSetFocus;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKey, FWL_MSGHASH_Key)
+FX_DWORD m_dwKeyCode;
+FX_DWORD m_dwFlags;
+FX_DWORD m_dwCmd;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgCursor, FWL_MSGHASH_Cursor)
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSize, FWL_MSGHASH_Size)
+int32_t m_iWidth;
+int32_t m_iHeight;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowMove, FWL_MSGHASH_WindowMove)
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDropFiles, FWL_MSGHASH_DropFiles)
+CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) {
+  m_pDstTarget = copy.m_pDstTarget;
+  m_pSrcTarget = copy.m_pSrcTarget;
+  m_fx = copy.m_fx;
+  m_fy = copy.m_fy;
+  m_files.Append(copy.m_files);
+}
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+CFX_WideStringArray m_files;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgTaskClicked, FWL_MSGHASH_TaskClicked)
+FX_FLOAT m_fx;
+FX_FLOAT m_fy;
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, FWL_MSGHASH_Close)
+END_FWL_MESSAGE_DEF
+
+BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, FWL_MSGHASH_WindowWillMove)
+END_FWL_MESSAGE_DEF
+
+#endif  // XFA_FWL_CORE_CFWL_MESSAGE_H_
diff --git a/xfa/fwl/core/cfwl_note.h b/xfa/fwl/core/cfwl_note.h
new file mode 100644
index 0000000..c0f1053
--- /dev/null
+++ b/xfa/fwl/core/cfwl_note.h
@@ -0,0 +1,67 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_NOTE_H_
+#define XFA_FWL_CORE_CFWL_NOTE_H_
+
+#include "core/fxcrt/include/fx_string.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+class IFWL_Widget;
+
+// Separate hierarchy not related to IFWL_* hierarchy. These should not
+// get cast to IFWL_* types.
+class CFWL_Note {
+ public:
+  virtual FX_DWORD Release() {
+    m_dwRefCount--;
+    FX_DWORD dwRefCount = m_dwRefCount;
+    if (!m_dwRefCount)
+      delete this;
+    return dwRefCount;
+  }
+
+  virtual CFWL_Note* Retain() {
+    m_dwRefCount++;
+    return this;
+  }
+
+  virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const {
+    wsClass = L"CFWL_Note";
+    return FWL_ERR_Succeeded;
+  }
+
+  virtual FX_DWORD GetClassID() const { return 0; }
+
+  virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const {
+    return TRUE;
+  }
+
+  virtual CFWL_Note* Clone() { return NULL; }
+  FX_BOOL IsEvent() const { return m_bIsEvent; }
+
+  IFWL_Widget* m_pSrcTarget;
+  IFWL_Widget* m_pDstTarget;
+  FX_DWORD m_dwExtend;
+
+ protected:
+  CFWL_Note(FX_BOOL bIsEvent)
+      : m_pSrcTarget(NULL),
+        m_pDstTarget(NULL),
+        m_dwExtend(0),
+        m_dwRefCount(1),
+        m_bIsEvent(bIsEvent) {}
+
+  virtual ~CFWL_Note() {}
+  virtual FX_BOOL Initialize() { return TRUE; }
+  virtual int32_t Finalize() { return 0; }
+
+  FX_DWORD m_dwRefCount;
+  FX_BOOL m_bIsEvent;
+};
+
+#endif  // XFA_FWL_CORE_CFWL_NOTE_H_
diff --git a/xfa/fwl/core/cfwl_themebackground.h b/xfa/fwl/core/cfwl_themebackground.h
new file mode 100644
index 0000000..cdab5b2
--- /dev/null
+++ b/xfa/fwl/core/cfwl_themebackground.h
@@ -0,0 +1,25 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_THEMEBACKGROUND_H_
+#define XFA_FWL_CORE_CFWL_THEMEBACKGROUND_H_
+
+#include "core/include/fxge/fx_dib.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+
+class CFX_DIBitmpa;
+class CFX_Graphics;
+class CFX_Path;
+
+class CFWL_ThemeBackground : public CFWL_ThemePart {
+ public:
+  CFWL_ThemeBackground() : m_pGraphics(NULL), m_pImage(NULL), m_pPath(NULL) {}
+  CFX_Graphics* m_pGraphics;
+  CFX_DIBitmap* m_pImage;
+  CFX_Path* m_pPath;
+};
+
+#endif  // XFA_FWL_CORE_CFWL_THEMEBACKGROUND_H_
diff --git a/xfa/fwl/core/cfwl_themepart.h b/xfa/fwl/core/cfwl_themepart.h
new file mode 100644
index 0000000..ddbdc32
--- /dev/null
+++ b/xfa/fwl/core/cfwl_themepart.h
@@ -0,0 +1,31 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_THEMEPART_H_
+#define XFA_FWL_CORE_CFWL_THEMEPART_H_
+
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+
+class CFWL_ThemePart {
+ public:
+  CFWL_ThemePart()
+      : m_pWidget(NULL), m_iPart(0), m_dwStates(0), m_dwData(0), m_pData(NULL) {
+    m_rtPart.Reset();
+    m_matrix.SetIdentity();
+  }
+
+  CFX_Matrix m_matrix;
+  CFX_RectF m_rtPart;
+  IFWL_Widget* m_pWidget;
+  int32_t m_iPart;
+  FX_DWORD m_dwStates;
+  FX_DWORD m_dwData;
+  void* m_pData;
+};
+
+#endif  // XFA_FWL_CORE_CFWL_THEMEPART_H_
diff --git a/xfa/fwl/core/cfwl_themetext.h b/xfa/fwl/core/cfwl_themetext.h
new file mode 100644
index 0000000..e4c0e92
--- /dev/null
+++ b/xfa/fwl/core/cfwl_themetext.h
@@ -0,0 +1,23 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_THEMETEXT_H_
+#define XFA_FWL_CORE_CFWL_THEMETEXT_H_
+
+#include "core/fxcrt/include/fx_string.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+
+class CFWL_ThemeText : public CFWL_ThemePart {
+ public:
+  CFWL_ThemeText() : m_pGraphics(NULL) {}
+  CFX_WideString m_wsText;
+  FX_DWORD m_dwTTOStyles;
+  int32_t m_iTTOAlign;
+  CFX_Graphics* m_pGraphics;
+};
+
+#endif  // XFA_FWL_CORE_CFWL_THEMETEXT_H_
diff --git a/xfa/fwl/core/cfwl_widgetimpproperties.h b/xfa/fwl/core/cfwl_widgetimpproperties.h
new file mode 100644
index 0000000..7a3bab6
--- /dev/null
+++ b/xfa/fwl/core/cfwl_widgetimpproperties.h
@@ -0,0 +1,43 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_CFWL_WIDGETIMPPROPERTIES_H_
+#define XFA_FWL_CORE_CFWL_WIDGETIMPPROPERTIES_H_
+
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_widgetdef.h"
+
+class IFWL_DataProvider;
+class IFWL_ThemeProvider;
+class IFWL_Widget;
+
+class CFWL_WidgetImpProperties {
+ public:
+  CFWL_WidgetImpProperties()
+      : m_dwStyles(FWL_WGTSTYLE_Child),
+        m_dwStyleExes(0),
+        m_dwStates(0),
+        m_pThemeProvider(nullptr),
+        m_pDataProvider(nullptr),
+        m_pParent(nullptr),
+        m_pOwner(nullptr) {
+    m_ctmOnParent.SetIdentity();
+    m_rtWidget.Set(0, 0, 0, 0);
+  }
+
+  CFX_Matrix m_ctmOnParent;
+  CFX_RectF m_rtWidget;
+  FX_DWORD m_dwStyles;
+  FX_DWORD m_dwStyleExes;
+  FX_DWORD m_dwStates;
+  IFWL_ThemeProvider* m_pThemeProvider;
+  IFWL_DataProvider* m_pDataProvider;
+  IFWL_Widget* m_pParent;
+  IFWL_Widget* m_pOwner;
+};
+
+#endif  // XFA_FWL_CORE_CFWL_WIDGETIMPPROPERTIES_H_
diff --git a/xfa/fwl/core/fwl_appimp.cpp b/xfa/fwl/core/fwl_appimp.cpp
index 3163486..2cff349 100644
--- a/xfa/fwl/core/fwl_appimp.cpp
+++ b/xfa/fwl/core/fwl_appimp.cpp
@@ -10,9 +10,9 @@
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 IFWL_App* IFWL_App::Create(IFWL_AdapterNative* pAdapter) {
   IFWL_App* pApp = new IFWL_App;
diff --git a/xfa/fwl/core/fwl_contentimp.cpp b/xfa/fwl/core/fwl_contentimp.cpp
index a38998f..5bfac08 100644
--- a/xfa/fwl/core/fwl_contentimp.cpp
+++ b/xfa/fwl/core/fwl_contentimp.cpp
@@ -11,7 +11,7 @@
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/core/fwl_content.h"
+#include "xfa/fwl/core/ifwl_content.h"
 
 FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget* pChild, int32_t nIndex) {
   return static_cast<CFWL_ContentImp*>(GetImpl())->InsertWidget(pChild, nIndex);
diff --git a/xfa/include/fwl/core/fwl_error.h b/xfa/fwl/core/fwl_error.h
similarity index 80%
rename from xfa/include/fwl/core/fwl_error.h
rename to xfa/fwl/core/fwl_error.h
index 8b4c8f4..92a483f 100644
--- a/xfa/include/fwl/core/fwl_error.h
+++ b/xfa/fwl/core/fwl_error.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_
+#ifndef XFA_FWL_CORE_FWL_ERROR_H_
+#define XFA_FWL_CORE_FWL_ERROR_H_
 
 #include <stdint.h>
 
@@ -19,4 +19,4 @@
 #define FWL_ERR_Method_Not_Supported -400
 #define FWL_ERR_Out_Of_Memory -500
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_
+#endif  // XFA_FWL_CORE_FWL_ERROR_H_
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp
index a321431..8317655 100644
--- a/xfa/fwl/core/fwl_formimp.cpp
+++ b/xfa/fwl/core/fwl_formimp.cpp
@@ -8,6 +8,10 @@
 
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fwl/basewidget/fwl_formproxyimp.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_panelimp.h"
@@ -15,10 +19,10 @@
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_content.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_content.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 #define FWL_SYSBTNSIZE 21
 #define FWL_SYSBTNMARGIN 5
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h
index eddc1d6..e5c0f80 100644
--- a/xfa/fwl/core/fwl_formimp.h
+++ b/xfa/fwl/core/fwl_formimp.h
@@ -9,11 +9,13 @@
 
 #include "xfa/fwl/core/fwl_panelimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/core/fwl_form.h"
+#include "xfa/fwl/core/ifwl_form.h"
 
+class CFWL_MsgMouse;
+class CFWL_MsgClose;
+class CFWL_MsgWindowMove;
 class CFWL_NoteLoop;
 class CFWL_WidgetImpProperties;
-class CFWL_MsgMouse;
 class IFWL_Widget;
 class IFWL_ThemeProvider;
 class CFWL_SysBtn;
diff --git a/xfa/fwl/core/fwl_gridimp.cpp b/xfa/fwl/core/fwl_gridimp.cpp
index a898bea..9ff1949 100644
--- a/xfa/fwl/core/fwl_gridimp.cpp
+++ b/xfa/fwl/core/fwl_gridimp.cpp
@@ -6,6 +6,8 @@
 
 #include "xfa/fwl/core/fwl_gridimp.h"
 
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 #include "xfa/fwl/core/fwl_contentimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
diff --git a/xfa/fwl/core/fwl_gridimp.h b/xfa/fwl/core/fwl_gridimp.h
index fda283f..3329cb7 100644
--- a/xfa/fwl/core/fwl_gridimp.h
+++ b/xfa/fwl/core/fwl_gridimp.h
@@ -8,9 +8,9 @@
 #define XFA_FWL_CORE_FWL_GRIDIMP_H_
 
 #include "xfa/fwl/core/fwl_contentimp.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_content.h"
-#include "xfa/include/fwl/core/fwl_grid.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_content.h"
+#include "xfa/fwl/core/ifwl_grid.h"
 
 class CFWL_GridLength {
  public:
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 6553454..ecc13f0 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -8,6 +8,8 @@
 
 #include "core/fxcrt/include/fx_ext.h"
 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h"
+#include "xfa/fwl/basewidget/ifwl_tooltip.h"
+#include "xfa/fwl/core/cfwl_message.h"
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_formimp.h"
 #include "xfa/fwl/core/fwl_panelimp.h"
@@ -15,10 +17,10 @@
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
-#include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_grid.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_grid.h"
+#include "xfa/fwl/core/ifwl_tooltiptarget.h"
 
 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm)
     : m_pForm(pForm), m_bContinueModal(TRUE) {}
@@ -805,7 +807,7 @@
     }
   }
 }
-class CFWL_CoreToopTipDP : public IFWL_ToolTipDP {
+class CFWL_CoreToolTipDP : public IFWL_ToolTipDP {
  public:
   FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
   int32_t GetInitialDelay(IFWL_Widget* pWidget);
@@ -813,36 +815,36 @@
   CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget);
   CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget);
   CFX_RectF GetAnchor();
-  CFWL_CoreToopTipDP();
+  CFWL_CoreToolTipDP();
 
   CFX_WideString m_wsCaption;
   int32_t m_nInitDelayTime;
   int32_t m_nAutoPopDelayTime;
   CFX_RectF m_fAnchor;
 };
-CFWL_CoreToopTipDP::CFWL_CoreToopTipDP() {
+CFWL_CoreToolTipDP::CFWL_CoreToolTipDP() {
   m_nInitDelayTime = 500;
   m_nAutoPopDelayTime = 50000;
   m_fAnchor.Set(0.0, 0.0, 0.0, 0.0);
 }
-FWL_ERR CFWL_CoreToopTipDP::GetCaption(IFWL_Widget* pWidget,
+FWL_ERR CFWL_CoreToolTipDP::GetCaption(IFWL_Widget* pWidget,
                                        CFX_WideString& wsCaption) {
   wsCaption = m_wsCaption;
   return FWL_ERR_Succeeded;
 }
-int32_t CFWL_CoreToopTipDP::GetInitialDelay(IFWL_Widget* pWidget) {
+int32_t CFWL_CoreToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) {
   return m_nInitDelayTime;
 }
-int32_t CFWL_CoreToopTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) {
+int32_t CFWL_CoreToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) {
   return m_nAutoPopDelayTime;
 }
-CFX_DIBitmap* CFWL_CoreToopTipDP::GetToolTipIcon(IFWL_Widget* pWidget) {
+CFX_DIBitmap* CFWL_CoreToolTipDP::GetToolTipIcon(IFWL_Widget* pWidget) {
   return NULL;
 }
-CFX_SizeF CFWL_CoreToopTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) {
+CFX_SizeF CFWL_CoreToolTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) {
   return CFX_SizeF();
 }
-CFX_RectF CFWL_CoreToopTipDP::GetAnchor() {
+CFX_RectF CFWL_CoreToolTipDP::GetAnchor() {
   return m_fAnchor;
 }
 CFWL_EventTarget::~CFWL_EventTarget() {
@@ -930,7 +932,7 @@
 
 CFWL_ToolTipContainer::CFWL_ToolTipContainer()
     : pCurTarget(NULL), m_pToolTipImp(NULL) {
-  m_ToolTipDp = new CFWL_CoreToopTipDP;
+  m_ToolTipDp = new CFWL_CoreToolTipDP;
   m_ToolTipDp->m_nInitDelayTime = 0;
   m_ToolTipDp->m_nAutoPopDelayTime = 2000;
 }
diff --git a/xfa/fwl/core/fwl_noteimp.h b/xfa/fwl/core/fwl_noteimp.h
index e0f17bb..7554082 100644
--- a/xfa/fwl/core/fwl_noteimp.h
+++ b/xfa/fwl/core/fwl_noteimp.h
@@ -7,14 +7,24 @@
 #ifndef XFA_FWL_CORE_FWL_NOTEIMP_H_
 #define XFA_FWL_CORE_FWL_NOTEIMP_H_
 
-#include "xfa/include/fwl/core/fwl_note.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
+#include "xfa/fwl/core/ifwl_noteloop.h"
+#include "xfa/fxgraphics/include/cfx_graphics.h"
 
-class CFWL_WidgetImp;
+class CFWL_CoreToolTipDP;
+class CFWL_MsgActivate;
+class CFWL_MsgDeactivate;
+class CFWL_MsgDropFiles;
+class CFWL_MsgKey;
+class CFWL_MsgKillFocus;
+class CFWL_MsgMouse;
+class CFWL_MsgMouseWheel;
+class CFWL_MsgSetFocus;
+class CFWL_MsgSize;
+class CFWL_MsgWindowMove;
 class CFWL_ToolTipImp;
-class CFWL_CoreToopTipDP;
-class CFWL_NoteDriver;
-class CFWL_EventTarget;
-class CFWL_ToolTipContainer;
+class CFWL_WidgetImp;
+class IFWL_ToolTipTarget;
 
 class CFWL_NoteLoop : public IFWL_NoteLoop {
  public:
@@ -37,6 +47,7 @@
   CFWL_WidgetImp* m_pForm;
   FX_BOOL m_bContinueModal;
 };
+
 class CFWL_NoteDriver : public IFWL_NoteDriver {
  public:
   CFWL_NoteDriver();
@@ -105,7 +116,9 @@
   FWLMessageHookCallback m_hook;
   void* m_hookInfo;
 };
+
 typedef CFX_MapPtrTemplate<void*, FX_DWORD> CFWL_EventSource;
+
 class CFWL_EventTarget {
  public:
   CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, IFWL_Widget* pListener)
@@ -124,6 +137,7 @@
   CFWL_NoteDriver* m_pNoteDriver;
   FX_BOOL m_bInvalid;
 };
+
 class CFWL_ToolTipContainer {
  public:
   static CFWL_ToolTipContainer* getInstance();
@@ -147,7 +161,7 @@
 
   IFWL_ToolTipTarget* pCurTarget;
   CFWL_ToolTipImp* m_pToolTipImp;
-  CFWL_CoreToopTipDP* m_ToolTipDp;
+  CFWL_CoreToolTipDP* m_ToolTipDp;
   CFX_PtrArray m_arrWidget;
 
  private:
diff --git a/xfa/fwl/core/fwl_panelimp.cpp b/xfa/fwl/core/fwl_panelimp.cpp
index e244133..3d1bf9a 100644
--- a/xfa/fwl/core/fwl_panelimp.cpp
+++ b/xfa/fwl/core/fwl_panelimp.cpp
@@ -6,13 +6,16 @@
 
 #include "xfa/fwl/core/fwl_panelimp.h"
 
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/core/fwl_content.h"
-#include "xfa/include/fwl/core/fwl_grid.h"
-#include "xfa/include/fwl/core/fwl_panel.h"
+#include "xfa/fwl/core/ifwl_content.h"
+#include "xfa/fwl/core/ifwl_custompanel.h"
+#include "xfa/fwl/core/ifwl_grid.h"
+#include "xfa/fwl/core/ifwl_panel.h"
+#include "xfa/fwl/core/ifwl_proxy.h"
 
 // static
 IFWL_Panel* IFWL_Panel::Create(CFWL_WidgetImpProperties& properties,
diff --git a/xfa/fwl/core/fwl_sdadapterimp.cpp b/xfa/fwl/core/fwl_sdadapterimp.cpp
index 550c4cc..1d69def 100644
--- a/xfa/fwl/core/fwl_sdadapterimp.cpp
+++ b/xfa/fwl/core/fwl_sdadapterimp.cpp
@@ -4,16 +4,16 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h"
+#include "xfa/fwl/core/fwl_sdadapterimp.h"
 
 #include "core/fxcrt/include/fx_system.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
-#include "xfa/include/fwl/core/fwl_app.h"
+#include "xfa/fwl/core/ifwl_adapterthreadmgr.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_app.h"
 
 CFWL_SDAdapterWidgetMgr::CFWL_SDAdapterWidgetMgr() {}
 CFWL_SDAdapterWidgetMgr::~CFWL_SDAdapterWidgetMgr() {}
diff --git a/xfa/include/fwl/adapter/fwl_sdadapterimp.h b/xfa/fwl/core/fwl_sdadapterimp.h
similarity index 92%
rename from xfa/include/fwl/adapter/fwl_sdadapterimp.h
rename to xfa/fwl/core/fwl_sdadapterimp.h
index 52cbb99..0e8bd7f 100644
--- a/xfa/include/fwl/adapter/fwl_sdadapterimp.h
+++ b/xfa/fwl/core/fwl_sdadapterimp.h
@@ -4,11 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_ADAPTER_FWL_SDADAPTERIMP_H_
-#define XFA_INCLUDE_FWL_ADAPTER_FWL_SDADAPTERIMP_H_
+#ifndef XFA_FWL_CORE_FWL_SDADAPTERIMP_H_
+#define XFA_FWL_CORE_FWL_SDADAPTERIMP_H_
 
-#include "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_adapterthreadmgr.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
 
 class CFWL_SDAdapterWidgetMgr : public IFWL_AdapterWidgetMgr {
  public:
@@ -86,4 +86,4 @@
   virtual IFWL_Thread* GetCurrentThread();
 };
 
-#endif  // XFA_INCLUDE_FWL_ADAPTER_FWL_SDADAPTERIMP_H_
+#endif  // XFA_FWL_CORE_FWL_SDADAPTERIMP_H_
diff --git a/xfa/fwl/core/fwl_targetimp.h b/xfa/fwl/core/fwl_targetimp.h
index 616c1ac..69946fb 100644
--- a/xfa/fwl/core/fwl_targetimp.h
+++ b/xfa/fwl/core/fwl_targetimp.h
@@ -8,7 +8,7 @@
 #define XFA_FWL_CORE_FWL_TARGETIMP_H_
 
 #include "core/fxcrt/include/fx_basic.h"
-#include "xfa/include/fwl/core/fwl_target.h"
+#include "xfa/fwl/core/ifwl_target.h"
 
 class CFWL_TargetImp {
  public:
diff --git a/xfa/fwl/core/fwl_threadimp.cpp b/xfa/fwl/core/fwl_threadimp.cpp
index e0ec0b0..66c57eb 100644
--- a/xfa/fwl/core/fwl_threadimp.cpp
+++ b/xfa/fwl/core/fwl_threadimp.cpp
@@ -9,6 +9,7 @@
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
+#include "xfa/fwl/core/ifwl_notethread.h"
 
 void IFWL_Thread::Release() {
   delete m_pImpl;
diff --git a/xfa/fwl/core/fwl_threadimp.h b/xfa/fwl/core/fwl_threadimp.h
index 591849b..3806f3c 100644
--- a/xfa/fwl/core/fwl_threadimp.h
+++ b/xfa/fwl/core/fwl_threadimp.h
@@ -7,10 +7,11 @@
 #ifndef XFA_FWL_CORE_FWL_THREADIMP_H_
 #define XFA_FWL_CORE_FWL_THREADIMP_H_
 
-#include "xfa/include/fwl/core/fwl_thread.h"  // For FWL_HTHREAD.
+#include "xfa/fwl/core/ifwl_thread.h"
 
 class CFWL_NoteDriver;
 class IFWL_NoteDriver;
+class IFWL_NoteThread;
 
 class CFWL_ThreadImp {
  public:
diff --git a/xfa/fwl/core/fwl_timerimp.cpp b/xfa/fwl/core/fwl_timerimp.cpp
index d9741f6..b9cb478 100644
--- a/xfa/fwl/core/fwl_timerimp.cpp
+++ b/xfa/fwl/core/fwl_timerimp.cpp
@@ -7,10 +7,10 @@
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_threadimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapternative.h"
-#include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
+#include "xfa/fwl/core/ifwl_adapternative.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_timer.h"
+#include "xfa/fwl/core/include/ifwl_adaptertimermgr.h"
 
 FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer,
                           FX_DWORD dwElapse,
diff --git a/xfa/include/fwl/core/fwl_widgetdef.h b/xfa/fwl/core/fwl_widgetdef.h
similarity index 97%
rename from xfa/include/fwl/core/fwl_widgetdef.h
rename to xfa/fwl/core/fwl_widgetdef.h
index 548fe92..849ba6f 100644
--- a/xfa/include/fwl/core/fwl_widgetdef.h
+++ b/xfa/fwl/core/fwl_widgetdef.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_WIDGETDEF_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_WIDGETDEF_H_
+#ifndef XFA_FWL_CORE_FWL_WIDGETDEF_H_
+#define XFA_FWL_CORE_FWL_WIDGETDEF_H_
 
 #define FWL_WGTSTYLE_OverLapper (0L << 0)
 #define FWL_WGTSTYLE_Popup (1L << 0)
@@ -246,4 +246,4 @@
 #define FWL_VKEYSTATE_Toggled 0x0001
 #define FWL_VKEYSTATE_Down 0x0100
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_WIDGETDEF_H_
+#endif  // XFA_FWL_CORE_FWL_WIDGETDEF_H_
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index 1842968..fdc1927 100644
--- a/xfa/fwl/core/fwl_widgetimp.cpp
+++ b/xfa/fwl/core/fwl_widgetimp.cpp
@@ -9,21 +9,29 @@
 #include <algorithm>
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_combobox.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapternative.h"
-#include "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
-#include "xfa/include/fwl/basewidget/fwl_combobox.h"
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
-#include "xfa/include/fwl/basewidget/fwl_menu.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_content.h"
-#include "xfa/include/fwl/core/fwl_form.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_adapternative.h"
+#include "xfa/fwl/core/ifwl_adapterthreadmgr.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_content.h"
+#include "xfa/fwl/core/ifwl_custom.h"
+#include "xfa/fwl/core/ifwl_form.h"
+#include "xfa/fwl/core/ifwl_proxy.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+
+#define FWL_CLASSHASH_Menu 3957949655
+#define FWL_STYLEEXT_MNU_Vert (1L << 0)
 
 FWL_ERR IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
   return static_cast<CFWL_WidgetImp*>(GetImpl())
diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h
index 0aa7beb..718268f 100644
--- a/xfa/fwl/core/fwl_widgetimp.h
+++ b/xfa/fwl/core/fwl_widgetimp.h
@@ -7,16 +7,20 @@
 #ifndef XFA_FWL_CORE_FWL_WIDGETIMP_H_
 #define XFA_FWL_CORE_FWL_WIDGETIMP_H_
 
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/ifwl_widgetdelegate.h"
 
+class CFWL_MsgKey;
 class CFWL_NoteThreadImp;
 class CFWL_WidgetImpProperties;
 class CFWL_WidgetMgr;
 class IFWL_DataProvider;
+class IFWL_NoteThread;
 class IFWL_ThemeProvider;
 class IFWL_Widget;
-class IFWL_WidgetDelegate;
 
 class CFWL_WidgetImp : public CFWL_TargetImp {
  public:
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp
index ab507c2..9a9b2d6 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp
@@ -6,15 +6,16 @@
 
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
 
+#include "xfa/fwl/core/cfwl_message.h"
 #include "xfa/fwl/core/fwl_appimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_threadimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
-#include "xfa/include/fwl/adapter/fwl_adapternative.h"
-#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_form.h"
+#include "xfa/fwl/core/ifwl_adapternative.h"
+#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_form.h"
 
 FX_BOOL FWL_UseOffscreen(IFWL_Widget* pWidget) {
 #if (_FX_OS_ == _FX_MACOSX_)
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.h b/xfa/fwl/core/fwl_widgetmgrimp.h
index c29045d..76e4425 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.h
+++ b/xfa/fwl/core/fwl_widgetmgrimp.h
@@ -7,7 +7,9 @@
 #ifndef XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_
 #define XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_
 
-#include "xfa/include/fwl/core/fwl_widgetmgr.h"
+#include "xfa/fwl/core/ifwl_widgetmgr.h"
+#include "xfa/fwl/core/ifwl_widgetmgrdelegate.h"
+#include "xfa/fxgraphics/include/cfx_graphics.h"
 
 class IFWL_Widget;
 class IFWL_AdapterWidgetMgr;
diff --git a/xfa/include/fwl/adapter/fwl_adapternative.h b/xfa/fwl/core/ifwl_adapternative.h
similarity index 79%
rename from xfa/include/fwl/adapter/fwl_adapternative.h
rename to xfa/fwl/core/ifwl_adapternative.h
index 83e6fd9..6c6d801 100644
--- a/xfa/include/fwl/adapter/fwl_adapternative.h
+++ b/xfa/fwl/core/ifwl_adapternative.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERNATIVE_H_
-#define XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERNATIVE_H_
+#ifndef XFA_FWL_CORE_IFWL_ADAPTERNATIVE_H_
+#define XFA_FWL_CORE_IFWL_ADAPTERNATIVE_H_
 
 class IFWL_WidgetMgrDelegate;
 class IFWL_AdapterWidgetMgr;
@@ -21,4 +21,4 @@
   virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0;
 };
 
-#endif  // XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERNATIVE_H_
+#endif  // XFA_FWL_CORE_IFWL_ADAPTERNATIVE_H_
diff --git a/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h b/xfa/fwl/core/ifwl_adapterthreadmgr.h
similarity index 75%
rename from xfa/include/fwl/adapter/fwl_adapterthreadmgr.h
rename to xfa/fwl/core/ifwl_adapterthreadmgr.h
index dbd1d72..821ced3 100644
--- a/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h
+++ b/xfa/fwl/core/ifwl_adapterthreadmgr.h
@@ -4,12 +4,12 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERTHREADMGR_H_
-#define XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERTHREADMGR_H_
+#ifndef XFA_FWL_CORE_IFWL_ADAPTERTHREADMGR_H_
+#define XFA_FWL_CORE_IFWL_ADAPTERTHREADMGR_H_
 
 #include "core/fxcrt/include/fx_system.h"
-#include "xfa/include/fwl/core/fwl_error.h"
-#include "xfa/include/fwl/core/fwl_thread.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_thread.h"
 
 class IFWL_AdapterThreadMgr {
  public:
@@ -23,4 +23,5 @@
   virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode) = 0;
   virtual IFWL_Thread* GetCurrentThread() = 0;
 };
-#endif  // XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERTHREADMGR_H_
+
+#endif  // XFA_FWL_CORE_IFWL_ADAPTERTHREADMGR_H_
diff --git a/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h b/xfa/fwl/core/ifwl_adapterwidgetmgr.h
similarity index 94%
rename from xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h
rename to xfa/fwl/core/ifwl_adapterwidgetmgr.h
index f5d3c05..80dbfd9 100644
--- a/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h
+++ b/xfa/fwl/core/ifwl_adapterwidgetmgr.h
@@ -4,12 +4,12 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERWIDGETMGR_H_
-#define XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERWIDGETMGR_H_
+#ifndef XFA_FWL_CORE_IFWL_ADAPTERWIDGETMGR_H_
+#define XFA_FWL_CORE_IFWL_ADAPTERWIDGETMGR_H_
 
 #include "core/fxcrt/include/fx_coordinates.h"
 #include "core/fxcrt/include/fx_system.h"
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 class IFWL_Widget;
 class IFWL_Menu;
@@ -78,4 +78,4 @@
                               CFX_RectF& rtPopup) = 0;
 };
 
-#endif  // XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERWIDGETMGR_H_
+#endif  // XFA_FWL_CORE_IFWL_ADAPTERWIDGETMGR_H_
diff --git a/xfa/include/fwl/core/fwl_app.h b/xfa/fwl/core/ifwl_app.h
similarity index 87%
rename from xfa/include/fwl/core/fwl_app.h
rename to xfa/fwl/core/ifwl_app.h
index 7904ee8..ed1fd67 100644
--- a/xfa/include/fwl/core/fwl_app.h
+++ b/xfa/fwl/core/ifwl_app.h
@@ -4,11 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_APP_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_APP_H_
+#ifndef XFA_FWL_CORE_IFWL_APP_H_
+#define XFA_FWL_CORE_IFWL_APP_H_
 
 #include "core/fxcrt/include/fx_string.h"
-#include "xfa/include/fwl/core/fwl_thread.h"
+#include "xfa/fwl/core/ifwl_notethread.h"
 
 class IFWL_AdapterNative;
 class IFWL_Widget;
@@ -31,6 +31,7 @@
  private:
   IFWL_App() {}
 };
+
 IFWL_App* FWL_GetApp();
 void FWL_SetApp(IFWL_App* pApp);
 IFWL_AdapterNative* FWL_GetAdapterNative();
@@ -41,4 +42,4 @@
 FWL_ERR FWL_SetFullScreen(IFWL_Widget* pWidget, FX_BOOL bFullScreen);
 FX_BOOL FWL_AppIsActived();
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_APP_H_
+#endif  // XFA_FWL_CORE_IFWL_APP_H_
diff --git a/xfa/include/fwl/core/fwl_content.h b/xfa/fwl/core/ifwl_content.h
similarity index 76%
rename from xfa/include/fwl/core/fwl_content.h
rename to xfa/fwl/core/ifwl_content.h
index 10d6c1e..76292a6 100644
--- a/xfa/include/fwl/core/fwl_content.h
+++ b/xfa/fwl/core/ifwl_content.h
@@ -4,10 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_CONTENT_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_CONTENT_H_
+#ifndef XFA_FWL_CORE_IFWL_CONTENT_H_
+#define XFA_FWL_CORE_IFWL_CONTENT_H_
 
 #include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 class IFWL_Content : public IFWL_Widget {
  public:
@@ -24,4 +27,4 @@
   IFWL_Content();
 };
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_CONTENT_H_
+#endif  // XFA_FWL_CORE_IFWL_CONTENT_H_
diff --git a/xfa/fwl/core/ifwl_custom.h b/xfa/fwl/core/ifwl_custom.h
new file mode 100644
index 0000000..d7f1b40
--- /dev/null
+++ b/xfa/fwl/core/ifwl_custom.h
@@ -0,0 +1,26 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_CUSTOM_H_
+#define XFA_FWL_CORE_IFWL_CUSTOM_H_
+
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+
+class IFWL_Proxy;
+
+class IFWL_Custom : public IFWL_Widget {
+ public:
+  static IFWL_Custom* Create(const CFWL_WidgetImpProperties& properties,
+                             IFWL_Widget* pOuter);
+
+  FWL_ERR SetProxy(IFWL_Proxy* pProxy);
+
+ protected:
+  IFWL_Custom();
+};
+
+#endif  // XFA_FWL_CORE_IFWL_CUSTOM_H_
diff --git a/xfa/fwl/core/ifwl_custompanel.h b/xfa/fwl/core/ifwl_custompanel.h
new file mode 100644
index 0000000..3491227
--- /dev/null
+++ b/xfa/fwl/core/ifwl_custompanel.h
@@ -0,0 +1,28 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_CUSTOMPANEL_H_
+#define XFA_FWL_CORE_IFWL_CUSTOMPANEL_H_
+
+#include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+
+class IFWL_Proxy;
+
+class IFWL_CustomPanel : public IFWL_Widget {
+ public:
+  static IFWL_CustomPanel* Create(CFWL_WidgetImpProperties& properties,
+                                  IFWL_Widget* pOuter);
+
+  IFWL_Content* GetContent();
+  FWL_ERR SetContent(IFWL_Content* pContent);
+  FWL_ERR SetProxy(IFWL_Proxy* pProxy);
+
+ protected:
+  IFWL_CustomPanel();
+};
+
+#endif  // XFA_FWL_CORE_IFWL_CUSTOMPANEL_H_
diff --git a/xfa/fwl/core/ifwl_dataprovider.h b/xfa/fwl/core/ifwl_dataprovider.h
new file mode 100644
index 0000000..271edb7
--- /dev/null
+++ b/xfa/fwl/core/ifwl_dataprovider.h
@@ -0,0 +1,22 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_DATAPROVIDER_H_
+#define XFA_FWL_CORE_IFWL_DATAPROVIDER_H_
+
+#include "core/fxcrt/include/fx_string.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+class IFWL_Widget;
+
+class IFWL_DataProvider {
+ public:
+  virtual ~IFWL_DataProvider() {}
+  virtual FWL_ERR GetCaption(IFWL_Widget* pWidget,
+                             CFX_WideString& wsCaption) = 0;
+};
+
+#endif  // XFA_FWL_CORE_IFWL_DATAPROVIDER_H_
diff --git a/xfa/include/fwl/core/fwl_form.h b/xfa/fwl/core/ifwl_form.h
similarity index 87%
rename from xfa/include/fwl/core/fwl_form.h
rename to xfa/fwl/core/ifwl_form.h
index 1fc3995..6639169 100644
--- a/xfa/include/fwl/core/fwl_form.h
+++ b/xfa/fwl/core/ifwl_form.h
@@ -4,13 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_FORM_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_FORM_H_
+#ifndef XFA_FWL_CORE_IFWL_FORM_H_
+#define XFA_FWL_CORE_IFWL_FORM_H_
 
-#include "xfa/include/fwl/core/fwl_panel.h"
-
-class IFWL_Widget;
-class IFWL_Form;
+#include "xfa/fwl/core/ifwl_panel.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
 
 #define FWL_CLASS_Form L"FWL_FORM"
 #define FWL_CLASSHASH_Form 881567292
@@ -23,9 +23,11 @@
 #define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3)
 #define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1)
 #define FWL_STYLEEXT_FRM_Max (3)
+
 #if (_FX_OS_ == _FX_MACOSX_)
 #define FWL_UseMacSystemBorder
 #endif
+
 #define FWL_WGTCAPACITY_FRM_CYCaption (FWL_WGTCAPACITY_MAX + 1)
 #define FWL_WGTCAPACITY_FRM_CYNarrowCaption (FWL_WGTCAPACITY_MAX + 2)
 #define FWL_WGTCAPACITY_FRM_BigIcon (FWL_WGTCAPACITY_MAX + 3)
@@ -46,16 +48,13 @@
 #define FWL_PARTSTATE_FRM_Inactive 4
 #define FWL_PARTSTATE_FRM_Disabled 5
 
-class IFWL_FormDP : public IFWL_DataProvider {
- public:
-  virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0;
-};
 enum FWL_FORMSIZE {
   FWL_FORMSIZE_Manual = 0,
   FWL_FORMSIZE_Width,
   FWL_FORMSIZE_Height,
   FWL_FORMSIZE_All,
 };
+
 enum FWL_COMMANDID {
   FWL_COMMANDID_Close = 0,
   FWL_COMMANDID_Ok,
@@ -67,6 +66,17 @@
   FWL_COMMANDID_No,
 };
 
+class CFX_DIBitmap;
+class CFX_WideString;
+class CFX_Path;
+class IFWL_Widget;
+class IFWL_Form;
+
+class IFWL_FormDP : public IFWL_DataProvider {
+ public:
+  virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0;
+};
+
 class IFWL_Form : public IFWL_Panel {
  public:
   static IFWL_Form* CreateFormProxy(CFWL_WidgetImpProperties& properties,
@@ -84,4 +94,4 @@
   IFWL_Form();
 };
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_FORM_H_
+#endif  // XFA_FWL_CORE_IFWL_FORM_H_
diff --git a/xfa/include/fwl/core/fwl_grid.h b/xfa/fwl/core/ifwl_grid.h
similarity index 94%
rename from xfa/include/fwl/core/fwl_grid.h
rename to xfa/fwl/core/ifwl_grid.h
index c5b443b..f1ef57f 100644
--- a/xfa/include/fwl/core/fwl_grid.h
+++ b/xfa/fwl/core/ifwl_grid.h
@@ -4,10 +4,10 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_GRID_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_GRID_H_
+#ifndef XFA_FWL_CORE_IFWL_GRID_H_
+#define XFA_FWL_CORE_IFWL_GRID_H_
 
-#include "xfa/include/fwl/core/fwl_content.h"
+#include "xfa/fwl/core/ifwl_content.h"
 
 class IFWL_Widget;
 
@@ -19,18 +19,21 @@
   FX_FLOAT fWidth;
   FX_FLOAT fHeight;
 };
+
 enum FWL_GRIDUNIT {
   FWL_GRIDUNIT_Auto = 0,
   FWL_GRIDUNIT_Fixed,
   FWL_GRIDUNIT_Scaled,
   FWL_GRIDUNIT_Infinity,
 };
+
 enum FWL_GRIDMARGIN {
   FWL_GRIDMARGIN_Left = 0,
   FWL_GRIDMARGIN_Top,
   FWL_GRIDMARGIN_Right,
   FWL_GRIDMARGIN_Bottom,
 };
+
 enum FWL_GRIDSIZE {
   FWL_GRIDSIZE_Width = 0,
   FWL_GRIDSIZE_Height,
@@ -41,6 +44,7 @@
 };
 
 typedef struct FWL_HGRIDCOLROW_ { void* pData; } * FWL_HGRIDCOLROW;
+
 class IFWL_Grid : public IFWL_Content {
  public:
   static IFWL_Grid* Create(const CFWL_WidgetImpProperties& properties);
@@ -86,4 +90,4 @@
   IFWL_Grid();
 };
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_GRID_H_
+#endif  // XFA_FWL_CORE_IFWL_GRID_H_
diff --git a/xfa/fwl/core/ifwl_notedriver.h b/xfa/fwl/core/ifwl_notedriver.h
new file mode 100644
index 0000000..cdedd6f
--- /dev/null
+++ b/xfa/fwl/core/ifwl_notedriver.h
@@ -0,0 +1,58 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_NOTEDRIVER_H_
+#define XFA_FWL_CORE_IFWL_NOTEDRIVER_H_
+
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+#define FWL_KEYFLAG_Ctrl (1 << 0)
+#define FWL_KEYFLAG_Alt (1 << 1)
+#define FWL_KEYFLAG_Shift (1 << 2)
+#define FWL_KEYFLAG_Command (1 << 3)
+#define FWL_KEYFLAG_LButton (1 << 4)
+#define FWL_KEYFLAG_RButton (1 << 5)
+#define FWL_KEYFLAG_MButton (1 << 6)
+
+class CFWL_Message;
+class CFWL_Note;
+class IFWL_NoteLoop;
+class IFWL_NoteThread;
+class IFWL_Widget;
+
+class IFWL_NoteDriver {
+ public:
+  virtual ~IFWL_NoteDriver() {}
+
+  virtual FX_BOOL SendNote(CFWL_Note* pNote) = 0;
+  virtual FX_BOOL PostMessage(CFWL_Message* pMessage) = 0;
+  virtual FWL_ERR RegisterEventTarget(
+      IFWL_Widget* pListener,
+      IFWL_Widget* pEventSource = NULL,
+      FX_DWORD dwFilter = FWL_EVENT_ALL_MASK) = 0;
+  virtual FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) = 0;
+  virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0;
+  virtual int32_t GetQueueMaxSize() const = 0;
+  virtual FWL_ERR SetQueueMaxSize(const int32_t size) = 0;
+  virtual IFWL_NoteThread* GetOwnerThread() const = 0;
+  virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) = 0;
+  virtual IFWL_NoteLoop* PopNoteLoop() = 0;
+  virtual IFWL_Widget* GetFocus() = 0;
+  virtual FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) = 0;
+  virtual void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) = 0;
+  virtual FWL_ERR Run() = 0;
+};
+
+IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread);
+
+typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info);
+FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver,
+                    FWLMessageHookCallback callback,
+                    void* info);
+
+#endif  // XFA_FWL_CORE_IFWL_NOTEDRIVER_H_
diff --git a/xfa/fwl/core/ifwl_noteloop.h b/xfa/fwl/core/ifwl_noteloop.h
new file mode 100644
index 0000000..a56d880
--- /dev/null
+++ b/xfa/fwl/core/ifwl_noteloop.h
@@ -0,0 +1,22 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_NOTELOOP_H_
+#define XFA_FWL_CORE_IFWL_NOTELOOP_H_
+
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+class CFWL_Message;
+
+class IFWL_NoteLoop {
+ public:
+  virtual ~IFWL_NoteLoop() {}
+  virtual FX_BOOL PreProcessMessage(CFWL_Message* pMessage) = 0;
+  virtual FWL_ERR Idle(int32_t count) = 0;
+};
+
+#endif  // XFA_FWL_CORE_IFWL_NOTELOOP_H_
diff --git a/xfa/fwl/core/ifwl_notethread.h b/xfa/fwl/core/ifwl_notethread.h
new file mode 100644
index 0000000..30a29b5
--- /dev/null
+++ b/xfa/fwl/core/ifwl_notethread.h
@@ -0,0 +1,19 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_NOTETHREAD_H_
+#define XFA_FWL_CORE_IFWL_NOTETHREAD_H_
+
+#include "xfa/fwl/core/ifwl_thread.h"
+
+class IFWL_NoteDriver;
+
+class IFWL_NoteThread : public IFWL_Thread {
+ public:
+  IFWL_NoteDriver* GetNoteDriver();
+};
+
+#endif  // XFA_FWL_CORE_IFWL_NOTETHREAD_H_
diff --git a/xfa/fwl/core/ifwl_panel.h b/xfa/fwl/core/ifwl_panel.h
new file mode 100644
index 0000000..ec9b02d
--- /dev/null
+++ b/xfa/fwl/core/ifwl_panel.h
@@ -0,0 +1,30 @@
+// 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
+
+#ifndef XFA_FWL_CORE_IFWL_PANEL_H_
+#define XFA_FWL_CORE_IFWL_PANEL_H_
+
+#include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/ifwl_widget.h"
+
+class IFWL_Content;
+
+#define FWL_CLASS_Panel L"FWL_Panel"
+#define FWL_CLASSHASH_Panel 881567292
+
+class IFWL_Panel : public IFWL_Widget {
+ public:
+  static IFWL_Panel* Create(CFWL_WidgetImpProperties& properties,
+                            IFWL_Widget* pOuter);
+
+  IFWL_Content* GetContent();
+  FWL_ERR SetContent(IFWL_Content* pContent);
+
+ protected:
+  IFWL_Panel();
+};
+
+#endif  // XFA_FWL_CORE_IFWL_PANEL_H_
diff --git a/xfa/fwl/core/ifwl_proxy.h b/xfa/fwl/core/ifwl_proxy.h
new file mode 100644
index 0000000..80393c5
--- /dev/null
+++ b/xfa/fwl/core/ifwl_proxy.h
@@ -0,0 +1,21 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_PROXY_H_
+#define XFA_FWL_CORE_IFWL_PROXY_H_
+
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+class IFWL_Proxy {
+ public:
+  virtual ~IFWL_Proxy() {}
+  virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) = 0;
+  virtual FWL_ERR Update() = 0;
+};
+
+#endif  // XFA_FWL_CORE_IFWL_PROXY_H_
diff --git a/xfa/include/fwl/core/fwl_target.h b/xfa/fwl/core/ifwl_target.h
similarity index 90%
rename from xfa/include/fwl/core/fwl_target.h
rename to xfa/fwl/core/ifwl_target.h
index 9f010e9..fd6410e 100644
--- a/xfa/include/fwl/core/fwl_target.h
+++ b/xfa/fwl/core/ifwl_target.h
@@ -4,11 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_TARGET_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_TARGET_H_
+#ifndef XFA_FWL_CORE_IFWL_TARGET_H_
+#define XFA_FWL_CORE_IFWL_TARGET_H_
 
 #include "core/fxcrt/include/fx_basic.h"
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 // FWL contains three parallel inheritance hierarchies, which reference each
 // other via pointers as follows:
@@ -49,4 +49,4 @@
   CFWL_TargetImp* m_pImpl;
 };
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_TARGET_H_
+#endif  // XFA_FWL_CORE_IFWL_TARGET_H_
diff --git a/xfa/include/fwl/core/fwl_theme.h b/xfa/fwl/core/ifwl_themeprovider.h
similarity index 66%
rename from xfa/include/fwl/core/fwl_theme.h
rename to xfa/fwl/core/ifwl_themeprovider.h
index 7dd443e..2bdacd5 100644
--- a/xfa/include/fwl/core/fwl_theme.h
+++ b/xfa/fwl/core/ifwl_themeprovider.h
@@ -4,17 +4,12 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_THEME_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_THEME_H_
+#ifndef XFA_FWL_CORE_IFWL_THEMEPROVIDER_H_
+#define XFA_FWL_CORE_IFWL_THEMEPROVIDER_H_
 
 #include "core/fxcrt/include/fx_coordinates.h"
 #include "core/fxcrt/include/fx_system.h"
-#include "xfa/include/fwl/core/fwl_error.h"
-
-class IFWL_Widget;
-class CFX_Graphics;
-class CFX_DIBitmap;
-class CFX_Path;
+#include "xfa/fwl/core/fwl_error.h"
 
 #define FWL_WGTCAPACITY_CXBorder 1
 #define FWL_WGTCAPACITY_CYBorder 2
@@ -31,36 +26,11 @@
 #define FWL_WGTCAPACITY_SpaceAboveBelow 13
 #define FWL_WGTCAPACITY_MAX 65535
 
-class CFWL_ThemePart {
- public:
-  CFWL_ThemePart()
-      : m_pWidget(NULL), m_iPart(0), m_dwStates(0), m_dwData(0), m_pData(NULL) {
-    m_rtPart.Reset();
-    m_matrix.SetIdentity();
-  }
-  CFX_Matrix m_matrix;
-  CFX_RectF m_rtPart;
-  IFWL_Widget* m_pWidget;
-  int32_t m_iPart;
-  FX_DWORD m_dwStates;
-  FX_DWORD m_dwData;
-  void* m_pData;
-};
-class CFWL_ThemeBackground : public CFWL_ThemePart {
- public:
-  CFWL_ThemeBackground() : m_pGraphics(NULL), m_pImage(NULL), m_pPath(NULL) {}
-  CFX_Graphics* m_pGraphics;
-  CFX_DIBitmap* m_pImage;
-  CFX_Path* m_pPath;
-};
-class CFWL_ThemeText : public CFWL_ThemePart {
- public:
-  CFWL_ThemeText() : m_pGraphics(NULL) {}
-  CFX_WideString m_wsText;
-  FX_DWORD m_dwTTOStyles;
-  int32_t m_iTTOAlign;
-  CFX_Graphics* m_pGraphics;
-};
+class CFWL_ThemeBackground;
+class CFWL_ThemePart;
+class CFWL_ThemeText;
+class IFWL_Widget;
+
 class IFWL_ThemeProvider {
  public:
   virtual ~IFWL_ThemeProvider() {}
@@ -85,4 +55,4 @@
   virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) = 0;
 };
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_THEME_H_
+#endif  // XFA_FWL_CORE_IFWL_THEMEPROVIDER_H_
diff --git a/xfa/include/fwl/core/fwl_thread.h b/xfa/fwl/core/ifwl_thread.h
similarity index 84%
rename from xfa/include/fwl/core/fwl_thread.h
rename to xfa/fwl/core/ifwl_thread.h
index 5b41c9c..c6f0c44 100644
--- a/xfa/include/fwl/core/fwl_thread.h
+++ b/xfa/fwl/core/ifwl_thread.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_THREAD_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_THREAD_H_
+#ifndef XFA_FWL_CORE_IFWL_THREAD_H_
+#define XFA_FWL_CORE_IFWL_THREAD_H_
 
 // The FWL thread/app code contains three parallel inheritance hierarchies,
 // which reference each other via pointers as follows:
@@ -22,7 +22,7 @@
 //      CFWL_App --------------> IFWL_App                CFWL_AppImp
 //
 
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 class CFWL_ThreadImp;
 class IFWL_NoteDriver;
@@ -45,9 +45,4 @@
   CFWL_ThreadImp* m_pImpl;
 };
 
-class IFWL_NoteThread : public IFWL_Thread {
- public:
-  IFWL_NoteDriver* GetNoteDriver();
-};
-
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_THREAD_H_
+#endif  // XFA_FWL_CORE_IFWL_THREAD_H_
diff --git a/xfa/include/fwl/core/fwl_timer.h b/xfa/fwl/core/ifwl_timer.h
similarity index 82%
rename from xfa/include/fwl/core/fwl_timer.h
rename to xfa/fwl/core/ifwl_timer.h
index 4e8feb0..42fc84b 100644
--- a/xfa/include/fwl/core/fwl_timer.h
+++ b/xfa/fwl/core/ifwl_timer.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_
+#ifndef XFA_FWL_CORE_IFWL_TIMER_H_
+#define XFA_FWL_CORE_IFWL_TIMER_H_
 
 #include "core/fxcrt/include/fx_system.h"
 
@@ -21,4 +21,4 @@
                           FX_BOOL bImmediately = TRUE);
 int32_t FWL_StopTimer(FWL_HTIMER hTimer);
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_
+#endif  // XFA_FWL_CORE_IFWL_TIMER_H_
diff --git a/xfa/fwl/core/ifwl_tooltiptarget.h b/xfa/fwl/core/ifwl_tooltiptarget.h
new file mode 100644
index 0000000..b0bbe44
--- /dev/null
+++ b/xfa/fwl/core/ifwl_tooltiptarget.h
@@ -0,0 +1,37 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_TOOLTIPTARGET_H_
+#define XFA_FWL_CORE_IFWL_TOOLTIPTARGET_H_
+
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_string.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+class CFX_Graphics;
+class IFWL_Widget;
+
+class IFWL_ToolTipTarget {
+ public:
+  virtual ~IFWL_ToolTipTarget() {}
+  virtual IFWL_Widget* GetWidget() = 0;
+  virtual FX_BOOL IsShowed() = 0;
+  virtual FWL_ERR DrawToolTip(CFX_Graphics* pGraphics,
+                              const CFX_Matrix* pMatrix,
+                              IFWL_Widget* pToolTip) = 0;
+  virtual FX_BOOL UseDefaultTheme() = 0;
+  virtual FWL_ERR GetCaption(CFX_WideString& wsCaption) = 0;
+  virtual FWL_ERR GetToolTipSize(CFX_SizeF& sz) = 0;
+  virtual FWL_ERR GetToolTipPos(CFX_PointF& pt) { return FWL_ERR_Indefinite; }
+};
+
+FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget* pTarget);
+FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget);
+FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime);
+FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime);
+
+#endif  // XFA_FWL_CORE_IFWL_TOOLTIPTARGET_H_
diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h
new file mode 100644
index 0000000..06e4beb
--- /dev/null
+++ b/xfa/fwl/core/ifwl_widget.h
@@ -0,0 +1,69 @@
+// 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
+
+#ifndef XFA_FWL_CORE_IFWL_WIDGET_H_
+#define XFA_FWL_CORE_IFWL_WIDGET_H_
+
+#include "xfa/fwl/core/fwl_error.h"
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "core/fxcrt/include/fx_basic.h"
+#include "xfa/fwl/core/ifwl_target.h"
+
+class CFX_Graphics;
+class IFWL_DataProvider;
+class IFWL_Form;
+class IFWL_NoteThread;
+class IFWL_ThemeProvider;
+class IFWL_WidgetDelegate;
+
+class IFWL_Widget : public IFWL_Target {
+ public:
+  FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
+  FWL_ERR GetGlobalRect(CFX_RectF& rect);
+  FWL_ERR SetWidgetRect(const CFX_RectF& rect);
+  FWL_ERR GetClientRect(CFX_RectF& rect);
+  IFWL_Widget* GetParent();
+  FWL_ERR SetParent(IFWL_Widget* pParent);
+  IFWL_Widget* GetOwner();
+  FWL_ERR SetOwner(IFWL_Widget* pOwner);
+  IFWL_Widget* GetOuter();
+  FX_DWORD GetStyles();
+  FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, FX_DWORD dwStylesRemoved);
+  FX_DWORD GetStylesEx();
+  FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved);
+  FX_DWORD GetStates();
+  FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE);
+  FWL_ERR SetPrivateData(void* module_id,
+                         void* pData,
+                         PD_CALLBACK_FREEDATA callback);
+  void* GetPrivateData(void* module_id);
+  FWL_ERR Update();
+  FWL_ERR LockUpdate();
+  FWL_ERR UnlockUpdate();
+  FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy);
+  FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy);
+  FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt);
+  FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
+  FWL_ERR SetMatrix(const CFX_Matrix& matrix);
+  FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL);
+  IFWL_ThemeProvider* GetThemeProvider();
+  FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
+  FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider);
+  IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate);
+  IFWL_NoteThread* GetOwnerThread() const;
+  CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent);
+};
+
+typedef CFX_MapPtrTemplate<FX_DWORD, FX_DWORD> CFX_MapAccelerators;
+
+FWL_ERR FWL_Accelerator_SetApp(CFX_MapAccelerators* pMapAccel);
+FWL_ERR FWL_Accelerator_SetThread(CFX_MapAccelerators* pMapAccel);
+FWL_ERR FWL_Accelerator_SetForm(IFWL_Form* pFrom,
+                                CFX_MapAccelerators* pMapAccel);
+FWL_ERR FWL_EnabelWidget(IFWL_Widget* widget, FX_BOOL bEnable);
+
+#endif  // XFA_FWL_CORE_IFWL_WIDGET_H_
diff --git a/xfa/fwl/core/ifwl_widgetdelegate.h b/xfa/fwl/core/ifwl_widgetdelegate.h
new file mode 100644
index 0000000..eeca68e
--- /dev/null
+++ b/xfa/fwl/core/ifwl_widgetdelegate.h
@@ -0,0 +1,26 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_WIDGETDELEGATE_H_
+#define XFA_FWL_CORE_IFWL_WIDGETDELEGATE_H_
+
+#include "xfa/fwl/core/fwl_error.h"
+
+class CFWL_Event;
+class CFWL_Message;
+class CFX_Graphics;
+class CFX_Matrix;
+
+class IFWL_WidgetDelegate {
+ public:
+  virtual ~IFWL_WidgetDelegate() {}
+  virtual int32_t OnProcessMessage(CFWL_Message* pMessage) = 0;
+  virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent) = 0;
+  virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
+                               const CFX_Matrix* pMatrix = NULL) = 0;
+};
+
+#endif  // XFA_FWL_CORE_IFWL_WIDGETDELEGATE_H_
diff --git a/xfa/include/fwl/core/fwl_widgetmgr.h b/xfa/fwl/core/ifwl_widgetmgr.h
similarity index 68%
rename from xfa/include/fwl/core/fwl_widgetmgr.h
rename to xfa/fwl/core/ifwl_widgetmgr.h
index 9486af5..5ff11f3 100644
--- a/xfa/include/fwl/core/fwl_widgetmgr.h
+++ b/xfa/fwl/core/ifwl_widgetmgr.h
@@ -4,16 +4,17 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_WIDGETMGR_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_WIDGETMGR_H_
+#ifndef XFA_FWL_CORE_IFWL_WIDGETMGR_H_
+#define XFA_FWL_CORE_IFWL_WIDGETMGR_H_
 
-#include "xfa/include/fwl/core/fwl_note.h"
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "core/fxcrt/include/fx_coordinates.h"
 
+class CFX_WideString;
+class CFX_Matrix;
 class IFWL_Widget;
 
-#define FWL_WGTMGR_DisableThread 0x00000001
-#define FWL_WGTMGR_DisableForm 0x00000002
-
 enum FWL_WGTRELATION {
   FWL_WGTRELATION_Parent = 0,
   FWL_WGTRELATION_Owner,
@@ -40,21 +41,11 @@
                                 const CFX_RectF* pRect = NULL) = 0;
   virtual FX_DWORD GetCapability() = 0;
 };
+
 IFWL_WidgetMgr* FWL_GetWidgetMgr();
 FX_BOOL FWL_WidgetIsChild(IFWL_Widget* parent, IFWL_Widget* find);
-
-class IFWL_WidgetMgrDelegate {
- public:
-  virtual ~IFWL_WidgetMgrDelegate() {}
-  virtual FWL_ERR OnSetCapability(
-      FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) = 0;
-  virtual int32_t OnProcessMessageToForm(CFWL_Message* pMessage) = 0;
-  virtual FWL_ERR OnDrawWidget(IFWL_Widget* pWidget,
-                               CFX_Graphics* pGraphics,
-                               const CFX_Matrix* pMatrix = NULL) = 0;
-};
 FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget* pWidget,
                               const CFX_WideString* saveFile,
                               const CFX_Matrix* pMatrix = NULL);
 
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_WIDGETMGR_H_
+#endif  // XFA_FWL_CORE_IFWL_WIDGETMGR_H_
diff --git a/xfa/fwl/core/ifwl_widgetmgrdelegate.h b/xfa/fwl/core/ifwl_widgetmgrdelegate.h
new file mode 100644
index 0000000..6204957
--- /dev/null
+++ b/xfa/fwl/core/ifwl_widgetmgrdelegate.h
@@ -0,0 +1,33 @@
+// Copyright 2016 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
+
+#ifndef XFA_FWL_CORE_IFWL_WIDGETMGRDELEGATE_H_
+#define XFA_FWL_CORE_IFWL_WIDGETMGRDELEGATE_H_
+
+#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
+
+#define FWL_WGTMGR_DisableThread 0x00000001
+#define FWL_WGTMGR_DisableForm 0x00000002
+
+class CFWL_Message;
+class CFX_Graphics;
+class CFX_Matrix;
+class IFWL_Widget;
+
+class IFWL_WidgetMgrDelegate {
+ public:
+  virtual ~IFWL_WidgetMgrDelegate() {}
+
+  virtual FWL_ERR OnSetCapability(
+      FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) = 0;
+  virtual int32_t OnProcessMessageToForm(CFWL_Message* pMessage) = 0;
+  virtual FWL_ERR OnDrawWidget(IFWL_Widget* pWidget,
+                               CFX_Graphics* pGraphics,
+                               const CFX_Matrix* pMatrix = nullptr) = 0;
+};
+
+#endif  // XFA_FWL_CORE_IFWL_WIDGETMGRDELEGATE_H_
diff --git a/xfa/include/fwl/adapter/fwl_adaptertimermgr.h b/xfa/fwl/core/include/ifwl_adaptertimermgr.h
similarity index 69%
rename from xfa/include/fwl/adapter/fwl_adaptertimermgr.h
rename to xfa/fwl/core/include/ifwl_adaptertimermgr.h
index f8b0daa..7c77670 100644
--- a/xfa/include/fwl/adapter/fwl_adaptertimermgr.h
+++ b/xfa/fwl/core/include/ifwl_adaptertimermgr.h
@@ -4,11 +4,11 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERTIMERMGR_H_
-#define XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERTIMERMGR_H_
+#ifndef XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_
+#define XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_
 
-#include "xfa/include/fwl/core/fwl_error.h"
-#include "xfa/include/fwl/core/fwl_timer.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_timer.h"
 
 class IFWL_Timer;
 
@@ -22,4 +22,4 @@
   virtual FWL_ERR Stop(FWL_HTIMER hTimer) = 0;
 };
 
-#endif  // XFA_INCLUDE_FWL_ADAPTER_FWL_ADAPTERTIMERMGR_H_
+#endif  // XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_
diff --git a/xfa/fwl/lightwidget/app.cpp b/xfa/fwl/lightwidget/app.cpp
index ca6462a..1d5b7d6 100644
--- a/xfa/fwl/lightwidget/app.cpp
+++ b/xfa/fwl/lightwidget/app.cpp
@@ -7,8 +7,8 @@
 #include "xfa/include/fwl/lightwidget/app.h"
 
 #include "core/fxcrt/include/fx_coordinates.h"
-#include "xfa/include/fwl/core/fwl_app.h"
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_app.h"
 #include "xfa/include/fwl/lightwidget/theme.h"
 
 CFWL_App::CFWL_App() : m_pIface(IFWL_App::Create(nullptr)), m_pTheme(nullptr) {}
diff --git a/xfa/fwl/lightwidget/caret.cpp b/xfa/fwl/lightwidget/caret.cpp
index b81c6c2..5415aa5 100644
--- a/xfa/fwl/lightwidget/caret.cpp
+++ b/xfa/fwl/lightwidget/caret.cpp
@@ -8,9 +8,9 @@
 
 #include <memory>
 
+#include "xfa/fwl/basewidget/ifwl_caret.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fxgraphics/cfx_color.h"
-#include "xfa/include/fwl/basewidget/fwl_caret.h"
 #include "xfa/include/fwl/lightwidget/edit.h"
 
 CFWL_Caret* CFWL_Caret::Create() {
diff --git a/xfa/fwl/lightwidget/checkbox.cpp b/xfa/fwl/lightwidget/checkbox.cpp
index 6b7a370..1d92199 100644
--- a/xfa/fwl/lightwidget/checkbox.cpp
+++ b/xfa/fwl/lightwidget/checkbox.cpp
@@ -8,7 +8,7 @@
 
 #include <memory>
 
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 CFWL_CheckBox* CFWL_CheckBox::Create() {
   return new CFWL_CheckBox;
diff --git a/xfa/fwl/lightwidget/combobox.cpp b/xfa/fwl/lightwidget/combobox.cpp
index aadb0d5..7ea1370 100644
--- a/xfa/fwl/lightwidget/combobox.cpp
+++ b/xfa/fwl/lightwidget/combobox.cpp
@@ -8,8 +8,8 @@
 
 #include <utility>
 
-#include "xfa/include/fwl/core/fwl_error.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 CFWL_ComboBox* CFWL_ComboBox::Create() {
   return new CFWL_ComboBox;
diff --git a/xfa/fwl/lightwidget/datetimepicker.cpp b/xfa/fwl/lightwidget/datetimepicker.cpp
index bf1d976..3372c53 100644
--- a/xfa/fwl/lightwidget/datetimepicker.cpp
+++ b/xfa/fwl/lightwidget/datetimepicker.cpp
@@ -8,10 +8,9 @@
 
 #include <memory>
 
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
-#include "xfa/include/fwl/core/fwl_error.h"
-#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 CFWL_DateTimePicker* CFWL_DateTimePicker::Create() {
   return new CFWL_DateTimePicker;
diff --git a/xfa/fwl/lightwidget/edit.cpp b/xfa/fwl/lightwidget/edit.cpp
index 303943a..612d5a4 100644
--- a/xfa/fwl/lightwidget/edit.cpp
+++ b/xfa/fwl/lightwidget/edit.cpp
@@ -9,7 +9,7 @@
 #include <memory>
 #include <vector>
 
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
+#include "xfa/fwl/basewidget/ifwl_edit.h"
 
 CFWL_Edit* CFWL_Edit::Create() {
   return new CFWL_Edit;
diff --git a/xfa/fwl/lightwidget/scrollbar.cpp b/xfa/fwl/lightwidget/scrollbar.cpp
index cc927e7..a070483 100644
--- a/xfa/fwl/lightwidget/scrollbar.cpp
+++ b/xfa/fwl/lightwidget/scrollbar.cpp
@@ -8,7 +8,7 @@
 
 #include <memory>
 
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
 
 CFWL_ScrollBar* CFWL_ScrollBar::Create() {
   return new CFWL_ScrollBar;
diff --git a/xfa/fwl/lightwidget/theme.cpp b/xfa/fwl/lightwidget/theme.cpp
index fe9f559..950d70e 100644
--- a/xfa/fwl/lightwidget/theme.cpp
+++ b/xfa/fwl/lightwidget/theme.cpp
@@ -8,6 +8,9 @@
 
 #include <algorithm>
 
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/include/fwl/theme/barcodetp.h"
 #include "xfa/include/fwl/theme/carettp.h"
 #include "xfa/include/fwl/theme/checkboxtp.h"
diff --git a/xfa/fwl/lightwidget/widget.cpp b/xfa/fwl/lightwidget/widget.cpp
index daaab3c..ae1f147 100644
--- a/xfa/fwl/lightwidget/widget.cpp
+++ b/xfa/fwl/lightwidget/widget.cpp
@@ -7,13 +7,14 @@
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_noteimp.h"
 #include "xfa/fwl/core/fwl_targetimp.h"
 #include "xfa/fwl/core/fwl_widgetimp.h"
 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
-#include "xfa/include/fwl/core/fwl_thread.h"
+#include "xfa/fwl/core/ifwl_notethread.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 CFWL_WidgetImpProperties CFWL_WidgetProperties::MakeWidgetImpProperties(
     IFWL_DataProvider* pDataProvider) const {
diff --git a/xfa/fwl/theme/barcodetp.cpp b/xfa/fwl/theme/barcodetp.cpp
index 477ce99..da10d7a 100644
--- a/xfa/fwl/theme/barcodetp.cpp
+++ b/xfa/fwl/theme/barcodetp.cpp
@@ -6,9 +6,9 @@
 
 #include "xfa/include/fwl/theme/barcodetp.h"
 
-#include "xfa/include/fwl/basewidget/fwl_barcode.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/basewidget/ifwl_barcode.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 CFWL_BarcodeTP::CFWL_BarcodeTP() {}
 CFWL_BarcodeTP::~CFWL_BarcodeTP() {}
diff --git a/xfa/fwl/theme/carettp.cpp b/xfa/fwl/theme/carettp.cpp
index 7b165f9..b1cf5ef 100644
--- a/xfa/fwl/theme/carettp.cpp
+++ b/xfa/fwl/theme/carettp.cpp
@@ -6,10 +6,11 @@
 
 #include "xfa/include/fwl/theme/carettp.h"
 
+#include "xfa/fwl/basewidget/ifwl_caret.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_caret.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 CFWL_CaretTP::CFWL_CaretTP() {}
 CFWL_CaretTP::~CFWL_CaretTP() {}
diff --git a/xfa/fwl/theme/checkboxtp.cpp b/xfa/fwl/theme/checkboxtp.cpp
index b039609..e7d206a 100644
--- a/xfa/fwl/theme/checkboxtp.cpp
+++ b/xfa/fwl/theme/checkboxtp.cpp
@@ -7,10 +7,12 @@
 #include "xfa/include/fwl/theme/checkboxtp.h"
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_checkbox.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_checkbox.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 #define CHECKBOX_SIZE_SIGNMARGIN 3
 #define CHECKBOX_SIZE_SIGNBORDER 2
diff --git a/xfa/fwl/theme/comboboxtp.cpp b/xfa/fwl/theme/comboboxtp.cpp
index c3824ec..23b1320 100644
--- a/xfa/fwl/theme/comboboxtp.cpp
+++ b/xfa/fwl/theme/comboboxtp.cpp
@@ -6,10 +6,12 @@
 
 #include "xfa/include/fwl/theme/comboboxtp.h"
 
+#include "xfa/fwl/basewidget/ifwl_combobox.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_combobox.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 #define FWLTHEME_CAPACITY_ComboFormHandler 8.0f
 
diff --git a/xfa/fwl/theme/datetimepickertp.cpp b/xfa/fwl/theme/datetimepickertp.cpp
index 5efe0b8..99c5ccb 100644
--- a/xfa/fwl/theme/datetimepickertp.cpp
+++ b/xfa/fwl/theme/datetimepickertp.cpp
@@ -6,7 +6,8 @@
 
 #include "xfa/include/fwl/theme/datetimepickertp.h"
 
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
 
 CFWL_DateTimePickerTP::CFWL_DateTimePickerTP() {
   m_pThemeData = new DTPThemeData;
diff --git a/xfa/fwl/theme/edittp.cpp b/xfa/fwl/theme/edittp.cpp
index 61a28ef..a99b214 100644
--- a/xfa/fwl/theme/edittp.cpp
+++ b/xfa/fwl/theme/edittp.cpp
@@ -6,10 +6,11 @@
 
 #include "xfa/include/fwl/theme/edittp.h"
 
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 CFWL_EditTP::CFWL_EditTP() {}
 CFWL_EditTP::~CFWL_EditTP() {}
diff --git a/xfa/fwl/theme/formtp.cpp b/xfa/fwl/theme/formtp.cpp
index d07902d..67ef025 100644
--- a/xfa/fwl/theme/formtp.cpp
+++ b/xfa/fwl/theme/formtp.cpp
@@ -7,10 +7,14 @@
 #include "xfa/include/fwl/theme/formtp.h"
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
+#include "xfa/fwl/core/ifwl_form.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/core/fwl_form.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 #define FWLTHEME_CAPACITY_CXFormBorder 3
 #define FWLTHEME_CAPACITY_CYFormBorder 3
diff --git a/xfa/fwl/theme/listboxtp.cpp b/xfa/fwl/theme/listboxtp.cpp
index 72979db..0022e06 100644
--- a/xfa/fwl/theme/listboxtp.cpp
+++ b/xfa/fwl/theme/listboxtp.cpp
@@ -6,10 +6,11 @@
 
 #include "xfa/include/fwl/theme/listboxtp.h"
 
+#include "xfa/fwl/basewidget/ifwl_listbox.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_listbox.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 CFWL_ListBoxTP::CFWL_ListBoxTP() {}
 CFWL_ListBoxTP::~CFWL_ListBoxTP() {}
diff --git a/xfa/fwl/theme/monthcalendartp.cpp b/xfa/fwl/theme/monthcalendartp.cpp
index 5a2f3af..832adde 100644
--- a/xfa/fwl/theme/monthcalendartp.cpp
+++ b/xfa/fwl/theme/monthcalendartp.cpp
@@ -7,10 +7,13 @@
 #include "xfa/include/fwl/theme/monthcalendartp.h"
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/basewidget/ifwl_monthcalendar.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_monthcalendar.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 #define FWL_THEMECAPACITY_MC_HEADER_WIDTH 200
 #define FWL_THEMECAPACITY_MC_HEADER_HEIGHT 30
diff --git a/xfa/fwl/theme/pictureboxtp.cpp b/xfa/fwl/theme/pictureboxtp.cpp
index 5d7c079..ab5cd02 100644
--- a/xfa/fwl/theme/pictureboxtp.cpp
+++ b/xfa/fwl/theme/pictureboxtp.cpp
@@ -6,10 +6,12 @@
 
 #include "xfa/include/fwl/theme/pictureboxtp.h"
 
-#include "xfa/include/fwl/basewidget/fwl_picturebox.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/basewidget/ifwl_picturebox.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 CFWL_PictureBoxTP::CFWL_PictureBoxTP() {}
+
 CFWL_PictureBoxTP::~CFWL_PictureBoxTP() {}
 
 FX_BOOL CFWL_PictureBoxTP::IsValidWidget(IFWL_Widget* pWidget) {
diff --git a/xfa/fwl/theme/pushbuttontp.cpp b/xfa/fwl/theme/pushbuttontp.cpp
index 456199e..0913750 100644
--- a/xfa/fwl/theme/pushbuttontp.cpp
+++ b/xfa/fwl/theme/pushbuttontp.cpp
@@ -6,10 +6,12 @@
 
 #include "xfa/include/fwl/theme/pushbuttontp.h"
 
+#include "xfa/fwl/basewidget/ifwl_pushbutton.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_pushbutton.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 #define PUSHBUTTON_SIZE_Corner 2
 
diff --git a/xfa/fwl/theme/scrollbartp.cpp b/xfa/fwl/theme/scrollbartp.cpp
index 7a79405..2c7bed0 100644
--- a/xfa/fwl/theme/scrollbartp.cpp
+++ b/xfa/fwl/theme/scrollbartp.cpp
@@ -6,10 +6,12 @@
 
 #include "xfa/include/fwl/theme/scrollbartp.h"
 
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 
 #define FWL_SCROLL_PawLen 12.5f
 
diff --git a/xfa/fwl/theme/widgettp.cpp b/xfa/fwl/theme/widgettp.cpp
index 7d3f462..2eda644 100644
--- a/xfa/fwl/theme/widgettp.cpp
+++ b/xfa/fwl/theme/widgettp.cpp
@@ -9,10 +9,14 @@
 #include <algorithm>
 
 #include "xfa/fde/tto/fde_textout.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/core/ifwl_widgetmgr.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
 #include "xfa/fxgraphics/cfx_shading.h"
-#include "xfa/include/fwl/core/fwl_widgetmgr.h"
 
 static void FWL_SetChildThemeID(IFWL_Widget* pParent, FX_DWORD dwThemeID) {
   IFWL_WidgetMgr* pWidgetMgr = FWL_GetWidgetMgr();
diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp
index 8327d1b..c315386 100644
--- a/xfa/fxfa/app/xfa_ffapp.cpp
+++ b/xfa/fxfa/app/xfa_ffapp.cpp
@@ -8,13 +8,13 @@
 
 #include <algorithm>
 
+#include "xfa/fwl/core/ifwl_widgetmgrdelegate.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdochandler.h"
 #include "xfa/fxfa/app/xfa_ffwidgethandler.h"
 #include "xfa/fxfa/app/xfa_fontmgr.h"
 #include "xfa/fxfa/app/xfa_fwladapter.h"
 #include "xfa/fxfa/app/xfa_fwltheme.h"
-#include "xfa/include/fwl/core/fwl_widgetmgr.h"
 
 CXFA_FileRead::CXFA_FileRead(const CFX_ArrayTemplate<CPDF_Stream*>& streams) {
   int32_t iCount = streams.GetSize();
diff --git a/xfa/fxfa/app/xfa_ffapp.h b/xfa/fxfa/app/xfa_ffapp.h
index fe3358a..c6c3286 100644
--- a/xfa/fxfa/app/xfa_ffapp.h
+++ b/xfa/fxfa/app/xfa_ffapp.h
@@ -10,9 +10,9 @@
 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h"
 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h"
 #include "xfa/fgas/font/fgas_font.h"
-#include "xfa/include/fwl/adapter/fwl_adapternative.h"
-#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h"
-#include "xfa/include/fwl/core/fwl_app.h"
+#include "xfa/fwl/core/fwl_sdadapterimp.h"
+#include "xfa/fwl/core/ifwl_adapternative.h"
+#include "xfa/fwl/core/ifwl_app.h"
 #include "xfa/include/fxfa/fxfa.h"
 
 class CXFA_FWLAdapterWidgetMgr;
diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp
index 49e01cb..8bc4a26 100644
--- a/xfa/fxfa/app/xfa_ffbarcode.cpp
+++ b/xfa/fxfa/app/xfa_ffbarcode.cpp
@@ -7,12 +7,13 @@
 #include "xfa/fxfa/app/xfa_ffbarcode.h"
 
 #include "core/fxcrt/include/fx_ext.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
 #include "xfa/fxfa/app/xfa_fffield.h"
 #include "xfa/fxfa/app/xfa_ffpageview.h"
 #include "xfa/fxfa/app/xfa_fftextedit.h"
 #include "xfa/fxfa/app/xfa_ffwidget.h"
 #include "xfa/fxfa/app/xfa_fwladapter.h"
-#include "xfa/include/fwl/core/fwl_app.h"
 #include "xfa/include/fwl/lightwidget/barcode.h"
 
 namespace {
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index 862a2cd..1e7c71a 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -6,6 +6,9 @@
 
 #include "xfa/fxfa/app/xfa_ffcheckbutton.h"
 
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
+#include "xfa/fwl/core/ifwl_widgetmgrdelegate.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdocview.h"
@@ -13,7 +16,6 @@
 #include "xfa/fxfa/app/xfa_fffield.h"
 #include "xfa/fxfa/app/xfa_ffpageview.h"
 #include "xfa/fxfa/app/xfa_ffwidget.h"
-#include "xfa/include/fwl/core/fwl_widgetmgr.h"
 #include "xfa/include/fwl/lightwidget/checkbox.h"
 
 CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_FFPageView* pPageView,
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 2789e07..f94ed1e 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -6,14 +6,15 @@
 
 #include "xfa/fxfa/app/xfa_ffchoicelist.h"
 
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdocview.h"
 #include "xfa/fxfa/app/xfa_fffield.h"
 #include "xfa/fxfa/app/xfa_ffpageview.h"
 #include "xfa/fxfa/app/xfa_ffwidget.h"
 #include "xfa/fxfa/app/xfa_fwladapter.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
-#include "xfa/include/fwl/core/fwl_app.h"
 #include "xfa/include/fwl/lightwidget/combobox.h"
 #include "xfa/include/fwl/lightwidget/listbox.h"
 
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index b7e1b1f..ec2a1a2 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -11,6 +11,7 @@
 #include "core/fxcrt/include/fx_ext.h"
 #include "core/include/fpdfdoc/fpdf_doc.h"
 #include "xfa/fgas/crt/fgas_algorithm.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_ffdocview.h"
 #include "xfa/fxfa/app/xfa_ffnotify.h"
@@ -18,7 +19,6 @@
 #include "xfa/fxfa/app/xfa_fontmgr.h"
 #include "xfa/fxfa/parser/xfa_docdata.h"
 #include "xfa/fxfa/parser/xfa_parser.h"
-#include "xfa/include/fwl/core/fwl_note.h"
 
 CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocProvider* pDocProvider)
     : m_pDocProvider(pDocProvider),
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index cc8f7ed..0f5874f 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -6,6 +6,9 @@
 
 #include "xfa/fxfa/app/xfa_fffield.h"
 
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/ifwl_widgetmgrdelegate.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdocview.h"
@@ -15,8 +18,6 @@
 #include "xfa/fxfa/app/xfa_textlayout.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
-#include "xfa/include/fwl/core/fwl_widgetmgr.h"
 #include "xfa/include/fwl/lightwidget/edit.h"
 #include "xfa/include/fwl/lightwidget/picturebox.h"
 
diff --git a/xfa/fxfa/app/xfa_fffield.h b/xfa/fxfa/app/xfa_fffield.h
index 4f816ce..952cfcd 100644
--- a/xfa/fxfa/app/xfa_fffield.h
+++ b/xfa/fxfa/app/xfa_fffield.h
@@ -7,10 +7,10 @@
 #ifndef XFA_FXFA_APP_XFA_FFFIELD_H_
 #define XFA_FXFA_APP_XFA_FFFIELD_H_
 
+#include "xfa/fwl/core/fwl_sdadapterimp.h"
+#include "xfa/fwl/core/ifwl_widgetdelegate.h"
 #include "xfa/fxfa/app/xfa_ffpageview.h"
 #include "xfa/fxfa/app/xfa_ffwidget.h"
-#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 #define XFA_MINUI_HEIGHT 4.32f
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index 4f9f6c6..c2d7552 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -6,12 +6,14 @@
 
 #include "xfa/fxfa/app/xfa_ffimageedit.h"
 
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdocview.h"
 #include "xfa/fxfa/app/xfa_fffield.h"
 #include "xfa/fxfa/app/xfa_ffpageview.h"
 #include "xfa/fxfa/app/xfa_ffwidget.h"
-#include "xfa/include/fwl/core/fwl_app.h"
 #include "xfa/include/fwl/lightwidget/picturebox.h"
 
 CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_FFPageView* pPageView,
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index bf18387..37472a8 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -6,6 +6,8 @@
 
 #include "xfa/fxfa/app/xfa_ffpushbutton.h"
 
+#include "xfa/fwl/core/ifwl_notedriver.h"
+#include "xfa/fwl/core/ifwl_widgetmgrdelegate.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_fffield.h"
 #include "xfa/fxfa/app/xfa_ffpageview.h"
@@ -14,7 +16,6 @@
 #include "xfa/fxfa/app/xfa_textlayout.h"
 #include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/fxgraphics/cfx_path.h"
-#include "xfa/include/fwl/core/fwl_widgetmgr.h"
 #include "xfa/include/fwl/lightwidget/pushbutton.h"
 
 CXFA_FFPushButton::CXFA_FFPushButton(CXFA_FFPageView* pPageView,
diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp
index d878158..b35f7b4 100644
--- a/xfa/fxfa/app/xfa_fftext.cpp
+++ b/xfa/fxfa/app/xfa_fftext.cpp
@@ -6,6 +6,7 @@
 
 #include "xfa/fxfa/app/xfa_fftext.h"
 
+#include "xfa/fwl/core/fwl_widgetdef.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdraw.h"
@@ -13,7 +14,6 @@
 #include "xfa/fxfa/app/xfa_ffwidget.h"
 #include "xfa/fxfa/app/xfa_textlayout.h"
 #include "xfa/fxgraphics/include/cfx_graphics.h"
-#include "xfa/include/fwl/core/fwl_widgetdef.h"
 
 CXFA_FFText::CXFA_FFText(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc)
     : CXFA_FFDraw(pPageView, pDataAcc) {}
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index c35fe58..837054a 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -8,6 +8,10 @@
 
 #include <vector>
 
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/core/cfwl_message.h"
+#include "xfa/fwl/core/ifwl_notedriver.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_ffdoc.h"
 #include "xfa/fxfa/app/xfa_ffdocview.h"
@@ -17,8 +21,6 @@
 #include "xfa/fxfa/app/xfa_fwladapter.h"
 #include "xfa/fxfa/app/xfa_textlayout.h"
 #include "xfa/fxfa/parser/xfa_localevalue.h"
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
 #include "xfa/include/fwl/lightwidget/datetimepicker.h"
 #include "xfa/include/fwl/lightwidget/edit.h"
 
diff --git a/xfa/fxfa/app/xfa_fwladapter.h b/xfa/fxfa/app/xfa_fwladapter.h
index bf9a3d6..c42ae74 100644
--- a/xfa/fxfa/app/xfa_fwladapter.h
+++ b/xfa/fxfa/app/xfa_fwladapter.h
@@ -7,7 +7,7 @@
 #ifndef XFA_FXFA_APP_XFA_FWLADAPTER_H_
 #define XFA_FXFA_APP_XFA_FWLADAPTER_H_
 
-#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h"
+#include "xfa/fwl/core/fwl_sdadapterimp.h"
 
 class CXFA_FWLAdapterWidgetMgr : public CFWL_SDAdapterWidgetMgr {
  public:
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index 11b7002..3c0d100 100644
--- a/xfa/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/fxfa/app/xfa_fwltheme.cpp
@@ -8,20 +8,22 @@
 
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fgas/crt/fgas_codepage.h"
+#include "xfa/fwl/basewidget/ifwl_barcode.h"
+#include "xfa/fwl/basewidget/ifwl_caret.h"
+#include "xfa/fwl/basewidget/ifwl_checkbox.h"
+#include "xfa/fwl/basewidget/ifwl_combobox.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
+#include "xfa/fwl/basewidget/ifwl_edit.h"
+#include "xfa/fwl/basewidget/ifwl_listbox.h"
+#include "xfa/fwl/basewidget/ifwl_monthcalendar.h"
+#include "xfa/fwl/basewidget/ifwl_picturebox.h"
+#include "xfa/fwl/basewidget/ifwl_pushbutton.h"
+#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
+#include "xfa/fwl/core/cfwl_themebackground.h"
+#include "xfa/fwl/core/cfwl_themetext.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
 #include "xfa/fxfa/app/xfa_ffwidget.h"
 #include "xfa/fxgraphics/cfx_color.h"
-#include "xfa/include/fwl/basewidget/fwl_barcode.h"
-#include "xfa/include/fwl/basewidget/fwl_caret.h"
-#include "xfa/include/fwl/basewidget/fwl_checkbox.h"
-#include "xfa/include/fwl/basewidget/fwl_combobox.h"
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
-#include "xfa/include/fwl/basewidget/fwl_edit.h"
-#include "xfa/include/fwl/basewidget/fwl_listbox.h"
-#include "xfa/include/fwl/basewidget/fwl_monthcalendar.h"
-#include "xfa/include/fwl/basewidget/fwl_picturebox.h"
-#include "xfa/include/fwl/basewidget/fwl_pushbutton.h"
-#include "xfa/include/fwl/basewidget/fwl_scrollbar.h"
 
 namespace {
 
diff --git a/xfa/fxfa/app/xfa_fwltheme.h b/xfa/fxfa/app/xfa_fwltheme.h
index aab8099..484c569 100644
--- a/xfa/fxfa/app/xfa_fwltheme.h
+++ b/xfa/fxfa/app/xfa_fwltheme.h
@@ -7,9 +7,9 @@
 #ifndef XFA_FXFA_APP_XFA_FWLTHEME_H_
 #define XFA_FXFA_APP_XFA_FWLTHEME_H_
 
+#include "xfa/fwl/core/ifwl_target.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 #include "xfa/fxfa/app/xfa_ffapp.h"
-#include "xfa/include/fwl/core/fwl_target.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
 #include "xfa/include/fwl/theme/barcodetp.h"
 #include "xfa/include/fwl/theme/carettp.h"
 #include "xfa/include/fwl/theme/checkboxtp.h"
diff --git a/xfa/include/fwl/basewidget/fwl_menu.h b/xfa/include/fwl/basewidget/fwl_menu.h
deleted file mode 100644
index d8ab0d9..0000000
--- a/xfa/include/fwl/basewidget/fwl_menu.h
+++ /dev/null
@@ -1,17 +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
-
-#ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_MENU_H_
-#define XFA_INCLUDE_FWL_BASEWIDGET_FWL_MENU_H_
-
-#define FWL_CLASS_Menu L"FWL_MENU"
-#define FWL_CLASSHASH_Menu 3957949655
-#define FWL_STYLEEXT_MNU_Horz (0L << 0)
-#define FWL_STYLEEXT_MNU_Vert (1L << 0)
-#define FWL_STYLEEXT_MNU_Dock (1L << 1)
-#define FWL_STYLEEXT_MNU_OwnerDraw (1L << 2)
-
-#endif  // XFA_INCLUDE_FWL_BASEWIDGET_FWL_MENU_H_
diff --git a/xfa/include/fwl/core/fwl_note.h b/xfa/include/fwl/core/fwl_note.h
deleted file mode 100644
index 170e479..0000000
--- a/xfa/include/fwl/core/fwl_note.h
+++ /dev/null
@@ -1,381 +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
-
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_NOTE_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_NOTE_H_
-
-#include "core/fxcrt/include/fx_coordinates.h"
-#include "xfa/fxgraphics/include/cfx_graphics.h"
-#include "xfa/include/fwl/core/fwl_error.h"
-
-class IFWL_Widget;
-class IFWL_NoteThread;
-class CFWL_Note;
-class CFWL_Message;
-class CFWL_MsgActivate;
-class CFWL_MsgDeactivate;
-class CFWL_MsgMouse;
-class CFWL_MsgMouseWheel;
-class CFWL_MsgKey;
-class CFWL_MsgSetFocus;
-class CFWL_MsgKillFocus;
-class CFWL_MsgCursor;
-class CFWL_MsgSize;
-class CFWL_MsgWindowMove;
-class CFWL_MsgDropFiles;
-class CFWL_MsgTaskClicked;
-class CFWL_MsgClose;
-class CFWL_MsgWindowWillMove;
-class CFWL_Event;
-class CFWL_EvtMouse;
-class CFWL_EvtMouseWheel;
-class CFWL_EvtKey;
-class CFWL_EvtSetFocus;
-class CFWL_EvtKillFocus;
-class CFWL_EvtDraw;
-class CFWL_EvtClick;
-class CFWL_EvtScroll;
-class CFWL_EvtClose;
-class CFWL_EvtContextMenu;
-class CFWL_EvtMenuCommand;
-class CFWL_EvtSizeChanged;
-class CFWL_EvtIdle;
-class IFWL_NoteDriver;
-class IFWL_NoteLoop;
-
-#define FWL_MSG_Activate L"FWL_MESSAGE_Activate"
-#define FWL_MSG_Deactivate L"FWL_MESSAGE_Deactivate"
-#define FWL_MSG_SetFocus L"FWL_MESSAGE_SetFocus"
-#define FWL_MSG_KillFocus L"FWL_MESSAGE_KillFocus"
-#define FWL_MSG_Mouse L"FWL_MESSAGE_Mouse"
-#define FWL_MSG_MouseWheel L"FWL_MESSAGE_MouseWheel"
-#define FWL_MSG_Key L"FWL_MESSAGE_Key"
-#define FWL_MSG_Cursor L"FWL_MESSAGE_Cursor"
-#define FWL_MSG_Size L"FWL_MESSAGE_Size"
-#define FWL_MSG_WindowMove L"FWL_MESSAGE_WindowMove"
-#define FWL_MSG_DropFiles L"FWL_MESSAGE_DropFiles"
-#define FWL_MSG_TaskClicked L"FWL_MESSAGE_TaskClicked"
-#define FWL_MSG_Close L"FWL_MESSAGE_Close"
-#define FWL_MSG_Post L"FWL_MESSAGE_Post"
-#define FWL_MSG_WindowWillMove L"FWL_MESSAGE_WindowWillMove"
-#define FWL_MSGHASH_Activate 2410369469
-#define FWL_MSGHASH_Deactivate 1184214790
-#define FWL_MSGHASH_SetFocus 4174512504
-#define FWL_MSGHASH_KillFocus 1557903832
-#define FWL_MSGHASH_Mouse 706128309
-#define FWL_MSGHASH_MouseWheel 893703466
-#define FWL_MSGHASH_Key 3751372405
-#define FWL_MSGHASH_Cursor 3182626218
-#define FWL_MSGHASH_Size 160077735
-#define FWL_MSGHASH_WindowMove 1032269377
-#define FWL_MSGHASH_DropFiles 2004165236
-#define FWL_MSGHASH_TaskClicked 3128231086
-#define FWL_MSGHASH_Close 2977563906
-#define FWL_MSGHASH_Post 1969633074
-#define FWL_MSGHASH_WindowWillMove 2229175763
-#define FWL_EVT_Mouse L"FWL_EVENT_Mouse"
-#define FWL_EVT_MouseWheel L"FWL_EVENT_MouseWheel"
-#define FWL_EVT_Key L"FWL_EVENT_Key"
-#define FWL_EVT_SetFocus L"FWL_EVENT_SetFocus"
-#define FWL_EVT_KillFocus L"FWL_EVENT_KillFocus"
-#define FWL_EVT_Click L"FWL_EVENT_Click"
-#define FWL_EVT_Draw L"FWL_EVENT_Draw"
-#define FWL_EVT_Scroll L"FWL_EVENT_Scroll"
-#define FWL_EVT_Close L"FWL_EVENT_Close"
-#define FWL_EVT_ContextMenu L"FWL_EVENT_ContextMenu"
-#define FWL_EVT_MenuCommand L"FWL_EVENT_MenuCommand"
-#define FWL_EVT_SizeChanged L"FWL_EVENT_SizeChanged"
-#define FWL_EVTHASH_Mouse 1765258002
-#define FWL_EVTHASH_MouseWheel 3907114407
-#define FWL_EVTHASH_Key 2408354450
-#define FWL_EVTHASH_SetFocus 3909721269
-#define FWL_EVTHASH_KillFocus 1779363253
-#define FWL_EVTHASH_Draw 2430713303
-#define FWL_EVTHASH_Click 4026328783
-#define FWL_EVTHASH_Scroll 2965158968
-#define FWL_EVTHASH_Close 4036693599
-#define FWL_EVTHASH_ContextMenu 2717307715
-#define FWL_EVTHASH_MenuCommand 497763741
-#define FWL_EVTHASH_SizeChanged 3083958510
-#define FWL_EVTHASH_Idle 839546759
-#define FWL_MSGMOUSECMD_LButtonDown 1
-#define FWL_MSGMOUSECMD_LButtonUp 2
-#define FWL_MSGMOUSECMD_LButtonDblClk 3
-#define FWL_MSGMOUSECMD_RButtonDown 4
-#define FWL_MSGMOUSECMD_RButtonUp 5
-#define FWL_MSGMOUSECMD_RButtonDblClk 6
-#define FWL_MSGMOUSECMD_MButtonDown 7
-#define FWL_MSGMOUSECMD_MButtonUp 8
-#define FWL_MSGMOUSECMD_MButtonDblClk 9
-#define FWL_MSGMOUSECMD_MouseMove 10
-#define FWL_MSGMOUSECMD_MouseEnter 11
-#define FWL_MSGMOUSECMD_MouseLeave 12
-#define FWL_MSGMOUSECMD_MouseHover 13
-#define FWL_MSGKEYCMD_KeyDown 1
-#define FWL_MSGKEYCMD_KeyUp 2
-#define FWL_MSGKEYCMD_Char 3
-#define FWL_KEYFLAG_Ctrl (1 << 0)
-#define FWL_KEYFLAG_Alt (1 << 1)
-#define FWL_KEYFLAG_Shift (1 << 2)
-#define FWL_KEYFLAG_Command (1 << 3)
-#define FWL_KEYFLAG_LButton (1 << 4)
-#define FWL_KEYFLAG_RButton (1 << 5)
-#define FWL_KEYFLAG_MButton (1 << 6)
-
-// Separate hierarchy not related to IFWL_* hierarchy. These should not
-// get cast to IFWL_* types.
-class CFWL_Note {
- public:
-  virtual FX_DWORD Release() {
-    m_dwRefCount--;
-    FX_DWORD dwRefCount = m_dwRefCount;
-    if (!m_dwRefCount) {
-      delete this;
-    }
-    return dwRefCount;
-  }
-  virtual CFWL_Note* Retain() {
-    m_dwRefCount++;
-    return this;
-  }
-  virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const {
-    wsClass = L"CFWL_Note";
-    return FWL_ERR_Succeeded;
-  }
-  virtual FX_DWORD GetClassID() const { return 0; }
-  virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const {
-    return TRUE;
-  }
-  virtual CFWL_Note* Clone() { return NULL; }
-  FX_BOOL IsEvent() const { return m_bIsEvent; }
-  IFWL_Widget* m_pSrcTarget;
-  IFWL_Widget* m_pDstTarget;
-
- protected:
-  CFWL_Note(FX_BOOL bIsEvent)
-      : m_pSrcTarget(NULL),
-        m_pDstTarget(NULL),
-        m_dwRefCount(1),
-        m_bIsEvent(bIsEvent),
-        m_dwExtend(0) {}
-  virtual ~CFWL_Note() {}
-  virtual FX_BOOL Initialize() { return TRUE; }
-  virtual int32_t Finalize() { return 0; }
-  FX_DWORD m_dwRefCount;
-  FX_BOOL m_bIsEvent;
-
- public:
-  FX_DWORD m_dwExtend;
-};
-class CFWL_Message : public CFWL_Note {
- public:
-  CFWL_Message() : CFWL_Note(FALSE) {}
-  virtual ~CFWL_Message() {}
-};
-#define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode)             \
-  class classname : public CFWL_Message {                         \
-   public:                                                        \
-    classname() : CFWL_Message() {}                               \
-    virtual CFWL_Note* Clone() { return new classname(*this); }   \
-    virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
-      wsClass = L## #classname;                                   \
-      return FWL_ERR_Succeeded;                                   \
-    }                                                             \
-    virtual FX_DWORD GetClassID() const { return msghashcode; }
-#define END_FWL_MESSAGE_DEF \
-  }                         \
-  ;  // NOLINT
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, FWL_MSGHASH_Activate)
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, FWL_MSGHASH_Deactivate)
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, FWL_MSGHASH_Mouse)
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-FX_DWORD m_dwFlags;
-FX_DWORD m_dwCmd;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouseWheel, FWL_MSGHASH_MouseWheel)
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-FX_FLOAT m_fDeltaX;
-FX_FLOAT m_fDeltaY;
-FX_DWORD m_dwFlags;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSetFocus, FWL_MSGHASH_SetFocus)
-IFWL_Widget* m_pKillFocus;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKillFocus, FWL_MSGHASH_KillFocus)
-IFWL_Widget* m_pSetFocus;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKey, FWL_MSGHASH_Key)
-FX_DWORD m_dwKeyCode;
-FX_DWORD m_dwFlags;
-FX_DWORD m_dwCmd;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgCursor, FWL_MSGHASH_Cursor)
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSize, FWL_MSGHASH_Size)
-int32_t m_iWidth;
-int32_t m_iHeight;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowMove, FWL_MSGHASH_WindowMove)
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDropFiles, FWL_MSGHASH_DropFiles)
-CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) {
-  m_pDstTarget = copy.m_pDstTarget;
-  m_pSrcTarget = copy.m_pSrcTarget;
-  m_fx = copy.m_fx;
-  m_fy = copy.m_fy;
-  m_files.Append(copy.m_files);
-}
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-CFX_WideStringArray m_files;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgTaskClicked, FWL_MSGHASH_TaskClicked)
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, FWL_MSGHASH_Close)
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, FWL_MSGHASH_WindowWillMove)
-END_FWL_MESSAGE_DEF
-class CFWL_Event : public CFWL_Note {
- public:
-  CFWL_Event() : CFWL_Note(TRUE) {}
-  virtual ~CFWL_Event() {}
-};
-#define BEGIN_FWL_EVENT_DEF(classname, eventhashcode)             \
-  class classname : public CFWL_Event {                           \
-   public:                                                        \
-    classname() : CFWL_Event() {}                                 \
-    virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
-      wsClass = L## #classname;                                   \
-      return FWL_ERR_Succeeded;                                   \
-    }                                                             \
-    virtual FX_DWORD GetClassID() const { return eventhashcode; }
-#define END_FWL_EVENT_DEF \
-  }                       \
-  ;  // NOLINT
-BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, FWL_EVTHASH_Mouse)
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-FX_DWORD m_dwFlags;
-FX_DWORD m_dwCmd;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtMouseWheel, FWL_EVTHASH_MouseWheel)
-FX_FLOAT m_fx;
-FX_FLOAT m_fy;
-FX_FLOAT m_fDeltaX;
-FX_FLOAT m_fDeltaY;
-FX_DWORD m_dwFlags;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtKey, FWL_EVTHASH_Key)
-FX_DWORD m_dwKeyCode;
-FX_DWORD m_dwFlags;
-FX_DWORD m_dwCmd;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtSetFocus, FWL_EVTHASH_SetFocus)
-IFWL_Widget* m_pSetFocus;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtKillFocus, FWL_EVTHASH_KillFocus)
-IFWL_Widget* m_pKillFocus;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtDraw, FWL_EVTHASH_Draw)
-CFX_Graphics* m_pGraphics;
-IFWL_Widget* m_pWidget;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtClick, FWL_EVTHASH_Click)
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtScroll, FWL_EVTHASH_Scroll)
-FX_DWORD m_iScrollCode;
-FX_FLOAT m_fPos;
-FX_BOOL* m_pRet;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtClose, FWL_EVTHASH_Close)
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtContextMenu, FWL_EVTHASH_ContextMenu)
-FX_FLOAT m_fPosX;
-FX_FLOAT m_fPosY;
-IFWL_Widget* m_pOwner;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtMenuCommand, FWL_EVTHASH_MenuCommand)
-int32_t m_iCommand;
-void* m_pData;
-END_FWL_EVENT_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, FWL_EVTHASH_SizeChanged)
-IFWL_Widget* m_pWidget;
-CFX_RectF m_rtOld;
-CFX_RectF m_rtNew;
-END_FWL_MESSAGE_DEF
-BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, FWL_EVTHASH_Idle)
-END_FWL_EVENT_DEF
-typedef enum {
-  FWL_EVENT_MOUSE_MASK = 1 << 0,
-  FWL_EVENT_MOUSEWHEEL_MASK = 1 << 1,
-  FWL_EVENT_KEY_MASK = 1 << 2,
-  FWL_EVENT_FOCUSCHANGED_MASK = 1 << 3,
-  FWL_EVENT_DRAW_MASK = 1 << 4,
-  FWL_EVENT_CLOSE_MASK = 1 << 5,
-  FWL_EVENT_SIZECHANGED_MASK = 1 << 6,
-  FWL_EVENT_IDLE_MASK = 1 << 7,
-  FWL_EVENT_CONTROL_MASK = 1 << 8,
-  FWL_EVENT_ALL_MASK = 0xFF
-} FWLEventMask;
-class IFWL_NoteDriver {
- public:
-  virtual ~IFWL_NoteDriver() {}
-  virtual FX_BOOL SendNote(CFWL_Note* pNote) = 0;
-  virtual FX_BOOL PostMessage(CFWL_Message* pMessage) = 0;
-  virtual FWL_ERR RegisterEventTarget(
-      IFWL_Widget* pListener,
-      IFWL_Widget* pEventSource = NULL,
-      FX_DWORD dwFilter = FWL_EVENT_ALL_MASK) = 0;
-  virtual FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) = 0;
-  virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0;
-  virtual int32_t GetQueueMaxSize() const = 0;
-  virtual FWL_ERR SetQueueMaxSize(const int32_t size) = 0;
-  virtual IFWL_NoteThread* GetOwnerThread() const = 0;
-  virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) = 0;
-  virtual IFWL_NoteLoop* PopNoteLoop() = 0;
-  virtual IFWL_Widget* GetFocus() = 0;
-  virtual FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) = 0;
-  virtual void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) = 0;
-  virtual FWL_ERR Run() = 0;
-};
-IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread);
-class IFWL_NoteLoop {
- public:
-  virtual ~IFWL_NoteLoop() {}
-  virtual FX_BOOL PreProcessMessage(CFWL_Message* pMessage) = 0;
-  virtual FWL_ERR Idle(int32_t count) = 0;
-};
-class IFWL_ToolTipTarget {
- public:
-  virtual ~IFWL_ToolTipTarget() {}
-  virtual IFWL_Widget* GetWidget() = 0;
-  virtual FX_BOOL IsShowed() = 0;
-  virtual FWL_ERR DrawToolTip(CFX_Graphics* pGraphics,
-                              const CFX_Matrix* pMatrix,
-                              IFWL_Widget* pToolTip) = 0;
-  virtual FX_BOOL UseDefaultTheme() = 0;
-  virtual FWL_ERR GetCaption(CFX_WideString& wsCaption) = 0;
-  virtual FWL_ERR GetToolTipSize(CFX_SizeF& sz) = 0;
-  virtual FWL_ERR GetToolTipPos(CFX_PointF& pt) { return FWL_ERR_Indefinite; }
-};
-FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget* pTarget);
-FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget);
-FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime);
-FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime);
-typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info);
-FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver,
-                    FWLMessageHookCallback callback,
-                    void* info);
-
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_NOTE_H_
diff --git a/xfa/include/fwl/core/fwl_panel.h b/xfa/include/fwl/core/fwl_panel.h
deleted file mode 100644
index 4e0b7a3..0000000
--- a/xfa/include/fwl/core/fwl_panel.h
+++ /dev/null
@@ -1,42 +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
-
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_PANEL_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_PANEL_H_
-
-#include "xfa/fwl/core/fwl_widgetimp.h"
-
-class IFWL_Content;
-
-#define FWL_CLASS_Panel L"FWL_Panel"
-#define FWL_CLASSHASH_Panel 881567292
-
-class IFWL_Panel : public IFWL_Widget {
- public:
-  static IFWL_Panel* Create(CFWL_WidgetImpProperties& properties,
-                            IFWL_Widget* pOuter);
-
-  IFWL_Content* GetContent();
-  FWL_ERR SetContent(IFWL_Content* pContent);
-
- protected:
-  IFWL_Panel();
-};
-
-class IFWL_CustomPanel : public IFWL_Widget {
- public:
-  static IFWL_CustomPanel* Create(CFWL_WidgetImpProperties& properties,
-                                  IFWL_Widget* pOuter);
-
-  IFWL_Content* GetContent();
-  FWL_ERR SetContent(IFWL_Content* pContent);
-  FWL_ERR SetProxy(IFWL_Proxy* pProxy);
-
- protected:
-  IFWL_CustomPanel();
-};
-
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_PANEL_H_
diff --git a/xfa/include/fwl/core/fwl_widget.h b/xfa/include/fwl/core/fwl_widget.h
deleted file mode 100644
index 5588efe..0000000
--- a/xfa/include/fwl/core/fwl_widget.h
+++ /dev/null
@@ -1,120 +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
-
-#ifndef XFA_INCLUDE_FWL_CORE_FWL_WIDGET_H_
-#define XFA_INCLUDE_FWL_CORE_FWL_WIDGET_H_
-
-#include "xfa/include/fwl/core/fwl_note.h"
-#include "xfa/include/fwl/core/fwl_target.h"
-#include "xfa/include/fwl/core/fwl_widgetdef.h"
-
-class IFWL_ThemeProvider;
-class CFWL_WidgetImpProperties;
-class IFWL_DataProvider;
-class IFWL_Widget;
-class IFWL_WidgetDelegate;
-class IFWL_Custom;
-class IFWL_Proxy;
-class IFWL_Form;
-
-class IFWL_DataProvider {
- public:
-  virtual ~IFWL_DataProvider() {}
-  virtual FWL_ERR GetCaption(IFWL_Widget* pWidget,
-                             CFX_WideString& wsCaption) = 0;
-};
-class IFWL_Widget : public IFWL_Target {
- public:
-  FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
-  FWL_ERR GetGlobalRect(CFX_RectF& rect);
-  FWL_ERR SetWidgetRect(const CFX_RectF& rect);
-  FWL_ERR GetClientRect(CFX_RectF& rect);
-  IFWL_Widget* GetParent();
-  FWL_ERR SetParent(IFWL_Widget* pParent);
-  IFWL_Widget* GetOwner();
-  FWL_ERR SetOwner(IFWL_Widget* pOwner);
-  IFWL_Widget* GetOuter();
-  FX_DWORD GetStyles();
-  FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, FX_DWORD dwStylesRemoved);
-  FX_DWORD GetStylesEx();
-  FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved);
-  FX_DWORD GetStates();
-  FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE);
-  FWL_ERR SetPrivateData(void* module_id,
-                         void* pData,
-                         PD_CALLBACK_FREEDATA callback);
-  void* GetPrivateData(void* module_id);
-  FWL_ERR Update();
-  FWL_ERR LockUpdate();
-  FWL_ERR UnlockUpdate();
-  FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy);
-  FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy);
-  FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt);
-  FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
-  FWL_ERR SetMatrix(const CFX_Matrix& matrix);
-  FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL);
-  IFWL_ThemeProvider* GetThemeProvider();
-  FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider);
-  FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider);
-  IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate);
-  IFWL_NoteThread* GetOwnerThread() const;
-  CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent);
-};
-class IFWL_WidgetDelegate {
- public:
-  virtual ~IFWL_WidgetDelegate() {}
-  virtual int32_t OnProcessMessage(CFWL_Message* pMessage) = 0;
-  virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent) = 0;
-  virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
-                               const CFX_Matrix* pMatrix = NULL) = 0;
-};
-class CFWL_WidgetImpProperties {
- public:
-  CFWL_WidgetImpProperties() {
-    m_ctmOnParent.SetIdentity();
-    m_rtWidget.Set(0, 0, 0, 0);
-    m_dwStyles = FWL_WGTSTYLE_Child;
-    m_dwStyleExes = 0;
-    m_dwStates = 0;
-    m_pThemeProvider = NULL;
-    m_pDataProvider = NULL;
-    m_pParent = NULL;
-    m_pOwner = NULL;
-  }
-  CFX_Matrix m_ctmOnParent;
-  CFX_RectF m_rtWidget;
-  FX_DWORD m_dwStyles;
-  FX_DWORD m_dwStyleExes;
-  FX_DWORD m_dwStates;
-  IFWL_ThemeProvider* m_pThemeProvider;
-  IFWL_DataProvider* m_pDataProvider;
-  IFWL_Widget* m_pParent;
-  IFWL_Widget* m_pOwner;
-};
-class IFWL_Custom : public IFWL_Widget {
- public:
-  static IFWL_Custom* Create(const CFWL_WidgetImpProperties& properties,
-                             IFWL_Widget* pOuter);
-
-  FWL_ERR SetProxy(IFWL_Proxy* pProxy);
-
- protected:
-  IFWL_Custom();
-};
-class IFWL_Proxy {
- public:
-  virtual ~IFWL_Proxy() {}
-  virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) = 0;
-  virtual FWL_ERR Update() = 0;
-};
-typedef CFX_MapPtrTemplate<FX_DWORD, FX_DWORD> CFX_MapAccelerators;
-FWL_ERR FWL_Accelerator_SetApp(CFX_MapAccelerators* pMapAccel);
-FWL_ERR FWL_Accelerator_SetThread(CFX_MapAccelerators* pMapAccel);
-FWL_ERR FWL_Accelerator_SetForm(IFWL_Form* pFrom,
-                                CFX_MapAccelerators* pMapAccel);
-FWL_ERR FWL_EnabelWidget(IFWL_Widget* widget, FX_BOOL bEnable);
-
-#endif  // XFA_INCLUDE_FWL_CORE_FWL_WIDGET_H_
diff --git a/xfa/include/fwl/lightwidget/app.h b/xfa/include/fwl/lightwidget/app.h
index ce0c0df..dee8d04 100644
--- a/xfa/include/fwl/lightwidget/app.h
+++ b/xfa/include/fwl/lightwidget/app.h
@@ -7,7 +7,7 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_APP_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_APP_H_
 
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
 
 class CFWL_Theme;
 class IFWL_App;
diff --git a/xfa/include/fwl/lightwidget/barcode.h b/xfa/include/fwl/lightwidget/barcode.h
index 7056f3a..0483de0 100644
--- a/xfa/include/fwl/lightwidget/barcode.h
+++ b/xfa/include/fwl/lightwidget/barcode.h
@@ -7,8 +7,8 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_BARCODE_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_BARCODE_H_
 
-#include "xfa/include/fwl/basewidget/fwl_barcode.h"
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/basewidget/ifwl_barcode.h"
+#include "xfa/fwl/core/fwl_error.h"
 #include "xfa/include/fwl/lightwidget/edit.h"
 
 class CFWL_Widget;
diff --git a/xfa/include/fwl/lightwidget/caret.h b/xfa/include/fwl/lightwidget/caret.h
index be11be1..9f84950 100644
--- a/xfa/include/fwl/lightwidget/caret.h
+++ b/xfa/include/fwl/lightwidget/caret.h
@@ -7,7 +7,8 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_CARET_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_CARET_H_
 
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fxgraphics/cfx_color.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_Caret : public CFWL_Widget {
diff --git a/xfa/include/fwl/lightwidget/checkbox.h b/xfa/include/fwl/lightwidget/checkbox.h
index 3780bad..a691c96 100644
--- a/xfa/include/fwl/lightwidget/checkbox.h
+++ b/xfa/include/fwl/lightwidget/checkbox.h
@@ -7,7 +7,7 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_CHECKBOX_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_CHECKBOX_H_
 
-#include "xfa/include/fwl/basewidget/fwl_checkbox.h"
+#include "xfa/fwl/basewidget/ifwl_checkbox.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_CheckBox : public CFWL_Widget {
diff --git a/xfa/include/fwl/lightwidget/combobox.h b/xfa/include/fwl/lightwidget/combobox.h
index db6db39..4229cc9 100644
--- a/xfa/include/fwl/lightwidget/combobox.h
+++ b/xfa/include/fwl/lightwidget/combobox.h
@@ -10,7 +10,7 @@
 #include <memory>
 #include <vector>
 
-#include "xfa/include/fwl/basewidget/fwl_combobox.h"
+#include "xfa/fwl/basewidget/ifwl_combobox.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_WidgetProperties;
diff --git a/xfa/include/fwl/lightwidget/datetimepicker.h b/xfa/include/fwl/lightwidget/datetimepicker.h
index 22048f3..379883f 100644
--- a/xfa/include/fwl/lightwidget/datetimepicker.h
+++ b/xfa/include/fwl/lightwidget/datetimepicker.h
@@ -7,7 +7,7 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_DATETIMEPICKER_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_DATETIMEPICKER_H_
 
-#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h"
+#include "xfa/fwl/basewidget/ifwl_datetimepicker.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_DateTimePicker : public CFWL_Widget {
diff --git a/xfa/include/fwl/lightwidget/listbox.h b/xfa/include/fwl/lightwidget/listbox.h
index 008f170..69c7d20 100644
--- a/xfa/include/fwl/lightwidget/listbox.h
+++ b/xfa/include/fwl/lightwidget/listbox.h
@@ -10,9 +10,9 @@
 #include <memory>
 #include <vector>
 
-#include "xfa/include/fwl/basewidget/fwl_listbox.h"
-#include "xfa/include/fwl/core/fwl_error.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/basewidget/ifwl_listbox.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_ListItem;
diff --git a/xfa/include/fwl/lightwidget/picturebox.h b/xfa/include/fwl/lightwidget/picturebox.h
index 793eb16..b5c8ae5 100644
--- a/xfa/include/fwl/lightwidget/picturebox.h
+++ b/xfa/include/fwl/lightwidget/picturebox.h
@@ -7,8 +7,8 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_PICTUREBOX_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_PICTUREBOX_H_
 
-#include "xfa/include/fwl/basewidget/fwl_picturebox.h"
-#include "xfa/include/fwl/core/fwl_error.h"
+#include "xfa/fwl/basewidget/ifwl_picturebox.h"
+#include "xfa/fwl/core/fwl_error.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_PictureBox : public CFWL_Widget {
diff --git a/xfa/include/fwl/lightwidget/pushbutton.h b/xfa/include/fwl/lightwidget/pushbutton.h
index d8f5760..abd76f5 100644
--- a/xfa/include/fwl/lightwidget/pushbutton.h
+++ b/xfa/include/fwl/lightwidget/pushbutton.h
@@ -7,7 +7,7 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_PUSHBUTTON_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_PUSHBUTTON_H_
 
-#include "xfa/include/fwl/basewidget/fwl_pushbutton.h"
+#include "xfa/fwl/basewidget/ifwl_pushbutton.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_PushButton : public CFWL_Widget {
diff --git a/xfa/include/fwl/lightwidget/theme.h b/xfa/include/fwl/lightwidget/theme.h
index f47725b..c39b48e 100644
--- a/xfa/include/fwl/lightwidget/theme.h
+++ b/xfa/include/fwl/lightwidget/theme.h
@@ -10,11 +10,15 @@
 #include <memory>
 #include <vector>
 
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_system.h"
 #include "core/include/fxge/fx_dib.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
+#include "xfa/fwl/core/ifwl_themeprovider.h"
 
 class CFWL_WidgetTP;
 class IFWL_Widget;
+class CFWL_ThemePart;
+class CFWL_ThemeText;
 
 class CFWL_Theme : public IFWL_ThemeProvider {
  public:
diff --git a/xfa/include/fwl/lightwidget/tooltipctrl.h b/xfa/include/fwl/lightwidget/tooltipctrl.h
index c446fe4..6a487f2 100644
--- a/xfa/include/fwl/lightwidget/tooltipctrl.h
+++ b/xfa/include/fwl/lightwidget/tooltipctrl.h
@@ -7,7 +7,7 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_TOOLTIPCTRL_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_TOOLTIPCTRL_H_
 
-#include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h"
+#include "xfa/fwl/basewidget/ifwl_tooltip.h"
 #include "xfa/include/fwl/lightwidget/widget.h"
 
 class CFWL_ToolTip : public CFWL_Widget {
diff --git a/xfa/include/fwl/lightwidget/widget.h b/xfa/include/fwl/lightwidget/widget.h
index c10428e..2f7ea64 100644
--- a/xfa/include/fwl/lightwidget/widget.h
+++ b/xfa/include/fwl/lightwidget/widget.h
@@ -7,7 +7,9 @@
 #ifndef XFA_INCLUDE_FWL_LIGHTWIDGET_WIDGET_H_
 #define XFA_INCLUDE_FWL_LIGHTWIDGET_WIDGET_H_
 
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
+#include "xfa/fwl/core/ifwl_widget.h"
 
 class CFWL_Event;
 class CFWL_Message;
diff --git a/xfa/include/fwl/theme/widgettp.h b/xfa/include/fwl/theme/widgettp.h
index 84cf82a..8d3f9ee 100644
--- a/xfa/include/fwl/theme/widgettp.h
+++ b/xfa/include/fwl/theme/widgettp.h
@@ -12,9 +12,8 @@
 
 #include "core/fxcrt/include/fx_coordinates.h"
 #include "core/fxcrt/include/fx_system.h"
-#include "xfa/include/fwl/core/fwl_error.h"
-#include "xfa/include/fwl/core/fwl_theme.h"
-#include "xfa/include/fwl/core/fwl_widget.h"
+#include "xfa/fwl/core/fwl_error.h"
+#include "xfa/fxgraphics/include/cfx_graphics.h"
 #include "xfa/include/fwl/theme/utils.h"
 
 class IFWL_Widget;
@@ -22,6 +21,9 @@
 class IFX_Font;
 class IFX_FontMgr;
 class CFWL_ArrowData;
+class CFWL_ThemeBackground;
+class CFWL_ThemePart;
+class CFWL_ThemeText;
 
 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
 class IFX_FontSourceEnum;