Move xfa/fwl code into namespace pdfium Remove "pdfium::" usage within. Add many temporarily `using` statements in xfa/fwl headers to make the build work. Aso move xfa/fxfa/cxfa_fwltheme.* into namespace pdfium to avoid churn in those files. Bug: 42271761 Change-Id: I362cb50d39a910c7f7f08ec0d95eded00666d4db Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/123333 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@google.com> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp index 9b55b04..ab5afab 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_widget.cpp
@@ -16,9 +16,10 @@ #include "xfa/fxfa/cxfa_ffwidgethandler.h" #include "xfa/fxfa/parser/cxfa_node.h" -#define CHECK_FWL_VKEY_ENUM____(name) \ - static_assert(static_cast<int>(name) == static_cast<int>(XFA_##name), \ - "FWL_VKEYCODE enum mismatch") +#define CHECK_FWL_VKEY_ENUM____(name) \ + static_assert( \ + static_cast<int>(name) == static_cast<int>(pdfium::XFA_##name), \ + "FWL_VKEYCODE enum mismatch") CHECK_FWL_VKEY_ENUM____(FWL_VKEY_Back); CHECK_FWL_VKEY_ENUM____(FWL_VKEY_Tab);
diff --git a/xfa/fwl/cfwl_app.cpp b/xfa/fwl/cfwl_app.cpp index 250fcec..2741b02 100644 --- a/xfa/fwl/cfwl_app.cpp +++ b/xfa/fwl/cfwl_app.cpp
@@ -11,6 +11,8 @@ #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/cfwl_widgetmgr.h" +namespace pdfium { + CFWL_App::CFWL_App(AdapterIface* pAdapter) : m_pAdapter(pAdapter), m_pWidgetMgr(cppgc::MakeGarbageCollected<CFWL_WidgetMgr>( @@ -28,3 +30,5 @@ visitor->Trace(m_pWidgetMgr); visitor->Trace(m_pNoteDriver); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_app.h b/xfa/fwl/cfwl_app.h index b6a76fa..6d91cc4 100644 --- a/xfa/fwl/cfwl_app.h +++ b/xfa/fwl/cfwl_app.h
@@ -14,6 +14,8 @@ #include "v8/include/cppgc/visitor.h" #include "xfa/fwl/cfwl_widgetmgr.h" +namespace pdfium { + class CFWL_NoteDriver; class IFWL_ThemeProvider; @@ -54,4 +56,9 @@ cppgc::Member<CFWL_NoteDriver> m_pNoteDriver; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_App; + #endif // XFA_FWL_CFWL_APP_H_
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index 76ace0e..7091da4 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp
@@ -13,6 +13,8 @@ #include "xfa/fwl/ifwl_themeprovider.h" #include "xfa/fwl/theme/cfwl_utils.h" +namespace pdfium { + CFWL_Barcode::CFWL_Barcode(CFWL_App* app) : CFWL_Edit(app, Properties(), nullptr) {} @@ -182,3 +184,5 @@ m_pBarcodeEngine = CFX_Barcode::Create(m_type); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h index e20a154..3657b83 100644 --- a/xfa/fwl/cfwl_barcode.h +++ b/xfa/fwl/cfwl_barcode.h
@@ -17,6 +17,8 @@ class CFX_Barcode; +namespace pdfium { + class CFWL_Barcode final : public CFWL_Edit { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; @@ -74,4 +76,9 @@ std::unique_ptr<CFX_Barcode> m_pBarcodeEngine; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_Barcode; + #endif // XFA_FWL_CFWL_BARCODE_H_
diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp index a573cae..2dea5d0 100644 --- a/xfa/fwl/cfwl_caret.cpp +++ b/xfa/fwl/cfwl_caret.cpp
@@ -13,6 +13,8 @@ #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { const uint32_t kBlinkPeriodMs = 600; @@ -85,3 +87,5 @@ CFX_RectF rt = GetWidgetRect(); RepaintRect(CFX_RectF(0, 0, rt.width + 1, rt.height)); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_caret.h b/xfa/fwl/cfwl_caret.h index 4c1b395..5d1dbfe 100644 --- a/xfa/fwl/cfwl_caret.h +++ b/xfa/fwl/cfwl_caret.h
@@ -13,6 +13,8 @@ #include "xfa/fgas/graphics/cfgas_gecolor.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_Caret final : public CFWL_Widget, public CFX_Timer::CallbackIface { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; @@ -41,4 +43,9 @@ std::unique_ptr<CFX_Timer> m_pTimer; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_Caret; + #endif // XFA_FWL_CFWL_CARET_H_
diff --git a/xfa/fwl/cfwl_checkbox.cpp b/xfa/fwl/cfwl_checkbox.cpp index fbe0280..b5b4421 100644 --- a/xfa/fwl/cfwl_checkbox.cpp +++ b/xfa/fwl/cfwl_checkbox.cpp
@@ -21,6 +21,8 @@ #include "xfa/fwl/fwl_widgetdef.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { const int kCaptionMargin = 5; @@ -319,3 +321,5 @@ NextStates(); } } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_checkbox.h b/xfa/fwl/cfwl_checkbox.h index 9ab1cb8..9787532 100644 --- a/xfa/fwl/cfwl_checkbox.h +++ b/xfa/fwl/cfwl_checkbox.h
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + #define FWL_STYLEEXT_CKB_3State (1L << 6) #define FWL_STYLEEXT_CKB_RadioButton (1L << 7) #define FWL_STYLEEXT_CKB_SignShapeCheck 0 @@ -72,4 +74,9 @@ float m_fBoxHeight = 16.0f; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_CheckBox; + #endif // XFA_FWL_CFWL_CHECKBOX_H_
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp index 7653b83..86103ba 100644 --- a/xfa/fwl/cfwl_combobox.cpp +++ b/xfa/fwl/cfwl_combobox.cpp
@@ -25,6 +25,8 @@ #include "xfa/fwl/fwl_widgetdef.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + CFWL_ComboBox::CFWL_ComboBox(CFWL_App* app) : CFWL_Widget(app, Properties(), nullptr), m_pEdit(cppgc::MakeGarbageCollected<CFWL_ComboEdit>( @@ -527,3 +529,5 @@ GetWidgetMgr()->GetAdapterPopupPos(this, fMinHeight, fMaxHeight, rtAnchor, pPopupRect); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h index efe9c8c..3f84659 100644 --- a/xfa/fwl/cfwl_combobox.h +++ b/xfa/fwl/cfwl_combobox.h
@@ -13,6 +13,8 @@ #include "xfa/fwl/cfwl_listbox.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + #define FWL_STYLEEXT_CMB_DropDown (1L << 0) #define FWL_STYLEEXT_CMB_Sort (1L << 1) #define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) @@ -122,4 +124,9 @@ Mask<CFWL_PartState> m_iBtnState = CFWL_PartState::kNormal; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ComboBox; + #endif // XFA_FWL_CFWL_COMBOBOX_H_
diff --git a/xfa/fwl/cfwl_comboedit.cpp b/xfa/fwl/cfwl_comboedit.cpp index 0be03d3..bc52632 100644 --- a/xfa/fwl/cfwl_comboedit.cpp +++ b/xfa/fwl/cfwl_comboedit.cpp
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_combobox.h" #include "xfa/fwl/cfwl_messagemouse.h" +namespace pdfium { + CFWL_ComboEdit::CFWL_ComboEdit(CFWL_App* app, const Properties& properties, CFWL_Widget* pOuter) @@ -54,3 +56,5 @@ if (backDefault) CFWL_Edit::OnProcessMessage(pMessage); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_comboedit.h b/xfa/fwl/cfwl_comboedit.h index 91e7f35..4c1ddcd 100644 --- a/xfa/fwl/cfwl_comboedit.h +++ b/xfa/fwl/cfwl_comboedit.h
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_edit.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_ComboEdit final : public CFWL_Edit { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; @@ -27,4 +29,9 @@ CFWL_Widget* pOuter); }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ComboEdit; + #endif // XFA_FWL_CFWL_COMBOEDIT_H_
diff --git a/xfa/fwl/cfwl_combolist.cpp b/xfa/fwl/cfwl_combolist.cpp index a9d19e5..4dd75a0 100644 --- a/xfa/fwl/cfwl_combolist.cpp +++ b/xfa/fwl/cfwl_combolist.cpp
@@ -15,6 +15,8 @@ #include "xfa/fwl/cfwl_messagemouse.h" #include "xfa/fwl/fwl_widgetdef.h" +namespace pdfium { + CFWL_ComboList::CFWL_ComboList(CFWL_App* app, const Properties& properties, CFWL_Widget* pOuter) @@ -227,3 +229,5 @@ break; } } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_combolist.h b/xfa/fwl/cfwl_combolist.h index 7ee2737..fecb996 100644 --- a/xfa/fwl/cfwl_combolist.h +++ b/xfa/fwl/cfwl_combolist.h
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_listbox.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_ComboList final : public CFWL_ListBox { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; @@ -37,4 +39,9 @@ bool m_bNotifyOwner = true; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ComboList; + #endif // XFA_FWL_CFWL_COMBOLIST_H_
diff --git a/xfa/fwl/cfwl_datetimeedit.cpp b/xfa/fwl/cfwl_datetimeedit.cpp index 2acf690..a7ff042 100644 --- a/xfa/fwl/cfwl_datetimeedit.cpp +++ b/xfa/fwl/cfwl_datetimeedit.cpp
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_messagemouse.h" #include "xfa/fwl/cfwl_widgetmgr.h" +namespace pdfium { + CFWL_DateTimeEdit::CFWL_DateTimeEdit(CFWL_App* app, const Properties& properties, CFWL_Widget* pOuter) @@ -40,3 +42,5 @@ } CFWL_Edit::OnProcessMessage(pMessage); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_datetimeedit.h b/xfa/fwl/cfwl_datetimeedit.h index a34d790..1549383 100644 --- a/xfa/fwl/cfwl_datetimeedit.h +++ b/xfa/fwl/cfwl_datetimeedit.h
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_edit.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_DateTimeEdit final : public CFWL_Edit { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; @@ -24,4 +26,9 @@ CFWL_Widget* pOuter); }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_DateTimeEdit; + #endif // XFA_FWL_CFWL_DATETIMEEDIT_H_
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp index 8d9bf7e..f6ad162 100644 --- a/xfa/fwl/cfwl_datetimepicker.cpp +++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -16,6 +16,8 @@ #include "xfa/fwl/cfwl_widgetmgr.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { constexpr int kDateTimePickerHeight = 20; @@ -463,3 +465,5 @@ bool CFWL_DateTimePicker::CanRedo() { return m_pEdit->CanRedo(); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h index 5e1d248..74e17bd 100644 --- a/xfa/fwl/cfwl_datetimepicker.h +++ b/xfa/fwl/cfwl_datetimepicker.h
@@ -15,6 +15,8 @@ #include "xfa/fwl/cfwl_monthcalendar.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + #define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1) #define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4) #define FWL_STYLEEXT_DTP_EditHNear (0L << 4) @@ -110,4 +112,9 @@ cppgc::Member<CFWL_MonthCalendar> const m_pMonthCal; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_DateTimePicker; + #endif // XFA_FWL_CFWL_DATETIMEPICKER_H_
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index 0f41681..8cd5999 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp
@@ -35,6 +35,8 @@ #include "xfa/fwl/ifwl_themeprovider.h" #include "xfa/fwl/theme/cfwl_utils.h" +namespace pdfium { + namespace { constexpr int kEditMargin = 3; @@ -346,8 +348,7 @@ size_t count; std::tie(sel_start, count) = m_pEditEngine->GetSelection(); std::vector<CFX_RectF> rects = m_pEditEngine->GetCharacterRectsInRange( - pdfium::checked_cast<int32_t>(sel_start), - pdfium::checked_cast<int32_t>(count)); + checked_cast<int32_t>(sel_start), checked_cast<int32_t>(count)); CFGAS_GEPath path; for (auto& rect : rects) { @@ -757,7 +758,7 @@ int32_t bidi_level; if (m_pEditEngine->CanGenerateCharacterInfo()) { std::tie(bidi_level, m_CaretRect) = m_pEditEngine->GetCharacterInfo( - pdfium::checked_cast<int32_t>(m_CursorPosition)); + checked_cast<int32_t>(m_CursorPosition)); } else { bidi_level = 0; m_CaretRect = CFX_RectF(); @@ -1115,3 +1116,5 @@ RepaintRect(CFX_RectF(0, 0, rect.width + 2, rect.height + 2)); return true; } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h index 66d8664..00502dd 100644 --- a/xfa/fwl/cfwl_edit.h +++ b/xfa/fwl/cfwl_edit.h
@@ -16,6 +16,10 @@ #include "xfa/fwl/cfwl_scrollbar.h" #include "xfa/fwl/cfwl_widget.h" +class CFX_RenderDevice; + +namespace pdfium { + #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) @@ -41,7 +45,6 @@ class CFWL_MessageKey; class CFWL_MessageMouse; class CFWL_Caret; -class CFX_RenderDevice; class CFWL_Edit : public CFWL_Widget, public CFDE_TextEditEngine::Delegate { public: @@ -163,4 +166,9 @@ WideString m_wsFont; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_Edit; + #endif // XFA_FWL_CFWL_EDIT_H_
diff --git a/xfa/fwl/cfwl_edit_embeddertest.cpp b/xfa/fwl/cfwl_edit_embeddertest.cpp index eae4000..1caaf32 100644 --- a/xfa/fwl/cfwl_edit_embeddertest.cpp +++ b/xfa/fwl/cfwl_edit_embeddertest.cpp
@@ -16,6 +16,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/xfa_js_embedder_test.h" +namespace pdfium { + namespace { const char kEmailRecommendedFilledChecksum[] = @@ -318,3 +320,5 @@ // CompareBitmap(page_bitmap.get(), 612, 792, kFilledMD5); } } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_event.cpp b/xfa/fwl/cfwl_event.cpp index 24321bb..0bb0898 100644 --- a/xfa/fwl/cfwl_event.cpp +++ b/xfa/fwl/cfwl_event.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_event.h" +namespace pdfium { + CFWL_Event::CFWL_Event(CFWL_Event::Type type) : m_type(type) {} CFWL_Event::CFWL_Event(Type type, CFWL_Widget* pSrcTarget) @@ -17,3 +19,5 @@ : m_type(type), m_pSrcTarget(pSrcTarget), m_pDstTarget(pDstTarget) {} CFWL_Event::~CFWL_Event() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_event.h b/xfa/fwl/cfwl_event.h index ab9606d..0a72351 100644 --- a/xfa/fwl/cfwl_event.h +++ b/xfa/fwl/cfwl_event.h
@@ -10,6 +10,8 @@ #include "core/fxcrt/unowned_ptr.h" #include "v8/include/cppgc/macros.h" +namespace pdfium { + class CFWL_Widget; class CFWL_Event { @@ -46,4 +48,9 @@ UnownedPtr<CFWL_Widget> const m_pDstTarget; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_Event; + #endif // XFA_FWL_CFWL_EVENT_H_
diff --git a/xfa/fwl/cfwl_eventmouse.cpp b/xfa/fwl/cfwl_eventmouse.cpp index 2182e40..2eb0051 100644 --- a/xfa/fwl/cfwl_eventmouse.cpp +++ b/xfa/fwl/cfwl_eventmouse.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_eventmouse.h" +namespace pdfium { + CFWL_EventMouse::CFWL_EventMouse(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget, CFWL_MessageMouse::MouseCommand cmd) @@ -13,3 +15,5 @@ m_dwCmd(cmd) {} CFWL_EventMouse::~CFWL_EventMouse() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_eventmouse.h b/xfa/fwl/cfwl_eventmouse.h index 5764e93..e4ade64 100644 --- a/xfa/fwl/cfwl_eventmouse.h +++ b/xfa/fwl/cfwl_eventmouse.h
@@ -10,6 +10,8 @@ #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_messagemouse.h" +namespace pdfium { + class CFWL_EventMouse final : public CFWL_Event { public: CFWL_EventMouse(CFWL_Widget* pSrcTarget, @@ -23,4 +25,9 @@ const CFWL_MessageMouse::MouseCommand m_dwCmd; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_EventMouse; + #endif // XFA_FWL_CFWL_EVENTMOUSE_H_
diff --git a/xfa/fwl/cfwl_eventscroll.cpp b/xfa/fwl/cfwl_eventscroll.cpp index 11df109..e4f629f 100644 --- a/xfa/fwl/cfwl_eventscroll.cpp +++ b/xfa/fwl/cfwl_eventscroll.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_eventscroll.h" +namespace pdfium { + CFWL_EventScroll::CFWL_EventScroll(CFWL_Widget* pSrcTarget, Code code, float pos) @@ -14,3 +16,5 @@ m_fPos(pos) {} CFWL_EventScroll::~CFWL_EventScroll() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_eventscroll.h b/xfa/fwl/cfwl_eventscroll.h index ce97b0b..1001b51 100644 --- a/xfa/fwl/cfwl_eventscroll.h +++ b/xfa/fwl/cfwl_eventscroll.h
@@ -9,6 +9,8 @@ #include "xfa/fwl/cfwl_event.h" +namespace pdfium { + class CFWL_EventScroll final : public CFWL_Event { public: enum class Code { @@ -35,4 +37,9 @@ const float m_fPos; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_EventScroll; + #endif // XFA_FWL_CFWL_EVENTSCROLL_H_
diff --git a/xfa/fwl/cfwl_eventselectchanged.cpp b/xfa/fwl/cfwl_eventselectchanged.cpp index e385a9c..760596c 100644 --- a/xfa/fwl/cfwl_eventselectchanged.cpp +++ b/xfa/fwl/cfwl_eventselectchanged.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_eventselectchanged.h" +namespace pdfium { + CFWL_EventSelectChanged::CFWL_EventSelectChanged(CFWL_Widget* pSrcTarget, bool bLButtonUp) : CFWL_Event(CFWL_Event::Type::SelectChanged, pSrcTarget), @@ -25,3 +27,5 @@ m_iDay(iDay) {} CFWL_EventSelectChanged::~CFWL_EventSelectChanged() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_eventselectchanged.h b/xfa/fwl/cfwl_eventselectchanged.h index 8f79fe3..2aa0376 100644 --- a/xfa/fwl/cfwl_eventselectchanged.h +++ b/xfa/fwl/cfwl_eventselectchanged.h
@@ -11,6 +11,8 @@ #include "xfa/fwl/cfwl_event.h" +namespace pdfium { + class CFWL_EventSelectChanged final : public CFWL_Event { public: CFWL_EventSelectChanged(CFWL_Widget* pSrcTarget, bool bLButtonUp); @@ -35,4 +37,9 @@ const int32_t m_iDay; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_EventSelectChanged; + #endif // XFA_FWL_CFWL_EVENTSELECTCHANGED_H_
diff --git a/xfa/fwl/cfwl_eventtextwillchange.cpp b/xfa/fwl/cfwl_eventtextwillchange.cpp index 6052cb7..cbed5a3 100644 --- a/xfa/fwl/cfwl_eventtextwillchange.cpp +++ b/xfa/fwl/cfwl_eventtextwillchange.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_eventtextwillchange.h" +namespace pdfium { + CFWL_EventTextWillChange::CFWL_EventTextWillChange( CFWL_Widget* pSrcTarget, const WideString& change_text, @@ -19,3 +21,5 @@ selection_end_(selection_end) {} CFWL_EventTextWillChange::~CFWL_EventTextWillChange() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_eventtextwillchange.h b/xfa/fwl/cfwl_eventtextwillchange.h index 65c0d89..851eae5 100644 --- a/xfa/fwl/cfwl_eventtextwillchange.h +++ b/xfa/fwl/cfwl_eventtextwillchange.h
@@ -10,6 +10,8 @@ #include "core/fxcrt/widestring.h" #include "xfa/fwl/cfwl_event.h" +namespace pdfium { + class CFWL_EventTextWillChange final : public CFWL_Event { public: CFWL_EventTextWillChange(CFWL_Widget* pSrcTarget, @@ -45,4 +47,9 @@ bool cancelled_ = false; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_EventTextWillChange; + #endif // XFA_FWL_CFWL_EVENTTEXTWILLCHANGE_H_
diff --git a/xfa/fwl/cfwl_eventvalidate.cpp b/xfa/fwl/cfwl_eventvalidate.cpp index 37a3ee7..2db1789 100644 --- a/xfa/fwl/cfwl_eventvalidate.cpp +++ b/xfa/fwl/cfwl_eventvalidate.cpp
@@ -6,9 +6,13 @@ #include "xfa/fwl/cfwl_eventvalidate.h" +namespace pdfium { + CFWL_EventValidate::CFWL_EventValidate(CFWL_Widget* pSrcTarget, const WideString& wsInsert) : CFWL_Event(CFWL_Event::Type::Validate, pSrcTarget), m_wsInsert(wsInsert) {} CFWL_EventValidate::~CFWL_EventValidate() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_eventvalidate.h b/xfa/fwl/cfwl_eventvalidate.h index de2b722..c1507aa 100644 --- a/xfa/fwl/cfwl_eventvalidate.h +++ b/xfa/fwl/cfwl_eventvalidate.h
@@ -10,6 +10,8 @@ #include "core/fxcrt/widestring.h" #include "xfa/fwl/cfwl_event.h" +namespace pdfium { + class CFWL_EventValidate final : public CFWL_Event { public: CFWL_EventValidate(CFWL_Widget* pSrcTarget, const WideString& wsInsert); @@ -24,4 +26,9 @@ bool m_bValidate = true; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_EventValidate; + #endif // XFA_FWL_CFWL_EVENTVALIDATE_H_
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index df55f21..f7940bb 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp
@@ -25,6 +25,8 @@ #include "xfa/fwl/fwl_widgetdef.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { const int kItemTextMargin = 2; @@ -824,7 +826,7 @@ return candidate.get() == pItem; }); return it != m_ItemArray.end() - ? pdfium::checked_cast<int32_t>(it - m_ItemArray.begin()) + ? checked_cast<int32_t>(it - m_ItemArray.begin()) : -1; } @@ -862,3 +864,5 @@ CFWL_ListBox::Item::Item(const WideString& text) : m_wsText(text) {} CFWL_ListBox::Item::~Item() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h index 2236842..9d8aa17 100644 --- a/xfa/fwl/cfwl_listbox.h +++ b/xfa/fwl/cfwl_listbox.h
@@ -17,6 +17,8 @@ #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/fwl_widgetdef.h" +namespace pdfium { + #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) @@ -141,4 +143,9 @@ UnownedPtr<Item> m_hAnchor; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ListBox; + #endif // XFA_FWL_CFWL_LISTBOX_H_
diff --git a/xfa/fwl/cfwl_message.cpp b/xfa/fwl/cfwl_message.cpp index d388f7e..a7f78ac 100644 --- a/xfa/fwl/cfwl_message.cpp +++ b/xfa/fwl/cfwl_message.cpp
@@ -6,7 +6,11 @@ #include "xfa/fwl/cfwl_message.h" +namespace pdfium { + CFWL_Message::CFWL_Message(Type type, CFWL_Widget* pDstTarget) : m_type(type), m_pDstTarget(pDstTarget) {} CFWL_Message::~CFWL_Message() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_message.h b/xfa/fwl/cfwl_message.h index 3a8d53d..aa8e198 100644 --- a/xfa/fwl/cfwl_message.h +++ b/xfa/fwl/cfwl_message.h
@@ -11,6 +11,8 @@ #include "core/fxcrt/unowned_ptr.h" #include "v8/include/cppgc/macros.h" +namespace pdfium { + class CFWL_Widget; class CFWL_Message { @@ -35,4 +37,9 @@ UnownedPtr<CFWL_Widget> m_pDstTarget; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_Message; + #endif // XFA_FWL_CFWL_MESSAGE_H_
diff --git a/xfa/fwl/cfwl_messagekey.cpp b/xfa/fwl/cfwl_messagekey.cpp index 2e9269d..65b67df 100644 --- a/xfa/fwl/cfwl_messagekey.cpp +++ b/xfa/fwl/cfwl_messagekey.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_messagekey.h" +namespace pdfium { + CFWL_MessageKey::CFWL_MessageKey(CFWL_Widget* pDstTarget, KeyCommand cmd, Mask<XFA_FWL_KeyFlag> flags, @@ -16,3 +18,5 @@ m_dwKeyCodeOrChar(dwKeyCodeOrChar) {} CFWL_MessageKey::~CFWL_MessageKey() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_messagekey.h b/xfa/fwl/cfwl_messagekey.h index 96f4610..20004a1 100644 --- a/xfa/fwl/cfwl_messagekey.h +++ b/xfa/fwl/cfwl_messagekey.h
@@ -11,6 +11,8 @@ #include "xfa/fwl/cfwl_message.h" #include "xfa/fwl/fwl_widgetdef.h" +namespace pdfium { + class CFWL_MessageKey final : public CFWL_Message { public: enum class KeyCommand : uint8_t { kKeyDown, kChar }; @@ -26,4 +28,9 @@ const uint32_t m_dwKeyCodeOrChar; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_MessageKey; + #endif // XFA_FWL_CFWL_MESSAGEKEY_H_
diff --git a/xfa/fwl/cfwl_messagekillfocus.cpp b/xfa/fwl/cfwl_messagekillfocus.cpp index a6c0649..dde8096 100644 --- a/xfa/fwl/cfwl_messagekillfocus.cpp +++ b/xfa/fwl/cfwl_messagekillfocus.cpp
@@ -6,7 +6,11 @@ #include "xfa/fwl/cfwl_messagekillfocus.h" +namespace pdfium { + CFWL_MessageKillFocus::CFWL_MessageKillFocus(CFWL_Widget* pDstTarget) : CFWL_Message(CFWL_Message::Type::kKillFocus, pDstTarget) {} CFWL_MessageKillFocus::~CFWL_MessageKillFocus() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_messagekillfocus.h b/xfa/fwl/cfwl_messagekillfocus.h index 996fc10..7e1eaf1 100644 --- a/xfa/fwl/cfwl_messagekillfocus.h +++ b/xfa/fwl/cfwl_messagekillfocus.h
@@ -10,6 +10,8 @@ #include "core/fxcrt/unowned_ptr.h" #include "xfa/fwl/cfwl_message.h" +namespace pdfium { + class CFWL_MessageKillFocus final : public CFWL_Message { public: explicit CFWL_MessageKillFocus(CFWL_Widget* pDstTarget); @@ -23,4 +25,9 @@ UnownedPtr<CFWL_Widget> m_pSetFocus; // Ok, stack-only. }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_MessageKillFocus; + #endif // XFA_FWL_CFWL_MESSAGEKILLFOCUS_H_
diff --git a/xfa/fwl/cfwl_messagemouse.cpp b/xfa/fwl/cfwl_messagemouse.cpp index 50aa801..1095256 100644 --- a/xfa/fwl/cfwl_messagemouse.cpp +++ b/xfa/fwl/cfwl_messagemouse.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_messagemouse.h" +namespace pdfium { + CFWL_MessageMouse::CFWL_MessageMouse(CFWL_Widget* pDstTarget, MouseCommand cmd, Mask<XFA_FWL_KeyFlag> flags, @@ -16,3 +18,5 @@ m_pos(pos) {} CFWL_MessageMouse::~CFWL_MessageMouse() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_messagemouse.h b/xfa/fwl/cfwl_messagemouse.h index fda7668..fd3383b 100644 --- a/xfa/fwl/cfwl_messagemouse.h +++ b/xfa/fwl/cfwl_messagemouse.h
@@ -12,6 +12,8 @@ #include "xfa/fwl/cfwl_message.h" #include "xfa/fwl/fwl_widgetdef.h" +namespace pdfium { + class CFWL_MessageMouse final : public CFWL_Message { public: enum class MouseCommand : uint8_t { @@ -38,4 +40,9 @@ CFX_PointF m_pos; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_MessageMouse; + #endif // XFA_FWL_CFWL_MESSAGEMOUSE_H_
diff --git a/xfa/fwl/cfwl_messagemousewheel.cpp b/xfa/fwl/cfwl_messagemousewheel.cpp index 8eb51cb..40b0888 100644 --- a/xfa/fwl/cfwl_messagemousewheel.cpp +++ b/xfa/fwl/cfwl_messagemousewheel.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_messagemousewheel.h" +namespace pdfium { + CFWL_MessageMouseWheel::CFWL_MessageMouseWheel(CFWL_Widget* destination, const CFX_PointF& pos, const CFX_Vector& delta) @@ -14,3 +16,5 @@ delta_(delta) {} CFWL_MessageMouseWheel::~CFWL_MessageMouseWheel() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_messagemousewheel.h b/xfa/fwl/cfwl_messagemousewheel.h index e0ea1c6..fd960de 100644 --- a/xfa/fwl/cfwl_messagemousewheel.h +++ b/xfa/fwl/cfwl_messagemousewheel.h
@@ -10,6 +10,8 @@ #include "core/fxcrt/fx_coordinates.h" #include "xfa/fwl/cfwl_message.h" +namespace pdfium { + class CFWL_MessageMouseWheel final : public CFWL_Message { public: CFWL_MessageMouseWheel(CFWL_Widget* destination, @@ -27,4 +29,9 @@ const CFX_Vector delta_; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_MessageMouseWheel; + #endif // XFA_FWL_CFWL_MESSAGEMOUSEWHEEL_H_
diff --git a/xfa/fwl/cfwl_messagesetfocus.cpp b/xfa/fwl/cfwl_messagesetfocus.cpp index 01b74b2..bb7a651 100644 --- a/xfa/fwl/cfwl_messagesetfocus.cpp +++ b/xfa/fwl/cfwl_messagesetfocus.cpp
@@ -6,7 +6,11 @@ #include "xfa/fwl/cfwl_messagesetfocus.h" +namespace pdfium { + CFWL_MessageSetFocus::CFWL_MessageSetFocus(CFWL_Widget* pDstTarget) : CFWL_Message(CFWL_Message::Type::kSetFocus, pDstTarget) {} CFWL_MessageSetFocus::~CFWL_MessageSetFocus() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_messagesetfocus.h b/xfa/fwl/cfwl_messagesetfocus.h index 2a4f76d..5672ed6 100644 --- a/xfa/fwl/cfwl_messagesetfocus.h +++ b/xfa/fwl/cfwl_messagesetfocus.h
@@ -9,10 +9,17 @@ #include "xfa/fwl/cfwl_message.h" +namespace pdfium { + class CFWL_MessageSetFocus final : public CFWL_Message { public: explicit CFWL_MessageSetFocus(CFWL_Widget* pDstTarget); ~CFWL_MessageSetFocus() override; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_MessageSetFocus; + #endif // XFA_FWL_CFWL_MESSAGESETFOCUS_H_
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp index 6ecf020..2a9248c 100644 --- a/xfa/fwl/cfwl_monthcalendar.cpp +++ b/xfa/fwl/cfwl_monthcalendar.cpp
@@ -23,6 +23,8 @@ #include "xfa/fwl/cfwl_themetext.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { constexpr float kMonthCalHSepHeight = 1.0f; @@ -464,7 +466,7 @@ const bool bFlagged = m_iYear == m_iCurYear && m_iMonth == m_iCurMonth && m_iDay == i + 1; - const bool bSelected = pdfium::Contains(m_SelDayArray, i + 1); + const bool bSelected = Contains(m_SelDayArray, i + 1); m_DateArray.push_back( std::make_unique<DATEINFO>(i + 1, iDayOfWeek, bFlagged, bSelected, WideString::FormatInteger(i + 1))); @@ -528,8 +530,9 @@ void CFWL_MonthCalendar::AddSelDay(int32_t iDay) { DCHECK(iDay > 0); - if (!pdfium::Contains(m_SelDayArray, iDay)) + if (!Contains(m_SelDayArray, iDay)) { return; + } RemoveSelDay(); if (iDay <= fxcrt::CollectionSize<int32_t>(m_DateArray)) @@ -547,8 +550,9 @@ return; } - if (!pdfium::Contains(m_SelDayArray, m_iDay)) + if (!Contains(m_SelDayArray, m_iDay)) { AddSelDay(m_iDay); + } } WideString CFWL_MonthCalendar::GetHeadText(int32_t iYear, int32_t iMonth) { @@ -732,3 +736,5 @@ dwStates |= CFWL_PartState::kSelected; return dwStates; } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_monthcalendar.h b/xfa/fwl/cfwl_monthcalendar.h index c7c7183..6575f4c 100644 --- a/xfa/fwl/cfwl_monthcalendar.h +++ b/xfa/fwl/cfwl_monthcalendar.h
@@ -14,6 +14,8 @@ #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_MessageMouse; class CFWL_MonthCalendar final : public CFWL_Widget { @@ -157,4 +159,9 @@ CFX_RectF m_ClientRect; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_MonthCalendar; + #endif // XFA_FWL_CFWL_MONTHCALENDAR_H_
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp index 348ef5f..d65dc38 100644 --- a/xfa/fwl/cfwl_notedriver.cpp +++ b/xfa/fwl/cfwl_notedriver.cpp
@@ -22,6 +22,8 @@ #include "xfa/fwl/cfwl_widgetmgr.h" #include "xfa/fwl/fwl_widgetdef.h" +namespace pdfium { + namespace { uint64_t g_next_listener_key = 1; @@ -274,3 +276,5 @@ pDelegate->OnProcessEvent(pEvent); return true; } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_notedriver.h b/xfa/fwl/cfwl_notedriver.h index 90b9cec..1f3f6d8 100644 --- a/xfa/fwl/cfwl_notedriver.h +++ b/xfa/fwl/cfwl_notedriver.h
@@ -18,6 +18,8 @@ #include "xfa/fgas/graphics/cfgas_gegraphics.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_Event; class CFWL_NoteDriver final : public cppgc::GarbageCollected<CFWL_NoteDriver> { @@ -71,4 +73,9 @@ std::map<uint64_t, cppgc::Member<Target>> m_eventTargets; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_NoteDriver; + #endif // XFA_FWL_CFWL_NOTEDRIVER_H_
diff --git a/xfa/fwl/cfwl_picturebox.cpp b/xfa/fwl/cfwl_picturebox.cpp index 6e864db..c5c60ac 100644 --- a/xfa/fwl/cfwl_picturebox.cpp +++ b/xfa/fwl/cfwl_picturebox.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_picturebox.h" +namespace pdfium { + CFWL_PictureBox::CFWL_PictureBox(CFWL_App* app) : CFWL_Widget(app, CFWL_Widget::Properties(), nullptr) {} @@ -35,3 +37,5 @@ const CFX_Matrix& matrix) { DrawWidget(pGraphics, matrix); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_picturebox.h b/xfa/fwl/cfwl_picturebox.h index 944bcb2..dc00cca 100644 --- a/xfa/fwl/cfwl_picturebox.h +++ b/xfa/fwl/cfwl_picturebox.h
@@ -9,6 +9,8 @@ #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + class CFWL_PictureBox final : public CFWL_Widget { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED; @@ -30,4 +32,9 @@ CFX_Matrix m_matrix; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_PictureBox; + #endif // XFA_FWL_CFWL_PICTUREBOX_H_
diff --git a/xfa/fwl/cfwl_pushbutton.cpp b/xfa/fwl/cfwl_pushbutton.cpp index 715b420..fa0fbc4 100644 --- a/xfa/fwl/cfwl_pushbutton.cpp +++ b/xfa/fwl/cfwl_pushbutton.cpp
@@ -17,6 +17,8 @@ #include "xfa/fwl/fwl_widgetdef.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + CFWL_PushButton::CFWL_PushButton(CFWL_App* app) : CFWL_Widget(app, Properties(), nullptr) {} @@ -215,3 +217,5 @@ CFWL_Event wmClick(CFWL_Event::Type::Click, this); DispatchEvent(&wmClick); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_pushbutton.h b/xfa/fwl/cfwl_pushbutton.h index 412e5bc..ae665ad 100644 --- a/xfa/fwl/cfwl_pushbutton.h +++ b/xfa/fwl/cfwl_pushbutton.h
@@ -9,6 +9,8 @@ #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + #define FWL_STATE_PSB_Hovered (1 << FWL_STATE_WGT_MAX) #define FWL_STATE_PSB_Pressed (1 << (FWL_STATE_WGT_MAX + 1)) #define FWL_STATE_PSB_Default (1 << (FWL_STATE_WGT_MAX + 2)) @@ -50,4 +52,9 @@ CFX_RectF m_CaptionRect; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_PushButton; + #endif // XFA_FWL_CFWL_PUSHBUTTON_H_
diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp index 4bf4b36..206b731 100644 --- a/xfa/fwl/cfwl_scrollbar.cpp +++ b/xfa/fwl/cfwl_scrollbar.cpp
@@ -18,6 +18,8 @@ #include "xfa/fwl/cfwl_themepart.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { constexpr int kScrollbarElapsedMsecs = 500; @@ -465,3 +467,5 @@ std::make_unique<CFX_Timer>(GetFWLApp()->GetTimerHandler(), this, 0); } } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_scrollbar.h b/xfa/fwl/cfwl_scrollbar.h index fa0bfcd..9af8517 100644 --- a/xfa/fwl/cfwl_scrollbar.h +++ b/xfa/fwl/cfwl_scrollbar.h
@@ -17,6 +17,8 @@ #include "xfa/fwl/cfwl_themepart.h" #include "xfa/fwl/cfwl_widget.h" +namespace pdfium { + #define FWL_STYLEEXT_SCB_Horz (0L << 0) #define FWL_STYLEEXT_SCB_Vert (1L << 0) @@ -127,4 +129,9 @@ std::unique_ptr<CFX_Timer> m_pTimer; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ScrollBar; + #endif // XFA_FWL_CFWL_SCROLLBAR_H_
diff --git a/xfa/fwl/cfwl_themebackground.cpp b/xfa/fwl/cfwl_themebackground.cpp index 87500ac..b883a04 100644 --- a/xfa/fwl/cfwl_themebackground.cpp +++ b/xfa/fwl/cfwl_themebackground.cpp
@@ -6,9 +6,13 @@ #include "xfa/fwl/cfwl_themebackground.h" +namespace pdfium { + CFWL_ThemeBackground::CFWL_ThemeBackground(Part iPart, CFWL_Widget* pWidget, CFGAS_GEGraphics* pGraphics) : CFWL_ThemePart(iPart, pWidget), m_pGraphics(pGraphics) {} CFWL_ThemeBackground::~CFWL_ThemeBackground() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h index 704ef43..b376078 100644 --- a/xfa/fwl/cfwl_themebackground.h +++ b/xfa/fwl/cfwl_themebackground.h
@@ -14,6 +14,8 @@ class CFGAS_GEGraphics; class CFGAS_GEPath; +namespace pdfium { + class CFWL_ThemeBackground final : public CFWL_ThemePart { public: FX_STACK_ALLOCATED(); @@ -32,4 +34,9 @@ UnownedPtr<CFGAS_GEGraphics> const m_pGraphics; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ThemeBackground; + #endif // XFA_FWL_CFWL_THEMEBACKGROUND_H_
diff --git a/xfa/fwl/cfwl_themepart.cpp b/xfa/fwl/cfwl_themepart.cpp index 7294a1a..70cafbb 100644 --- a/xfa/fwl/cfwl_themepart.cpp +++ b/xfa/fwl/cfwl_themepart.cpp
@@ -6,6 +6,8 @@ #include "xfa/fwl/cfwl_themepart.h" +namespace pdfium { + CFWL_ThemePart::CFWL_ThemePart(Part iPart, CFWL_Widget* pWidget) : m_iPart(iPart), m_pWidget(pWidget) {} @@ -20,3 +22,5 @@ return FWLTHEME_STATE::kHover; return FWLTHEME_STATE::kNormal; } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_themepart.h b/xfa/fwl/cfwl_themepart.h index 25f8a7f..cf271a0 100644 --- a/xfa/fwl/cfwl_themepart.h +++ b/xfa/fwl/cfwl_themepart.h
@@ -15,6 +15,8 @@ #include "core/fxcrt/unowned_ptr.h" #include "xfa/fwl/theme/cfwl_utils.h" +namespace pdfium { + class CFWL_Widget; enum class CFWL_PartState : uint16_t { @@ -103,4 +105,10 @@ UnownedPtr<CFWL_Widget> const m_pWidget; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_PartState; +using pdfium::CFWL_ThemePart; + #endif // XFA_FWL_CFWL_THEMEPART_H_
diff --git a/xfa/fwl/cfwl_themetext.cpp b/xfa/fwl/cfwl_themetext.cpp index c228c93..ce65a11 100644 --- a/xfa/fwl/cfwl_themetext.cpp +++ b/xfa/fwl/cfwl_themetext.cpp
@@ -6,9 +6,13 @@ #include "xfa/fwl/cfwl_themetext.h" +namespace pdfium { + CFWL_ThemeText::CFWL_ThemeText(Part iPart, CFWL_Widget* pWidget, CFGAS_GEGraphics* pGraphics) : CFWL_ThemePart(iPart, pWidget), m_pGraphics(pGraphics) {} CFWL_ThemeText::~CFWL_ThemeText() = default; + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_themetext.h b/xfa/fwl/cfwl_themetext.h index 71f8d8d..2b06c8c 100644 --- a/xfa/fwl/cfwl_themetext.h +++ b/xfa/fwl/cfwl_themetext.h
@@ -15,6 +15,8 @@ class CFGAS_GEGraphics; +namespace pdfium { + class CFWL_ThemeText final : public CFWL_ThemePart { public: FX_STACK_ALLOCATED(); @@ -32,4 +34,9 @@ UnownedPtr<CFGAS_GEGraphics> const m_pGraphics; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_ThemeText; + #endif // XFA_FWL_CFWL_THEMETEXT_H_
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index 5c0db05..f0d4d9a 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp
@@ -29,6 +29,8 @@ #include "xfa/fwl/cfwl_widgetmgr.h" #include "xfa/fwl/ifwl_themeprovider.h" +namespace pdfium { + namespace { constexpr float kCalcHeight = 2048.0f; @@ -351,3 +353,5 @@ CFWL_Widget::ScopedUpdateLock::~ScopedUpdateLock() { widget_->UnlockUpdate(); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h index 8e61c80..ec68939 100644 --- a/xfa/fwl/cfwl_widget.h +++ b/xfa/fwl/cfwl_widget.h
@@ -24,6 +24,8 @@ #include "xfa/fwl/fwl_widgethit.h" #include "xfa/fwl/ifwl_widgetdelegate.h" +namespace pdfium { + class CFWL_App; class CFWL_Event; class CFWL_Widget; @@ -203,4 +205,10 @@ cppgc::Member<CFWL_Widget> const m_pOuter; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_Widget; +using pdfium::FWL_Type; + #endif // XFA_FWL_CFWL_WIDGET_H_
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index b07ed3c..554b729 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -14,6 +14,8 @@ #include "xfa/fwl/cfwl_notedriver.h" #include "xfa/fwl/cfwl_pushbutton.h" +namespace pdfium { + CFWL_WidgetMgr::CFWL_WidgetMgr(AdapterIface* pAdapter, CFWL_App* pApp) : m_pAdapter(pAdapter), m_pApp(pApp) { DCHECK(m_pAdapter); @@ -241,3 +243,5 @@ GCedTreeNode<Item>::Trace(visitor); visitor->Trace(pWidget); } + +} // namespace pdfium
diff --git a/xfa/fwl/cfwl_widgetmgr.h b/xfa/fwl/cfwl_widgetmgr.h index 8383f0f..2f0efd6 100644 --- a/xfa/fwl/cfwl_widgetmgr.h +++ b/xfa/fwl/cfwl_widgetmgr.h
@@ -17,6 +17,9 @@ #include "v8/include/cppgc/visitor.h" class CFGAS_GEGraphics; + +namespace pdfium { + class CFWL_App; class CFWL_Message; class CFWL_Widget; @@ -98,4 +101,9 @@ m_mapWidgetItem; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CFWL_WidgetMgr; + #endif // XFA_FWL_CFWL_WIDGETMGR_H_
diff --git a/xfa/fwl/fwl_widgetdef.h b/xfa/fwl/fwl_widgetdef.h index a44a442..999a4a1 100644 --- a/xfa/fwl/fwl_widgetdef.h +++ b/xfa/fwl/fwl_widgetdef.h
@@ -9,6 +9,8 @@ #include <stdint.h> +namespace pdfium { + // Same as enum FWL_VKEYCODE in public/fpdf_fwlevent.h, but duplicated here // to keep xfa/fwl standalone. enum XFA_FWL_VKEYCODE { @@ -195,4 +197,10 @@ kMButton = 1 << 6 }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::XFA_FWL_KeyFlag; +using pdfium::XFA_FWL_VKEYCODE; + #endif // XFA_FWL_FWL_WIDGETDEF_H_
diff --git a/xfa/fwl/fwl_widgethit.h b/xfa/fwl/fwl_widgethit.h index 2de257f..e3b769f 100644 --- a/xfa/fwl/fwl_widgethit.h +++ b/xfa/fwl/fwl_widgethit.h
@@ -7,6 +7,8 @@ #ifndef XFA_FWL_FWL_WIDGETHIT_H_ #define XFA_FWL_FWL_WIDGETHIT_H_ +namespace pdfium { + enum class FWL_WidgetHit { Unknown = 0, Client, @@ -32,4 +34,9 @@ DownButton }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::FWL_WidgetHit; + #endif // XFA_FWL_FWL_WIDGETHIT_H_
diff --git a/xfa/fwl/ifwl_themeprovider.cpp b/xfa/fwl/ifwl_themeprovider.cpp index e98a3f1..686032e 100644 --- a/xfa/fwl/ifwl_themeprovider.cpp +++ b/xfa/fwl/ifwl_themeprovider.cpp
@@ -19,6 +19,8 @@ #include "xfa/fwl/theme/cfwl_pushbuttontp.h" #include "xfa/fwl/theme/cfwl_scrollbartp.h" +namespace pdfium { + IFWL_ThemeProvider::IFWL_ThemeProvider(cppgc::Heap* pHeap) : m_pCheckBoxTP(cppgc::MakeGarbageCollected<CFWL_CheckBoxTP>( pHeap->GetAllocationHandle())), @@ -87,3 +89,5 @@ return nullptr; } } + +} // namespace pdfium
diff --git a/xfa/fwl/ifwl_themeprovider.h b/xfa/fwl/ifwl_themeprovider.h index b763d48..10c12e3 100644 --- a/xfa/fwl/ifwl_themeprovider.h +++ b/xfa/fwl/ifwl_themeprovider.h
@@ -13,14 +13,16 @@ #include "fxjs/gc/heap.h" #include "v8/include/cppgc/garbage-collected.h" #include "v8/include/cppgc/member.h" -// TODO(crbug.com/42271761): Remove and forward declare CFWL_WidgetTP. -#include "xfa/fwl/theme/cfwl_widgettp.h" class CFGAS_GEFont; + +namespace pdfium { + class CFWL_ThemeBackground; class CFWL_ThemePart; class CFWL_ThemeText; class CFWL_Widget; +class CFWL_WidgetTP; class IFWL_ThemeProvider : public cppgc::GarbageCollectedMixin { public: @@ -64,4 +66,9 @@ cppgc::Member<CFWL_WidgetTP> m_pBarcodeTP; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::IFWL_ThemeProvider; + #endif // XFA_FWL_IFWL_THEMEPROVIDER_H_
diff --git a/xfa/fwl/ifwl_widgetdelegate.h b/xfa/fwl/ifwl_widgetdelegate.h index ef0895f..fb8d4b1 100644 --- a/xfa/fwl/ifwl_widgetdelegate.h +++ b/xfa/fwl/ifwl_widgetdelegate.h
@@ -10,9 +10,12 @@ #include "v8/include/cppgc/garbage-collected.h" class CFGAS_GEGraphics; +class CFX_Matrix; + +namespace pdfium { + class CFWL_Event; class CFWL_Message; -class CFX_Matrix; class IFWL_WidgetDelegate : public cppgc::GarbageCollectedMixin { public: @@ -24,4 +27,9 @@ const CFX_Matrix& matrix) = 0; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::IFWL_WidgetDelegate; + #endif // XFA_FWL_IFWL_WIDGETDELEGATE_H_
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h index 26f92d8..a4a72f6 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.h +++ b/xfa/fwl/theme/cfwl_checkboxtp.h
@@ -14,10 +14,11 @@ #include "xfa/fwl/theme/cfwl_widgettp.h" class CFGAS_GEPath; -class CFWL_Widget; namespace pdfium { +class CFWL_Widget; + class CFWL_CheckBoxTP final : public CFWL_WidgetTP { public: CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index cf1e750..7c11730 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -18,13 +18,13 @@ #include "xfa/fwl/theme/cfwl_utils.h" class CFGAS_GEGraphics; -class CFWL_ThemeBackground; -class CFWL_ThemeText; -class IFWL_ThemeProvider; namespace pdfium { class CFDE_TextOut; +class CFWL_ThemeBackground; +class CFWL_ThemeText; +class IFWL_ThemeProvider; class CFWL_WidgetTP : public cppgc::GarbageCollected<CFWL_WidgetTP> { public:
diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index d16e5fb..642973f 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h
@@ -14,13 +14,15 @@ #include "v8/include/cppgc/member.h" #include "xfa/fwl/cfwl_app.h" -class CFWL_WidgetMgr; class CXFA_FFDoc; class CXFA_FWLAdapterWidgetMgr; -class CXFA_FWLTheme; class CXFA_FontMgr; class IFX_SeekableReadStream; +namespace pdfium { +class CXFA_FWLTheme; +} // namespace pdfium + class CXFA_FFApp final : public cppgc::GarbageCollected<CXFA_FFApp>, public CFWL_App::AdapterIface { public: @@ -136,7 +138,7 @@ void Trace(cppgc::Visitor* visitor) const override; CFWL_WidgetMgr::AdapterIface* GetWidgetMgrAdapter() override; CFX_Timer::HandlerIface* GetTimerHandler() override; - IFWL_ThemeProvider* GetThemeProvider() override; + pdfium::IFWL_ThemeProvider* GetThemeProvider() override; cppgc::Heap* GetHeap() override; bool LoadFWLTheme(CXFA_FFDoc* doc); @@ -151,7 +153,7 @@ UnownedPtr<CallbackIface> const m_pProvider; cppgc::Member<CXFA_FontMgr> m_pXFAFontMgr; cppgc::Member<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; - cppgc::Member<CXFA_FWLTheme> m_pFWLTheme; + cppgc::Member<pdfium::CXFA_FWLTheme> m_pFWLTheme; cppgc::Member<CFWL_App> m_pFWLApp; };
diff --git a/xfa/fxfa/cxfa_ffcheckbutton.h b/xfa/fxfa/cxfa_ffcheckbutton.h index 1e05878..b394225 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.h +++ b/xfa/fxfa/cxfa_ffcheckbutton.h
@@ -33,7 +33,7 @@ bool OnLButtonUp(Mask<XFA_FWL_KeyFlag> dwFlags, const CFX_PointF& point) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override; FormFieldType GetFormFieldType() override;
diff --git a/xfa/fxfa/cxfa_ffcombobox.h b/xfa/fxfa/cxfa_ffcombobox.h index 1227dff..58529de 100644 --- a/xfa/fxfa/cxfa_ffcombobox.h +++ b/xfa/fxfa/cxfa_ffcombobox.h
@@ -48,7 +48,7 @@ // IFWL_WidgetDelegate void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override;
diff --git a/xfa/fxfa/cxfa_ffdatetimeedit.h b/xfa/fxfa/cxfa_ffdatetimeedit.h index 93eb0a6..c2786b8 100644 --- a/xfa/fxfa/cxfa_ffdatetimeedit.h +++ b/xfa/fxfa/cxfa_ffdatetimeedit.h
@@ -10,9 +10,10 @@ #include "core/fxcrt/fx_coordinates.h" #include "xfa/fxfa/cxfa_fftextedit.h" +namespace pdfium { class CFWL_DateTimePicker; -class CFWL_Event; class CFWL_Widget; +} // namespace pdfium class CXFA_FFDateTimeEdit final : public CXFA_FFTextEdit { public: @@ -23,9 +24,9 @@ CFX_RectF GetBBox(FocusOption focus) override; bool LoadWidget() override; void UpdateWidgetProperty() override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; - void OnSelectChanged(CFWL_Widget* pWidget, + void OnSelectChanged(pdfium::CFWL_Widget* pWidget, int32_t iYear, int32_t iMonth, int32_t iDay); @@ -53,7 +54,7 @@ bool UpdateFWLData() override; bool IsDataChanged() override; - CFWL_DateTimePicker* GetPickerWidget(); + pdfium::CFWL_DateTimePicker* GetPickerWidget(); uint32_t GetAlignment(); };
diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h index bcd3112..ab2267c 100644 --- a/xfa/fxfa/cxfa_fffield.h +++ b/xfa/fxfa/cxfa_fffield.h
@@ -65,8 +65,8 @@ FWL_WidgetHit HitTest(const CFX_PointF& point) override; // IFWL_WidgetDelegate: - void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessMessage(pdfium::CFWL_Message* pMessage) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override;
diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index 6b09564..0e84c76 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp
@@ -145,7 +145,7 @@ m_pOldDelegate->OnProcessMessage(pMessage); } -void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) { +void CXFA_FFImageEdit::OnProcessEvent(pdfium::CFWL_Event* pEvent) { CXFA_FFField::OnProcessEvent(pEvent); m_pOldDelegate->OnProcessEvent(pEvent); }
diff --git a/xfa/fxfa/cxfa_ffimageedit.h b/xfa/fxfa/cxfa_ffimageedit.h index c393f8f..bee08b6 100644 --- a/xfa/fxfa/cxfa_ffimageedit.h +++ b/xfa/fxfa/cxfa_ffimageedit.h
@@ -33,7 +33,7 @@ bool OnLButtonDown(Mask<XFA_FWL_KeyFlag> dwFlags, const CFX_PointF& point) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override; FormFieldType GetFormFieldType() override;
diff --git a/xfa/fxfa/cxfa_fflistbox.h b/xfa/fxfa/cxfa_fflistbox.h index fae01ae..ae2423f 100644 --- a/xfa/fxfa/cxfa_fflistbox.h +++ b/xfa/fxfa/cxfa_fflistbox.h
@@ -25,7 +25,7 @@ bool LoadWidget() override; [[nodiscard]] bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override; FormFieldType GetFormFieldType() override;
diff --git a/xfa/fxfa/cxfa_ffnumericedit.h b/xfa/fxfa/cxfa_ffnumericedit.h index 4a5c409..f04eb3b 100644 --- a/xfa/fxfa/cxfa_ffnumericedit.h +++ b/xfa/fxfa/cxfa_ffnumericedit.h
@@ -10,8 +10,9 @@ #include "core/fxcrt/widestring.h" #include "xfa/fxfa/cxfa_fftextedit.h" -class CFWL_Event; +namespace pdfium { class CFWL_Widget; +} // namespace pdfium class CXFA_FFNumericEdit final : public CXFA_FFTextEdit { public: @@ -21,7 +22,7 @@ // CXFA_FFTextEdit bool LoadWidget() override; void UpdateWidgetProperty() override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; private: bool OnValidate(CFWL_Widget* pWidget, const WideString& wsText);
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp index d13539a..8828b37 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.cpp +++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -205,7 +205,7 @@ m_pOldDelegate->OnProcessMessage(pMessage); } -void CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) { +void CXFA_FFPushButton::OnProcessEvent(pdfium::CFWL_Event* pEvent) { m_pOldDelegate->OnProcessEvent(pEvent); CXFA_FFField::OnProcessEvent(pEvent); }
diff --git a/xfa/fxfa/cxfa_ffpushbutton.h b/xfa/fxfa/cxfa_ffpushbutton.h index 9c07714..fcec556 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.h +++ b/xfa/fxfa/cxfa_ffpushbutton.h
@@ -33,7 +33,7 @@ bool PerformLayout() override; void UpdateWidgetProperty() override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override; FormFieldType GetFormFieldType() override;
diff --git a/xfa/fxfa/cxfa_fftextedit.h b/xfa/fxfa/cxfa_fftextedit.h index 73affe8..d03ba6d 100644 --- a/xfa/fxfa/cxfa_fftextedit.h +++ b/xfa/fxfa/cxfa_fftextedit.h
@@ -12,12 +12,14 @@ #include "v8/include/cppgc/prefinalizer.h" #include "xfa/fxfa/cxfa_fffield.h" -class CFWL_Event; -class CFWL_EventTextWillChange; -class CFWL_Widget; class CFX_Matrix; class CXFA_FFWidget; + +namespace pdfium { +class CFWL_EventTextWillChange; +class CFWL_Widget; class IFWL_WidgetDelegate; +} // namespace pdfium class CXFA_FFTextEdit : public CXFA_FFField { CPPGC_USING_PRE_FINALIZER(CXFA_FFTextEdit, PreFinalize); @@ -46,11 +48,12 @@ [[nodiscard]] bool OnSetFocus(CXFA_FFWidget* pOldWidget) override; [[nodiscard]] bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnProcessEvent(CFWL_Event* pEvent) override; + void OnProcessEvent(pdfium::CFWL_Event* pEvent) override; void OnDrawWidget(CFGAS_GEGraphics* pGraphics, const CFX_Matrix& matrix) override; - void OnTextWillChange(CFWL_Widget* pWidget, CFWL_EventTextWillChange* change); + void OnTextWillChange(pdfium::CFWL_Widget* pWidget, + pdfium::CFWL_EventTextWillChange* change); void OnTextFull(CFWL_Widget* pWidget); // CXFA_FFWidget
diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index 3af75b2..5c3eb4e 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h
@@ -37,7 +37,10 @@ class CXFA_FFWidgetHandler; class CXFA_Margin; class IFX_SeekableReadStream; + +namespace pdfium { enum class FWL_WidgetHit; +} // namespace pdfium inline float XFA_UnitPx2Pt(float fPx, float fDpi) { return fPx * 72.0f / fDpi; @@ -135,7 +138,7 @@ [[nodiscard]] virtual bool OnChar(uint32_t dwChar, Mask<XFA_FWL_KeyFlag> dwFlags); - virtual FWL_WidgetHit HitTest(const CFX_PointF& point); + virtual pdfium::FWL_WidgetHit HitTest(const CFX_PointF& point); virtual bool CanUndo(); virtual bool CanRedo(); virtual bool CanCopy();
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.h b/xfa/fxfa/cxfa_ffwidgethandler.h index eca6f67..e7a9e9f 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.h +++ b/xfa/fxfa/cxfa_ffwidgethandler.h
@@ -21,7 +21,10 @@ class CFGAS_GEGraphics; class CXFA_FFDocView; class CXFA_FFWidget; + +namespace pdfium { enum class FWL_WidgetHit; +} // namespace pdfium class CXFA_FFWidgetHandler final : public cppgc::GarbageCollected<CXFA_FFWidgetHandler> { @@ -75,7 +78,8 @@ bool OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, Mask<XFA_FWL_KeyFlag> dwFlags); - FWL_WidgetHit HitTest(CXFA_FFWidget* pWidget, const CFX_PointF& point); + pdfium::FWL_WidgetHit HitTest(CXFA_FFWidget* pWidget, + const CFX_PointF& point); void RenderWidget(CXFA_FFWidget* hWidget, CFGAS_GEGraphics* pGS, const CFX_Matrix& matrix,
diff --git a/xfa/fxfa/cxfa_fwladapterwidgetmgr.h b/xfa/fxfa/cxfa_fwladapterwidgetmgr.h index 232b914..f3161eb 100644 --- a/xfa/fxfa/cxfa_fwladapterwidgetmgr.h +++ b/xfa/fxfa/cxfa_fwladapterwidgetmgr.h
@@ -11,7 +11,6 @@ #include "v8/include/cppgc/garbage-collected.h" #include "xfa/fwl/cfwl_widgetmgr.h" -class CFWL_Widget; class CFX_RectF; class CXFA_FWLAdapterWidgetMgr final @@ -23,8 +22,8 @@ // CFWL_WidgetMgr::AdapterIface: void Trace(cppgc::Visitor* visitor) const override; - void RepaintWidget(CFWL_Widget* pWidget) override; - bool GetPopupPos(CFWL_Widget* pWidget, + void RepaintWidget(pdfium::CFWL_Widget* pWidget) override; + bool GetPopupPos(pdfium::CFWL_Widget* pWidget, float fMinHeight, float fMaxHeight, const CFX_RectF& rtAnchor,
diff --git a/xfa/fxfa/cxfa_fwltheme.cpp b/xfa/fxfa/cxfa_fwltheme.cpp index 1fa3738..215bef0 100644 --- a/xfa/fxfa/cxfa_fwltheme.cpp +++ b/xfa/fxfa/cxfa_fwltheme.cpp
@@ -31,6 +31,8 @@ #include "xfa/fxfa/cxfa_fontmgr.h" #include "xfa/fxfa/parser/cxfa_para.h" +namespace pdfium { + namespace { constexpr const wchar_t* kFWLThemeCalFonts[] = { @@ -251,3 +253,5 @@ m_pTextOut->SetStyles(pParams.m_dwTTOStyles); m_pTextOut->CalcLogicSize(pParams.m_wsText.AsStringView(), pRect); } + +} // namespace pdfium
diff --git a/xfa/fxfa/cxfa_fwltheme.h b/xfa/fxfa/cxfa_fwltheme.h index e23da7e..e1a2619 100644 --- a/xfa/fxfa/cxfa_fwltheme.h +++ b/xfa/fxfa/cxfa_fwltheme.h
@@ -17,13 +17,13 @@ #include "v8/include/cppgc/prefinalizer.h" #include "xfa/fwl/ifwl_themeprovider.h" -namespace pdfium { -class CFDE_TextOut; -} // namespace pdfium - class CXFA_FFApp; class CXFA_FFDoc; +namespace pdfium { + +class CFDE_TextOut; + class CXFA_FWLTheme final : public cppgc::GarbageCollected<CXFA_FWLTheme>, public IFWL_ThemeProvider { CPPGC_USING_PRE_FINALIZER(CXFA_FWLTheme, PreFinalize); @@ -55,7 +55,7 @@ private: CXFA_FWLTheme(cppgc::Heap* pHeap, CXFA_FFApp* pApp); - std::unique_ptr<pdfium::CFDE_TextOut> m_pTextOut; + std::unique_ptr<CFDE_TextOut> m_pTextOut; RetainPtr<CFGAS_GEFont> m_pFWLFont; RetainPtr<CFGAS_GEFont> m_pCalendarFont; cppgc::Member<CXFA_FFApp> const m_pApp; @@ -63,4 +63,9 @@ CFX_RectF m_Rect; }; +} // namespace pdfium + +// TODO(crbug.com/42271761): Remove. +using pdfium::CXFA_FWLTheme; + #endif // XFA_FXFA_CXFA_FWLTHEME_H_