From 202ad7238489934ba0c64760de5f95782b36a213 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 17:41:42 -0700 Subject: Move xfa/{fwl,fxbarcode,fxgraphics}/include up to parent BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2383583002 --- BUILD.gn | 8 +- fpdfsdk/DEPS | 4 +- fpdfsdk/cpdfsdk_pageview.cpp | 2 +- fpdfsdk/cpdfsdk_xfawidgethandler.cpp | 4 +- fpdfsdk/fpdfxfa/DEPS | 4 +- fpdfsdk/fpdfxfa/fpdfxfa_app.cpp | 2 +- fpdfsdk/fpdfxfa/fpdfxfa_util.h | 2 +- xfa/fwl/basewidget/cfx_barcode.h | 2 +- xfa/fwl/basewidget/ifwl_barcode.h | 2 +- xfa/fwl/basewidget/ifwl_combobox.h | 2 +- xfa/fwl/core/cfwl_widgetmgr.h | 2 +- xfa/fwl/core/fwl_noteimp.h | 2 +- xfa/fwl/core/fwl_timerimp.cpp | 2 +- xfa/fwl/core/fwl_widgethit.h | 35 ++++ xfa/fwl/core/fwl_widgetimp.h | 2 +- xfa/fwl/core/ifwl_adaptertimermgr.h | 23 +++ xfa/fwl/core/include/fwl_widgethit.h | 35 ---- xfa/fwl/core/include/ifwl_adaptertimermgr.h | 23 --- xfa/fwl/theme/cfwl_widgettp.h | 2 +- xfa/fxbarcode/BC_Library.h | 38 +++++ xfa/fxbarcode/cbc_codebase.h | 2 +- xfa/fxbarcode/include/BC_Library.h | 38 ----- xfa/fxbarcode/oned/BC_OneDimWriter.h | 2 +- xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h | 2 +- xfa/fxbarcode/oned/BC_OnedCode39Writer.h | 2 +- xfa/fxbarcode/oned/BC_OnedEAN8Writer.h | 2 +- xfa/fxfa/app/xfa_ffbarcode.h | 2 +- xfa/fxfa/app/xfa_fftext.cpp | 2 +- xfa/fxfa/app/xfa_ffwidget.cpp | 2 +- xfa/fxfa/app/xfa_rendercontext.cpp | 2 +- xfa/fxfa/parser/cxfa_widgetdata.cpp | 2 +- xfa/fxgraphics/cagg_graphics.h | 2 +- xfa/fxgraphics/cfx_color.h | 2 +- xfa/fxgraphics/cfx_graphics.cpp | 2 +- xfa/fxgraphics/cfx_graphics.h | 242 ++++++++++++++++++++++++++++ xfa/fxgraphics/cfx_path.h | 2 +- xfa/fxgraphics/cfx_pattern.h | 2 +- xfa/fxgraphics/include/cfx_graphics.h | 242 ---------------------------- 38 files changed, 374 insertions(+), 374 deletions(-) create mode 100644 xfa/fwl/core/fwl_widgethit.h create mode 100644 xfa/fwl/core/ifwl_adaptertimermgr.h delete mode 100644 xfa/fwl/core/include/fwl_widgethit.h delete mode 100644 xfa/fwl/core/include/ifwl_adaptertimermgr.h create mode 100644 xfa/fxbarcode/BC_Library.h delete mode 100644 xfa/fxbarcode/include/BC_Library.h create mode 100644 xfa/fxgraphics/cfx_graphics.h delete mode 100644 xfa/fxgraphics/include/cfx_graphics.h diff --git a/BUILD.gn b/BUILD.gn index f2015c3d11..efe8a28229 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1212,8 +1212,10 @@ if (pdf_enable_xfa) { "xfa/fwl/core/fwl_noteimp.h", "xfa/fwl/core/fwl_timerimp.cpp", "xfa/fwl/core/fwl_widgetdef.h", + "xfa/fwl/core/fwl_widgethit.h", "xfa/fwl/core/fwl_widgetimp.cpp", "xfa/fwl/core/fwl_widgetimp.h", + "xfa/fwl/core/ifwl_adaptertimermgr.h", "xfa/fwl/core/ifwl_app.h", "xfa/fwl/core/ifwl_dataprovider.h", "xfa/fwl/core/ifwl_form.h", @@ -1221,8 +1223,6 @@ if (pdf_enable_xfa) { "xfa/fwl/core/ifwl_timer.h", "xfa/fwl/core/ifwl_widget.h", "xfa/fwl/core/ifwl_widgetdelegate.h", - "xfa/fwl/core/include/fwl_widgethit.h", - "xfa/fwl/core/include/ifwl_adaptertimermgr.h", "xfa/fwl/lightwidget/cfwl_barcode.cpp", "xfa/fwl/lightwidget/cfwl_barcode.h", "xfa/fwl/lightwidget/cfwl_checkbox.cpp", @@ -1273,6 +1273,7 @@ if (pdf_enable_xfa) { "xfa/fxbarcode/BC_Dimension.cpp", "xfa/fxbarcode/BC_Dimension.h", "xfa/fxbarcode/BC_Library.cpp", + "xfa/fxbarcode/BC_Library.h", "xfa/fxbarcode/BC_TwoDimWriter.cpp", "xfa/fxbarcode/BC_TwoDimWriter.h", "xfa/fxbarcode/BC_UtilCodingConvert.cpp", @@ -1346,7 +1347,6 @@ if (pdf_enable_xfa) { "xfa/fxbarcode/datamatrix/BC_TextEncoder.h", "xfa/fxbarcode/datamatrix/BC_X12Encoder.cpp", "xfa/fxbarcode/datamatrix/BC_X12Encoder.h", - "xfa/fxbarcode/include/BC_Library.h", "xfa/fxbarcode/oned/BC_OneDimWriter.cpp", "xfa/fxbarcode/oned/BC_OneDimWriter.h", "xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp", @@ -1612,6 +1612,7 @@ if (pdf_enable_xfa) { "xfa/fxgraphics/cfx_color.cpp", "xfa/fxgraphics/cfx_color.h", "xfa/fxgraphics/cfx_graphics.cpp", + "xfa/fxgraphics/cfx_graphics.h", "xfa/fxgraphics/cfx_path.cpp", "xfa/fxgraphics/cfx_path.h", "xfa/fxgraphics/cfx_path_generator.cpp", @@ -1620,7 +1621,6 @@ if (pdf_enable_xfa) { "xfa/fxgraphics/cfx_pattern.h", "xfa/fxgraphics/cfx_shading.cpp", "xfa/fxgraphics/cfx_shading.h", - "xfa/fxgraphics/include/cfx_graphics.h", ] include_dirs = [ "." ] deps = [ diff --git a/fpdfsdk/DEPS b/fpdfsdk/DEPS index 0fed7f3228..840666d996 100644 --- a/fpdfsdk/DEPS +++ b/fpdfsdk/DEPS @@ -11,7 +11,7 @@ include_rules = [ '+core/fxge', '+public', '+v8', - '+xfa/fwl/core/include', + '+xfa/fwl/core', '+xfa/fxfa/include', - '+xfa/fxgraphics/include', + '+xfa/fxgraphics', ] diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index 7f1cf76c90..0e4266774c 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -25,7 +25,7 @@ #include "xfa/fxfa/include/xfa_ffpageview.h" #include "xfa/fxfa/include/xfa_ffwidgethandler.h" #include "xfa/fxfa/include/xfa_rendercontext.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" #endif // PDF_ENABLE_XFA CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, diff --git a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp index 11415c6e85..74a6a8e401 100644 --- a/fpdfsdk/cpdfsdk_xfawidgethandler.cpp +++ b/fpdfsdk/cpdfsdk_xfawidgethandler.cpp @@ -14,13 +14,13 @@ #include "fpdfsdk/cpdfsdk_pageview.h" #include "fpdfsdk/cpdfsdk_xfawidget.h" #include "fpdfsdk/fpdfxfa/fpdfxfa_doc.h" -#include "xfa/fwl/core/include/fwl_widgethit.h" +#include "xfa/fwl/core/fwl_widgethit.h" #include "xfa/fxfa/include/fxfa_basic.h" #include "xfa/fxfa/include/xfa_ffdocview.h" #include "xfa/fxfa/include/xfa_ffpageview.h" #include "xfa/fxfa/include/xfa_ffwidget.h" #include "xfa/fxfa/include/xfa_ffwidgethandler.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" CPDFSDK_XFAWidgetHandler::CPDFSDK_XFAWidgetHandler(CPDFSDK_Environment* pEnv) : m_pEnv(pEnv) {} diff --git a/fpdfsdk/fpdfxfa/DEPS b/fpdfsdk/fpdfxfa/DEPS index b9a370408a..212c6ccf65 100644 --- a/fpdfsdk/fpdfxfa/DEPS +++ b/fpdfsdk/fpdfxfa/DEPS @@ -1,4 +1,4 @@ include_rules = [ - '+xfa/fwl/core/include', - '+xfa/fxbarcode/include', + '+xfa/fwl/core', + '+xfa/fxbarcode', ] diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp index f26a95dff1..91dca08a86 100644 --- a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp +++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp @@ -11,7 +11,7 @@ #include "fpdfsdk/cpdfsdk_environment.h" #include "fpdfsdk/fpdfxfa/fpdfxfa_util.h" #include "fpdfsdk/fsdk_define.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxfa/include/xfa_ffapp.h" #include "xfa/fxfa/include/xfa_fontmgr.h" diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_util.h b/fpdfsdk/fpdfxfa/fpdfxfa_util.h index 74f4f31d7c..a6b08a0d33 100644 --- a/fpdfsdk/fpdfxfa/fpdfxfa_util.h +++ b/fpdfsdk/fpdfxfa/fpdfxfa_util.h @@ -10,7 +10,7 @@ #include #include "fpdfsdk/fpdfxfa/fpdfxfa_doc.h" -#include "xfa/fwl/core/include/ifwl_adaptertimermgr.h" +#include "xfa/fwl/core/ifwl_adaptertimermgr.h" #define JS_STR_VIEWERTYPE_STANDARD L"Exchange" #define JS_STR_LANGUANGE L"ENU" diff --git a/xfa/fwl/basewidget/cfx_barcode.h b/xfa/fwl/basewidget/cfx_barcode.h index da2aabf575..fee0885654 100644 --- a/xfa/fwl/basewidget/cfx_barcode.h +++ b/xfa/fwl/basewidget/cfx_barcode.h @@ -13,7 +13,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" class CBC_CodeBase; class CFX_Font; diff --git a/xfa/fwl/basewidget/ifwl_barcode.h b/xfa/fwl/basewidget/ifwl_barcode.h index c2f464f71b..aaee09b9ff 100644 --- a/xfa/fwl/basewidget/ifwl_barcode.h +++ b/xfa/fwl/basewidget/ifwl_barcode.h @@ -8,7 +8,7 @@ #define XFA_FWL_BASEWIDGET_IFWL_BARCODE_H_ #include "xfa/fwl/basewidget/ifwl_edit.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" class CFWL_WidgetImpProperties; diff --git a/xfa/fwl/basewidget/ifwl_combobox.h b/xfa/fwl/basewidget/ifwl_combobox.h index 5165ef2c48..1dd0ca0ad3 100644 --- a/xfa/fwl/basewidget/ifwl_combobox.h +++ b/xfa/fwl/basewidget/ifwl_combobox.h @@ -8,7 +8,7 @@ #define XFA_FWL_BASEWIDGET_IFWL_COMBOBOX_H_ #include "xfa/fwl/basewidget/ifwl_listbox.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" class CFWL_WidgetImpProperties; class IFDE_TxtEdtDoRecord; diff --git a/xfa/fwl/core/cfwl_widgetmgr.h b/xfa/fwl/core/cfwl_widgetmgr.h index c528889f77..e0188bd600 100644 --- a/xfa/fwl/core/cfwl_widgetmgr.h +++ b/xfa/fwl/core/cfwl_widgetmgr.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fwl/core/fwl_error.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" #define FWL_WGTMGR_DisableThread 0x00000001 #define FWL_WGTMGR_DisableForm 0x00000002 diff --git a/xfa/fwl/core/fwl_noteimp.h b/xfa/fwl/core/fwl_noteimp.h index f923c395d5..9a0723de7b 100644 --- a/xfa/fwl/core/fwl_noteimp.h +++ b/xfa/fwl/core/fwl_noteimp.h @@ -14,7 +14,7 @@ #include "xfa/fwl/core/cfwl_message.h" #include "xfa/fwl/core/fwl_error.h" #include "xfa/fwl/core/ifwl_widget.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" enum FWL_KeyFlag { FWL_KEYFLAG_Ctrl = 1 << 0, diff --git a/xfa/fwl/core/fwl_timerimp.cpp b/xfa/fwl/core/fwl_timerimp.cpp index 22b28c8c67..0fcbc24b01 100644 --- a/xfa/fwl/core/fwl_timerimp.cpp +++ b/xfa/fwl/core/fwl_timerimp.cpp @@ -5,9 +5,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "xfa/fwl/core/fwl_appimp.h" +#include "xfa/fwl/core/ifwl_adaptertimermgr.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_timer.h" -#include "xfa/fwl/core/include/ifwl_adaptertimermgr.h" #include "xfa/fxfa/include/xfa_ffapp.h" IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) { diff --git a/xfa/fwl/core/fwl_widgethit.h b/xfa/fwl/core/fwl_widgethit.h new file mode 100644 index 0000000000..3adecfe49e --- /dev/null +++ b/xfa/fwl/core/fwl_widgethit.h @@ -0,0 +1,35 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FWL_CORE_FWL_WIDGETHIT_H_ +#define XFA_FWL_CORE_FWL_WIDGETHIT_H_ + +enum class FWL_WidgetHit { + Unknown = 0, + Client, + Left, + Top, + Right, + Bottom, + LeftTop, + RightTop, + LeftBottom, + RightBottom, + Titlebar, + MinBox, + MaxBox, + CloseBox, + HScrollBar, + VScrollBar, + Border, + Edge, + Edit, + HyperLink, + UpButton, + DownButton +}; + +#endif // XFA_FWL_CORE_FWL_WIDGETHIT_H_ diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h index 0c8f643a0f..57970a87eb 100644 --- a/xfa/fwl/core/fwl_widgetimp.h +++ b/xfa/fwl/core/fwl_widgetimp.h @@ -13,8 +13,8 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fwl/core/cfwl_event.h" #include "xfa/fwl/core/cfwl_themepart.h" +#include "xfa/fwl/core/fwl_widgethit.h" #include "xfa/fwl/core/ifwl_widgetdelegate.h" -#include "xfa/fwl/core/include/fwl_widgethit.h" #include "xfa/fwl/theme/cfwl_widgettp.h" class CFWL_AppImp; diff --git a/xfa/fwl/core/ifwl_adaptertimermgr.h b/xfa/fwl/core/ifwl_adaptertimermgr.h new file mode 100644 index 0000000000..ef5ebba59b --- /dev/null +++ b/xfa/fwl/core/ifwl_adaptertimermgr.h @@ -0,0 +1,23 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FWL_CORE_IFWL_ADAPTERTIMERMGR_H_ +#define XFA_FWL_CORE_IFWL_ADAPTERTIMERMGR_H_ + +#include "xfa/fwl/core/fwl_error.h" +#include "xfa/fwl/core/ifwl_timer.h" + +class IFWL_AdapterTimerMgr { + public: + virtual ~IFWL_AdapterTimerMgr() {} + virtual FWL_Error Start(IFWL_Timer* pTimer, + uint32_t dwElapse, + bool bImmediately, + IFWL_TimerInfo** pTimerInfo) = 0; + virtual FWL_Error Stop(IFWL_TimerInfo* pTimerInfo) = 0; +}; + +#endif // XFA_FWL_CORE_IFWL_ADAPTERTIMERMGR_H_ diff --git a/xfa/fwl/core/include/fwl_widgethit.h b/xfa/fwl/core/include/fwl_widgethit.h deleted file mode 100644 index 102024a510..0000000000 --- a/xfa/fwl/core/include/fwl_widgethit.h +++ /dev/null @@ -1,35 +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_FWL_CORE_INCLUDE_FWL_WIDGETHIT_H_ -#define XFA_FWL_CORE_INCLUDE_FWL_WIDGETHIT_H_ - -enum class FWL_WidgetHit { - Unknown = 0, - Client, - Left, - Top, - Right, - Bottom, - LeftTop, - RightTop, - LeftBottom, - RightBottom, - Titlebar, - MinBox, - MaxBox, - CloseBox, - HScrollBar, - VScrollBar, - Border, - Edge, - Edit, - HyperLink, - UpButton, - DownButton -}; - -#endif // XFA_FWL_CORE_INCLUDE_FWL_WIDGETHIT_H_ diff --git a/xfa/fwl/core/include/ifwl_adaptertimermgr.h b/xfa/fwl/core/include/ifwl_adaptertimermgr.h deleted file mode 100644 index 111c3ebf84..0000000000 --- a/xfa/fwl/core/include/ifwl_adaptertimermgr.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_ -#define XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_ - -#include "xfa/fwl/core/fwl_error.h" -#include "xfa/fwl/core/ifwl_timer.h" - -class IFWL_AdapterTimerMgr { - public: - virtual ~IFWL_AdapterTimerMgr() {} - virtual FWL_Error Start(IFWL_Timer* pTimer, - uint32_t dwElapse, - bool bImmediately, - IFWL_TimerInfo** pTimerInfo) = 0; - virtual FWL_Error Stop(IFWL_TimerInfo* pTimerInfo) = 0; -}; - -#endif // XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_ diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index 1ce1f45a31..a6fc4d65fb 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h @@ -14,7 +14,7 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fwl/core/fwl_error.h" #include "xfa/fwl/theme/cfwl_utils.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" enum class CFWL_WidgetCapacity { None = 0, diff --git a/xfa/fxbarcode/BC_Library.h b/xfa/fxbarcode/BC_Library.h new file mode 100644 index 0000000000..47ef9d1532 --- /dev/null +++ b/xfa/fxbarcode/BC_Library.h @@ -0,0 +1,38 @@ +// 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_FXBARCODE_BC_LIBRARY_H_ +#define XFA_FXBARCODE_BC_LIBRARY_H_ + +enum BC_TEXT_LOC { + BC_TEXT_LOC_NONE = 0, + BC_TEXT_LOC_ABOVE, + BC_TEXT_LOC_BELOW, + BC_TEXT_LOC_ABOVEEMBED, + BC_TEXT_LOC_BELOWEMBED +}; + +enum BC_CHAR_ENCODING { CHAR_ENCODING_UTF8 = 0, CHAR_ENCODING_UNICODE }; + +enum BC_TYPE { + BC_UNKNOWN = -1, + BC_CODE39 = 0, + BC_CODABAR, + BC_CODE128, + BC_CODE128_B, + BC_CODE128_C, + BC_EAN8, + BC_UPCA, + BC_EAN13, + BC_QR_CODE, + BC_PDF417, + BC_DATAMATRIX +}; + +void BC_Library_Init(); +void BC_Library_Destory(); + +#endif // XFA_FXBARCODE_BC_LIBRARY_H_ diff --git a/xfa/fxbarcode/cbc_codebase.h b/xfa/fxbarcode/cbc_codebase.h index d185d0ead2..886095aaba 100644 --- a/xfa/fxbarcode/cbc_codebase.h +++ b/xfa/fxbarcode/cbc_codebase.h @@ -11,7 +11,7 @@ #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" class CBC_Writer; class CBC_Reader; diff --git a/xfa/fxbarcode/include/BC_Library.h b/xfa/fxbarcode/include/BC_Library.h deleted file mode 100644 index d0bd85b118..0000000000 --- a/xfa/fxbarcode/include/BC_Library.h +++ /dev/null @@ -1,38 +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_FXBARCODE_INCLUDE_BC_LIBRARY_H_ -#define XFA_FXBARCODE_INCLUDE_BC_LIBRARY_H_ - -enum BC_TEXT_LOC { - BC_TEXT_LOC_NONE = 0, - BC_TEXT_LOC_ABOVE, - BC_TEXT_LOC_BELOW, - BC_TEXT_LOC_ABOVEEMBED, - BC_TEXT_LOC_BELOWEMBED -}; - -enum BC_CHAR_ENCODING { CHAR_ENCODING_UTF8 = 0, CHAR_ENCODING_UNICODE }; - -enum BC_TYPE { - BC_UNKNOWN = -1, - BC_CODE39 = 0, - BC_CODABAR, - BC_CODE128, - BC_CODE128_B, - BC_CODE128_C, - BC_EAN8, - BC_UPCA, - BC_EAN13, - BC_QR_CODE, - BC_PDF417, - BC_DATAMATRIX -}; - -void BC_Library_Init(); -void BC_Library_Destory(); - -#endif // XFA_FXBARCODE_INCLUDE_BC_LIBRARY_H_ diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.h b/xfa/fxbarcode/oned/BC_OneDimWriter.h index 910b2068c8..432c91fbe2 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.h +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.h @@ -10,8 +10,8 @@ #include #include "core/fxge/cfx_renderdevice.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxbarcode/BC_Writer.h" -#include "xfa/fxbarcode/include/BC_Library.h" class CBC_CommonBitMatrix; class CFX_Font; diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h index 8eb20fa754..417b2fe408 100644 --- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h +++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" class CBC_OnedCodaBarWriter : public CBC_OneDimWriter { diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h index 3cd1594271..711e1c0534 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h +++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h @@ -7,7 +7,7 @@ #ifndef XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ #define XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" class CBC_OnedCode39Writer : public CBC_OneDimWriter { diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h index d6a293a250..8517d8614a 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h +++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" class CFX_DIBitmap; diff --git a/xfa/fxfa/app/xfa_ffbarcode.h b/xfa/fxfa/app/xfa_ffbarcode.h index 5f6c64e4e0..84753773c5 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.h +++ b/xfa/fxfa/app/xfa_ffbarcode.h @@ -7,7 +7,7 @@ #ifndef XFA_FXFA_APP_XFA_FFBARCODE_H_ #define XFA_FXFA_APP_XFA_FFBARCODE_H_ -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxfa/app/xfa_fftextedit.h" #include "xfa/fxfa/include/xfa_ffpageview.h" diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp index ad0fdbc42c..174325e94f 100644 --- a/xfa/fxfa/app/xfa_fftext.cpp +++ b/xfa/fxfa/app/xfa_fftext.cpp @@ -13,7 +13,7 @@ #include "xfa/fxfa/include/xfa_ffdoc.h" #include "xfa/fxfa/include/xfa_ffpageview.h" #include "xfa/fxfa/include/xfa_ffwidget.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" CXFA_FFText::CXFA_FFText(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pPageView, pDataAcc) {} diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 10b587004d..e8bd80b6e0 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -24,10 +24,10 @@ #include "xfa/fxfa/include/xfa_ffpageview.h" #include "xfa/fxfa/parser/cxfa_corner.h" #include "xfa/fxgraphics/cfx_color.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/include/cfx_graphics.h" CXFA_FFWidget::CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) diff --git a/xfa/fxfa/app/xfa_rendercontext.cpp b/xfa/fxfa/app/xfa_rendercontext.cpp index bbb11cb5ec..e1abb75a3f 100644 --- a/xfa/fxfa/app/xfa_rendercontext.cpp +++ b/xfa/fxfa/app/xfa_rendercontext.cpp @@ -8,7 +8,7 @@ #include "xfa/fxfa/include/xfa_ffpageview.h" #include "xfa/fxfa/include/xfa_ffwidget.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" namespace { diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 4e02087ebd..a5a7807ac8 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -7,7 +7,7 @@ #include "xfa/fxfa/parser/cxfa_widgetdata.h" #include "core/fxcrt/fx_ext.h" -#include "xfa/fxbarcode/include/BC_Library.h" +#include "xfa/fxbarcode/BC_Library.h" #include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_event.h" diff --git a/xfa/fxgraphics/cagg_graphics.h b/xfa/fxgraphics/cagg_graphics.h index 30117e86c7..9f57a72343 100644 --- a/xfa/fxgraphics/cagg_graphics.h +++ b/xfa/fxgraphics/cagg_graphics.h @@ -8,7 +8,7 @@ #define XFA_FXGRAPHICS_CAGG_GRAPHICS_H_ #include "core/fxge/fx_dib.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" class CFX_Graphics; diff --git a/xfa/fxgraphics/cfx_color.h b/xfa/fxgraphics/cfx_color.h index 6af1f37d70..f47f8c472b 100644 --- a/xfa/fxgraphics/cfx_color.h +++ b/xfa/fxgraphics/cfx_color.h @@ -8,7 +8,7 @@ #define XFA_FXGRAPHICS_CFX_COLOR_H_ #include "core/fxge/fx_dib.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" class CFX_Pattern; class CFX_Shading; diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp index 85a9f439d8..b6574e800e 100644 --- a/xfa/fxgraphics/cfx_graphics.cpp +++ b/xfa/fxgraphics/cfx_graphics.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" #include diff --git a/xfa/fxgraphics/cfx_graphics.h b/xfa/fxgraphics/cfx_graphics.h new file mode 100644 index 0000000000..66e4da333d --- /dev/null +++ b/xfa/fxgraphics/cfx_graphics.h @@ -0,0 +1,242 @@ +// 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 "core/fxcrt/fx_system.h" +#include "core/fxge/cfx_fxgedevice.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" +#include "xfa/fwl/core/fwl_error.h" + +class CFX_Color; +class CFX_Path; +class CAGG_Graphics; + +using FX_DeviceCap = int32_t; +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 FX_StrokeAlignment { + FX_STROKEALIGNMENT_Center = 0, + FX_STROKEALIGNMENT_Inset = 1, + FX_STROKEALIGNMENT_Outset = 2, + FX_STROKEALIGNMENT_Left = 3, + FX_STROKEALIGNMENT_Right = 4 +}; + +enum FX_HatchStyle { + FX_HATCHSTYLE_Horizontal = 0, + FX_HATCHSTYLE_Vertical = 1, + FX_HATCHSTYLE_ForwardDiagonal = 2, + FX_HATCHSTYLE_BackwardDiagonal = 3, + FX_HATCHSTYLE_Cross = 4, + FX_HATCHSTYLE_DiagonalCross = 5, + FX_HATCHSTYLE_05Percent = 6, + FX_HATCHSTYLE_10Percent = 7, + FX_HATCHSTYLE_20Percent = 8, + FX_HATCHSTYLE_25Percent = 9, + FX_HATCHSTYLE_30Percent = 10, + FX_HATCHSTYLE_40Percent = 11, + FX_HATCHSTYLE_50Percent = 12, + FX_HATCHSTYLE_60Percent = 13, + FX_HATCHSTYLE_70Percent = 14, + FX_HATCHSTYLE_75Percent = 15, + FX_HATCHSTYLE_80Percent = 16, + FX_HATCHSTYLE_90Percent = 17, + FX_HATCHSTYLE_LightDownwardDiagonal = 18, + FX_HATCHSTYLE_LightUpwardDiagonal = 19, + FX_HATCHSTYLE_DarkDownwardDiagonal = 20, + FX_HATCHSTYLE_DarkUpwardDiagonal = 21, + FX_HATCHSTYLE_WideDownwardDiagonal = 22, + FX_HATCHSTYLE_WideUpwardDiagonal = 23, + FX_HATCHSTYLE_LightVertical = 24, + FX_HATCHSTYLE_LightHorizontal = 25, + FX_HATCHSTYLE_NarrowVertical = 26, + FX_HATCHSTYLE_NarrowHorizontal = 27, + FX_HATCHSTYLE_DarkVertical = 28, + FX_HATCHSTYLE_DarkHorizontal = 29, + FX_HATCHSTYLE_DashedDownwardDiagonal = 30, + FX_HATCHSTYLE_DashedUpwardDiagonal = 31, + FX_HATCHSTYLE_DashedHorizontal = 32, + FX_HATCHSTYLE_DashedVertical = 33, + FX_HATCHSTYLE_SmallConfetti = 34, + FX_HATCHSTYLE_LargeConfetti = 35, + FX_HATCHSTYLE_ZigZag = 36, + FX_HATCHSTYLE_Wave = 37, + FX_HATCHSTYLE_DiagonalBrick = 38, + FX_HATCHSTYLE_HorizontalBrick = 39, + FX_HATCHSTYLE_Weave = 40, + FX_HATCHSTYLE_Plaid = 41, + FX_HATCHSTYLE_Divot = 42, + FX_HATCHSTYLE_DottedGrid = 43, + FX_HATCHSTYLE_DottedDiamond = 44, + FX_HATCHSTYLE_Shingle = 45, + FX_HATCHSTYLE_Trellis = 46, + FX_HATCHSTYLE_Sphere = 47, + FX_HATCHSTYLE_SmallGrid = 48, + FX_HATCHSTYLE_SmallCheckerBoard = 49, + FX_HATCHSTYLE_LargeCheckerBoard = 50, + FX_HATCHSTYLE_OutlinedDiamond = 51, + FX_HATCHSTYLE_SolidDiamond = 52 +}; + +class CFX_RenderDevice; + +class CFX_Graphics { + public: + CFX_Graphics(); + virtual ~CFX_Graphics(); + + FWL_Error Create(CFX_RenderDevice* renderDevice, + FX_BOOL isAntialiasing = TRUE); + FWL_Error Create(int32_t width, + int32_t height, + FXDIB_Format format, + FX_BOOL isNative = TRUE, + FX_BOOL isAntialiasing = TRUE); + + FWL_Error GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal); + FWL_Error IsPrinterDevice(FX_BOOL& isPrinter); + FWL_Error EnableAntialiasing(FX_BOOL isAntialiasing); + + FWL_Error SaveGraphState(); + FWL_Error RestoreGraphState(); + + FWL_Error GetLineCap(CFX_GraphStateData::LineCap& lineCap) const; + FWL_Error GetDashCount(int32_t& dashCount) const; + FWL_Error GetLineDash(FX_FLOAT& dashPhase, FX_FLOAT* dashArray) const; + FWL_Error GetLineJoin(CFX_GraphStateData::LineJoin& lineJoin) const; + FWL_Error GetMiterLimit(FX_FLOAT& miterLimit) const; + FWL_Error GetLineWidth(FX_FLOAT& lineWidth) const; + FWL_Error GetStrokeAlignment(FX_StrokeAlignment& strokeAlignment) const; + FWL_Error GetClipRect(CFX_RectF& rect) const; + CFX_Matrix* GetMatrix(); + CFX_RenderDevice* GetRenderDevice(); + + FWL_Error SetLineCap(CFX_GraphStateData::LineCap lineCap); + FWL_Error SetLineDash(FX_FLOAT dashPhase, + FX_FLOAT* dashArray, + int32_t dashCount); + FWL_Error SetLineDash(FX_DashStyle dashStyle); + FWL_Error SetLineJoin(CFX_GraphStateData::LineJoin lineJoin); + FWL_Error SetMiterLimit(FX_FLOAT miterLimit); + FWL_Error SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash = FALSE); + FWL_Error SetStrokeAlignment(FX_StrokeAlignment strokeAlignment); + FWL_Error SetStrokeColor(CFX_Color* color); + FWL_Error SetFillColor(CFX_Color* color); + FWL_Error SetClipRect(const CFX_RectF& rect); + FWL_Error SetFont(CFX_Font* font); + FWL_Error SetFontSize(const FX_FLOAT size); + FWL_Error SetFontHScale(const FX_FLOAT scale); + FWL_Error SetCharSpacing(const FX_FLOAT spacing); + FWL_Error SetTextDrawingMode(const int32_t mode); + + FWL_Error StrokePath(CFX_Path* path, CFX_Matrix* matrix = nullptr); + FWL_Error FillPath(CFX_Path* path, + FX_FillMode fillMode = FXFILL_WINDING, + CFX_Matrix* matrix = nullptr); + FWL_Error ClipPath(CFX_Path* path, + FX_FillMode fillMode = FXFILL_WINDING, + CFX_Matrix* matrix = nullptr); + FWL_Error DrawImage(CFX_DIBSource* source, + const CFX_PointF& point, + CFX_Matrix* matrix = nullptr); + FWL_Error StretchImage(CFX_DIBSource* source, + const CFX_RectF& rect, + CFX_Matrix* matrix = nullptr); + FWL_Error ConcatMatrix(const CFX_Matrix* matrix); + FWL_Error ClearClip(); + FWL_Error ShowText(const CFX_PointF& point, + const CFX_WideString& text, + CFX_Matrix* matrix = nullptr); + FWL_Error CalcTextRect(CFX_RectF& rect, + const CFX_WideString& text, + FX_BOOL isMultiline = FALSE, + CFX_Matrix* matrix = nullptr); + FWL_Error Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix); + FWL_Error Transfer(CFX_Graphics* graphics, + FX_FLOAT srcLeft, + FX_FLOAT srcTop, + const CFX_RectF& dstRect, + const CFX_Matrix* matrix); + + FWL_Error InverseRect(const CFX_RectF& rect); + FWL_Error XorDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect); + FWL_Error EqvDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect); + + protected: + int32_t m_type; + + private: + struct TInfo { + TInfo(); + explicit TInfo(const TInfo& info); + TInfo& operator=(const TInfo& other); + + CFX_GraphStateData graphState; + FX_BOOL isAntialiasing; + FX_StrokeAlignment strokeAlignment; + CFX_Matrix CTM; + FX_BOOL isActOnDash; + CFX_Color* strokeColor; + CFX_Color* fillColor; + CFX_Font* font; + FX_FLOAT fontSize; + FX_FLOAT fontHScale; + FX_FLOAT fontSpacing; + } m_info; + + FWL_Error RenderDeviceSetLineDash(FX_DashStyle dashStyle); + FWL_Error RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix); + FWL_Error RenderDeviceFillPath(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + FWL_Error RenderDeviceDrawImage(CFX_DIBSource* source, + const CFX_PointF& point, + CFX_Matrix* matrix); + FWL_Error RenderDeviceStretchImage(CFX_DIBSource* source, + const CFX_RectF& rect, + CFX_Matrix* matrix); + FWL_Error RenderDeviceShowText(const CFX_PointF& point, + const CFX_WideString& text, + CFX_Matrix* matrix); + + FWL_Error StrokePathWithPattern(CFX_Path* path, CFX_Matrix* matrix); + FWL_Error StrokePathWithShading(CFX_Path* path, CFX_Matrix* matrix); + + FWL_Error FillPathWithPattern(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + FWL_Error FillPathWithShading(CFX_Path* path, + FX_FillMode fillMode, + CFX_Matrix* matrix); + + FWL_Error SetDIBitsWithMatrix(CFX_DIBSource* source, CFX_Matrix* matrix); + FWL_Error CalcTextInfo(const CFX_WideString& text, + uint32_t* charCodes, + FXTEXT_CHARPOS* charPos, + CFX_RectF& rect); + + CFX_RenderDevice* m_renderDevice; + CFX_ArrayTemplate m_infoStack; + std::unique_ptr m_aggGraphics; + friend class CAGG_Graphics; +}; + +#endif // XFA_FXGRAPHICS_CFX_GRAPHICS_H_ diff --git a/xfa/fxgraphics/cfx_path.h b/xfa/fxgraphics/cfx_path.h index 7cd446edcf..8a19d6481f 100644 --- a/xfa/fxgraphics/cfx_path.h +++ b/xfa/fxgraphics/cfx_path.h @@ -10,7 +10,7 @@ #include #include "core/fxcrt/fx_system.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" class CFX_PathData; class CFX_PathGenerator; diff --git a/xfa/fxgraphics/cfx_pattern.h b/xfa/fxgraphics/cfx_pattern.h index 860d346287..ef0008a3ea 100644 --- a/xfa/fxgraphics/cfx_pattern.h +++ b/xfa/fxgraphics/cfx_pattern.h @@ -9,7 +9,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "xfa/fxgraphics/include/cfx_graphics.h" +#include "xfa/fxgraphics/cfx_graphics.h" class CFX_DIBitmap; class CFX_Matrix; diff --git a/xfa/fxgraphics/include/cfx_graphics.h b/xfa/fxgraphics/include/cfx_graphics.h deleted file mode 100644 index 584a5cbac3..0000000000 --- a/xfa/fxgraphics/include/cfx_graphics.h +++ /dev/null @@ -1,242 +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_INCLUDE_CFX_GRAPHICS_H_ -#define XFA_FXGRAPHICS_INCLUDE_CFX_GRAPHICS_H_ - -#include - -#include "core/fxcrt/fx_system.h" -#include "core/fxge/cfx_fxgedevice.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" -#include "xfa/fwl/core/fwl_error.h" - -class CFX_Color; -class CFX_Path; -class CAGG_Graphics; - -using FX_DeviceCap = int32_t; -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 FX_StrokeAlignment { - FX_STROKEALIGNMENT_Center = 0, - FX_STROKEALIGNMENT_Inset = 1, - FX_STROKEALIGNMENT_Outset = 2, - FX_STROKEALIGNMENT_Left = 3, - FX_STROKEALIGNMENT_Right = 4 -}; - -enum FX_HatchStyle { - FX_HATCHSTYLE_Horizontal = 0, - FX_HATCHSTYLE_Vertical = 1, - FX_HATCHSTYLE_ForwardDiagonal = 2, - FX_HATCHSTYLE_BackwardDiagonal = 3, - FX_HATCHSTYLE_Cross = 4, - FX_HATCHSTYLE_DiagonalCross = 5, - FX_HATCHSTYLE_05Percent = 6, - FX_HATCHSTYLE_10Percent = 7, - FX_HATCHSTYLE_20Percent = 8, - FX_HATCHSTYLE_25Percent = 9, - FX_HATCHSTYLE_30Percent = 10, - FX_HATCHSTYLE_40Percent = 11, - FX_HATCHSTYLE_50Percent = 12, - FX_HATCHSTYLE_60Percent = 13, - FX_HATCHSTYLE_70Percent = 14, - FX_HATCHSTYLE_75Percent = 15, - FX_HATCHSTYLE_80Percent = 16, - FX_HATCHSTYLE_90Percent = 17, - FX_HATCHSTYLE_LightDownwardDiagonal = 18, - FX_HATCHSTYLE_LightUpwardDiagonal = 19, - FX_HATCHSTYLE_DarkDownwardDiagonal = 20, - FX_HATCHSTYLE_DarkUpwardDiagonal = 21, - FX_HATCHSTYLE_WideDownwardDiagonal = 22, - FX_HATCHSTYLE_WideUpwardDiagonal = 23, - FX_HATCHSTYLE_LightVertical = 24, - FX_HATCHSTYLE_LightHorizontal = 25, - FX_HATCHSTYLE_NarrowVertical = 26, - FX_HATCHSTYLE_NarrowHorizontal = 27, - FX_HATCHSTYLE_DarkVertical = 28, - FX_HATCHSTYLE_DarkHorizontal = 29, - FX_HATCHSTYLE_DashedDownwardDiagonal = 30, - FX_HATCHSTYLE_DashedUpwardDiagonal = 31, - FX_HATCHSTYLE_DashedHorizontal = 32, - FX_HATCHSTYLE_DashedVertical = 33, - FX_HATCHSTYLE_SmallConfetti = 34, - FX_HATCHSTYLE_LargeConfetti = 35, - FX_HATCHSTYLE_ZigZag = 36, - FX_HATCHSTYLE_Wave = 37, - FX_HATCHSTYLE_DiagonalBrick = 38, - FX_HATCHSTYLE_HorizontalBrick = 39, - FX_HATCHSTYLE_Weave = 40, - FX_HATCHSTYLE_Plaid = 41, - FX_HATCHSTYLE_Divot = 42, - FX_HATCHSTYLE_DottedGrid = 43, - FX_HATCHSTYLE_DottedDiamond = 44, - FX_HATCHSTYLE_Shingle = 45, - FX_HATCHSTYLE_Trellis = 46, - FX_HATCHSTYLE_Sphere = 47, - FX_HATCHSTYLE_SmallGrid = 48, - FX_HATCHSTYLE_SmallCheckerBoard = 49, - FX_HATCHSTYLE_LargeCheckerBoard = 50, - FX_HATCHSTYLE_OutlinedDiamond = 51, - FX_HATCHSTYLE_SolidDiamond = 52 -}; - -class CFX_RenderDevice; - -class CFX_Graphics { - public: - CFX_Graphics(); - virtual ~CFX_Graphics(); - - FWL_Error Create(CFX_RenderDevice* renderDevice, - FX_BOOL isAntialiasing = TRUE); - FWL_Error Create(int32_t width, - int32_t height, - FXDIB_Format format, - FX_BOOL isNative = TRUE, - FX_BOOL isAntialiasing = TRUE); - - FWL_Error GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal); - FWL_Error IsPrinterDevice(FX_BOOL& isPrinter); - FWL_Error EnableAntialiasing(FX_BOOL isAntialiasing); - - FWL_Error SaveGraphState(); - FWL_Error RestoreGraphState(); - - FWL_Error GetLineCap(CFX_GraphStateData::LineCap& lineCap) const; - FWL_Error GetDashCount(int32_t& dashCount) const; - FWL_Error GetLineDash(FX_FLOAT& dashPhase, FX_FLOAT* dashArray) const; - FWL_Error GetLineJoin(CFX_GraphStateData::LineJoin& lineJoin) const; - FWL_Error GetMiterLimit(FX_FLOAT& miterLimit) const; - FWL_Error GetLineWidth(FX_FLOAT& lineWidth) const; - FWL_Error GetStrokeAlignment(FX_StrokeAlignment& strokeAlignment) const; - FWL_Error GetClipRect(CFX_RectF& rect) const; - CFX_Matrix* GetMatrix(); - CFX_RenderDevice* GetRenderDevice(); - - FWL_Error SetLineCap(CFX_GraphStateData::LineCap lineCap); - FWL_Error SetLineDash(FX_FLOAT dashPhase, - FX_FLOAT* dashArray, - int32_t dashCount); - FWL_Error SetLineDash(FX_DashStyle dashStyle); - FWL_Error SetLineJoin(CFX_GraphStateData::LineJoin lineJoin); - FWL_Error SetMiterLimit(FX_FLOAT miterLimit); - FWL_Error SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash = FALSE); - FWL_Error SetStrokeAlignment(FX_StrokeAlignment strokeAlignment); - FWL_Error SetStrokeColor(CFX_Color* color); - FWL_Error SetFillColor(CFX_Color* color); - FWL_Error SetClipRect(const CFX_RectF& rect); - FWL_Error SetFont(CFX_Font* font); - FWL_Error SetFontSize(const FX_FLOAT size); - FWL_Error SetFontHScale(const FX_FLOAT scale); - FWL_Error SetCharSpacing(const FX_FLOAT spacing); - FWL_Error SetTextDrawingMode(const int32_t mode); - - FWL_Error StrokePath(CFX_Path* path, CFX_Matrix* matrix = nullptr); - FWL_Error FillPath(CFX_Path* path, - FX_FillMode fillMode = FXFILL_WINDING, - CFX_Matrix* matrix = nullptr); - FWL_Error ClipPath(CFX_Path* path, - FX_FillMode fillMode = FXFILL_WINDING, - CFX_Matrix* matrix = nullptr); - FWL_Error DrawImage(CFX_DIBSource* source, - const CFX_PointF& point, - CFX_Matrix* matrix = nullptr); - FWL_Error StretchImage(CFX_DIBSource* source, - const CFX_RectF& rect, - CFX_Matrix* matrix = nullptr); - FWL_Error ConcatMatrix(const CFX_Matrix* matrix); - FWL_Error ClearClip(); - FWL_Error ShowText(const CFX_PointF& point, - const CFX_WideString& text, - CFX_Matrix* matrix = nullptr); - FWL_Error CalcTextRect(CFX_RectF& rect, - const CFX_WideString& text, - FX_BOOL isMultiline = FALSE, - CFX_Matrix* matrix = nullptr); - FWL_Error Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix); - FWL_Error Transfer(CFX_Graphics* graphics, - FX_FLOAT srcLeft, - FX_FLOAT srcTop, - const CFX_RectF& dstRect, - const CFX_Matrix* matrix); - - FWL_Error InverseRect(const CFX_RectF& rect); - FWL_Error XorDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect); - FWL_Error EqvDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect); - - protected: - int32_t m_type; - - private: - struct TInfo { - TInfo(); - explicit TInfo(const TInfo& info); - TInfo& operator=(const TInfo& other); - - CFX_GraphStateData graphState; - FX_BOOL isAntialiasing; - FX_StrokeAlignment strokeAlignment; - CFX_Matrix CTM; - FX_BOOL isActOnDash; - CFX_Color* strokeColor; - CFX_Color* fillColor; - CFX_Font* font; - FX_FLOAT fontSize; - FX_FLOAT fontHScale; - FX_FLOAT fontSpacing; - } m_info; - - FWL_Error RenderDeviceSetLineDash(FX_DashStyle dashStyle); - FWL_Error RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix); - FWL_Error RenderDeviceFillPath(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - FWL_Error RenderDeviceDrawImage(CFX_DIBSource* source, - const CFX_PointF& point, - CFX_Matrix* matrix); - FWL_Error RenderDeviceStretchImage(CFX_DIBSource* source, - const CFX_RectF& rect, - CFX_Matrix* matrix); - FWL_Error RenderDeviceShowText(const CFX_PointF& point, - const CFX_WideString& text, - CFX_Matrix* matrix); - - FWL_Error StrokePathWithPattern(CFX_Path* path, CFX_Matrix* matrix); - FWL_Error StrokePathWithShading(CFX_Path* path, CFX_Matrix* matrix); - - FWL_Error FillPathWithPattern(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - FWL_Error FillPathWithShading(CFX_Path* path, - FX_FillMode fillMode, - CFX_Matrix* matrix); - - FWL_Error SetDIBitsWithMatrix(CFX_DIBSource* source, CFX_Matrix* matrix); - FWL_Error CalcTextInfo(const CFX_WideString& text, - uint32_t* charCodes, - FXTEXT_CHARPOS* charPos, - CFX_RectF& rect); - - CFX_RenderDevice* m_renderDevice; - CFX_ArrayTemplate m_infoStack; - std::unique_ptr m_aggGraphics; - friend class CAGG_Graphics; -}; - -#endif // XFA_FXGRAPHICS_INCLUDE_CFX_GRAPHICS_H_ -- cgit v1.2.3