Rename FDE files to match contents.
This CL renames files in xfa/fde to match the contents. The fde_object.h
file is split apart into cfde_pen and cfde_brush.
Change-Id: I953f102182caa6d87c5ee9b99bbeb01c34a01aa9
Reviewed-on: https://pdfium-review.googlesource.com/3371
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index bed74a0..cd3c724 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1299,8 +1299,13 @@
static_library("xfa") {
sources = [
+ "xfa/fde/cfde_brush.h",
"xfa/fde/cfde_path.cpp",
"xfa/fde/cfde_path.h",
+ "xfa/fde/cfde_pen.h",
+ "xfa/fde/cfde_rendercontext.cpp",
+ "xfa/fde/cfde_rendercontext.h",
+ "xfa/fde/cfde_renderdevice.cpp",
"xfa/fde/cfde_txtedtbuf.cpp",
"xfa/fde/cfde_txtedtbuf.h",
"xfa/fde/cfde_txtedtdorecord_deleterange.cpp",
@@ -1315,6 +1320,8 @@
"xfa/fde/cfde_txtedtparag.h",
"xfa/fde/cfde_txtedttextset.cpp",
"xfa/fde/cfde_txtedttextset.h",
+ "xfa/fde/cfde_visualsetiterator.cpp",
+ "xfa/fde/cfde_visualsetiterator.h",
"xfa/fde/cfx_chariter.cpp",
"xfa/fde/cfx_chariter.h",
"xfa/fde/cfx_wordbreak.cpp",
@@ -1358,12 +1365,6 @@
"xfa/fde/css/fde_css.h",
"xfa/fde/css/fde_cssdatatable.cpp",
"xfa/fde/css/fde_cssdatatable.h",
- "xfa/fde/fde_gedevice.cpp",
- "xfa/fde/fde_iterator.cpp",
- "xfa/fde/fde_iterator.h",
- "xfa/fde/fde_object.h",
- "xfa/fde/fde_render.cpp",
- "xfa/fde/fde_render.h",
"xfa/fde/ifde_txtedtdorecord.h",
"xfa/fde/ifde_txtedtengine.h",
"xfa/fde/ifde_txtedtpage.h",
diff --git a/xfa/fde/cfde_brush.h b/xfa/fde/cfde_brush.h
new file mode 100644
index 0000000..7a070c8
--- /dev/null
+++ b/xfa/fde/cfde_brush.h
@@ -0,0 +1,23 @@
+// Copyright 2017 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_FDE_CFDE_BRUSH_H_
+#define XFA_FDE_CFDE_BRUSH_H_
+
+#include "core/fxge/fx_dib.h"
+
+class CFDE_Brush {
+ public:
+ CFDE_Brush() : m_Color(0xFF000000) {}
+
+ FX_ARGB GetColor() const { return m_Color; }
+ void SetColor(FX_ARGB color) { m_Color = color; }
+
+ private:
+ FX_ARGB m_Color;
+};
+
+#endif // XFA_FDE_CFDE_BRUSH_H_
diff --git a/xfa/fde/cfde_path.cpp b/xfa/fde/cfde_path.cpp
index 32f67e3..4afa718 100644
--- a/xfa/fde/cfde_path.cpp
+++ b/xfa/fde/cfde_path.cpp
@@ -7,7 +7,6 @@
#include "xfa/fde/cfde_path.h"
#include "third_party/base/stl_util.h"
-#include "xfa/fde/fde_object.h"
void CFDE_Path::CloseFigure() {
m_Path.ClosePath();
diff --git a/xfa/fde/cfde_pen.h b/xfa/fde/cfde_pen.h
new file mode 100644
index 0000000..ac49571
--- /dev/null
+++ b/xfa/fde/cfde_pen.h
@@ -0,0 +1,24 @@
+// Copyright 2017 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_FDE_CFDE_PEN_H_
+#define XFA_FDE_CFDE_PEN_H_
+
+#include "core/fxge/fx_dib.h"
+
+class CFDE_Pen {
+ public:
+ CFDE_Pen() : m_Color(0) {}
+ ~CFDE_Pen() {}
+
+ FX_ARGB GetColor() const { return m_Color; }
+ void SetColor(FX_ARGB color) { m_Color = color; }
+
+ private:
+ FX_ARGB m_Color;
+};
+
+#endif // XFA_FDE_CFDE_PEN_H_
diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/cfde_rendercontext.cpp
similarity index 96%
rename from xfa/fde/fde_render.cpp
rename to xfa/fde/cfde_rendercontext.cpp
index a502c7b..2e690e0 100644
--- a/xfa/fde/fde_render.cpp
+++ b/xfa/fde/cfde_rendercontext.cpp
@@ -4,12 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fde/fde_render.h"
+#include "xfa/fde/cfde_rendercontext.h"
#include "third_party/base/ptr_util.h"
+#include "xfa/fde/cfde_brush.h"
+#include "xfa/fde/cfde_renderdevice.h"
#include "xfa/fde/cfde_txtedttextset.h"
-#include "xfa/fde/fde_gedevice.h"
-#include "xfa/fde/fde_object.h"
#define FDE_PATHRENDER_Stroke 1
#define FDE_PATHRENDER_Fill 2
@@ -126,4 +126,3 @@
m_pRenderDevice->DrawString(m_pBrush.get(), pFont, m_CharPos.data(), iCount,
fFontSize, &m_Transform);
}
-
diff --git a/xfa/fde/fde_render.h b/xfa/fde/cfde_rendercontext.h
similarity index 83%
rename from xfa/fde/fde_render.h
rename to xfa/fde/cfde_rendercontext.h
index ba56754..28b8780 100644
--- a/xfa/fde/fde_render.h
+++ b/xfa/fde/cfde_rendercontext.h
@@ -4,16 +4,16 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FDE_FDE_RENDER_H_
-#define XFA_FDE_FDE_RENDER_H_
+#ifndef XFA_FDE_CFDE_RENDERCONTEXT_H_
+#define XFA_FDE_CFDE_RENDERCONTEXT_H_
#include <memory>
#include <vector>
#include "core/fxcrt/fx_coordinates.h"
-#include "xfa/fde/fde_gedevice.h"
-#include "xfa/fde/fde_iterator.h"
-#include "xfa/fde/fde_visualset.h"
+#include "xfa/fde/cfde_renderdevice.h"
+#include "xfa/fde/cfde_visualsetiterator.h"
+#include "xfa/fde/ifde_visualset.h"
class CFDE_RenderDevice;
class CFDE_TxtEdtTextSet;
@@ -47,4 +47,4 @@
std::unique_ptr<CFDE_VisualSetIterator> m_pIterator;
};
-#endif // XFA_FDE_FDE_RENDER_H_
+#endif // XFA_FDE_CFDE_RENDERCONTEXT_H_
diff --git a/xfa/fde/fde_gedevice.cpp b/xfa/fde/cfde_renderdevice.cpp
similarity index 98%
rename from xfa/fde/fde_gedevice.cpp
rename to xfa/fde/cfde_renderdevice.cpp
index 8af769a..d3456e1 100644
--- a/xfa/fde/fde_gedevice.cpp
+++ b/xfa/fde/cfde_renderdevice.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fde/fde_gedevice.h"
+#include "xfa/fde/cfde_renderdevice.h"
#include <algorithm>
#include <memory>
@@ -13,8 +13,9 @@
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_substfont.h"
+#include "xfa/fde/cfde_brush.h"
#include "xfa/fde/cfde_path.h"
-#include "xfa/fde/fde_object.h"
+#include "xfa/fde/cfde_pen.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
#include "xfa/fgas/font/cfgas_gefont.h"
@@ -352,4 +353,3 @@
return m_pDevice->DrawPath(&pGePath->m_Path, pMatrix, nullptr,
pBrush->GetColor(), 0, FXFILL_WINDING);
}
-
diff --git a/xfa/fde/fde_gedevice.h b/xfa/fde/cfde_renderdevice.h
similarity index 97%
rename from xfa/fde/fde_gedevice.h
rename to xfa/fde/cfde_renderdevice.h
index a3a1eaf..f429ac1 100644
--- a/xfa/fde/fde_gedevice.h
+++ b/xfa/fde/cfde_renderdevice.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FDE_FDE_GEDEVICE_H_
-#define XFA_FDE_FDE_GEDEVICE_H_
+#ifndef XFA_FDE_CFDE_RENDERDEVICE_H_
+#define XFA_FDE_CFDE_RENDERDEVICE_H_
#include <vector>
@@ -124,4 +124,4 @@
int32_t m_iCharCount;
};
-#endif // XFA_FDE_FDE_GEDEVICE_H_
+#endif // XFA_FDE_CFDE_RENDERDEVICE_H_
diff --git a/xfa/fde/cfde_txtedtpage.h b/xfa/fde/cfde_txtedtpage.h
index 2cae7ce..699a908 100644
--- a/xfa/fde/cfde_txtedtpage.h
+++ b/xfa/fde/cfde_txtedtpage.h
@@ -11,7 +11,7 @@
#include <memory>
#include <vector>
-#include "xfa/fde/fde_visualset.h"
+#include "xfa/fde/ifde_visualset.h"
#include "xfa/fde/ifx_chariter.h"
class CFDE_TxtEdtEngine;
diff --git a/xfa/fde/cfde_txtedttextset.h b/xfa/fde/cfde_txtedttextset.h
index 35f7472..8e4c4d0 100644
--- a/xfa/fde/cfde_txtedttextset.h
+++ b/xfa/fde/cfde_txtedttextset.h
@@ -9,7 +9,7 @@
#include <vector>
-#include "xfa/fde/fde_visualset.h"
+#include "xfa/fde/ifde_visualset.h"
class CFDE_TxtEdtPage;
diff --git a/xfa/fde/fde_iterator.cpp b/xfa/fde/cfde_visualsetiterator.cpp
similarity index 97%
rename from xfa/fde/fde_iterator.cpp
rename to xfa/fde/cfde_visualsetiterator.cpp
index ff4fc0e..5fd84ed 100644
--- a/xfa/fde/fde_iterator.cpp
+++ b/xfa/fde/cfde_visualsetiterator.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fde/fde_iterator.h"
+#include "xfa/fde/cfde_visualsetiterator.h"
#include "xfa/fde/cfde_txtedtpage.h"
diff --git a/xfa/fde/fde_iterator.h b/xfa/fde/cfde_visualsetiterator.h
similarity index 84%
rename from xfa/fde/fde_iterator.h
rename to xfa/fde/cfde_visualsetiterator.h
index 99f9597..a8e311a 100644
--- a/xfa/fde/fde_iterator.h
+++ b/xfa/fde/cfde_visualsetiterator.h
@@ -4,12 +4,12 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FDE_FDE_ITERATOR_H_
-#define XFA_FDE_FDE_ITERATOR_H_
+#ifndef XFA_FDE_CFDE_VISUALSETITERATOR_H_
+#define XFA_FDE_CFDE_VISUALSETITERATOR_H_
#include <stack>
-#include "xfa/fde/fde_visualset.h"
+#include "xfa/fde/ifde_visualset.h"
class CFDE_TxtEdtPage;
@@ -37,4 +37,4 @@
std::stack<FDE_CANVASITEM> m_CanvasStack;
};
-#endif // XFA_FDE_FDE_ITERATOR_H_
+#endif // XFA_FDE_CFDE_VISUALSETITERATOR_H_
diff --git a/xfa/fde/fde_object.h b/xfa/fde/fde_object.h
deleted file mode 100644
index 5c66b20..0000000
--- a/xfa/fde/fde_object.h
+++ /dev/null
@@ -1,37 +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_FDE_FDE_OBJECT_H_
-#define XFA_FDE_FDE_OBJECT_H_
-
-#include <cstdint>
-
-#include "core/fxge/fx_dib.h"
-
-class CFDE_Brush {
- public:
- CFDE_Brush() : m_Color(0xFF000000) {}
-
- FX_ARGB GetColor() const { return m_Color; }
- void SetColor(FX_ARGB color) { m_Color = color; }
-
- private:
- FX_ARGB m_Color;
-};
-
-class CFDE_Pen {
- public:
- CFDE_Pen() : m_Color(0) {}
- ~CFDE_Pen() {}
-
- FX_ARGB GetColor() const { return m_Color; }
- void SetColor(FX_ARGB color) { m_Color = color; }
-
- private:
- FX_ARGB m_Color;
-};
-
-#endif // XFA_FDE_FDE_OBJECT_H_
diff --git a/xfa/fde/fde_visualset.h b/xfa/fde/ifde_visualset.h
similarity index 90%
rename from xfa/fde/fde_visualset.h
rename to xfa/fde/ifde_visualset.h
index e9ee9ab..144475f 100644
--- a/xfa/fde/fde_visualset.h
+++ b/xfa/fde/ifde_visualset.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FDE_FDE_VISUALSET_H_
-#define XFA_FDE_FDE_VISUALSET_H_
+#ifndef XFA_FDE_IFDE_VISUALSET_H_
+#define XFA_FDE_IFDE_VISUALSET_H_
#include <vector>
@@ -14,7 +14,6 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxge/fx_dib.h"
#include "xfa/fde/cfde_path.h"
-#include "xfa/fde/fde_object.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
class FXTEXT_CHARPOS;
@@ -47,4 +46,4 @@
virtual CFX_RectF GetRect(const FDE_TEXTEDITPIECE& hVisualObj) = 0;
};
-#endif // XFA_FDE_FDE_VISUALSET_H_
+#endif // XFA_FDE_IFDE_VISUALSET_H_
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index c06a12f..c036c77 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -12,13 +12,16 @@
#include "core/fxcrt/fx_system.h"
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
+#include "xfa/fde/cfde_brush.h"
#include "xfa/fde/cfde_path.h"
-#include "xfa/fde/fde_gedevice.h"
-#include "xfa/fde/fde_object.h"
+#include "xfa/fde/cfde_pen.h"
+#include "xfa/fde/cfde_renderdevice.h"
#include "xfa/fgas/layout/fgas_textbreak.h"
FDE_TTOPIECE::FDE_TTOPIECE() = default;
+
FDE_TTOPIECE::FDE_TTOPIECE(const FDE_TTOPIECE& that) = default;
+
FDE_TTOPIECE::~FDE_TTOPIECE() = default;
CFDE_TextOut::CFDE_TextOut()
diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h
index e48e255..2ca7721 100644
--- a/xfa/fde/tto/fde_textout.h
+++ b/xfa/fde/tto/fde_textout.h
@@ -15,7 +15,6 @@
#include "core/fxge/cfx_fxgedevice.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/fx_dib.h"
-#include "xfa/fde/fde_object.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
#define FDE_TTOSTYLE_Underline 0x0001
@@ -38,6 +37,7 @@
#define FDE_TTOALIGNMENT_BottomRight 10
#define FDE_TTOALIGNMENT_BottomAuto 11
+class CFDE_Pen;
class CFDE_RenderDevice;
class CFX_RenderDevice;
class CFX_TxtBreak;
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 4af2eb0..e05f251 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -13,10 +13,10 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
+#include "xfa/fde/cfde_rendercontext.h"
+#include "xfa/fde/cfde_renderdevice.h"
#include "xfa/fde/cfde_txtedtengine.h"
#include "xfa/fde/cfde_txtedtpage.h"
-#include "xfa/fde/fde_gedevice.h"
-#include "xfa/fde/fde_render.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_caret.h"
diff --git a/xfa/fxfa/app/cxfa_textlayout.cpp b/xfa/fxfa/app/cxfa_textlayout.cpp
index c547197..c8ed4f7 100644
--- a/xfa/fxfa/app/cxfa_textlayout.cpp
+++ b/xfa/fxfa/app/cxfa_textlayout.cpp
@@ -11,11 +11,12 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
+#include "xfa/fde/cfde_brush.h"
#include "xfa/fde/cfde_path.h"
+#include "xfa/fde/cfde_pen.h"
+#include "xfa/fde/cfde_renderdevice.h"
#include "xfa/fde/css/cfde_csscomputedstyle.h"
#include "xfa/fde/css/cfde_cssstyleselector.h"
-#include "xfa/fde/fde_gedevice.h"
-#include "xfa/fde/fde_object.h"
#include "xfa/fde/xml/fde_xml_imp.h"
#include "xfa/fxfa/app/cxfa_linkuserdata.h"
#include "xfa/fxfa/app/cxfa_loadercontext.h"
diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp
index 0066086..49033bc 100644
--- a/xfa/fxfa/cxfa_ffpageview.cpp
+++ b/xfa/fxfa/cxfa_ffpageview.cpp
@@ -12,7 +12,7 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-#include "xfa/fde/fde_render.h"
+#include "xfa/fde/cfde_rendercontext.h"
#include "xfa/fxfa/app/xfa_ffcheckbutton.h"
#include "xfa/fxfa/app/xfa_ffchoicelist.h"
#include "xfa/fxfa/app/xfa_fffield.h"