diff options
40 files changed, 1425 insertions, 1282 deletions
@@ -15,6 +15,7 @@ Bruce Dawson <brucedawson@chromium.org> Chery Cherian <cherycherian@gmail.com> Chris Palmer <palmer@chromium.org> Dan Sinclair <dsinclair@chromium.org> +Felix Kauselmann <licorn@gmail.com> Finnur Thorarinsson <finnur@chromium.org> GiWan Go <gogil@stealien.com> Jiang Jiang <jiangj@opera.com> @@ -19,6 +19,7 @@ config("pdfium_common_config") { ldflags = [] include_dirs = [ "." ] defines = [ + "FPDF_IMPLEMENTATION", "OPJ_STATIC", "PNG_PREFIX", "PNG_USE_READ_MACROS", @@ -99,7 +100,7 @@ config("xfa_warnings") { } } -static_library("pdfium") { +component("pdfium") { sources = [ "fpdfsdk/cba_annotiterator.cpp", "fpdfsdk/cba_annotiterator.h", @@ -228,7 +229,7 @@ static_library("pdfium") { } } -static_library("test_support") { +pdf_source_set("test_support") { testonly = true sources = [ "testing/fx_string_testhelpers.cpp", @@ -261,7 +262,7 @@ static_library("test_support") { configs += [ ":pdfium_core_config" ] } -static_library("image_diff") { +pdf_source_set("image_diff") { testonly = true sources = [ "testing/image_diff/image_diff_png.cpp", @@ -281,7 +282,7 @@ visibility = [ "//:gn_visibility", ] -static_library("fdrm") { +pdf_source_set("fdrm") { sources = [ "core/fdrm/crypto/fx_crypt.cpp", "core/fdrm/crypto/fx_crypt.h", @@ -294,7 +295,7 @@ static_library("fdrm") { ] } -static_library("fpdfdoc") { +pdf_source_set("fpdfdoc") { sources = [ "core/fpdfdoc/cline.cpp", "core/fpdfdoc/cline.h", @@ -794,7 +795,7 @@ config("fxge_warnings") { } } -static_library("fxcrt") { +pdf_source_set("fxcrt") { sources = [ "core/fxcrt/cfx_bytestring.cpp", "core/fxcrt/cfx_bytestring.h", @@ -1119,7 +1120,7 @@ static_library("fxge") { } } -static_library("pwl") { +pdf_source_set("pwl") { sources = [ "fpdfsdk/pwl/cpwl_appstream.cpp", "fpdfsdk/pwl/cpwl_appstream.h", @@ -1160,7 +1161,7 @@ static_library("pwl") { ] } -static_library("javascript") { +pdf_source_set("javascript") { sources = [ "fpdfsdk/javascript/ijs_event_context.h", "fpdfsdk/javascript/ijs_runtime.h", @@ -1223,7 +1224,7 @@ static_library("javascript") { } } -static_library("formfiller") { +pdf_source_set("formfiller") { sources = [ "fpdfsdk/formfiller/cba_fontmap.cpp", "fpdfsdk/formfiller/cba_fontmap.h", @@ -1255,7 +1256,7 @@ static_library("formfiller") { } if (pdf_enable_v8) { - static_library("fxjs") { + pdf_source_set("fxjs") { sources = [ "fxjs/fxjs_v8.cpp", "fxjs/fxjs_v8.h", @@ -1295,7 +1296,7 @@ if (pdf_enable_v8) { } if (pdf_enable_xfa) { - static_library("fpdfxfa") { + pdf_source_set("fpdfxfa") { sources = [ "fpdfsdk/fpdfxfa/cpdfxfa_context.cpp", "fpdfsdk/fpdfxfa/cpdfxfa_context.h", @@ -1314,7 +1315,7 @@ if (pdf_enable_xfa) { configs += [ ":pdfium_core_config" ] } - static_library("fxbarcode") { + pdf_source_set("fxbarcode") { sources = [ "fxbarcode/BC_Library.cpp", "fxbarcode/BC_Library.h", @@ -1449,7 +1450,7 @@ if (pdf_enable_xfa) { configs += [ ":pdfium_core_config" ] } - static_library("xfa") { + pdf_source_set("xfa") { sources = [ "xfa/fde/cfde_brush.h", "xfa/fde/cfde_path.cpp", diff --git a/fpdfsdk/fpdf_dataavail.cpp b/fpdfsdk/fpdf_dataavail.cpp index 85dd873cf3..e365fd9313 100644 --- a/fpdfsdk/fpdf_dataavail.cpp +++ b/fpdfsdk/fpdf_dataavail.cpp @@ -116,8 +116,8 @@ CFPDF_DataAvail* CFPDFDataAvailFromFPDFAvail(FPDF_AVAIL avail) { } // namespace -DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, - FPDF_FILEACCESS* file) { +FPDF_EXPORT FPDF_AVAIL FPDF_CALLCONV FPDFAvail_Create(FX_FILEAVAIL* file_avail, + FPDF_FILEACCESS* file) { auto pAvail = pdfium::MakeUnique<CFPDF_DataAvail>(); pAvail->m_FileAvail->Set(file_avail); pAvail->m_FileRead->Set(file); @@ -126,13 +126,13 @@ DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, return pAvail.release(); // Caller takes ownership. } -DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail) { +FPDF_EXPORT void FPDF_CALLCONV FPDFAvail_Destroy(FPDF_AVAIL avail) { // Take ownership back from caller and destroy. std::unique_ptr<CFPDF_DataAvail>(static_cast<CFPDF_DataAvail*>(avail)); } -DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, - FX_DOWNLOADHINTS* hints) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsDocAvail(FPDF_AVAIL avail, + FX_DOWNLOADHINTS* hints) { if (!avail || !hints) return PDF_DATA_ERROR; CFPDF_DownloadHintsWrap hints_wrap(hints); @@ -140,7 +140,7 @@ DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, &hints_wrap); } -DLLEXPORT FPDF_DOCUMENT STDCALL +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { CFPDF_DataAvail* pDataAvail = static_cast<CFPDF_DataAvail*>(avail); if (!pDataAvail) @@ -161,14 +161,14 @@ FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { return FPDFDocumentFromCPDFDocument(pDocument.release()); } -DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(doc); return pDoc ? pDoc->GetParser()->GetFirstPageNo() : 0; } -DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, - int page_index, - FX_DOWNLOADHINTS* hints) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsPageAvail(FPDF_AVAIL avail, + int page_index, + FX_DOWNLOADHINTS* hints) { if (!avail || !hints) return PDF_DATA_ERROR; if (page_index < 0) @@ -178,8 +178,8 @@ DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, page_index, &hints_wrap); } -DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, - FX_DOWNLOADHINTS* hints) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsFormAvail(FPDF_AVAIL avail, + FX_DOWNLOADHINTS* hints) { if (!avail || !hints) return PDF_FORM_ERROR; CFPDF_DownloadHintsWrap hints_wrap(hints); @@ -187,7 +187,7 @@ DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, &hints_wrap); } -DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsLinearized(FPDF_AVAIL avail) { if (!avail) return PDF_LINEARIZATION_UNKNOWN; return CFPDFDataAvailFromFPDFAvail(avail)->m_pDataAvail->IsLinearizedPDF(); diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp index f598835e3c..2284453d2d 100644 --- a/fpdfsdk/fpdf_ext.cpp +++ b/fpdfsdk/fpdf_ext.cpp @@ -37,7 +37,7 @@ bool FPDF_UnSupportError(int nError) { return true; } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info) { if (!unsp_info || unsp_info->version != 1) return false; @@ -169,7 +169,7 @@ void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code) { #endif // PDF_ENABLE_XFA } -DLLEXPORT int STDCALL FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { +FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return PAGEMODE_UNKNOWN; diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index 16528c2ee3..5be322a9b0 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -235,7 +235,7 @@ CFX_Matrix GetMatrix(CFX_FloatRect rcAnnot, } // namespace -DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!page) return FLATTEN_FAIL; diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp index 2411869904..c52f3707cc 100644 --- a/fpdfsdk/fpdf_progressive.cpp +++ b/fpdfsdk/fpdf_progressive.cpp @@ -30,15 +30,15 @@ static_assert(CPDF_ProgressiveRenderer::Done == FPDF_RENDER_DONE, static_assert(CPDF_ProgressiveRenderer::Failed == FPDF_RENDER_FAILED, "CPDF_ProgressiveRenderer::Failed value mismatch"); -DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags, - IFSDK_PAUSE* pause) { +FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags, + IFSDK_PAUSE* pause) { if (!bitmap || !pause || pause->version != 1) return FPDF_RENDER_FAILED; @@ -71,8 +71,8 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, return FPDF_RENDER_FAILED; } -DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, - IFSDK_PAUSE* pause) { +FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPage_Continue(FPDF_PAGE page, + IFSDK_PAUSE* pause) { if (!pause || pause->version != 1) return FPDF_RENDER_FAILED; @@ -95,7 +95,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, return FPDF_RENDER_FAILED; } -DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage_Close(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (pPage) { #ifdef _SKIA_SUPPORT_PATHS_ diff --git a/fpdfsdk/fpdf_searchex.cpp b/fpdfsdk/fpdf_searchex.cpp index 13729167ed..9d48cebf8a 100644 --- a/fpdfsdk/fpdf_searchex.cpp +++ b/fpdfsdk/fpdf_searchex.cpp @@ -8,7 +8,7 @@ #include "core/fpdftext/cpdf_textpage.h" -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex) { if (!text_page) return -1; @@ -16,7 +16,7 @@ FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex) { ->CharIndexFromTextIndex(nTextIndex); } -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetTextIndexFromCharIndex(FPDF_TEXTPAGE text_page, int nCharIndex) { if (!text_page) return -1; diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp index bd6641f7cb..a6bf60d0df 100644 --- a/fpdfsdk/fpdf_structtree.cpp +++ b/fpdfsdk/fpdf_structtree.cpp @@ -37,7 +37,8 @@ unsigned long WideStringToBuffer(const CFX_WideString& str, } // namespace -DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page) { +FPDF_EXPORT FPDF_STRUCTTREE FPDF_CALLCONV +FPDF_StructTree_GetForPage(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return nullptr; @@ -46,17 +47,18 @@ DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page) { .release(); } -DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree) { +FPDF_EXPORT void FPDF_CALLCONV +FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree) { std::unique_ptr<CPDF_StructTree>(ToStructTree(struct_tree)); } -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree) { CPDF_StructTree* tree = ToStructTree(struct_tree); return tree ? tree->CountTopElements() : -1; } -DLLEXPORT FPDF_STRUCTELEMENT STDCALL +FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index) { CPDF_StructTree* tree = ToStructTree(struct_tree); if (!tree || index < 0 || index >= tree->CountTopElements()) @@ -64,7 +66,7 @@ FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index) { return tree->GetTopElement(index); } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element, void* buffer, unsigned long buflen) { @@ -75,7 +77,7 @@ FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element, : 0; } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element, void* buffer, unsigned long buflen) { @@ -84,7 +86,7 @@ FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element, : 0; } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element, void* buffer, unsigned long buflen) { @@ -94,13 +96,13 @@ FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element, : 0; } -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element) { CPDF_StructElement* elem = ToStructTreeElement(struct_element); return elem ? elem->CountKids() : -1; } -DLLEXPORT FPDF_STRUCTELEMENT STDCALL +FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element, int index) { CPDF_StructElement* elem = ToStructTreeElement(struct_element); diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp index 5dca4814d4..9228326096 100644 --- a/fpdfsdk/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/fpdf_sysfontinfo.cpp @@ -103,14 +103,15 @@ class CFX_ExternalFontInfo final : public IFX_SystemFontInfo { FPDF_SYSFONTINFO* const m_pInfo; }; -DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, - const char* name, - int charset) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_AddInstalledFont(void* mapper, + const char* name, + int charset) { CFX_FontMapper* pMapper = static_cast<CFX_FontMapper*>(mapper); pMapper->AddInstalledFont(name, charset); } -DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) { +FPDF_EXPORT void FPDF_CALLCONV +FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) { if (pFontInfoExt->version != 1) return; @@ -118,7 +119,7 @@ DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) { pdfium::MakeUnique<CFX_ExternalFontInfo>(pFontInfoExt)); } -DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap() { +FPDF_EXPORT const FPDF_CharsetFontMap* FPDF_CALLCONV FPDF_GetDefaultTTFMap() { return CPWL_FontMap::defaultTTFMap; } @@ -191,7 +192,7 @@ static void DefaultDeleteFont(struct _FPDF_SYSFONTINFO* pThis, void* hFont) { pDefault->m_pFontInfo->DeleteFont(hFont); } -DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo() { +FPDF_EXPORT FPDF_SYSFONTINFO* FPDF_CALLCONV FPDF_GetDefaultSystemFontInfo() { std::unique_ptr<IFX_SystemFontInfo> pFontInfo = IFX_SystemFontInfo::CreateDefault(nullptr); if (!pFontInfo) @@ -212,7 +213,7 @@ DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo() { return pFontInfoExt; } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pDefaultFontInfo) { FX_Free(static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pDefaultFontInfo)); } diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp index b419ad1fb2..93df594618 100644 --- a/fpdfsdk/fpdf_transformpage.cpp +++ b/fpdfsdk/fpdf_transformpage.cpp @@ -56,11 +56,11 @@ bool GetBoundingBox(CPDF_Page* page, } // namespace -DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, - float left, - float bottom, - float right, - float top) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetMediaBox(FPDF_PAGE page, + float left, + float bottom, + float right, + float top) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; @@ -68,11 +68,11 @@ DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, SetBoundingBox(pPage, "MediaBox", left, bottom, right, top); } -DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, - float left, - float bottom, - float right, - float top) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetCropBox(FPDF_PAGE page, + float left, + float bottom, + float right, + float top) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; @@ -80,27 +80,28 @@ DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, SetBoundingBox(pPage, "CropBox", left, bottom, right, top); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, - float* left, - float* bottom, - float* right, - float* top) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetMediaBox(FPDF_PAGE page, + float* left, + float* bottom, + float* right, + float* top) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); return pPage && GetBoundingBox(pPage, "MediaBox", left, bottom, right, top); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, - float* left, - float* bottom, - float* right, - float* top) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page, + float* left, + float* bottom, + float* right, + float* top) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); return pPage && GetBoundingBox(pPage, "CropBox", left, bottom, right, top); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, - FS_MATRIX* matrix, - FS_RECTF* clipRect) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPage_TransFormWithClip(FPDF_PAGE page, + FS_MATRIX* matrix, + FS_RECTF* clipRect) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return false; @@ -197,7 +198,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, return true; } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, double a, double b, @@ -217,10 +218,10 @@ FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, pPageObj->TransformGeneralState(matrix); } -DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, - float bottom, - float right, - float top) { +FPDF_EXPORT FPDF_CLIPPATH FPDF_CALLCONV FPDF_CreateClipPath(float left, + float bottom, + float right, + float top) { CPDF_Path Path; Path.AppendRect(left, bottom, right, top); @@ -229,7 +230,7 @@ DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, return pNewClipPath.release(); // Caller takes ownership. } -DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) { // Take ownership back from caller and destroy. std::unique_ptr<CPDF_ClipPath>(static_cast<CPDF_ClipPath*>(clipPath)); } @@ -271,8 +272,8 @@ void OutputPath(std::ostringstream& buf, CPDF_Path path) { } } -DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page, - FPDF_CLIPPATH clipPath) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertClipPath(FPDF_PAGE page, + FPDF_CLIPPATH clipPath) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp index 64c95a3777..9213877b0b 100644 --- a/fpdfsdk/fpdfannot.cpp +++ b/fpdfsdk/fpdfannot.cpp @@ -184,7 +184,7 @@ void UpdateContentStream(CPDF_Form* pForm, CPDF_Stream* pStream) { } // namespace -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype) { // The supported subtypes must also be communicated in the user doc. return subtype == FPDF_ANNOT_CIRCLE || subtype == FPDF_ANNOT_HIGHLIGHT || @@ -194,7 +194,7 @@ FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype) { subtype == FPDF_ANNOT_TEXT || subtype == FPDF_ANNOT_UNDERLINE; } -DLLEXPORT FPDF_ANNOTATION STDCALL +FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage || !FPDFAnnot_IsSupportedSubtype(subtype)) @@ -217,7 +217,7 @@ FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype) { return pNewAnnot.release(); } -DLLEXPORT int STDCALL FPDFPage_GetAnnotCount(FPDF_PAGE page) { +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage || !pPage->m_pFormDict) return 0; @@ -226,7 +226,8 @@ DLLEXPORT int STDCALL FPDFPage_GetAnnotCount(FPDF_PAGE page) { return pAnnots ? pAnnots->GetCount() : 0; } -DLLEXPORT FPDF_ANNOTATION STDCALL FPDFPage_GetAnnot(FPDF_PAGE page, int index) { +FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page, + int index) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage || !pPage->m_pFormDict || index < 0) return nullptr; @@ -240,11 +241,12 @@ DLLEXPORT FPDF_ANNOTATION STDCALL FPDFPage_GetAnnot(FPDF_PAGE page, int index) { return pNewAnnot.release(); } -DLLEXPORT void STDCALL FPDFPage_CloseAnnot(FPDF_ANNOTATION annot) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_CloseAnnot(FPDF_ANNOTATION annot) { delete CPDFAnnotContextFromFPDFAnnotation(annot); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_RemoveAnnot(FPDF_PAGE page, int index) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page, + int index) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage || !pPage->m_pFormDict || index < 0) return false; @@ -257,7 +259,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_RemoveAnnot(FPDF_PAGE page, int index) { return true; } -DLLEXPORT FPDF_ANNOTATION_SUBTYPE STDCALL +FPDF_EXPORT FPDF_ANNOTATION_SUBTYPE FPDF_CALLCONV FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot) { if (!annot) return FPDF_ANNOT_UNKNOWN; @@ -271,14 +273,14 @@ FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot) { CPDF_Annot::StringToAnnotSubtype(pAnnotDict->GetStringFor("Subtype"))); } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype) { // The supported subtypes must also be communicated in the user doc. return subtype == FPDF_ANNOT_INK || subtype == FPDF_ANNOT_STAMP; } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, - FPDF_PAGEOBJECT obj) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) { CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot); CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(obj); if (!pAnnot || !pAnnot->GetAnnotDict() || !pAnnot->HasForm() || !pObj) @@ -311,8 +313,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, - FPDF_PAGEOBJECT obj) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) { CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot); CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(obj); if (!pAnnot || !pObj) @@ -373,7 +375,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, return true; } -DLLEXPORT int STDCALL FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) { CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot); if (!pAnnot || !pAnnot->GetAnnotDict()) return 0; @@ -389,8 +391,8 @@ DLLEXPORT int STDCALL FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) { return pdfium::CollectionSize<int>(*pAnnot->GetForm()->GetPageObjectList()); } -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFAnnot_GetObject(FPDF_ANNOTATION annot, - int index) { +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV +FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index) { CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot); if (!pAnnot || !pAnnot->GetAnnotDict() || index < 0) return nullptr; @@ -407,8 +409,8 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFAnnot_GetObject(FPDF_ANNOTATION annot, return pAnnot->GetForm()->GetPageObjectList()->GetPageObjectByIndex(index); } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, - int index) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index) { CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot); if (!pAnnot || !pAnnot->GetAnnotDict() || !pAnnot->HasForm() || index < 0) return false; @@ -433,12 +435,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetColor(FPDF_ANNOTATION annot, - FPDFANNOT_COLORTYPE type, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetColor(FPDF_ANNOTATION annot, + FPDFANNOT_COLORTYPE type, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A) { if (!annot || R > 255 || G > 255 || B > 255 || A > 255) return false; @@ -471,12 +473,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetColor(FPDF_ANNOTATION annot, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_GetColor(FPDF_ANNOTATION annot, - FPDFANNOT_COLORTYPE type, - unsigned int* R, - unsigned int* G, - unsigned int* B, - unsigned int* A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetColor(FPDF_ANNOTATION annot, + FPDFANNOT_COLORTYPE type, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A) { if (!annot || !R || !G || !B || !A) return false; @@ -536,7 +538,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_GetColor(FPDF_ANNOTATION annot, return true; } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot) { if (!annot) return false; @@ -547,7 +549,7 @@ FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot) { subtype == FPDF_ANNOT_STRIKEOUT; } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, const FS_QUADPOINTSF* quadPoints) { if (!annot || !quadPoints || !FPDFAnnot_HasAttachmentPoints(annot)) @@ -588,7 +590,7 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, return true; } -DLLEXPORT FS_QUADPOINTSF STDCALL +FPDF_EXPORT FS_QUADPOINTSF FPDF_CALLCONV FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot) { if (!annot || !FPDFAnnot_HasAttachmentPoints(annot)) return FS_QUADPOINTSF(); @@ -641,8 +643,8 @@ FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot) { return quadPoints; } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetRect(FPDF_ANNOTATION annot, - const FS_RECTF* rect) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot, + const FS_RECTF* rect) { if (!annot || !rect) return false; @@ -671,7 +673,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetRect(FPDF_ANNOTATION annot, return true; } -DLLEXPORT FS_RECTF STDCALL FPDFAnnot_GetRect(FPDF_ANNOTATION annot) { +FPDF_EXPORT FS_RECTF FPDF_CALLCONV FPDFAnnot_GetRect(FPDF_ANNOTATION annot) { if (!annot) return FS_RECTF(); @@ -702,8 +704,8 @@ DLLEXPORT FS_RECTF STDCALL FPDFAnnot_GetRect(FPDF_ANNOTATION annot) { return rect; } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_HasKey(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasKey(FPDF_ANNOTATION annot, + FPDF_WIDESTRING key) { if (!annot) return false; @@ -715,8 +717,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_HasKey(FPDF_ANNOTATION annot, return pAnnotDict->KeyExist(CFXByteStringFromFPDFWideString(key)); } -DLLEXPORT FPDF_OBJECT_TYPE STDCALL FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key) { +FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV +FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, FPDF_WIDESTRING key) { if (!FPDFAnnot_HasKey(annot, key)) return FPDF_OBJECT_UNKNOWN; @@ -729,9 +731,10 @@ DLLEXPORT FPDF_OBJECT_TYPE STDCALL FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, return pObj->GetType(); } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key, - FPDF_WIDESTRING value) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, + FPDF_WIDESTRING key, + FPDF_WIDESTRING value) { if (!annot) return false; @@ -746,10 +749,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, return true; } -DLLEXPORT unsigned long STDCALL FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, + FPDF_WIDESTRING key, + void* buffer, + unsigned long buflen) { if (!annot) return 0; @@ -763,7 +767,7 @@ DLLEXPORT unsigned long STDCALL FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, buffer, buflen); } -DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot) { +FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFlags(FPDF_ANNOTATION annot) { if (!annot) return FPDF_ANNOT_FLAG_NONE; @@ -775,8 +779,8 @@ DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot) { return pAnnotDict->GetIntegerFor("F"); } -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, - int flags) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, + int flags) { if (!annot) return false; @@ -789,8 +793,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, return true; } -DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, - FPDF_ANNOTATION annot) { +FPDF_EXPORT int FPDF_CALLCONV +FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, FPDF_ANNOTATION annot) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage || !annot) return FPDF_FORMFLAG_NONE; @@ -805,7 +809,7 @@ DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, return pFormField ? pFormField->GetFieldFlags() : FPDF_FORMFLAG_NONE; } -DLLEXPORT FPDF_ANNOTATION STDCALL +FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, double page_x, diff --git a/fpdfsdk/fpdfattachment.cpp b/fpdfsdk/fpdfattachment.cpp index 5bdb3bd4a2..b759ae2655 100644 --- a/fpdfsdk/fpdfattachment.cpp +++ b/fpdfsdk/fpdfattachment.cpp @@ -45,7 +45,8 @@ CFX_ByteString GenerateMD5Base16(const void* contents, } // namespace -DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document) { +FPDF_EXPORT int FPDF_CALLCONV +FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 0; @@ -53,8 +54,8 @@ DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document) { return CPDF_NameTree(pDoc, "EmbeddedFiles").GetCount(); } -DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_AddAttachment(FPDF_DOCUMENT document, - FPDF_WIDESTRING name) { +FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV +FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); CFX_WideString wsName = CFX_WideString::FromUTF16LE(name, CFX_WideString::WStringLength(name)); @@ -97,8 +98,8 @@ DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_AddAttachment(FPDF_DOCUMENT document, return pFile; } -DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_GetAttachment(FPDF_DOCUMENT document, - int index) { +FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV +FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc || index < 0) return nullptr; @@ -111,8 +112,8 @@ DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_GetAttachment(FPDF_DOCUMENT document, return nameTree.LookupValueAndName(index, &csName); } -DLLEXPORT FPDF_BOOL STDCALL FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, - int index) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, int index) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc || index < 0) return false; @@ -124,7 +125,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, return nameTree.DeleteValueAndName(index); } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, void* buffer, unsigned long buflen) { @@ -136,8 +137,8 @@ FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, buffer, buflen); } -DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, - FPDF_WIDESTRING key) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { CPDF_Object* pFile = CPDFObjectFromFPDFAttachment(attachment); if (!pFile) return 0; @@ -149,7 +150,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, return pParamsDict->KeyExist(CFXByteStringFromFPDFWideString(key)); } -DLLEXPORT FPDF_OBJECT_TYPE STDCALL +FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { if (!FPDFAttachment_HasKey(attachment, key)) return FPDF_OBJECT_UNKNOWN; @@ -163,7 +164,7 @@ FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { return pObj->GetType(); } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key, FPDF_WIDESTRING value) { @@ -185,7 +186,7 @@ FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, return true; } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key, void* buffer, @@ -213,10 +214,11 @@ FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, return Utf16EncodeMaybeCopyAndReturnLength(value, buffer, buflen); } -DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, - FPDF_DOCUMENT document, - const void* contents, - const unsigned long len) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, + FPDF_DOCUMENT document, + const void* contents, + const unsigned long len) { CPDF_Object* pFile = CPDFObjectFromFPDFAttachment(attachment); CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pFile || !pFile->IsDictionary() || !pDoc || len > INT_MAX) @@ -260,7 +262,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, return true; } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetFile(FPDF_ATTACHMENT attachment, void* buffer, unsigned long buflen) { diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index b6088604fd..8f81b3a840 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -62,7 +62,7 @@ CPDF_LinkList* GetLinkList(CPDF_Page* page) { } // namespace -DLLEXPORT FPDF_BOOKMARK STDCALL +FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) @@ -73,7 +73,7 @@ FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { return tree.GetFirstChild(bookmark).GetDict(); } -DLLEXPORT FPDF_BOOKMARK STDCALL +FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { if (!pDict) return nullptr; @@ -86,9 +86,8 @@ FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { return tree.GetNextSibling(bookmark).GetDict(); } -DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK pDict, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFBookmark_GetTitle(FPDF_BOOKMARK pDict, void* buffer, unsigned long buflen) { if (!pDict) return 0; CPDF_Bookmark bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); @@ -96,8 +95,8 @@ DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK pDict, return Utf16EncodeMaybeCopyAndReturnLength(title, buffer, buflen); } -DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, - FPDF_WIDESTRING title) { +FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV +FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title) { if (!title || title[0] == 0) return nullptr; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -110,8 +109,8 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, return FindBookmark(tree, CPDF_Bookmark(), encodedTitle, &visited).GetDict(); } -DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, - FPDF_BOOKMARK pDict) { +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFBookmark_GetDest(FPDF_DOCUMENT document, + FPDF_BOOKMARK pDict) { if (!pDict) return nullptr; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -129,14 +128,15 @@ DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, return action.GetDest(pDoc).GetObject(); } -DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK pDict) { +FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV +FPDFBookmark_GetAction(FPDF_BOOKMARK pDict) { if (!pDict) return nullptr; CPDF_Bookmark bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); return bookmark.GetAction().GetDict(); } -DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION pDict) { +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetType(FPDF_ACTION pDict) { if (!pDict) return PDFACTION_UNSUPPORTED; @@ -156,8 +156,8 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION pDict) { } } -DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, - FPDF_ACTION pDict) { +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document, + FPDF_ACTION pDict) { if (!pDict) return nullptr; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -167,9 +167,8 @@ DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, return action.GetDest(pDoc).GetObject(); } -DLLEXPORT unsigned long STDCALL FPDFAction_GetFilePath(FPDF_ACTION pDict, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFAction_GetFilePath(FPDF_ACTION pDict, void* buffer, unsigned long buflen) { unsigned long type = FPDFAction_GetType(pDict); if (type != PDFACTION_REMOTEGOTO && type != PDFACTION_LAUNCH) return 0; @@ -182,10 +181,11 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetFilePath(FPDF_ACTION pDict, return len; } -DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, - FPDF_ACTION pDict, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFAction_GetURIPath(FPDF_DOCUMENT document, + FPDF_ACTION pDict, + void* buffer, + unsigned long buflen) { if (!pDict) return 0; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -199,8 +199,8 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, return len; } -DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, - FPDF_DEST pDict) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST pDict) { if (!pDict) return 0; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -210,13 +210,14 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, return dest.GetPageIndex(pDoc); } -DLLEXPORT FPDF_BOOL STDCALL FPDFDest_GetLocationInPage(FPDF_DEST pDict, - FPDF_BOOL* hasXVal, - FPDF_BOOL* hasYVal, - FPDF_BOOL* hasZoomVal, - FS_FLOAT* x, - FS_FLOAT* y, - FS_FLOAT* zoom) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFDest_GetLocationInPage(FPDF_DEST pDict, + FPDF_BOOL* hasXVal, + FPDF_BOOL* hasYVal, + FPDF_BOOL* hasZoomVal, + FS_FLOAT* x, + FS_FLOAT* y, + FS_FLOAT* zoom) { if (!pDict) return false; @@ -235,9 +236,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFDest_GetLocationInPage(FPDF_DEST pDict, return true; } -DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, - double x, - double y) { +FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFLink_GetLinkAtPoint(FPDF_PAGE page, + double x, + double y) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return nullptr; @@ -253,9 +254,9 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, .GetDict(); } -DLLEXPORT int STDCALL FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, - double x, - double y) { +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, + double x, + double y) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return -1; @@ -271,8 +272,8 @@ DLLEXPORT int STDCALL FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, return z_order; } -DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, - FPDF_LINK pDict) { +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFLink_GetDest(FPDF_DOCUMENT document, + FPDF_LINK pDict) { if (!pDict) return nullptr; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -289,7 +290,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, return action.GetDest(pDoc).GetObject(); } -DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) { +FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK pDict) { if (!pDict) return nullptr; @@ -297,9 +298,9 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) { return link.GetAction().GetDict(); } -DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, - int* startPos, - FPDF_LINK* linkAnnot) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, + int* startPos, + FPDF_LINK* linkAnnot) { if (!startPos || !linkAnnot) return false; CPDF_Page* pPage = CPDFPageFromFPDFPage(page); @@ -322,8 +323,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, return false; } -DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, - FS_RECTF* rect) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, + FS_RECTF* rect) { if (!linkAnnot || !rect) return false; CPDF_Dictionary* pAnnotDict = @@ -336,7 +337,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, return true; } -DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { if (!linkAnnot) return 0; CPDF_Dictionary* pAnnotDict = @@ -347,9 +348,10 @@ DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { return static_cast<int>(pArray->GetCount() / 8); } -DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, - int quadIndex, - FS_QUADPOINTSF* quadPoints) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, + int quadIndex, + FS_QUADPOINTSF* quadPoints) { if (!linkAnnot || !quadPoints) return false; CPDF_Dictionary* pAnnotDict = @@ -375,10 +377,10 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, return true; } -DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document, - FPDF_BYTESTRING tag, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetMetaText(FPDF_DOCUMENT document, + FPDF_BYTESTRING tag, + void* buffer, + unsigned long buflen) { if (!tag) return 0; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); @@ -392,10 +394,11 @@ DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document, return Utf16EncodeMaybeCopyAndReturnLength(text, buffer, buflen); } -DLLEXPORT unsigned long STDCALL FPDF_GetPageLabel(FPDF_DOCUMENT document, - int page_index, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDF_GetPageLabel(FPDF_DOCUMENT document, + int page_index, + void* buffer, + unsigned long buflen) { if (page_index < 0) return 0; diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp index b4254e97c6..f19e21c8ff 100644 --- a/fpdfsdk/fpdfeditimg.cpp +++ b/fpdfsdk/fpdfeditimg.cpp @@ -47,7 +47,7 @@ bool LoadJpegHelper(FPDF_PAGE* pages, } // namespace -DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_NewImageObj(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) @@ -58,7 +58,7 @@ FPDFPageObj_NewImageObj(FPDF_DOCUMENT document) { return pImageObj.release(); } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, @@ -66,7 +66,7 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, return LoadJpegHelper(pages, nCount, image_object, fileAccess, false); } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, @@ -74,13 +74,14 @@ FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages, return LoadJpegHelper(pages, nCount, image_object, fileAccess, true); } -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, - double a, - double b, - double c, - double d, - double e, - double f) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, + double a, + double b, + double c, + double d, + double e, + double f) { if (!image_object) return false; @@ -93,10 +94,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, - int nCount, - FPDF_PAGEOBJECT image_object, - FPDF_BITMAP bitmap) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFImageObj_SetBitmap(FPDF_PAGE* pages, + int nCount, + FPDF_PAGEOBJECT image_object, + FPDF_BITMAP bitmap) { if (!image_object || !bitmap || !pages) return false; @@ -113,7 +115,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, return true; } -DLLEXPORT FPDF_BITMAP STDCALL +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object) { CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(image_object); if (!pObj || !pObj->IsImage()) @@ -140,7 +142,7 @@ FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object) { return pBitmap.Leak(); } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object, void* buffer, unsigned long buflen) { @@ -159,7 +161,7 @@ FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object, return DecodeStreamMaybeCopyAndReturnLength(pImgStream, buffer, buflen); } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object, void* buffer, unsigned long buflen) { @@ -182,7 +184,7 @@ FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object, return len; } -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object) { CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(image_object); if (!pObj || !pObj->IsImage()) @@ -205,7 +207,7 @@ FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object) { return 0; } -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, int index, void* buffer, diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp index 91b966c384..489053080c 100644 --- a/fpdfsdk/fpdfeditpage.cpp +++ b/fpdfsdk/fpdfeditpage.cpp @@ -95,7 +95,7 @@ void CalcBoundingBox(CPDF_PageObject* pPageObj) { } // namespace -DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() { +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_CreateNewDocument() { auto pDoc = pdfium::MakeUnique<CPDF_Document>(nullptr); pDoc->CreateNewDoc(); @@ -123,15 +123,16 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() { return FPDFDocumentFromCPDFDocument(pDoc.release()); } -DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_Delete(FPDF_DOCUMENT document, + int page_index) { if (UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document)) pDoc->DeletePage(page_index); } -DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, - int page_index, - double width, - double height) { +FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDFPage_New(FPDF_DOCUMENT document, + int page_index, + double width, + double height) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; @@ -161,13 +162,13 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, #endif // PDF_ENABLE_XFA } -DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) { +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetRotation(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); return IsPageObject(pPage) ? pPage->GetPageRotation() : -1; } -DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, - FPDF_PAGEOBJECT page_obj) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertObject(FPDF_PAGE page, + FPDF_PAGEOBJECT page_obj) { CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(page_obj); if (!pPageObj) return; @@ -181,31 +182,31 @@ DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, CalcBoundingBox(pPageObj); } -DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page) { +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_CountObject(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!IsPageObject(pPage)) return -1; return pdfium::CollectionSize<int>(*pPage->GetPageObjectList()); } -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, - int index) { +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPage_GetObject(FPDF_PAGE page, + int index) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!IsPageObject(pPage)) return nullptr; return pPage->GetPageObjectList()->GetPageObjectByIndex(index); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_HasTransparency(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); return pPage && pPage->BackgroundAlphaNeeded(); } -DLLEXPORT void STDCALL FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_obj) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_obj) { delete CPDFPageObjectFromFPDFPageObject(page_obj); } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) { if (!pageObject) return false; @@ -239,7 +240,7 @@ FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) { return false; } -DLLEXPORT int STDCALL FPDFPageObj_GetType(FPDF_PAGEOBJECT pageObject) { +FPDF_EXPORT int FPDF_CALLCONV FPDFPageObj_GetType(FPDF_PAGEOBJECT pageObject) { if (!pageObject) return FPDF_PAGEOBJ_UNKNOWN; @@ -247,7 +248,7 @@ DLLEXPORT int STDCALL FPDFPageObj_GetType(FPDF_PAGEOBJECT pageObject) { return pPageObj->GetType(); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GenerateContent(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!IsPageObject(pPage)) return false; @@ -257,13 +258,14 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page) { return true; } -DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, - double a, - double b, - double c, - double d, - double e, - double f) { +FPDF_EXPORT void FPDF_CALLCONV +FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, + double a, + double b, + double c, + double d, + double e, + double f) { CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object); if (!pPageObj) return; @@ -272,8 +274,9 @@ DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, pPageObj->Transform(matrix); } -DLLEXPORT void STDCALL FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, - FPDF_BYTESTRING blend_mode) { +FPDF_EXPORT void FPDF_CALLCONV +FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, + FPDF_BYTESTRING blend_mode) { CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object); if (!pPageObj) return; @@ -282,13 +285,13 @@ DLLEXPORT void STDCALL FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, pPageObj->SetDirty(true); } -DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, - double a, - double b, - double c, - double d, - double e, - double f) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_TransformAnnots(FPDF_PAGE page, + double a, + double b, + double c, + double d, + double e, + double f) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; @@ -317,7 +320,8 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, } } -DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetRotation(FPDF_PAGE page, + int rotate) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!IsPageObject(pPage)) return; @@ -343,11 +347,12 @@ FPDF_BOOL FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_GetBounds(FPDF_PAGEOBJECT pageObject, - float* left, - float* bottom, - float* right, - float* top) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_GetBounds(FPDF_PAGEOBJECT pageObject, + float* left, + float* bottom, + float* right, + float* top) { if (!pageObject) return false; diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp index 2181df8406..19d47e6a44 100644 --- a/fpdfsdk/fpdfeditpath.cpp +++ b/fpdfsdk/fpdfeditpath.cpp @@ -26,28 +26,30 @@ static_assert(CFX_GraphStateData::LineJoinRound == FPDF_LINEJOIN_ROUND, static_assert(CFX_GraphStateData::LineJoinBevel == FPDF_LINEJOIN_BEVEL, "CFX_GraphStateData::LineJoinBevel value mismatch"); -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y) { +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewPath(float x, + float y) { auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>(); pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false); pPathObj->DefaultStates(); return pPathObj.release(); // Caller takes ownership. } -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewRect(float x, - float y, - float w, - float h) { +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewRect(float x, + float y, + float w, + float h) { auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>(); pPathObj->m_Path.AppendRect(x, y, x + w, y + h); pPathObj->DefaultStates(); return pPathObj.release(); // Caller takes ownership. } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A) { if (!path || R > 255 || G > 255 || B > 255 || A > 255) return false; @@ -60,11 +62,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, - unsigned int* R, - unsigned int* G, - unsigned int* B, - unsigned int* A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A) { if (!path || !R || !G || !B || !A) return false; @@ -78,8 +81,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, - float width) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width) { if (!path || width < 0.0f) return false; @@ -89,19 +92,19 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A) { return FPDFPageObj_SetFillColor(path, R, G, B, A); } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, - unsigned int* R, - unsigned int* G, - unsigned int* B, - unsigned int* A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A) { if (!path || !R || !G || !B || !A) return false; @@ -115,9 +118,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, - float x, - float y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_MoveTo(FPDF_PAGEOBJECT path, + float x, + float y) { if (!path) return false; @@ -127,9 +130,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_LineTo(FPDF_PAGEOBJECT path, - float x, - float y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_LineTo(FPDF_PAGEOBJECT path, + float x, + float y) { if (!path) return false; @@ -139,13 +142,13 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_LineTo(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_BezierTo(FPDF_PAGEOBJECT path, - float x1, - float y1, - float x2, - float y2, - float x3, - float y3) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_BezierTo(FPDF_PAGEOBJECT path, + float x1, + float y1, + float x2, + float y2, + float x3, + float y3) { if (!path) return false; @@ -157,7 +160,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_BezierTo(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_Close(FPDF_PAGEOBJECT path) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_Close(FPDF_PAGEOBJECT path) { if (!path) return false; @@ -170,9 +173,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_Close(FPDF_PAGEOBJECT path) { return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, - int fillmode, - FPDF_BOOL stroke) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, + int fillmode, + FPDF_BOOL stroke) { if (!path) return false; @@ -189,8 +192,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, return true; } -DLLEXPORT void STDCALL FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path, - int line_join) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path, + int line_join) { if (!path) return; if (line_join < @@ -206,7 +209,8 @@ DLLEXPORT void STDCALL FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path, pPathObj->SetDirty(true); } -DLLEXPORT void STDCALL FPDFPath_SetLineCap(FPDF_PAGEOBJECT path, int line_cap) { +FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineCap(FPDF_PAGEOBJECT path, + int line_cap) { if (!path) return; if (line_cap < static_cast<int>(CFX_GraphStateData::LineCap::LineCapButt) || diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp index f498917a19..47facb4345 100644 --- a/fpdfsdk/fpdfedittext.cpp +++ b/fpdfsdk/fpdfedittext.cpp @@ -396,9 +396,10 @@ void* LoadCompositeFont(CPDF_Document* pDoc, } // namespace -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, - FPDF_BYTESTRING font, - float font_size) { +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV +FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, + FPDF_BYTESTRING font, + float font_size) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; @@ -414,8 +415,8 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, return pTextObj.release(); // Caller takes ownership. } -DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object, - FPDF_WIDESTRING text) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFText_SetText(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text) { auto* pTextObj = static_cast<CPDF_TextObject*>(text_object); if (!pTextObj) return false; @@ -431,11 +432,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object, return true; } -DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadFont(FPDF_DOCUMENT document, - const uint8_t* data, - uint32_t size, - int font_type, - FPDF_BOOL cid) { +FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadFont(FPDF_DOCUMENT document, + const uint8_t* data, + uint32_t size, + int font_type, + FPDF_BOOL cid) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc || !data || size == 0 || (font_type != FPDF_FONT_TYPE1 && font_type != FPDF_FONT_TRUETYPE)) { @@ -454,15 +455,16 @@ DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadFont(FPDF_DOCUMENT document, : LoadSimpleFont(pDoc, std::move(pFont), data, size, font_type); } -DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetFillColor(FPDF_PAGEOBJECT text_object, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFText_SetFillColor(FPDF_PAGEOBJECT text_object, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A) { return FPDFPageObj_SetFillColor(text_object, R, G, B, A); } -DLLEXPORT void STDCALL FPDFFont_Close(FPDF_FONT font) { +FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close(FPDF_FONT font) { CPDF_Font* pFont = static_cast<CPDF_Font*>(font); if (!pFont) return; @@ -476,7 +478,7 @@ DLLEXPORT void STDCALL FPDFFont_Close(FPDF_FONT font) { pPageData->ReleaseFont(pFont->GetFontDict()); } -DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document, FPDF_FONT font, float font_size) { diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 7f4e3dfd69..6e142ed97c 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -151,10 +151,11 @@ void FFLCommon(FPDF_FORMHANDLE hHandle, } // namespace -DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - double page_x, - double page_y) { +FPDF_EXPORT int FPDF_CALLCONV +FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + double page_x, + double page_y) { if (!hHandle) return -1; CPDF_Page* pPage = CPDFPageFromFPDFPage(page); @@ -209,10 +210,11 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, return -1; } -DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - double page_x, - double page_y) { +FPDF_EXPORT int FPDF_CALLCONV +FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + double page_x, + double page_y) { if (!hHandle) return -1; CPDF_Page* pPage = CPDFPageFromFPDFPage(page); @@ -226,7 +228,7 @@ DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, return z_order; } -DLLEXPORT FPDF_FORMHANDLE STDCALL +FPDF_EXPORT FPDF_FORMHANDLE FPDF_CALLCONV FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo) { #ifdef PDF_ENABLE_XFA @@ -259,7 +261,7 @@ FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, return pFormFillEnv.release(); // Caller takes ownership. } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); @@ -278,33 +280,33 @@ FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) { delete pFormFillEnv; } -DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnMouseMove(CFX_PointF(page_x, page_y), modifier); } -DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnLButtonDown(CFX_PointF(page_x, page_y), modifier); } -DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; @@ -312,22 +314,22 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, } #ifdef PDF_ENABLE_XFA -DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnRButtonDown(CFX_PointF(page_x, page_y), modifier); } -DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; @@ -335,40 +337,41 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, } #endif // PDF_ENABLE_XFA -DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int nKeyCode, - int modifier) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int nKeyCode, + int modifier) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnKeyDown(nKeyCode, modifier); } -DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int nKeyCode, - int modifier) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int nKeyCode, + int modifier) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnKeyUp(nKeyCode, modifier); } -DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int nChar, - int modifier) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnChar(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int nChar, + int modifier) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return false; return pPageView->OnChar(nChar, modifier); } -DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - void* buffer, - unsigned long buflen) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + void* buffer, + unsigned long buflen) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return 0; @@ -383,9 +386,9 @@ DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, return form_text_len; } -DLLEXPORT void STDCALL FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - FPDF_WIDESTRING wsText) { +FPDF_EXPORT void FPDF_CALLCONV FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + FPDF_WIDESTRING wsText) { CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); if (!pPageView) return; @@ -396,7 +399,8 @@ DLLEXPORT void STDCALL FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, pPageView->ReplaceSelection(wide_str_text); } -DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); if (!pFormFillEnv) @@ -404,37 +408,37 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) { return pFormFillEnv->KillFocusAnnot(0); } -DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, - FPDF_BITMAP bitmap, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, + FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags) { FFLCommon(hHandle, bitmap, nullptr, page, start_x, start_y, size_x, size_y, rotate, flags); } #ifdef _SKIA_SUPPORT_ -DLLEXPORT void STDCALL FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, - FPDF_RECORDER recorder, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, + FPDF_RECORDER recorder, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags) { FFLCommon(hHandle, nullptr, recorder, page, start_x, start_y, size_x, size_y, rotate, flags); } #endif #ifdef PDF_ENABLE_XFA -DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Undo(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget) { if (!hWidget || !document) return; @@ -447,8 +451,8 @@ DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, static_cast<CXFA_FFWidget*>(hWidget)->Undo(); } -DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Redo(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget) { if (!hWidget || !document) return; @@ -460,8 +464,8 @@ DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, static_cast<CXFA_FFWidget*>(hWidget)->Redo(); } -DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_SelectAll(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget) { if (!hWidget || !document) return; @@ -473,10 +477,10 @@ DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, static_cast<CXFA_FFWidget*>(hWidget)->SelectAll(); } -DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD* size) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Copy(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget, + FPDF_WIDESTRING wsText, + FPDF_DWORD* size) { if (!hWidget || !document) return; @@ -505,10 +509,10 @@ DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, *size = real_size; } -DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD* size) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Cut(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget, + FPDF_WIDESTRING wsText, + FPDF_DWORD* size) { if (!hWidget || !document) return; @@ -537,10 +541,10 @@ DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, *size = real_size; } -DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD size) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Paste(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget, + FPDF_WIDESTRING wsText, + FPDF_DWORD size) { if (!hWidget || !document) return; @@ -553,7 +557,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, static_cast<CXFA_FFWidget*>(hWidget)->Paste(wstr); } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, @@ -574,7 +578,7 @@ FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, static_cast<CXFA_FFWidget*>(hWidget)->ReplaceSpellCheckWord(ptPopup, bs); } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, @@ -599,12 +603,13 @@ FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, *stringHandle = ToFPDFStringHandle(sSuggestWords.release()); } -DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE sHandle) { +FPDF_EXPORT int FPDF_CALLCONV +FPDF_StringHandleCounts(FPDF_STRINGHANDLE sHandle) { std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle); return sSuggestWords ? pdfium::CollectionSize<int>(*sSuggestWords) : -1; } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE sHandle, int index, FPDF_BYTESTRING bsText, @@ -630,12 +635,12 @@ FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE sHandle, return true; } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle) { delete FromFPDFStringHandle(stringHandle); } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, FPDF_BYTESTRING bsText, FPDF_DWORD size) { @@ -647,32 +652,34 @@ FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, } #endif // PDF_ENABLE_XFA -DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, - int fieldType, - unsigned long color) { +FPDF_EXPORT void FPDF_CALLCONV +FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, + int fieldType, + unsigned long color) { if (CPDFSDK_InterForm* pInterForm = FormHandleToInterForm(hHandle)) pInterForm->SetHighlightColor(color, fieldType); } -DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, - unsigned char alpha) { +FPDF_EXPORT void FPDF_CALLCONV +FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha) { if (CPDFSDK_InterForm* pInterForm = FormHandleToInterForm(hHandle)) pInterForm->SetHighlightAlpha(alpha); } -DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle) { +FPDF_EXPORT void FPDF_CALLCONV +FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle) { if (CPDFSDK_InterForm* pInterForm = FormHandleToInterForm(hHandle)) pInterForm->RemoveAllHighLight(); } -DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, - FPDF_FORMHANDLE hHandle) { +FPDF_EXPORT void FPDF_CALLCONV FORM_OnAfterLoadPage(FPDF_PAGE page, + FPDF_FORMHANDLE hHandle) { if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page)) pPageView->SetValid(true); } -DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, - FPDF_FORMHANDLE hHandle) { +FPDF_EXPORT void FPDF_CALLCONV FORM_OnBeforeClosePage(FPDF_PAGE page, + FPDF_FORMHANDLE hHandle) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); if (!pFormFillEnv) @@ -690,22 +697,24 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, } } -DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle) { +FPDF_EXPORT void FPDF_CALLCONV +FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); if (pFormFillEnv && pFormFillEnv->IsJSInitiated()) pFormFillEnv->ProcJavascriptFun(); } -DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle) { +FPDF_EXPORT void FPDF_CALLCONV +FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); if (pFormFillEnv && pFormFillEnv->IsJSInitiated()) pFormFillEnv->ProcOpenAction(); } -DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, - int aaType) { +FPDF_EXPORT void FPDF_CALLCONV FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, + int aaType) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); if (!pFormFillEnv) @@ -726,9 +735,9 @@ DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, } } -DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, - FPDF_FORMHANDLE hHandle, - int aaType) { +FPDF_EXPORT void FPDF_CALLCONV FORM_DoPageAAction(FPDF_PAGE page, + FPDF_FORMHANDLE hHandle, + int aaType) { CPDFSDK_FormFillEnvironment* pFormFillEnv = HandleToCPDFSDKEnvironment(hHandle); if (!pFormFillEnv) diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp index bf52932a1d..905d53af48 100644 --- a/fpdfsdk/fpdfppo.cpp +++ b/fpdfsdk/fpdfppo.cpp @@ -344,10 +344,10 @@ uint32_t CPDF_PageOrganizer::GetNewObjId(ObjectNumberMap* pObjNumberMap, return dwNewObjNum; } -DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc, - FPDF_DOCUMENT src_doc, - FPDF_BYTESTRING pagerange, - int index) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_ImportPages(FPDF_DOCUMENT dest_doc, + FPDF_DOCUMENT src_doc, + FPDF_BYTESTRING pagerange, + int index) { CPDF_Document* pDestDoc = CPDFDocumentFromFPDFDocument(dest_doc); if (!dest_doc) return false; @@ -371,8 +371,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc, return pageOrg.PDFDocInit() && pageOrg.ExportPage(pageArray, index); } -DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, - FPDF_DOCUMENT src_doc) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc) { CPDF_Document* pDstDoc = CPDFDocumentFromFPDFDocument(dest_doc); if (!pDstDoc) return false; diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp index ae9f2a17b8..91f88503fc 100644 --- a/fpdfsdk/fpdfsave.cpp +++ b/fpdfsdk/fpdfsave.cpp @@ -274,15 +274,16 @@ bool FPDF_Doc_Save(FPDF_DOCUMENT document, } // namespace -DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy(FPDF_DOCUMENT document, - FPDF_FILEWRITE* pFileWrite, - FPDF_DWORD flags) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SaveAsCopy(FPDF_DOCUMENT document, + FPDF_FILEWRITE* pFileWrite, + FPDF_DWORD flags) { return FPDF_Doc_Save(document, pFileWrite, flags, false, 0); } -DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, - FPDF_FILEWRITE* pFileWrite, - FPDF_DWORD flags, - int fileVersion) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDF_SaveWithVersion(FPDF_DOCUMENT document, + FPDF_FILEWRITE* pFileWrite, + FPDF_DWORD flags, + int fileVersion) { return FPDF_Doc_Save(document, pFileWrite, flags, true, fileVersion); } diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp index 916233c56e..70acf54ec7 100644 --- a/fpdfsdk/fpdftext.cpp +++ b/fpdfsdk/fpdftext.cpp @@ -43,7 +43,7 @@ CPDF_LinkExtract* CPDFLinkExtractFromFPDFPageLink(FPDF_PAGELINK link) { } // namespace -DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { +FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) { CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page); if (!pPDFPage) return nullptr; @@ -63,11 +63,11 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { return textpage; } -DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) { +FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page) { delete CPDFTextPageFromFPDFTextPage(text_page); } -DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) { +FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page) { if (!text_page) return -1; @@ -75,8 +75,8 @@ DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) { return textpage->CountChars(); } -DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, - int index) { +FPDF_EXPORT unsigned int FPDF_CALLCONV +FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index) { if (!text_page) return 0; @@ -89,8 +89,8 @@ DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, return charinfo.m_Unicode; } -DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, - int index) { +FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, + int index) { if (!text_page) return 0; CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page); @@ -103,12 +103,12 @@ DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, return charinfo.m_FontSize; } -DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, - int index, - double* left, - double* right, - double* bottom, - double* top) { +FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, + int index, + double* left, + double* right, + double* bottom, + double* top) { if (!text_page) return; CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page); @@ -124,11 +124,12 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, } // select -DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, - double x, - double y, - double xTolerance, - double yTolerance) { +FPDF_EXPORT int FPDF_CALLCONV +FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, + double x, + double y, + double xTolerance, + double yTolerance) { if (!text_page) return -3; @@ -139,10 +140,10 @@ DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, static_cast<float>(yTolerance))); } -DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, - int start, - int count, - unsigned short* result) { +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page, + int start, + int count, + unsigned short* result) { if (!text_page) return 0; @@ -162,9 +163,9 @@ DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, return cbUTF16str.GetLength() / sizeof(unsigned short); } -DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, - int start, - int count) { +FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page, + int start, + int count) { if (!text_page) return 0; @@ -172,12 +173,12 @@ DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, return textpage->CountRects(start, count); } -DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, - int rect_index, - double* left, - double* top, - double* right, - double* bottom) { +FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page, + int rect_index, + double* left, + double* top, + double* right, + double* bottom) { if (!text_page) return; @@ -190,13 +191,13 @@ DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, *bottom = rect.bottom; } -DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, - double left, - double top, - double right, - double bottom, - unsigned short* buffer, - int buflen) { +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, + double left, + double top, + double right, + double bottom, + unsigned short* buffer, + int buflen) { if (!text_page) return 0; @@ -219,10 +220,11 @@ DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, // Search // -1 for end -DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, - FPDF_WIDESTRING findwhat, - unsigned long flags, - int start_index) { +FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV +FPDFText_FindStart(FPDF_TEXTPAGE text_page, + FPDF_WIDESTRING findwhat, + unsigned long flags, + int start_index) { if (!text_page) return nullptr; @@ -234,7 +236,7 @@ DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, return textpageFind; } -DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle) { if (!handle) return false; @@ -242,7 +244,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle) { return textpageFind->FindNext(); } -DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle) { if (!handle) return false; @@ -250,7 +252,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle) { return textpageFind->FindPrev(); } -DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) { +FPDF_EXPORT int FPDF_CALLCONV +FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) { if (!handle) return 0; @@ -258,7 +261,7 @@ DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) { return textpageFind->GetCurOrder(); } -DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle) { +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle) { if (!handle) return 0; @@ -266,7 +269,7 @@ DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle) { return textpageFind->GetMatchedCount(); } -DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle) { +FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle) { if (!handle) return; @@ -276,7 +279,8 @@ DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle) { } // web link -DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) { +FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV +FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) { if (!text_page) return nullptr; @@ -286,7 +290,7 @@ DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) { return pageLink; } -DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) { +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) { if (!link_page) return 0; @@ -294,10 +298,10 @@ DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) { return pdfium::base::checked_cast<int>(pageLink->CountLinks()); } -DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, - int link_index, - unsigned short* buffer, - int buflen) { +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page, + int link_index, + unsigned short* buffer, + int buflen) { CFX_WideString wsUrl(L""); if (link_page && link_index >= 0) { CPDF_LinkExtract* pageLink = CPDFLinkExtractFromFPDFPageLink(link_page); @@ -316,8 +320,8 @@ DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, return size; } -DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, - int link_index) { +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page, + int link_index) { if (!link_page || link_index < 0) return 0; @@ -325,13 +329,13 @@ DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, return pdfium::CollectionSize<int>(pageLink->GetRects(link_index)); } -DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, - int link_index, - int rect_index, - double* left, - double* top, - double* right, - double* bottom) { +FPDF_EXPORT void FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page, + int link_index, + int rect_index, + double* left, + double* top, + double* right, + double* bottom) { if (!link_page || link_index < 0 || rect_index < 0) return; @@ -346,6 +350,6 @@ DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, *bottom = rectArray[rect_index].bottom; } -DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { +FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { delete CPDFLinkExtractFromFPDFPageLink(link_page); } diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 57e4806d39..c9d6bee40e 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -439,11 +439,11 @@ FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy) { } } -DLLEXPORT void STDCALL FPDF_InitLibrary() { +FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibrary() { FPDF_InitLibraryWithConfig(nullptr); } -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { if (g_bLibraryInitialized) return; @@ -466,7 +466,7 @@ FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { g_bLibraryInitialized = true; } -DLLEXPORT void STDCALL FPDF_DestroyLibrary() { +FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { if (!g_bLibraryInitialized) return; @@ -517,28 +517,29 @@ void ProcessParseError(CPDF_Parser::Error err) { SetLastError(err_code); } -DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, - FPDF_BOOL enable) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_SetSandBoxPolicy(FPDF_DWORD policy, + FPDF_BOOL enable) { return FSDK_SetSandBoxPolicy(policy, enable); } #if defined(_WIN32) #if defined(PDFIUM_PRINT_TEXT_WITH_GDI) -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func) { g_pdfium_typeface_accessible_func = func; } -DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi) { g_pdfium_print_text_with_gdi = !!use_gdi; } #endif // PDFIUM_PRINT_TEXT_WITH_GDI -DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintPostscriptLevel(int postscript_level) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDF_SetPrintPostscriptLevel(int postscript_level) { return postscript_level != 1 && FPDF_SetPrintMode(postscript_level); } -DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintMode(int mode) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SetPrintMode(int mode) { if (mode < FPDF_PRINTMODE_EMF || mode > FPDF_PRINTMODE_POSTSCRIPT3) return FALSE; g_pdfium_print_mode = mode; @@ -546,8 +547,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintMode(int mode) { } #endif // defined(_WIN32) -DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, - FPDF_BYTESTRING password) { +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV +FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password) { // NOTE: the creation of the file needs to be by the embedder on the // other side of this API. return LoadDocumentImpl( @@ -556,8 +557,8 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, } #ifdef PDF_ENABLE_XFA -DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, - int* docType) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document, + int* docType) { if (!document) return false; @@ -583,7 +584,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, return true; } -DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document) { return document && (static_cast<CPDFXFA_Context*>(document))->LoadXFADoc(); } #endif // PDF_ENABLE_XFA @@ -615,21 +616,20 @@ class CMemFile final : public IFX_SeekableReadStream { const FX_FILESIZE m_size; }; -DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, - int size, - FPDF_BYTESTRING password) { +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV +FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password) { return LoadDocumentImpl(CMemFile::Create((uint8_t*)data_buf, size), password); } -DLLEXPORT FPDF_DOCUMENT STDCALL +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password) { return LoadDocumentImpl(pdfium::MakeRetain<CPDF_CustomAccess>(pFileAccess), password); } -DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, - int* fileVersion) { +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc, + int* fileVersion) { if (!fileVersion) return false; @@ -648,7 +648,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, // jabdelmalek: changed return type from uint32_t to build on Linux (and match // header). -DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDF_GetDocPermissions(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); // https://bugs.chromium.org/p/pdfium/issues/detail?id=499 if (!pDoc) { @@ -662,7 +663,8 @@ DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document) { return pDoc->GetUserPermissions(); } -DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) { +FPDF_EXPORT int FPDF_CALLCONV +FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc || !pDoc->GetParser()) return -1; @@ -671,13 +673,13 @@ DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) { return pDict ? pDict->GetIntegerFor("R") : -1; } -DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) { +FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageCount(FPDF_DOCUMENT document) { UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document); return pDoc ? pDoc->GetPageCount() : 0; } -DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, - int page_index) { +FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDF_LoadPage(FPDF_DOCUMENT document, + int page_index) { UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document); if (!pDoc) return nullptr; @@ -698,12 +700,12 @@ DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, #endif // PDF_ENABLE_XFA } -DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page) { +FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageWidth(FPDF_PAGE page) { UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); return pPage ? pPage->GetPageWidth() : 0.0; } -DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page) { +FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageHeight(FPDF_PAGE page) { UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); return pPage ? pPage->GetPageHeight() : 0.0; } @@ -837,14 +839,14 @@ void RenderBitmap(CFX_RenderDevice* device, } // namespace -DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; @@ -934,14 +936,14 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, } #endif // defined(_WIN32) -DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags) { if (!bitmap) return; @@ -967,11 +969,12 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, pPage->SetRenderContext(nullptr); } -DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, - FPDF_PAGE page, - const FS_MATRIX* matrix, - const FS_RECTF* clipping, - int flags) { +FPDF_EXPORT void FPDF_CALLCONV +FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, + FPDF_PAGE page, + const FS_MATRIX* matrix, + const FS_RECTF* clipping, + int flags) { if (!bitmap) return; @@ -1010,9 +1013,9 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, } #ifdef _SKIA_SUPPORT_ -DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, - int size_x, - int size_y) { +FPDF_EXPORT FPDF_RECORDER FPDF_CALLCONV FPDF_RenderPageSkp(FPDF_PAGE page, + int size_x, + int size_y) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return nullptr; @@ -1029,7 +1032,7 @@ DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, } #endif -DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page) { UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); if (!page) return; @@ -1062,24 +1065,24 @@ DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) { #endif // PDF_ENABLE_XFA } -DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document) { delete UnderlyingFromFPDFDocument(document); } -DLLEXPORT unsigned long STDCALL FPDF_GetLastError() { +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetLastError() { return GetLastError(); } -DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int device_x, - int device_y, - double* page_x, - double* page_y) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int device_x, + int device_y, + double* page_x, + double* page_y) { if (!page || !page_x || !page_y) return; UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); @@ -1098,16 +1101,16 @@ DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, #endif // PDF_ENABLE_XFA } -DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - double page_x, - double page_y, - int* device_x, - int* device_y) { +FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + double page_x, + double page_y, + int* device_x, + int* device_y) { if (!device_x || !device_y) return; UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); @@ -1127,9 +1130,9 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, #endif // PDF_ENABLE_XFA } -DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, - int height, - int alpha) { +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width, + int height, + int alpha) { auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32)) return nullptr; @@ -1137,11 +1140,11 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, return pBitmap.Leak(); } -DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, - int height, - int format, - void* first_scan, - int stride) { +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_CreateEx(int width, + int height, + int format, + void* first_scan, + int stride) { FXDIB_Format fx_format; switch (format) { case FPDFBitmap_Gray: @@ -1164,7 +1167,7 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, return pBitmap.Leak(); } -DLLEXPORT int STDCALL FPDFBitmap_GetFormat(FPDF_BITMAP bitmap) { +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetFormat(FPDF_BITMAP bitmap) { if (!bitmap) return FPDFBitmap_Unknown; @@ -1184,12 +1187,12 @@ DLLEXPORT int STDCALL FPDFBitmap_GetFormat(FPDF_BITMAP bitmap) { } } -DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, - int left, - int top, - int width, - int height, - FPDF_DWORD color) { +FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap, + int left, + int top, + int width, + int height, + FPDF_DWORD color) { if (!bitmap) return; @@ -1202,23 +1205,23 @@ DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, device.FillRect(&rect, color); } -DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap) { +FPDF_EXPORT void* FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap) { return bitmap ? CFXBitmapFromFPDFBitmap(bitmap)->GetBuffer() : nullptr; } -DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap) { +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetWidth(FPDF_BITMAP bitmap) { return bitmap ? CFXBitmapFromFPDFBitmap(bitmap)->GetWidth() : 0; } -DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap) { +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetHeight(FPDF_BITMAP bitmap) { return bitmap ? CFXBitmapFromFPDFBitmap(bitmap)->GetHeight() : 0; } -DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap) { +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap) { return bitmap ? CFXBitmapFromFPDFBitmap(bitmap)->GetPitch() : 0; } -DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap) { +FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap) { CFX_RetainPtr<CFX_DIBitmap> destroyer; destroyer.Unleak(CFXBitmapFromFPDFBitmap(bitmap)); } @@ -1243,10 +1246,10 @@ void FPDF_RenderPage_Retail(CPDF_PageRenderContext* pContext, flags, bNeedToRestore, pause); } -DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, - int page_index, - double* width, - double* height) { +FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, + int page_index, + double* width, + double* height) { UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document); if (!pDoc) return false; @@ -1273,7 +1276,7 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, return true; } -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) @@ -1282,7 +1285,8 @@ FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document) { return viewRef.PrintScaling(); } -DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document) { +FPDF_EXPORT int FPDF_CALLCONV +FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 1; @@ -1290,7 +1294,7 @@ DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document) { return viewRef.NumCopies(); } -DLLEXPORT FPDF_PAGERANGE STDCALL +FPDF_EXPORT FPDF_PAGERANGE FPDF_CALLCONV FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) @@ -1299,7 +1303,7 @@ FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document) { return viewRef.PrintPageRange(); } -DLLEXPORT FPDF_DUPLEXTYPE STDCALL +FPDF_EXPORT FPDF_DUPLEXTYPE FPDF_CALLCONV FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) @@ -1315,10 +1319,11 @@ FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document) { return DuplexUndefined; } -DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, - FPDF_BYTESTRING key, - char* buffer, - unsigned long length) { +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, + FPDF_BYTESTRING key, + char* buffer, + unsigned long length) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 0; @@ -1334,7 +1339,8 @@ DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, return dwStringLen; } -DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document) { +FPDF_EXPORT FPDF_DWORD FPDF_CALLCONV +FPDF_CountNamedDests(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 0; @@ -1355,8 +1361,8 @@ DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document) { return count.ValueOrDie(); } -DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document, - FPDF_BYTESTRING name) { +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV +FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name) { if (!name || name[0] == 0) return nullptr; @@ -1369,7 +1375,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document, } #ifdef PDF_ENABLE_XFA -DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Init(FPDF_BSTR* str) { +FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Init(FPDF_BSTR* str) { if (!str) return -1; @@ -1377,9 +1383,9 @@ DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Init(FPDF_BSTR* str) { return 0; } -DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Set(FPDF_BSTR* str, - FPDF_LPCSTR bstr, - int length) { +FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Set(FPDF_BSTR* str, + FPDF_LPCSTR bstr, + int length) { if (!str) return -1; if (!bstr || !length) @@ -1408,7 +1414,7 @@ DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Set(FPDF_BSTR* str, return 0; } -DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str) { +FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Clear(FPDF_BSTR* str) { if (!str) return -1; @@ -1421,10 +1427,10 @@ DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str) { } #endif // PDF_ENABLE_XFA -DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, - int index, - void* buffer, - long* buflen) { +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document, + int index, + void* buffer, + long* buflen) { if (!buffer) *buflen = 0; diff --git a/pdfium.gni b/pdfium.gni index 530301a5d9..1842ae095b 100644 --- a/pdfium.gni +++ b/pdfium.gni @@ -66,3 +66,26 @@ declare_args() { if (pdf_use_skia && pdf_use_skia_paths) { assert(false, "Enable at most ONE of pdf_use_skia and pdf_use_skia_paths") } + +# Custom template used to enable building with "source_set" instead of +# "static_library" when doing component or complete static library builds + +template("pdf_source_set") { + if (is_component_build || pdf_is_complete_lib) { + pdf_link_target_type = "source_set" + } else { + pdf_link_target_type = "static_library" + } + target(pdf_link_target_type, target_name) { + # See http://crbug.com/594610 + forward_variables_from(invoker, [ "visibility" ]) + forward_variables_from(invoker, "*", [ "visibility" ]) + } +} + +set_defaults("pdf_source_set") { + if (!defined(deps)) { + deps = [] + } + configs = default_compiler_configs +} diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h index c0f9a6e4c6..ebe72eafb4 100644 --- a/public/fpdf_annot.h +++ b/public/fpdf_annot.h @@ -96,7 +96,7 @@ typedef enum FPDFANNOT_COLORTYPE { // subtype - the subtype to be checked. // // Returns true if this subtype supported. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype); // Experimental API. @@ -109,7 +109,7 @@ FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype); // subtype - the subtype of the new annotation. // // Returns a handle to the new annotation object, or NULL on failure. -DLLEXPORT FPDF_ANNOTATION STDCALL +FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype); // Experimental API. @@ -118,7 +118,7 @@ FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype); // page - handle to a page. // // Returns the number of annotations in |page|. -DLLEXPORT int STDCALL FPDFPage_GetAnnotCount(FPDF_PAGE page); +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page); // Experimental API. // Get annotation in |page| at |index|. Must call FPDFPage_CloseAnnot() when the @@ -128,7 +128,8 @@ DLLEXPORT int STDCALL FPDFPage_GetAnnotCount(FPDF_PAGE page); // index - the index of the annotation. // // Returns a handle to the annotation object, or NULL on failure. -DLLEXPORT FPDF_ANNOTATION STDCALL FPDFPage_GetAnnot(FPDF_PAGE page, int index); +FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page, + int index); // Experimental API. // Close an annotation. Must be called when the annotation returned by @@ -136,7 +137,7 @@ DLLEXPORT FPDF_ANNOTATION STDCALL FPDFPage_GetAnnot(FPDF_PAGE page, int index); // function does not remove the annotation from the document. // // annot - handle to an annotation. -DLLEXPORT void STDCALL FPDFPage_CloseAnnot(FPDF_ANNOTATION annot); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_CloseAnnot(FPDF_ANNOTATION annot); // Experimental API. // Remove the annotation in |page| at |index|. @@ -145,7 +146,8 @@ DLLEXPORT void STDCALL FPDFPage_CloseAnnot(FPDF_ANNOTATION annot); // index - the index of the annotation. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_RemoveAnnot(FPDF_PAGE page, int index); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page, + int index); // Experimental API. // Get the subtype of an annotation. @@ -153,7 +155,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_RemoveAnnot(FPDF_PAGE page, int index); // annot - handle to an annotation. // // Returns the annotation subtype. -DLLEXPORT FPDF_ANNOTATION_SUBTYPE STDCALL +FPDF_EXPORT FPDF_ANNOTATION_SUBTYPE FPDF_CALLCONV FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot); // Experimental API. @@ -164,7 +166,7 @@ FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot); // subtype - the subtype to be checked. // // Returns true if this subtype supported. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype); // Experimental API. @@ -178,8 +180,8 @@ FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype); // obj - handle to the object that |annot| needs to update. // // Return true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, - FPDF_PAGEOBJECT obj); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj); // Experimental API. // Add |obj| to |annot|. |obj| must have been created by @@ -192,8 +194,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, // obj - handle to the object that is to be added to |annot|. // // Return true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, - FPDF_PAGEOBJECT obj); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj); // Experimental API. // Get the total number of objects in |annot|, including path objects, text @@ -202,7 +204,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, // annot - handle to an annotation. // // Returns the number of objects in |annot|. -DLLEXPORT int STDCALL FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot); +FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot); // Experimental API. // Get the object in |annot| at |index|. @@ -211,8 +213,8 @@ DLLEXPORT int STDCALL FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot); // index - the index of the object. // // Return a handle to the object, or NULL on failure. -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFAnnot_GetObject(FPDF_ANNOTATION annot, - int index); +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV +FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index); // Experimental API. // Remove the object in |annot| at |index|. @@ -221,8 +223,8 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFAnnot_GetObject(FPDF_ANNOTATION annot, // index - the index of the object to be removed. // // Return true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, - int index); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index); // Experimental API. // Set the color of an annotation. Fails when called on annotations with @@ -235,12 +237,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, // A - buffer to hold the opacity. Ranges from 0 to 255. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetColor(FPDF_ANNOTATION annot, - FPDFANNOT_COLORTYPE type, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetColor(FPDF_ANNOTATION annot, + FPDFANNOT_COLORTYPE type, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A); // Experimental API. // Get the color of an annotation. If no color is specified, default to yellow @@ -254,12 +256,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetColor(FPDF_ANNOTATION annot, // A - buffer to hold the opacity. Ranges from 0 to 255. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_GetColor(FPDF_ANNOTATION annot, - FPDFANNOT_COLORTYPE type, - unsigned int* R, - unsigned int* G, - unsigned int* B, - unsigned int* A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetColor(FPDF_ANNOTATION annot, + FPDFANNOT_COLORTYPE type, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A); // Experimental API. // Check if the annotation is of a type that has attachment points @@ -273,7 +275,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_GetColor(FPDF_ANNOTATION annot, // // Returns true if the annotation is of a type that has quadpoints, false // otherwise. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot); // Experimental API. @@ -285,7 +287,7 @@ FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot); // quadPoints - the quadpoints to be set. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, const FS_QUADPOINTSF* quadPoints); @@ -297,7 +299,7 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, // annot - handle to an annotation. // // Returns a quadpoints object, or an empty set of quadpoints on failure. -DLLEXPORT FS_QUADPOINTSF STDCALL +FPDF_EXPORT FS_QUADPOINTSF FPDF_CALLCONV FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot); // Experimental API. @@ -309,8 +311,8 @@ FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot); // rect - the annotation rectangle to be set. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetRect(FPDF_ANNOTATION annot, - const FS_RECTF* rect); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot, + const FS_RECTF* rect); // Experimental API. // Get the annotation rectangle defining the location of the annotation. If the @@ -320,7 +322,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetRect(FPDF_ANNOTATION annot, // annot - handle to an annotation. // // Returns a rectangle object, or an empty rectangle on failure. -DLLEXPORT FS_RECTF STDCALL FPDFAnnot_GetRect(FPDF_ANNOTATION annot); +FPDF_EXPORT FS_RECTF FPDF_CALLCONV FPDFAnnot_GetRect(FPDF_ANNOTATION annot); // Experimental API. // Check if |annot|'s dictionary has |key| as a key. @@ -329,8 +331,8 @@ DLLEXPORT FS_RECTF STDCALL FPDFAnnot_GetRect(FPDF_ANNOTATION annot); // key - the key to look for. // // Returns true if |key| exists. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_HasKey(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasKey(FPDF_ANNOTATION annot, + FPDF_WIDESTRING key); // Experimental API. // Get the type of the value corresponding to |key| in |annot|'s dictionary. @@ -339,8 +341,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_HasKey(FPDF_ANNOTATION annot, // key - the key to look for. // // Returns the type of the dictionary value. -DLLEXPORT FPDF_OBJECT_TYPE STDCALL FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key); +FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV +FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, FPDF_WIDESTRING key); // Experimental API. // Set the string value corresponding to |key| in |annot|'s dictionary, @@ -352,9 +354,10 @@ DLLEXPORT FPDF_OBJECT_TYPE STDCALL FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, // value - the string value to be set, encoded in UTF16-LE. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key, - FPDF_WIDESTRING value); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, + FPDF_WIDESTRING key, + FPDF_WIDESTRING value); // Experimental API. // Get the string value corresponding to |key| in |annot|'s dictionary. |buffer| @@ -371,10 +374,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, // buflen - length of the buffer. // // Returns the length of the string value. -DLLEXPORT unsigned long STDCALL FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, - FPDF_WIDESTRING key, - void* buffer, - unsigned long buflen); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, + FPDF_WIDESTRING key, + void* buffer, + unsigned long buflen); // Experimental API. // Get the annotation flags of |annot|. @@ -382,7 +386,7 @@ DLLEXPORT unsigned long STDCALL FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, // annot - handle to an annotation. // // Returns the annotation flags. -DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot); +FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFlags(FPDF_ANNOTATION annot); // Experimental API. // Set the |annot|'s flags to be of the value |flags|. @@ -391,8 +395,8 @@ DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot); // flags - the flag values to be set. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, - int flags); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, + int flags); // Experimental API. // Get the annotation flags of |annot|, which is an interactive form @@ -402,8 +406,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, // annot - handle to an interactive form annotation. // // Returns the annotation flags specific to interactive forms. -DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, - FPDF_ANNOTATION annot); +FPDF_EXPORT int FPDF_CALLCONV +FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, FPDF_ANNOTATION annot); // Experimental API. // Retrieves an interactive form annotation whose rectangle contains a given @@ -419,7 +423,7 @@ DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page, // // Returns the interactive form annotation whose rectangle contains the given // coordinates on the page. If there is no such annotation, return NULL. -DLLEXPORT FPDF_ANNOTATION STDCALL +FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, double page_x, diff --git a/public/fpdf_attachment.h b/public/fpdf_attachment.h index a5a84658a2..5a7ab6a722 100644 --- a/public/fpdf_attachment.h +++ b/public/fpdf_attachment.h @@ -18,7 +18,8 @@ extern "C" { // document - handle to a document. // // Returns the number of embedded files in |document|. -DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document); +FPDF_EXPORT int FPDF_CALLCONV +FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document); // Experimental API. // Add an embedded file with |name| in |document|. If |name| is empty, or if @@ -30,8 +31,8 @@ DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document); // name - name of the new attachment. // // Returns a handle to the new attachment object, or NULL on failure. -DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_AddAttachment(FPDF_DOCUMENT document, - FPDF_WIDESTRING name); +FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV +FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name); // Experimental API. // Get the embedded attachment at |index| in |document|. Note that the returned @@ -41,8 +42,8 @@ DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_AddAttachment(FPDF_DOCUMENT document, // index - the index of the requested embedded file. // // Returns the handle to the attachment object, or NULL on failure. -DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_GetAttachment(FPDF_DOCUMENT document, - int index); +FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV +FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index); // Experimental API. // Delete the embedded attachment at |index| in |document|. Note that this does @@ -54,8 +55,8 @@ DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_GetAttachment(FPDF_DOCUMENT document, // index - the index of the embedded file to be deleted. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, - int index); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, int index); // Experimental API. // Get the name of the |attachment| file. |buffer| is only modified if |buflen| @@ -67,7 +68,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, // buflen - length of the buffer. // // Returns the length of the file name. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, void* buffer, unsigned long buflen); @@ -79,8 +80,8 @@ FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, // key - the key to look for. // // Returns true if |key| exists. -DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, - FPDF_WIDESTRING key); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key); // Experimental API. // Get the type of the value corresponding to |key| in the params dictionary of @@ -90,7 +91,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, // key - the key to look for. // // Returns the type of the dictionary value. -DLLEXPORT FPDF_OBJECT_TYPE STDCALL +FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key); // Experimental API. @@ -103,7 +104,7 @@ FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key); // value - the string value to be set, encoded in UTF16-LE. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key, FPDF_WIDESTRING value); @@ -124,7 +125,7 @@ FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, // buflen - length of the buffer. // // Returns the length of the dictionary value string. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key, void* buffer, @@ -141,10 +142,11 @@ FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, // len - length of file data. // // Returns true if successful. -DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, - FPDF_DOCUMENT document, - const void* contents, - const unsigned long len); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, + FPDF_DOCUMENT document, + const void* contents, + const unsigned long len); // Experimental API. // Get the file data of |attachment|. |buffer| is only modified if |buflen| is @@ -156,7 +158,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, // buflen - length of the buffer. // // Returns the length of the file. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAttachment_GetFile(FPDF_ATTACHMENT attachment, void* buffer, unsigned long buflen); diff --git a/public/fpdf_dataavail.h b/public/fpdf_dataavail.h index 2413e2be7a..12a77146d7 100644 --- a/public/fpdf_dataavail.h +++ b/public/fpdf_dataavail.h @@ -60,13 +60,13 @@ typedef void* FPDF_AVAIL; // Returns a handle to the document availability provider, or NULL on error. // // |FPDFAvail_Destroy| must be called when done with the availability provider. -DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, - FPDF_FILEACCESS* file); +FPDF_EXPORT FPDF_AVAIL FPDF_CALLCONV FPDFAvail_Create(FX_FILEAVAIL* file_avail, + FPDF_FILEACCESS* file); // Destroy the |avail| document availability provider. // // avail - handle to document availability provider to be destroyed. -DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail); +FPDF_EXPORT void FPDF_CALLCONV FPDFAvail_Destroy(FPDF_AVAIL avail); // Download hints interface. Used to receive hints for further downloading. typedef struct _FX_DOWNLOADHINTS { @@ -106,8 +106,8 @@ typedef struct _FX_DOWNLOADHINTS { // // Once all data is available, call |FPDFAvail_GetDocument| to get a document // handle. -DLLEXPORT int STDCALL -FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints); +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsDocAvail(FPDF_AVAIL avail, + FX_DOWNLOADHINTS* hints); // Get document from the availability provider. // @@ -118,8 +118,8 @@ FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints); // // When |FPDFAvail_IsDocAvail| returns TRUE, call |FPDFAvail_GetDocument| to // retrieve the document handle. -DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail, - FPDF_BYTESTRING password); +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV +FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password); // Get the page number for the first available page in a linearized PDF. // @@ -130,7 +130,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail, // For most linearized PDFs, the first available page will be the first page, // however, some PDFs might make another page the first available page. // For non-linearized PDFs, this function will always return zero. -DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc); +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc); // Check if |page_index| is ready for loading, if not, get the // |FX_DOWNLOADHINTS|. @@ -150,9 +150,9 @@ DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc); // all the generated download |hints|, if any, until this function returns // |PDF_DATA_ERROR| or |PDF_DATA_AVAIL|. Applications can then perform page // loading. -DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, - int page_index, - FX_DOWNLOADHINTS* hints); +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsPageAvail(FPDF_AVAIL avail, + int page_index, + FX_DOWNLOADHINTS* hints); // Check if form data is ready for initialization, if not, get the // |FX_DOWNLOADHINTS|. @@ -173,8 +173,8 @@ DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, // |PDF_FORM_ERROR|, |PDF_FORM_AVAIL| or |PDF_FORM_NOTEXIST|. // Applications can then perform page loading. It is recommend to call // |FPDFDOC_InitFormFillEnvironment| when |PDF_FORM_AVAIL| is returned. -DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, - FX_DOWNLOADHINTS* hints); +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsFormAvail(FPDF_AVAIL avail, + FX_DOWNLOADHINTS* hints); // Check whether a document is a linearized PDF. // @@ -189,7 +189,7 @@ DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, // when we have 1k of data. If the files size less than 1k, it returns // |PDF_LINEARIZATION_UNKNOWN| as there is insufficient information to determine // if the PDF is linearlized. -DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail); +FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsLinearized(FPDF_AVAIL avail); #ifdef __cplusplus } // extern "C" diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h index 558ea199a9..0f87361b38 100644 --- a/public/fpdf_doc.h +++ b/public/fpdf_doc.h @@ -44,7 +44,7 @@ typedef struct _FS_QUADPOINTSF { // // Returns a handle to the first child of |bookmark| or the first top-level // bookmark item. NULL if no child or top-level bookmark found. -DLLEXPORT FPDF_BOOKMARK STDCALL +FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); // Get the next sibling of |bookmark|. @@ -54,7 +54,7 @@ FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); // // Returns a handle to the next sibling of |bookmark|, or NULL if this is the // last bookmark at this level. -DLLEXPORT FPDF_BOOKMARK STDCALL +FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); // Get the title of |bookmark|. @@ -70,9 +70,10 @@ FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); // Regardless of the platform, the |buffer| is always in UTF-16LE encoding. The // string is terminated by a UTF16 NUL character. If |buflen| is less than the // required length, or |buffer| is NULL, |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, - void* buffer, - unsigned long buflen); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, + void* buffer, + unsigned long buflen); // Find the bookmark with |title| in |document|. // @@ -83,8 +84,8 @@ DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, // // |FPDFBookmark_Find| will always return the first bookmark found even if // multiple bookmarks have the same |title|. -DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, - FPDF_WIDESTRING title); +FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV +FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title); // Get the destination associated with |bookmark|. // @@ -93,8 +94,8 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, // // Returns the handle to the destination data, NULL if no destination is // associated with |bookmark|. -DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, - FPDF_BOOKMARK bookmark); +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV +FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); // Get the action associated with |bookmark|. // @@ -103,7 +104,8 @@ DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, // Returns the handle to the action data, or NULL if no action is associated // with |bookmark|. When NULL is returned, |FPDFBookmark_GetDest| should be // called to get the |bookmark| destination data. -DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark); +FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV +FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark); // Get the type of |action|. // @@ -115,7 +117,7 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark); // PDFACTION_REMOTEGOTO // PDFACTION_URI // PDFACTION_LAUNCH -DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action); +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetType(FPDF_ACTION action); // Get the destination of |action|. // @@ -128,8 +130,8 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action); // In the case of |PDFACTION_REMOTEGOTO|, you should first call // |FPDFAction_GetFilePath| then load that document, the document handle from // that document should pass as |document| to |FPDFAction_GetDest|. -DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, - FPDF_ACTION action); +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document, + FPDF_ACTION action); // Get file path of a |PDFACTION_REMOTEGOTO| |action|. // @@ -144,7 +146,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, // Regardless of the platform, the |buffer| is always in UTF-8 encoding. // If |buflen| is less than the returned length, or |buffer| is NULL, |buffer| // will not be modified. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetFilePath(FPDF_ACTION action, void* buffer, unsigned long buflen); // Get the URI path of a |PDFACTION_URI| |action|. @@ -158,10 +160,11 @@ FPDFAction_GetFilePath(FPDF_ACTION action, void* buffer, unsigned long buflen); // // The |buffer| is always encoded in 7-bit ASCII. If |buflen| is less than the // returned length, or |buffer| is NULL, |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, - FPDF_ACTION action, - void* buffer, - unsigned long buflen); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFAction_GetURIPath(FPDF_DOCUMENT document, + FPDF_ACTION action, + void* buffer, + unsigned long buflen); // Get the page index of |dest|. // @@ -169,8 +172,8 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, // dest - handle to the destination. // // Returns the page index containing |dest|. Page indices start from 0. -DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, - FPDF_DEST dest); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest); // Get the (x, y, zoom) location of |dest| in the destination page, if the // destination is in [page /XYZ x y zoom] syntax. @@ -186,13 +189,14 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, // // Note the [x, y, zoom] values are only set if the corresponding hasXVal, // hasYVal or hasZoomVal flags are true. -DLLEXPORT FPDF_BOOL STDCALL FPDFDest_GetLocationInPage(FPDF_DEST dest, - FPDF_BOOL* hasXCoord, - FPDF_BOOL* hasYCoord, - FPDF_BOOL* hasZoom, - FS_FLOAT* x, - FS_FLOAT* y, - FS_FLOAT* zoom); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFDest_GetLocationInPage(FPDF_DEST dest, + FPDF_BOOL* hasXCoord, + FPDF_BOOL* hasYCoord, + FPDF_BOOL* hasZoom, + FS_FLOAT* x, + FS_FLOAT* y, + FS_FLOAT* zoom); // Find a link at point (|x|,|y|) on |page|. // @@ -204,9 +208,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFDest_GetLocationInPage(FPDF_DEST dest, // // You can convert coordinates from screen coordinates to page coordinates using // |FPDF_DeviceToPage|. -DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, - double x, - double y); +FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFLink_GetLinkAtPoint(FPDF_PAGE page, + double x, + double y); // Find the Z-order of link at point (|x|,|y|) on |page|. // @@ -219,8 +223,9 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, // // You can convert coordinates from screen coordinates to page coordinates using // |FPDF_DeviceToPage|. -DLLEXPORT int STDCALL -FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y); +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, + double x, + double y); // Get destination info for |link|. // @@ -230,15 +235,15 @@ FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y); // Returns a handle to the destination, or NULL if there is no destination // associated with the link. In this case, you should call |FPDFLink_GetAction| // to retrieve the action associated with |link|. -DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, - FPDF_LINK link); +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFLink_GetDest(FPDF_DOCUMENT document, + FPDF_LINK link); // Get action info for |link|. // // link - handle to the link. // // Returns a handle to the action associated to |link|, or NULL if no action. -DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link); +FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK link); // Enumerates all the link annotations in |page|. // @@ -248,9 +253,9 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link); // linkAnnot - the link handle for |startPos|. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, - int* startPos, - FPDF_LINK* linkAnnot); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, + int* startPos, + FPDF_LINK* linkAnnot); // Get the rectangle for |linkAnnot|. // @@ -258,15 +263,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, // rect - the annotation rectangle. // // Returns true on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, - FS_RECTF* rect); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, + FS_RECTF* rect); // Get the count of quadrilateral points to the |linkAnnot|. // // linkAnnot - handle to the link annotation. // // Returns the count of quadrilateral points. -DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot); +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot); // Get the quadrilateral points for the specified |quadIndex| in |linkAnnot|. // @@ -275,9 +280,10 @@ DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot); // quadPoints - receives the quadrilateral points. // // Returns true on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, - int quadIndex, - FS_QUADPOINTSF* quadPoints); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, + int quadIndex, + FS_QUADPOINTSF* quadPoints); // Get meta-data |tag| content from |document|. // @@ -300,10 +306,10 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, // For linearized files, FPDFAvail_IsFormAvail must be called before this, and // it must have returned PDF_FORM_AVAIL or PDF_FORM_NOTEXIST. Before that, there // is no guarantee the metadata has been loaded. -DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document, - FPDF_BYTESTRING tag, - void* buffer, - unsigned long buflen); +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetMetaText(FPDF_DOCUMENT document, + FPDF_BYTESTRING tag, + void* buffer, + unsigned long buflen); // Get the page label for |page_index| from |document|. // @@ -317,10 +323,11 @@ DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document, // The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two // bytes of zeros indicating the end of the string. If |buflen| is less than // the returned length, or |buffer| is NULL, |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL FPDF_GetPageLabel(FPDF_DOCUMENT document, - int page_index, - void* buffer, - unsigned long buflen); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDF_GetPageLabel(FPDF_DOCUMENT document, + int page_index, + void* buffer, + unsigned long buflen); #ifdef __cplusplus } // extern "C" diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index 54127d80ea..f75744599f 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -54,7 +54,7 @@ extern "C" { // Create a new PDF document. // // Returns a handle to a new document, or NULL on failure. -DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument(); +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_CreateNewDocument(); // Create a new PDF page. // @@ -69,16 +69,17 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument(); // // The page should be closed with CPDF_ClosePage() when finished as // with any other page in the document. -DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, - int page_index, - double width, - double height); +FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDFPage_New(FPDF_DOCUMENT document, + int page_index, + double width, + double height); // Delete the page at |page_index|. // // document - handle to document. // page_index - the index of the page to delete. -DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_Delete(FPDF_DOCUMENT document, + int page_index); // Get the rotation of |page|. // @@ -89,7 +90,7 @@ DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index); // 1 - Rotated 90 degrees clockwise. // 2 - Rotated 180 degrees clockwise. // 3 - Rotated 270 degrees clockwise. -DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page); +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetRotation(FPDF_PAGE page); // Set rotation for |page|. // @@ -99,22 +100,22 @@ DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page); // 1 - Rotated 90 degrees clockwise. // 2 - Rotated 180 degrees clockwise. // 3 - Rotated 270 degrees clockwise. -DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetRotation(FPDF_PAGE page, int rotate); // Insert |page_obj| into |page|. // // page - handle to a page // page_obj - handle to a page object. The |page_obj| will be automatically // freed. -DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, - FPDF_PAGEOBJECT page_obj); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertObject(FPDF_PAGE page, + FPDF_PAGEOBJECT page_obj); // Get number of page objects inside |page|. // // page - handle to a page. // // Returns the number of objects in |page|. -DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page); +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_CountObject(FPDF_PAGE page); // Get object in |page| at |index|. // @@ -122,14 +123,15 @@ DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page); // index - the index of a page object. // // Returns the handle to the page object, or NULL on failed. -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index); +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPage_GetObject(FPDF_PAGE page, + int index); // Checks if |page| contains transparency. // // page - handle to a page. // // Returns TRUE if |page| contains transparency. -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_HasTransparency(FPDF_PAGE page); // Generate the content of |page|. // @@ -139,7 +141,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page); // // Before you save the page to a file, or reload the page, you must call // |FPDFPage_GenerateContent| or any changes to |page| will be lost. -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GenerateContent(FPDF_PAGE page); // Destroy |page_obj| by releasing its resources. |page_obj| must have been // created by FPDFPageObj_CreateNew{Path|Rect}() or @@ -148,14 +150,14 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page); // FPDFPage_InsertObject() or to an annotation through FPDFAnnot_AppendObject(). // // page_obj - handle to a page object. -DLLEXPORT void STDCALL FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_obj); +FPDF_EXPORT void FPDF_CALLCONV FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_obj); // Checks if |page_object| contains transparency. // // page_object - handle to a page object. // // Returns TRUE if |pageObject| contains transparency. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT page_object); // Get type of |page_object|. @@ -164,7 +166,7 @@ FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT page_object); // // Returns one of the FPDF_PAGEOBJ_* values on success, FPDF_PAGEOBJ_UNKNOWN on // error. -DLLEXPORT int STDCALL FPDFPageObj_GetType(FPDF_PAGEOBJECT page_object); +FPDF_EXPORT int FPDF_CALLCONV FPDFPageObj_GetType(FPDF_PAGEOBJECT page_object); // Transform |page_object| by the given matrix. // @@ -180,13 +182,14 @@ DLLEXPORT int STDCALL FPDFPageObj_GetType(FPDF_PAGEOBJECT page_object); // |a c e| // |b d f| // and can be used to scale, rotate, shear and translate the |page_object|. -DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, - double a, - double b, - double c, - double d, - double e, - double f); +FPDF_EXPORT void FPDF_CALLCONV +FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, + double a, + double b, + double c, + double d, + double e, + double f); // Transform all annotations in |page|. // @@ -202,20 +205,20 @@ DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, // |a c e| // |b d f| // and can be used to scale, rotate, shear and translate the |page| annotations. -DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, - double a, - double b, - double c, - double d, - double e, - double f); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_TransformAnnots(FPDF_PAGE page, + double a, + double b, + double c, + double d, + double e, + double f); // Create a new image object. // // document - handle to a document. // // Returns a handle to a new image object. -DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_NewImageObj(FPDF_DOCUMENT document); // Load an image from a JPEG image file and then set it into |image_object|. @@ -232,7 +235,7 @@ FPDFPageObj_NewImageObj(FPDF_DOCUMENT document); // for all the loaded pages. Pass |pages| and page count (|nCount|) to this API // to clear the image cache. If the image is not previously shared, or NULL is a // valid |pages| value. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, @@ -254,7 +257,7 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, // valid |pages| value. This function loads the JPEG image inline, so the image // content is copied to the file. This allows |fileAccess| and its associated // data to be deleted after this function returns. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages, int nCount, FPDF_PAGEOBJECT image_object, @@ -276,13 +279,14 @@ FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages, // and can be used to scale, rotate, shear and translate the |page| annotations. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, - double a, - double b, - double c, - double d, - double e, - double f); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, + double a, + double b, + double c, + double d, + double e, + double f); // Set |bitmap| to |image_object|. // @@ -292,10 +296,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, // bitmap - handle of the bitmap. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, - int nCount, - FPDF_PAGEOBJECT image_object, - FPDF_BITMAP bitmap); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFImageObj_SetBitmap(FPDF_PAGE* pages, + int nCount, + FPDF_PAGEOBJECT image_object, + FPDF_BITMAP bitmap); // Get a bitmap rasterisation of |image_object|. The returned bitmap will be // owned by the caller, and FPDFBitmap_Destroy() must be called on the returned @@ -304,7 +309,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, // image_object - handle to an image object. // // Returns the bitmap. -DLLEXPORT FPDF_BITMAP STDCALL +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object); // Get the decoded image data of |image_object|. The decoded data is the @@ -317,7 +322,7 @@ FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object); // buflen - length of the buffer. // // Returns the length of the decoded image data. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object, void* buffer, unsigned long buflen); @@ -331,7 +336,7 @@ FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object, // buflen - length of the buffer. // // Returns the length of the raw image data. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object, void* buffer, unsigned long buflen); @@ -341,7 +346,7 @@ FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object, // image_object - handle to an image object. // // Returns the number of |image_object|'s filters. -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object); // Get the filter at |index| of |image_object|'s list of filters. Note that the @@ -355,7 +360,7 @@ FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object); // buflen - length of the buffer. // // Returns the length of the filter string. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, int index, void* buffer, @@ -367,7 +372,8 @@ FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, // y - initial vertical position. // // Returns a handle to a new path object. -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y); +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewPath(float x, + float y); // Create a closed path consisting of a rectangle. // @@ -377,10 +383,10 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y); // h - height of the rectangle. // // Returns a handle to the new path object. -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewRect(float x, - float y, - float w, - float h); +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewRect(float x, + float y, + float w, + float h); // Get the bounding box of |page_object|. // @@ -391,11 +397,12 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewRect(float x, // top - pointer where the top coordinate will be stored // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_GetBounds(FPDF_PAGEOBJECT page_object, - float* left, - float* bottom, - float* right, - float* top); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_GetBounds(FPDF_PAGEOBJECT page_object, + float* left, + float* bottom, + float* right, + float* top); // Set the blend mode of |page_object|. // @@ -405,8 +412,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_GetBounds(FPDF_PAGEOBJECT page_object, // Blend mode can be one of following: Color, ColorBurn, ColorDodge, Darken, // Difference, Exclusion, HardLight, Hue, Lighten, Luminosity, Multiply, Normal, // Overlay, Saturation, Screen, SoftLight -DLLEXPORT void STDCALL FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, - FPDF_BYTESTRING blend_mode); +FPDF_EXPORT void FPDF_CALLCONV +FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, + FPDF_BYTESTRING blend_mode); // Set the stroke RGBA of a path. Range of values: 0 - 255. // @@ -417,11 +425,12 @@ DLLEXPORT void STDCALL FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, // A - the stroke alpha for the path. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A); // Get the stroke RGBA of a path. Range of values: 0 - 255. // @@ -432,11 +441,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, // A - the stroke alpha of the path. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, - unsigned int* R, - unsigned int* G, - unsigned int* B, - unsigned int* A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A); // Set the stroke width of a path. // @@ -444,8 +454,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, // width - the width of the stroke. // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, - float width); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width); // Set the line join of |page_object|. // @@ -454,8 +464,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, // // Line join can be one of following: FPDF_LINEJOIN_MITER, FPDF_LINEJOIN_ROUND, // FPDF_LINEJOIN_BEVEL -DLLEXPORT void STDCALL STDCALL FPDFPath_SetLineJoin(FPDF_PAGEOBJECT page_object, - int line_join); +FPDF_EXPORT void FPDF_CALLCONV FPDF_CALLCONV +FPDFPath_SetLineJoin(FPDF_PAGEOBJECT page_object, int line_join); // Set the line cap of |page_object|. // @@ -464,8 +474,8 @@ DLLEXPORT void STDCALL STDCALL FPDFPath_SetLineJoin(FPDF_PAGEOBJECT page_object, // // Line cap can be one of following: FPDF_LINECAP_BUTT, FPDF_LINECAP_ROUND, // FPDF_LINECAP_PROJECTING_SQUARE -DLLEXPORT void STDCALL FPDFPath_SetLineCap(FPDF_PAGEOBJECT page_object, - int line_cap); +FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineCap(FPDF_PAGEOBJECT page_object, + int line_cap); // Set the fill RGBA of a path. Range of values: 0 - 255. // @@ -476,11 +486,11 @@ DLLEXPORT void STDCALL FPDFPath_SetLineCap(FPDF_PAGEOBJECT page_object, // A - the fill alpha for the path. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A); // Get the fill RGBA of a path. Range of values: 0 - 255. // @@ -491,11 +501,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, // A - the fill alpha of the path. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, - unsigned int* R, - unsigned int* G, - unsigned int* B, - unsigned int* A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A); // Move a path's current point. // @@ -507,9 +517,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, // new one. // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, - float x, - float y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_MoveTo(FPDF_PAGEOBJECT path, + float x, + float y); // Add a line between the current point and a new point in the path. // @@ -520,9 +530,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, // The path's current point is changed to (x, y). // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_LineTo(FPDF_PAGEOBJECT path, - float x, - float y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_LineTo(FPDF_PAGEOBJECT path, + float x, + float y); // Add a cubic Bezier curve to the given path, starting at the current point. // @@ -535,13 +545,13 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_LineTo(FPDF_PAGEOBJECT path, // y3 - the vertical position of the ending point of the Bezier curve. // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_BezierTo(FPDF_PAGEOBJECT path, - float x1, - float y1, - float x2, - float y2, - float x3, - float y3); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_BezierTo(FPDF_PAGEOBJECT path, + float x1, + float y1, + float x2, + float y2, + float x3, + float y3); // Close the current subpath of a given path. // @@ -551,7 +561,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_BezierTo(FPDF_PAGEOBJECT path, // subpath, thus terminating the current subpath. // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_Close(FPDF_PAGEOBJECT path); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_Close(FPDF_PAGEOBJECT path); // Set the drawing mode of a path. // @@ -561,9 +571,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_Close(FPDF_PAGEOBJECT path); // stroke - a boolean specifying if the path should be stroked or not. // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, - int fillmode, - FPDF_BOOL stroke); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, + int fillmode, + FPDF_BOOL stroke); // Create a new text object using one of the standard PDF fonts. // @@ -572,9 +582,10 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, // font_size - the font size for the new text object. // // Returns a handle to a new text object, or NULL on failure -DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, - FPDF_BYTESTRING font, - float font_size); +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV +FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, + FPDF_BYTESTRING font, + float font_size); // Set the text for a textobject. If it had text, it will be replaced. // @@ -582,8 +593,8 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, // text - the UTF-16LE encoded string containing the text to be added. // // Returns TRUE on success -DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object, - FPDF_WIDESTRING text); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFText_SetText(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text); // Returns a font object loaded from a stream of data. The font is loaded // into the document. @@ -598,11 +609,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object, // The loaded font can be closed using FPDF_Font_Close. // // Returns NULL on failure -DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadFont(FPDF_DOCUMENT document, - const uint8_t* data, - uint32_t size, - int font_type, - FPDF_BOOL cid); +FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadFont(FPDF_DOCUMENT document, + const uint8_t* data, + uint32_t size, + int font_type, + FPDF_BOOL cid); // Set the fill RGBA of a text object. Range of values: 0 - 255. // @@ -613,16 +624,17 @@ DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadFont(FPDF_DOCUMENT document, // A - the fill alpha for the path. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetFillColor(FPDF_PAGEOBJECT text_object, - unsigned int R, - unsigned int G, - unsigned int B, - unsigned int A); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFText_SetFillColor(FPDF_PAGEOBJECT text_object, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A); // Close a loaded PDF font. // // font - Handle to the loaded font. -DLLEXPORT void STDCALL FPDFFont_Close(FPDF_FONT font); +FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close(FPDF_FONT font); // Create a new text object using a loaded font. // @@ -631,7 +643,7 @@ DLLEXPORT void STDCALL FPDFFont_Close(FPDF_FONT font); // font_size - the font size for the new text object. // // Returns a handle to a new text object, or NULL on failure -DLLEXPORT FPDF_PAGEOBJECT STDCALL +FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document, FPDF_FONT font, float font_size); diff --git a/public/fpdf_ext.h b/public/fpdf_ext.h index 3465878990..e488c5283b 100644 --- a/public/fpdf_ext.h +++ b/public/fpdf_ext.h @@ -64,7 +64,7 @@ typedef struct _UNSUPPORT_INFO { // unsp_info - Pointer to an UNSUPPORT_INFO structure. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info); // Unknown page mode. @@ -89,7 +89,7 @@ FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info); // Returns one of the |PAGEMODE_*| flags defined above. // // The page mode defines how the document should be initially displayed. -DLLEXPORT int STDCALL FPDFDoc_GetPageMode(FPDF_DOCUMENT document); +FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetPageMode(FPDF_DOCUMENT document); #ifdef __cplusplus } // extern "C" diff --git a/public/fpdf_flatten.h b/public/fpdf_flatten.h index c1e354e906..614540e156 100644 --- a/public/fpdf_flatten.h +++ b/public/fpdf_flatten.h @@ -35,7 +35,7 @@ extern "C" { // // Currently, all failures return |FLATTEN_FAIL| with no indication of the // cause. -DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag); +FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag); #ifdef __cplusplus } // extern "C" diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h index 617bc34b17..6a90140097 100644 --- a/public/fpdf_formfill.h +++ b/public/fpdf_formfill.h @@ -1081,7 +1081,7 @@ typedef struct _FPDF_FORMFILLINFO { * Return Value: * Return handler to the form fill module. NULL means fails. **/ -DLLEXPORT FPDF_FORMHANDLE STDCALL +FPDF_EXPORT FPDF_FORMHANDLE FPDF_CALLCONV FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo); @@ -1094,7 +1094,8 @@ FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, * Return Value: * NULL. **/ -DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle); +FPDF_EXPORT void FPDF_CALLCONV +FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle); /** * Function: FORM_OnAfterLoadPage @@ -1108,8 +1109,8 @@ DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle); * Return Value: * NONE. **/ -DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, - FPDF_FORMHANDLE hHandle); +FPDF_EXPORT void FPDF_CALLCONV FORM_OnAfterLoadPage(FPDF_PAGE page, + FPDF_FORMHANDLE hHandle); /** * Function: FORM_OnBeforeClosePage @@ -1124,8 +1125,8 @@ DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, * Return Value: * NONE. **/ -DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, - FPDF_FORMHANDLE hHandle); +FPDF_EXPORT void FPDF_CALLCONV FORM_OnBeforeClosePage(FPDF_PAGE page, + FPDF_FORMHANDLE hHandle); /** * Function: FORM_DoDocumentJSAction @@ -1142,7 +1143,7 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, *document, this method will execute the javascript action; * otherwise, the method will do nothing. **/ -DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle); +FPDF_EXPORT void FPDF_CALLCONV FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle); /** * Function: FORM_DoDocumentOpenAction @@ -1157,7 +1158,8 @@ DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle); * This method will do nothing if there is no open-actions embedded in *the document. **/ -DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle); +FPDF_EXPORT void FPDF_CALLCONV +FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle); // additional actions type of document. #define FPDFDOC_AACTION_WC \ @@ -1187,8 +1189,8 @@ DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle); *additional-action corresponding to the specified aaType. **/ -DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, - int aaType); +FPDF_EXPORT void FPDF_CALLCONV FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, + int aaType); // Additional-action types of page object #define FPDFPAGE_AACTION_OPEN \ @@ -1213,9 +1215,9 @@ DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, * This method will do nothing if no additional-action corresponding to *the specified aaType exists. **/ -DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, - FPDF_FORMHANDLE hHandle, - int aaType); +FPDF_EXPORT void FPDF_CALLCONV FORM_DoPageAAction(FPDF_PAGE page, + FPDF_FORMHANDLE hHandle, + int aaType); /** * Function: FORM_OnMouseMove @@ -1233,11 +1235,11 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y); /** * Function: FORM_OnLButtonDown @@ -1256,11 +1258,11 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y); /** * Function: FORM_OnLButtonUp @@ -1277,23 +1279,23 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y); #ifdef PDF_ENABLE_XFA -DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y); -DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int modifier, - double page_x, - double page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int modifier, + double page_x, + double page_y); #endif // PDF_ENABLE_XFA /** @@ -1310,10 +1312,10 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int nKeyCode, - int modifier); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int nKeyCode, + int modifier); /** * Function: FORM_OnKeyUp @@ -1329,10 +1331,10 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int nKeyCode, - int modifier); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int nKeyCode, + int modifier); /** * Function: FORM_OnChar @@ -1349,10 +1351,10 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - int nChar, - int modifier); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnChar(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + int nChar, + int modifier); /** * Function: FORM_GetSelectedText @@ -1372,10 +1374,11 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, * Length in bytes of selected text in form text field or form combobox * text field. **/ -DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - void* buffer, - unsigned long buflen); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + void* buffer, + unsigned long buflen); /** * Function: FORM_ReplaceSelection @@ -1393,9 +1396,9 @@ DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, * Return Value: * None. **/ -DLLEXPORT void STDCALL FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - FPDF_WIDESTRING wsText); +FPDF_EXPORT void FPDF_CALLCONV FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + FPDF_WIDESTRING wsText); /** * Function: FORM_ForceToKillFocus. @@ -1409,7 +1412,8 @@ DLLEXPORT void STDCALL FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, * Return Value: * TRUE indicates success; otherwise false. **/ -DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle); // Field Types #define FPDF_FORMFIELD_UNKNOWN 0 // Unknown. @@ -1436,10 +1440,11 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle); * Return the type of the form field; -1 indicates no field. * See field types above. **/ -DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - double page_x, - double page_y); +FPDF_EXPORT int FPDF_CALLCONV +FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + double page_x, + double page_y); /** * Function: FPDFPage_FormFieldZOrderAtPoint @@ -1454,10 +1459,11 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, * Return the z-order of the form field; -1 indicates no field. * Higher numbers are closer to the front. **/ -DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, - FPDF_PAGE page, - double page_x, - double page_y); +FPDF_EXPORT int FPDF_CALLCONV +FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, + FPDF_PAGE page, + double page_x, + double page_y); /** * Function: FPDF_SetFormFieldHighlightColor @@ -1481,9 +1487,10 @@ DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, * Please refresh the client window to show the highlight immediately *if necessary. **/ -DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, - int fieldType, - unsigned long color); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, + int fieldType, + unsigned long color); /** * Function: FPDF_SetFormFieldHighlightAlpha @@ -1499,8 +1506,8 @@ DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, * Return Value: * NONE. **/ -DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, - unsigned char alpha); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha); /** * Function: FPDF_RemoveFormFieldHighlight @@ -1514,7 +1521,8 @@ DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, * Please refresh the client window to remove the highlight immediately *if necessary. **/ -DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle); /** * Function: FPDF_FFLDraw @@ -1554,26 +1562,26 @@ DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle); *call this function after rendering functions, such as FPDF_RenderPageBitmap or *FPDF_RenderPageBitmap_Start, finish rendering the page contents. **/ -DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, - FPDF_BITMAP bitmap, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags); +FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, + FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags); #ifdef _SKIA_SUPPORT_ -DLLEXPORT void STDCALL FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, - FPDF_RECORDER recorder, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags); +FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, + FPDF_RECORDER recorder, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags); #endif #ifdef PDF_ENABLE_XFA @@ -1590,8 +1598,8 @@ DLLEXPORT void STDCALL FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, * TRUE indicates that the input document has XFA fields, *otherwise FALSE. **/ -DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, - int* docType); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_HasXFAField(FPDF_DOCUMENT document, + int* docType); /** * Function: FPDF_LoadXFA @@ -1603,7 +1611,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, * Return Value: * TRUE indicates success,otherwise FALSE. **/ -DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document); /** * Function: FPDF_Widget_Undo @@ -1616,8 +1624,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document); * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget); +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Undo(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget); /** * Function: FPDF_Widget_Redo * This method will implement the redo feature for the specified xfa @@ -1629,8 +1637,8 @@ DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget); +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Redo(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget); /** * Function: FPDF_Widget_SelectAll * This method will implement the select all feature for the specified @@ -1642,8 +1650,8 @@ DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget); +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_SelectAll(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget); /** * Function: FPDF_Widget_Copy * This method will implement the copy feature for the specified xfa @@ -1658,10 +1666,10 @@ DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD* size); +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Copy(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget, + FPDF_WIDESTRING wsText, + FPDF_DWORD* size); /** * Function: FPDF_Widget_Cut * This method will implement the cut feature for the specified xfa @@ -1676,10 +1684,10 @@ DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD* size); +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Cut(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget, + FPDF_WIDESTRING wsText, + FPDF_DWORD* size); /** * Function: FPDF_Widget_Paste * This method will implement the paste feature for the specified xfa @@ -1693,10 +1701,10 @@ DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD size); +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Paste(FPDF_DOCUMENT document, + FPDF_WIDGET hWidget, + FPDF_WIDESTRING wsText, + FPDF_DWORD size); /** * Function: FPDF_Widget_ReplaceSpellCheckWord * This method will implement the spell check feature for the specified @@ -1712,7 +1720,7 @@ DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, @@ -1734,7 +1742,7 @@ FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, @@ -1748,7 +1756,8 @@ FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, * Return Value: * None. **/ -DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle); +FPDF_EXPORT int FPDF_CALLCONV +FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle); /** * Function: FPDF_StringHandleGetStringByIndex * This method will get the specified index of the text buffer. @@ -1761,7 +1770,7 @@ DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle); * Return Value: * TRUE indicates success, otherwise FALSE. **/ -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle, int index, FPDF_BYTESTRING bsText, @@ -1774,7 +1783,8 @@ FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle, * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle); /** * Function: FPDF_StringHandleAddString * This method will add the specified text buffer. @@ -1786,7 +1796,7 @@ DLLEXPORT void STDCALL FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle); * Return Value: * TRUE indicates success, otherwise FALSE. **/ -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, FPDF_BYTESTRING bsText, FPDF_DWORD size); diff --git a/public/fpdf_ppo.h b/public/fpdf_ppo.h index d9c83002b5..88c3162ecb 100644 --- a/public/fpdf_ppo.h +++ b/public/fpdf_ppo.h @@ -23,10 +23,10 @@ extern "C" { // index - The page index to insert at. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc, - FPDF_DOCUMENT src_doc, - FPDF_BYTESTRING pagerange, - int index); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_ImportPages(FPDF_DOCUMENT dest_doc, + FPDF_DOCUMENT src_doc, + FPDF_BYTESTRING pagerange, + int index); // Copy the viewer preferences from |src_doc| into |dest_doc|. // @@ -34,8 +34,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc, // src_doc - Document to read the viewer preferences from. // // Returns TRUE on success. -DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, - FPDF_DOCUMENT src_doc); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc); #ifdef __cplusplus } // extern "C" diff --git a/public/fpdf_progressive.h b/public/fpdf_progressive.h index 24b9ddbe8a..3f0ae293a8 100644 --- a/public/fpdf_progressive.h +++ b/public/fpdf_progressive.h @@ -79,15 +79,15 @@ typedef struct _IFSDK_PAUSE { // Rendering Status. See flags for progressive process status for the // details. // -DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags, - IFSDK_PAUSE* pause); +FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags, + IFSDK_PAUSE* pause); // Function: FPDF_RenderPage_Continue // Continue rendering a PDF page. @@ -101,8 +101,8 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, // Return value: // The rendering status. See flags for progressive process status for // the details. -DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, - IFSDK_PAUSE* pause); +FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPage_Continue(FPDF_PAGE page, + IFSDK_PAUSE* pause); // Function: FPDF_RenderPage_Close // Release the resource allocate during page rendering. Need to be @@ -113,7 +113,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, // function. // Return value: // NULL -DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page); +FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage_Close(FPDF_PAGE page); #ifdef __cplusplus } diff --git a/public/fpdf_save.h b/public/fpdf_save.h index c34e2bc6c7..6ffca52ee3 100644 --- a/public/fpdf_save.h +++ b/public/fpdf_save.h @@ -59,9 +59,9 @@ typedef struct FPDF_FILEWRITE_ { // Return value: // TRUE for succeed, FALSE for failed. // -DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy(FPDF_DOCUMENT document, - FPDF_FILEWRITE* pFileWrite, - FPDF_DWORD flags); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SaveAsCopy(FPDF_DOCUMENT document, + FPDF_FILEWRITE* pFileWrite, + FPDF_DWORD flags); // Function: FPDF_SaveWithVersion // Same as function ::FPDF_SaveAsCopy, except the file version of the @@ -75,10 +75,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy(FPDF_DOCUMENT document, // Return value: // TRUE if succeed, FALSE if failed. // -DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, - FPDF_FILEWRITE* pFileWrite, - FPDF_DWORD flags, - int fileVersion); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDF_SaveWithVersion(FPDF_DOCUMENT document, + FPDF_FILEWRITE* pFileWrite, + FPDF_DWORD flags, + int fileVersion); #ifdef __cplusplus } diff --git a/public/fpdf_searchex.h b/public/fpdf_searchex.h index a795a52394..207c1046c1 100644 --- a/public/fpdf_searchex.h +++ b/public/fpdf_searchex.h @@ -20,7 +20,7 @@ extern "C" { // nTextIndex - index of the text returned from |FPDFText_GetText|. // // Returns the index of the character in internal character list. -1 for error. -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex); // Get the text index in |text_page| internal character list. @@ -29,7 +29,7 @@ FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex); // nCharIndex - index of the character in internal character list. // // Returns the index of the text returned from |FPDFText_GetText|. -1 for error. -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetTextIndexFromCharIndex(FPDF_TEXTPAGE text_page, int nCharIndex); #ifdef __cplusplus diff --git a/public/fpdf_structtree.h b/public/fpdf_structtree.h index 9cf46cc306..688471f28d 100644 --- a/public/fpdf_structtree.h +++ b/public/fpdf_structtree.h @@ -21,7 +21,8 @@ extern "C" { // function. // Return value: // A handle to the structure tree or NULL on error. -DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page); +FPDF_EXPORT FPDF_STRUCTTREE FPDF_CALLCONV +FPDF_StructTree_GetForPage(FPDF_PAGE page); // Function: FPDF_StructTree_Close // Release the resource allocate by FPDF_StructTree_GetForPage. @@ -30,7 +31,8 @@ DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page); // FPDF_StructTree_LoadPage function. // Return value: // NULL -DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree); // Function: FPDF_StructTree_CountChildren // Count the number of children for the structure tree. @@ -39,7 +41,7 @@ DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree); // FPDF_StructTree_LoadPage function. // Return value: // The number of children, or -1 on error. -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree); // Function: FPDF_StructTree_GetChildAtIndex @@ -50,7 +52,7 @@ FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree); // index - The index for the child, 0-based. // Return value: // The child at the n-th index or NULL on error. -DLLEXPORT FPDF_STRUCTELEMENT STDCALL +FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index); // Function: FPDF_StructElement_GetAltText @@ -68,7 +70,7 @@ FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index); // encoding. The string is terminated by a UTF16 NUL character. If // |buflen| is less than the required length, or |buffer| is NULL, // |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element, void* buffer, unsigned long buflen); @@ -88,7 +90,7 @@ FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element, // encoding. The string is terminated by a UTF16 NUL character. If // |buflen| is less than the required length, or |buffer| is NULL, // |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element, void* buffer, unsigned long buflen); @@ -108,7 +110,7 @@ FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element, // encoding. The string is terminated by a UTF16 NUL character. If // |buflen| is less than the required length, or |buffer| is NULL, // |buffer| will not be modified. -DLLEXPORT unsigned long STDCALL +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element, void* buffer, unsigned long buflen); @@ -119,7 +121,7 @@ FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element, // struct_element - Handle to the struct element. // Return value: // The number of children, or -1 on error. -DLLEXPORT int STDCALL +FPDF_EXPORT int FPDF_CALLCONV FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element); // Function: FPDF_StructElement_GetChildAtIndex @@ -132,7 +134,7 @@ FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element); // Comments: // If the child exists but is not an element, then this function will // return NULL. This will also return NULL for out of bounds indices. -DLLEXPORT FPDF_STRUCTELEMENT STDCALL +FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element, int index); diff --git a/public/fpdf_sysfontinfo.h b/public/fpdf_sysfontinfo.h index c351026973..4acaa033b2 100644 --- a/public/fpdf_sysfontinfo.h +++ b/public/fpdf_sysfontinfo.h @@ -244,7 +244,7 @@ typedef struct FPDF_CharsetFontMap_ { * Return Value: * Pointer to the Charset Font Map. **/ -DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap(); +FPDF_EXPORT const FPDF_CharsetFontMap* FPDF_CALLCONV FPDF_GetDefaultTTFMap(); /** * Function: FPDF_AddInstalledFont @@ -259,9 +259,9 @@ DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap(); * Return Value: * None. **/ -DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, - const char* face, - int charset); +FPDF_EXPORT void FPDF_CALLCONV FPDF_AddInstalledFont(void* mapper, + const char* face, + int charset); /** * Function: FPDF_SetSystemFontInfo @@ -275,7 +275,8 @@ DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, * Return Value: * None **/ -DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo); /** * Function: FPDF_GetDefaultSystemFontInfo @@ -294,7 +295,7 @@ DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo); * Application should call FPDF_FreeDefaultSystemFontInfo to free the *returned pointer. **/ -DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo(); +FPDF_EXPORT FPDF_SYSFONTINFO* FPDF_CALLCONV FPDF_GetDefaultSystemFontInfo(); /** * Function: FPDF_FreeDefaultSystemFontInfo @@ -307,7 +308,7 @@ DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo(); * Return Value: * None **/ -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo); #ifdef __cplusplus diff --git a/public/fpdf_text.h b/public/fpdf_text.h index 5c241527eb..c069144026 100644 --- a/public/fpdf_text.h +++ b/public/fpdf_text.h @@ -27,7 +27,7 @@ extern "C" { // Application must call FPDFText_ClosePage to release the text page // information. // -DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page); +FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page); // Function: FPDFText_ClosePage // Release all resources allocated for a text page information @@ -38,7 +38,7 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page); // Return Value: // None. // -DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page); +FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page); // Function: FPDFText_CountChars // Get number of characters in a page. @@ -56,7 +56,7 @@ DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page); // first character in the page // has an index value of zero. // -DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page); +FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page); // Function: FPDFText_GetUnicode // Get Unicode of a character in a page. @@ -70,8 +70,8 @@ DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page); // convert to Unicode, // the return value will be zero. // -DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, - int index); +FPDF_EXPORT unsigned int FPDF_CALLCONV +FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index); // Function: FPDFText_GetFontSize // Get the font size of a particular character. @@ -84,8 +84,8 @@ DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, // 1/72 inch). // This is the typographic size of the font (so called "em size"). // -DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, - int index); +FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, + int index); // Function: FPDFText_GetCharBox // Get bounding box of a particular character. @@ -106,12 +106,12 @@ DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, // Comments: // All positions are measured in PDF "user space". // -DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, - int index, - double* left, - double* right, - double* bottom, - double* top); +FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, + int index, + double* left, + double* right, + double* bottom, + double* top); // Function: FPDFText_GetCharIndexAtPos // Get the index of a character at or nearby a certain position on the @@ -131,11 +131,12 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, // be -1. // If an error occurs, -3 will be returned. // -DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, - double x, - double y, - double xTolerance, - double yTolerance); +FPDF_EXPORT int FPDF_CALLCONV +FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, + double x, + double y, + double xTolerance, + double yTolerance); // Function: FPDFText_GetText // Extract unicode text string from the page. @@ -154,10 +155,10 @@ DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, // Comments: // This function ignores characters without unicode information. // -DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, - int start_index, - int count, - unsigned short* result); +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page, + int start_index, + int count, + unsigned short* result); // Function: FPDFText_CountRects // Count number of rectangular areas occupied by a segment of texts. @@ -177,9 +178,9 @@ DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, // one if those characters // are on the same line and use same font settings. // -DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, - int start_index, - int count); +FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page, + int start_index, + int count); // Function: FPDFText_GetRect // Get a rectangular area from the result generated by @@ -199,12 +200,12 @@ DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, // Return Value: // None. // -DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, - int rect_index, - double* left, - double* top, - double* right, - double* bottom); +FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page, + int rect_index, + double* left, + double* top, + double* right, + double* bottom); // Function: FPDFText_GetBoundedText // Extract unicode text within a rectangular boundary on the page. @@ -232,13 +233,13 @@ DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, // If the buffer is too small, as much text as will fit is copied into // it. // -DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, - double left, - double top, - double right, - double bottom, - unsigned short* buffer, - int buflen); +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, + double left, + double top, + double right, + double bottom, + unsigned short* buffer, + int buflen); // Flags used by FPDFText_FindStart function. #define FPDF_MATCHCASE \ @@ -258,10 +259,11 @@ DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, // A handle for the search context. FPDFText_FindClose must be called // to release this handle. // -DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, - FPDF_WIDESTRING findwhat, - unsigned long flags, - int start_index); +FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV +FPDFText_FindStart(FPDF_TEXTPAGE text_page, + FPDF_WIDESTRING findwhat, + unsigned long flags, + int start_index); // Function: FPDFText_FindNext // Search in the direction from page start to end. @@ -271,7 +273,7 @@ DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, // Return Value: // Whether a match is found. // -DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle); // Function: FPDFText_FindPrev // Search in the direction from page end to start. @@ -281,7 +283,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle); // Return Value: // Whether a match is found. // -DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle); // Function: FPDFText_GetSchResultIndex // Get the starting character index of the search result. @@ -291,7 +293,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle); // Return Value: // Index for the starting character. // -DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle); +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle); // Function: FPDFText_GetSchCount // Get the number of matched characters in the search result. @@ -301,7 +303,7 @@ DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle); // Return Value: // Number of matched characters. // -DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle); +FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle); // Function: FPDFText_FindClose // Release a search context. @@ -311,7 +313,7 @@ DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle); // Return Value: // None. // -DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle); +FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle); // Function: FPDFLink_LoadWebLinks // Prepare information about weblinks in a page. @@ -336,7 +338,8 @@ DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle); // // FPDFLink_CloseWebLinks must be called to release resources. // -DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page); +FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV +FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page); // Function: FPDFLink_CountWebLinks // Count number of detected web links. @@ -345,7 +348,7 @@ DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page); // Return Value: // Number of detected web links. // -DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page); +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page); // Function: FPDFLink_GetURL // Fetch the URL information for a detected web link. @@ -366,10 +369,10 @@ DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page); // If |link_index| does not correspond to a valid link, then the result // is an empty string. // -DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, - int link_index, - unsigned short* buffer, - int buflen); +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page, + int link_index, + unsigned short* buffer, + int buflen); // Function: FPDFLink_CountRects // Count number of rectangular areas for the link. @@ -380,8 +383,8 @@ DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, // Number of rectangular areas for the link. If |link_index| does // not correspond to a valid link, then 0 is returned. // -DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, - int link_index); +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page, + int link_index); // Function: FPDFLink_GetRect // Fetch the boundaries of a rectangle for a link. @@ -401,13 +404,13 @@ DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, // None. If |link_index| does not correspond to a valid link, then // |left|, |top|, |right|, and |bottom| remain unmodified. // -DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, - int link_index, - int rect_index, - double* left, - double* top, - double* right, - double* bottom); +FPDF_EXPORT void FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page, + int link_index, + int rect_index, + double* left, + double* top, + double* right, + double* bottom); // Function: FPDFLink_CloseWebLinks // Release resources used by weblink feature. @@ -416,7 +419,7 @@ DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, // Return Value: // None. // -DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page); +FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page); #ifdef __cplusplus } diff --git a/public/fpdf_transformpage.h b/public/fpdf_transformpage.h index 66271fcda8..f26c077bde 100644 --- a/public/fpdf_transformpage.h +++ b/public/fpdf_transformpage.h @@ -26,11 +26,11 @@ typedef void* FPDF_PAGEARCLOADER; * @param[in] top - The top of the rectangle. * @retval None. */ -DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, - float left, - float bottom, - float right, - float top); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetMediaBox(FPDF_PAGE page, + float left, + float bottom, + float right, + float top); /** * Set "CropBox" entry to the page dictionary. @@ -41,11 +41,11 @@ DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, * @param[in] top - The top of the rectangle. * @retval None. */ -DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, - float left, - float bottom, - float right, - float top); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetCropBox(FPDF_PAGE page, + float left, + float bottom, + float right, + float top); /** Get "MediaBox" entry from the page dictionary. * @param[in] page - Handle to a page. @@ -59,11 +59,11 @@ DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, * rectangle. * @retval True if success,else fail. */ -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, - float* left, - float* bottom, - float* right, - float* top); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetMediaBox(FPDF_PAGE page, + float* left, + float* bottom, + float* right, + float* top); /** Get "CropBox" entry from the page dictionary. * @param[in] page - Handle to a page. @@ -77,11 +77,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, * rectangle. * @retval True if success,else fail. */ -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, - float* left, - float* bottom, - float* right, - float* top); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page, + float* left, + float* bottom, + float* right, + float* top); /** * Transform the whole page with a specified matrix, then clip the page content @@ -93,9 +93,10 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, * @Note. This function will transform the whole page, and would take effect to * all the objects in the page. */ -DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, - FS_MATRIX* matrix, - FS_RECTF* clipRect); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPage_TransFormWithClip(FPDF_PAGE page, + FS_MATRIX* matrix, + FS_RECTF* clipRect); /** * Transform (scale, rotate, shear, move) the clip path of page object. @@ -109,7 +110,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, * @param[in] f - The coefficient "f" of the matrix. * @retval None. */ -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, double a, double b, @@ -127,10 +128,10 @@ FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, * @param[in] top - The top of the clip box. * @retval a handle to the clip path. */ -DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, - float bottom, - float right, - float top); +FPDF_EXPORT FPDF_CLIPPATH FPDF_CALLCONV FPDF_CreateClipPath(float left, + float bottom, + float right, + float top); /** * Destroy the clip path. @@ -139,7 +140,7 @@ DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, * Destroy the clip path. * @retval None. */ -DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath); +FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath); /** * Clip the page content, the page content that outside the clipping region @@ -151,8 +152,8 @@ DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath); * array. In this way, the page content will be clipped * by this clip path. */ -DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page, - FPDF_CLIPPATH clipPath); +FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertClipPath(FPDF_PAGE page, + FPDF_CLIPPATH clipPath); #ifdef __cplusplus } diff --git a/public/fpdfview.h b/public/fpdfview.h index 4e2e698918..01a856d291 100644 --- a/public/fpdfview.h +++ b/public/fpdfview.h @@ -142,13 +142,36 @@ typedef int FPDF_ANNOTATION_SUBTYPE; // Dictionary value types. typedef int FPDF_OBJECT_TYPE; -#if defined(_WIN32) && defined(FPDFSDK_EXPORTS) -// On Windows system, functions are exported in a DLL -#define DLLEXPORT __declspec(dllexport) -#define STDCALL __stdcall +// Defines FPDF_EXPORT to enable symbol export +// for component builds + +#if defined(COMPONENT_BUILD) +#if defined(_WIN32) + +#if defined(FPDF_IMPLEMENTATION) +#define FPDF_EXPORT __declspec(dllexport) +#else +#define FPDF_EXPORT __declspec(dllimport) +#endif // defined(FPDF_IMPLEMENTATION) + +#else // defined(_WIN32) + +#if defined(FPDF_IMPLEMENTATION) +#define FPDF_EXPORT __attribute__((visibility("default"))) +#else +#define FPDF_EXPORT +#endif // defined(FPDF_IMPLEMENTATION) + +#endif // defined(_WIN32) + +#else // defined(COMPONENT_BUILD) +#define FPDF_EXPORT +#endif // defined(COMPONENT_BUILD) + +#if defined(_WIN32) +#define FPDF_CALLCONV __cdecl #else -#define DLLEXPORT -#define STDCALL +#define FPDF_CALLCONV #endif // Exported Functions @@ -165,7 +188,7 @@ extern "C" { // Comments: // Convenience function to call FPDF_InitLibraryWithConfig() for // backwards comatibility purposes. -DLLEXPORT void STDCALL FPDF_InitLibrary(); +FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibrary(); // Process-wide options for initializing the library. typedef struct FPDF_LIBRARY_CONFIG_ { @@ -199,8 +222,8 @@ typedef struct FPDF_LIBRARY_CONFIG_ { // Comments: // You have to call this function before you can call any PDF // processing functions. -DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig( - const FPDF_LIBRARY_CONFIG* config); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* config); // Function: FPDF_DestroyLibary // Release all resources allocated by the FPDFSDK library. @@ -213,7 +236,7 @@ DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig( // the library. // After this function is called, you should not call any PDF // processing functions. -DLLEXPORT void STDCALL FPDF_DestroyLibrary(); +FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary(); // Policy for accessing the local machine time. #define FPDF_POLICY_MACHINETIME_ACCESS 0 @@ -226,8 +249,8 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary(); // enable - True to enable, false to disable the policy. // Return value: // None. -DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, - FPDF_BOOL enable); +FPDF_EXPORT void FPDF_CALLCONV FPDF_SetSandBoxPolicy(FPDF_DWORD policy, + FPDF_BOOL enable); #if defined(_WIN32) #if defined(PDFIUM_PRINT_TEXT_WITH_GDI) @@ -245,7 +268,7 @@ typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font, // func - A function pointer. See description above. // Return value: // None. -DLLEXPORT void STDCALL +FPDF_EXPORT void FPDF_CALLCONV FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func); // Function: FPDF_SetPrintTextWithGDI @@ -255,7 +278,7 @@ FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func); // use_gdi - Set to true to enable printing text with GDI. // Return value: // None. -DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi); +FPDF_EXPORT void FPDF_CALLCONV FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi); #endif // PDFIUM_PRINT_TEXT_WITH_GDI // Function: FPDF_SetPrintPostscriptLevel @@ -268,7 +291,8 @@ DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi); // All other values are invalid. // Return value: // True if successful, false if unsuccessful (typically invalid input). -DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintPostscriptLevel(int postscript_level); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDF_SetPrintPostscriptLevel(int postscript_level); // Function: FPDF_SetPrintMode // Set printing mode when printing on Windows. @@ -281,7 +305,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintPostscriptLevel(int postscript_level); // FPDF_PRINTMODE_POSTSCRIPT3 to output level 3 postscript // Return value: // True if successful, false if unsuccessful (typically invalid input). -DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintMode(int mode); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SetPrintMode(int mode); #endif // defined(_WIN32) // Function: FPDF_LoadDocument @@ -296,8 +320,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_SetPrintMode(int mode); // Loaded document can be closed by FPDF_CloseDocument(). // If this function fails, you can use FPDF_GetLastError() to retrieve // the reason why it failed. -DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, - FPDF_BYTESTRING password); +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV +FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password); // Function: FPDF_LoadMemDocument // Open and load a PDF document from memory. @@ -317,9 +341,8 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, // If PDFium is built with the XFA module, the application should call // FPDF_LoadXFA() function after the PDF document loaded to support XFA // fields defined in the fpdfformfill.h file. -DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, - int size, - FPDF_BYTESTRING password); +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV +FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password); // Structure for custom file access. typedef struct { @@ -444,7 +467,7 @@ typedef struct _FPDF_FILEHANDLER { // If PDFium is built with the XFA module, the application should call // FPDF_LoadXFA() function after the PDF document loaded to support XFA // fields defined in the fpdfformfill.h file. -DLLEXPORT FPDF_DOCUMENT STDCALL +FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password); // Function: FPDF_GetFileVersion @@ -458,8 +481,8 @@ FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password); // Comments: // If the document was created by FPDF_CreateNewDocument, // then this function will always fail. -DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, - int* fileVersion); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc, + int* fileVersion); #define FPDF_ERR_SUCCESS 0 // No error. #define FPDF_ERR_UNKNOWN 1 // Unknown error. @@ -482,7 +505,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, // Comments: // If the previous SDK call succeeded, the return value of this // function is not defined. -DLLEXPORT unsigned long STDCALL FPDF_GetLastError(); +FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetLastError(); // Function: FPDF_GetDocPermission // Get file permission flags of the document. @@ -492,7 +515,8 @@ DLLEXPORT unsigned long STDCALL FPDF_GetLastError(); // A 32-bit integer indicating permission flags. Please refer to the // PDF Reference for detailed descriptions. If the document is not // protected, 0xffffffff will be returned. -DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDF_GetDocPermissions(FPDF_DOCUMENT document); // Function: FPDF_GetSecurityHandlerRevision // Get the revision for the security handler. @@ -502,7 +526,8 @@ DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document); // The security handler revision number. Please refer to the PDF // Reference for a detailed description. If the document is not // protected, -1 will be returned. -DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document); +FPDF_EXPORT int FPDF_CALLCONV +FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document); // Function: FPDF_GetPageCount // Get total number of pages in the document. @@ -510,7 +535,7 @@ DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document); // document - Handle to document. Returned by FPDF_LoadDocument. // Return value: // Total number of pages in the document. -DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document); +FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageCount(FPDF_DOCUMENT document); // Function: FPDF_LoadPage // Load a page inside the document. @@ -522,8 +547,8 @@ DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document); // Comments: // The loaded page can be rendered to devices using FPDF_RenderPage. // The loaded page can be closed using FPDF_ClosePage. -DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, - int page_index); +FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDF_LoadPage(FPDF_DOCUMENT document, + int page_index); // Function: FPDF_GetPageWidth // Get page width. @@ -532,7 +557,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, // Return value: // Page width (excluding non-displayable area) measured in points. // One point is 1/72 inch (around 0.3528 mm). -DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page); +FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageWidth(FPDF_PAGE page); // Function: FPDF_GetPageHeight // Get page height. @@ -541,7 +566,7 @@ DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page); // Return value: // Page height (excluding non-displayable area) measured in points. // One point is 1/72 inch (around 0.3528 mm) -DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page); +FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageHeight(FPDF_PAGE page); // Function: FPDF_GetPageSizeByIndex // Get the size of the page at the given index. @@ -554,10 +579,10 @@ DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page); // (in points). // Return value: // Non-zero for success. 0 for error (document or page not found). -DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, - int page_index, - double* width, - double* height); +FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, + int page_index, + double* width, + double* height); // Page rendering flags. They can be combined with bit-wise OR. // @@ -611,14 +636,14 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, // defined above. // Return value: // None. -DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags); +FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags); #endif // Function: FPDF_RenderPageBitmap @@ -647,14 +672,14 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, // widget and popup annotations. // Return value: // None. -DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, - FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int flags); +FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags); // Function: FPDF_RenderPageBitmapWithMatrix // Render contents of a page to a device independent bitmap. @@ -673,16 +698,17 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, // widget and popup annotations. // Return value: // None. -DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, - FPDF_PAGE page, - const FS_MATRIX* matrix, - const FS_RECTF* clipping, - int flags); +FPDF_EXPORT void FPDF_CALLCONV +FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, + FPDF_PAGE page, + const FS_MATRIX* matrix, + const FS_RECTF* clipping, + int flags); #ifdef _SKIA_SUPPORT_ -DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, - int size_x, - int size_y); +FPDF_EXPORT FPDF_RECORDER FPDF_CALLCONV FPDF_RenderPageSkp(FPDF_PAGE page, + int size_x, + int size_y); #endif // Function: FPDF_ClosePage @@ -691,7 +717,7 @@ DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, // page - Handle to the loaded page. // Return value: // None. -DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page); +FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page); // Function: FPDF_CloseDocument // Close a loaded PDF document. @@ -699,7 +725,7 @@ DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page); // document - Handle to the loaded document. // Return value: // None. -DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document); +FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document); // Function: FPDF_DeviceToPage // Convert the screen coordinates of a point to page coordinates. @@ -741,16 +767,16 @@ DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document); // You must make sure the start_x, start_y, size_x, size_y // and rotate parameters have exactly same values as you used in // the FPDF_RenderPage() function call. -DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int device_x, - int device_y, - double* page_x, - double* page_y); +FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int device_x, + int device_y, + double* page_x, + double* page_y); // Function: FPDF_PageToDevice // Convert the page coordinates of a point to screen coordinates. @@ -777,16 +803,16 @@ DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, // None. // Comments: // See comments for FPDF_DeviceToPage(). -DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - double page_x, - double page_y, - int* device_x, - int* device_y); +FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + double page_x, + double page_y, + int* device_x, + int* device_y); // Function: FPDFBitmap_Create // Create a device independent bitmap (FXDIB). @@ -817,9 +843,9 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, // This function allocates enough memory for holding all pixels in the // bitmap, but it doesn't initialize the buffer. Applications can use // FPDFBitmap_FillRect to fill the bitmap using any color. -DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, - int height, - int alpha); +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width, + int height, + int alpha); // More DIB formats // Unknown or unsupported format. @@ -858,11 +884,11 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, // If an external buffer is used, then the application should destroy // the buffer by itself. FPDFBitmap_Destroy function will not destroy // the buffer. -DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, - int height, - int format, - void* first_scan, - int stride); +FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_CreateEx(int width, + int height, + int format, + void* first_scan, + int stride); // Function: FPDFBitmap_GetFormat // Get the format of the bitmap. @@ -874,7 +900,7 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, // Comments: // Only formats supported by FPDFBitmap_CreateEx are supported by this // function; see the list of such formats above. -DLLEXPORT int STDCALL FPDFBitmap_GetFormat(FPDF_BITMAP bitmap); +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetFormat(FPDF_BITMAP bitmap); // Function: FPDFBitmap_FillRect // Fill a rectangle in a bitmap. @@ -900,12 +926,12 @@ DLLEXPORT int STDCALL FPDFBitmap_GetFormat(FPDF_BITMAP bitmap); // background will be replaced by the source color and the alpha. // // If the alpha channel is not used, the alpha parameter is ignored. -DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, - int left, - int top, - int width, - int height, - FPDF_DWORD color); +FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap, + int left, + int top, + int width, + int height, + FPDF_DWORD color); // Function: FPDFBitmap_GetBuffer // Get data buffer of a bitmap. @@ -923,7 +949,7 @@ DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, // // The data is in BGRA format. Where the A maybe unused if alpha was // not specified. -DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap); +FPDF_EXPORT void* FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap); // Function: FPDFBitmap_GetWidth // Get width of a bitmap. @@ -932,7 +958,7 @@ DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap); // or FPDFImageObj_GetBitmap. // Return value: // The width of the bitmap in pixels. -DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap); +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetWidth(FPDF_BITMAP bitmap); // Function: FPDFBitmap_GetHeight // Get height of a bitmap. @@ -941,7 +967,7 @@ DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap); // or FPDFImageObj_GetBitmap. // Return value: // The height of the bitmap in pixels. -DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap); +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetHeight(FPDF_BITMAP bitmap); // Function: FPDFBitmap_GetStride // Get number of bytes for each line in the bitmap buffer. @@ -952,7 +978,7 @@ DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap); // The number of bytes for each line in the bitmap buffer. // Comments: // The stride may be more than width * number of bytes per pixel. -DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap); +FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap); // Function: FPDFBitmap_Destroy // Destroy a bitmap and release all related buffers. @@ -964,7 +990,7 @@ DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap); // Comments: // This function will not destroy any external buffers provided when // the bitmap was created. -DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap); +FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap); // Function: FPDF_VIEWERREF_GetPrintScaling // Whether the PDF document prefers to be scaled or not. @@ -972,7 +998,7 @@ DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap); // document - Handle to the loaded document. // Return value: // None. -DLLEXPORT FPDF_BOOL STDCALL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document); // Function: FPDF_VIEWERREF_GetNumCopies @@ -981,7 +1007,8 @@ FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document); // document - Handle to the loaded document. // Return value: // The number of copies to be printed. -DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document); +FPDF_EXPORT int FPDF_CALLCONV +FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document); // Function: FPDF_VIEWERREF_GetPrintPageRange // Page numbers to initialize print dialog box when file is printed. @@ -989,7 +1016,7 @@ DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document); // document - Handle to the loaded document. // Return value: // The print page range to be used for printing. -DLLEXPORT FPDF_PAGERANGE STDCALL +FPDF_EXPORT FPDF_PAGERANGE FPDF_CALLCONV FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document); // Function: FPDF_VIEWERREF_GetDuplex @@ -999,7 +1026,7 @@ FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document); // document - Handle to the loaded document. // Return value: // The paper handling option to be used when printing. -DLLEXPORT FPDF_DUPLEXTYPE STDCALL +FPDF_EXPORT FPDF_DUPLEXTYPE FPDF_CALLCONV FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document); // Function: FPDF_VIEWERREF_GetName @@ -1016,10 +1043,11 @@ FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document); // as when |document| is invalid or |buffer| is NULL. If |length| is // less than the returned length, or |buffer| is NULL, |buffer| will // not be modified. -DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, - FPDF_BYTESTRING key, - char* buffer, - unsigned long length); +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, + FPDF_BYTESTRING key, + char* buffer, + unsigned long length); // Function: FPDF_CountNamedDests // Get the count of named destinations in the PDF document. @@ -1027,7 +1055,8 @@ DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, // document - Handle to a document // Return value: // The count of named destinations. -DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document); +FPDF_EXPORT FPDF_DWORD FPDF_CALLCONV +FPDF_CountNamedDests(FPDF_DOCUMENT document); // Function: FPDF_GetNamedDestByName // Get a the destination handle for the given name. @@ -1036,8 +1065,8 @@ DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document); // name - The name of a destination. // Return value: // The handle to the destination. -DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document, - FPDF_BYTESTRING name); +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV +FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name); // Function: FPDF_GetNamedDest // Get the named destination by index. @@ -1060,25 +1089,25 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document, // // If buflen is not sufficiently large, it will be set to -1 upon // return. -DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, - int index, - void* buffer, - long* buflen); +FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document, + int index, + void* buffer, + long* buflen); #ifdef PDF_ENABLE_XFA // Function: FPDF_BStr_Init // Helper function to initialize a byte string. -DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Init(FPDF_BSTR* str); +FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Init(FPDF_BSTR* str); // Function: FPDF_BStr_Set // Helper function to set string data. -DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Set(FPDF_BSTR* str, - FPDF_LPCSTR bstr, - int length); +FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Set(FPDF_BSTR* str, + FPDF_LPCSTR bstr, + int length); // Function: FPDF_BStr_Clear // Helper function to clear a byte string. -DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str); +FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Clear(FPDF_BSTR* str); #endif // PDF_ENABLE_XFA #ifdef __cplusplus |