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/fpdfapi/fpdf_page/include/cpdf_pageobject.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" |
11 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 11 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
12 #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" | 12 #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" |
13 #include "core/fpdfdoc/include/cpvt_word.h" | 13 #include "core/fpdfdoc/include/cpvt_word.h" |
14 #include "core/fpdfdoc/include/ipvt_fontmap.h" | 14 #include "core/fpdfdoc/include/ipvt_fontmap.h" |
15 #include "core/fxge/include/fx_ge.h" | 15 #include "core/fxge/include/fx_ge.h" |
| 16 #include "fpdfsdk/cfx_systemhandler.h" |
16 #include "fpdfsdk/fxedit/include/fx_edit.h" | 17 #include "fpdfsdk/fxedit/include/fx_edit.h" |
17 #include "fpdfsdk/fxedit/include/fxet_edit.h" | 18 #include "fpdfsdk/fxedit/include/fxet_edit.h" |
18 #include "fpdfsdk/include/fx_systemhandler.h" | |
19 | 19 |
20 #define FX_EDIT_UNDERLINEHALFWIDTH 0.5f | 20 #define FX_EDIT_UNDERLINEHALFWIDTH 0.5f |
21 #define FX_EDIT_CROSSOUTHALFWIDTH 0.5f | 21 #define FX_EDIT_CROSSOUTHALFWIDTH 0.5f |
22 | 22 |
23 CFX_FloatRect GetUnderLineRect(const CPVT_Word& word) { | 23 CFX_FloatRect GetUnderLineRect(const CPVT_Word& word) { |
24 return CFX_FloatRect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f, | 24 return CFX_FloatRect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f, |
25 word.ptWord.x + word.fWidth, | 25 word.ptWord.x + word.fWidth, |
26 word.ptWord.y + word.fDescent * 0.25f); | 26 word.ptWord.y + word.fDescent * 0.25f); |
27 } | 27 } |
28 | 28 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, | 146 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, |
147 CFX_Matrix* pUser2Device, | 147 CFX_Matrix* pUser2Device, |
148 IFX_Edit* pEdit, | 148 IFX_Edit* pEdit, |
149 FX_COLORREF crTextFill, | 149 FX_COLORREF crTextFill, |
150 FX_COLORREF crTextStroke, | 150 FX_COLORREF crTextStroke, |
151 const CFX_FloatRect& rcClip, | 151 const CFX_FloatRect& rcClip, |
152 const CFX_FloatPoint& ptOffset, | 152 const CFX_FloatPoint& ptOffset, |
153 const CPVT_WordRange* pRange, | 153 const CPVT_WordRange* pRange, |
154 IFX_SystemHandler* pSystemHandler, | 154 CFX_SystemHandler* pSystemHandler, |
155 void* pFFLData) { | 155 void* pFFLData) { |
156 const bool bContinuous = | 156 const bool bContinuous = |
157 pEdit->GetCharArray() == 0 && pEdit->GetCharSpace() <= 0.0f; | 157 pEdit->GetCharArray() == 0 && pEdit->GetCharSpace() <= 0.0f; |
158 uint16_t SubWord = pEdit->GetPasswordChar(); | 158 uint16_t SubWord = pEdit->GetPasswordChar(); |
159 FX_FLOAT fFontSize = pEdit->GetFontSize(); | 159 FX_FLOAT fFontSize = pEdit->GetFontSize(); |
160 CPVT_WordRange wrSelect = pEdit->GetSelectWordRange(); | 160 CPVT_WordRange wrSelect = pEdit->GetSelectWordRange(); |
161 int32_t nHorzScale = pEdit->GetHorzScale(); | 161 int32_t nHorzScale = pEdit->GetHorzScale(); |
162 | 162 |
163 FX_COLORREF crCurFill = crTextFill; | 163 FX_COLORREF crCurFill = crTextFill; |
164 FX_COLORREF crOldFill = crCurFill; | 164 FX_COLORREF crOldFill = crCurFill; |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 rcUnderline.left += ptOffset.x; | 642 rcUnderline.left += ptOffset.x; |
643 rcUnderline.right += ptOffset.x; | 643 rcUnderline.right += ptOffset.x; |
644 rcUnderline.top += ptOffset.y; | 644 rcUnderline.top += ptOffset.y; |
645 rcUnderline.bottom += ptOffset.y; | 645 rcUnderline.bottom += ptOffset.y; |
646 AddRectToPageObjects(pObjectHolder, color, rcUnderline); | 646 AddRectToPageObjects(pObjectHolder, color, rcUnderline); |
647 } | 647 } |
648 } | 648 } |
649 } | 649 } |
650 } | 650 } |
651 } | 651 } |
OLD | NEW |