OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfdoc/include/cpdf_annot.h" | 7 #include "core/fpdfdoc/include/cpdf_annot.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
13 #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" | 13 #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" |
14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
15 #include "core/fpdfdoc/cpvt_generateap.h" | 15 #include "core/fpdfdoc/cpvt_generateap.h" |
16 #include "core/fxcrt/include/fx_memory.h" | 16 #include "core/fxcrt/include/fx_memory.h" |
17 #include "core/fxge/include/cfx_pathdata.h" | 17 #include "core/fxge/include/cfx_pathdata.h" |
18 #include "core/fxge/include/fx_ge.h" | 18 #include "core/fxge/include/fx_ge.h" |
19 | 19 |
20 CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) | 20 CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) |
21 : m_pAnnotDict(pDict), | 21 : m_pAnnotDict(pDict), |
22 m_pDocument(pDocument), | 22 m_pDocument(pDocument), |
23 m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) { | 23 m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) { |
24 if (m_sSubtype == "Circle") | 24 if (m_sSubtype == "Circle") |
25 CPVT_GenerateAP::GenerateCircleAP(m_pDocument, m_pAnnotDict); | 25 CPVT_GenerateAP::GenerateCircleAP(m_pDocument, m_pAnnotDict); |
26 else if (m_sSubtype == "Highlight") | 26 else if (m_sSubtype == "Highlight") |
27 CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); | 27 CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); |
| 28 else if (m_sSubtype == "Ink") |
| 29 CPVT_GenerateAP::GenerateInkAP(m_pDocument, m_pAnnotDict); |
28 else if (m_sSubtype == "Square") | 30 else if (m_sSubtype == "Square") |
29 CPVT_GenerateAP::GenerateSquareAP(m_pDocument, m_pAnnotDict); | 31 CPVT_GenerateAP::GenerateSquareAP(m_pDocument, m_pAnnotDict); |
30 else if (m_sSubtype == "Squiggly") | 32 else if (m_sSubtype == "Squiggly") |
31 CPVT_GenerateAP::GenerateSquigglyAP(m_pDocument, m_pAnnotDict); | 33 CPVT_GenerateAP::GenerateSquigglyAP(m_pDocument, m_pAnnotDict); |
32 else if (m_sSubtype == "StrikeOut") | 34 else if (m_sSubtype == "StrikeOut") |
33 CPVT_GenerateAP::GenerateStrikeOutAP(m_pDocument, m_pAnnotDict); | 35 CPVT_GenerateAP::GenerateStrikeOutAP(m_pDocument, m_pAnnotDict); |
34 else if (m_sSubtype == "Underline") | 36 else if (m_sSubtype == "Underline") |
35 CPVT_GenerateAP::GenerateUnderlineAP(m_pDocument, m_pAnnotDict); | 37 CPVT_GenerateAP::GenerateUnderlineAP(m_pDocument, m_pAnnotDict); |
36 } | 38 } |
37 | 39 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 CFX_PathData path; | 254 CFX_PathData path; |
253 width /= 2; | 255 width /= 2; |
254 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, | 256 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, |
255 rect.top - width); | 257 rect.top - width); |
256 int fill_type = 0; | 258 int fill_type = 0; |
257 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { | 259 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { |
258 fill_type |= FXFILL_NOPATHSMOOTH; | 260 fill_type |= FXFILL_NOPATHSMOOTH; |
259 } | 261 } |
260 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); | 262 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); |
261 } | 263 } |
OLD | NEW |