Fix various build/include_order lint errors.
Rename/split some foo_int.h files. Also rename all the "imp" files in
core/ to "impl".
Change-Id: I5128ef1f0284259b12091a8445c97127f8732e68
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/57734
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/cpdf_type1font.cpp b/core/fpdfapi/font/cpdf_type1font.cpp
index 04dd7c2..908d40d 100644
--- a/core/fpdfapi/font/cpdf_type1font.cpp
+++ b/core/fpdfapi/font/cpdf_type1font.cpp
@@ -16,7 +16,7 @@
#include "core/fxge/fx_freetype.h"
#if defined(OS_MACOSX)
-#include "core/fxge/apple/apple_int.h"
+#include "core/fxge/apple/fx_mac_impl.h"
#endif
namespace {
diff --git a/core/fxcrt/fx_unicode.cpp b/core/fxcrt/fx_unicode.cpp
index cbd4f0d..f6f102b 100644
--- a/core/fxcrt/fx_unicode.cpp
+++ b/core/fxcrt/fx_unicode.cpp
@@ -25,7 +25,7 @@
((mirror << kMirrorBitPos) | \
(static_cast<uint16_t>(FX_BIDICLASS::bd) << kBidiClassBitPos)),
constexpr uint16_t kTextLayoutCodeProperties[] = {
-#include "core/fxcrt/fx_ucddata.inc"
+#include "core/fxcrt/fx_ucddata.inc" // NOLINT(build/include)
};
#undef CHARPROP____
@@ -58,7 +58,7 @@
((static_cast<uint16_t>(FX_CHARTYPE::ct) << kCharTypeBitPos) | \
(static_cast<uint16_t>(FX_BREAKPROPERTY::bt) << kBreakTypeBitPos)),
constexpr uint16_t kExtendedTextLayoutCodeProperties[] = {
-#include "core/fxcrt/fx_ucddata.inc"
+#include "core/fxcrt/fx_ucddata.inc" // NOLINT(build/include)
};
#undef CHARPROP____
@@ -129,7 +129,7 @@
#define CHARPROP____(mirror, ct, bd, bt) \
static_assert(mirror == kMirrorMax || mirror < kFXTextLayoutBidiMirrorSize, \
"Bad mirror index");
-#include "core/fxcrt/fx_ucddata.inc"
+#include "core/fxcrt/fx_ucddata.inc" // NOLINT(build/include)
#undef CHARPROP____
} // namespace
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 04742d0..88de3d9 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -154,7 +154,7 @@
"android/cfpf_skiapathfont.h",
"android/cfx_androidfontinfo.cpp",
"android/cfx_androidfontinfo.h",
- "android/fx_android_imp.cpp",
+ "android/fx_android_impl.cpp",
]
}
@@ -164,10 +164,11 @@
if (is_mac) {
sources += [
- "apple/apple_int.h",
"apple/fx_apple_platform.cpp",
- "apple/fx_mac_imp.cpp",
+ "apple/fx_mac_impl.cpp",
+ "apple/fx_mac_impl.h",
"apple/fx_quartz_device.cpp",
+ "apple/fx_quartz_device.h",
]
libs = [ "CoreGraphics.framework" ]
}
diff --git a/core/fxge/android/fx_android_imp.cpp b/core/fxge/android/fx_android_impl.cpp
similarity index 99%
rename from core/fxge/android/fx_android_imp.cpp
rename to core/fxge/android/fx_android_impl.cpp
index 147011c..755de14 100644
--- a/core/fxge/android/fx_android_imp.cpp
+++ b/core/fxge/android/fx_android_impl.cpp
@@ -4,14 +4,13 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "core/fxge/cfx_gemodule.h"
-
#include <memory>
#include <utility>
#include "core/fxge/android/cfpf_skiadevicemodule.h"
#include "core/fxge/android/cfx_androidfontinfo.h"
#include "core/fxge/cfx_fontmgr.h"
+#include "core/fxge/cfx_gemodule.h"
#include "third_party/base/ptr_util.h"
class CAndroidPlatform : public CFX_GEModule::PlatformIface {
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index 96adc88..f87c3dd 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -8,8 +8,7 @@
#include <vector>
#include "core/fxcrt/fx_system.h"
-
-#include "core/fxge/apple/apple_int.h"
+#include "core/fxge/apple/fx_mac_impl.h"
#include "core/fxge/cfx_cliprgn.h"
#include "core/fxge/cfx_font.h"
#include "core/fxge/cfx_gemodule.h"
diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_impl.cpp
similarity index 98%
rename from core/fxge/apple/fx_mac_imp.cpp
rename to core/fxge/apple/fx_mac_impl.cpp
index 64e50cc..957883a 100644
--- a/core/fxge/apple/fx_mac_imp.cpp
+++ b/core/fxge/apple/fx_mac_impl.cpp
@@ -4,14 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/fxge/apple/fx_mac_impl.h"
+
#include <memory>
#include <utility>
#include "core/fxcrt/fx_codepage.h"
-#include "core/fxge/apple/apple_int.h"
#include "core/fxge/cfx_folderfontinfo.h"
#include "core/fxge/cfx_fontmgr.h"
-#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/systemfontinfo_iface.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fxge/apple/fx_mac_impl.h b/core/fxge/apple/fx_mac_impl.h
new file mode 100644
index 0000000..23d0e63
--- /dev/null
+++ b/core/fxge/apple/fx_mac_impl.h
@@ -0,0 +1,24 @@
+// Copyright 2020 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 CORE_FXGE_APPLE_FX_MAC_IMPL_H_
+#define CORE_FXGE_APPLE_FX_MAC_IMPL_H_
+
+#include "core/fxge/apple/fx_quartz_device.h"
+#include "core/fxge/cfx_gemodule.h"
+
+class CApplePlatform : public CFX_GEModule::PlatformIface {
+ public:
+ CApplePlatform();
+ ~CApplePlatform() override;
+
+ // CFX_GEModule::PlatformIface:
+ void Init() override;
+
+ CQuartz2D m_quartz2d;
+};
+
+#endif // CORE_FXGE_APPLE_FX_MAC_IMPL_H_
diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp
index 2281ba5..e272cb1 100644
--- a/core/fxge/apple/fx_quartz_device.cpp
+++ b/core/fxge/apple/fx_quartz_device.cpp
@@ -4,19 +4,19 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/fxge/apple/fx_quartz_device.h"
+
#include "core/fxcrt/fx_extension.h"
-
-#if !defined _SKIA_SUPPORT_ && !defined _SKIA_SUPPORT_PATHS_
-#include "core/fxge/agg/fx_agg_driver.h"
-#endif
-
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_freetype.h"
-#include "core/fxge/apple/apple_int.h"
+#if !defined _SKIA_SUPPORT_ && !defined _SKIA_SUPPORT_PATHS_
+#include "core/fxge/agg/fx_agg_driver.h"
+#endif
+
#ifndef CGFLOAT_IS_DOUBLE
#error Expected CGFLOAT_IS_DOUBLE to be defined by CoreGraphics headers
#endif
diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/fx_quartz_device.h
similarity index 68%
rename from core/fxge/apple/apple_int.h
rename to core/fxge/apple/fx_quartz_device.h
index c58e75c..f702684 100644
--- a/core/fxge/apple/apple_int.h
+++ b/core/fxge/apple/fx_quartz_device.h
@@ -4,18 +4,17 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef CORE_FXGE_APPLE_APPLE_INT_H_
-#define CORE_FXGE_APPLE_APPLE_INT_H_
-
-#include "core/fxcrt/fx_system.h"
+#ifndef CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+#define CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
#include <Carbon/Carbon.h>
+#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_gemodule.h"
-#include "core/fxge/cfx_graphstatedata.h"
-#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/fx_dib.h"
-#include "core/fxge/renderdevicedriver_iface.h"
+
+class CFX_DIBitmap;
+class CFX_Matrix;
class CQuartz2D {
public:
@@ -34,15 +33,4 @@
FX_ARGB argb);
};
-class CApplePlatform : public CFX_GEModule::PlatformIface {
- public:
- CApplePlatform();
- ~CApplePlatform() override;
-
- // CFX_GEModule::PlatformIface:
- void Init() override;
-
- CQuartz2D m_quartz2d;
-};
-
-#endif // CORE_FXGE_APPLE_APPLE_INT_H_
+#endif // CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_