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

Side by Side Diff: core/fpdfdoc/include/fpdf_doc.h

Issue 2136683002: Use smart pointers for class owned member variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « core/fpdfdoc/doc_annot.cpp ('k') | fpdfsdk/fsdk_mgr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_FPDFDOC_INCLUDE_FPDF_DOC_H_ 7 #ifndef CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 8 #define CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 void DisplayAnnots(CPDF_Page* pPage, 368 void DisplayAnnots(CPDF_Page* pPage,
369 CFX_RenderDevice* pDevice, 369 CFX_RenderDevice* pDevice,
370 CPDF_RenderContext* pContext, 370 CPDF_RenderContext* pContext,
371 FX_BOOL bPrinting, 371 FX_BOOL bPrinting,
372 CFX_Matrix* pMatrix, 372 CFX_Matrix* pMatrix,
373 uint32_t dwAnnotFlags, 373 uint32_t dwAnnotFlags,
374 CPDF_RenderOptions* pOptions, 374 CPDF_RenderOptions* pOptions,
375 FX_RECT* pClipRect); 375 FX_RECT* pClipRect);
376 size_t Count() const { return m_AnnotList.size(); } 376 size_t Count() const { return m_AnnotList.size(); }
377 CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index]; } 377 CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index].get(); }
378 const std::vector<CPDF_Annot*>& All() const { return m_AnnotList; } 378 const std::vector<std::unique_ptr<CPDF_Annot>>& All() const {
379 return m_AnnotList;
380 }
379 CPDF_Document* GetDocument() const { return m_pDocument; } 381 CPDF_Document* GetDocument() const { return m_pDocument; }
380 382
381 protected: 383 protected:
382 void DisplayPass(CPDF_Page* pPage, 384 void DisplayPass(CPDF_Page* pPage,
383 CFX_RenderDevice* pDevice, 385 CFX_RenderDevice* pDevice,
384 CPDF_RenderContext* pContext, 386 CPDF_RenderContext* pContext,
385 FX_BOOL bPrinting, 387 FX_BOOL bPrinting,
386 CFX_Matrix* pMatrix, 388 CFX_Matrix* pMatrix,
387 FX_BOOL bWidget, 389 FX_BOOL bWidget,
388 CPDF_RenderOptions* pOptions, 390 CPDF_RenderOptions* pOptions,
389 FX_RECT* clip_rect); 391 FX_RECT* clip_rect);
390 392
391 CPDF_Document* const m_pDocument; 393 CPDF_Document* const m_pDocument;
392 std::vector<CPDF_Annot*> m_AnnotList; 394 std::vector<std::unique_ptr<CPDF_Annot>> m_AnnotList;
393 }; 395 };
394 396
395 #define COLORTYPE_TRANSPARENT 0 397 #define COLORTYPE_TRANSPARENT 0
396 #define COLORTYPE_GRAY 1 398 #define COLORTYPE_GRAY 1
397 #define COLORTYPE_RGB 2 399 #define COLORTYPE_RGB 2
398 #define COLORTYPE_CMYK 3 400 #define COLORTYPE_CMYK 3
399 class CPDF_DefaultAppearance { 401 class CPDF_DefaultAppearance {
400 public: 402 public:
401 CPDF_DefaultAppearance() {} 403 CPDF_DefaultAppearance() {}
402 explicit CPDF_DefaultAppearance(const CFX_ByteString& csDA) : m_csDA(csDA) {} 404 explicit CPDF_DefaultAppearance(const CFX_ByteString& csDA) : m_csDA(csDA) {}
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const; 930 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const;
929 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const; 931 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const;
930 932
931 CPDF_Dictionary* const m_pDict; 933 CPDF_Dictionary* const m_pDict;
932 }; 934 };
933 935
934 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, 936 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
935 CPDF_Annot::AppearanceMode mode); 937 CPDF_Annot::AppearanceMode mode);
936 938
937 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 939 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/doc_annot.cpp ('k') | fpdfsdk/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698