Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: core/include/fpdfapi/fpdf_pageobj.h

Issue 1695633004: Fix the way to access marked content. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_
9 9
10 #include "core/include/fpdfapi/fpdf_resource.h" 10 #include "core/include/fpdfapi/fpdf_resource.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 int GetAlpha(FX_BOOL bStroke) const { 259 int GetAlpha(FX_BOOL bStroke) const {
260 return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha 260 return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha
261 : m_pObject->m_FillAlpha) * 261 : m_pObject->m_FillAlpha) *
262 255) 262 255)
263 : 255; 263 : 255;
264 } 264 }
265 }; 265 };
266 class CPDF_ContentMarkItem { 266 class CPDF_ContentMarkItem {
267 public: 267 public:
268 typedef enum { None, PropertiesDict, DirectDict, MCID } ParamType; 268 enum ParamType { None, PropertiesDict, DirectDict };
269 269
270 CPDF_ContentMarkItem(); 270 CPDF_ContentMarkItem();
271 271
272 CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src); 272 CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src);
273 273
274 ~CPDF_ContentMarkItem(); 274 ~CPDF_ContentMarkItem();
275 275
276 inline const CFX_ByteString& GetName() const { return m_MarkName; } 276 inline const CFX_ByteString& GetName() const { return m_MarkName; }
277 277
278 inline ParamType GetParamType() const { return m_ParamType; } 278 inline ParamType GetParamType() const { return m_ParamType; }
279 279
280 inline void* GetParam() const { return m_pParam; } 280 inline CPDF_Dictionary* GetParam() const { return m_pParam; }
281 281
282 inline FX_BOOL HasMCID() const; 282 inline FX_BOOL HasMCID() const;
283 283
284 inline void SetName(const CFX_ByteString& name) { m_MarkName = name; } 284 inline void SetName(const CFX_ByteString& name) { m_MarkName = name; }
285 285
286 inline void SetParam(ParamType type, void* param) { 286 inline void SetParam(ParamType type, CPDF_Dictionary* param) {
287 m_ParamType = type; 287 m_ParamType = type;
288 m_pParam = param; 288 m_pParam = param;
289 } 289 }
290 290
291 private: 291 private:
292 CFX_ByteString m_MarkName; 292 CFX_ByteString m_MarkName;
293 293
294 ParamType m_ParamType; 294 ParamType m_ParamType;
295 295
296 void* m_pParam; 296 CPDF_Dictionary* m_pParam;
297 }; 297 };
298 class CPDF_ContentMarkData { 298 class CPDF_ContentMarkData {
299 public: 299 public:
300 CPDF_ContentMarkData() {} 300 CPDF_ContentMarkData() {}
301 301
302 CPDF_ContentMarkData(const CPDF_ContentMarkData& src); 302 CPDF_ContentMarkData(const CPDF_ContentMarkData& src);
303 303
304 inline int CountItems() const { return m_Marks.GetSize(); } 304 inline int CountItems() const { return m_Marks.GetSize(); }
305 305
306 inline CPDF_ContentMarkItem& GetItem(int index) const { 306 inline CPDF_ContentMarkItem& GetItem(int index) const {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 void CalcBoundingBox(); 542 void CalcBoundingBox();
543 543
544 CPDF_Form* m_pForm; 544 CPDF_Form* m_pForm;
545 CFX_Matrix m_FormMatrix; 545 CFX_Matrix m_FormMatrix;
546 546
547 protected: 547 protected:
548 void CopyData(const CPDF_PageObject* pSrcObject) override; 548 void CopyData(const CPDF_PageObject* pSrcObject) override;
549 }; 549 };
550 550
551 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_ 551 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGEOBJ_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698