Create top-level public/ header directory.

These are the only files that embedders of PDFium should be including.
They are entirely self-contained, and compile cleanly against -Wall so
as to not offend the code that may include them.

Having done this, we can see that chromium is pulling in two additional
files from the fpdfsdk/include/pdfwindow directory, which is not guaranteed
to work.

A few files are renamed, adding an "_" to make the names consistent.
The exception is fpdfview, which is doc'd as such in the doc.

Naturally, paths will need updating in a handful of files in chrome
when this rolls in.

BUG=pdfium:154
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1135913002
diff --git a/BUILD.gn b/BUILD.gn
index edfaf2f..72246e5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -47,19 +47,6 @@
 
 static_library("pdfium") {
   sources = [
-    "fpdfsdk/include/fpdf_dataavail.h",
-    "fpdfsdk/include/fpdf_ext.h",
-    "fpdfsdk/include/fpdf_flatten.h",
-    "fpdfsdk/include/fpdf_progressive.h",
-    "fpdfsdk/include/fpdf_searchex.h",
-    "fpdfsdk/include/fpdf_sysfontinfo.h",
-    "fpdfsdk/include/fpdf_sysfontinfo.h",
-    "fpdfsdk/include/fpdf_transformpage.h",
-    "fpdfsdk/include/fpdfdoc.h",
-    "fpdfsdk/include/fpdfedit.h",
-    "fpdfsdk/include/fpdfformfill.h",
-    "fpdfsdk/include/fpdftext.h",
-    "fpdfsdk/include/fpdfview.h",
     "fpdfsdk/include/fsdk_actionhandler.h",
     "fpdfsdk/include/fsdk_annothandler.h",
     "fpdfsdk/include/fsdk_baseannot.h",
@@ -87,6 +74,21 @@
     "fpdfsdk/src/fsdk_mgr.cpp",
     "fpdfsdk/src/fsdk_rendercontext.cpp",
     "fpdfsdk/src/resource.h",
+    "public/fpdf_dataavail.h",
+    "public/fpdf_doc.h",
+    "public/fpdf_edit.h",
+    "public/fpdf_ext.h",
+    "public/fpdf_flatten.h",
+    "public/fpdf_formfill.h",
+    "public/fpdf_fwlevent.h",
+    "public/fpdf_ppo.h",
+    "public/fpdf_progressive.h",
+    "public/fpdf_save.h",
+    "public/fpdf_searchex.h",
+    "public/fpdf_sysfontinfo.h",
+    "public/fpdf_text.h",
+    "public/fpdf_transformpage.h",
+    "public/fpdfview.h",
   ]
 
   libs = []
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
index 2769f3c..45caf4e 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp
@@ -5,7 +5,7 @@
 #include <cstring>
 #include <string>
 
-#include "../../../../fpdfsdk/include/fpdfview.h"
+#include "../../../../public/fpdfview.h"
 #include "../../../../testing/fx_string_testhelpers.h"
 #include "../../../include/fpdfapi/fpdf_parser.h"
 #include "../../../include/fxcrt/fx_basic.h"
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 2dee672..13cdbd2 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -65,7 +65,7 @@
 
 typedef unsigned int FX_UINT;	
 
-#include "fpdfview.h"
+#include "../../public/fpdfview.h"
 
 class CPDF_CustomAccess FX_FINAL : public IFX_FileRead
 {
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index a25eb94..fa94371 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -7,19 +7,16 @@
 #ifndef _FPDFSDK_MGR_H
 #define _FPDFSDK_MGR_H
 
+#include "../../public/fpdf_formfill.h"
+#include "../../public/fpdf_fwlevent.h" // cross platform keycode and events define.
 #include "fsdk_common.h"
 #include "fsdk_define.h"
 #include "fx_systemhandler.h"
 #include "fsdk_baseannot.h"
 #include "fsdk_baseform.h"
-#include "fpdfformfill.h"
 #include "fsdk_annothandler.h"
 #include "fsdk_actionhandler.h"
 
-//cross platform keycode and events define.
-#include "fpdf_fwlevent.h"
-
-
 class CPDFSDK_Document;
 class CPDFSDK_PageView;
 class CPDFSDK_Annot;
diff --git a/fpdfsdk/include/fsdk_rendercontext.h b/fpdfsdk/include/fsdk_rendercontext.h
index 94ad48e..dfc9f5e 100644
--- a/fpdfsdk/include/fsdk_rendercontext.h
+++ b/fpdfsdk/include/fsdk_rendercontext.h
@@ -6,8 +6,9 @@
 
 #ifndef _RENDERCONTENT_H_
 #define _RENDERCONTENT_H_
+
+#include "../../public/fpdf_progressive.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_progressive.h"
 
 // Everything about rendering is put here: for OOM recovery
 class CRenderContext 
diff --git a/fpdfsdk/include/pdfwindow/PDFWindow.h b/fpdfsdk/include/pdfwindow/PDFWindow.h
index a83be41..a26c57d 100644
--- a/fpdfsdk/include/pdfwindow/PDFWindow.h
+++ b/fpdfsdk/include/pdfwindow/PDFWindow.h
@@ -19,7 +19,7 @@
 	#include "../../../core/include/fpdfdoc/fpdf_vt.h" 
 	#include "../../../core/include/fxcrt/fx_xml.h" 
 
-	#include "../fpdf_fwlevent.h"
+	#include "../../../public/fpdf_fwlevent.h"
 	#include "../fx_systemhandler.h"
 #endif
 
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 0f9e956..f31685f 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_dataavail.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_dataavail.h"
 
 extern void ProcessParseError(FX_DWORD err_code);
 class CFPDF_FileAvailWrap : public IFX_FileAvail
diff --git a/fpdfsdk/src/fpdf_dataavail_embeddertest.cpp b/fpdfsdk/src/fpdf_dataavail_embeddertest.cpp
index 6081fa5..3207802 100644
--- a/fpdfsdk/src/fpdf_dataavail_embeddertest.cpp
+++ b/fpdfsdk/src/fpdf_dataavail_embeddertest.cpp
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "../../public/fpdf_doc.h"
+#include "../../public/fpdfview.h"
 #include "../../testing/embedder_test.h"
-#include "../../fpdfsdk/include/fpdfview.h"
-#include "../../fpdfsdk/include/fpdfdoc.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 class FPDFDataAvailEmbeddertest : public EmbedderTest {
diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp
index c454756..2dc8d78 100644
--- a/fpdfsdk/src/fpdf_ext.cpp
+++ b/fpdfsdk/src/fpdf_ext.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_ext.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_ext.h"
 
 #define  FPDFSDK_UNSUPPORT_CALL 100
 
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index 51e208f..4fea6a9 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_flatten.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_flatten.h"
 
 typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray;
 typedef CFX_ArrayTemplate<CPDF_Rect> CPDF_RectArray;
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index 6b433a2..a5d6c13 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -4,9 +4,9 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../include/fpdf_progressive.h"
+#include "../../public/fpdf_progressive.h"
+#include "../../public/fpdfview.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdfview.h"
 #include "../include/fsdk_rendercontext.h"
 
 extern void (*Func_RenderPage)( CRenderContext*, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
diff --git a/fpdfsdk/src/fpdf_searchex.cpp b/fpdfsdk/src/fpdf_searchex.cpp
index 21831a3..4384cdc 100644
--- a/fpdfsdk/src/fpdf_searchex.cpp
+++ b/fpdfsdk/src/fpdf_searchex.cpp
@@ -4,9 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_searchex.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_searchex.h"
-
 
 DLLEXPORT int STDCALL  FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex)
 {
diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp
index e916b12..9be2fe9 100644
--- a/fpdfsdk/src/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_sysfontinfo.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_sysfontinfo.h"
 
 class CSysFontInfo_Ext FX_FINAL : public IFX_SystemFontInfo
 {
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index cfe1688..613bae1 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_transformpage.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdf_transformpage.h"
 
 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top)
 {
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index 52d88b2..b89ce26 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -5,7 +5,7 @@
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
 #include "../include/fsdk_define.h"
-#include "../include/fpdfdoc.h"
+#include "../../public/fpdf_doc.h"
 
 static int THISMODULE = 0;
 
diff --git a/fpdfsdk/src/fpdfdoc_embeddertest.cpp b/fpdfsdk/src/fpdfdoc_embeddertest.cpp
index dadaf1d..1f11bef 100644
--- a/fpdfsdk/src/fpdfdoc_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfdoc_embeddertest.cpp
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "../../public/fpdf_doc.h"
+#include "../../public/fpdfview.h"
 #include "../../testing/embedder_test.h"
-#include "../../fpdfsdk/include/fpdfview.h"
-#include "../../fpdfsdk/include/fpdfdoc.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 class FPDFDocEmbeddertest : public EmbedderTest {
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp
index 6e7e196..f06564e 100644
--- a/fpdfsdk/src/fpdfeditimg.cpp
+++ b/fpdfsdk/src/fpdfeditimg.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_edit.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdfedit.h"
 
 
 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document)
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index e7c8db8..e13c480 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_edit.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdfedit.h"
 
 
 #if _FX_OS_ == _FX_ANDROID_
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 0f94733..304226f 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../include/fpdfview.h"
-#include "../include/fpdfformfill.h"
+#include "../../public/fpdf_formfill.h"
+#include "../../public/fpdfview.h"
 #include "../include/fsdk_define.h"
 #include "../include/fsdk_mgr.h"
 
diff --git a/fpdfsdk/src/fpdfformfill_embeddertest.cpp b/fpdfsdk/src/fpdfformfill_embeddertest.cpp
index 3fe34d5..7c3988c 100644
--- a/fpdfsdk/src/fpdfformfill_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfformfill_embeddertest.cpp
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 
-#include "../../fpdfsdk/include/fpdfformfill.h"
+#include "../../public/fpdf_formfill.h"
 #include "../../testing/embedder_test.h"
 #include "../../testing/embedder_test_mock_delegate.h"
 #include "testing/gmock/include/gmock/gmock.h"
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index c68ae68..e8bd76d 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -4,7 +4,7 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../include/fpdfppo.h"
+#include "../../public/fpdf_ppo.h"
 #include "../include/fsdk_define.h"
 
 class CPDF_PageOrganizer
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 45dfbf7..68b9b4c 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -4,9 +4,10 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_edit.h"
+#include "../../public/fpdf_save.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdfsave.h"
-#include "../include/fpdfedit.h"
+
 #if _FX_OS_ == _FX_ANDROID_
 #include "time.h"
 #else
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 63de443..a25b153 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -4,8 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_text.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdftext.h"
 
 #ifdef _WIN32
 #include <tchar.h>
diff --git a/fpdfsdk/src/fpdftext_embeddertest.cpp b/fpdfsdk/src/fpdftext_embeddertest.cpp
index f0d9feb..394e1a9 100644
--- a/fpdfsdk/src/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/src/fpdftext_embeddertest.cpp
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "../../public/fpdf_text.h"
+#include "../../public/fpdfview.h"
 #include "../../testing/embedder_test.h"
-#include "../../fpdfsdk/include/fpdfview.h"
-#include "../../fpdfsdk/include/fpdftext.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 3c0e010..d977996 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -6,10 +6,10 @@
 
 #include "../include/fsdk_define.h"
 #include "../include/fsdk_mgr.h"
-#include "../include/fpdfview.h"
 #include "../include/fsdk_rendercontext.h"
-#include "../include/fpdf_progressive.h"
-#include "../include/fpdf_ext.h"
+#include "../../public/fpdfview.h"
+#include "../../public/fpdf_progressive.h"
+#include "../../public/fpdf_ext.h"
 #include "../../../core/src/fxcrt/fx_safe_types.h"
 #include "../../third_party/base/nonstd_unique_ptr.h"
 #include "../../third_party/base/numerics/safe_conversions_impl.h"
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp
index 47119b5..b8f6921 100644
--- a/fpdfsdk/src/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfview_embeddertest.cpp
@@ -5,8 +5,8 @@
 #include <limits>
 #include <string>
 
+#include "../../public/fpdfview.h"
 #include "../../testing/embedder_test.h"
-#include "../../fpdfsdk/include/fpdfview.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 class FPDFViewEmbeddertest : public EmbedderTest {
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 9e0b230..e6be9bd 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -4,9 +4,9 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "../../public/fpdf_ext.h"
 #include "../include/fsdk_define.h"
 #include "../include/fsdk_mgr.h"
-#include "../include/fpdf_ext.h"
 #include "../include/formfiller/FFL_FormFiller.h"
 #include "../include/javascript/IJavaScript.h"
 
diff --git a/pdfium.gyp b/pdfium.gyp
index 5cb5d8b..c24c511 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -61,18 +61,6 @@
       ],
       'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
-        'fpdfsdk/include/fpdfdoc.h',
-        'fpdfsdk/include/fpdfedit.h',
-        'fpdfsdk/include/fpdfformfill.h',
-        'fpdfsdk/include/fpdftext.h',
-        'fpdfsdk/include/fpdfview.h',
-        'fpdfsdk/include/fpdf_dataavail.h',
-        'fpdfsdk/include/fpdf_flatten.h',
-        'fpdfsdk/include/fpdf_progressive.h',
-        'fpdfsdk/include/fpdf_searchex.h',
-        'fpdfsdk/include/fpdf_sysfontinfo.h',
-        'fpdfsdk/include/fpdf_ext.h',
-        'fpdfsdk/include/fpdf_sysfontinfo.h',
         'fpdfsdk/include/fsdk_actionhandler.h',
         'fpdfsdk/include/fsdk_annothandler.h',
         'fpdfsdk/include/fsdk_baseannot.h',
@@ -91,6 +79,7 @@
         'fpdfsdk/src/fpdf_progressive.cpp',
         'fpdfsdk/src/fpdf_searchex.cpp',
         'fpdfsdk/src/fpdf_sysfontinfo.cpp',
+        'fpdfsdk/src/fpdf_transformpage.cpp',
         'fpdfsdk/src/fsdk_actionhandler.cpp',
         'fpdfsdk/src/fsdk_annothandler.cpp',
         'fpdfsdk/src/fsdk_baseannot.cpp',
@@ -99,8 +88,21 @@
         'fpdfsdk/src/fsdk_rendercontext.cpp',
         'fpdfsdk/src/fpdfsdkdll.rc',
         'fpdfsdk/src/resource.h',
-        'fpdfsdk/include/fpdf_transformpage.h',
-        'fpdfsdk/src/fpdf_transformpage.cpp',
+        'public/fpdf_dataavail.h',
+        'public/fpdf_doc.h',
+        'public/fpdf_edit.h',
+        'public/fpdf_ext.h',
+        'public/fpdf_flatten.h',
+        'public/fpdf_formfill.h',
+        'public/fpdf_fwlevent.h',
+        'public/fpdf_ppo.h',
+        'public/fpdf_progressive.h',
+        'public/fpdf_save.h',
+        'public/fpdf_searchex.h',
+        'public/fpdf_sysfontinfo.h',
+        'public/fpdf_text.h',
+        'public/fpdf_transformpage.h',
+        'public/fpdfview.h',
       ],
       'conditions': [
         ['OS!="win"', {
diff --git a/fpdfsdk/include/fpdf_dataavail.h b/public/fpdf_dataavail.h
similarity index 100%
rename from fpdfsdk/include/fpdf_dataavail.h
rename to public/fpdf_dataavail.h
diff --git a/fpdfsdk/include/fpdfdoc.h b/public/fpdf_doc.h
similarity index 100%
rename from fpdfsdk/include/fpdfdoc.h
rename to public/fpdf_doc.h
diff --git a/fpdfsdk/include/fpdfedit.h b/public/fpdf_edit.h
similarity index 100%
rename from fpdfsdk/include/fpdfedit.h
rename to public/fpdf_edit.h
diff --git a/fpdfsdk/include/fpdf_ext.h b/public/fpdf_ext.h
similarity index 100%
rename from fpdfsdk/include/fpdf_ext.h
rename to public/fpdf_ext.h
diff --git a/fpdfsdk/include/fpdf_flatten.h b/public/fpdf_flatten.h
similarity index 100%
rename from fpdfsdk/include/fpdf_flatten.h
rename to public/fpdf_flatten.h
diff --git a/fpdfsdk/include/fpdfformfill.h b/public/fpdf_formfill.h
similarity index 100%
rename from fpdfsdk/include/fpdfformfill.h
rename to public/fpdf_formfill.h
diff --git a/fpdfsdk/include/fpdf_fwlevent.h b/public/fpdf_fwlevent.h
similarity index 100%
rename from fpdfsdk/include/fpdf_fwlevent.h
rename to public/fpdf_fwlevent.h
diff --git a/fpdfsdk/include/fpdfppo.h b/public/fpdf_ppo.h
similarity index 100%
rename from fpdfsdk/include/fpdfppo.h
rename to public/fpdf_ppo.h
diff --git a/fpdfsdk/include/fpdf_progressive.h b/public/fpdf_progressive.h
similarity index 100%
rename from fpdfsdk/include/fpdf_progressive.h
rename to public/fpdf_progressive.h
diff --git a/fpdfsdk/include/fpdfsave.h b/public/fpdf_save.h
similarity index 100%
rename from fpdfsdk/include/fpdfsave.h
rename to public/fpdf_save.h
diff --git a/fpdfsdk/include/fpdf_searchex.h b/public/fpdf_searchex.h
similarity index 100%
rename from fpdfsdk/include/fpdf_searchex.h
rename to public/fpdf_searchex.h
diff --git a/fpdfsdk/include/fpdf_sysfontinfo.h b/public/fpdf_sysfontinfo.h
similarity index 100%
rename from fpdfsdk/include/fpdf_sysfontinfo.h
rename to public/fpdf_sysfontinfo.h
diff --git a/fpdfsdk/include/fpdftext.h b/public/fpdf_text.h
similarity index 100%
rename from fpdfsdk/include/fpdftext.h
rename to public/fpdf_text.h
diff --git a/fpdfsdk/include/fpdf_transformpage.h b/public/fpdf_transformpage.h
similarity index 100%
rename from fpdfsdk/include/fpdf_transformpage.h
rename to public/fpdf_transformpage.h
diff --git a/fpdfsdk/include/fpdfview.h b/public/fpdfview.h
similarity index 99%
rename from fpdfsdk/include/fpdfview.h
rename to public/fpdfview.h
index 21cddab..4e7ee50 100644
--- a/fpdfsdk/include/fpdfview.h
+++ b/public/fpdfview.h
@@ -4,6 +4,8 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+// NOTE: External docs refer to this file as "fpdfview.h", so do not rename
+// despite lack of consitency with other public files.
 
 #ifndef _FPDFVIEW_H_
 #define _FPDFVIEW_H_
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index d473c47..a3c4fdf 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -13,15 +13,14 @@
 #include <utility>
 #include <vector>
 
-#include "../fpdfsdk/include/fpdf_dataavail.h"
-#include "../fpdfsdk/include/fpdf_ext.h"
-#include "../fpdfsdk/include/fpdfformfill.h"
-#include "../fpdfsdk/include/fpdftext.h"
-#include "../fpdfsdk/include/fpdfview.h"
-#include "../core/include/fxcrt/fx_system.h"
+#include "../public/fpdf_dataavail.h"
+#include "../public/fpdf_ext.h"
+#include "../public/fpdf_formfill.h"
+#include "../public/fpdf_text.h"
+#include "../public/fpdfview.h"
 #include "image_diff_png.h"
-#include "v8/include/v8.h"
 #include "v8/include/libplatform/libplatform.h"
+#include "v8/include/v8.h"
 
 #ifdef _WIN32
 #define snprintf _snprintf
@@ -485,8 +484,8 @@
   FORM_DoDocumentJSAction(form);
   FORM_DoDocumentOpenAction(form);
 
-  size_t rendered_pages = 0;
-  size_t bad_pages = 0;
+  int rendered_pages = 0;
+  int bad_pages = 0;
   for (int i = 0; i < page_count; ++i) {
     FPDF_PAGE page = FPDF_LoadPage(doc, i);
     if (!page) {
@@ -555,8 +554,8 @@
   FPDF_CloseDocument(doc);
   FPDFAvail_Destroy(pdf_avail);
 
-  fprintf(stderr, "Rendered %" PRIuS " pages.\n", rendered_pages);
-  fprintf(stderr, "Skipped %" PRIuS " bad pages.\n", bad_pages);
+  fprintf(stderr, "Rendered %d pages.\n", rendered_pages);
+  fprintf(stderr, "Skipped %d bad pages.\n", bad_pages);
 }
 
 static const char usage_string[] =
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index e8d5a09..e1473c0 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -14,9 +14,9 @@
 #include <utility>
 #include <vector>
 
-#include "../fpdfsdk/include/fpdftext.h"
-#include "../fpdfsdk/include/fpdfview.h"
 #include "../core/include/fxcrt/fx_system.h"
+#include "../public/fpdf_text.h"
+#include "../public/fpdfview.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "v8/include/v8.h"
 
diff --git a/testing/embedder_test.h b/testing/embedder_test.h
index ea93131..5cede6c 100644
--- a/testing/embedder_test.h
+++ b/testing/embedder_test.h
@@ -8,10 +8,10 @@
 #include <string>
 
 #include "../core/include/fxcrt/fx_system.h"
-#include "../fpdfsdk/include/fpdf_dataavail.h"
-#include "../fpdfsdk/include/fpdf_ext.h"
-#include "../fpdfsdk/include/fpdfformfill.h"
-#include "../fpdfsdk/include/fpdfview.h"
+#include "../public/fpdf_dataavail.h"
+#include "../public/fpdf_ext.h"
+#include "../public/fpdf_formfill.h"
+#include "../public/fpdfview.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "v8/include/v8.h"