summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfeditpage.cpp
diff options
context:
space:
mode:
authorFelix Kauselmann <licorn@gmail.com>2017-08-09 21:44:31 +0200
committerChromium commit bot <commit-bot@chromium.org>2017-08-09 20:14:43 +0000
commit00334675c18a0203f313cceb670c970a77280f49 (patch)
tree431cc04539913358cedf9f1386b7dda0e3982562 /fpdfsdk/fpdfeditpage.cpp
parentd0f2dcd0802969494e991d8cef00b4bd81aefc8d (diff)
downloadpdfium-00334675c18a0203f313cceb670c970a77280f49.tar.xz
Add a build target and a proper export header for shared library builds.
This CL adds support for Chromium's component build feature to pdfium. The export header stub in fpdfview.h is expanded to match Chromium's export mechanisms and patterns (fixes pdfium:825). A component/shared library build can be triggered by adding is_component_build = true as a gn argument. Please note that setting this will also affect some of pdfiums dependencies like v8, which will be build as components too. Additionally, this CL provides a "pdf_source_set" template which dynamically enables the use of "source_set" when building a complete static library or a shared library to reduce build time. When testing this it is recommended to only build the pdfium target as most of pdfiums test rely on non-public functions which aren't exported by the shared library. Bug: pdfium:825,pdfium:826 Change-Id: Icedc538ec535e11d1e53c4d5fabc8c064b275752 Reviewed-on: https://pdfium-review.googlesource.com/8970 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditpage.cpp')
-rw-r--r--fpdfsdk/fpdfeditpage.cpp83
1 files changed, 44 insertions, 39 deletions
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;