From 2b918c8d05c922287efbc8858f029026cee31442 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 13 Jul 2017 14:47:10 -0400 Subject: Fixup naming of XFA graphics classes These files were originally renamed thinking they'd move with the colour class up to core/. It was decided that CPWL_Color was a better core colour class the the xfa colour so these are being renamed back to XFA based names to make it clear where they live. Change-Id: Ie89f2306be0609add29bd445e719567e7b439211 Reviewed-on: https://pdfium-review.googlesource.com/7754 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fwl/cfwl_barcode.cpp | 2 +- xfa/fwl/cfwl_barcode.h | 2 +- xfa/fwl/cfwl_caret.cpp | 6 +- xfa/fwl/cfwl_caret.h | 6 +- xfa/fwl/cfwl_checkbox.cpp | 4 +- xfa/fwl/cfwl_checkbox.h | 4 +- xfa/fwl/cfwl_combobox.cpp | 8 +- xfa/fwl/cfwl_combobox.h | 10 +- xfa/fwl/cfwl_comboboxproxy.cpp | 2 +- xfa/fwl/cfwl_comboboxproxy.h | 2 +- xfa/fwl/cfwl_datetimepicker.cpp | 8 +- xfa/fwl/cfwl_datetimepicker.h | 8 +- xfa/fwl/cfwl_edit.cpp | 23 +- xfa/fwl/cfwl_edit.h | 14 +- xfa/fwl/cfwl_event.h | 2 +- xfa/fwl/cfwl_form.cpp | 7 +- xfa/fwl/cfwl_form.h | 6 +- xfa/fwl/cfwl_formproxy.cpp | 2 +- xfa/fwl/cfwl_formproxy.h | 2 +- xfa/fwl/cfwl_listbox.cpp | 10 +- xfa/fwl/cfwl_listbox.h | 12 +- xfa/fwl/cfwl_monthcalendar.cpp | 28 +- xfa/fwl/cfwl_monthcalendar.h | 28 +- xfa/fwl/cfwl_notedriver.h | 2 +- xfa/fwl/cfwl_picturebox.cpp | 4 +- xfa/fwl/cfwl_picturebox.h | 4 +- xfa/fwl/cfwl_pushbutton.cpp | 6 +- xfa/fwl/cfwl_pushbutton.h | 6 +- xfa/fwl/cfwl_scrollbar.cpp | 10 +- xfa/fwl/cfwl_scrollbar.h | 10 +- xfa/fwl/cfwl_spinbutton.cpp | 8 +- xfa/fwl/cfwl_spinbutton.h | 8 +- xfa/fwl/cfwl_themebackground.h | 8 +- xfa/fwl/cfwl_themetext.h | 2 +- xfa/fwl/cfwl_widget.cpp | 6 +- xfa/fwl/cfwl_widget.h | 8 +- xfa/fwl/cfwl_widgetmgr.cpp | 4 +- xfa/fwl/cfwl_widgetmgr.h | 16 +- xfa/fwl/ifwl_widgetdelegate.h | 4 +- xfa/fwl/ifwl_widgetmgrdelegate.h | 4 +- xfa/fwl/theme/cfwl_carettp.cpp | 6 +- xfa/fwl/theme/cfwl_carettp.h | 2 +- xfa/fwl/theme/cfwl_checkboxtp.cpp | 28 +- xfa/fwl/theme/cfwl_checkboxtp.h | 16 +- xfa/fwl/theme/cfwl_comboboxtp.cpp | 6 +- xfa/fwl/theme/cfwl_edittp.cpp | 6 +- xfa/fwl/theme/cfwl_listboxtp.cpp | 6 +- xfa/fwl/theme/cfwl_listboxtp.h | 2 +- xfa/fwl/theme/cfwl_monthcalendartp.cpp | 22 +- xfa/fwl/theme/cfwl_pushbuttontp.cpp | 8 +- xfa/fwl/theme/cfwl_scrollbartp.cpp | 18 +- xfa/fwl/theme/cfwl_scrollbartp.h | 8 +- xfa/fwl/theme/cfwl_widgettp.cpp | 36 +-- xfa/fwl/theme/cfwl_widgettp.h | 20 +- xfa/fxfa/app/cxfa_ffarc.cpp | 2 +- xfa/fxfa/app/cxfa_ffarc.h | 2 +- xfa/fxfa/app/cxfa_ffbarcode.cpp | 2 +- xfa/fxfa/app/cxfa_ffbarcode.h | 2 +- xfa/fxfa/app/cxfa_ffcheckbutton.cpp | 4 +- xfa/fxfa/app/cxfa_ffcheckbutton.h | 4 +- xfa/fxfa/app/cxfa_ffcombobox.cpp | 2 +- xfa/fxfa/app/cxfa_ffcombobox.h | 2 +- xfa/fxfa/app/cxfa_ffexclgroup.cpp | 2 +- xfa/fxfa/app/cxfa_ffexclgroup.h | 2 +- xfa/fxfa/app/cxfa_fffield.cpp | 16 +- xfa/fxfa/app/cxfa_fffield.h | 10 +- xfa/fxfa/app/cxfa_ffimage.cpp | 2 +- xfa/fxfa/app/cxfa_ffimage.h | 2 +- xfa/fxfa/app/cxfa_ffimageedit.cpp | 4 +- xfa/fxfa/app/cxfa_ffimageedit.h | 4 +- xfa/fxfa/app/cxfa_ffline.cpp | 8 +- xfa/fxfa/app/cxfa_ffline.h | 2 +- xfa/fxfa/app/cxfa_fflistbox.cpp | 2 +- xfa/fxfa/app/cxfa_fflistbox.h | 2 +- xfa/fxfa/app/cxfa_ffpushbutton.cpp | 12 +- xfa/fxfa/app/cxfa_ffpushbutton.h | 6 +- xfa/fxfa/app/cxfa_ffrectangle.cpp | 2 +- xfa/fxfa/app/cxfa_ffrectangle.h | 2 +- xfa/fxfa/app/cxfa_ffsignature.cpp | 2 +- xfa/fxfa/app/cxfa_ffsignature.h | 2 +- xfa/fxfa/app/cxfa_fftext.cpp | 4 +- xfa/fxfa/app/cxfa_fftext.h | 2 +- xfa/fxfa/app/cxfa_fftextedit.cpp | 2 +- xfa/fxfa/app/cxfa_fftextedit.h | 2 +- xfa/fxfa/app/cxfa_fwltheme.cpp | 4 +- xfa/fxfa/cxfa_ffwidget.cpp | 88 +++--- xfa/fxfa/cxfa_ffwidget.h | 10 +- xfa/fxfa/cxfa_ffwidgethandler.cpp | 2 +- xfa/fxfa/cxfa_ffwidgethandler.h | 2 +- xfa/fxfa/cxfa_rendercontext.cpp | 4 +- xfa/fxfa/cxfa_rendercontext.h | 2 +- xfa/fxfa/fxfa.h | 2 +- xfa/fxgraphics/cfx_graphics.cpp | 535 -------------------------------- xfa/fxgraphics/cfx_graphics.h | 111 ------- xfa/fxgraphics/cfx_path.cpp | 148 --------- xfa/fxgraphics/cfx_path.h | 55 ---- xfa/fxgraphics/cfx_pattern.cpp | 20 -- xfa/fxgraphics/cfx_pattern.h | 36 --- xfa/fxgraphics/cfx_shading.cpp | 78 ----- xfa/fxgraphics/cfx_shading.h | 56 ---- xfa/fxgraphics/cxfa_color.cpp | 8 +- xfa/fxgraphics/cxfa_color.h | 20 +- xfa/fxgraphics/cxfa_graphics.cpp | 536 +++++++++++++++++++++++++++++++++ xfa/fxgraphics/cxfa_graphics.h | 111 +++++++ xfa/fxgraphics/cxfa_path.cpp | 148 +++++++++ xfa/fxgraphics/cxfa_path.h | 55 ++++ xfa/fxgraphics/cxfa_pattern.cpp | 20 ++ xfa/fxgraphics/cxfa_pattern.h | 36 +++ xfa/fxgraphics/cxfa_shading.cpp | 78 +++++ xfa/fxgraphics/cxfa_shading.h | 56 ++++ 110 files changed, 1413 insertions(+), 1410 deletions(-) delete mode 100644 xfa/fxgraphics/cfx_graphics.cpp delete mode 100644 xfa/fxgraphics/cfx_graphics.h delete mode 100644 xfa/fxgraphics/cfx_path.cpp delete mode 100644 xfa/fxgraphics/cfx_path.h delete mode 100644 xfa/fxgraphics/cfx_pattern.cpp delete mode 100644 xfa/fxgraphics/cfx_pattern.h delete mode 100644 xfa/fxgraphics/cfx_shading.cpp delete mode 100644 xfa/fxgraphics/cfx_shading.h create mode 100644 xfa/fxgraphics/cxfa_graphics.cpp create mode 100644 xfa/fxgraphics/cxfa_graphics.h create mode 100644 xfa/fxgraphics/cxfa_path.cpp create mode 100644 xfa/fxgraphics/cxfa_path.h create mode 100644 xfa/fxgraphics/cxfa_pattern.cpp create mode 100644 xfa/fxgraphics/cxfa_pattern.h create mode 100644 xfa/fxgraphics/cxfa_shading.cpp create mode 100644 xfa/fxgraphics/cxfa_shading.h (limited to 'xfa') diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index 378bb8e06b..b51bb24366 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -35,7 +35,7 @@ void CFWL_Barcode::Update() { GenerateBarcodeImageCache(); } -void CFWL_Barcode::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_Barcode::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h index 0620541c2f..c913a17b10 100644 --- a/xfa/fwl/cfwl_barcode.h +++ b/xfa/fwl/cfwl_barcode.h @@ -45,7 +45,7 @@ class CFWL_Barcode : public CFWL_Edit { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessEvent(CFWL_Event* pEvent) override; // CFWL_Edit diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp index 21387a47f9..be7ecbf331 100644 --- a/xfa/fwl/cfwl_caret.cpp +++ b/xfa/fwl/cfwl_caret.cpp @@ -43,7 +43,7 @@ FWL_Type CFWL_Caret::GetClassID() const { void CFWL_Caret::Update() {} -void CFWL_Caret::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_Caret::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -70,7 +70,7 @@ void CFWL_Caret::HideCaret() { SetStates(FWL_WGTSTATE_Invisible); } -void CFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics, +void CFWL_Caret::DrawCaretBK(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { if (!(m_pProperties->m_dwStates & FWL_STATE_CAT_HightLight)) @@ -89,7 +89,7 @@ void CFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics, void CFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {} -void CFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_Caret::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_caret.h b/xfa/fwl/cfwl_caret.h index ce692532db..d00f38a29c 100644 --- a/xfa/fwl/cfwl_caret.h +++ b/xfa/fwl/cfwl_caret.h @@ -27,9 +27,9 @@ class CFWL_Caret : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void Update() override; @@ -46,7 +46,7 @@ class CFWL_Caret : public CFWL_Widget { }; friend class CFWL_Caret::Timer; - void DrawCaretBK(CFX_Graphics* pGraphics, + void DrawCaretBK(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); diff --git a/xfa/fwl/cfwl_checkbox.cpp b/xfa/fwl/cfwl_checkbox.cpp index 5ec3504cae..eed201ba34 100644 --- a/xfa/fwl/cfwl_checkbox.cpp +++ b/xfa/fwl/cfwl_checkbox.cpp @@ -61,7 +61,7 @@ void CFWL_CheckBox::Update() { Layout(); } -void CFWL_CheckBox::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_CheckBox::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -266,7 +266,7 @@ void CFWL_CheckBox::OnProcessMessage(CFWL_Message* pMessage) { CFWL_Widget::OnProcessMessage(pMessage); } -void CFWL_CheckBox::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_CheckBox::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_checkbox.h b/xfa/fwl/cfwl_checkbox.h index 2f434f23cf..6fc9033dee 100644 --- a/xfa/fwl/cfwl_checkbox.h +++ b/xfa/fwl/cfwl_checkbox.h @@ -41,10 +41,10 @@ class CFWL_CheckBox : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void SetBoxSize(float fHeight); diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp index cdb4f81d67..acc72b0e64 100644 --- a/xfa/fwl/cfwl_combobox.cpp +++ b/xfa/fwl/cfwl_combobox.cpp @@ -125,7 +125,7 @@ FWL_WidgetHit CFWL_ComboBox::HitTest(const CFX_PointF& point) { return CFWL_Widget::HitTest(point); } -void CFWL_ComboBox::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (m_pWidgetMgr->IsFormDisabled()) { DisForm_DrawWidget(pGraphics, pMatrix); @@ -288,7 +288,7 @@ void CFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded, m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); } -void CFWL_ComboBox::DrawStretchHandler(CFX_Graphics* pGraphics, +void CFWL_ComboBox::DrawStretchHandler(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; param.m_pGraphics = pGraphics; @@ -615,7 +615,7 @@ FWL_WidgetHit CFWL_ComboBox::DisForm_HitTest(const CFX_PointF& point) { return FWL_WidgetHit::Unknown; } -void CFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics, +void CFWL_ComboBox::DisForm_DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; CFX_Matrix mtOrg; @@ -756,7 +756,7 @@ void CFWL_ComboBox::OnProcessEvent(CFWL_Event* pEvent) { } } -void CFWL_ComboBox::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_ComboBox::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h index 168e203162..396aa6c9d5 100644 --- a/xfa/fwl/cfwl_combobox.h +++ b/xfa/fwl/cfwl_combobox.h @@ -14,7 +14,7 @@ #include "xfa/fwl/cfwl_combolist.h" #include "xfa/fwl/cfwl_form.h" #include "xfa/fwl/cfwl_listbox.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" class CFWL_WidgetProperties; class CFWL_ComboBox; @@ -52,11 +52,11 @@ class CFWL_ComboBox : public CFWL_Widget { void RemoveStates(uint32_t dwStates) override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; CFX_WideString GetTextByIndex(int32_t iIndex) const; @@ -95,7 +95,7 @@ class CFWL_ComboBox : public CFWL_Widget { CFX_RectF GetBBox() const; void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); - void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); + void DrawStretchHandler(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix); bool IsDropListVisible() const { return m_pComboBoxProxy && !(m_pComboBoxProxy->GetStates() & FWL_WGTSTATE_Invisible); @@ -136,7 +136,7 @@ class CFWL_ComboBox : public CFWL_Widget { uint32_t dwStylesExRemoved); void DisForm_Update(); FWL_WidgetHit DisForm_HitTest(const CFX_PointF& point); - void DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); + void DisForm_DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix); CFX_RectF DisForm_GetBBox() const; void DisForm_Layout(); void DisForm_OnProcessMessage(CFWL_Message* pMessage); diff --git a/xfa/fwl/cfwl_comboboxproxy.cpp b/xfa/fwl/cfwl_comboboxproxy.cpp index 0e2779b5c9..28c403fb0a 100644 --- a/xfa/fwl/cfwl_comboboxproxy.cpp +++ b/xfa/fwl/cfwl_comboboxproxy.cpp @@ -58,7 +58,7 @@ void CFWL_ComboBoxProxy::OnProcessMessage(CFWL_Message* pMessage) { CFWL_Widget::OnProcessMessage(pMessage); } -void CFWL_ComboBoxProxy::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_ComboBoxProxy::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { m_pComboBox->DrawStretchHandler(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_comboboxproxy.h b/xfa/fwl/cfwl_comboboxproxy.h index 4be14b9e65..8282348657 100644 --- a/xfa/fwl/cfwl_comboboxproxy.h +++ b/xfa/fwl/cfwl_comboboxproxy.h @@ -23,7 +23,7 @@ class CFWL_ComboBoxProxy : public CFWL_FormProxy { // CFWL_FormProxy void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void Reset() { m_bLButtonUpSelf = false; } diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp index a49785e987..1a82a5c7ee 100644 --- a/xfa/fwl/cfwl_datetimepicker.cpp +++ b/xfa/fwl/cfwl_datetimepicker.cpp @@ -114,7 +114,7 @@ FWL_WidgetHit CFWL_DateTimePicker::HitTest(const CFX_PointF& point) { return FWL_WidgetHit::Unknown; } -void CFWL_DateTimePicker::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_DateTimePicker::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -195,7 +195,7 @@ void CFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded, m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); } -void CFWL_DateTimePicker::DrawDropDownButton(CFX_Graphics* pGraphics, +void CFWL_DateTimePicker::DrawDropDownButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; @@ -443,7 +443,7 @@ CFX_RectF CFWL_DateTimePicker::DisForm_GetBBox() const { return rect; } -void CFWL_DateTimePicker::DisForm_DrawWidget(CFX_Graphics* pGraphics, +void CFWL_DateTimePicker::DisForm_DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -510,7 +510,7 @@ void CFWL_DateTimePicker::OnProcessMessage(CFWL_Message* pMessage) { CFWL_Widget::OnProcessMessage(pMessage); } -void CFWL_DateTimePicker::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_DateTimePicker::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h index 0f086d6b32..79e9cad9dd 100644 --- a/xfa/fwl/cfwl_datetimepicker.h +++ b/xfa/fwl/cfwl_datetimepicker.h @@ -39,10 +39,10 @@ class CFWL_DateTimePicker : public CFWL_Widget { FWL_Type GetClassID() const override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void SetThemeProvider(IFWL_ThemeProvider* pTP) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); @@ -67,7 +67,7 @@ class CFWL_DateTimePicker : public CFWL_Widget { CFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } private: - void DrawDropDownButton(CFX_Graphics* pGraphics, + void DrawDropDownButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); void FormatDateString(int32_t iYear, @@ -88,7 +88,7 @@ class CFWL_DateTimePicker : public CFWL_Widget { bool DisForm_IsNeedShowButton() const; void DisForm_Update(); CFX_RectF DisForm_GetBBox() const; - void DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); + void DisForm_DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix); void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); CFX_RectF m_rtBtn; diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index 268bd1a244..acefd3a964 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -32,7 +32,7 @@ #include "xfa/fwl/ifwl_themeprovider.h" #include "xfa/fxfa/cxfa_ffdoc.h" #include "xfa/fxfa/cxfa_ffwidget.h" -#include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_path.h" namespace { @@ -44,7 +44,7 @@ bool FX_EDIT_ISLATINWORD(wchar_t c) { c == 0x0027; } -void AddSquigglyPath(CFX_Path* pPathData, +void AddSquigglyPath(CXFA_Path* pPathData, float fStartX, float fEndX, float fY, @@ -158,7 +158,7 @@ FWL_WidgetHit CFWL_Edit::HitTest(const CFX_PointF& point) { return FWL_WidgetHit::Unknown; } -void CFWL_Edit::AddSpellCheckObj(CFX_Path& PathData, +void CFWL_Edit::AddSpellCheckObj(CXFA_Path& PathData, int32_t nStart, int32_t nCount, float fOffSetX, @@ -184,7 +184,7 @@ void CFWL_Edit::AddSpellCheckObj(CFX_Path& PathData, } } -void CFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics, +void CFWL_Edit::DrawSpellCheck(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { pGraphics->SaveGraphState(); if (pMatrix) @@ -193,7 +193,7 @@ void CFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics, CXFA_Color crLine(0xFFFF0000); CFWL_EventCheckWord checkWordEvent(this); CFX_ByteString sLatinWord; - CFX_Path pathSpell; + CXFA_Path pathSpell; int32_t nStart = 0; float fOffSetX = m_rtEngine.left - m_fScrollOffsetX; float fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; @@ -240,7 +240,8 @@ void CFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_Edit::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { +void CFWL_Edit::DrawWidget(CXFA_Graphics* pGraphics, + const CFX_Matrix* pMatrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -472,7 +473,7 @@ void CFWL_Edit::SetScrollOffset(float fScrollOffset) { m_fScrollOffsetY = fScrollOffset; } -void CFWL_Edit::DrawTextBk(CFX_Graphics* pGraphics, +void CFWL_Edit::DrawTextBk(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; @@ -504,7 +505,7 @@ void CFWL_Edit::DrawTextBk(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } -void CFWL_Edit::DrawContent(CFX_Graphics* pGraphics, +void CFWL_Edit::DrawContent(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFDE_TxtEdtPage* pPage = m_EdtEngine.GetPage(0); @@ -545,7 +546,7 @@ void CFWL_Edit::DrawContent(CFX_Graphics* pGraphics, &rectArr); } - CFX_Path path; + CXFA_Path path; for (auto& rect : rectArr) { rect.left += fOffSetX; rect.top += fOffSetY; @@ -575,7 +576,7 @@ void CFWL_Edit::DrawContent(CFX_Graphics* pGraphics, if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_CombText) { pGraphics->RestoreGraphState(); - CFX_Path path; + CXFA_Path path; int32_t iLimit = m_nLimit > 0 ? m_nLimit : 1; float fStep = m_rtEngine.width / iLimit; float fLeft = m_rtEngine.left + 1; @@ -1235,7 +1236,7 @@ void CFWL_Edit::OnProcessEvent(CFWL_Event* pEvent) { } } -void CFWL_Edit::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_Edit::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h index 0dbbcd6eef..15d20bf7cb 100644 --- a/xfa/fwl/cfwl_edit.h +++ b/xfa/fwl/cfwl_edit.h @@ -16,7 +16,7 @@ #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_scrollbar.h" #include "xfa/fwl/cfwl_widget.h" -#include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_path.h" #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) @@ -61,11 +61,11 @@ class CFWL_Edit : public CFWL_Widget { void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; void SetStates(uint32_t dwStates) override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; virtual void SetText(const CFX_WideString& wsText); @@ -109,13 +109,13 @@ class CFWL_Edit : public CFWL_Widget { CFDE_TxtEdtEngine* GetTxtEdtEngine() { return &m_EdtEngine; } private: - void DrawTextBk(CFX_Graphics* pGraphics, + void DrawTextBk(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawContent(CFX_Graphics* pGraphics, + void DrawContent(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawSpellCheck(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); + void DrawSpellCheck(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix); void UpdateEditEngine(); void UpdateEditParams(); @@ -138,7 +138,7 @@ class CFWL_Edit : public CFWL_Widget { bool IsContentHeightOverflow(); int32_t AddDoRecord(std::unique_ptr pRecord); void ProcessInsertError(int32_t iError); - void AddSpellCheckObj(CFX_Path& PathData, + void AddSpellCheckObj(CXFA_Path& PathData, int32_t nStart, int32_t nCount, float fOffSetX, diff --git a/xfa/fwl/cfwl_event.h b/xfa/fwl/cfwl_event.h index e326ab32c8..01e3914b8b 100644 --- a/xfa/fwl/cfwl_event.h +++ b/xfa/fwl/cfwl_event.h @@ -13,7 +13,7 @@ #include "xfa/fwl/cfwl_messagekey.h" #include "xfa/fwl/cfwl_messagemouse.h" -class CFX_Graphics; +class CXFA_Graphics; class CFWL_Widget; class CFWL_Event { diff --git a/xfa/fwl/cfwl_form.cpp b/xfa/fwl/cfwl_form.cpp index 3e606b3eb9..c560a0d352 100644 --- a/xfa/fwl/cfwl_form.cpp +++ b/xfa/fwl/cfwl_form.cpp @@ -75,7 +75,8 @@ FWL_WidgetHit CFWL_Form::HitTest(const CFX_PointF& point) { : FWL_WidgetHit::Client; } -void CFWL_Form::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { +void CFWL_Form::DrawWidget(CXFA_Graphics* pGraphics, + const CFX_Matrix* pMatrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -147,7 +148,7 @@ void CFWL_Form::EndDoModal() { #endif } -void CFWL_Form::DrawBackground(CFX_Graphics* pGraphics, +void CFWL_Form::DrawBackground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme) { CFWL_ThemeBackground param; param.m_pWidget = this; @@ -238,7 +239,7 @@ void CFWL_Form::OnProcessMessage(CFWL_Message* pMessage) { #endif // FWL_UseMacSystemBorder } -void CFWL_Form::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_Form::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_form.h b/xfa/fwl/cfwl_form.h index ec7fc137be..96452e8e33 100644 --- a/xfa/fwl/cfwl_form.h +++ b/xfa/fwl/cfwl_form.h @@ -38,9 +38,9 @@ class CFWL_Form : public CFWL_Widget { CFX_RectF GetClientRect() override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; CFWL_Widget* DoModal(); @@ -50,7 +50,7 @@ class CFWL_Form : public CFWL_Widget { void SetSubFocus(CFWL_Widget* pWidget) { m_pSubFocus = pWidget; } private: - void DrawBackground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); + void DrawBackground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); CFX_RectF GetEdgeRect(); void SetWorkAreaRect(); void Layout(); diff --git a/xfa/fwl/cfwl_formproxy.cpp b/xfa/fwl/cfwl_formproxy.cpp index 776ba0ac61..af7703e9c0 100644 --- a/xfa/fwl/cfwl_formproxy.cpp +++ b/xfa/fwl/cfwl_formproxy.cpp @@ -32,7 +32,7 @@ bool CFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const { void CFWL_FormProxy::Update() {} -void CFWL_FormProxy::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_FormProxy::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) {} void CFWL_FormProxy::OnProcessMessage(CFWL_Message* pMessage) { diff --git a/xfa/fwl/cfwl_formproxy.h b/xfa/fwl/cfwl_formproxy.h index 4ad70bf15c..dbc49d8f5e 100644 --- a/xfa/fwl/cfwl_formproxy.h +++ b/xfa/fwl/cfwl_formproxy.h @@ -24,7 +24,7 @@ class CFWL_FormProxy : public CFWL_Form { FWL_Type GetClassID() const override; bool IsInstance(const CFX_WideStringC& wsClass) const override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; }; diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index 0fd43efa08..ddad4038f5 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp @@ -91,7 +91,7 @@ FWL_WidgetHit CFWL_ListBox::HitTest(const CFX_PointF& point) { return FWL_WidgetHit::Unknown; } -void CFWL_ListBox::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_ListBox::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -352,7 +352,7 @@ bool CFWL_ListBox::ScrollToVisible(CFWL_ListItem* pItem) { return true; } -void CFWL_ListBox::DrawBkground(CFX_Graphics* pGraphics, +void CFWL_ListBox::DrawBkground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { if (!pGraphics) @@ -375,7 +375,7 @@ void CFWL_ListBox::DrawBkground(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } -void CFWL_ListBox::DrawItems(CFX_Graphics* pGraphics, +void CFWL_ListBox::DrawItems(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { float fPosX = 0.0f; @@ -408,7 +408,7 @@ void CFWL_ListBox::DrawItems(CFX_Graphics* pGraphics, } } -void CFWL_ListBox::DrawItem(CFX_Graphics* pGraphics, +void CFWL_ListBox::DrawItem(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, CFWL_ListItem* pItem, int32_t Index, @@ -714,7 +714,7 @@ void CFWL_ListBox::OnProcessEvent(CFWL_Event* pEvent) { } } -void CFWL_ListBox::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_ListBox::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h index 18aaf4cbd5..4f934432d6 100644 --- a/xfa/fwl/cfwl_listbox.h +++ b/xfa/fwl/cfwl_listbox.h @@ -42,11 +42,11 @@ class CFWL_ListBox : public CFWL_Widget { FWL_Type GetClassID() const override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; int32_t CountItems(const CFWL_Widget* pWidget) const; @@ -85,19 +85,19 @@ class CFWL_ListBox : public CFWL_Widget { void SelectAll(); CFWL_ListItem* GetFocusedItem(); void SetFocusItem(CFWL_ListItem* hItem); - void DrawBkground(CFX_Graphics* pGraphics, + void DrawBkground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawItems(CFX_Graphics* pGraphics, + void DrawItems(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawItem(CFX_Graphics* pGraphics, + void DrawItem(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, CFWL_ListItem* hItem, int32_t Index, const CFX_RectF& rtItem, const CFX_Matrix* pMatrix); - void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); + void DrawStatic(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); CFX_SizeF CalcSize(bool bAutoSize); void UpdateItemSize(CFWL_ListItem* hItem, CFX_SizeF& size, diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp index 4ef0c694c5..8c770e545b 100644 --- a/xfa/fwl/cfwl_monthcalendar.cpp +++ b/xfa/fwl/cfwl_monthcalendar.cpp @@ -146,7 +146,7 @@ void CFWL_MonthCalendar::Update() { Layout(); } -void CFWL_MonthCalendar::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -178,7 +178,7 @@ void CFWL_MonthCalendar::SetSelect(int32_t iYear, AddSelDay(iDay); } -void CFWL_MonthCalendar::DrawBackground(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawBackground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -192,7 +192,7 @@ void CFWL_MonthCalendar::DrawBackground(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶ms); } -void CFWL_MonthCalendar::DrawHeadBK(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawHeadBK(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -206,7 +206,7 @@ void CFWL_MonthCalendar::DrawHeadBK(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶ms); } -void CFWL_MonthCalendar::DrawLButton(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawLButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -220,7 +220,7 @@ void CFWL_MonthCalendar::DrawLButton(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶ms); } -void CFWL_MonthCalendar::DrawRButton(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawRButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -234,7 +234,7 @@ void CFWL_MonthCalendar::DrawRButton(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶ms); } -void CFWL_MonthCalendar::DrawCaption(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawCaption(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeText textParam; @@ -254,7 +254,7 @@ void CFWL_MonthCalendar::DrawCaption(CFX_Graphics* pGraphics, pTheme->DrawText(&textParam); } -void CFWL_MonthCalendar::DrawSeperator(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawSeperator(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -268,7 +268,7 @@ void CFWL_MonthCalendar::DrawSeperator(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶ms); } -void CFWL_MonthCalendar::DrawDatesInBK(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawDatesInBK(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -298,7 +298,7 @@ void CFWL_MonthCalendar::DrawDatesInBK(CFX_Graphics* pGraphics, } } -void CFWL_MonthCalendar::DrawWeek(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawWeek(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; @@ -323,7 +323,7 @@ void CFWL_MonthCalendar::DrawWeek(CFX_Graphics* pGraphics, } } -void CFWL_MonthCalendar::DrawToday(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawToday(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; @@ -344,7 +344,7 @@ void CFWL_MonthCalendar::DrawToday(CFX_Graphics* pGraphics, pTheme->DrawText(¶ms); } -void CFWL_MonthCalendar::DrawDatesIn(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawDatesIn(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; @@ -369,7 +369,7 @@ void CFWL_MonthCalendar::DrawDatesIn(CFX_Graphics* pGraphics, } } -void CFWL_MonthCalendar::DrawDatesOut(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawDatesOut(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; @@ -383,7 +383,7 @@ void CFWL_MonthCalendar::DrawDatesOut(CFX_Graphics* pGraphics, pTheme->DrawText(¶ms); } -void CFWL_MonthCalendar::DrawDatesInCircle(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::DrawDatesInCircle(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { if (m_iMonth != m_iCurMonth || m_iYear != m_iCurYear) @@ -745,7 +745,7 @@ void CFWL_MonthCalendar::OnProcessMessage(CFWL_Message* pMessage) { CFWL_Widget::OnProcessMessage(pMessage); } -void CFWL_MonthCalendar::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_MonthCalendar::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_monthcalendar.h b/xfa/fwl/cfwl_monthcalendar.h index 70c0401b7d..e537c331ef 100644 --- a/xfa/fwl/cfwl_monthcalendar.h +++ b/xfa/fwl/cfwl_monthcalendar.h @@ -33,9 +33,9 @@ class CFWL_MonthCalendar : public CFWL_Widget { FWL_Type GetClassID() const override; CFX_RectF GetAutosizedWidgetRect() override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); @@ -90,40 +90,40 @@ class CFWL_MonthCalendar : public CFWL_Widget { CFX_WideString wsDay; }; - void DrawBackground(CFX_Graphics* pGraphics, + void DrawBackground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawHeadBK(CFX_Graphics* pGraphics, + void DrawHeadBK(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawLButton(CFX_Graphics* pGraphics, + void DrawLButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawRButton(CFX_Graphics* pGraphics, + void DrawRButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawCaption(CFX_Graphics* pGraphics, + void DrawCaption(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawSeperator(CFX_Graphics* pGraphics, + void DrawSeperator(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawDatesInBK(CFX_Graphics* pGraphics, + void DrawDatesInBK(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawWeek(CFX_Graphics* pGraphics, + void DrawWeek(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawToday(CFX_Graphics* pGraphics, + void DrawToday(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawDatesIn(CFX_Graphics* pGraphics, + void DrawDatesIn(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawDatesOut(CFX_Graphics* pGraphics, + void DrawDatesOut(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawDatesInCircle(CFX_Graphics* pGraphics, + void DrawDatesInCircle(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); CFX_SizeF CalcSize(); diff --git a/xfa/fwl/cfwl_notedriver.h b/xfa/fwl/cfwl_notedriver.h index b55e701c40..0db482ecbc 100644 --- a/xfa/fwl/cfwl_notedriver.h +++ b/xfa/fwl/cfwl_notedriver.h @@ -14,7 +14,7 @@ #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_widget.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" class CFWL_EventTarget; class CFWL_NoteLoop; diff --git a/xfa/fwl/cfwl_picturebox.cpp b/xfa/fwl/cfwl_picturebox.cpp index 8c200e0494..096b14ec61 100644 --- a/xfa/fwl/cfwl_picturebox.cpp +++ b/xfa/fwl/cfwl_picturebox.cpp @@ -32,7 +32,7 @@ void CFWL_PictureBox::Update() { m_rtClient = GetClientRect(); } -void CFWL_PictureBox::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_PictureBox::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -44,7 +44,7 @@ void CFWL_PictureBox::DrawWidget(CFX_Graphics* pGraphics, DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } -void CFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_PictureBox::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_picturebox.h b/xfa/fwl/cfwl_picturebox.h index 743ea1dc6d..e244c853b8 100644 --- a/xfa/fwl/cfwl_picturebox.h +++ b/xfa/fwl/cfwl_picturebox.h @@ -23,8 +23,8 @@ class CFWL_PictureBox : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; private: diff --git a/xfa/fwl/cfwl_pushbutton.cpp b/xfa/fwl/cfwl_pushbutton.cpp index 42925414f8..382748df53 100644 --- a/xfa/fwl/cfwl_pushbutton.cpp +++ b/xfa/fwl/cfwl_pushbutton.cpp @@ -51,7 +51,7 @@ void CFWL_PushButton::Update() { m_rtCaption = m_rtClient; } -void CFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_PushButton::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -65,7 +65,7 @@ void CFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix); } -void CFWL_PushButton::DrawBkground(CFX_Graphics* pGraphics, +void CFWL_PushButton::DrawBkground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; @@ -144,7 +144,7 @@ void CFWL_PushButton::OnProcessMessage(CFWL_Message* pMessage) { CFWL_Widget::OnProcessMessage(pMessage); } -void CFWL_PushButton::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_PushButton::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_pushbutton.h b/xfa/fwl/cfwl_pushbutton.h index f7323eb46b..196c53763f 100644 --- a/xfa/fwl/cfwl_pushbutton.h +++ b/xfa/fwl/cfwl_pushbutton.h @@ -28,13 +28,13 @@ class CFWL_PushButton : public CFWL_Widget { FWL_Type GetClassID() const override; void SetStates(uint32_t dwStates) override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; private: - void DrawBkground(CFX_Graphics* pGraphics, + void DrawBkground(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); uint32_t GetPartStates(); diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp index 79e8b48115..0e1a9be1ba 100644 --- a/xfa/fwl/cfwl_scrollbar.cpp +++ b/xfa/fwl/cfwl_scrollbar.cpp @@ -74,7 +74,7 @@ void CFWL_ScrollBar::Update() { Layout(); } -void CFWL_ScrollBar::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_ScrollBar::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -104,7 +104,7 @@ bool CFWL_ScrollBar::DoScroll(CFWL_EventScroll::Code dwCode, float fPos) { return OnScroll(dwCode, fPos); } -void CFWL_ScrollBar::DrawTrack(CFX_Graphics* pGraphics, +void CFWL_ScrollBar::DrawTrack(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, bool bLower, const CFX_Matrix* pMatrix) { @@ -120,7 +120,7 @@ void CFWL_ScrollBar::DrawTrack(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } -void CFWL_ScrollBar::DrawArrowBtn(CFX_Graphics* pGraphics, +void CFWL_ScrollBar::DrawArrowBtn(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, bool bMinBtn, const CFX_Matrix* pMatrix) { @@ -137,7 +137,7 @@ void CFWL_ScrollBar::DrawArrowBtn(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } -void CFWL_ScrollBar::DrawThumb(CFX_Graphics* pGraphics, +void CFWL_ScrollBar::DrawThumb(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; @@ -355,7 +355,7 @@ void CFWL_ScrollBar::OnProcessMessage(CFWL_Message* pMessage) { } } -void CFWL_ScrollBar::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_ScrollBar::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_scrollbar.h b/xfa/fwl/cfwl_scrollbar.h index 262d0794d8..368dee96fe 100644 --- a/xfa/fwl/cfwl_scrollbar.h +++ b/xfa/fwl/cfwl_scrollbar.h @@ -30,9 +30,9 @@ class CFWL_ScrollBar : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void GetRange(float* fMin, float* fMax) const { @@ -66,15 +66,15 @@ class CFWL_ScrollBar : public CFWL_Widget { bool IsVertical() const { return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert); } - void DrawTrack(CFX_Graphics* pGraphics, + void DrawTrack(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, bool bLower, const CFX_Matrix* pMatrix); - void DrawArrowBtn(CFX_Graphics* pGraphics, + void DrawArrowBtn(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, bool bMinBtn, const CFX_Matrix* pMatrix); - void DrawThumb(CFX_Graphics* pGraphics, + void DrawThumb(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); void Layout(); diff --git a/xfa/fwl/cfwl_spinbutton.cpp b/xfa/fwl/cfwl_spinbutton.cpp index 65bd6cdd3a..2943c205d7 100644 --- a/xfa/fwl/cfwl_spinbutton.cpp +++ b/xfa/fwl/cfwl_spinbutton.cpp @@ -78,7 +78,7 @@ FWL_WidgetHit CFWL_SpinButton::HitTest(const CFX_PointF& point) { return FWL_WidgetHit::Unknown; } -void CFWL_SpinButton::DrawWidget(CFX_Graphics* pGraphics, +void CFWL_SpinButton::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) return; @@ -107,7 +107,7 @@ bool CFWL_SpinButton::IsDownButtonEnabled() { return m_dwDnState != CFWL_PartState_Disabled; } -void CFWL_SpinButton::DrawUpButton(CFX_Graphics* pGraphics, +void CFWL_SpinButton::DrawUpButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -122,7 +122,7 @@ void CFWL_SpinButton::DrawUpButton(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶ms); } -void CFWL_SpinButton::DrawDownButton(CFX_Graphics* pGraphics, +void CFWL_SpinButton::DrawDownButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; @@ -182,7 +182,7 @@ void CFWL_SpinButton::OnProcessMessage(CFWL_Message* pMessage) { CFWL_Widget::OnProcessMessage(pMessage); } -void CFWL_SpinButton::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_SpinButton::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { DrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fwl/cfwl_spinbutton.h b/xfa/fwl/cfwl_spinbutton.h index 3cda761f91..2dcb8483f2 100644 --- a/xfa/fwl/cfwl_spinbutton.h +++ b/xfa/fwl/cfwl_spinbutton.h @@ -28,9 +28,9 @@ class CFWL_SpinButton : public CFWL_Widget { FWL_Type GetClassID() const override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; private: @@ -46,10 +46,10 @@ class CFWL_SpinButton : public CFWL_Widget { void DisableButton(); bool IsUpButtonEnabled(); bool IsDownButtonEnabled(); - void DrawUpButton(CFX_Graphics* pGraphics, + void DrawUpButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); - void DrawDownButton(CFX_Graphics* pGraphics, + void DrawDownButton(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); void OnFocusChanged(CFWL_Message* pMsg, bool bSet); diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h index f23f26e229..0141754c1e 100644 --- a/xfa/fwl/cfwl_themebackground.h +++ b/xfa/fwl/cfwl_themebackground.h @@ -11,16 +11,16 @@ #include "xfa/fwl/cfwl_themepart.h" class CFX_DIBitmpa; -class CFX_Graphics; -class CFX_Path; +class CXFA_Graphics; +class CXFA_Path; class CFWL_ThemeBackground : public CFWL_ThemePart { public: CFWL_ThemeBackground(); ~CFWL_ThemeBackground(); - CFX_Graphics* m_pGraphics; - CFX_Path* m_pPath; + CXFA_Graphics* m_pGraphics; + CXFA_Path* m_pPath; CFX_RetainPtr m_pImage; }; diff --git a/xfa/fwl/cfwl_themetext.h b/xfa/fwl/cfwl_themetext.h index 6cbc465bf3..7c8330e04e 100644 --- a/xfa/fwl/cfwl_themetext.h +++ b/xfa/fwl/cfwl_themetext.h @@ -18,7 +18,7 @@ class CFWL_ThemeText : public CFWL_ThemePart { CFX_WideString m_wsText; uint32_t m_dwTTOStyles; int32_t m_iTTOAlign; - CFX_Graphics* m_pGraphics; + CXFA_Graphics* m_pGraphics; }; #endif // XFA_FWL_CFWL_THEMETEXT_H_ diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index 45ae9c0b0c..a2c270c332 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp @@ -518,7 +518,7 @@ void CFWL_Widget::RepaintRect(const CFX_RectF& pRect) { m_pWidgetMgr->RepaintWidget(this, pRect); } -void CFWL_Widget::DrawBackground(CFX_Graphics* pGraphics, +void CFWL_Widget::DrawBackground(CXFA_Graphics* pGraphics, CFWL_Part iPartBk, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { @@ -532,7 +532,7 @@ void CFWL_Widget::DrawBackground(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } -void CFWL_Widget::DrawBorder(CFX_Graphics* pGraphics, +void CFWL_Widget::DrawBorder(CXFA_Graphics* pGraphics, CFWL_Part iPartBorder, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { @@ -610,5 +610,5 @@ void CFWL_Widget::OnProcessMessage(CFWL_Message* pMessage) { void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} -void CFWL_Widget::OnDrawWidget(CFX_Graphics* pGraphics, +void CFWL_Widget::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) {} diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h index 9bcbf55cbc..316e6f5404 100644 --- a/xfa/fwl/cfwl_widget.h +++ b/xfa/fwl/cfwl_widget.h @@ -63,14 +63,14 @@ class CFWL_Widget : public IFWL_WidgetDelegate { virtual void RemoveStates(uint32_t dwStates); virtual void Update() = 0; virtual FWL_WidgetHit HitTest(const CFX_PointF& point); - virtual void DrawWidget(CFX_Graphics* pGraphics, + virtual void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) = 0; virtual void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); // IFWL_WidgetDelegate. void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; void InflateWidgetRect(CFX_RectF& rect); @@ -143,7 +143,7 @@ class CFWL_Widget : public IFWL_WidgetDelegate { void RegisterEventTarget(CFWL_Widget* pEventSource); void UnregisterEventTarget(); void DispatchEvent(CFWL_Event* pEvent); - void DrawBorder(CFX_Graphics* pGraphics, + void DrawBorder(CXFA_Graphics* pGraphics, CFWL_Part iPartBorder, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); @@ -175,7 +175,7 @@ class CFWL_Widget : public IFWL_WidgetDelegate { float fMaxHeight, const CFX_RectF& rtAnchor, CFX_RectF& rtPopup); - void DrawBackground(CFX_Graphics* pGraphics, + void DrawBackground(CXFA_Graphics* pGraphics, CFWL_Part iPartBk, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index 3abe14d89b..eb98f2ee81 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -418,7 +418,7 @@ void CFWL_WidgetMgr::OnProcessMessageToForm(CFWL_Message* pMessage) { } void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pWidget || !pGraphics) return; @@ -453,7 +453,7 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, void CFWL_WidgetMgr::DrawChild(CFWL_Widget* parent, const CFX_RectF& rtClip, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!parent) return; diff --git a/xfa/fwl/cfwl_widgetmgr.h b/xfa/fwl/cfwl_widgetmgr.h index 4c12e707f6..3b26c7155d 100644 --- a/xfa/fwl/cfwl_widgetmgr.h +++ b/xfa/fwl/cfwl_widgetmgr.h @@ -13,14 +13,14 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fwl/ifwl_widgetmgrdelegate.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" #define FWL_WGTMGR_DisableForm 0x00000002 class CFWL_Message; class CXFA_FFApp; class CXFA_FWLAdapterWidgetMgr; -class CFX_Graphics; +class CXFA_Graphics; class CFX_Matrix; class CFWL_Widget; @@ -33,7 +33,7 @@ class CFWL_WidgetMgr : public CFWL_WidgetMgrDelegate { void OnSetCapability(uint32_t dwCapability) override; void OnProcessMessageToForm(CFWL_Message* pMessage) override; void OnDrawWidget(CFWL_Widget* pWidget, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; CFWL_Widget* GetParentWidget(CFWL_Widget* pWidget) const; @@ -82,7 +82,7 @@ class CFWL_WidgetMgr : public CFWL_WidgetMgrDelegate { Item* pPrevious; Item* pNext; CFWL_Widget* const pWidget; - std::unique_ptr pOffscreen; + std::unique_ptr pOffscreen; int32_t iRedrawCounter; #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) bool bOutsideChanged; @@ -103,11 +103,11 @@ class CFWL_WidgetMgr : public CFWL_WidgetMgrDelegate { void DrawChild(CFWL_Widget* pParent, const CFX_RectF& rtClip, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix); - CFX_Graphics* DrawWidgetBefore(CFWL_Widget* pWidget, - CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix); + CXFA_Graphics* DrawWidgetBefore(CFWL_Widget* pWidget, + CXFA_Graphics* pGraphics, + const CFX_Matrix* pMatrix); bool IsNeedRepaint(CFWL_Widget* pWidget, CFX_Matrix* pMatrix, const CFX_RectF& rtDirty); diff --git a/xfa/fwl/ifwl_widgetdelegate.h b/xfa/fwl/ifwl_widgetdelegate.h index a96f00dc9e..8dee6da7a9 100644 --- a/xfa/fwl/ifwl_widgetdelegate.h +++ b/xfa/fwl/ifwl_widgetdelegate.h @@ -11,7 +11,7 @@ class CFWL_Event; class CFWL_Message; -class CFX_Graphics; +class CXFA_Graphics; class CFX_Matrix; class IFWL_WidgetDelegate { @@ -20,7 +20,7 @@ class IFWL_WidgetDelegate { virtual void OnProcessMessage(CFWL_Message* pMessage) = 0; virtual void OnProcessEvent(CFWL_Event* pEvent) = 0; - virtual void OnDrawWidget(CFX_Graphics* pGraphics, + virtual void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) = 0; }; diff --git a/xfa/fwl/ifwl_widgetmgrdelegate.h b/xfa/fwl/ifwl_widgetmgrdelegate.h index 9f0b5708b3..46996821c5 100644 --- a/xfa/fwl/ifwl_widgetmgrdelegate.h +++ b/xfa/fwl/ifwl_widgetmgrdelegate.h @@ -8,7 +8,7 @@ #define XFA_FWL_IFWL_WIDGETMGRDELEGATE_H_ class CFWL_Message; -class CFX_Graphics; +class CXFA_Graphics; class CFX_Matrix; class CFWL_Widget; @@ -17,7 +17,7 @@ class CFWL_WidgetMgrDelegate { virtual void OnSetCapability(uint32_t dwCapability) = 0; virtual void OnProcessMessageToForm(CFWL_Message* pMessage) = 0; virtual void OnDrawWidget(CFWL_Widget* pWidget, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) = 0; }; diff --git a/xfa/fwl/theme/cfwl_carettp.cpp b/xfa/fwl/theme/cfwl_carettp.cpp index 6d68ba283b..64eef9ffc9 100644 --- a/xfa/fwl/theme/cfwl_carettp.cpp +++ b/xfa/fwl/theme/cfwl_carettp.cpp @@ -9,8 +9,8 @@ #include "xfa/fwl/cfwl_caret.h" #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_widget.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" CFWL_CaretTP::CFWL_CaretTP() {} CFWL_CaretTP::~CFWL_CaretTP() {} @@ -34,12 +34,12 @@ void CFWL_CaretTP::DrawBackground(CFWL_ThemeBackground* pParams) { } } -void CFWL_CaretTP::DrawCaretBK(CFX_Graphics* pGraphics, +void CFWL_CaretTP::DrawCaretBK(CXFA_Graphics* pGraphics, uint32_t dwStates, const CFX_RectF* pRect, CXFA_Color* crFill, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rect = *pRect; path.AddRectangle(rect.left, rect.top, rect.width, rect.height); if (crFill) { diff --git a/xfa/fwl/theme/cfwl_carettp.h b/xfa/fwl/theme/cfwl_carettp.h index 0491ee7b4e..fdf330b8bf 100644 --- a/xfa/fwl/theme/cfwl_carettp.h +++ b/xfa/fwl/theme/cfwl_carettp.h @@ -18,7 +18,7 @@ class CFWL_CaretTP : public CFWL_WidgetTP { void DrawBackground(CFWL_ThemeBackground* pParams) override; protected: - void DrawCaretBK(CFX_Graphics* pGraphics, + void DrawCaretBK(CXFA_Graphics* pGraphics, uint32_t dwStates, const CFX_RectF* pRect, CXFA_Color* crFill, diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp index 7e9fc510c6..334c1912a3 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.cpp +++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp @@ -13,8 +13,8 @@ #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_themetext.h" #include "xfa/fwl/cfwl_widget.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" namespace { @@ -56,7 +56,7 @@ void CFWL_CheckBoxTP::DrawText(CFWL_ThemeText* pParams) { CFWL_WidgetTP::DrawText(pParams); } -void CFWL_CheckBoxTP::DrawSignCheck(CFX_Graphics* pGraphics, +void CFWL_CheckBoxTP::DrawSignCheck(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix) { @@ -74,11 +74,11 @@ void CFWL_CheckBoxTP::DrawSignCheck(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_CheckBoxTP::DrawSignCircle(CFX_Graphics* pGraphics, +void CFWL_CheckBoxTP::DrawSignCircle(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; path.AddEllipse(*pRtSign); CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); @@ -87,11 +87,11 @@ void CFWL_CheckBoxTP::DrawSignCircle(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_CheckBoxTP::DrawSignCross(CFX_Graphics* pGraphics, +void CFWL_CheckBoxTP::DrawSignCross(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; float fRight = pRtSign->right(); float fBottom = pRtSign->bottom(); path.AddLine(pRtSign->TopLeft(), CFX_PointF(fRight, fBottom)); @@ -106,11 +106,11 @@ void CFWL_CheckBoxTP::DrawSignCross(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_CheckBoxTP::DrawSignDiamond(CFX_Graphics* pGraphics, +void CFWL_CheckBoxTP::DrawSignDiamond(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; float fWidth = pRtSign->width; float fHeight = pRtSign->height; float fBottom = pRtSign->bottom(); @@ -127,11 +127,11 @@ void CFWL_CheckBoxTP::DrawSignDiamond(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_CheckBoxTP::DrawSignSquare(CFX_Graphics* pGraphics, +void CFWL_CheckBoxTP::DrawSignSquare(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; path.AddRectangle(pRtSign->left, pRtSign->top, pRtSign->width, pRtSign->height); CXFA_Color crFill(argbFill); @@ -141,11 +141,11 @@ void CFWL_CheckBoxTP::DrawSignSquare(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics* pGraphics, +void CFWL_CheckBoxTP::DrawSignStar(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; float fBottom = pRtSign->bottom(); float fRadius = (pRtSign->top - fBottom) / (1 + static_cast(cos(FX_PI / 5.0f))); @@ -218,7 +218,7 @@ void CFWL_CheckBoxTP::SetThemeData() { void CFWL_CheckBoxTP::InitCheckPath(float fCheckLen) { if (!m_pCheckPath) { - m_pCheckPath = pdfium::MakeUnique(); + m_pCheckPath = pdfium::MakeUnique(); float fWidth = kSignPath; float fHeight = -kSignPath; @@ -282,7 +282,7 @@ void CFWL_CheckBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) { } void CFWL_CheckBoxTP::DrawCheckSign(CFWL_Widget* pWidget, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_RectF& pRtBox, int32_t iState, CFX_Matrix* pMatrix) { diff --git a/xfa/fwl/theme/cfwl_checkboxtp.h b/xfa/fwl/theme/cfwl_checkboxtp.h index 1070b12598..97ef5cf20c 100644 --- a/xfa/fwl/theme/cfwl_checkboxtp.h +++ b/xfa/fwl/theme/cfwl_checkboxtp.h @@ -36,31 +36,31 @@ class CFWL_CheckBoxTP : public CFWL_WidgetTP { }; void DrawCheckSign(CFWL_Widget* pWidget, - CFX_Graphics* pGraphics, + CXFA_Graphics* pGraphics, const CFX_RectF& pRtBox, int32_t iState, CFX_Matrix* pMatrix); - void DrawSignCheck(CFX_Graphics* pGraphics, + void DrawSignCheck(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix); - void DrawSignCircle(CFX_Graphics* pGraphics, + void DrawSignCircle(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix); - void DrawSignCross(CFX_Graphics* pGraphics, + void DrawSignCross(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix); - void DrawSignDiamond(CFX_Graphics* pGraphics, + void DrawSignDiamond(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix); - void DrawSignSquare(CFX_Graphics* pGraphics, + void DrawSignSquare(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix); - void DrawSignStar(CFX_Graphics* pGraphics, + void DrawSignStar(CXFA_Graphics* pGraphics, const CFX_RectF* pRtSign, FX_ARGB argbFill, CFX_Matrix* pMatrix); @@ -68,7 +68,7 @@ class CFWL_CheckBoxTP : public CFWL_WidgetTP { void InitCheckPath(float fCheckLen); std::unique_ptr m_pThemeData; - std::unique_ptr m_pCheckPath; + std::unique_ptr m_pCheckPath; private: void SetThemeData(); diff --git a/xfa/fwl/theme/cfwl_comboboxtp.cpp b/xfa/fwl/theme/cfwl_comboboxtp.cpp index 0136a2ec87..d8852ffe52 100644 --- a/xfa/fwl/theme/cfwl_comboboxtp.cpp +++ b/xfa/fwl/theme/cfwl_comboboxtp.cpp @@ -10,8 +10,8 @@ #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/ifwl_themeprovider.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" CFWL_ComboBoxTP::CFWL_ComboBoxTP() {} @@ -27,7 +27,7 @@ void CFWL_ComboBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) { break; } case CFWL_Part::Background: { - CFX_Path path; + CXFA_Path path; CFX_RectF& rect = pParams->m_rtPart; path.AddRectangle(rect.left, rect.top, rect.width, rect.height); FX_ARGB argb_color; @@ -64,7 +64,7 @@ void CFWL_ComboBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) { void CFWL_ComboBoxTP::DrawStrethHandler(CFWL_ThemeBackground* pParams, uint32_t dwStates, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; path.AddRectangle(pParams->m_rtPart.left, pParams->m_rtPart.top, pParams->m_rtPart.width - 1, pParams->m_rtPart.height); CXFA_Color cr(ArgbEncode(0xff, 0xff, 0, 0)); diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp index 249a15afba..b04136ba23 100644 --- a/xfa/fwl/theme/cfwl_edittp.cpp +++ b/xfa/fwl/theme/cfwl_edittp.cpp @@ -11,8 +11,8 @@ #include "xfa/fwl/cfwl_widget.h" #include "xfa/fxfa/app/cxfa_fwltheme.h" #include "xfa/fxfa/cxfa_ffwidget.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" CFWL_EditTP::CFWL_EditTP() {} @@ -44,7 +44,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { } case CFWL_Part::Background: { if (pParams->m_pPath) { - CFX_Graphics* pGraphics = pParams->m_pGraphics; + CXFA_Graphics* pGraphics = pParams->m_pGraphics; pGraphics->SaveGraphState(); CXFA_Color crSelected(FWLTHEME_COLOR_BKSelected); pGraphics->SetFillColor(&crSelected); @@ -52,7 +52,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { &pParams->m_matrix); pGraphics->RestoreGraphState(); } else { - CFX_Path path; + CXFA_Path path; path.AddRectangle(pParams->m_rtPart.left, pParams->m_rtPart.top, pParams->m_rtPart.width, pParams->m_rtPart.height); CXFA_Color cr(FWLTHEME_COLOR_Background); diff --git a/xfa/fwl/theme/cfwl_listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp index 6a9231d208..caa764f953 100644 --- a/xfa/fwl/theme/cfwl_listboxtp.cpp +++ b/xfa/fwl/theme/cfwl_listboxtp.cpp @@ -9,8 +9,8 @@ #include "xfa/fwl/cfwl_listbox.h" #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_widget.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" CFWL_ListBoxTP::CFWL_ListBoxTP() {} @@ -59,7 +59,7 @@ void CFWL_ListBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) { } } -void CFWL_ListBoxTP::DrawListBoxItem(CFX_Graphics* pGraphics, +void CFWL_ListBoxTP::DrawListBoxItem(CXFA_Graphics* pGraphics, uint32_t dwStates, const CFX_RectF* prtItem, void* pData, @@ -69,7 +69,7 @@ void CFWL_ListBoxTP::DrawListBoxItem(CFX_Graphics* pGraphics, CXFA_Color crFill(FWLTHEME_COLOR_BKSelected); pGraphics->SetFillColor(&crFill); CFX_RectF rt(*prtItem); - CFX_Path path; + CXFA_Path path; #if (_FX_OS_ == _FX_MACOSX_) path.AddRectangle(rt.left, rt.top, rt.width - 1, rt.height - 1); #else diff --git a/xfa/fwl/theme/cfwl_listboxtp.h b/xfa/fwl/theme/cfwl_listboxtp.h index dcf5ec89be..5dc45af4fe 100644 --- a/xfa/fwl/theme/cfwl_listboxtp.h +++ b/xfa/fwl/theme/cfwl_listboxtp.h @@ -18,7 +18,7 @@ class CFWL_ListBoxTP : public CFWL_WidgetTP { void DrawBackground(CFWL_ThemeBackground* pParams) override; protected: - void DrawListBoxItem(CFX_Graphics* pGraphics, + void DrawListBoxItem(CXFA_Graphics* pGraphics, uint32_t dwStates, const CFX_RectF* prtItem, void* pData = nullptr, diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp index 2f075ab7b7..8b73bac668 100644 --- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp +++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp @@ -12,8 +12,8 @@ #include "xfa/fwl/cfwl_themetext.h" #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/ifwl_themeprovider.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() : m_pThemeData(new MCThemeData) { SetThemeData(); @@ -104,7 +104,7 @@ void CFWL_MonthCalendarTP::DrawText(CFWL_ThemeText* pParams) { void CFWL_MonthCalendarTP::DrawTotalBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtTotal(pParams->m_rtPart); path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height); pParams->m_pGraphics->SaveGraphState(); @@ -117,7 +117,7 @@ void CFWL_MonthCalendarTP::DrawTotalBK(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawHeadBk(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtHead = pParams->m_rtPart; path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height); pParams->m_pGraphics->SaveGraphState(); @@ -130,7 +130,7 @@ void CFWL_MonthCalendarTP::DrawHeadBk(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtLBtn = pParams->m_rtPart; path.AddRectangle(rtLBtn.left, rtLBtn.top, rtLBtn.width, rtLBtn.height); pParams->m_pGraphics->SaveGraphState(); @@ -164,7 +164,7 @@ void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtRBtn = pParams->m_rtPart; path.AddRectangle(rtRBtn.left, rtRBtn.top, rtRBtn.width, rtRBtn.height); pParams->m_pGraphics->SaveGraphState(); @@ -198,7 +198,7 @@ void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawHSeperator(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtHSep = pParams->m_rtPart; path.MoveTo(CFX_PointF(rtHSep.left, rtHSep.top + rtHSep.height / 2)); path.LineTo(CFX_PointF(rtHSep.right(), rtHSep.top + rtHSep.height / 2)); @@ -212,7 +212,7 @@ void CFWL_MonthCalendarTP::DrawHSeperator(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawWeekNumSep(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtWeekSep = pParams->m_rtPart; path.MoveTo(rtWeekSep.TopLeft()); path.LineTo(rtWeekSep.BottomLeft()); @@ -228,7 +228,7 @@ void CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { pParams->m_pGraphics->SaveGraphState(); if (pParams->m_dwStates & CFWL_PartState_Selected) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtSelDay = pParams->m_rtPart; path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, rtSelDay.height); @@ -236,7 +236,7 @@ void CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams, pParams->m_pGraphics->SetFillColor(&clrSelDayBK); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } else if (pParams->m_dwStates & CFWL_PartState_Hovered) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtSelDay = pParams->m_rtPart; path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, rtSelDay.height); @@ -249,7 +249,7 @@ void CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawDatesInCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtSelDay = pParams->m_rtPart; path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, rtSelDay.height); @@ -262,7 +262,7 @@ void CFWL_MonthCalendarTP::DrawDatesInCircle(CFWL_ThemeBackground* pParams, void CFWL_MonthCalendarTP::DrawTodayCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; CFX_RectF rtTodayCircle = pParams->m_rtPart; path.AddRectangle(rtTodayCircle.left, rtTodayCircle.top, rtTodayCircle.width, rtTodayCircle.height); diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp index 3ef5072743..d0f5760f44 100644 --- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp +++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp @@ -10,8 +10,8 @@ #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/ifwl_themeprovider.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" #define PUSHBUTTON_SIZE_Corner 2 @@ -32,7 +32,7 @@ void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) { float fRight = rect.right(); float fBottom = rect.bottom(); - CFX_Path strokePath; + CXFA_Path strokePath; strokePath.MoveTo( CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, rect.top)); strokePath.LineTo(CFX_PointF(fRight - PUSHBUTTON_SIZE_Corner, rect.top)); @@ -48,10 +48,10 @@ void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) { strokePath.LineTo( CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, rect.top)); - CFX_Path fillPath; + CXFA_Path fillPath; fillPath.AddSubpath(&strokePath); - CFX_Graphics* pGraphics = pParams->m_pGraphics; + CXFA_Graphics* pGraphics = pParams->m_pGraphics; pGraphics->SaveGraphState(); CFX_RectF rtInner(rect); diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp index f0063b4a32..2975888ac2 100644 --- a/xfa/fwl/theme/cfwl_scrollbartp.cpp +++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp @@ -10,8 +10,8 @@ #include "xfa/fwl/cfwl_themebackground.h" #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/ifwl_themeprovider.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" namespace { @@ -38,7 +38,7 @@ void CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) { else if (pParams->m_dwStates & CFWL_PartState_Disabled) eState = FWLTHEME_STATE_Disable; - CFX_Graphics* pGraphics = pParams->m_pGraphics; + CXFA_Graphics* pGraphics = pParams->m_pGraphics; CFX_RectF* pRect = &pParams->m_rtPart; bool bVert = !!pWidget->GetStylesEx(); switch (pParams->m_iPart) { @@ -71,7 +71,7 @@ void CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) { } } -void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics, +void CFWL_ScrollBarTP::DrawThumbBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, bool bVert, FWLTHEME_STATE eState, @@ -80,7 +80,7 @@ void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics, if (eState < FWLTHEME_STATE_Normal || eState > FWLTHEME_STATE_Disable) return; - CFX_Path path; + CXFA_Path path; CFX_RectF rect(*pRect); if (bVert) { rect.Deflate(1, 0); @@ -117,12 +117,12 @@ void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics, } } -void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics, +void CFWL_ScrollBarTP::DrawPaw(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, bool bVert, FWLTHEME_STATE eState, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; if (bVert) { float fPawLen = kPawLength; if (pRect->width / 2 <= fPawLen) { @@ -200,7 +200,7 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics, } } -void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics, +void CFWL_ScrollBarTP::DrawTrack(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, bool bVert, FWLTHEME_STATE eState, @@ -211,7 +211,7 @@ void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics, pGraphics->SaveGraphState(); CXFA_Color colorLine(ArgbEncode(255, 238, 237, 229)); - CFX_Path path; + CXFA_Path path; float fRight = pRect->right(); float fBottom = pRect->bottom(); if (bVert) { @@ -235,7 +235,7 @@ void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics, m_pThemeData->clrTrackBKEnd, &path, FXFILL_WINDING, pMatrix); } -void CFWL_ScrollBarTP::DrawMaxMinBtn(CFX_Graphics* pGraphics, +void CFWL_ScrollBarTP::DrawMaxMinBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h index 2389eff3c9..eec372c660 100644 --- a/xfa/fwl/theme/cfwl_scrollbartp.h +++ b/xfa/fwl/theme/cfwl_scrollbartp.h @@ -29,24 +29,24 @@ class CFWL_ScrollBarTP : public CFWL_WidgetTP { FX_ARGB clrTrackBKEnd; }; - void DrawThumbBtn(CFX_Graphics* pGraphics, + void DrawThumbBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, bool bVert, FWLTHEME_STATE eState, bool bPawButton = true, CFX_Matrix* pMatrix = nullptr); - void DrawTrack(CFX_Graphics* pGraphics, + void DrawTrack(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, bool bVert, FWLTHEME_STATE eState, bool bLowerTrack, CFX_Matrix* pMatrix = nullptr); - void DrawMaxMinBtn(CFX_Graphics* pGraphics, + void DrawMaxMinBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, CFX_Matrix* pMatrix = nullptr); - void DrawPaw(CFX_Graphics* pGraphics, + void DrawPaw(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, bool bVert, FWLTHEME_STATE eState, diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 07df4fa17c..90a144fcc1 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -19,9 +19,9 @@ #include "xfa/fwl/cfwl_widget.h" #include "xfa/fwl/cfwl_widgetmgr.h" #include "xfa/fwl/ifwl_themeprovider.h" -#include "xfa/fxgraphics/cfx_path.h" -#include "xfa/fxgraphics/cfx_shading.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" +#include "xfa/fxgraphics/cxfa_shading.h" CFWL_WidgetTP::CFWL_WidgetTP() : m_dwRefCount(1), m_pFDEFont(nullptr), m_pColorData(nullptr) {} @@ -45,7 +45,7 @@ void CFWL_WidgetTP::DrawText(CFWL_ThemeText* pParams) { if (iLen <= 0) return; - CFX_Graphics* pGraphics = pParams->m_pGraphics; + CXFA_Graphics* pGraphics = pParams->m_pGraphics; m_pTextOut->SetRenderDevice(pGraphics->GetRenderDevice()); m_pTextOut->SetStyles(pParams->m_dwTTOStyles); m_pTextOut->SetAlignment(pParams->m_iTTOAlign); @@ -96,14 +96,14 @@ void CFWL_WidgetTP::FinalizeTTO() { m_pTextOut.reset(); } -void CFWL_WidgetTP::DrawBorder(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::DrawBorder(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { if (!pGraphics) return; if (!pRect) return; - CFX_Path path; + CXFA_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 2, pRect->height - 2); @@ -114,13 +114,13 @@ void CFWL_WidgetTP::DrawBorder(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_WidgetTP::FillBackground(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::FillBackground(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { FillSoildRect(pGraphics, FWLTHEME_COLOR_Background, pRect, pMatrix); } -void CFWL_WidgetTP::FillSoildRect(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::FillSoildRect(CXFA_Graphics* pGraphics, FX_ARGB fillColor, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { @@ -131,20 +131,20 @@ void CFWL_WidgetTP::FillSoildRect(CFX_Graphics* pGraphics, pGraphics->SaveGraphState(); CXFA_Color crFill(fillColor); pGraphics->SetFillColor(&crFill); - CFX_Path path; + CXFA_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); pGraphics->RestoreGraphState(); } -void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::DrawAxialShading(CXFA_Graphics* pGraphics, float fx1, float fy1, float fx2, float fy2, FX_ARGB beginColor, FX_ARGB endColor, - CFX_Path* path, + CXFA_Path* path, int32_t fillMode, CFX_Matrix* pMatrix) { if (!pGraphics || !path) @@ -152,7 +152,7 @@ void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics* pGraphics, CFX_PointF begPoint(fx1, fy1); CFX_PointF endPoint(fx2, fy2); - CFX_Shading shading(begPoint, endPoint, false, false, beginColor, endColor); + CXFA_Shading shading(begPoint, endPoint, false, false, beginColor, endColor); pGraphics->SaveGraphState(); CXFA_Color color1(&shading); pGraphics->SetFillColor(&color1); @@ -160,7 +160,7 @@ void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_WidgetTP::DrawFocus(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::DrawFocus(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { if (!pGraphics) @@ -172,13 +172,13 @@ void CFWL_WidgetTP::DrawFocus(CFX_Graphics* pGraphics, pGraphics->SetStrokeColor(&cr); float DashPattern[2] = {1, 1}; pGraphics->SetLineDash(0.0f, DashPattern, 2); - CFX_Path path; + CXFA_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); pGraphics->StrokePath(&path, pMatrix); pGraphics->RestoreGraphState(); } -void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::DrawArrow(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FX_ARGB argSign, @@ -189,7 +189,7 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics, (float)(((pRect->width - (bVert ? 9 : 6)) / 2 + pRect->left) + 0.5); float fTop = (float)(((pRect->height - (bVert ? 6 : 9)) / 2 + pRect->top) + 0.5); - CFX_Path path; + CXFA_Path path; switch (eDict) { case FWLTHEME_DIRECTION_Down: { path.MoveTo(CFX_PointF(fLeft, fTop + 1)); @@ -233,11 +233,11 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics, pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } -void CFWL_WidgetTP::DrawBtn(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::DrawBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_STATE eState, CFX_Matrix* pMatrix) { - CFX_Path path; + CXFA_Path path; InitializeArrowColorData(); float fRight = pRect->right(); @@ -254,7 +254,7 @@ void CFWL_WidgetTP::DrawBtn(CFX_Graphics* pGraphics, pGraphics->StrokePath(&path, pMatrix); } -void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics* pGraphics, +void CFWL_WidgetTP::DrawArrowBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index 730a39cd17..229b9ea7c3 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h @@ -15,7 +15,7 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fwl/theme/cfwl_utils.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" class CFDE_TextOut; class CFGAS_GEFont; @@ -55,39 +55,39 @@ class CFWL_WidgetTP { void InitTTO(); void FinalizeTTO(); - void DrawBorder(CFX_Graphics* pGraphics, + void DrawBorder(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix = nullptr); - void FillBackground(CFX_Graphics* pGraphics, + void FillBackground(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix = nullptr); - void FillSoildRect(CFX_Graphics* pGraphics, + void FillSoildRect(CXFA_Graphics* pGraphics, FX_ARGB fillColor, const CFX_RectF* pRect, CFX_Matrix* pMatrix = nullptr); - void DrawAxialShading(CFX_Graphics* pGraphics, + void DrawAxialShading(CXFA_Graphics* pGraphics, float fx1, float fy1, float fx2, float fy2, FX_ARGB beginColor, FX_ARGB endColor, - CFX_Path* path, + CXFA_Path* path, int32_t fillMode = FXFILL_WINDING, CFX_Matrix* pMatrix = nullptr); - void DrawFocus(CFX_Graphics* pGraphics, + void DrawFocus(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix = nullptr); - void DrawArrow(CFX_Graphics* pGraphics, + void DrawArrow(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FX_ARGB argSign, CFX_Matrix* pMatrix = nullptr); - void DrawBtn(CFX_Graphics* pGraphics, + void DrawBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_STATE eState, CFX_Matrix* pMatrix = nullptr); - void DrawArrowBtn(CFX_Graphics* pGraphics, + void DrawArrowBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, diff --git a/xfa/fxfa/app/cxfa_ffarc.cpp b/xfa/fxfa/app/cxfa_ffarc.cpp index e2085480a5..1a12fb5f23 100644 --- a/xfa/fxfa/app/cxfa_ffarc.cpp +++ b/xfa/fxfa/app/cxfa_ffarc.cpp @@ -10,7 +10,7 @@ CXFA_FFArc::CXFA_FFArc(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} CXFA_FFArc::~CXFA_FFArc() {} -void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFArc::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_ffarc.h b/xfa/fxfa/app/cxfa_ffarc.h index 777ed6f3af..f1bc82f1d2 100644 --- a/xfa/fxfa/app/cxfa_ffarc.h +++ b/xfa/fxfa/app/cxfa_ffarc.h @@ -15,7 +15,7 @@ class CXFA_FFArc : public CXFA_FFDraw { ~CXFA_FFArc() override; // CXFA_FFWidget - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; }; diff --git a/xfa/fxfa/app/cxfa_ffbarcode.cpp b/xfa/fxfa/app/cxfa_ffbarcode.cpp index bd529d3eb2..7bbb60dd77 100644 --- a/xfa/fxfa/app/cxfa_ffbarcode.cpp +++ b/xfa/fxfa/app/cxfa_ffbarcode.cpp @@ -137,7 +137,7 @@ bool CXFA_FFBarcode::LoadWidget() { return CXFA_FFField::LoadWidget(); } -void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFBarcode::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_ffbarcode.h b/xfa/fxfa/app/cxfa_ffbarcode.h index 11b678d98a..782aec39a1 100644 --- a/xfa/fxfa/app/cxfa_ffbarcode.h +++ b/xfa/fxfa/app/cxfa_ffbarcode.h @@ -92,7 +92,7 @@ class CXFA_FFBarcode : public CXFA_FFTextEdit { // CXFA_FFTextEdit bool LoadWidget() override; - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; void UpdateWidgetProperty() override; diff --git a/xfa/fxfa/app/cxfa_ffcheckbutton.cpp b/xfa/fxfa/app/cxfa_ffcheckbutton.cpp index b55daae21a..c3fd6b9157 100644 --- a/xfa/fxfa/app/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/cxfa_ffcheckbutton.cpp @@ -222,7 +222,7 @@ void CXFA_FFCheckButton::AddUIMargin(int32_t iCapPlacement) { } } -void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) @@ -339,7 +339,7 @@ void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) { m_pOldDelegate->OnProcessEvent(pEvent); } -void CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFCheckButton::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fxfa/app/cxfa_ffcheckbutton.h b/xfa/fxfa/app/cxfa_ffcheckbutton.h index f92b50a692..f092abbcf8 100644 --- a/xfa/fxfa/app/cxfa_ffcheckbutton.h +++ b/xfa/fxfa/app/cxfa_ffcheckbutton.h @@ -16,7 +16,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { ~CXFA_FFCheckButton() override; // CXFA_FFField - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; @@ -27,7 +27,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { bool OnLButtonUp(uint32_t dwFlags, const CFX_PointF& point) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; void SetFWLCheckState(XFA_CHECKSTATE eCheckState); diff --git a/xfa/fxfa/app/cxfa_ffcombobox.cpp b/xfa/fxfa/app/cxfa_ffcombobox.cpp index 91de16e9c3..c317c1d90f 100644 --- a/xfa/fxfa/app/cxfa_ffcombobox.cpp +++ b/xfa/fxfa/app/cxfa_ffcombobox.cpp @@ -354,7 +354,7 @@ void CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) { m_pOldDelegate->OnProcessEvent(pEvent); } -void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFComboBox::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fxfa/app/cxfa_ffcombobox.h b/xfa/fxfa/app/cxfa_ffcombobox.h index 048521f5e0..de239b624a 100644 --- a/xfa/fxfa/app/cxfa_ffcombobox.h +++ b/xfa/fxfa/app/cxfa_ffcombobox.h @@ -39,7 +39,7 @@ class CXFA_FFComboBox : public CXFA_FFField { // IFWL_WidgetDelegate void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; virtual void OpenDropDownList(); diff --git a/xfa/fxfa/app/cxfa_ffexclgroup.cpp b/xfa/fxfa/app/cxfa_ffexclgroup.cpp index 60f0202120..c881a79468 100644 --- a/xfa/fxfa/app/cxfa_ffexclgroup.cpp +++ b/xfa/fxfa/app/cxfa_ffexclgroup.cpp @@ -16,7 +16,7 @@ CXFA_FFExclGroup::CXFA_FFExclGroup(CXFA_WidgetAcc* pDataAcc) CXFA_FFExclGroup::~CXFA_FFExclGroup() {} -void CXFA_FFExclGroup::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFExclGroup::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_ffexclgroup.h b/xfa/fxfa/app/cxfa_ffexclgroup.h index 4b66b94712..3575ad38af 100644 --- a/xfa/fxfa/app/cxfa_ffexclgroup.h +++ b/xfa/fxfa/app/cxfa_ffexclgroup.h @@ -16,7 +16,7 @@ class CXFA_FFExclGroup : public CXFA_FFWidget { ~CXFA_FFExclGroup() override; // CXFA_FFWidget - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; }; diff --git a/xfa/fxfa/app/cxfa_fffield.cpp b/xfa/fxfa/app/cxfa_fffield.cpp index 09773b6737..bf98b99a8e 100644 --- a/xfa/fxfa/app/cxfa_fffield.cpp +++ b/xfa/fxfa/app/cxfa_fffield.cpp @@ -23,8 +23,8 @@ #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/parser/cxfa_node.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" namespace { @@ -57,7 +57,7 @@ CFX_RectF CXFA_FFField::GetBBox(uint32_t dwStatus, bool bDrawFocus) { return rtBox; } -void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) @@ -80,7 +80,7 @@ void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, &mt); } -void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, +void CXFA_FFField::DrawHighlight(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus, bool bEllipse) { @@ -95,7 +95,7 @@ void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, CXFA_FFDoc* pDoc = GetDoc(); CXFA_Color crHighlight(pDoc->GetDocEnvironment()->GetHighlightColor(pDoc)); pGS->SetFillColor(&crHighlight); - CFX_Path path; + CXFA_Path path; if (bEllipse) path.AddEllipse(m_rtUI); else @@ -104,7 +104,7 @@ void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, pGS->FillPath(&path, FXFILL_WINDING, pMatrix); } -void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { +void CXFA_FFField::DrawFocus(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) { if (!(m_dwStatus & XFA_WidgetStatus_Focused)) return; @@ -115,7 +115,7 @@ void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { pGS->SetLineDash(0.0f, DashPattern, 2); pGS->SetLineWidth(0, false); - CFX_Path path; + CXFA_Path path; path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); pGS->StrokePath(&path, pMatrix); } @@ -605,7 +605,7 @@ void CXFA_FFField::LayoutCaption() { m_rtCaption.height = fHeight; } -void CXFA_FFField::RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { +void CXFA_FFField::RenderCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) { CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); if (!pCapTextLayout) return; @@ -781,5 +781,5 @@ void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { } } -void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFField::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) {} diff --git a/xfa/fxfa/app/cxfa_fffield.h b/xfa/fxfa/app/cxfa_fffield.h index 3799eb39b7..d2eba09a62 100644 --- a/xfa/fxfa/app/cxfa_fffield.h +++ b/xfa/fxfa/app/cxfa_fffield.h @@ -24,7 +24,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { // CXFA_FFWidget CFX_RectF GetBBox(uint32_t dwStatus, bool bDrawFocus = false) override; - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; bool IsLoaded() override; @@ -55,7 +55,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { // IFWL_WidgetDelegate void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; void UpdateFWL(); @@ -69,18 +69,18 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { CFWL_Widget* GetNormalWidget() { return m_pNormalWidget.get(); } CFX_PointF FWLToClient(const CFX_PointF& point); void LayoutCaption(); - void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix); + void RenderCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix); int32_t CalculateOverride(); int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); bool ProcessCommittedData(); virtual bool CommitData(); virtual bool IsDataChanged(); - void DrawHighlight(CFX_Graphics* pGS, + void DrawHighlight(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus, bool bEllipse); - void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); + void DrawFocus(CXFA_Graphics* pGS, CFX_Matrix* pMatrix); void TranslateFWLMessage(CFWL_Message* pMessage); void CapPlacement(); void CapTopBottomPlacement(CXFA_Caption caption, diff --git a/xfa/fxfa/app/cxfa_ffimage.cpp b/xfa/fxfa/app/cxfa_ffimage.cpp index f8a6668a91..cfcc9d6d7d 100644 --- a/xfa/fxfa/app/cxfa_ffimage.cpp +++ b/xfa/fxfa/app/cxfa_ffimage.cpp @@ -34,7 +34,7 @@ void CXFA_FFImage::UnloadWidget() { GetDataAcc()->SetImageImage(nullptr); } -void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_ffimage.h b/xfa/fxfa/app/cxfa_ffimage.h index 1b22fce668..aaa5df4048 100644 --- a/xfa/fxfa/app/cxfa_ffimage.h +++ b/xfa/fxfa/app/cxfa_ffimage.h @@ -15,7 +15,7 @@ class CXFA_FFImage : public CXFA_FFDraw { ~CXFA_FFImage() override; // CXFA_FFWidget - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; bool IsLoaded() override; diff --git a/xfa/fxfa/app/cxfa_ffimageedit.cpp b/xfa/fxfa/app/cxfa_ffimageedit.cpp index 0b0b6ec853..4019dd11d8 100644 --- a/xfa/fxfa/app/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/app/cxfa_ffimageedit.cpp @@ -51,7 +51,7 @@ void CXFA_FFImageEdit::UnloadWidget() { CXFA_FFField::UnloadWidget(); } -void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) @@ -137,7 +137,7 @@ void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) { m_pOldDelegate->OnProcessEvent(pEvent); } -void CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFImageEdit::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fxfa/app/cxfa_ffimageedit.h b/xfa/fxfa/app/cxfa_ffimageedit.h index 81b45e8de0..c81af5eb08 100644 --- a/xfa/fxfa/app/cxfa_ffimageedit.h +++ b/xfa/fxfa/app/cxfa_ffimageedit.h @@ -15,7 +15,7 @@ class CXFA_FFImageEdit : public CXFA_FFField { ~CXFA_FFImageEdit() override; // CXFA_FFField - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; bool LoadWidget() override; @@ -23,7 +23,7 @@ class CXFA_FFImageEdit : public CXFA_FFField { bool OnLButtonDown(uint32_t dwFlags, const CFX_PointF& point) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; private: diff --git a/xfa/fxfa/app/cxfa_ffline.cpp b/xfa/fxfa/app/cxfa_ffline.cpp index dafa660a73..6c028dd340 100644 --- a/xfa/fxfa/app/cxfa_ffline.cpp +++ b/xfa/fxfa/app/cxfa_ffline.cpp @@ -6,9 +6,9 @@ #include "xfa/fxfa/app/cxfa_ffline.h" -#include "xfa/fxgraphics/cfx_graphics.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_graphics.h" +#include "xfa/fxgraphics/cxfa_path.h" CXFA_FFLine::CXFA_FFLine(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} @@ -47,7 +47,7 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, } } -void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFLine::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) @@ -82,7 +82,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, XFA_RectWidthoutMargin(rtLine, mgWidget); GetRectFromHand(rtLine, lineObj.GetHand(), fLineWidth); - CFX_Path linePath; + CXFA_Path linePath; if (lineObj.GetSlope() && rtLine.right() > 0.0f && rtLine.bottom() > 0.0f) linePath.AddLine(rtLine.TopRight(), rtLine.BottomLeft()); else diff --git a/xfa/fxfa/app/cxfa_ffline.h b/xfa/fxfa/app/cxfa_ffline.h index 6803e38285..7649f5a827 100644 --- a/xfa/fxfa/app/cxfa_ffline.h +++ b/xfa/fxfa/app/cxfa_ffline.h @@ -15,7 +15,7 @@ class CXFA_FFLine : public CXFA_FFDraw { ~CXFA_FFLine() override; // CXFA_FFWidget - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; diff --git a/xfa/fxfa/app/cxfa_fflistbox.cpp b/xfa/fxfa/app/cxfa_fflistbox.cpp index dd80325c34..cc9100b5db 100644 --- a/xfa/fxfa/app/cxfa_fflistbox.cpp +++ b/xfa/fxfa/app/cxfa_fflistbox.cpp @@ -204,7 +204,7 @@ void CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) { m_pOldDelegate->OnProcessEvent(pEvent); } -void CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFListBox::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fxfa/app/cxfa_fflistbox.h b/xfa/fxfa/app/cxfa_fflistbox.h index 6f090af63f..ac563cc86c 100644 --- a/xfa/fxfa/app/cxfa_fflistbox.h +++ b/xfa/fxfa/app/cxfa_fflistbox.h @@ -19,7 +19,7 @@ class CXFA_FFListBox : public CXFA_FFField { bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; void OnSelectChanged(CFWL_Widget* pWidget); diff --git a/xfa/fxfa/app/cxfa_ffpushbutton.cpp b/xfa/fxfa/app/cxfa_ffpushbutton.cpp index 21e4b977a1..44ec0d42d0 100644 --- a/xfa/fxfa/app/cxfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/cxfa_ffpushbutton.cpp @@ -18,8 +18,8 @@ #include "xfa/fxfa/cxfa_ffapp.h" #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" -#include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" CXFA_FFPushButton::CXFA_FFPushButton(CXFA_WidgetAcc* pDataAcc) : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {} @@ -28,7 +28,7 @@ CXFA_FFPushButton::~CXFA_FFPushButton() { CXFA_FFPushButton::UnloadWidget(); } -void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFPushButton::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) @@ -166,7 +166,7 @@ void CXFA_FFPushButton::LayoutHighlightCaption() { m_pDownTextLayout->Layout(sz); } -void CXFA_FFPushButton::RenderHighlightCaption(CFX_Graphics* pGS, +void CXFA_FFPushButton::RenderHighlightCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) { CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); CXFA_Caption caption = m_pDataAcc->GetCaption(); @@ -205,7 +205,7 @@ void CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) { CXFA_FFField::OnProcessEvent(pEvent); } -void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFPushButton::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) { if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && @@ -216,7 +216,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, CXFA_Color cr(FXARGB_MAKE(128, 128, 255, 255)); pGraphics->SetFillColor(&cr); - CFX_Path path; + CXFA_Path path; path.AddRectangle(rtFill.left, rtFill.top, rtFill.width, rtFill.height); pGraphics->FillPath(&path, FXFILL_WINDING, (CFX_Matrix*)pMatrix); } @@ -231,7 +231,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, pGraphics->SetStrokeColor(&cr); pGraphics->SetLineWidth(fLineWidth); - CFX_Path path; + CXFA_Path path; CFX_RectF rect = m_pNormalWidget->GetWidgetRect(); path.AddRectangle(0, 0, rect.width, rect.height); pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); diff --git a/xfa/fxfa/app/cxfa_ffpushbutton.h b/xfa/fxfa/app/cxfa_ffpushbutton.h index 797d92d970..e64ef706f3 100644 --- a/xfa/fxfa/app/cxfa_ffpushbutton.h +++ b/xfa/fxfa/app/cxfa_ffpushbutton.h @@ -24,7 +24,7 @@ class CXFA_FFPushButton : public CXFA_FFField { ~CXFA_FFPushButton() override; // CXFA_FFField - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; bool LoadWidget() override; @@ -33,13 +33,13 @@ class CXFA_FFPushButton : public CXFA_FFField { void UpdateWidgetProperty() override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; private: void LoadHighlightCaption(); void LayoutHighlightCaption(); - void RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix); + void RenderHighlightCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix); float GetLineWidth(); FX_ARGB GetLineColor(); FX_ARGB GetFillColor(); diff --git a/xfa/fxfa/app/cxfa_ffrectangle.cpp b/xfa/fxfa/app/cxfa_ffrectangle.cpp index bccf7404f2..89ae129cb1 100644 --- a/xfa/fxfa/app/cxfa_ffrectangle.cpp +++ b/xfa/fxfa/app/cxfa_ffrectangle.cpp @@ -11,7 +11,7 @@ CXFA_FFRectangle::CXFA_FFRectangle(CXFA_WidgetAcc* pDataAcc) CXFA_FFRectangle::~CXFA_FFRectangle() {} -void CXFA_FFRectangle::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_ffrectangle.h b/xfa/fxfa/app/cxfa_ffrectangle.h index 499f60007e..2ddb35dade 100644 --- a/xfa/fxfa/app/cxfa_ffrectangle.h +++ b/xfa/fxfa/app/cxfa_ffrectangle.h @@ -15,7 +15,7 @@ class CXFA_FFRectangle : public CXFA_FFDraw { ~CXFA_FFRectangle() override; // CXFA_FFWidget - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; }; diff --git a/xfa/fxfa/app/cxfa_ffsignature.cpp b/xfa/fxfa/app/cxfa_ffsignature.cpp index a5d33ad51c..0afe5cc86a 100644 --- a/xfa/fxfa/app/cxfa_ffsignature.cpp +++ b/xfa/fxfa/app/cxfa_ffsignature.cpp @@ -20,7 +20,7 @@ bool CXFA_FFSignature::LoadWidget() { return CXFA_FFField::LoadWidget(); } -void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFSignature::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_ffsignature.h b/xfa/fxfa/app/cxfa_ffsignature.h index 839cfaf5fc..8d2a33e21a 100644 --- a/xfa/fxfa/app/cxfa_ffsignature.h +++ b/xfa/fxfa/app/cxfa_ffsignature.h @@ -15,7 +15,7 @@ class CXFA_FFSignature final : public CXFA_FFField { ~CXFA_FFSignature() override; // CXFA_FFField - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; bool LoadWidget() override; diff --git a/xfa/fxfa/app/cxfa_fftext.cpp b/xfa/fxfa/app/cxfa_fftext.cpp index b5224eaaed..3d90e6cd4e 100644 --- a/xfa/fxfa/app/cxfa_fftext.cpp +++ b/xfa/fxfa/app/cxfa_fftext.cpp @@ -17,13 +17,13 @@ #include "xfa/fxfa/cxfa_ffdoc.h" #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" CXFA_FFText::CXFA_FFText(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} CXFA_FFText::~CXFA_FFText() {} -void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFText::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) diff --git a/xfa/fxfa/app/cxfa_fftext.h b/xfa/fxfa/app/cxfa_fftext.h index 3fd48da2a9..df920f0266 100644 --- a/xfa/fxfa/app/cxfa_fftext.h +++ b/xfa/fxfa/app/cxfa_fftext.h @@ -19,7 +19,7 @@ class CXFA_FFText : public CXFA_FFDraw { bool OnLButtonUp(uint32_t dwFlags, const CFX_PointF& point) override; bool OnMouseMove(uint32_t dwFlags, const CFX_PointF& point) override; FWL_WidgetHit OnHitTest(const CFX_PointF& point) override; - void RenderWidget(CFX_Graphics* pGS, + void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; bool IsLoaded() override; diff --git a/xfa/fxfa/app/cxfa_fftextedit.cpp b/xfa/fxfa/app/cxfa_fftextedit.cpp index 7248abf908..0d211eb7b4 100644 --- a/xfa/fxfa/app/cxfa_fftextedit.cpp +++ b/xfa/fxfa/app/cxfa_fftextedit.cpp @@ -353,7 +353,7 @@ void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) { m_pOldDelegate->OnProcessEvent(pEvent); } -void CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics, +void CXFA_FFTextEdit::OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) { m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); } diff --git a/xfa/fxfa/app/cxfa_fftextedit.h b/xfa/fxfa/app/cxfa_fftextedit.h index fa0779ed2c..109a31a0de 100644 --- a/xfa/fxfa/app/cxfa_fftextedit.h +++ b/xfa/fxfa/app/cxfa_fftextedit.h @@ -33,7 +33,7 @@ class CXFA_FFTextEdit : public CXFA_FFField { bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; - void OnDrawWidget(CFX_Graphics* pGraphics, + void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; void OnTextChanged(CFWL_Widget* pWidget, diff --git a/xfa/fxfa/app/cxfa_fwltheme.cpp b/xfa/fxfa/app/cxfa_fwltheme.cpp index fbcbd75b6e..5ad0873e19 100644 --- a/xfa/fxfa/app/cxfa_fwltheme.cpp +++ b/xfa/fxfa/app/cxfa_fwltheme.cpp @@ -105,7 +105,7 @@ void CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) { if (pParams->m_iPart == CFWL_Part::Caption) m_pTextOut->SetTextColor(ArgbEncode(0xff, 0, 153, 255)); - CFX_Graphics* pGraphics = pParams->m_pGraphics; + CXFA_Graphics* pGraphics = pParams->m_pGraphics; CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice(); if (!pRenderDevice) return; @@ -126,7 +126,7 @@ void CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) { return; CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc(); - CFX_Graphics* pGraphics = pParams->m_pGraphics; + CXFA_Graphics* pGraphics = pParams->m_pGraphics; CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice(); if (!pRenderDevice) return; diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 8a9841db2d..2573ff4f6b 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -30,11 +30,11 @@ #include "xfa/fxfa/cxfa_widgetacc.h" #include "xfa/fxfa/parser/cxfa_corner.h" #include "xfa/fxfa/parser/cxfa_node.h" -#include "xfa/fxgraphics/cfx_graphics.h" -#include "xfa/fxgraphics/cfx_path.h" -#include "xfa/fxgraphics/cfx_pattern.h" -#include "xfa/fxgraphics/cfx_shading.h" #include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_graphics.h" +#include "xfa/fxgraphics/cxfa_path.h" +#include "xfa/fxgraphics/cxfa_pattern.h" +#include "xfa/fxgraphics/cxfa_shading.h" CXFA_FFWidget::CXFA_FFWidget(CXFA_WidgetAcc* pDataAcc) : CXFA_ContentLayoutItem(pDataAcc->GetNode()), @@ -110,7 +110,7 @@ bool CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) { return GetCaptionText(wsToolTip); } -void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, +void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) @@ -145,7 +145,7 @@ bool CXFA_FFWidget::UpdateFWLData() { return false; } void CXFA_FFWidget::UpdateWidgetProperty() {} -void CXFA_FFWidget::DrawBorder(CFX_Graphics* pGS, +void CXFA_FFWidget::DrawBorder(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, CFX_Matrix* pMatrix, @@ -494,7 +494,7 @@ void CXFA_FFWidget::SetButtonDown(bool bSet) { bSet ? m_dwStatus |= XFA_WidgetStatus_ButtonDown : m_dwStatus &= ~XFA_WidgetStatus_ButtonDown; } -int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, +int32_t XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics, int32_t iStrokeType, int32_t iCapType) { switch (iStrokeType) { @@ -824,7 +824,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( continue; } -void XFA_DrawImage(CFX_Graphics* pGS, +void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, CFX_Matrix* pMatrix, const CFX_RetainPtr& pDIBitmap, @@ -1177,7 +1177,7 @@ bool XFA_IsCreateWidget(XFA_Element eType) { } static void XFA_BOX_GetPath_Arc(CXFA_Box box, CFX_RectF rtDraw, - CFX_Path& fillPath, + CXFA_Path& fillPath, uint32_t dwFlags) { float a, b; a = rtDraw.width / 2.0f; @@ -1205,7 +1205,7 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box, static void XFA_BOX_GetPath(CXFA_Box box, const std::vector& strokes, CFX_RectF rtWidget, - CFX_Path& path, + CXFA_Path& path, int32_t nIndex, bool bStart, bool bCorner) { @@ -1374,7 +1374,7 @@ static void XFA_BOX_GetPath(CXFA_Box box, static void XFA_BOX_GetFillPath(CXFA_Box box, const std::vector& strokes, CFX_RectF rtWidget, - CFX_Path& fillPath, + CXFA_Path& fillPath, uint16_t dwFlags) { if (box.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) { CXFA_Edge edge = box.GetEdge(0); @@ -1523,8 +1523,8 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, } } static void XFA_BOX_Fill_Radial(CXFA_Box box, - CFX_Graphics* pGS, - CFX_Path& fillPath, + CXFA_Graphics* pGS, + CXFA_Path& fillPath, CFX_RectF rtFill, CFX_Matrix* pMatrix) { CXFA_Fill fill = box.GetFill(); @@ -1536,18 +1536,18 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box, crEnd = crStart; crStart = temp; } - CFX_Shading shading(rtFill.Center(), rtFill.Center(), 0, - sqrt(rtFill.Width() * rtFill.Width() + - rtFill.Height() * rtFill.Height()) / - 2, - true, true, crStart, crEnd); + CXFA_Shading shading(rtFill.Center(), rtFill.Center(), 0, + sqrt(rtFill.Width() * rtFill.Width() + + rtFill.Height() * rtFill.Height()) / + 2, + true, true, crStart, crEnd); CXFA_Color cr(&shading); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } static void XFA_BOX_Fill_Pattern(CXFA_Box box, - CFX_Graphics* pGS, - CFX_Path& fillPath, + CXFA_Graphics* pGS, + CXFA_Path& fillPath, CFX_RectF rtFill, CFX_Matrix* pMatrix) { CXFA_Fill fill = box.GetFill(); @@ -1575,14 +1575,14 @@ static void XFA_BOX_Fill_Pattern(CXFA_Box box, break; } - CFX_Pattern pattern(iHatch, crEnd, crStart); + CXFA_Pattern pattern(iHatch, crEnd, crStart); CXFA_Color cr(&pattern, 0x0); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } static void XFA_BOX_Fill_Linear(CXFA_Box box, - CFX_Graphics* pGS, - CFX_Path& fillPath, + CXFA_Graphics* pGS, + CXFA_Path& fillPath, CFX_RectF rtFill, CFX_Matrix* pMatrix) { CXFA_Fill fill = box.GetFill(); @@ -1611,14 +1611,14 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box, default: break; } - CFX_Shading shading(ptStart, ptEnd, false, false, crStart, crEnd); + CXFA_Shading shading(ptStart, ptEnd, false, false, crStart, crEnd); CXFA_Color cr(&shading); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } static void XFA_BOX_Fill(CXFA_Box box, const std::vector& strokes, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, const CFX_RectF& rtWidget, CFX_Matrix* pMatrix, uint32_t dwFlags) { @@ -1627,7 +1627,7 @@ static void XFA_BOX_Fill(CXFA_Box box, return; pGS->SaveGraphState(); - CFX_Path fillPath; + CXFA_Path fillPath; XFA_BOX_GetFillPath(box, strokes, rtWidget, fillPath, (dwFlags & XFA_DRAWBOX_ForceRound) != 0); fillPath.Close(); @@ -1663,8 +1663,8 @@ static void XFA_BOX_Fill(CXFA_Box box, pGS->RestoreGraphState(); } static void XFA_BOX_StrokePath(CXFA_Stroke stroke, - CFX_Path* pPath, - CFX_Graphics* pGS, + CXFA_Path* pPath, + CXFA_Graphics* pGS, CFX_Matrix* pMatrix) { if (!stroke || !stroke.IsVisible()) { return; @@ -1687,7 +1687,7 @@ static void XFA_BOX_StrokePath(CXFA_Stroke stroke, pGS->RestoreGraphState(); } static void XFA_BOX_StrokeArc(CXFA_Box box, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, CFX_RectF rtWidget, CFX_Matrix* pMatrix, uint32_t dwFlags) { @@ -1718,7 +1718,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, if (fHalf < 0.001f) return; - CFX_Path arcPath; + CXFA_Path arcPath; XFA_BOX_GetPath_Arc(box, rtWidget, arcPath, dwFlags); XFA_BOX_StrokePath(edge, &arcPath, pGS, pMatrix); return; @@ -1744,7 +1744,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, startAngle = startAngle * FX_PI / 180.0f; sweepAngle = -sweepAngle * FX_PI / 180.0f; - CFX_Path arcPath; + CXFA_Path arcPath; arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f, FX_PI); @@ -1775,7 +1775,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, pGS->StrokePath(&arcPath, pMatrix); pGS->RestoreGraphState(); } -static void XFA_Draw3DRect(CFX_Graphics* pGraphic, +static void XFA_Draw3DRect(CXFA_Graphics* pGraphic, const CFX_RectF& rt, float fLineWidth, CFX_Matrix* pMatrix, @@ -1785,7 +1785,7 @@ static void XFA_Draw3DRect(CFX_Graphics* pGraphic, pGraphic->SetFillColor(&crLT); float fBottom = rt.bottom(); float fRight = rt.right(); - CFX_Path pathLT; + CXFA_Path pathLT; pathLT.MoveTo(CFX_PointF(rt.left, fBottom)); pathLT.LineTo(CFX_PointF(rt.left, rt.top)); pathLT.LineTo(CFX_PointF(fRight, rt.top)); @@ -1798,7 +1798,7 @@ static void XFA_Draw3DRect(CFX_Graphics* pGraphic, CXFA_Color crRB(argbBottomRight); pGraphic->SetFillColor(&crRB); - CFX_Path pathRB; + CXFA_Path pathRB; pathRB.MoveTo(CFX_PointF(fRight, rt.top)); pathRB.LineTo(CFX_PointF(fRight, fBottom)); pathRB.LineTo(CFX_PointF(rt.left, fBottom)); @@ -1808,7 +1808,7 @@ static void XFA_Draw3DRect(CFX_Graphics* pGraphic, pathRB.LineTo(CFX_PointF(fRight, rt.top)); pGraphic->FillPath(&pathRB, FXFILL_WINDING, pMatrix); } -static void XFA_BOX_Stroke_3DRect_Lowered(CFX_Graphics* pGS, +static void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, CFX_Matrix* pMatrix) { @@ -1817,13 +1817,13 @@ static void XFA_BOX_Stroke_3DRect_Lowered(CFX_Graphics* pGS, rtInner.Deflate(fHalfWidth, fHalfWidth); CXFA_Color cr(0xFF000000); pGS->SetFillColor(&cr); - CFX_Path path; + CXFA_Path path; path.AddRectangle(rt.left, rt.top, rt.width, rt.height); path.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height); pGS->FillPath(&path, FXFILL_ALTERNATE, pMatrix); XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFF808080, 0xFFC0C0C0); } -static void XFA_BOX_Stroke_3DRect_Raised(CFX_Graphics* pGS, +static void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, CFX_Matrix* pMatrix) { @@ -1832,13 +1832,13 @@ static void XFA_BOX_Stroke_3DRect_Raised(CFX_Graphics* pGS, rtInner.Deflate(fHalfWidth, fHalfWidth); CXFA_Color cr(0xFF000000); pGS->SetFillColor(&cr); - CFX_Path path; + CXFA_Path path; path.AddRectangle(rt.left, rt.top, rt.width, rt.height); path.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height); pGS->FillPath(&path, FXFILL_ALTERNATE, pMatrix); XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFFFFFFFF, 0xFF808080); } -static void XFA_BOX_Stroke_3DRect_Etched(CFX_Graphics* pGS, +static void XFA_BOX_Stroke_3DRect_Etched(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, CFX_Matrix* pMatrix) { @@ -1848,7 +1848,7 @@ static void XFA_BOX_Stroke_3DRect_Etched(CFX_Graphics* pGS, rtInner.Deflate(fHalfWidth, fHalfWidth); XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFFFFFFFF, 0xFF808080); } -static void XFA_BOX_Stroke_3DRect_Embossed(CFX_Graphics* pGS, +static void XFA_BOX_Stroke_3DRect_Embossed(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, CFX_Matrix* pMatrix) { @@ -1860,7 +1860,7 @@ static void XFA_BOX_Stroke_3DRect_Embossed(CFX_Graphics* pGS, } static void XFA_BOX_Stroke_Rect(CXFA_Box box, const std::vector& strokes, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, CFX_RectF rtWidget, CFX_Matrix* pMatrix) { bool bVisible = false; @@ -1918,7 +1918,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, } } bool bStart = true; - CFX_Path path; + CXFA_Path path; for (int32_t i = 0; i < 8; i++) { CXFA_Stroke stroke = strokes[i]; if ((i % 1) == 0 && stroke.GetRadius() < 0) { @@ -1948,7 +1948,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, } static void XFA_BOX_Stroke(CXFA_Box box, const std::vector& strokes, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, CFX_RectF rtWidget, CFX_Matrix* pMatrix, uint32_t dwFlags) { @@ -2012,7 +2012,7 @@ static void XFA_BOX_Stroke(CXFA_Box box, XFA_BOX_Stroke_Rect(box, strokes, pGS, rtWidget, pMatrix); } void XFA_DrawBox(CXFA_Box box, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, const CFX_RectF& rtWidget, CFX_Matrix* pMatrix, uint32_t dwFlags) { diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index 29161403c2..0e7c35e361 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -35,11 +35,11 @@ enum XFA_WIDGETITEM { XFA_WIDGETITEM_PrevSibling, }; -int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, +int32_t XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics, int32_t iStrokeType, int32_t iCapType); CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap); -void XFA_DrawImage(CFX_Graphics* pGS, +void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, CFX_Matrix* pMatrix, const CFX_RetainPtr& pDIBitmap, @@ -71,7 +71,7 @@ bool XFA_IsCreateWidget(XFA_Element iType); #define XFA_DRAWBOX_ForceRound 1 #define XFA_DRAWBOX_Lowered3D 2 void XFA_DrawBox(CXFA_Box box, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, const CFX_RectF& rtWidget, CFX_Matrix* pMatrix, uint32_t dwFlags = 0); @@ -91,7 +91,7 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { ~CXFA_FFWidget() override; virtual CFX_RectF GetBBox(uint32_t dwStatus, bool bDrawFocus = false); - virtual void RenderWidget(CFX_Graphics* pGS, + virtual void RenderWidget(CXFA_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus); virtual bool IsLoaded(); @@ -171,7 +171,7 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { protected: virtual bool PtInActiveRect(const CFX_PointF& point); - void DrawBorder(CFX_Graphics* pGS, + void DrawBorder(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, CFX_Matrix* pMatrix, diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index 680a00a975..b703f746e8 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -155,7 +155,7 @@ bool CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget, } void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, CFX_Matrix* pMatrix, bool bHighlight) { hWidget->RenderWidget(pGS, pMatrix, diff --git a/xfa/fxfa/cxfa_ffwidgethandler.h b/xfa/fxfa/cxfa_ffwidgethandler.h index 8f44dbbd45..36d91a709c 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.h +++ b/xfa/fxfa/cxfa_ffwidgethandler.h @@ -59,7 +59,7 @@ class CXFA_FFWidgetHandler { FWL_WidgetHit OnHitTest(CXFA_FFWidget* hWidget, const CFX_PointF& point); bool OnSetCursor(CXFA_FFWidget* hWidget, const CFX_PointF& point); void RenderWidget(CXFA_FFWidget* hWidget, - CFX_Graphics* pGS, + CXFA_Graphics* pGS, CFX_Matrix* pMatrix, bool bHighlight); bool HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); diff --git a/xfa/fxfa/cxfa_rendercontext.cpp b/xfa/fxfa/cxfa_rendercontext.cpp index d709502ec8..bac13f3676 100644 --- a/xfa/fxfa/cxfa_rendercontext.cpp +++ b/xfa/fxfa/cxfa_rendercontext.cpp @@ -8,7 +8,7 @@ #include "xfa/fxfa/cxfa_ffpageview.h" #include "xfa/fxfa/cxfa_ffwidget.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" CXFA_RenderContext::CXFA_RenderContext(CXFA_FFPageView* pPageView, const CFX_RectF& clipRect, @@ -24,7 +24,7 @@ CXFA_RenderContext::CXFA_RenderContext(CXFA_FFPageView* pPageView, CXFA_RenderContext::~CXFA_RenderContext() {} -void CXFA_RenderContext::DoRender(CFX_Graphics* gs) { +void CXFA_RenderContext::DoRender(CXFA_Graphics* gs) { while (m_pWidget) { CFX_RectF rtWidgetBox = m_pWidget->GetBBox(XFA_WidgetStatus_Visible); rtWidgetBox.width += 1; diff --git a/xfa/fxfa/cxfa_rendercontext.h b/xfa/fxfa/cxfa_rendercontext.h index 0fd1dc9e1f..8f9ef3d0aa 100644 --- a/xfa/fxfa/cxfa_rendercontext.h +++ b/xfa/fxfa/cxfa_rendercontext.h @@ -18,7 +18,7 @@ class CXFA_RenderContext { const CFX_Matrix& matrix); ~CXFA_RenderContext(); - void DoRender(CFX_Graphics* gs); + void DoRender(CXFA_Graphics* gs); private: std::unique_ptr m_pWidgetIterator; diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h index 6dd901eaf4..3e78ed2f95 100644 --- a/xfa/fxfa/fxfa.h +++ b/xfa/fxfa/fxfa.h @@ -14,7 +14,7 @@ #include "xfa/fxfa/fxfa_basic.h" class CFGAS_GEFont; -class CFX_Graphics; +class CXFA_Graphics; class CPDF_Document; class CXFA_FFPageView; class CXFA_Node; diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp deleted file mode 100644 index 0865221aa9..0000000000 --- a/xfa/fxgraphics/cfx_graphics.cpp +++ /dev/null @@ -1,535 +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 - -#include "xfa/fxgraphics/cfx_graphics.h" - -#include - -#include "core/fxge/cfx_defaultrenderdevice.h" -#include "core/fxge/cfx_renderdevice.h" -#include "core/fxge/cfx_unicodeencoding.h" -#include "third_party/base/ptr_util.h" -#include "xfa/fxgraphics/cfx_path.h" -#include "xfa/fxgraphics/cfx_pattern.h" -#include "xfa/fxgraphics/cfx_shading.h" -#include "xfa/fxgraphics/cxfa_color.h" - -namespace { - -enum { - FX_CONTEXT_None = 0, - FX_CONTEXT_Device, -}; - -#define FX_HATCHSTYLE_Total 53 - -struct FX_HATCHDATA { - int32_t width; - int32_t height; - uint8_t maskBits[64]; -}; - -const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = { - {16, // Horizontal - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }}, - {16, // Vertical - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, - 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, - 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, - 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, - 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - }}, - {16, // ForwardDiagonal - 16, - { - 0x80, 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, - 0x00, 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, - 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x80, - 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, - 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, - 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, - }}, - {16, // BackwardDiagonal - 16, - { - 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, - 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, - 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, - 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, - 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - }}, - {16, // Cross - 16, - { - 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, - 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, - 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0xff, - 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, - 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, - }}, - {16, // DiagonalCross - 16, - { - 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, - 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, - 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x81, - 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, - 0x00, 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, - }}, -}; - -} // namespace - -CFX_Graphics::CFX_Graphics(CFX_RenderDevice* renderDevice) - : m_type(FX_CONTEXT_None), m_renderDevice(renderDevice) { - if (!renderDevice) - return; - m_type = FX_CONTEXT_Device; -} - -CFX_Graphics::~CFX_Graphics() {} - -void CFX_Graphics::SaveGraphState() { - if (m_type != FX_CONTEXT_Device || !m_renderDevice) - return; - - m_renderDevice->SaveState(); - m_infoStack.push_back(pdfium::MakeUnique(m_info)); -} - -void CFX_Graphics::RestoreGraphState() { - if (m_type != FX_CONTEXT_Device || !m_renderDevice) - return; - - m_renderDevice->RestoreState(false); - if (m_infoStack.empty() || !m_infoStack.back()) - return; - - m_info = *m_infoStack.back(); - m_infoStack.pop_back(); - return; -} - -void CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.graphState.m_LineCap = lineCap; - } -} - -void CFX_Graphics::SetLineDash(float dashPhase, - float* dashArray, - int32_t dashCount) { - if (dashCount > 0 && !dashArray) - return; - - dashCount = dashCount < 0 ? 0 : dashCount; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - float scale = 1.0; - if (m_info.isActOnDash) { - scale = m_info.graphState.m_LineWidth; - } - m_info.graphState.m_DashPhase = dashPhase; - m_info.graphState.SetDashCount(dashCount); - for (int32_t i = 0; i < dashCount; i++) { - m_info.graphState.m_DashArray[i] = dashArray[i] * scale; - } - } -} - -void CFX_Graphics::SetLineDash(FX_DashStyle dashStyle) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) - RenderDeviceSetLineDash(dashStyle); -} - -void CFX_Graphics::SetLineWidth(float lineWidth, bool isActOnDash) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.graphState.m_LineWidth = lineWidth; - m_info.isActOnDash = isActOnDash; - } -} - -void CFX_Graphics::SetStrokeColor(CXFA_Color* color) { - if (!color) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.strokeColor = color; - } -} - -void CFX_Graphics::SetFillColor(CXFA_Color* color) { - if (!color) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.fillColor = color; - } -} - -void CFX_Graphics::StrokePath(CFX_Path* path, CFX_Matrix* matrix) { - if (!path) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) - RenderDeviceStrokePath(path, matrix); -} - -void CFX_Graphics::FillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { - if (!path) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) - RenderDeviceFillPath(path, fillMode, matrix); -} - -void CFX_Graphics::StretchImage(const CFX_RetainPtr& source, - const CFX_RectF& rect, - CFX_Matrix* matrix) { - if (!source) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) - RenderDeviceStretchImage(source, rect, matrix); -} - -void CFX_Graphics::ConcatMatrix(const CFX_Matrix* matrix) { - if (!matrix) - return; - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_info.CTM.Concat(*matrix); - } -} - -CFX_Matrix* CFX_Graphics::GetMatrix() { - if (m_type == FX_CONTEXT_Device && m_renderDevice) - return &m_info.CTM; - return nullptr; -} - -CFX_RectF CFX_Graphics::GetClipRect() const { - if (m_type != FX_CONTEXT_Device || !m_renderDevice) - return CFX_RectF(); - - FX_RECT r = m_renderDevice->GetClipBox(); - return CFX_Rect(r.left, r.top, r.Width(), r.Height()).As(); -} - -void CFX_Graphics::SetClipRect(const CFX_RectF& rect) { - if (m_type == FX_CONTEXT_Device && m_renderDevice) { - m_renderDevice->SetClip_Rect( - FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top), - FXSYS_round(rect.right()), FXSYS_round(rect.bottom()))); - } -} - -CFX_RenderDevice* CFX_Graphics::GetRenderDevice() { - return m_renderDevice; -} - -void CFX_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) { - switch (dashStyle) { - case FX_DASHSTYLE_Solid: { - m_info.graphState.SetDashCount(0); - return; - } - case FX_DASHSTYLE_Dash: { - float dashArray[] = {3, 1}; - SetLineDash(0, dashArray, 2); - return; - } - case FX_DASHSTYLE_Dot: { - float dashArray[] = {1, 1}; - SetLineDash(0, dashArray, 2); - return; - } - case FX_DASHSTYLE_DashDot: { - float dashArray[] = {3, 1, 1, 1}; - SetLineDash(0, dashArray, 4); - return; - } - case FX_DASHSTYLE_DashDotDot: { - float dashArray[] = {4, 1, 2, 1, 2, 1}; - SetLineDash(0, dashArray, 6); - return; - } - default: - return; - } -} - -void CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix) { - if (!m_info.strokeColor) - return; - CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - if (matrix) { - m.Concat(*matrix); - } - switch (m_info.strokeColor->m_type) { - case FX_COLOR_Solid: { - m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, 0x0, - m_info.strokeColor->m_info.argb, 0); - return; - } - default: - return; - } -} - -void CFX_Graphics::RenderDeviceFillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { - if (!m_info.fillColor) - return; - CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - if (matrix) { - m.Concat(*matrix); - } - switch (m_info.fillColor->m_type) { - case FX_COLOR_Solid: { - m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, - m_info.fillColor->m_info.argb, 0x0, fillMode); - return; - } - case FX_COLOR_Pattern: - FillPathWithPattern(path, fillMode, &m); - return; - case FX_COLOR_Shading: - FillPathWithShading(path, fillMode, &m); - return; - default: - return; - } -} - -void CFX_Graphics::RenderDeviceStretchImage( - const CFX_RetainPtr& source, - const CFX_RectF& rect, - CFX_Matrix* matrix) { - CFX_Matrix m1(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, - m_info.CTM.e, m_info.CTM.f); - if (matrix) { - m1.Concat(*matrix); - } - CFX_RetainPtr bmp1 = - source->StretchTo(static_cast(rect.Width()), - static_cast(rect.Height()), 0, nullptr); - CFX_Matrix m2(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top); - m2.Concat(m1); - - int32_t left; - int32_t top; - CFX_RetainPtr bmp2 = bmp1->FlipImage(false, true); - CFX_RetainPtr bmp3 = bmp2->TransformTo(&m2, &left, &top); - CFX_RectF r = GetClipRect(); - CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); - bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), - FXSYS_round(r.Width()), FXSYS_round(r.Height()), bmp3, - FXSYS_round(r.left - left), FXSYS_round(r.top - top)); -} - -void CFX_Graphics::FillPathWithPattern(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { - CFX_Pattern* pattern = m_info.fillColor->m_info.pattern; - CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); - int32_t width = bitmap->GetWidth(); - int32_t height = bitmap->GetHeight(); - auto bmp = pdfium::MakeRetain(); - bmp->Create(width, height, FXDIB_Argb); - m_renderDevice->GetDIBits(bmp, 0, 0); - - FX_HatchStyle hatchStyle = m_info.fillColor->m_info.pattern->m_hatchStyle; - const FX_HATCHDATA& data = hatchBitmapData[static_cast(hatchStyle)]; - - auto mask = pdfium::MakeRetain(); - mask->Create(data.width, data.height, FXDIB_1bppMask); - memcpy(mask->GetBuffer(), data.maskBits, mask->GetPitch() * data.height); - CFX_FloatRect rectf = path->GetPathData()->GetBoundingBox(); - if (matrix) - matrix->TransformRect(rectf); - - FX_RECT rect(FXSYS_round(rectf.left), FXSYS_round(rectf.top), - FXSYS_round(rectf.right), FXSYS_round(rectf.bottom)); - CFX_DefaultRenderDevice device; - device.Attach(bmp, false, nullptr, false); - device.FillRect(&rect, m_info.fillColor->m_info.pattern->m_backArgb); - for (int32_t j = rect.bottom; j < rect.top; j += mask->GetHeight()) { - for (int32_t i = rect.left; i < rect.right; i += mask->GetWidth()) { - device.SetBitMask(mask, i, j, - m_info.fillColor->m_info.pattern->m_foreArgb); - } - } - CFX_RenderDevice::StateRestorer restorer(m_renderDevice); - m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode); - SetDIBitsWithMatrix(bmp, &pattern->m_matrix); -} - -void CFX_Graphics::FillPathWithShading(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix) { - CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); - int32_t width = bitmap->GetWidth(); - int32_t height = bitmap->GetHeight(); - float start_x = m_info.fillColor->m_shading->m_beginPoint.x; - float start_y = m_info.fillColor->m_shading->m_beginPoint.y; - float end_x = m_info.fillColor->m_shading->m_endPoint.x; - float end_y = m_info.fillColor->m_shading->m_endPoint.y; - auto bmp = pdfium::MakeRetain(); - bmp->Create(width, height, FXDIB_Argb); - m_renderDevice->GetDIBits(bmp, 0, 0); - int32_t pitch = bmp->GetPitch(); - bool result = false; - switch (m_info.fillColor->m_shading->m_type) { - case FX_SHADING_Axial: { - float x_span = end_x - start_x; - float y_span = end_y - start_y; - float axis_len_square = (x_span * x_span) + (y_span * y_span); - for (int32_t row = 0; row < height; row++) { - uint32_t* dib_buf = (uint32_t*)(bmp->GetBuffer() + row * pitch); - for (int32_t column = 0; column < width; column++) { - float x = (float)(column); - float y = (float)(row); - float scale = (((x - start_x) * x_span) + ((y - start_y) * y_span)) / - axis_len_square; - if (scale < 0) { - if (!m_info.fillColor->m_shading->m_isExtendedBegin) { - continue; - } - scale = 0; - } else if (scale > 1.0f) { - if (!m_info.fillColor->m_shading->m_isExtendedEnd) { - continue; - } - scale = 1.0f; - } - int32_t index = (int32_t)(scale * (FX_SHADING_Steps - 1)); - dib_buf[column] = m_info.fillColor->m_shading->m_argbArray[index]; - } - } - result = true; - break; - } - case FX_SHADING_Radial: { - float start_r = m_info.fillColor->m_shading->m_beginRadius; - float end_r = m_info.fillColor->m_shading->m_endRadius; - float a = ((start_x - end_x) * (start_x - end_x)) + - ((start_y - end_y) * (start_y - end_y)) - - ((start_r - end_r) * (start_r - end_r)); - for (int32_t row = 0; row < height; row++) { - uint32_t* dib_buf = (uint32_t*)(bmp->GetBuffer() + row * pitch); - for (int32_t column = 0; column < width; column++) { - float x = (float)(column); - float y = (float)(row); - float b = -2 * (((x - start_x) * (end_x - start_x)) + - ((y - start_y) * (end_y - start_y)) + - (start_r * (end_r - start_r))); - float c = ((x - start_x) * (x - start_x)) + - ((y - start_y) * (y - start_y)) - (start_r * start_r); - float s; - if (a == 0) { - s = -c / b; - } else { - float b2_4ac = (b * b) - 4 * (a * c); - if (b2_4ac < 0) { - continue; - } - float root = (sqrt(b2_4ac)); - float s1, s2; - if (a > 0) { - s1 = (-b - root) / (2 * a); - s2 = (-b + root) / (2 * a); - } else { - s2 = (-b - root) / (2 * a); - s1 = (-b + root) / (2 * a); - } - if (s2 <= 1.0f || m_info.fillColor->m_shading->m_isExtendedEnd) { - s = (s2); - } else { - s = (s1); - } - if ((start_r) + s * (end_r - start_r) < 0) { - continue; - } - } - if (s < 0) { - if (!m_info.fillColor->m_shading->m_isExtendedBegin) { - continue; - } - s = 0; - } - if (s > 1.0f) { - if (!m_info.fillColor->m_shading->m_isExtendedEnd) { - continue; - } - s = 1.0f; - } - int index = (int32_t)(s * (FX_SHADING_Steps - 1)); - dib_buf[column] = m_info.fillColor->m_shading->m_argbArray[index]; - } - } - result = true; - break; - } - default: { - result = false; - break; - } - } - if (result) { - CFX_RenderDevice::StateRestorer restorer(m_renderDevice); - m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode); - SetDIBitsWithMatrix(bmp, matrix); - } -} - -void CFX_Graphics::SetDIBitsWithMatrix( - const CFX_RetainPtr& source, - CFX_Matrix* matrix) { - if (matrix->IsIdentity()) { - m_renderDevice->SetDIBits(source, 0, 0); - } else { - CFX_Matrix m((float)source->GetWidth(), 0, 0, (float)source->GetHeight(), 0, - 0); - m.Concat(*matrix); - int32_t left; - int32_t top; - CFX_RetainPtr bmp1 = source->FlipImage(false, true); - CFX_RetainPtr bmp2 = bmp1->TransformTo(&m, &left, &top); - m_renderDevice->SetDIBits(bmp2, left, top); - } -} - -CFX_Graphics::TInfo::TInfo() - : isActOnDash(false), strokeColor(nullptr), fillColor(nullptr) {} - -CFX_Graphics::TInfo::TInfo(const TInfo& info) - : graphState(info.graphState), - CTM(info.CTM), - isActOnDash(info.isActOnDash), - strokeColor(info.strokeColor), - fillColor(info.fillColor) {} - -CFX_Graphics::TInfo& CFX_Graphics::TInfo::operator=(const TInfo& other) { - graphState.Copy(other.graphState); - CTM = other.CTM; - isActOnDash = other.isActOnDash; - strokeColor = other.strokeColor; - fillColor = other.fillColor; - return *this; -} diff --git a/xfa/fxgraphics/cfx_graphics.h b/xfa/fxgraphics/cfx_graphics.h deleted file mode 100644 index 0ce9bf4b32..0000000000 --- a/xfa/fxgraphics/cfx_graphics.h +++ /dev/null @@ -1,111 +0,0 @@ -// 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_FXGRAPHICS_CFX_GRAPHICS_H_ -#define XFA_FXGRAPHICS_CFX_GRAPHICS_H_ - -#include -#include - -#include "core/fxcrt/fx_system.h" -#include "core/fxge/cfx_defaultrenderdevice.h" -#include "core/fxge/cfx_graphstatedata.h" -#include "core/fxge/cfx_renderdevice.h" -#include "core/fxge/fx_dib.h" -#include "core/fxge/fx_font.h" - -class CXFA_Color; -class CFX_Path; - -using FX_FillMode = int32_t; - -enum FX_DashStyle { - FX_DASHSTYLE_Solid = 0, - FX_DASHSTYLE_Dash = 1, - FX_DASHSTYLE_Dot = 2, - FX_DASHSTYLE_DashDot = 3, - FX_DASHSTYLE_DashDotDot = 4 -}; - -enum class FX_HatchStyle { - Horizontal = 0, - Vertical = 1, - ForwardDiagonal = 2, - BackwardDiagonal = 3, - Cross = 4, - DiagonalCross = 5 -}; - -class CFX_RenderDevice; - -class CFX_Graphics { - public: - explicit CFX_Graphics(CFX_RenderDevice* renderDevice); - ~CFX_Graphics(); - - void SaveGraphState(); - void RestoreGraphState(); - - CFX_RectF GetClipRect() const; - CFX_Matrix* GetMatrix(); - CFX_RenderDevice* GetRenderDevice(); - - void SetLineCap(CFX_GraphStateData::LineCap lineCap); - void SetLineDash(float dashPhase, float* dashArray, int32_t dashCount); - void SetLineDash(FX_DashStyle dashStyle); - void SetLineWidth(float lineWidth, bool isActOnDash = false); - void SetStrokeColor(CXFA_Color* color); - void SetFillColor(CXFA_Color* color); - void SetClipRect(const CFX_RectF& rect); - void StrokePath(CFX_Path* path, CFX_Matrix* matrix = nullptr); - void FillPath(CFX_Path* path, - FX_FillMode fillMode = FXFILL_WINDING, - CFX_Matrix* matrix = nullptr); - void StretchImage(const CFX_RetainPtr& source, - const CFX_RectF& rect, - CFX_Matrix* matrix = nullptr); - void ConcatMatrix(const CFX_Matrix* matrix); - - protected: - int32_t m_type; - - private: - struct TInfo { - TInfo(); - explicit TInfo(const TInfo& info); - TInfo& operator=(const TInfo& other); - - CFX_GraphStateData graphState; - CFX_Matrix CTM; - bool isActOnDash; - CXFA_Color* strokeColor; - CXFA_Color* fillColor; - } m_info; - - void RenderDeviceSetLineDash(FX_DashStyle dashStyle); - void RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix); - void RenderDeviceFillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - void RenderDeviceStretchImage(const CFX_RetainPtr& source, - const CFX_RectF& rect, - CFX_Matrix* matrix); - - void FillPathWithPattern(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - void FillPathWithShading(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - - void SetDIBitsWithMatrix(const CFX_RetainPtr& source, - CFX_Matrix* matrix); - - CFX_RenderDevice* const m_renderDevice; // Not owned. - std::vector> m_infoStack; -}; - -#endif // XFA_FXGRAPHICS_CFX_GRAPHICS_H_ diff --git a/xfa/fxgraphics/cfx_path.cpp b/xfa/fxgraphics/cfx_path.cpp deleted file mode 100644 index fc0051ad4c..0000000000 --- a/xfa/fxgraphics/cfx_path.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// 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 - -#include "xfa/fxgraphics/cfx_path.h" - -#include "core/fxge/cfx_pathdata.h" -#include "third_party/base/ptr_util.h" - -CFX_Path::CFX_Path() {} - -CFX_Path::~CFX_Path() {} - -void CFX_Path::Clear() { - data_.Clear(); -} - -void CFX_Path::Close() { - data_.ClosePath(); -} - -void CFX_Path::MoveTo(const CFX_PointF& point) { - data_.AppendPoint(point, FXPT_TYPE::MoveTo, false); -} - -void CFX_Path::LineTo(const CFX_PointF& point) { - data_.AppendPoint(point, FXPT_TYPE::LineTo, false); -} - -void CFX_Path::BezierTo(const CFX_PointF& c1, - const CFX_PointF& c2, - const CFX_PointF& to) { - data_.AppendPoint(c1, FXPT_TYPE::BezierTo, false); - data_.AppendPoint(c2, FXPT_TYPE::BezierTo, false); - data_.AppendPoint(to, FXPT_TYPE::BezierTo, false); -} - -void CFX_Path::ArcTo(const CFX_PointF& pos, - const CFX_SizeF& size, - float start_angle, - float sweep_angle) { - CFX_SizeF new_size = size / 2.0f; - ArcToInternal(CFX_PointF(pos.x + new_size.width, pos.y + new_size.height), - new_size, start_angle, sweep_angle); -} - -void CFX_Path::ArcToInternal(const CFX_PointF& pos, - const CFX_SizeF& size, - float start_angle, - float sweep_angle) { - float x0 = cos(sweep_angle / 2); - float y0 = sin(sweep_angle / 2); - float tx = ((1.0f - x0) * 4) / (3 * 1.0f); - float ty = y0 - ((tx * x0) / y0); - - CFX_PointF points[] = {CFX_PointF(x0 + tx, -ty), CFX_PointF(x0 + tx, ty)}; - float sn = sin(start_angle + sweep_angle / 2); - float cs = cos(start_angle + sweep_angle / 2); - - CFX_PointF bezier; - bezier.x = pos.x + (size.width * ((points[0].x * cs) - (points[0].y * sn))); - bezier.y = pos.y + (size.height * ((points[0].x * sn) + (points[0].y * cs))); - data_.AppendPoint(bezier, FXPT_TYPE::BezierTo, false); - - bezier.x = pos.x + (size.width * ((points[1].x * cs) - (points[1].y * sn))); - bezier.y = pos.y + (size.height * ((points[1].x * sn) + (points[1].y * cs))); - data_.AppendPoint(bezier, FXPT_TYPE::BezierTo, false); - - bezier.x = pos.x + (size.width * cos(start_angle + sweep_angle)); - bezier.y = pos.y + (size.height * sin(start_angle + sweep_angle)); - data_.AppendPoint(bezier, FXPT_TYPE::BezierTo, false); -} - -void CFX_Path::AddLine(const CFX_PointF& p1, const CFX_PointF& p2) { - data_.AppendPoint(p1, FXPT_TYPE::MoveTo, false); - data_.AppendPoint(p2, FXPT_TYPE::LineTo, false); -} - -void CFX_Path::AddRectangle(float left, float top, float width, float height) { - data_.AppendRect(left, top, left + width, top + height); -} - -void CFX_Path::AddEllipse(const CFX_RectF& rect) { - AddArc(rect.TopLeft(), rect.Size(), 0, FX_PI * 2); -} - -void CFX_Path::AddArc(const CFX_PointF& original_pos, - const CFX_SizeF& original_size, - float start_angle, - float sweep_angle) { - if (sweep_angle == 0) - return; - - const float bezier_arc_angle_epsilon = 0.01f; - while (start_angle > FX_PI * 2) - start_angle -= FX_PI * 2; - while (start_angle < 0) - start_angle += FX_PI * 2; - if (sweep_angle >= FX_PI * 2) - sweep_angle = FX_PI * 2; - if (sweep_angle <= -FX_PI * 2) - sweep_angle = -FX_PI * 2; - - CFX_SizeF size = original_size / 2; - CFX_PointF pos(original_pos.x + size.width, original_pos.y + size.height); - data_.AppendPoint(pos + CFX_PointF(size.width * cos(start_angle), - size.height * sin(start_angle)), - FXPT_TYPE::MoveTo, false); - - float total_sweep = 0; - float local_sweep = 0; - float prev_sweep = 0; - bool done = false; - do { - if (sweep_angle < 0) { - prev_sweep = total_sweep; - local_sweep = -FX_PI / 2; - total_sweep -= FX_PI / 2; - if (total_sweep <= sweep_angle + bezier_arc_angle_epsilon) { - local_sweep = sweep_angle - prev_sweep; - done = true; - } - } else { - prev_sweep = total_sweep; - local_sweep = FX_PI / 2; - total_sweep += FX_PI / 2; - if (total_sweep >= sweep_angle - bezier_arc_angle_epsilon) { - local_sweep = sweep_angle - prev_sweep; - done = true; - } - } - - ArcToInternal(pos, size, start_angle, local_sweep); - start_angle += local_sweep; - } while (!done); -} - -void CFX_Path::AddSubpath(CFX_Path* path) { - if (!path) - return; - data_.Append(&path->data_, nullptr); -} - -void CFX_Path::TransformBy(const CFX_Matrix& mt) { - data_.Transform(&mt); -} diff --git a/xfa/fxgraphics/cfx_path.h b/xfa/fxgraphics/cfx_path.h deleted file mode 100644 index 186465f810..0000000000 --- a/xfa/fxgraphics/cfx_path.h +++ /dev/null @@ -1,55 +0,0 @@ -// 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_FXGRAPHICS_CFX_PATH_H_ -#define XFA_FXGRAPHICS_CFX_PATH_H_ - -#include "core/fxcrt/fx_system.h" -#include "core/fxge/cfx_pathdata.h" -#include "xfa/fxgraphics/cfx_graphics.h" - -class CFX_Path final { - public: - CFX_Path(); - ~CFX_Path(); - - const CFX_PathData* GetPathData() const { return &data_; } - - void Clear(); - bool IsEmpty() const { return data_.GetPoints().empty(); } - void TransformBy(const CFX_Matrix& mt); - - void Close(); - void MoveTo(const CFX_PointF& point); - void LineTo(const CFX_PointF& point); - void BezierTo(const CFX_PointF& c1, - const CFX_PointF& c2, - const CFX_PointF& to); - void ArcTo(const CFX_PointF& pos, - const CFX_SizeF& size, - float startAngle, - float sweepAngle); - - void AddLine(const CFX_PointF& p1, const CFX_PointF& p2); - void AddRectangle(float left, float top, float width, float height); - void AddEllipse(const CFX_RectF& rect); - void AddArc(const CFX_PointF& pos, - const CFX_SizeF& size, - float startAngle, - float sweepAngle); - - void AddSubpath(CFX_Path* path); - - private: - void ArcToInternal(const CFX_PointF& pos, - const CFX_SizeF& size, - float start_angle, - float sweep_angle); - - CFX_PathData data_; -}; - -#endif // XFA_FXGRAPHICS_CFX_PATH_H_ diff --git a/xfa/fxgraphics/cfx_pattern.cpp b/xfa/fxgraphics/cfx_pattern.cpp deleted file mode 100644 index a20ec24aa5..0000000000 --- a/xfa/fxgraphics/cfx_pattern.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// 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 - -#include "xfa/fxgraphics/cfx_pattern.h" - -CFX_Pattern::CFX_Pattern(FX_HatchStyle hatchStyle, - const FX_ARGB foreArgb, - const FX_ARGB backArgb, - CFX_Matrix* matrix) - : m_hatchStyle(hatchStyle), m_foreArgb(foreArgb), m_backArgb(backArgb) { - if (matrix) - m_matrix = *matrix; - else - m_matrix.SetIdentity(); -} - -CFX_Pattern::~CFX_Pattern() {} diff --git a/xfa/fxgraphics/cfx_pattern.h b/xfa/fxgraphics/cfx_pattern.h deleted file mode 100644 index ef0008a3ea..0000000000 --- a/xfa/fxgraphics/cfx_pattern.h +++ /dev/null @@ -1,36 +0,0 @@ -// 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_FXGRAPHICS_CFX_PATTERN_H_ -#define XFA_FXGRAPHICS_CFX_PATTERN_H_ - -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_system.h" -#include "xfa/fxgraphics/cfx_graphics.h" - -class CFX_DIBitmap; -class CFX_Matrix; - -class CFX_Pattern { - public: - CFX_Pattern(FX_HatchStyle hatchStyle, - const FX_ARGB foreArgb, - const FX_ARGB backArgb, - CFX_Matrix* matrix = nullptr); - - virtual ~CFX_Pattern(); - - private: - friend class CFX_Graphics; - - CFX_Matrix m_matrix; - - const FX_HatchStyle m_hatchStyle; - const FX_ARGB m_foreArgb; - const FX_ARGB m_backArgb; -}; - -#endif // XFA_FXGRAPHICS_CFX_PATTERN_H_ diff --git a/xfa/fxgraphics/cfx_shading.cpp b/xfa/fxgraphics/cfx_shading.cpp deleted file mode 100644 index b099bb97b1..0000000000 --- a/xfa/fxgraphics/cfx_shading.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// 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 - -#include "xfa/fxgraphics/cfx_shading.h" - -CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint, - const CFX_PointF& endPoint, - bool isExtendedBegin, - bool isExtendedEnd, - const FX_ARGB beginArgb, - const FX_ARGB endArgb) - : m_type(FX_SHADING_Axial), - m_beginPoint(beginPoint), - m_endPoint(endPoint), - m_beginRadius(0), - m_endRadius(0), - m_isExtendedBegin(isExtendedBegin), - m_isExtendedEnd(isExtendedEnd), - m_beginArgb(beginArgb), - m_endArgb(endArgb) { - InitArgbArray(); -} - -CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint, - const CFX_PointF& endPoint, - const float beginRadius, - const float endRadius, - bool isExtendedBegin, - bool isExtendedEnd, - const FX_ARGB beginArgb, - const FX_ARGB endArgb) - : m_type(FX_SHADING_Radial), - m_beginPoint(beginPoint), - m_endPoint(endPoint), - m_beginRadius(beginRadius), - m_endRadius(endRadius), - m_isExtendedBegin(isExtendedBegin), - m_isExtendedEnd(isExtendedEnd), - m_beginArgb(beginArgb), - m_endArgb(endArgb) { - InitArgbArray(); -} - -CFX_Shading::~CFX_Shading() {} - -void CFX_Shading::InitArgbArray() { - int32_t a1; - int32_t r1; - int32_t g1; - int32_t b1; - std::tie(a1, r1, g1, b1) = ArgbDecode(m_beginArgb); - - int32_t a2; - int32_t r2; - int32_t g2; - int32_t b2; - std::tie(a2, r2, g2, b2) = ArgbDecode(m_endArgb); - - float f = static_cast(FX_SHADING_Steps - 1); - float aScale = 1.0 * (a2 - a1) / f; - float rScale = 1.0 * (r2 - r1) / f; - float gScale = 1.0 * (g2 - g1) / f; - float bScale = 1.0 * (b2 - b1) / f; - - for (int32_t i = 0; i < FX_SHADING_Steps; i++) { - int32_t a3 = static_cast(i * aScale); - int32_t r3 = static_cast(i * rScale); - int32_t g3 = static_cast(i * gScale); - int32_t b3 = static_cast(i * bScale); - - // TODO(dsinclair): Add overloads for FX_ARGB. pdfium:437 - m_argbArray[i] = - FXARGB_TODIB(FXARGB_MAKE(a1 + a3, r1 + r3, g1 + g3, b1 + b3)); - } -} diff --git a/xfa/fxgraphics/cfx_shading.h b/xfa/fxgraphics/cfx_shading.h deleted file mode 100644 index 1fb34d2b07..0000000000 --- a/xfa/fxgraphics/cfx_shading.h +++ /dev/null @@ -1,56 +0,0 @@ -// 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_FXGRAPHICS_CFX_SHADING_H_ -#define XFA_FXGRAPHICS_CFX_SHADING_H_ - -#include "core/fxcrt/fx_coordinates.h" -#include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" - -#define FX_SHADING_Steps 256 - -enum CFX_Shading_Type { FX_SHADING_Axial = 1, FX_SHADING_Radial }; - -class CFX_Shading { - public: - // Axial shading. - CFX_Shading(const CFX_PointF& beginPoint, - const CFX_PointF& endPoint, - bool isExtendedBegin, - bool isExtendedEnd, - const FX_ARGB beginArgb, - const FX_ARGB endArgb); - - // Radial shading. - CFX_Shading(const CFX_PointF& beginPoint, - const CFX_PointF& endPoint, - const float beginRadius, - const float endRadius, - bool isExtendedBegin, - bool isExtendedEnd, - const FX_ARGB beginArgb, - const FX_ARGB endArgb); - virtual ~CFX_Shading(); - - private: - friend class CFX_Graphics; - - void InitArgbArray(); - - const CFX_Shading_Type m_type; - const CFX_PointF m_beginPoint; - const CFX_PointF m_endPoint; - const float m_beginRadius; - const float m_endRadius; - const bool m_isExtendedBegin; - const bool m_isExtendedEnd; - const FX_ARGB m_beginArgb; - const FX_ARGB m_endArgb; - FX_ARGB m_argbArray[FX_SHADING_Steps]; -}; - -#endif // XFA_FXGRAPHICS_CFX_SHADING_H_ diff --git a/xfa/fxgraphics/cxfa_color.cpp b/xfa/fxgraphics/cxfa_color.cpp index 27a0cbe569..79c0e5f794 100644 --- a/xfa/fxgraphics/cxfa_color.cpp +++ b/xfa/fxgraphics/cxfa_color.cpp @@ -12,11 +12,11 @@ CXFA_Color::CXFA_Color(const FX_ARGB argb) { Set(argb); } -CXFA_Color::CXFA_Color(CFX_Pattern* pattern, const FX_ARGB argb) { +CXFA_Color::CXFA_Color(CXFA_Pattern* pattern, const FX_ARGB argb) { Set(pattern, argb); } -CXFA_Color::CXFA_Color(CFX_Shading* shading) { +CXFA_Color::CXFA_Color(CXFA_Shading* shading) { Set(shading); } @@ -30,7 +30,7 @@ void CXFA_Color::Set(const FX_ARGB argb) { m_info.pattern = nullptr; } -void CXFA_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { +void CXFA_Color::Set(CXFA_Pattern* pattern, const FX_ARGB argb) { if (!pattern) return; m_type = FX_COLOR_Pattern; @@ -38,7 +38,7 @@ void CXFA_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { m_info.pattern = pattern; } -void CXFA_Color::Set(CFX_Shading* shading) { +void CXFA_Color::Set(CXFA_Shading* shading) { if (!shading) return; m_type = FX_COLOR_Shading; diff --git a/xfa/fxgraphics/cxfa_color.h b/xfa/fxgraphics/cxfa_color.h index 16ef1d7d4d..f5bba27586 100644 --- a/xfa/fxgraphics/cxfa_color.h +++ b/xfa/fxgraphics/cxfa_color.h @@ -8,10 +8,10 @@ #define XFA_FXGRAPHICS_CXFA_COLOR_H_ #include "core/fxge/fx_dib.h" -#include "xfa/fxgraphics/cfx_graphics.h" +#include "xfa/fxgraphics/cxfa_graphics.h" -class CFX_Pattern; -class CFX_Shading; +class CXFA_Pattern; +class CXFA_Shading; enum { FX_COLOR_None = 0, FX_COLOR_Solid, FX_COLOR_Pattern, FX_COLOR_Shading }; @@ -19,24 +19,24 @@ class CXFA_Color { public: CXFA_Color(); explicit CXFA_Color(const FX_ARGB argb); - explicit CXFA_Color(CFX_Shading* shading); - CXFA_Color(CFX_Pattern* pattern, const FX_ARGB argb); + explicit CXFA_Color(CXFA_Shading* shading); + CXFA_Color(CXFA_Pattern* pattern, const FX_ARGB argb); virtual ~CXFA_Color(); void Set(const FX_ARGB argb); - void Set(CFX_Pattern* pattern, const FX_ARGB argb); - void Set(CFX_Shading* shading); + void Set(CXFA_Pattern* pattern, const FX_ARGB argb); + void Set(CXFA_Shading* shading); private: - friend class CFX_Graphics; + friend class CXFA_Graphics; int32_t m_type; union { struct { FX_ARGB argb; - CFX_Pattern* pattern; + CXFA_Pattern* pattern; } m_info; - CFX_Shading* m_shading; + CXFA_Shading* m_shading; }; }; diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp new file mode 100644 index 0000000000..8648abb81d --- /dev/null +++ b/xfa/fxgraphics/cxfa_graphics.cpp @@ -0,0 +1,536 @@ +// 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 + +#include "xfa/fxgraphics/cxfa_graphics.h" + +#include + +#include "core/fxge/cfx_defaultrenderdevice.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/cfx_unicodeencoding.h" +#include "third_party/base/ptr_util.h" +#include "xfa/fxgraphics/cxfa_color.h" +#include "xfa/fxgraphics/cxfa_path.h" +#include "xfa/fxgraphics/cxfa_pattern.h" +#include "xfa/fxgraphics/cxfa_shading.h" + +namespace { + +enum { + FX_CONTEXT_None = 0, + FX_CONTEXT_Device, +}; + +#define FX_HATCHSTYLE_Total 53 + +struct FX_HATCHDATA { + int32_t width; + int32_t height; + uint8_t maskBits[64]; +}; + +const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = { + {16, // Horizontal + 16, + { + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }}, + {16, // Vertical + 16, + { + 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, + 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, + 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + }}, + {16, // ForwardDiagonal + 16, + { + 0x80, 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, + 0x00, 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, + 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x80, + 0x80, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, + 0x10, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00, + 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, + }}, + {16, // BackwardDiagonal + 16, + { + 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, + 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, + 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, + 0x08, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x20, 0x00, + 0x00, 0x40, 0x40, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + }}, + {16, // Cross + 16, + { + 0xff, 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, + 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, + }}, + {16, // DiagonalCross + 16, + { + 0x81, 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, + 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, + 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, 0x81, + 0x81, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, + 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x24, 0x24, 0x00, + 0x00, 0x42, 0x42, 0x00, 0x00, 0x81, 0x81, 0x00, 0x00, + }}, +}; + +} // namespace + +CXFA_Graphics::CXFA_Graphics(CFX_RenderDevice* renderDevice) + : m_type(FX_CONTEXT_None), m_renderDevice(renderDevice) { + if (!renderDevice) + return; + m_type = FX_CONTEXT_Device; +} + +CXFA_Graphics::~CXFA_Graphics() {} + +void CXFA_Graphics::SaveGraphState() { + if (m_type != FX_CONTEXT_Device || !m_renderDevice) + return; + + m_renderDevice->SaveState(); + m_infoStack.push_back(pdfium::MakeUnique(m_info)); +} + +void CXFA_Graphics::RestoreGraphState() { + if (m_type != FX_CONTEXT_Device || !m_renderDevice) + return; + + m_renderDevice->RestoreState(false); + if (m_infoStack.empty() || !m_infoStack.back()) + return; + + m_info = *m_infoStack.back(); + m_infoStack.pop_back(); + return; +} + +void CXFA_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) { + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + m_info.graphState.m_LineCap = lineCap; + } +} + +void CXFA_Graphics::SetLineDash(float dashPhase, + float* dashArray, + int32_t dashCount) { + if (dashCount > 0 && !dashArray) + return; + + dashCount = dashCount < 0 ? 0 : dashCount; + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + float scale = 1.0; + if (m_info.isActOnDash) { + scale = m_info.graphState.m_LineWidth; + } + m_info.graphState.m_DashPhase = dashPhase; + m_info.graphState.SetDashCount(dashCount); + for (int32_t i = 0; i < dashCount; i++) { + m_info.graphState.m_DashArray[i] = dashArray[i] * scale; + } + } +} + +void CXFA_Graphics::SetLineDash(FX_DashStyle dashStyle) { + if (m_type == FX_CONTEXT_Device && m_renderDevice) + RenderDeviceSetLineDash(dashStyle); +} + +void CXFA_Graphics::SetLineWidth(float lineWidth, bool isActOnDash) { + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + m_info.graphState.m_LineWidth = lineWidth; + m_info.isActOnDash = isActOnDash; + } +} + +void CXFA_Graphics::SetStrokeColor(CXFA_Color* color) { + if (!color) + return; + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + m_info.strokeColor = color; + } +} + +void CXFA_Graphics::SetFillColor(CXFA_Color* color) { + if (!color) + return; + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + m_info.fillColor = color; + } +} + +void CXFA_Graphics::StrokePath(CXFA_Path* path, CFX_Matrix* matrix) { + if (!path) + return; + if (m_type == FX_CONTEXT_Device && m_renderDevice) + RenderDeviceStrokePath(path, matrix); +} + +void CXFA_Graphics::FillPath(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { + if (!path) + return; + if (m_type == FX_CONTEXT_Device && m_renderDevice) + RenderDeviceFillPath(path, fillMode, matrix); +} + +void CXFA_Graphics::StretchImage(const CFX_RetainPtr& source, + const CFX_RectF& rect, + CFX_Matrix* matrix) { + if (!source) + return; + if (m_type == FX_CONTEXT_Device && m_renderDevice) + RenderDeviceStretchImage(source, rect, matrix); +} + +void CXFA_Graphics::ConcatMatrix(const CFX_Matrix* matrix) { + if (!matrix) + return; + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + m_info.CTM.Concat(*matrix); + } +} + +CFX_Matrix* CXFA_Graphics::GetMatrix() { + if (m_type == FX_CONTEXT_Device && m_renderDevice) + return &m_info.CTM; + return nullptr; +} + +CFX_RectF CXFA_Graphics::GetClipRect() const { + if (m_type != FX_CONTEXT_Device || !m_renderDevice) + return CFX_RectF(); + + FX_RECT r = m_renderDevice->GetClipBox(); + return CFX_Rect(r.left, r.top, r.Width(), r.Height()).As(); +} + +void CXFA_Graphics::SetClipRect(const CFX_RectF& rect) { + if (m_type == FX_CONTEXT_Device && m_renderDevice) { + m_renderDevice->SetClip_Rect( + FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top), + FXSYS_round(rect.right()), FXSYS_round(rect.bottom()))); + } +} + +CFX_RenderDevice* CXFA_Graphics::GetRenderDevice() { + return m_renderDevice; +} + +void CXFA_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) { + switch (dashStyle) { + case FX_DASHSTYLE_Solid: { + m_info.graphState.SetDashCount(0); + return; + } + case FX_DASHSTYLE_Dash: { + float dashArray[] = {3, 1}; + SetLineDash(0, dashArray, 2); + return; + } + case FX_DASHSTYLE_Dot: { + float dashArray[] = {1, 1}; + SetLineDash(0, dashArray, 2); + return; + } + case FX_DASHSTYLE_DashDot: { + float dashArray[] = {3, 1, 1, 1}; + SetLineDash(0, dashArray, 4); + return; + } + case FX_DASHSTYLE_DashDotDot: { + float dashArray[] = {4, 1, 2, 1, 2, 1}; + SetLineDash(0, dashArray, 6); + return; + } + default: + return; + } +} + +void CXFA_Graphics::RenderDeviceStrokePath(CXFA_Path* path, + CFX_Matrix* matrix) { + if (!m_info.strokeColor) + return; + CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, + m_info.CTM.e, m_info.CTM.f); + if (matrix) { + m.Concat(*matrix); + } + switch (m_info.strokeColor->m_type) { + case FX_COLOR_Solid: { + m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, 0x0, + m_info.strokeColor->m_info.argb, 0); + return; + } + default: + return; + } +} + +void CXFA_Graphics::RenderDeviceFillPath(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { + if (!m_info.fillColor) + return; + CFX_Matrix m(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, + m_info.CTM.e, m_info.CTM.f); + if (matrix) { + m.Concat(*matrix); + } + switch (m_info.fillColor->m_type) { + case FX_COLOR_Solid: { + m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState, + m_info.fillColor->m_info.argb, 0x0, fillMode); + return; + } + case FX_COLOR_Pattern: + FillPathWithPattern(path, fillMode, &m); + return; + case FX_COLOR_Shading: + FillPathWithShading(path, fillMode, &m); + return; + default: + return; + } +} + +void CXFA_Graphics::RenderDeviceStretchImage( + const CFX_RetainPtr& source, + const CFX_RectF& rect, + CFX_Matrix* matrix) { + CFX_Matrix m1(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, + m_info.CTM.e, m_info.CTM.f); + if (matrix) { + m1.Concat(*matrix); + } + CFX_RetainPtr bmp1 = + source->StretchTo(static_cast(rect.Width()), + static_cast(rect.Height()), 0, nullptr); + CFX_Matrix m2(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top); + m2.Concat(m1); + + int32_t left; + int32_t top; + CFX_RetainPtr bmp2 = bmp1->FlipImage(false, true); + CFX_RetainPtr bmp3 = bmp2->TransformTo(&m2, &left, &top); + CFX_RectF r = GetClipRect(); + CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); + bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), + FXSYS_round(r.Width()), FXSYS_round(r.Height()), bmp3, + FXSYS_round(r.left - left), FXSYS_round(r.top - top)); +} + +void CXFA_Graphics::FillPathWithPattern(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { + CXFA_Pattern* pattern = m_info.fillColor->m_info.pattern; + CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); + int32_t width = bitmap->GetWidth(); + int32_t height = bitmap->GetHeight(); + auto bmp = pdfium::MakeRetain(); + bmp->Create(width, height, FXDIB_Argb); + m_renderDevice->GetDIBits(bmp, 0, 0); + + FX_HatchStyle hatchStyle = m_info.fillColor->m_info.pattern->m_hatchStyle; + const FX_HATCHDATA& data = hatchBitmapData[static_cast(hatchStyle)]; + + auto mask = pdfium::MakeRetain(); + mask->Create(data.width, data.height, FXDIB_1bppMask); + memcpy(mask->GetBuffer(), data.maskBits, mask->GetPitch() * data.height); + CFX_FloatRect rectf = path->GetPathData()->GetBoundingBox(); + if (matrix) + matrix->TransformRect(rectf); + + FX_RECT rect(FXSYS_round(rectf.left), FXSYS_round(rectf.top), + FXSYS_round(rectf.right), FXSYS_round(rectf.bottom)); + CFX_DefaultRenderDevice device; + device.Attach(bmp, false, nullptr, false); + device.FillRect(&rect, m_info.fillColor->m_info.pattern->m_backArgb); + for (int32_t j = rect.bottom; j < rect.top; j += mask->GetHeight()) { + for (int32_t i = rect.left; i < rect.right; i += mask->GetWidth()) { + device.SetBitMask(mask, i, j, + m_info.fillColor->m_info.pattern->m_foreArgb); + } + } + CFX_RenderDevice::StateRestorer restorer(m_renderDevice); + m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode); + SetDIBitsWithMatrix(bmp, &pattern->m_matrix); +} + +void CXFA_Graphics::FillPathWithShading(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix) { + CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); + int32_t width = bitmap->GetWidth(); + int32_t height = bitmap->GetHeight(); + float start_x = m_info.fillColor->m_shading->m_beginPoint.x; + float start_y = m_info.fillColor->m_shading->m_beginPoint.y; + float end_x = m_info.fillColor->m_shading->m_endPoint.x; + float end_y = m_info.fillColor->m_shading->m_endPoint.y; + auto bmp = pdfium::MakeRetain(); + bmp->Create(width, height, FXDIB_Argb); + m_renderDevice->GetDIBits(bmp, 0, 0); + int32_t pitch = bmp->GetPitch(); + bool result = false; + switch (m_info.fillColor->m_shading->m_type) { + case FX_SHADING_Axial: { + float x_span = end_x - start_x; + float y_span = end_y - start_y; + float axis_len_square = (x_span * x_span) + (y_span * y_span); + for (int32_t row = 0; row < height; row++) { + uint32_t* dib_buf = (uint32_t*)(bmp->GetBuffer() + row * pitch); + for (int32_t column = 0; column < width; column++) { + float x = (float)(column); + float y = (float)(row); + float scale = (((x - start_x) * x_span) + ((y - start_y) * y_span)) / + axis_len_square; + if (scale < 0) { + if (!m_info.fillColor->m_shading->m_isExtendedBegin) { + continue; + } + scale = 0; + } else if (scale > 1.0f) { + if (!m_info.fillColor->m_shading->m_isExtendedEnd) { + continue; + } + scale = 1.0f; + } + int32_t index = (int32_t)(scale * (FX_SHADING_Steps - 1)); + dib_buf[column] = m_info.fillColor->m_shading->m_argbArray[index]; + } + } + result = true; + break; + } + case FX_SHADING_Radial: { + float start_r = m_info.fillColor->m_shading->m_beginRadius; + float end_r = m_info.fillColor->m_shading->m_endRadius; + float a = ((start_x - end_x) * (start_x - end_x)) + + ((start_y - end_y) * (start_y - end_y)) - + ((start_r - end_r) * (start_r - end_r)); + for (int32_t row = 0; row < height; row++) { + uint32_t* dib_buf = (uint32_t*)(bmp->GetBuffer() + row * pitch); + for (int32_t column = 0; column < width; column++) { + float x = (float)(column); + float y = (float)(row); + float b = -2 * (((x - start_x) * (end_x - start_x)) + + ((y - start_y) * (end_y - start_y)) + + (start_r * (end_r - start_r))); + float c = ((x - start_x) * (x - start_x)) + + ((y - start_y) * (y - start_y)) - (start_r * start_r); + float s; + if (a == 0) { + s = -c / b; + } else { + float b2_4ac = (b * b) - 4 * (a * c); + if (b2_4ac < 0) { + continue; + } + float root = (sqrt(b2_4ac)); + float s1, s2; + if (a > 0) { + s1 = (-b - root) / (2 * a); + s2 = (-b + root) / (2 * a); + } else { + s2 = (-b - root) / (2 * a); + s1 = (-b + root) / (2 * a); + } + if (s2 <= 1.0f || m_info.fillColor->m_shading->m_isExtendedEnd) { + s = (s2); + } else { + s = (s1); + } + if ((start_r) + s * (end_r - start_r) < 0) { + continue; + } + } + if (s < 0) { + if (!m_info.fillColor->m_shading->m_isExtendedBegin) { + continue; + } + s = 0; + } + if (s > 1.0f) { + if (!m_info.fillColor->m_shading->m_isExtendedEnd) { + continue; + } + s = 1.0f; + } + int index = (int32_t)(s * (FX_SHADING_Steps - 1)); + dib_buf[column] = m_info.fillColor->m_shading->m_argbArray[index]; + } + } + result = true; + break; + } + default: { + result = false; + break; + } + } + if (result) { + CFX_RenderDevice::StateRestorer restorer(m_renderDevice); + m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode); + SetDIBitsWithMatrix(bmp, matrix); + } +} + +void CXFA_Graphics::SetDIBitsWithMatrix( + const CFX_RetainPtr& source, + CFX_Matrix* matrix) { + if (matrix->IsIdentity()) { + m_renderDevice->SetDIBits(source, 0, 0); + } else { + CFX_Matrix m((float)source->GetWidth(), 0, 0, (float)source->GetHeight(), 0, + 0); + m.Concat(*matrix); + int32_t left; + int32_t top; + CFX_RetainPtr bmp1 = source->FlipImage(false, true); + CFX_RetainPtr bmp2 = bmp1->TransformTo(&m, &left, &top); + m_renderDevice->SetDIBits(bmp2, left, top); + } +} + +CXFA_Graphics::TInfo::TInfo() + : isActOnDash(false), strokeColor(nullptr), fillColor(nullptr) {} + +CXFA_Graphics::TInfo::TInfo(const TInfo& info) + : graphState(info.graphState), + CTM(info.CTM), + isActOnDash(info.isActOnDash), + strokeColor(info.strokeColor), + fillColor(info.fillColor) {} + +CXFA_Graphics::TInfo& CXFA_Graphics::TInfo::operator=(const TInfo& other) { + graphState.Copy(other.graphState); + CTM = other.CTM; + isActOnDash = other.isActOnDash; + strokeColor = other.strokeColor; + fillColor = other.fillColor; + return *this; +} diff --git a/xfa/fxgraphics/cxfa_graphics.h b/xfa/fxgraphics/cxfa_graphics.h new file mode 100644 index 0000000000..5492d4d3be --- /dev/null +++ b/xfa/fxgraphics/cxfa_graphics.h @@ -0,0 +1,111 @@ +// 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_FXGRAPHICS_CXFA_GRAPHICS_H_ +#define XFA_FXGRAPHICS_CXFA_GRAPHICS_H_ + +#include +#include + +#include "core/fxcrt/fx_system.h" +#include "core/fxge/cfx_defaultrenderdevice.h" +#include "core/fxge/cfx_graphstatedata.h" +#include "core/fxge/cfx_renderdevice.h" +#include "core/fxge/fx_dib.h" +#include "core/fxge/fx_font.h" + +class CXFA_Color; +class CXFA_Path; + +using FX_FillMode = int32_t; + +enum FX_DashStyle { + FX_DASHSTYLE_Solid = 0, + FX_DASHSTYLE_Dash = 1, + FX_DASHSTYLE_Dot = 2, + FX_DASHSTYLE_DashDot = 3, + FX_DASHSTYLE_DashDotDot = 4 +}; + +enum class FX_HatchStyle { + Horizontal = 0, + Vertical = 1, + ForwardDiagonal = 2, + BackwardDiagonal = 3, + Cross = 4, + DiagonalCross = 5 +}; + +class CFX_RenderDevice; + +class CXFA_Graphics { + public: + explicit CXFA_Graphics(CFX_RenderDevice* renderDevice); + ~CXFA_Graphics(); + + void SaveGraphState(); + void RestoreGraphState(); + + CFX_RectF GetClipRect() const; + CFX_Matrix* GetMatrix(); + CFX_RenderDevice* GetRenderDevice(); + + void SetLineCap(CFX_GraphStateData::LineCap lineCap); + void SetLineDash(float dashPhase, float* dashArray, int32_t dashCount); + void SetLineDash(FX_DashStyle dashStyle); + void SetLineWidth(float lineWidth, bool isActOnDash = false); + void SetStrokeColor(CXFA_Color* color); + void SetFillColor(CXFA_Color* color); + void SetClipRect(const CFX_RectF& rect); + void StrokePath(CXFA_Path* path, CFX_Matrix* matrix = nullptr); + void FillPath(CXFA_Path* path, + FX_FillMode fillMode = FXFILL_WINDING, + CFX_Matrix* matrix = nullptr); + void StretchImage(const CFX_RetainPtr& source, + const CFX_RectF& rect, + CFX_Matrix* matrix = nullptr); + void ConcatMatrix(const CFX_Matrix* matrix); + + protected: + int32_t m_type; + + private: + struct TInfo { + TInfo(); + explicit TInfo(const TInfo& info); + TInfo& operator=(const TInfo& other); + + CFX_GraphStateData graphState; + CFX_Matrix CTM; + bool isActOnDash; + CXFA_Color* strokeColor; + CXFA_Color* fillColor; + } m_info; + + void RenderDeviceSetLineDash(FX_DashStyle dashStyle); + void RenderDeviceStrokePath(CXFA_Path* path, CFX_Matrix* matrix); + void RenderDeviceFillPath(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + void RenderDeviceStretchImage(const CFX_RetainPtr& source, + const CFX_RectF& rect, + CFX_Matrix* matrix); + + void FillPathWithPattern(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + void FillPathWithShading(CXFA_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + + void SetDIBitsWithMatrix(const CFX_RetainPtr& source, + CFX_Matrix* matrix); + + CFX_RenderDevice* const m_renderDevice; // Not owned. + std::vector> m_infoStack; +}; + +#endif // XFA_FXGRAPHICS_CXFA_GRAPHICS_H_ diff --git a/xfa/fxgraphics/cxfa_path.cpp b/xfa/fxgraphics/cxfa_path.cpp new file mode 100644 index 0000000000..6d7ed0be58 --- /dev/null +++ b/xfa/fxgraphics/cxfa_path.cpp @@ -0,0 +1,148 @@ +// 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 + +#include "xfa/fxgraphics/cxfa_path.h" + +#include "core/fxge/cfx_pathdata.h" +#include "third_party/base/ptr_util.h" + +CXFA_Path::CXFA_Path() {} + +CXFA_Path::~CXFA_Path() {} + +void CXFA_Path::Clear() { + data_.Clear(); +} + +void CXFA_Path::Close() { + data_.ClosePath(); +} + +void CXFA_Path::MoveTo(const CFX_PointF& point) { + data_.AppendPoint(point, FXPT_TYPE::MoveTo, false); +} + +void CXFA_Path::LineTo(const CFX_PointF& point) { + data_.AppendPoint(point, FXPT_TYPE::LineTo, false); +} + +void CXFA_Path::BezierTo(const CFX_PointF& c1, + const CFX_PointF& c2, + const CFX_PointF& to) { + data_.AppendPoint(c1, FXPT_TYPE::BezierTo, false); + data_.AppendPoint(c2, FXPT_TYPE::BezierTo, false); + data_.AppendPoint(to, FXPT_TYPE::BezierTo, false); +} + +void CXFA_Path::ArcTo(const CFX_PointF& pos, + const CFX_SizeF& size, + float start_angle, + float sweep_angle) { + CFX_SizeF new_size = size / 2.0f; + ArcToInternal(CFX_PointF(pos.x + new_size.width, pos.y + new_size.height), + new_size, start_angle, sweep_angle); +} + +void CXFA_Path::ArcToInternal(const CFX_PointF& pos, + const CFX_SizeF& size, + float start_angle, + float sweep_angle) { + float x0 = cos(sweep_angle / 2); + float y0 = sin(sweep_angle / 2); + float tx = ((1.0f - x0) * 4) / (3 * 1.0f); + float ty = y0 - ((tx * x0) / y0); + + CFX_PointF points[] = {CFX_PointF(x0 + tx, -ty), CFX_PointF(x0 + tx, ty)}; + float sn = sin(start_angle + sweep_angle / 2); + float cs = cos(start_angle + sweep_angle / 2); + + CFX_PointF bezier; + bezier.x = pos.x + (size.width * ((points[0].x * cs) - (points[0].y * sn))); + bezier.y = pos.y + (size.height * ((points[0].x * sn) + (points[0].y * cs))); + data_.AppendPoint(bezier, FXPT_TYPE::BezierTo, false); + + bezier.x = pos.x + (size.width * ((points[1].x * cs) - (points[1].y * sn))); + bezier.y = pos.y + (size.height * ((points[1].x * sn) + (points[1].y * cs))); + data_.AppendPoint(bezier, FXPT_TYPE::BezierTo, false); + + bezier.x = pos.x + (size.width * cos(start_angle + sweep_angle)); + bezier.y = pos.y + (size.height * sin(start_angle + sweep_angle)); + data_.AppendPoint(bezier, FXPT_TYPE::BezierTo, false); +} + +void CXFA_Path::AddLine(const CFX_PointF& p1, const CFX_PointF& p2) { + data_.AppendPoint(p1, FXPT_TYPE::MoveTo, false); + data_.AppendPoint(p2, FXPT_TYPE::LineTo, false); +} + +void CXFA_Path::AddRectangle(float left, float top, float width, float height) { + data_.AppendRect(left, top, left + width, top + height); +} + +void CXFA_Path::AddEllipse(const CFX_RectF& rect) { + AddArc(rect.TopLeft(), rect.Size(), 0, FX_PI * 2); +} + +void CXFA_Path::AddArc(const CFX_PointF& original_pos, + const CFX_SizeF& original_size, + float start_angle, + float sweep_angle) { + if (sweep_angle == 0) + return; + + const float bezier_arc_angle_epsilon = 0.01f; + while (start_angle > FX_PI * 2) + start_angle -= FX_PI * 2; + while (start_angle < 0) + start_angle += FX_PI * 2; + if (sweep_angle >= FX_PI * 2) + sweep_angle = FX_PI * 2; + if (sweep_angle <= -FX_PI * 2) + sweep_angle = -FX_PI * 2; + + CFX_SizeF size = original_size / 2; + CFX_PointF pos(original_pos.x + size.width, original_pos.y + size.height); + data_.AppendPoint(pos + CFX_PointF(size.width * cos(start_angle), + size.height * sin(start_angle)), + FXPT_TYPE::MoveTo, false); + + float total_sweep = 0; + float local_sweep = 0; + float prev_sweep = 0; + bool done = false; + do { + if (sweep_angle < 0) { + prev_sweep = total_sweep; + local_sweep = -FX_PI / 2; + total_sweep -= FX_PI / 2; + if (total_sweep <= sweep_angle + bezier_arc_angle_epsilon) { + local_sweep = sweep_angle - prev_sweep; + done = true; + } + } else { + prev_sweep = total_sweep; + local_sweep = FX_PI / 2; + total_sweep += FX_PI / 2; + if (total_sweep >= sweep_angle - bezier_arc_angle_epsilon) { + local_sweep = sweep_angle - prev_sweep; + done = true; + } + } + + ArcToInternal(pos, size, start_angle, local_sweep); + start_angle += local_sweep; + } while (!done); +} + +void CXFA_Path::AddSubpath(CXFA_Path* path) { + if (!path) + return; + data_.Append(&path->data_, nullptr); +} + +void CXFA_Path::TransformBy(const CFX_Matrix& mt) { + data_.Transform(&mt); +} diff --git a/xfa/fxgraphics/cxfa_path.h b/xfa/fxgraphics/cxfa_path.h new file mode 100644 index 0000000000..9c71a4d5ff --- /dev/null +++ b/xfa/fxgraphics/cxfa_path.h @@ -0,0 +1,55 @@ +// 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_FXGRAPHICS_CXFA_PATH_H_ +#define XFA_FXGRAPHICS_CXFA_PATH_H_ + +#include "core/fxcrt/fx_system.h" +#include "core/fxge/cfx_pathdata.h" +#include "xfa/fxgraphics/cxfa_graphics.h" + +class CXFA_Path final { + public: + CXFA_Path(); + ~CXFA_Path(); + + const CFX_PathData* GetPathData() const { return &data_; } + + void Clear(); + bool IsEmpty() const { return data_.GetPoints().empty(); } + void TransformBy(const CFX_Matrix& mt); + + void Close(); + void MoveTo(const CFX_PointF& point); + void LineTo(const CFX_PointF& point); + void BezierTo(const CFX_PointF& c1, + const CFX_PointF& c2, + const CFX_PointF& to); + void ArcTo(const CFX_PointF& pos, + const CFX_SizeF& size, + float startAngle, + float sweepAngle); + + void AddLine(const CFX_PointF& p1, const CFX_PointF& p2); + void AddRectangle(float left, float top, float width, float height); + void AddEllipse(const CFX_RectF& rect); + void AddArc(const CFX_PointF& pos, + const CFX_SizeF& size, + float startAngle, + float sweepAngle); + + void AddSubpath(CXFA_Path* path); + + private: + void ArcToInternal(const CFX_PointF& pos, + const CFX_SizeF& size, + float start_angle, + float sweep_angle); + + CFX_PathData data_; +}; + +#endif // XFA_FXGRAPHICS_CXFA_PATH_H_ diff --git a/xfa/fxgraphics/cxfa_pattern.cpp b/xfa/fxgraphics/cxfa_pattern.cpp new file mode 100644 index 0000000000..ea6cea87a5 --- /dev/null +++ b/xfa/fxgraphics/cxfa_pattern.cpp @@ -0,0 +1,20 @@ +// 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 + +#include "xfa/fxgraphics/cxfa_pattern.h" + +CXFA_Pattern::CXFA_Pattern(FX_HatchStyle hatchStyle, + const FX_ARGB foreArgb, + const FX_ARGB backArgb, + CFX_Matrix* matrix) + : m_hatchStyle(hatchStyle), m_foreArgb(foreArgb), m_backArgb(backArgb) { + if (matrix) + m_matrix = *matrix; + else + m_matrix.SetIdentity(); +} + +CXFA_Pattern::~CXFA_Pattern() {} diff --git a/xfa/fxgraphics/cxfa_pattern.h b/xfa/fxgraphics/cxfa_pattern.h new file mode 100644 index 0000000000..838ec98b01 --- /dev/null +++ b/xfa/fxgraphics/cxfa_pattern.h @@ -0,0 +1,36 @@ +// 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_FXGRAPHICS_CXFA_PATTERN_H_ +#define XFA_FXGRAPHICS_CXFA_PATTERN_H_ + +#include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/fx_system.h" +#include "xfa/fxgraphics/cxfa_graphics.h" + +class CFX_DIBitmap; +class CFX_Matrix; + +class CXFA_Pattern { + public: + CXFA_Pattern(FX_HatchStyle hatchStyle, + const FX_ARGB foreArgb, + const FX_ARGB backArgb, + CFX_Matrix* matrix = nullptr); + + virtual ~CXFA_Pattern(); + + private: + friend class CXFA_Graphics; + + CFX_Matrix m_matrix; + + const FX_HatchStyle m_hatchStyle; + const FX_ARGB m_foreArgb; + const FX_ARGB m_backArgb; +}; + +#endif // XFA_FXGRAPHICS_CXFA_PATTERN_H_ diff --git a/xfa/fxgraphics/cxfa_shading.cpp b/xfa/fxgraphics/cxfa_shading.cpp new file mode 100644 index 0000000000..599a3f9d42 --- /dev/null +++ b/xfa/fxgraphics/cxfa_shading.cpp @@ -0,0 +1,78 @@ +// 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 + +#include "xfa/fxgraphics/cxfa_shading.h" + +CXFA_Shading::CXFA_Shading(const CFX_PointF& beginPoint, + const CFX_PointF& endPoint, + bool isExtendedBegin, + bool isExtendedEnd, + const FX_ARGB beginArgb, + const FX_ARGB endArgb) + : m_type(FX_SHADING_Axial), + m_beginPoint(beginPoint), + m_endPoint(endPoint), + m_beginRadius(0), + m_endRadius(0), + m_isExtendedBegin(isExtendedBegin), + m_isExtendedEnd(isExtendedEnd), + m_beginArgb(beginArgb), + m_endArgb(endArgb) { + InitArgbArray(); +} + +CXFA_Shading::CXFA_Shading(const CFX_PointF& beginPoint, + const CFX_PointF& endPoint, + const float beginRadius, + const float endRadius, + bool isExtendedBegin, + bool isExtendedEnd, + const FX_ARGB beginArgb, + const FX_ARGB endArgb) + : m_type(FX_SHADING_Radial), + m_beginPoint(beginPoint), + m_endPoint(endPoint), + m_beginRadius(beginRadius), + m_endRadius(endRadius), + m_isExtendedBegin(isExtendedBegin), + m_isExtendedEnd(isExtendedEnd), + m_beginArgb(beginArgb), + m_endArgb(endArgb) { + InitArgbArray(); +} + +CXFA_Shading::~CXFA_Shading() {} + +void CXFA_Shading::InitArgbArray() { + int32_t a1; + int32_t r1; + int32_t g1; + int32_t b1; + std::tie(a1, r1, g1, b1) = ArgbDecode(m_beginArgb); + + int32_t a2; + int32_t r2; + int32_t g2; + int32_t b2; + std::tie(a2, r2, g2, b2) = ArgbDecode(m_endArgb); + + float f = static_cast(FX_SHADING_Steps - 1); + float aScale = 1.0 * (a2 - a1) / f; + float rScale = 1.0 * (r2 - r1) / f; + float gScale = 1.0 * (g2 - g1) / f; + float bScale = 1.0 * (b2 - b1) / f; + + for (int32_t i = 0; i < FX_SHADING_Steps; i++) { + int32_t a3 = static_cast(i * aScale); + int32_t r3 = static_cast(i * rScale); + int32_t g3 = static_cast(i * gScale); + int32_t b3 = static_cast(i * bScale); + + // TODO(dsinclair): Add overloads for FX_ARGB. pdfium:437 + m_argbArray[i] = + FXARGB_TODIB(FXARGB_MAKE(a1 + a3, r1 + r3, g1 + g3, b1 + b3)); + } +} diff --git a/xfa/fxgraphics/cxfa_shading.h b/xfa/fxgraphics/cxfa_shading.h new file mode 100644 index 0000000000..22ef941250 --- /dev/null +++ b/xfa/fxgraphics/cxfa_shading.h @@ -0,0 +1,56 @@ +// 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_FXGRAPHICS_CXFA_SHADING_H_ +#define XFA_FXGRAPHICS_CXFA_SHADING_H_ + +#include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/fx_system.h" +#include "core/fxge/fx_dib.h" + +#define FX_SHADING_Steps 256 + +enum CXFA_Shading_Type { FX_SHADING_Axial = 1, FX_SHADING_Radial }; + +class CXFA_Shading { + public: + // Axial shading. + CXFA_Shading(const CFX_PointF& beginPoint, + const CFX_PointF& endPoint, + bool isExtendedBegin, + bool isExtendedEnd, + const FX_ARGB beginArgb, + const FX_ARGB endArgb); + + // Radial shading. + CXFA_Shading(const CFX_PointF& beginPoint, + const CFX_PointF& endPoint, + const float beginRadius, + const float endRadius, + bool isExtendedBegin, + bool isExtendedEnd, + const FX_ARGB beginArgb, + const FX_ARGB endArgb); + virtual ~CXFA_Shading(); + + private: + friend class CXFA_Graphics; + + void InitArgbArray(); + + const CXFA_Shading_Type m_type; + const CFX_PointF m_beginPoint; + const CFX_PointF m_endPoint; + const float m_beginRadius; + const float m_endRadius; + const bool m_isExtendedBegin; + const bool m_isExtendedEnd; + const FX_ARGB m_beginArgb; + const FX_ARGB m_endArgb; + FX_ARGB m_argbArray[FX_SHADING_Steps]; +}; + +#endif // XFA_FXGRAPHICS_CXFA_SHADING_H_ -- cgit v1.2.3