| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../core/include/fpdfdoc/fpdf_doc.h" | 7 #include "../../core/include/fpdfdoc/fpdf_doc.h" |
| 8 #include "../../core/include/fpdftext/fpdf_text.h" | 8 #include "../../core/include/fpdftext/fpdf_text.h" |
| 9 #include "../../public/fpdf_text.h" | 9 #include "../../public/fpdf_text.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 10 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 *left = charinfo.m_CharBox.left; | 85 *left = charinfo.m_CharBox.left; |
| 86 *right = charinfo.m_CharBox.right; | 86 *right = charinfo.m_CharBox.right; |
| 87 *bottom = charinfo.m_CharBox.bottom; | 87 *bottom = charinfo.m_CharBox.bottom; |
| 88 *top = charinfo.m_CharBox.top; | 88 *top = charinfo.m_CharBox.top; |
| 89 } | 89 } |
| 90 | 90 |
| 91 // select | 91 // select |
| 92 DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, | 92 DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, |
| 93 double x, | 93 double x, |
| 94 double y, | 94 double y, |
| 95 double xTorelance, | 95 double xTolerance, |
| 96 double yTorelance) { | 96 double yTolerance) { |
| 97 if (!text_page) | 97 if (!text_page) |
| 98 return -3; | 98 return -3; |
| 99 IPDF_TextPage* textpage = (IPDF_TextPage*)text_page; | 99 IPDF_TextPage* textpage = (IPDF_TextPage*)text_page; |
| 100 return textpage->GetIndexAtPos((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)xTorelance, | 100 return textpage->GetIndexAtPos((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)xTolerance, |
| 101 (FX_FLOAT)yTorelance); | 101 (FX_FLOAT)yTolerance); |
| 102 } | 102 } |
| 103 | 103 |
| 104 DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, | 104 DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, |
| 105 int start, | 105 int start, |
| 106 int count, | 106 int count, |
| 107 unsigned short* result) { | 107 unsigned short* result) { |
| 108 if (!text_page) | 108 if (!text_page) |
| 109 return 0; | 109 return 0; |
| 110 IPDF_TextPage* textpage = (IPDF_TextPage*)text_page; | 110 IPDF_TextPage* textpage = (IPDF_TextPage*)text_page; |
| 111 | 111 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 CFX_FloatRect rect = rectArray.GetAt(rect_index); | 285 CFX_FloatRect rect = rectArray.GetAt(rect_index); |
| 286 *left = rect.left; | 286 *left = rect.left; |
| 287 *right = rect.right; | 287 *right = rect.right; |
| 288 *top = rect.top; | 288 *top = rect.top; |
| 289 *bottom = rect.bottom; | 289 *bottom = rect.bottom; |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { | 292 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { |
| 293 delete (IPDF_LinkExtract*)link_page; | 293 delete (IPDF_LinkExtract*)link_page; |
| 294 } | 294 } |
| OLD | NEW |