OLD | NEW |
(Empty) | |
| 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. |
| 34 int 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_OnRButtonDown); |
| 106 CHK(FORM_OnRButtonUp); |
| 107 CHK(FORM_OnKeyDown); |
| 108 CHK(FORM_OnKeyUp); |
| 109 CHK(FORM_OnChar); |
| 110 CHK(FORM_ForceToKillFocus); |
| 111 CHK(FPDPage_HasFormFieldAtPoint); |
| 112 CHK(FPDF_SetFormFieldHighlightColor); |
| 113 CHK(FPDF_SetFormFieldHighlightAlpha); |
| 114 CHK(FPDF_RemoveFormFieldHighlight); |
| 115 CHK(FPDF_FFLDraw); |
| 116 CHK(FPDF_HasXFAField); |
| 117 CHK(FPDF_LoadXFA); |
| 118 CHK(FPDF_Widget_Undo); |
| 119 CHK(FPDF_Widget_Redo); |
| 120 CHK(FPDF_Widget_SelectAll); |
| 121 CHK(FPDF_Widget_Copy); |
| 122 CHK(FPDF_Widget_Cut); |
| 123 CHK(FPDF_Widget_Paste); |
| 124 CHK(FPDF_Widget_ReplaceSpellCheckWord); |
| 125 CHK(FPDF_Widget_GetSpellCheckWords); |
| 126 CHK(FPDF_StringHandleCounts); |
| 127 CHK(FPDF_StringHandleGetStringByIndex); |
| 128 CHK(FPDF_StringHandleRelease); |
| 129 CHK(FPDF_StringHandleAddString); |
| 130 |
| 131 // fpdf_ppo.h |
| 132 CHK(FPDF_ImportPages); |
| 133 CHK(FPDF_CopyViewerPreferences); |
| 134 |
| 135 // fpdf_progressive.h |
| 136 CHK(FPDF_RenderPageBitmap_Start); |
| 137 CHK(FPDF_RenderPage_Continue); |
| 138 CHK(FPDF_RenderPage_Close); |
| 139 |
| 140 // fpdf_save.h |
| 141 CHK(FPDF_SaveAsCopy); |
| 142 CHK(FPDF_SaveWithVersion); |
| 143 |
| 144 // fpdf_searchex.h |
| 145 CHK(FPDFText_GetCharIndexFromTextIndex); |
| 146 |
| 147 // fpdf_sysfontinfo.h |
| 148 CHK(FPDF_GetDefaultTTFMap); |
| 149 CHK(FPDF_AddInstalledFont); |
| 150 CHK(FPDF_SetSystemFontInfo); |
| 151 CHK(FPDF_GetDefaultSystemFontInfo); |
| 152 |
| 153 // fpdf_text.h |
| 154 CHK(FPDFText_LoadPage); |
| 155 CHK(FPDFText_ClosePage); |
| 156 CHK(FPDFText_CountChars); |
| 157 CHK(FPDFText_GetUnicode); |
| 158 CHK(FPDFText_GetFontSize); |
| 159 CHK(FPDFText_GetCharBox); |
| 160 CHK(FPDFText_GetCharIndexAtPos); |
| 161 CHK(FPDFText_GetText); |
| 162 CHK(FPDFText_CountRects); |
| 163 CHK(FPDFText_GetRect); |
| 164 CHK(FPDFText_GetBoundedText); |
| 165 CHK(FPDFText_FindStart); |
| 166 CHK(FPDFText_FindNext); |
| 167 CHK(FPDFText_FindPrev); |
| 168 CHK(FPDFText_GetSchResultIndex); |
| 169 CHK(FPDFText_GetSchCount); |
| 170 CHK(FPDFText_FindClose); |
| 171 CHK(FPDFLink_LoadWebLinks); |
| 172 CHK(FPDFLink_CountWebLinks); |
| 173 CHK(FPDFLink_GetURL); |
| 174 CHK(FPDFLink_CountRects); |
| 175 CHK(FPDFLink_GetRect); |
| 176 CHK(FPDFLink_CloseWebLinks); |
| 177 |
| 178 // fpdf_transformpage.h |
| 179 CHK(FPDFPage_SetMediaBox); |
| 180 CHK(FPDFPage_SetCropBox); |
| 181 CHK(FPDFPage_GetMediaBox); |
| 182 CHK(FPDFPage_GetCropBox); |
| 183 CHK(FPDFPage_TransFormWithClip); |
| 184 CHK(FPDFPageObj_TransformClipPath); |
| 185 CHK(FPDF_CreateClipPath); |
| 186 CHK(FPDF_DestroyClipPath); |
| 187 CHK(FPDFPage_InsertClipPath); |
| 188 |
| 189 // fpdfview.h |
| 190 CHK(FPDF_InitLibrary); |
| 191 CHK(FPDF_DestroyLibrary); |
| 192 CHK(FPDF_SetSandBoxPolicy); |
| 193 CHK(FPDF_LoadDocument); |
| 194 CHK(FPDF_LoadMemDocument); |
| 195 CHK(FPDF_LoadCustomDocument); |
| 196 CHK(FPDF_GetFileVersion); |
| 197 CHK(FPDF_GetLastError); |
| 198 CHK(FPDF_GetDocPermissions); |
| 199 CHK(FPDF_GetSecurityHandlerRevision); |
| 200 CHK(FPDF_GetPageCount); |
| 201 CHK(FPDF_LoadPage); |
| 202 CHK(FPDF_GetPageWidth); |
| 203 CHK(FPDF_GetPageHeight); |
| 204 CHK(FPDF_GetPageSizeByIndex); |
| 205 CHK(FPDF_RenderPageBitmap); |
| 206 CHK(FPDF_ClosePage); |
| 207 CHK(FPDF_CloseDocument); |
| 208 CHK(FPDF_DeviceToPage); |
| 209 CHK(FPDF_PageToDevice); |
| 210 CHK(FPDFBitmap_Create); |
| 211 CHK(FPDFBitmap_CreateEx); |
| 212 CHK(FPDFBitmap_FillRect); |
| 213 CHK(FPDFBitmap_GetBuffer); |
| 214 CHK(FPDFBitmap_GetWidth); |
| 215 CHK(FPDFBitmap_GetHeight); |
| 216 CHK(FPDFBitmap_GetStride); |
| 217 CHK(FPDFBitmap_Destroy); |
| 218 CHK(FPDF_VIEWERREF_GetPrintScaling); |
| 219 CHK(FPDF_VIEWERREF_GetNumCopies); |
| 220 CHK(FPDF_VIEWERREF_GetPrintPageRange); |
| 221 CHK(FPDF_VIEWERREF_GetDuplex); |
| 222 CHK(FPDF_CountNamedDests); |
| 223 CHK(FPDF_GetNamedDestByName); |
| 224 CHK(FPDF_GetNamedDest); |
| 225 CHK(FPDF_BStr_Init); |
| 226 CHK(FPDF_BStr_Set); |
| 227 CHK(FPDF_BStr_Clear); |
| 228 |
| 229 return 1; |
| 230 } |
| 231 |
| 232 #undef CHK |
OLD | NEW |