summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-10 15:13:19 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-08-10 15:13:33 +0000
commit7e805d1a6f3bf7ddd04b2c1ce857a2cf6d9ff873 (patch)
tree0aab30fc879ea390d3f3351dafc5511e16ddedc0 /fpdfsdk/fpdftext.cpp
parente6c67cd64a80bd67c587ad3ffb380fe1b7574d1f (diff)
downloadpdfium-7e805d1a6f3bf7ddd04b2c1ce857a2cf6d9ff873.tar.xz
Revert "Add a build target and a proper export header for shared library builds."
This reverts commit 00334675c18a0203f313cceb670c970a77280f49. Reason for revert: Breaking the deps roller - https://chromium-review.googlesource.com/c/609307 Original change's description: > 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> TBR=thestig@chromium.org,tsepez@chromium.org,brucedawson@chromium.org,dsinclair@google.com,dsinclair@chromium.org,licorn@gmail.com Change-Id: Ib02af2298932481293f50d362ae87bfedf284821 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:825, pdfium:826 Reviewed-on: https://pdfium-review.googlesource.com/10550 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdftext.cpp')
-rw-r--r--fpdfsdk/fpdftext.cpp130
1 files changed, 63 insertions, 67 deletions
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp
index 70acf54ec7..916233c56e 100644
--- a/fpdfsdk/fpdftext.cpp
+++ b/fpdfsdk/fpdftext.cpp
@@ -43,7 +43,7 @@ CPDF_LinkExtract* CPDFLinkExtractFromFPDFPageLink(FPDF_PAGELINK link) {
} // namespace
-FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) {
+DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return nullptr;
@@ -63,11 +63,11 @@ FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) {
return textpage;
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page) {
+DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) {
delete CPDFTextPageFromFPDFTextPage(text_page);
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
+DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
if (!text_page)
return -1;
@@ -75,8 +75,8 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
return textpage->CountChars();
}
-FPDF_EXPORT unsigned int FPDF_CALLCONV
-FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index) {
+DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page,
+ int index) {
if (!text_page)
return 0;
@@ -89,8 +89,8 @@ FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index) {
return charinfo.m_Unicode;
}
-FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
- int index) {
+DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
+ int index) {
if (!text_page)
return 0;
CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
@@ -103,12 +103,12 @@ FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
return charinfo.m_FontSize;
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
- int index,
- double* left,
- double* right,
- double* bottom,
- double* top) {
+DLLEXPORT void STDCALL 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,12 +124,11 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
}
// select
-FPDF_EXPORT int FPDF_CALLCONV
-FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
- double x,
- double y,
- double xTolerance,
- double yTolerance) {
+DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
+ double x,
+ double y,
+ double xTolerance,
+ double yTolerance) {
if (!text_page)
return -3;
@@ -140,10 +139,10 @@ FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
static_cast<float>(yTolerance)));
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page,
- int start,
- int count,
- unsigned short* result) {
+DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
+ int start,
+ int count,
+ unsigned short* result) {
if (!text_page)
return 0;
@@ -163,9 +162,9 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page,
return cbUTF16str.GetLength() / sizeof(unsigned short);
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page,
- int start,
- int count) {
+DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page,
+ int start,
+ int count) {
if (!text_page)
return 0;
@@ -173,12 +172,12 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page,
return textpage->CountRects(start, count);
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
- int rect_index,
- double* left,
- double* top,
- double* right,
- double* bottom) {
+DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,
+ int rect_index,
+ double* left,
+ double* top,
+ double* right,
+ double* bottom) {
if (!text_page)
return;
@@ -191,13 +190,13 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
*bottom = rect.bottom;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
- double left,
- double top,
- double right,
- double bottom,
- unsigned short* buffer,
- int buflen) {
+DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
+ double left,
+ double top,
+ double right,
+ double bottom,
+ unsigned short* buffer,
+ int buflen) {
if (!text_page)
return 0;
@@ -220,11 +219,10 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
// Search
// -1 for end
-FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV
-FPDFText_FindStart(FPDF_TEXTPAGE text_page,
- FPDF_WIDESTRING findwhat,
- unsigned long flags,
- int start_index) {
+DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,
+ FPDF_WIDESTRING findwhat,
+ unsigned long flags,
+ int start_index) {
if (!text_page)
return nullptr;
@@ -236,7 +234,7 @@ FPDFText_FindStart(FPDF_TEXTPAGE text_page,
return textpageFind;
}
-FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle) {
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle) {
if (!handle)
return false;
@@ -244,7 +242,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle) {
return textpageFind->FindNext();
}
-FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
if (!handle)
return false;
@@ -252,8 +250,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
return textpageFind->FindPrev();
}
-FPDF_EXPORT int FPDF_CALLCONV
-FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
+DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
if (!handle)
return 0;
@@ -261,7 +258,7 @@ FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
return textpageFind->GetCurOrder();
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle) {
+DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle) {
if (!handle)
return 0;
@@ -269,7 +266,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle) {
return textpageFind->GetMatchedCount();
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle) {
+DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle) {
if (!handle)
return;
@@ -279,8 +276,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle) {
}
// web link
-FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV
-FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
+DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
if (!text_page)
return nullptr;
@@ -290,7 +286,7 @@ FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
return pageLink;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) {
+DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) {
if (!link_page)
return 0;
@@ -298,10 +294,10 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) {
return pdfium::base::checked_cast<int>(pageLink->CountLinks());
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page,
- int link_index,
- unsigned short* buffer,
- int buflen) {
+DLLEXPORT int STDCALL 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);
@@ -320,8 +316,8 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page,
return size;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page,
- int link_index) {
+DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page,
+ int link_index) {
if (!link_page || link_index < 0)
return 0;
@@ -329,13 +325,13 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page,
return pdfium::CollectionSize<int>(pageLink->GetRects(link_index));
}
-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) {
+DLLEXPORT void STDCALL 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;
@@ -350,6 +346,6 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page,
*bottom = rectArray[rect_index].bottom;
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) {
+DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) {
delete CPDFLinkExtractFromFPDFPageLink(link_page);
}