Rename fpdfsdk/fpdf* files to be consistent

This CL makes the fpdfsdk/fpdf* files to be consistently prefixed with
fpdf_ instead of randomly dropping the _.

Change-Id: I23e3c8a0831b56bcd17c788d9fe874b2ab8b24fc
Reviewed-on: https://pdfium-review.googlesource.com/29390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index affff2b..a62b028 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -142,27 +142,27 @@
     "fpdfsdk/cpdfsdk_widget.h",
     "fpdfsdk/cpdfsdk_widgethandler.cpp",
     "fpdfsdk/cpdfsdk_widgethandler.h",
+    "fpdfsdk/fpdf_annot.cpp",
+    "fpdfsdk/fpdf_attachment.cpp",
+    "fpdfsdk/fpdf_catalog.cpp",
     "fpdfsdk/fpdf_dataavail.cpp",
+    "fpdfsdk/fpdf_doc.cpp",
+    "fpdfsdk/fpdf_editimg.cpp",
+    "fpdfsdk/fpdf_editpage.cpp",
+    "fpdfsdk/fpdf_editpath.cpp",
+    "fpdfsdk/fpdf_edittext.cpp",
     "fpdfsdk/fpdf_ext.cpp",
     "fpdfsdk/fpdf_flatten.cpp",
+    "fpdfsdk/fpdf_formfill.cpp",
     "fpdfsdk/fpdf_ppo.cpp",
     "fpdfsdk/fpdf_progressive.cpp",
+    "fpdfsdk/fpdf_save.cpp",
     "fpdfsdk/fpdf_searchex.cpp",
     "fpdfsdk/fpdf_structtree.cpp",
     "fpdfsdk/fpdf_sysfontinfo.cpp",
+    "fpdfsdk/fpdf_text.cpp",
     "fpdfsdk/fpdf_transformpage.cpp",
-    "fpdfsdk/fpdfannot.cpp",
-    "fpdfsdk/fpdfattachment.cpp",
-    "fpdfsdk/fpdfcatalog.cpp",
-    "fpdfsdk/fpdfdoc.cpp",
-    "fpdfsdk/fpdfeditimg.cpp",
-    "fpdfsdk/fpdfeditpage.cpp",
-    "fpdfsdk/fpdfeditpath.cpp",
-    "fpdfsdk/fpdfedittext.cpp",
-    "fpdfsdk/fpdfformfill.cpp",
-    "fpdfsdk/fpdfsave.cpp",
-    "fpdfsdk/fpdftext.cpp",
-    "fpdfsdk/fpdfview.cpp",
+    "fpdfsdk/fpdf_view.cpp",
     "fpdfsdk/ipdfsdk_annothandler.h",
     "fpdfsdk/ipdfsdk_pauseadapter.cpp",
     "fpdfsdk/ipdfsdk_pauseadapter.h",
@@ -2914,9 +2914,9 @@
     "core/fxcrt/widestring_unittest.cpp",
     "core/fxge/dib/cfx_dibitmap_unittest.cpp",
     "core/fxge/dib/cstretchengine_unittest.cpp",
-    "fpdfsdk/fpdfcatalog_unittest.cpp",
-    "fpdfsdk/fpdfdoc_unittest.cpp",
-    "fpdfsdk/fpdfeditimg_unittest.cpp",
+    "fpdfsdk/fpdf_catalog_unittest.cpp",
+    "fpdfsdk/fpdf_doc_unittest.cpp",
+    "fpdfsdk/fpdf_editimg_unittest.cpp",
     "testing/unit_test_main.cpp",
   ]
   deps = [
@@ -2989,22 +2989,22 @@
     "core/fxcodec/codec/fx_codec_embeddertest.cpp",
     "core/fxge/fx_ge_text_embeddertest.cpp",
     "fpdfsdk/cba_annotiterator_embeddertest.cpp",
+    "fpdfsdk/fpdf_annot_embeddertest.cpp",
+    "fpdfsdk/fpdf_attachment_embeddertest.cpp",
     "fpdfsdk/fpdf_dataavail_embeddertest.cpp",
+    "fpdfsdk/fpdf_doc_embeddertest.cpp",
+    "fpdfsdk/fpdf_edit_embeddertest.cpp",
+    "fpdfsdk/fpdf_editpath_embeddertest.cpp",
+    "fpdfsdk/fpdf_ext_embeddertest.cpp",
     "fpdfsdk/fpdf_flatten_embeddertest.cpp",
+    "fpdfsdk/fpdf_formfill_embeddertest.cpp",
+    "fpdfsdk/fpdf_ppo_embeddertest.cpp",
+    "fpdfsdk/fpdf_save_embeddertest.cpp",
     "fpdfsdk/fpdf_structtree_embeddertest.cpp",
-    "fpdfsdk/fpdfannot_embeddertest.cpp",
-    "fpdfsdk/fpdfattachment_embeddertest.cpp",
-    "fpdfsdk/fpdfdoc_embeddertest.cpp",
-    "fpdfsdk/fpdfedit_embeddertest.cpp",
-    "fpdfsdk/fpdfeditpath_embeddertest.cpp",
-    "fpdfsdk/fpdfext_embeddertest.cpp",
-    "fpdfsdk/fpdfformfill_embeddertest.cpp",
-    "fpdfsdk/fpdfppo_embeddertest.cpp",
-    "fpdfsdk/fpdfsave_embeddertest.cpp",
-    "fpdfsdk/fpdftext_embeddertest.cpp",
-    "fpdfsdk/fpdfview_c_api_test.c",
-    "fpdfsdk/fpdfview_c_api_test.h",
-    "fpdfsdk/fpdfview_embeddertest.cpp",
+    "fpdfsdk/fpdf_text_embeddertest.cpp",
+    "fpdfsdk/fpdf_view_c_api_test.c",
+    "fpdfsdk/fpdf_view_c_api_test.h",
+    "fpdfsdk/fpdf_view_embeddertest.cpp",
     "fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp",
     "fpdfsdk/pwl/cpwl_edit_embeddertest.cpp",
     "testing/embedder_test.cpp",
diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdf_annot.cpp
similarity index 100%
rename from fpdfsdk/fpdfannot.cpp
rename to fpdfsdk/fpdf_annot.cpp
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdf_annot_embeddertest.cpp
similarity index 99%
rename from fpdfsdk/fpdfannot_embeddertest.cpp
rename to fpdfsdk/fpdf_annot_embeddertest.cpp
index 552398c..b97193d 100644
--- a/fpdfsdk/fpdfannot_embeddertest.cpp
+++ b/fpdfsdk/fpdf_annot_embeddertest.cpp
@@ -1011,12 +1011,13 @@
   EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
   UnloadPage(page);
 
-  // Open the saved annotation.
 #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
   const char md5[] = "4d64e61c9c0f8c60ab3cc3234bb73b1c";
 #else
   const char md5[] = "c96ee1f316d7f5a1b154de9f9d467f01";
 #endif
+
+  // Open the saved annotation.
   OpenSavedDocument();
   page = LoadSavedPage(0);
   VerifySavedRendering(page, 595, 842, md5);
diff --git a/fpdfsdk/fpdfattachment.cpp b/fpdfsdk/fpdf_attachment.cpp
similarity index 100%
rename from fpdfsdk/fpdfattachment.cpp
rename to fpdfsdk/fpdf_attachment.cpp
diff --git a/fpdfsdk/fpdfattachment_embeddertest.cpp b/fpdfsdk/fpdf_attachment_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdfattachment_embeddertest.cpp
rename to fpdfsdk/fpdf_attachment_embeddertest.cpp
diff --git a/fpdfsdk/fpdfcatalog.cpp b/fpdfsdk/fpdf_catalog.cpp
similarity index 100%
rename from fpdfsdk/fpdfcatalog.cpp
rename to fpdfsdk/fpdf_catalog.cpp
diff --git a/fpdfsdk/fpdfcatalog_unittest.cpp b/fpdfsdk/fpdf_catalog_unittest.cpp
similarity index 99%
rename from fpdfsdk/fpdfcatalog_unittest.cpp
rename to fpdfsdk/fpdf_catalog_unittest.cpp
index 13c0634..b00748b 100644
--- a/fpdfsdk/fpdfcatalog_unittest.cpp
+++ b/fpdfsdk/fpdf_catalog_unittest.cpp
@@ -4,6 +4,8 @@
 
 #include "public/fpdf_catalog.h"
 
+#include <memory>
+
 #include "core/fpdfapi/cpdf_modulemgr.h"
 #include "core/fpdfapi/parser/cpdf_document.h"
 #include "core/fpdfapi/parser/cpdf_number.h"
diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdf_doc.cpp
similarity index 100%
rename from fpdfsdk/fpdfdoc.cpp
rename to fpdfsdk/fpdf_doc.cpp
diff --git a/fpdfsdk/fpdfdoc_embeddertest.cpp b/fpdfsdk/fpdf_doc_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdfdoc_embeddertest.cpp
rename to fpdfsdk/fpdf_doc_embeddertest.cpp
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdf_doc_unittest.cpp
similarity index 100%
rename from fpdfsdk/fpdfdoc_unittest.cpp
rename to fpdfsdk/fpdf_doc_unittest.cpp
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp
similarity index 98%
rename from fpdfsdk/fpdfedit_embeddertest.cpp
rename to fpdfsdk/fpdf_edit_embeddertest.cpp
index 7ea22d0..074bb40 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -106,8 +106,8 @@
         size_t inner_idx = 0;
         for (cur_cid = cid; cur_cid < cid + cnt; cur_cid++) {
           uint32_t width = arr->GetNumberAt(inner_idx++);
-          EXPECT_EQ(width, typed_font->GetCharWidthF(cur_cid)) << " at cid "
-                                                               << cur_cid;
+          EXPECT_EQ(width, typed_font->GetCharWidthF(cur_cid))
+              << " at cid " << cur_cid;
         }
         num_cids_checked += cnt;
         continue;
@@ -118,8 +118,8 @@
       ASSERT_FALSE(++idx == widths_array->GetCount());
       uint32_t width = widths_array->GetNumberAt(idx);
       for (cur_cid = cid; cur_cid <= last_cid; cur_cid++) {
-        EXPECT_EQ(width, typed_font->GetCharWidthF(cur_cid)) << " at cid "
-                                                             << cur_cid;
+        EXPECT_EQ(width, typed_font->GetCharWidthF(cur_cid))
+            << " at cid " << cur_cid;
       }
       num_cids_checked += last_cid - cid + 1;
     }
@@ -390,11 +390,11 @@
   // Show what the original file looks like.
   {
 #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
-  const char kOriginalMD5[] = "b90475ca64d1348c3bf5e2b77ad9187a";
+    const char kOriginalMD5[] = "b90475ca64d1348c3bf5e2b77ad9187a";
 #elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
-  const char kOriginalMD5[] = "e5a6fa28298db07484cd922f3e210c88";
+    const char kOriginalMD5[] = "e5a6fa28298db07484cd922f3e210c88";
 #else
-  const char kOriginalMD5[] = "2baa4c0e1758deba1b9c908e1fbd04ed";
+    const char kOriginalMD5[] = "2baa4c0e1758deba1b9c908e1fbd04ed";
 #endif
     std::unique_ptr<void, FPDFBitmapDeleter> page_bitmap =
         RenderPageWithFlags(page, nullptr, 0);
@@ -410,11 +410,11 @@
   // Verify the "Hello, world!" text is gone.
   {
 #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
-  const char kRemovedMD5[] = "af760c4702467cb1492a57fb8215efaa";
+    const char kRemovedMD5[] = "af760c4702467cb1492a57fb8215efaa";
 #elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
-  const char kRemovedMD5[] = "72be917349bf7004a5c39661fe1fc433";
+    const char kRemovedMD5[] = "72be917349bf7004a5c39661fe1fc433";
 #else
-  const char kRemovedMD5[] = "b76df015fe88009c3c342395df96abf1";
+    const char kRemovedMD5[] = "b76df015fe88009c3c342395df96abf1";
 #endif
     std::unique_ptr<void, FPDFBitmapDeleter> page_bitmap =
         RenderPageWithFlags(page, nullptr, 0);
@@ -766,13 +766,13 @@
     std::unique_ptr<void, FPDFBitmapDeleter> page_bitmap =
         RenderPageWithFlags(page, nullptr, 0);
 #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
-  const char md5_2[] = "a5c4ace4c6f27644094813fe1441a21c";
+    const char md5_2[] = "a5c4ace4c6f27644094813fe1441a21c";
 #elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
-  const char md5_2[] = "2587eac9a787e97a37636d54d11bd28d";
+    const char md5_2[] = "2587eac9a787e97a37636d54d11bd28d";
 #else
-  const char md5_2[] = "76fcc7d08aa15445efd2e2ceb7c6cc3b";
+    const char md5_2[] = "76fcc7d08aa15445efd2e2ceb7c6cc3b";
 #endif
-  CompareBitmap(page_bitmap.get(), 612, 792, md5_2);
+    CompareBitmap(page_bitmap.get(), 612, 792, md5_2);
   }
 
   // And some randomly transformed text
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdf_editimg.cpp
similarity index 100%
rename from fpdfsdk/fpdfeditimg.cpp
rename to fpdfsdk/fpdf_editimg.cpp
diff --git a/fpdfsdk/fpdfeditimg_unittest.cpp b/fpdfsdk/fpdf_editimg_unittest.cpp
similarity index 100%
rename from fpdfsdk/fpdfeditimg_unittest.cpp
rename to fpdfsdk/fpdf_editimg_unittest.cpp
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdf_editpage.cpp
similarity index 99%
rename from fpdfsdk/fpdfeditpage.cpp
rename to fpdfsdk/fpdf_editpage.cpp
index 29cad9a..bc494f8 100644
--- a/fpdfsdk/fpdfeditpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -156,7 +156,7 @@
       static_cast<CPDFXFA_Context*>(document), page_index);
   pXFAPage->LoadPDFPage(pPageDict);
   return pXFAPage.Leak();  // Caller takes ownership.
-#else   // PDF_ENABLE_XFA
+#else  // PDF_ENABLE_XFA
   auto pPage = pdfium::MakeUnique<CPDF_Page>(pDoc, pPageDict, true);
   pPage->ParseContent();
   return pPage.release();  // Caller takes ownership.
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdf_editpath.cpp
similarity index 99%
rename from fpdfsdk/fpdfeditpath.cpp
rename to fpdfsdk/fpdf_editpath.cpp
index 745c3b7..2daec67 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdf_editpath.cpp
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <vector>
-
 #include "public/fpdf_edit.h"
 
+#include <vector>
+
 #include "core/fpdfapi/page/cpdf_path.h"
 #include "core/fpdfapi/page/cpdf_pathobject.h"
 #include "core/fxcrt/fx_system.h"
diff --git a/fpdfsdk/fpdfeditpath_embeddertest.cpp b/fpdfsdk/fpdf_editpath_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdfeditpath_embeddertest.cpp
rename to fpdfsdk/fpdf_editpath_embeddertest.cpp
diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdf_edittext.cpp
similarity index 100%
rename from fpdfsdk/fpdfedittext.cpp
rename to fpdfsdk/fpdf_edittext.cpp
diff --git a/fpdfsdk/fpdfext_embeddertest.cpp b/fpdfsdk/fpdf_ext_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdfext_embeddertest.cpp
rename to fpdfsdk/fpdf_ext_embeddertest.cpp
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdf_formfill.cpp
similarity index 100%
rename from fpdfsdk/fpdfformfill.cpp
rename to fpdfsdk/fpdf_formfill.cpp
diff --git a/fpdfsdk/fpdfformfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp
similarity index 99%
rename from fpdfsdk/fpdfformfill_embeddertest.cpp
rename to fpdfsdk/fpdf_formfill_embeddertest.cpp
index 709bc39..99a51fd 100644
--- a/fpdfsdk/fpdfformfill_embeddertest.cpp
+++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp
@@ -285,7 +285,6 @@
   // Selects one of the pre-selected values from a combobox with three options.
   // Options are specified by |item_index|, which is 0-based.
   void SelectOption(int item_index, const CFX_PointF& point) {
-
     // Navigate to button for drop down and click mouse to reveal options.
     ClickOnFormFieldAtPoint(point);
 
diff --git a/fpdfsdk/fpdfppo_embeddertest.cpp b/fpdfsdk/fpdf_ppo_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdfppo_embeddertest.cpp
rename to fpdfsdk/fpdf_ppo_embeddertest.cpp
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdf_save.cpp
similarity index 100%
rename from fpdfsdk/fpdfsave.cpp
rename to fpdfsdk/fpdf_save.cpp
diff --git a/fpdfsdk/fpdfsave_embeddertest.cpp b/fpdfsdk/fpdf_save_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdfsave_embeddertest.cpp
rename to fpdfsdk/fpdf_save_embeddertest.cpp
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdf_text.cpp
similarity index 100%
rename from fpdfsdk/fpdftext.cpp
rename to fpdfsdk/fpdf_text.cpp
diff --git a/fpdfsdk/fpdftext_embeddertest.cpp b/fpdfsdk/fpdf_text_embeddertest.cpp
similarity index 100%
rename from fpdfsdk/fpdftext_embeddertest.cpp
rename to fpdfsdk/fpdf_text_embeddertest.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdf_view.cpp
similarity index 99%
rename from fpdfsdk/fpdfview.cpp
rename to fpdfsdk/fpdf_view.cpp
index 187db9b..a0877f3 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -904,10 +904,11 @@
   if (!pPage)
     return;
 
-  RenderPageImpl(pContext, pPage, pPage->GetDisplayMatrix(
-                                      start_x, start_y, size_x, size_y, rotate),
-                 FX_RECT(start_x, start_y, start_x + size_x, start_y + size_y),
-                 flags, bNeedToRestore, pause);
+  RenderPageImpl(
+      pContext, pPage,
+      pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate),
+      FX_RECT(start_x, start_y, start_x + size_x, start_y + size_y), flags,
+      bNeedToRestore, pause);
 }
 
 FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
diff --git a/fpdfsdk/fpdfview_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c
similarity index 99%
rename from fpdfsdk/fpdfview_c_api_test.c
rename to fpdfsdk/fpdf_view_c_api_test.c
index a0bcc13..df7ade8 100644
--- a/fpdfsdk/fpdfview_c_api_test.c
+++ b/fpdfsdk/fpdf_view_c_api_test.c
@@ -7,7 +7,7 @@
 
 #include <stdio.h>
 
-#include "fpdfsdk/fpdfview_c_api_test.h"
+#include "fpdfsdk/fpdf_view_c_api_test.h"
 
 #include "public/fpdf_annot.h"
 #include "public/fpdf_attachment.h"
diff --git a/fpdfsdk/fpdfview_c_api_test.h b/fpdfsdk/fpdf_view_c_api_test.h
similarity index 74%
rename from fpdfsdk/fpdfview_c_api_test.h
rename to fpdfsdk/fpdf_view_c_api_test.h
index d5b84a2..c662f40 100644
--- a/fpdfsdk/fpdfview_c_api_test.h
+++ b/fpdfsdk/fpdf_view_c_api_test.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef FPDFSDK_FPDFVIEW_C_API_TEST_H_
-#define FPDFSDK_FPDFVIEW_C_API_TEST_H_
+#ifndef FPDFSDK_FPDF_VIEW_C_API_TEST_H_
+#define FPDFSDK_FPDF_VIEW_C_API_TEST_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -17,4 +17,4 @@
 }
 #endif
 
-#endif  // FPDFSDK_FPDFVIEW_C_API_TEST_H_
+#endif  // FPDFSDK_FPDF_VIEW_C_API_TEST_H_
diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdf_view_embeddertest.cpp
similarity index 99%
rename from fpdfsdk/fpdfview_embeddertest.cpp
rename to fpdfsdk/fpdf_view_embeddertest.cpp
index ab76064..0bfa1a3 100644
--- a/fpdfsdk/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/fpdf_view_embeddertest.cpp
@@ -7,7 +7,7 @@
 #include <memory>
 #include <string>
 
-#include "fpdfsdk/fpdfview_c_api_test.h"
+#include "fpdfsdk/fpdf_view_c_api_test.h"
 #include "public/fpdfview.h"
 #include "testing/embedder_test.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/testing/tools/api_check.py b/testing/tools/api_check.py
index ee769bc..c41701e 100755
--- a/testing/tools/api_check.py
+++ b/testing/tools/api_check.py
@@ -7,7 +7,7 @@
 
 This script gathers a list of functions from public/*.h that contain
 FPDF_EXPORT. It then gathers a list of functions from
-fpdfsdk/fpdfview_c_api_test.c. It then verifies both lists do not contain
+fpdfsdk/fpdf_view_c_api_test.c. It then verifies both lists do not contain
 duplicates, and they match each other.
 
 """