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

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

Issue 2166883002: Pass CPDF_Document instead of CPDF_AnnotList when constructing CPDF_Annot. (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') | no next file » | 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 #define ANNOTFLAG_NOROTATE 0x0010 313 #define ANNOTFLAG_NOROTATE 0x0010
314 #define ANNOTFLAG_NOVIEW 0x0020 314 #define ANNOTFLAG_NOVIEW 0x0020
315 #define ANNOTFLAG_READONLY 0x0040 315 #define ANNOTFLAG_READONLY 0x0040
316 #define ANNOTFLAG_LOCKED 0x0080 316 #define ANNOTFLAG_LOCKED 0x0080
317 #define ANNOTFLAG_TOGGLENOVIEW 0x0100 317 #define ANNOTFLAG_TOGGLENOVIEW 0x0100
318 318
319 class CPDF_Annot { 319 class CPDF_Annot {
320 public: 320 public:
321 enum AppearanceMode { Normal, Rollover, Down }; 321 enum AppearanceMode { Normal, Rollover, Down };
322 322
323 CPDF_Annot(CPDF_Dictionary* pDict, CPDF_AnnotList* pList); 323 CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument);
324 ~CPDF_Annot(); 324 ~CPDF_Annot();
325 325
326 CFX_ByteString GetSubType() const; 326 CFX_ByteString GetSubType() const;
327 uint32_t GetFlags() const; 327 uint32_t GetFlags() const;
328 void GetRect(CFX_FloatRect& rect) const; 328 void GetRect(CFX_FloatRect& rect) const;
329 const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; } 329 const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; }
330 CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; } 330 CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; }
331 FX_BOOL DrawAppearance(CPDF_Page* pPage, 331 FX_BOOL DrawAppearance(CPDF_Page* pPage,
332 CFX_RenderDevice* pDevice, 332 CFX_RenderDevice* pDevice,
333 const CFX_Matrix* pUser2Device, 333 const CFX_Matrix* pUser2Device,
334 AppearanceMode mode, 334 AppearanceMode mode,
335 const CPDF_RenderOptions* pOptions); 335 const CPDF_RenderOptions* pOptions);
336 FX_BOOL DrawInContext(const CPDF_Page* pPage, 336 FX_BOOL DrawInContext(const CPDF_Page* pPage,
337 CPDF_RenderContext* pContext, 337 CPDF_RenderContext* pContext,
338 const CFX_Matrix* pUser2Device, 338 const CFX_Matrix* pUser2Device,
339 AppearanceMode mode); 339 AppearanceMode mode);
340 void ClearCachedAP(); 340 void ClearCachedAP();
341 void DrawBorder(CFX_RenderDevice* pDevice, 341 void DrawBorder(CFX_RenderDevice* pDevice,
342 const CFX_Matrix* pUser2Device, 342 const CFX_Matrix* pUser2Device,
343 const CPDF_RenderOptions* pOptions); 343 const CPDF_RenderOptions* pOptions);
344 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); 344 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode);
345 345
346 private: 346 private:
347 CPDF_Dictionary* const m_pAnnotDict; 347 CPDF_Dictionary* const m_pAnnotDict;
348 CPDF_AnnotList* const m_pList; 348 CPDF_Document* const m_pDocument;
349 const CFX_ByteString m_sSubtype; 349 const CFX_ByteString m_sSubtype;
350 std::map<CPDF_Stream*, CPDF_Form*> m_APMap; 350 std::map<CPDF_Stream*, CPDF_Form*> m_APMap;
351 }; 351 };
352 352
353 class CPDF_AnnotList { 353 class CPDF_AnnotList {
354 public: 354 public:
355 explicit CPDF_AnnotList(CPDF_Page* pPage); 355 explicit CPDF_AnnotList(CPDF_Page* pPage);
356 ~CPDF_AnnotList(); 356 ~CPDF_AnnotList();
357 357
358 void DisplayAnnots(CPDF_Page* pPage, 358 void DisplayAnnots(CPDF_Page* pPage,
(...skipping 12 matching lines...) Expand all
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].get(); } 377 CPDF_Annot* GetAt(size_t index) const { return m_AnnotList[index].get(); }
378 const std::vector<std::unique_ptr<CPDF_Annot>>& All() const { 378 const std::vector<std::unique_ptr<CPDF_Annot>>& All() const {
379 return m_AnnotList; 379 return m_AnnotList;
380 } 380 }
381 CPDF_Document* GetDocument() const { return m_pDocument; }
382 381
383 protected: 382 protected:
384 void DisplayPass(CPDF_Page* pPage, 383 void DisplayPass(CPDF_Page* pPage,
385 CFX_RenderDevice* pDevice, 384 CFX_RenderDevice* pDevice,
386 CPDF_RenderContext* pContext, 385 CPDF_RenderContext* pContext,
387 FX_BOOL bPrinting, 386 FX_BOOL bPrinting,
388 CFX_Matrix* pMatrix, 387 CFX_Matrix* pMatrix,
389 FX_BOOL bWidget, 388 FX_BOOL bWidget,
390 CPDF_RenderOptions* pOptions, 389 CPDF_RenderOptions* pOptions,
391 FX_RECT* clip_rect); 390 FX_RECT* clip_rect);
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const; 929 CFX_WideString GetCaption(const CFX_ByteString& csEntry) const;
931 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const; 930 CPDF_Stream* GetIcon(const CFX_ByteString& csEntry) const;
932 931
933 CPDF_Dictionary* const m_pDict; 932 CPDF_Dictionary* const m_pDict;
934 }; 933 };
935 934
936 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, 935 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
937 CPDF_Annot::AppearanceMode mode); 936 CPDF_Annot::AppearanceMode mode);
938 937
939 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_ 938 #endif // CORE_FPDFDOC_INCLUDE_FPDF_DOC_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/doc_annot.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698