summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp13
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp12
-rw-r--r--fpdfsdk/pdfwindow/PWL_Caret.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp16
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.cpp61
7 files changed, 67 insertions, 59 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 01009d25f0..82b9549a1c 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -71,11 +71,14 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
if (!rcFocus.IsEmpty()) {
CFX_PathData path;
path.SetPointCount(5);
- path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
- path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
- path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO);
- path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO);
- path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO);
+ path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_TYPE::LineTo,
+ false);
+ path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_TYPE::LineTo,
+ false);
+ path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_TYPE::LineTo,
+ false);
+ path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_TYPE::LineTo, false);
CFX_GraphStateData gsd;
gsd.SetDashCount(1);
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 13d9756bd8..6d19a6b430 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -247,20 +247,20 @@ void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) {
CFX_ByteString temp;
for (int i = 0; i < pPathData->GetPointCount(); i++) {
buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY);
- int point_type = pPoints[i].m_Flag & FXPT_TYPE;
- if (point_type == FXPT_MOVETO) {
+ FXPT_TYPE point_type = pPoints[i].m_Type;
+ if (point_type == FXPT_TYPE::MoveTo) {
buf << " m\n";
- } else if (point_type == FXPT_BEZIERTO) {
+ } else if (point_type == FXPT_TYPE::BezierTo) {
buf << " " << (pPoints[i + 1].m_PointX) << " "
<< (pPoints[i + 1].m_PointY) << " " << (pPoints[i + 2].m_PointX)
<< " " << (pPoints[i + 2].m_PointY);
- if (pPoints[i + 2].m_Flag & FXPT_CLOSEFIGURE)
+ if (pPoints[i + 2].m_CloseFigure)
buf << " c h\n";
else
buf << " c\n";
i += 2;
- } else if (point_type == FXPT_LINETO) {
- if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE)
+ } else if (point_type == FXPT_TYPE::LineTo) {
+ if (pPoints[i].m_CloseFigure)
buf << " l h\n";
else
buf << " l\n";
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp
index 8a5f539596..6636170e81 100644
--- a/fpdfsdk/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp
@@ -42,14 +42,14 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice,
if (!rcRect.IsEmpty()) {
fCaretTop = rcRect.top;
fCaretBottom = rcRect.bottom;
- path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
- path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
+ path.SetPoint(0, fCaretX, fCaretBottom, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, fCaretX, fCaretTop, FXPT_TYPE::LineTo, false);
} else {
return;
}
} else {
- path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
- path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
+ path.SetPoint(0, fCaretX, fCaretBottom, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, fCaretX, fCaretTop, FXPT_TYPE::LineTo, false);
}
CFX_GraphStateData gsd;
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index 8e9a04b97d..acee850024 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -149,10 +149,10 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_PathData path;
path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index bb8ec9115d..b9958a3128 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -330,12 +330,12 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
i * 2,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
- rcClient.bottom, FXPT_MOVETO);
+ rcClient.bottom, FXPT_TYPE::MoveTo, false);
path.SetPoint(
i * 2 + 1,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
- rcClient.top, FXPT_LINETO);
+ rcClient.top, FXPT_TYPE::LineTo, false);
}
if (path.GetPointCount() > 0) {
pDevice->DrawPath(
@@ -362,12 +362,12 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
i * 2,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
- rcClient.bottom, FXPT_MOVETO);
+ rcClient.bottom, FXPT_TYPE::MoveTo, false);
path.SetPoint(
i * 2 + 1,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
- rcClient.top, FXPT_LINETO);
+ rcClient.top, FXPT_TYPE::LineTo, false);
}
if (path.GetPointCount() > 0) {
pDevice->DrawPath(
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 8a09ac6636..c7e6bbfa99 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -264,10 +264,10 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_PathData path;
path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(
@@ -288,10 +288,10 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_PathData path;
path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_TYPE::LineTo, false);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_TYPE::LineTo, false);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&path, pUser2Device, nullptr,
CPWL_Utils::PWLColorToFXColor(
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index 713a193fb3..f3caf12af9 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -54,15 +54,15 @@ void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path,
switch (pPathData[i].type) {
case PWLPT_MOVETO:
path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y,
- FXPT_MOVETO);
+ FXPT_TYPE::MoveTo, false);
break;
case PWLPT_LINETO:
path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
break;
case PWLPT_BEZIERTO:
path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y,
- FXPT_BEZIERTO);
+ FXPT_TYPE::BezierTo, false);
break;
default:
break;
@@ -1236,9 +1236,9 @@ void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice,
CFX_PathData path;
path.SetPointCount(nCount);
- path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_MOVETO);
+ path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_TYPE::MoveTo, false);
for (int32_t i = 1; i < nCount; i++)
- path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO);
+ path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&path, pUser2Device, nullptr, color, 0, FXFILL_ALTERNATE);
}
@@ -1266,8 +1266,8 @@ void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice,
FX_FLOAT fWidth) {
CFX_PathData path;
path.SetPointCount(2);
- path.SetPoint(0, ptMoveTo.x, ptMoveTo.y, FXPT_MOVETO);
- path.SetPoint(1, ptLineTo.x, ptLineTo.y, FXPT_LINETO);
+ path.SetPoint(0, ptMoveTo.x, ptMoveTo.y, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, ptLineTo.x, ptLineTo.y, FXPT_TYPE::LineTo, false);
CFX_GraphStateData gsd;
gsd.m_LineWidth = fWidth;
@@ -1353,15 +1353,15 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
path.SetPointCount(5);
path.SetPoint(0, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f,
- FXPT_MOVETO);
+ FXPT_TYPE::MoveTo, false);
path.SetPoint(1, fLeft + fWidth / 2.0f, fTop - fWidth / 2.0f,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
path.SetPoint(2, fRight - fWidth / 2.0f, fTop - fWidth / 2.0f,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
path.SetPoint(3, fRight - fWidth / 2.0f, fBottom + fWidth / 2.0f,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
path.SetPoint(4, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
CFX_GraphStateData gsd;
gsd.SetDashCount(2);
@@ -1384,17 +1384,19 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
pathLT.SetPointCount(7);
pathLT.SetPoint(0, fLeft + fHalfWidth, fBottom + fHalfWidth,
- FXPT_MOVETO);
- pathLT.SetPoint(1, fLeft + fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
- pathLT.SetPoint(2, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
+ FXPT_TYPE::MoveTo, false);
+ pathLT.SetPoint(1, fLeft + fHalfWidth, fTop - fHalfWidth,
+ FXPT_TYPE::LineTo, false);
+ pathLT.SetPoint(2, fRight - fHalfWidth, fTop - fHalfWidth,
+ FXPT_TYPE::LineTo, false);
pathLT.SetPoint(3, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathLT.SetPoint(4, fLeft + fHalfWidth * 2, fTop - fHalfWidth * 2,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathLT.SetPoint(5, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathLT.SetPoint(6, fLeft + fHalfWidth, fBottom + fHalfWidth,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&pathLT, pUser2Device, &gsd,
PWLColorToFXColor(crLeftTop, nTransparancy), 0,
@@ -1403,18 +1405,20 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
CFX_PathData pathRB;
pathRB.SetPointCount(7);
- pathRB.SetPoint(0, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_MOVETO);
+ pathRB.SetPoint(0, fRight - fHalfWidth, fTop - fHalfWidth,
+ FXPT_TYPE::MoveTo, false);
pathRB.SetPoint(1, fRight - fHalfWidth, fBottom + fHalfWidth,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathRB.SetPoint(2, fLeft + fHalfWidth, fBottom + fHalfWidth,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathRB.SetPoint(3, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathRB.SetPoint(4, fRight - fHalfWidth * 2, fBottom + fHalfWidth * 2,
- FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
pathRB.SetPoint(5, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2,
- FXPT_LINETO);
- pathRB.SetPoint(6, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
+ FXPT_TYPE::LineTo, false);
+ pathRB.SetPoint(6, fRight - fHalfWidth, fTop - fHalfWidth,
+ FXPT_TYPE::LineTo, false);
pDevice->DrawPath(&pathRB, pUser2Device, &gsd,
PWLColorToFXColor(crRightBottom, nTransparancy), 0,
@@ -1435,8 +1439,9 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
CFX_PathData path;
path.SetPointCount(2);
- path.SetPoint(0, fLeft, fBottom + fWidth / 2, FXPT_MOVETO);
- path.SetPoint(1, fRight, fBottom + fWidth / 2, FXPT_LINETO);
+ path.SetPoint(0, fLeft, fBottom + fWidth / 2, FXPT_TYPE::MoveTo, false);
+ path.SetPoint(1, fRight, fBottom + fWidth / 2, FXPT_TYPE::LineTo,
+ false);
CFX_GraphStateData gsd;
gsd.m_LineWidth = fWidth;