1 // Copyright 2015 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // This "C" (not "C++") file ensures that the public headers compile 6 // and link for "C" (and not just "C++"). 7 8 #include <stdio.h> 9 10 #include "fpdfview_c_api_test.h" 11 12 #include "../../public/fpdf_dataavail.h" 13 #include "../../public/fpdf_doc.h" 14 #include "../../public/fpdf_edit.h" 15 #include "../../public/fpdf_ext.h" 16 #include "../../public/fpdf_flatten.h" 17 #include "../../public/fpdf_formfill.h" 18 #include "../../public/fpdf_fwlevent.h" 19 #include "../../public/fpdf_ppo.h" 20 #include "../../public/fpdf_progressive.h" 21 #include "../../public/fpdf_save.h" 22 #include "../../public/fpdf_searchex.h" 23 #include "../../public/fpdf_sysfontinfo.h" 24 #include "../../public/fpdf_text.h" 25 #include "../../public/fpdf_transformpage.h" 26 #include "../../public/fpdfview.h" 27 28 // Scheme for avoiding LTO out of existence, warnings, etc. 29 typedef void (*fnptr)(void); // Legal generic function type for casts. 30 fnptr g_c_api_test_fnptr = NULL; // Extern, so can't know it doesn't change. 31 #define CHK(x) if ((fnptr)(x) == g_c_api_test_fnptr) return 0 32 33 // Function to call from gtest harness to ensure linker resolution. CheckPDFiumCApi()34int CheckPDFiumCApi() { 35 // fpdf_dataavail.h 36 CHK(FPDFAvail_Create); 37 CHK(FPDFAvail_Destroy); 38 CHK(FPDFAvail_IsDocAvail); 39 CHK(FPDFAvail_GetDocument); 40 CHK(FPDFAvail_GetFirstPageNum); 41 CHK(FPDFAvail_IsPageAvail); 42 CHK(FPDFAvail_IsFormAvail); 43 CHK(FPDFAvail_IsLinearized); 44 45 // fpdf_doc.h 46 CHK(FPDFBookmark_GetFirstChild); 47 CHK(FPDFBookmark_GetNextSibling); 48 CHK(FPDFBookmark_GetTitle); 49 CHK(FPDFBookmark_Find); 50 CHK(FPDFBookmark_GetDest); 51 CHK(FPDFBookmark_GetAction); 52 CHK(FPDFAction_GetType); 53 CHK(FPDFAction_GetDest); 54 CHK(FPDFAction_GetURIPath); 55 CHK(FPDFDest_GetPageIndex); 56 CHK(FPDFLink_GetLinkAtPoint); 57 CHK(FPDFLink_GetDest); 58 CHK(FPDFLink_GetAction); 59 CHK(FPDFLink_Enumerate); 60 CHK(FPDFLink_GetAnnotRect); 61 CHK(FPDFLink_CountQuadPoints); 62 CHK(FPDFLink_GetQuadPoints); 63 CHK(FPDF_GetMetaText); 64 65 // fpdf_edit.h 66 CHK(FPDF_CreateNewDocument); 67 CHK(FPDFPage_New); 68 CHK(FPDFPage_Delete); 69 CHK(FPDFPage_GetRotation); 70 CHK(FPDFPage_SetRotation); 71 CHK(FPDFPage_InsertObject); 72 CHK(FPDFPage_CountObject); 73 CHK(FPDFPage_GetObject); 74 CHK(FPDFPage_HasTransparency); 75 CHK(FPDFPage_GenerateContent); 76 CHK(FPDFPageObj_HasTransparency); 77 CHK(FPDFPageObj_Transform); 78 CHK(FPDFPage_TransformAnnots); 79 CHK(FPDFPageObj_NewImgeObj); 80 CHK(FPDFImageObj_LoadJpegFile); 81 CHK(FPDFImageObj_SetMatrix); 82 CHK(FPDFImageObj_SetBitmap); 83 84 // fpdf_ext.h 85 CHK(FSDK_SetUnSpObjProcessHandler); 86 CHK(FPDFDoc_GetPageMode); 87 88 // fpdf_flatten.h 89 CHK(FPDFPage_Flatten); 90 91 // fpdf_fwlevent.h - no exports. 92 93 // fpdf_formfill.h 94 CHK(FPDFDOC_InitFormFillEnvironment); 95 CHK(FPDFDOC_ExitFormFillEnvironment); 96 CHK(FORM_OnAfterLoadPage); 97 CHK(FORM_OnBeforeClosePage); 98 CHK(FORM_DoDocumentJSAction); 99 CHK(FORM_DoDocumentOpenAction); 100 CHK(FORM_DoDocumentAAction); 101 CHK(FORM_DoPageAAction); 102 CHK(FORM_OnMouseMove); 103 CHK(FORM_OnLButtonDown); 104 CHK(FORM_OnLButtonUp); 105 CHK(FORM_OnKeyDown); 106 CHK(FORM_OnKeyUp); 107 CHK(FORM_OnChar); 108 CHK(FORM_ForceToKillFocus); 109 CHK(FPDPage_HasFormFieldAtPoint); 110 CHK(FPDF_SetFormFieldHighlightColor); 111 CHK(FPDF_SetFormFieldHighlightAlpha); 112 CHK(FPDF_RemoveFormFieldHighlight); 113 CHK(FPDF_FFLDraw); 114 115 // fpdf_ppo.h 116 CHK(FPDF_ImportPages); 117 CHK(FPDF_CopyViewerPreferences); 118 119 // fpdf_progressive.h 120 CHK(FPDF_RenderPageBitmap_Start); 121 CHK(FPDF_RenderPage_Continue); 122 CHK(FPDF_RenderPage_Close); 123 124 // fpdf_save.h 125 CHK(FPDF_SaveAsCopy); 126 CHK(FPDF_SaveWithVersion); 127 128 // fpdf_searchex.h 129 CHK(FPDFText_GetCharIndexFromTextIndex); 130 131 // fpdf_sysfontinfo.h 132 CHK(FPDF_GetDefaultTTFMap); 133 CHK(FPDF_AddInstalledFont); 134 CHK(FPDF_SetSystemFontInfo); 135 CHK(FPDF_GetDefaultSystemFontInfo); 136 137 // fpdf_text.h 138 CHK(FPDFText_LoadPage); 139 CHK(FPDFText_ClosePage); 140 CHK(FPDFText_CountChars); 141 CHK(FPDFText_GetUnicode); 142 CHK(FPDFText_GetFontSize); 143 CHK(FPDFText_GetCharBox); 144 CHK(FPDFText_GetCharIndexAtPos); 145 CHK(FPDFText_GetText); 146 CHK(FPDFText_CountRects); 147 CHK(FPDFText_GetRect); 148 CHK(FPDFText_GetBoundedText); 149 CHK(FPDFText_FindStart); 150 CHK(FPDFText_FindNext); 151 CHK(FPDFText_FindPrev); 152 CHK(FPDFText_GetSchResultIndex); 153 CHK(FPDFText_GetSchCount); 154 CHK(FPDFText_FindClose); 155 CHK(FPDFLink_LoadWebLinks); 156 CHK(FPDFLink_CountWebLinks); 157 CHK(FPDFLink_GetURL); 158 CHK(FPDFLink_CountRects); 159 CHK(FPDFLink_GetRect); 160 CHK(FPDFLink_CloseWebLinks); 161 162 // fpdf_transformpage.h 163 CHK(FPDFPage_SetMediaBox); 164 CHK(FPDFPage_SetCropBox); 165 CHK(FPDFPage_GetMediaBox); 166 CHK(FPDFPage_GetCropBox); 167 CHK(FPDFPage_TransFormWithClip); 168 CHK(FPDFPageObj_TransformClipPath); 169 CHK(FPDF_CreateClipPath); 170 CHK(FPDF_DestroyClipPath); 171 CHK(FPDFPage_InsertClipPath); 172 173 // fpdfview.h 174 CHK(FPDF_InitLibrary); 175 CHK(FPDF_DestroyLibrary); 176 CHK(FPDF_SetSandBoxPolicy); 177 CHK(FPDF_LoadDocument); 178 CHK(FPDF_LoadMemDocument); 179 CHK(FPDF_LoadCustomDocument); 180 CHK(FPDF_GetFileVersion); 181 CHK(FPDF_GetLastError); 182 CHK(FPDF_GetDocPermissions); 183 CHK(FPDF_GetSecurityHandlerRevision); 184 CHK(FPDF_GetPageCount); 185 CHK(FPDF_LoadPage); 186 CHK(FPDF_GetPageWidth); 187 CHK(FPDF_GetPageHeight); 188 CHK(FPDF_GetPageSizeByIndex); 189 CHK(FPDF_RenderPageBitmap); 190 CHK(FPDF_ClosePage); 191 CHK(FPDF_CloseDocument); 192 CHK(FPDF_DeviceToPage); 193 CHK(FPDF_PageToDevice); 194 CHK(FPDFBitmap_Create); 195 CHK(FPDFBitmap_CreateEx); 196 CHK(FPDFBitmap_FillRect); 197 CHK(FPDFBitmap_GetBuffer); 198 CHK(FPDFBitmap_GetWidth); 199 CHK(FPDFBitmap_GetHeight); 200 CHK(FPDFBitmap_GetStride); 201 CHK(FPDFBitmap_Destroy); 202 CHK(FPDF_VIEWERREF_GetPrintScaling); 203 CHK(FPDF_VIEWERREF_GetNumCopies); 204 CHK(FPDF_VIEWERREF_GetPrintPageRange); 205 CHK(FPDF_VIEWERREF_GetDuplex); 206 CHK(FPDF_CountNamedDests); 207 CHK(FPDF_GetNamedDestByName); 208 CHK(FPDF_GetNamedDest); 209 210 return 1; 211 } 212 213 #undef CHK 214