From fe75997a8a8d7fc555d91c3aad595112a46ad7a2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 13 Jul 2017 13:51:04 -0400 Subject: Rename cfx_color to cxfa_color This CL renames CFX_Color to CXFA_Color. The class has some XFA specific things like shadings and patterns in it and doesn't make sense as the colour base class. Change-Id: I1d2230b9f03a1017777ce673419926429b769e7c Reviewed-on: https://pdfium-review.googlesource.com/7752 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fwl/cfwl_caret.h | 2 +- xfa/fwl/cfwl_edit.cpp | 2 +- xfa/fwl/theme/cfwl_carettp.cpp | 8 +++--- xfa/fwl/theme/cfwl_carettp.h | 2 +- xfa/fwl/theme/cfwl_checkboxtp.cpp | 14 +++++------ xfa/fwl/theme/cfwl_comboboxtp.cpp | 6 ++--- xfa/fwl/theme/cfwl_edittp.cpp | 10 ++++---- xfa/fwl/theme/cfwl_listboxtp.cpp | 4 +-- xfa/fwl/theme/cfwl_monthcalendartp.cpp | 34 ++++++++++++------------- xfa/fwl/theme/cfwl_pushbuttontp.cpp | 6 ++--- xfa/fwl/theme/cfwl_scrollbartp.cpp | 16 ++++++------ xfa/fwl/theme/cfwl_widgettp.cpp | 14 +++++------ xfa/fxfa/app/cxfa_fffield.cpp | 6 ++--- xfa/fxfa/app/cxfa_ffline.cpp | 4 +-- xfa/fxfa/app/cxfa_ffpushbutton.cpp | 6 ++--- xfa/fxfa/app/cxfa_fwltheme.cpp | 2 +- xfa/fxfa/cxfa_ffwidget.cpp | 22 ++++++++-------- xfa/fxgraphics/cfx_color.cpp | 46 ---------------------------------- xfa/fxgraphics/cfx_color.h | 43 ------------------------------- xfa/fxgraphics/cfx_graphics.cpp | 6 ++--- xfa/fxgraphics/cfx_graphics.h | 10 ++++---- xfa/fxgraphics/cxfa_color.cpp | 46 ++++++++++++++++++++++++++++++++++ xfa/fxgraphics/cxfa_color.h | 43 +++++++++++++++++++++++++++++++ 23 files changed, 176 insertions(+), 176 deletions(-) delete mode 100644 xfa/fxgraphics/cfx_color.cpp delete mode 100644 xfa/fxgraphics/cfx_color.h create mode 100644 xfa/fxgraphics/cxfa_color.cpp create mode 100644 xfa/fxgraphics/cxfa_color.h (limited to 'xfa') diff --git a/xfa/fwl/cfwl_caret.h b/xfa/fwl/cfwl_caret.h index da0548c2bf..ce692532db 100644 --- a/xfa/fwl/cfwl_caret.h +++ b/xfa/fwl/cfwl_caret.h @@ -11,7 +11,7 @@ #include "xfa/fwl/cfwl_timer.h" #include "xfa/fwl/cfwl_widget.h" -#include "xfa/fxgraphics/cfx_color.h" +#include "xfa/fxgraphics/cxfa_color.h" class CFWL_WidgetProperties; class CFWL_Widget; diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index b0d22c17c4..268bd1a244 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -190,7 +190,7 @@ void CFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics, if (pMatrix) pGraphics->ConcatMatrix(const_cast(pMatrix)); - CFX_Color crLine(0xFFFF0000); + CXFA_Color crLine(0xFFFF0000); CFWL_EventCheckWord checkWordEvent(this); CFX_ByteString sLatinWord; CFX_Path pathSpell; diff --git a/xfa/fwl/theme/cfwl_carettp.cpp b/xfa/fwl/theme/cfwl_carettp.cpp index 4a04f869f4..6d68ba283b 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CFWL_CaretTP::CFWL_CaretTP() {} CFWL_CaretTP::~CFWL_CaretTP() {} @@ -25,7 +25,7 @@ void CFWL_CaretTP::DrawBackground(CFWL_ThemeBackground* pParams) { return; DrawCaretBK(pParams->m_pGraphics, pParams->m_dwStates, - &(pParams->m_rtPart), (CFX_Color*)pParams->m_pData, + &(pParams->m_rtPart), (CXFA_Color*)pParams->m_pData, &(pParams->m_matrix)); break; } @@ -37,7 +37,7 @@ void CFWL_CaretTP::DrawBackground(CFWL_ThemeBackground* pParams) { void CFWL_CaretTP::DrawCaretBK(CFX_Graphics* pGraphics, uint32_t dwStates, const CFX_RectF* pRect, - CFX_Color* crFill, + CXFA_Color* crFill, CFX_Matrix* pMatrix) { CFX_Path path; CFX_RectF rect = *pRect; @@ -45,7 +45,7 @@ void CFWL_CaretTP::DrawCaretBK(CFX_Graphics* pGraphics, if (crFill) { pGraphics->SetFillColor(crFill); } else { - CFX_Color crFilltemp(ArgbEncode(255, 0, 0, 0)); + CXFA_Color crFilltemp(ArgbEncode(255, 0, 0, 0)); pGraphics->SetFillColor(&crFilltemp); } pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); diff --git a/xfa/fwl/theme/cfwl_carettp.h b/xfa/fwl/theme/cfwl_carettp.h index f7d44b7f8e..0491ee7b4e 100644 --- a/xfa/fwl/theme/cfwl_carettp.h +++ b/xfa/fwl/theme/cfwl_carettp.h @@ -21,7 +21,7 @@ class CFWL_CaretTP : public CFWL_WidgetTP { void DrawCaretBK(CFX_Graphics* pGraphics, uint32_t dwStates, const CFX_RectF* pRect, - CFX_Color* crFill, + CXFA_Color* crFill, CFX_Matrix* pMatrix = nullptr); }; diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp index 6386611b54..7e9fc510c6 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" namespace { @@ -67,7 +67,7 @@ void CFWL_CheckBoxTP::DrawSignCheck(CFX_Graphics* pGraphics, mt.SetIdentity(); mt.Translate(pRtSign->left, pRtSign->top); mt.Concat(*pMatrix); - CFX_Color crFill(argbFill); + CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(m_pCheckPath.get(), FXFILL_WINDING, &mt); @@ -80,7 +80,7 @@ void CFWL_CheckBoxTP::DrawSignCircle(CFX_Graphics* pGraphics, CFX_Matrix* pMatrix) { CFX_Path path; path.AddEllipse(*pRtSign); - CFX_Color crFill(argbFill); + CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); @@ -98,7 +98,7 @@ void CFWL_CheckBoxTP::DrawSignCross(CFX_Graphics* pGraphics, path.AddLine(CFX_PointF(pRtSign->left, fBottom), CFX_PointF(fRight, pRtSign->top)); - CFX_Color crFill(argbFill); + CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); pGraphics->SetStrokeColor(&crFill); pGraphics->SetLineWidth(1.0f); @@ -120,7 +120,7 @@ void CFWL_CheckBoxTP::DrawSignDiamond(CFX_Graphics* pGraphics, path.LineTo(CFX_PointF(pRtSign->right(), pRtSign->top + fHeight / 2)); path.LineTo(CFX_PointF(pRtSign->left + fWidth / 2, pRtSign->top)); - CFX_Color crFill(argbFill); + CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); @@ -134,7 +134,7 @@ void CFWL_CheckBoxTP::DrawSignSquare(CFX_Graphics* pGraphics, CFX_Path path; path.AddRectangle(pRtSign->left, pRtSign->top, pRtSign->width, pRtSign->height); - CFX_Color crFill(argbFill); + CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); @@ -171,7 +171,7 @@ void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics* pGraphics, path.LineTo(points[nNext]); } - CFX_Color crFill(argbFill); + CXFA_Color crFill(argbFill); pGraphics->SaveGraphState(); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); diff --git a/xfa/fwl/theme/cfwl_comboboxtp.cpp b/xfa/fwl/theme/cfwl_comboboxtp.cpp index 53a6eae722..0136a2ec87 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CFWL_ComboBoxTP::CFWL_ComboBoxTP() {} @@ -42,7 +42,7 @@ void CFWL_ComboBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) { argb_color = 0xFFFFFFFF; } pParams->m_pGraphics->SaveGraphState(); - CFX_Color cr(argb_color); + CXFA_Color cr(argb_color); pParams->m_pGraphics->SetFillColor(&cr); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, &pParams->m_matrix); pParams->m_pGraphics->RestoreGraphState(); @@ -67,7 +67,7 @@ void CFWL_ComboBoxTP::DrawStrethHandler(CFWL_ThemeBackground* pParams, CFX_Path path; path.AddRectangle(pParams->m_rtPart.left, pParams->m_rtPart.top, pParams->m_rtPart.width - 1, pParams->m_rtPart.height); - CFX_Color cr(ArgbEncode(0xff, 0xff, 0, 0)); + CXFA_Color cr(ArgbEncode(0xff, 0xff, 0, 0)); pParams->m_pGraphics->SetFillColor(&cr); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, &pParams->m_matrix); } diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp index 06cdceb09e..249a15afba 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CFWL_EditTP::CFWL_EditTP() {} @@ -30,7 +30,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { fWidth = edge.GetThickness(); } } - CFX_Color crLine(cr); + CXFA_Color crLine(cr); pParams->m_pGraphics->SetStrokeColor(&crLine); pParams->m_pGraphics->SetLineWidth(fWidth); pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); @@ -46,7 +46,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { if (pParams->m_pPath) { CFX_Graphics* pGraphics = pParams->m_pGraphics; pGraphics->SaveGraphState(); - CFX_Color crSelected(FWLTHEME_COLOR_BKSelected); + CXFA_Color crSelected(FWLTHEME_COLOR_BKSelected); pGraphics->SetFillColor(&crSelected); pGraphics->FillPath(pParams->m_pPath, FXFILL_WINDING, &pParams->m_matrix); @@ -55,7 +55,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { CFX_Path path; path.AddRectangle(pParams->m_rtPart.left, pParams->m_rtPart.top, pParams->m_rtPart.width, pParams->m_rtPart.height); - CFX_Color cr(FWLTHEME_COLOR_Background); + CXFA_Color cr(FWLTHEME_COLOR_Background); if (!pParams->m_bStaticBackground) { if (pParams->m_dwStates & CFWL_PartState_Disabled) cr.Set(FWLTHEME_COLOR_EDGERB1); @@ -75,7 +75,7 @@ void CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { case CFWL_Part::CombTextLine: { FX_ARGB cr = 0xFF000000; float fWidth = 1.0f; - CFX_Color crLine(cr); + CXFA_Color crLine(cr); pParams->m_pGraphics->SetStrokeColor(&crLine); pParams->m_pGraphics->SetLineWidth(fWidth); pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); diff --git a/xfa/fwl/theme/cfwl_listboxtp.cpp b/xfa/fwl/theme/cfwl_listboxtp.cpp index 4e00420df5..6a9231d208 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CFWL_ListBoxTP::CFWL_ListBoxTP() {} @@ -66,7 +66,7 @@ void CFWL_ListBoxTP::DrawListBoxItem(CFX_Graphics* pGraphics, CFX_Matrix* pMatrix) { if (dwStates & CFWL_PartState_Selected) { pGraphics->SaveGraphState(); - CFX_Color crFill(FWLTHEME_COLOR_BKSelected); + CXFA_Color crFill(FWLTHEME_COLOR_BKSelected); pGraphics->SetFillColor(&crFill); CFX_RectF rt(*prtItem); CFX_Path path; diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp index b9961af8b0..2f075ab7b7 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() : m_pThemeData(new MCThemeData) { SetThemeData(); @@ -109,7 +109,7 @@ void CFWL_MonthCalendarTP::DrawTotalBK(CFWL_ThemeBackground* pParams, path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrBK(m_pThemeData->clrBK); + CXFA_Color clrBK(m_pThemeData->clrBK); pParams->m_pGraphics->SetFillColor(&clrBK); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -122,7 +122,7 @@ void CFWL_MonthCalendarTP::DrawHeadBk(CFWL_ThemeBackground* pParams, path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrHeadBK(m_pThemeData->clrBK); + CXFA_Color clrHeadBK(m_pThemeData->clrBK); pParams->m_pGraphics->SetFillColor(&clrHeadBK); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -135,15 +135,15 @@ void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams, path.AddRectangle(rtLBtn.left, rtLBtn.top, rtLBtn.width, rtLBtn.height); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrLBtnEdge(ArgbEncode(0xff, 205, 219, 243)); + CXFA_Color clrLBtnEdge(ArgbEncode(0xff, 205, 219, 243)); pParams->m_pGraphics->SetStrokeColor(&clrLBtnEdge); pParams->m_pGraphics->StrokePath(&path, pMatrix); if (pParams->m_dwStates & CFWL_PartState_Pressed) { - CFX_Color clrLBtnFill(ArgbEncode(0xff, 174, 198, 242)); + CXFA_Color clrLBtnFill(ArgbEncode(0xff, 174, 198, 242)); pParams->m_pGraphics->SetFillColor(&clrLBtnFill); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } else { - CFX_Color clrLBtnFill(ArgbEncode(0xff, 227, 235, 249)); + CXFA_Color clrLBtnFill(ArgbEncode(0xff, 227, 235, 249)); pParams->m_pGraphics->SetFillColor(&clrLBtnFill); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } @@ -156,7 +156,7 @@ void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams, path.LineTo(CFX_PointF(rtLBtn.left + rtLBtn.Width() / 3 * 2, rtLBtn.bottom() - rtLBtn.height / 4)); - CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205)); + CXFA_Color clrFlag(ArgbEncode(0xff, 50, 104, 205)); pParams->m_pGraphics->SetStrokeColor(&clrFlag); pParams->m_pGraphics->StrokePath(&path, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -169,15 +169,15 @@ void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams, path.AddRectangle(rtRBtn.left, rtRBtn.top, rtRBtn.width, rtRBtn.height); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrRBtnEdge(ArgbEncode(0xff, 205, 219, 243)); + CXFA_Color clrRBtnEdge(ArgbEncode(0xff, 205, 219, 243)); pParams->m_pGraphics->SetStrokeColor(&clrRBtnEdge); pParams->m_pGraphics->StrokePath(&path, pMatrix); if (pParams->m_dwStates & CFWL_PartState_Pressed) { - CFX_Color clrRBtnFill(ArgbEncode(0xff, 174, 198, 242)); + CXFA_Color clrRBtnFill(ArgbEncode(0xff, 174, 198, 242)); pParams->m_pGraphics->SetFillColor(&clrRBtnFill); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } else { - CFX_Color clrRBtnFill(ArgbEncode(0xff, 227, 235, 249)); + CXFA_Color clrRBtnFill(ArgbEncode(0xff, 227, 235, 249)); pParams->m_pGraphics->SetFillColor(&clrRBtnFill); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } @@ -190,7 +190,7 @@ void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams, path.LineTo(CFX_PointF(rtRBtn.left + rtRBtn.Width() / 3, rtRBtn.bottom() - rtRBtn.height / 4)); - CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205)); + CXFA_Color clrFlag(ArgbEncode(0xff, 50, 104, 205)); pParams->m_pGraphics->SetStrokeColor(&clrFlag); pParams->m_pGraphics->StrokePath(&path, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -204,7 +204,7 @@ void CFWL_MonthCalendarTP::DrawHSeperator(CFWL_ThemeBackground* pParams, path.LineTo(CFX_PointF(rtHSep.right(), rtHSep.top + rtHSep.height / 2)); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrHSep(m_pThemeData->clrSeperator); + CXFA_Color clrHSep(m_pThemeData->clrSeperator); pParams->m_pGraphics->SetStrokeColor(&clrHSep); pParams->m_pGraphics->StrokePath(&path, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -218,7 +218,7 @@ void CFWL_MonthCalendarTP::DrawWeekNumSep(CFWL_ThemeBackground* pParams, path.LineTo(rtWeekSep.BottomLeft()); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrHSep(m_pThemeData->clrSeperator); + CXFA_Color clrHSep(m_pThemeData->clrSeperator); pParams->m_pGraphics->SetStrokeColor(&clrHSep); pParams->m_pGraphics->StrokePath(&path, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -232,7 +232,7 @@ void CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams, CFX_RectF rtSelDay = pParams->m_rtPart; path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, rtSelDay.height); - CFX_Color clrSelDayBK(m_pThemeData->clrDatesSelectedBK); + CXFA_Color clrSelDayBK(m_pThemeData->clrDatesSelectedBK); pParams->m_pGraphics->SetFillColor(&clrSelDayBK); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } else if (pParams->m_dwStates & CFWL_PartState_Hovered) { @@ -240,7 +240,7 @@ void CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams, CFX_RectF rtSelDay = pParams->m_rtPart; path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, rtSelDay.height); - CFX_Color clrSelDayBK(m_pThemeData->clrDatesHoverBK); + CXFA_Color clrSelDayBK(m_pThemeData->clrDatesHoverBK); pParams->m_pGraphics->SetFillColor(&clrSelDayBK); pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } @@ -254,7 +254,7 @@ void CFWL_MonthCalendarTP::DrawDatesInCircle(CFWL_ThemeBackground* pParams, path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, rtSelDay.height); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrSelDayBK(m_pThemeData->clrDatesCircle); + CXFA_Color clrSelDayBK(m_pThemeData->clrDatesCircle); pParams->m_pGraphics->SetStrokeColor(&clrSelDayBK); pParams->m_pGraphics->StrokePath(&path, pMatrix); pParams->m_pGraphics->RestoreGraphState(); @@ -267,7 +267,7 @@ void CFWL_MonthCalendarTP::DrawTodayCircle(CFWL_ThemeBackground* pParams, path.AddRectangle(rtTodayCircle.left, rtTodayCircle.top, rtTodayCircle.width, rtTodayCircle.height); pParams->m_pGraphics->SaveGraphState(); - CFX_Color clrTodayCircle(m_pThemeData->clrDatesCircle); + CXFA_Color clrTodayCircle(m_pThemeData->clrDatesCircle); pParams->m_pGraphics->SetStrokeColor(&clrTodayCircle); pParams->m_pGraphics->StrokePath(&path, pMatrix); pParams->m_pGraphics->RestoreGraphState(); diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp index 6bb34d0657..3ef5072743 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" #define PUSHBUTTON_SIZE_Corner 2 @@ -67,7 +67,7 @@ void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) { m_pThemeData->clrEnd[iColor], &fillPath, FXFILL_ALTERNATE, &pParams->m_matrix); - CFX_Color crStroke(m_pThemeData->clrBorder[iColor]); + CXFA_Color crStroke(m_pThemeData->clrBorder[iColor]); pGraphics->SetStrokeColor(&crStroke); pGraphics->StrokePath(&strokePath, &pParams->m_matrix); @@ -75,7 +75,7 @@ void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) { fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height); - CFX_Color crFill(m_pThemeData->clrFill[iColor]); + CXFA_Color crFill(m_pThemeData->clrFill[iColor]); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(&fillPath, FXFILL_WINDING, &pParams->m_matrix); if (pParams->m_dwStates & CFWL_PartState_Focused) { diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp index bab9a3f3be..f0063b4a32 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" namespace { @@ -92,7 +92,7 @@ void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics, m_pThemeData->clrBtnBK[eState - 1][0], m_pThemeData->clrBtnBK[eState - 1][1], &path, FXFILL_WINDING, pMatrix); - CFX_Color rcStroke; + CXFA_Color rcStroke; rcStroke.Set(m_pThemeData->clrBtnBorder[eState - 1]); pGraphics->SaveGraphState(); pGraphics->SetStrokeColor(&rcStroke); @@ -108,7 +108,7 @@ void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics, m_pThemeData->clrBtnBK[eState - 1][0], m_pThemeData->clrBtnBK[eState - 1][1], &path, FXFILL_WINDING, pMatrix); - CFX_Color rcStroke; + CXFA_Color rcStroke; rcStroke.Set(m_pThemeData->clrBtnBorder[eState - 1]); pGraphics->SaveGraphState(); pGraphics->SetStrokeColor(&rcStroke); @@ -140,7 +140,7 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics, path.MoveTo(CFX_PointF(fX, fY + 2)); path.LineTo(CFX_PointF(fX + fPawLen, fY + 2)); - CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]); + CXFA_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]); pGraphics->SetLineWidth(1); pGraphics->SetStrokeColor(&clrLight); pGraphics->StrokePath(&path); @@ -156,7 +156,7 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics, path.MoveTo(CFX_PointF(fX, fY + 3)); path.LineTo(CFX_PointF(fX + fPawLen, fY + 3)); - CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]); + CXFA_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]); pGraphics->SetLineWidth(1); pGraphics->SetStrokeColor(&clrDark); pGraphics->StrokePath(&path, pMatrix); @@ -177,7 +177,7 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics, path.MoveTo(CFX_PointF(fX + 2, fY)); path.LineTo(CFX_PointF(fX + 2, fY + fPawLen)); - CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]); + CXFA_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]); pGraphics->SetLineWidth(1); pGraphics->SetStrokeColor(&clrLight); pGraphics->StrokePath(&path, pMatrix); @@ -193,7 +193,7 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics, path.MoveTo(CFX_PointF(fX + 3, fY)); path.LineTo(CFX_PointF(fX + 3, fY + fPawLen)); - CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]); + CXFA_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]); pGraphics->SetLineWidth(1); pGraphics->SetStrokeColor(&clrDark); pGraphics->StrokePath(&path, pMatrix); @@ -210,7 +210,7 @@ void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics, return; pGraphics->SaveGraphState(); - CFX_Color colorLine(ArgbEncode(255, 238, 237, 229)); + CXFA_Color colorLine(ArgbEncode(255, 238, 237, 229)); CFX_Path path; float fRight = pRect->right(); float fBottom = pRect->bottom(); diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index a45716ad6b..07df4fa17c 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_color.h" #include "xfa/fxgraphics/cfx_path.h" #include "xfa/fxgraphics/cfx_shading.h" +#include "xfa/fxgraphics/cxfa_color.h" CFWL_WidgetTP::CFWL_WidgetTP() : m_dwRefCount(1), m_pFDEFont(nullptr), m_pColorData(nullptr) {} @@ -108,7 +108,7 @@ void CFWL_WidgetTP::DrawBorder(CFX_Graphics* pGraphics, path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 2, pRect->height - 2); pGraphics->SaveGraphState(); - CFX_Color crFill(ArgbEncode(255, 0, 0, 0)); + CXFA_Color crFill(ArgbEncode(255, 0, 0, 0)); pGraphics->SetFillColor(&crFill); pGraphics->FillPath(&path, FXFILL_ALTERNATE, pMatrix); pGraphics->RestoreGraphState(); @@ -129,7 +129,7 @@ void CFWL_WidgetTP::FillSoildRect(CFX_Graphics* pGraphics, if (!pRect) return; pGraphics->SaveGraphState(); - CFX_Color crFill(fillColor); + CXFA_Color crFill(fillColor); pGraphics->SetFillColor(&crFill); CFX_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); @@ -154,7 +154,7 @@ void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics* pGraphics, CFX_PointF endPoint(fx2, fy2); CFX_Shading shading(begPoint, endPoint, false, false, beginColor, endColor); pGraphics->SaveGraphState(); - CFX_Color color1(&shading); + CXFA_Color color1(&shading); pGraphics->SetFillColor(&color1); pGraphics->FillPath(path, fillMode, pMatrix); pGraphics->RestoreGraphState(); @@ -168,7 +168,7 @@ void CFWL_WidgetTP::DrawFocus(CFX_Graphics* pGraphics, if (!pRect) return; pGraphics->SaveGraphState(); - CFX_Color cr(0xFF000000); + CXFA_Color cr(0xFF000000); pGraphics->SetStrokeColor(&cr); float DashPattern[2] = {1, 1}; pGraphics->SetLineDash(0.0f, DashPattern, 2); @@ -228,7 +228,7 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics, break; } } - CFX_Color cr(argSign); + CXFA_Color cr(argSign); pGraphics->SetFillColor(&cr); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } @@ -248,7 +248,7 @@ void CFWL_WidgetTP::DrawBtn(CFX_Graphics* pGraphics, m_pColorData->clrEnd[eState - 1], &path, FXFILL_WINDING, pMatrix); - CFX_Color rcStroke; + CXFA_Color rcStroke; rcStroke.Set(m_pColorData->clrBorder[eState - 1]); pGraphics->SetStrokeColor(&rcStroke); pGraphics->StrokePath(&path, pMatrix); diff --git a/xfa/fxfa/app/cxfa_fffield.cpp b/xfa/fxfa/app/cxfa_fffield.cpp index fe56917cb6..09773b6737 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" namespace { @@ -93,7 +93,7 @@ void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, } CXFA_FFDoc* pDoc = GetDoc(); - CFX_Color crHighlight(pDoc->GetDocEnvironment()->GetHighlightColor(pDoc)); + CXFA_Color crHighlight(pDoc->GetDocEnvironment()->GetHighlightColor(pDoc)); pGS->SetFillColor(&crHighlight); CFX_Path path; if (bEllipse) @@ -108,7 +108,7 @@ void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { if (!(m_dwStatus & XFA_WidgetStatus_Focused)) return; - CFX_Color cr(0xFF000000); + CXFA_Color cr(0xFF000000); pGS->SetStrokeColor(&cr); float DashPattern[2] = {1, 1}; diff --git a/xfa/fxfa/app/cxfa_ffline.cpp b/xfa/fxfa/app/cxfa_ffline.cpp index 67ed7ebd1a..dafa660a73 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_color.h" #include "xfa/fxgraphics/cfx_graphics.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CXFA_FFLine::CXFA_FFLine(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} @@ -88,7 +88,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, else linePath.AddLine(rtLine.TopLeft(), rtLine.BottomRight()); - CFX_Color color(lineColor); + CXFA_Color color(lineColor); pGS->SaveGraphState(); pGS->SetLineWidth(fLineWidth, true); XFA_StrokeTypeSetLineDash(pGS, iStrokeType, iCap); diff --git a/xfa/fxfa/app/cxfa_ffpushbutton.cpp b/xfa/fxfa/app/cxfa_ffpushbutton.cpp index 1e784a496e..21e4b977a1 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_color.h" #include "xfa/fxgraphics/cfx_path.h" +#include "xfa/fxgraphics/cxfa_color.h" CXFA_FFPushButton::CXFA_FFPushButton(CXFA_WidgetAcc* pDataAcc) : CXFA_FFField(pDataAcc), m_pOldDelegate(nullptr) {} @@ -213,7 +213,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, CFX_RectF rtFill(0, 0, m_pNormalWidget->GetWidgetRect().Size()); float fLineWith = GetLineWidth(); rtFill.Deflate(fLineWith, fLineWith); - CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255)); + CXFA_Color cr(FXARGB_MAKE(128, 128, 255, 255)); pGraphics->SetFillColor(&cr); CFX_Path path; @@ -227,7 +227,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { float fLineWidth = GetLineWidth(); - CFX_Color cr(FXARGB_MAKE(255, 128, 255, 255)); + CXFA_Color cr(FXARGB_MAKE(255, 128, 255, 255)); pGraphics->SetStrokeColor(&cr); pGraphics->SetLineWidth(fLineWidth); diff --git a/xfa/fxfa/app/cxfa_fwltheme.cpp b/xfa/fxfa/app/cxfa_fwltheme.cpp index 5f8e1dc7dc..fbcbd75b6e 100644 --- a/xfa/fxfa/app/cxfa_fwltheme.cpp +++ b/xfa/fxfa/app/cxfa_fwltheme.cpp @@ -24,7 +24,7 @@ #include "xfa/fwl/cfwl_themetext.h" #include "xfa/fxfa/cxfa_ffapp.h" #include "xfa/fxfa/cxfa_ffwidget.h" -#include "xfa/fxgraphics/cfx_color.h" +#include "xfa/fxgraphics/cxfa_color.h" namespace { diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 0bc808f538..8a9841db2d 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_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/cxfa_color.h" CXFA_FFWidget::CXFA_FFWidget(CXFA_WidgetAcc* pDataAcc) : CXFA_ContentLayoutItem(pDataAcc->GetNode()), @@ -1541,7 +1541,7 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box, rtFill.Height() * rtFill.Height()) / 2, true, true, crStart, crEnd); - CFX_Color cr(&shading); + CXFA_Color cr(&shading); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } @@ -1576,7 +1576,7 @@ static void XFA_BOX_Fill_Pattern(CXFA_Box box, } CFX_Pattern pattern(iHatch, crEnd, crStart); - CFX_Color cr(&pattern, 0x0); + CXFA_Color cr(&pattern, 0x0); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } @@ -1612,7 +1612,7 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box, break; } CFX_Shading shading(ptStart, ptEnd, false, false, crStart, crEnd); - CFX_Color cr(&shading); + CXFA_Color cr(&shading); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } @@ -1655,7 +1655,7 @@ static void XFA_BOX_Fill(CXFA_Box box, } else { cr = fill.GetColor(); } - CFX_Color fillColor(cr); + CXFA_Color fillColor(cr); pGS->SetFillColor(&fillColor); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); } break; @@ -1681,7 +1681,7 @@ static void XFA_BOX_StrokePath(CXFA_Stroke stroke, pGS->SetLineCap(CFX_GraphStateData::LineCapButt); XFA_StrokeTypeSetLineDash(pGS, stroke.GetStrokeType(), XFA_ATTRIBUTEENUM_Butt); - CFX_Color fxColor(stroke.GetColor()); + CXFA_Color fxColor(stroke.GetColor()); pGS->SetStrokeColor(&fxColor); pGS->StrokePath(pPath, pMatrix); pGS->RestoreGraphState(); @@ -1748,7 +1748,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f, FX_PI); - CFX_Color cr(0xFF808080); + CXFA_Color cr(0xFF808080); pGS->SetStrokeColor(&cr); pGS->StrokePath(&arcPath, pMatrix); arcPath.Clear(); @@ -1781,7 +1781,7 @@ static void XFA_Draw3DRect(CFX_Graphics* pGraphic, CFX_Matrix* pMatrix, FX_ARGB argbTopLeft, FX_ARGB argbBottomRight) { - CFX_Color crLT(argbTopLeft); + CXFA_Color crLT(argbTopLeft); pGraphic->SetFillColor(&crLT); float fBottom = rt.bottom(); float fRight = rt.right(); @@ -1795,7 +1795,7 @@ static void XFA_Draw3DRect(CFX_Graphics* pGraphic, pathLT.LineTo(CFX_PointF(rt.left, fBottom)); pGraphic->FillPath(&pathLT, FXFILL_WINDING, pMatrix); - CFX_Color crRB(argbBottomRight); + CXFA_Color crRB(argbBottomRight); pGraphic->SetFillColor(&crRB); CFX_Path pathRB; @@ -1815,7 +1815,7 @@ static void XFA_BOX_Stroke_3DRect_Lowered(CFX_Graphics* pGS, float fHalfWidth = fThickness / 2.0f; CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); - CFX_Color cr(0xFF000000); + CXFA_Color cr(0xFF000000); pGS->SetFillColor(&cr); CFX_Path path; path.AddRectangle(rt.left, rt.top, rt.width, rt.height); @@ -1830,7 +1830,7 @@ static void XFA_BOX_Stroke_3DRect_Raised(CFX_Graphics* pGS, float fHalfWidth = fThickness / 2.0f; CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); - CFX_Color cr(0xFF000000); + CXFA_Color cr(0xFF000000); pGS->SetFillColor(&cr); CFX_Path path; path.AddRectangle(rt.left, rt.top, rt.width, rt.height); diff --git a/xfa/fxgraphics/cfx_color.cpp b/xfa/fxgraphics/cfx_color.cpp deleted file mode 100644 index 36025a82c8..0000000000 --- a/xfa/fxgraphics/cfx_color.cpp +++ /dev/null @@ -1,46 +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_color.h" - -CFX_Color::CFX_Color() : m_type(FX_COLOR_None) {} - -CFX_Color::CFX_Color(const FX_ARGB argb) { - Set(argb); -} - -CFX_Color::CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb) { - Set(pattern, argb); -} - -CFX_Color::CFX_Color(CFX_Shading* shading) { - Set(shading); -} - -CFX_Color::~CFX_Color() { - m_type = FX_COLOR_None; -} - -void CFX_Color::Set(const FX_ARGB argb) { - m_type = FX_COLOR_Solid; - m_info.argb = argb; - m_info.pattern = nullptr; -} - -void CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { - if (!pattern) - return; - m_type = FX_COLOR_Pattern; - m_info.argb = argb; - m_info.pattern = pattern; -} - -void CFX_Color::Set(CFX_Shading* shading) { - if (!shading) - return; - m_type = FX_COLOR_Shading; - m_shading = shading; -} diff --git a/xfa/fxgraphics/cfx_color.h b/xfa/fxgraphics/cfx_color.h deleted file mode 100644 index 75f7fe2010..0000000000 --- a/xfa/fxgraphics/cfx_color.h +++ /dev/null @@ -1,43 +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_COLOR_H_ -#define XFA_FXGRAPHICS_CFX_COLOR_H_ - -#include "core/fxge/fx_dib.h" -#include "xfa/fxgraphics/cfx_graphics.h" - -class CFX_Pattern; -class CFX_Shading; - -enum { FX_COLOR_None = 0, FX_COLOR_Solid, FX_COLOR_Pattern, FX_COLOR_Shading }; - -class CFX_Color { - public: - CFX_Color(); - explicit CFX_Color(const FX_ARGB argb); - explicit CFX_Color(CFX_Shading* shading); - CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb); - virtual ~CFX_Color(); - - void Set(const FX_ARGB argb); - void Set(CFX_Pattern* pattern, const FX_ARGB argb); - void Set(CFX_Shading* shading); - - private: - friend class CFX_Graphics; - - int32_t m_type; - union { - struct { - FX_ARGB argb; - CFX_Pattern* pattern; - } m_info; - CFX_Shading* m_shading; - }; -}; - -#endif // XFA_FXGRAPHICS_CFX_COLOR_H_ diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp index a67932f052..0865221aa9 100644 --- a/xfa/fxgraphics/cfx_graphics.cpp +++ b/xfa/fxgraphics/cfx_graphics.cpp @@ -12,10 +12,10 @@ #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/cfx_unicodeencoding.h" #include "third_party/base/ptr_util.h" -#include "xfa/fxgraphics/cfx_color.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 { @@ -165,7 +165,7 @@ void CFX_Graphics::SetLineWidth(float lineWidth, bool isActOnDash) { } } -void CFX_Graphics::SetStrokeColor(CFX_Color* color) { +void CFX_Graphics::SetStrokeColor(CXFA_Color* color) { if (!color) return; if (m_type == FX_CONTEXT_Device && m_renderDevice) { @@ -173,7 +173,7 @@ void CFX_Graphics::SetStrokeColor(CFX_Color* color) { } } -void CFX_Graphics::SetFillColor(CFX_Color* color) { +void CFX_Graphics::SetFillColor(CXFA_Color* color) { if (!color) return; if (m_type == FX_CONTEXT_Device && m_renderDevice) { diff --git a/xfa/fxgraphics/cfx_graphics.h b/xfa/fxgraphics/cfx_graphics.h index 8785a387d6..0ce9bf4b32 100644 --- a/xfa/fxgraphics/cfx_graphics.h +++ b/xfa/fxgraphics/cfx_graphics.h @@ -17,7 +17,7 @@ #include "core/fxge/fx_dib.h" #include "core/fxge/fx_font.h" -class CFX_Color; +class CXFA_Color; class CFX_Path; using FX_FillMode = int32_t; @@ -57,8 +57,8 @@ class CFX_Graphics { void SetLineDash(float dashPhase, float* dashArray, int32_t dashCount); void SetLineDash(FX_DashStyle dashStyle); void SetLineWidth(float lineWidth, bool isActOnDash = false); - void SetStrokeColor(CFX_Color* color); - void SetFillColor(CFX_Color* color); + 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, @@ -81,8 +81,8 @@ class CFX_Graphics { CFX_GraphStateData graphState; CFX_Matrix CTM; bool isActOnDash; - CFX_Color* strokeColor; - CFX_Color* fillColor; + CXFA_Color* strokeColor; + CXFA_Color* fillColor; } m_info; void RenderDeviceSetLineDash(FX_DashStyle dashStyle); diff --git a/xfa/fxgraphics/cxfa_color.cpp b/xfa/fxgraphics/cxfa_color.cpp new file mode 100644 index 0000000000..27a0cbe569 --- /dev/null +++ b/xfa/fxgraphics/cxfa_color.cpp @@ -0,0 +1,46 @@ +// 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_color.h" + +CXFA_Color::CXFA_Color() : m_type(FX_COLOR_None) {} + +CXFA_Color::CXFA_Color(const FX_ARGB argb) { + Set(argb); +} + +CXFA_Color::CXFA_Color(CFX_Pattern* pattern, const FX_ARGB argb) { + Set(pattern, argb); +} + +CXFA_Color::CXFA_Color(CFX_Shading* shading) { + Set(shading); +} + +CXFA_Color::~CXFA_Color() { + m_type = FX_COLOR_None; +} + +void CXFA_Color::Set(const FX_ARGB argb) { + m_type = FX_COLOR_Solid; + m_info.argb = argb; + m_info.pattern = nullptr; +} + +void CXFA_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { + if (!pattern) + return; + m_type = FX_COLOR_Pattern; + m_info.argb = argb; + m_info.pattern = pattern; +} + +void CXFA_Color::Set(CFX_Shading* shading) { + if (!shading) + return; + m_type = FX_COLOR_Shading; + m_shading = shading; +} diff --git a/xfa/fxgraphics/cxfa_color.h b/xfa/fxgraphics/cxfa_color.h new file mode 100644 index 0000000000..16ef1d7d4d --- /dev/null +++ b/xfa/fxgraphics/cxfa_color.h @@ -0,0 +1,43 @@ +// Copyright 2016 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXGRAPHICS_CXFA_COLOR_H_ +#define XFA_FXGRAPHICS_CXFA_COLOR_H_ + +#include "core/fxge/fx_dib.h" +#include "xfa/fxgraphics/cfx_graphics.h" + +class CFX_Pattern; +class CFX_Shading; + +enum { FX_COLOR_None = 0, FX_COLOR_Solid, FX_COLOR_Pattern, FX_COLOR_Shading }; + +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); + virtual ~CXFA_Color(); + + void Set(const FX_ARGB argb); + void Set(CFX_Pattern* pattern, const FX_ARGB argb); + void Set(CFX_Shading* shading); + + private: + friend class CFX_Graphics; + + int32_t m_type; + union { + struct { + FX_ARGB argb; + CFX_Pattern* pattern; + } m_info; + CFX_Shading* m_shading; + }; +}; + +#endif // XFA_FXGRAPHICS_CXFA_COLOR_H_ -- cgit v1.2.3