1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "core/fpdfapi/page/cpdf_pageobject.h" 8 CPDF_PageObject()9CPDF_PageObject::CPDF_PageObject() : m_bDirty(false) {} 10 ~CPDF_PageObject()11CPDF_PageObject::~CPDF_PageObject() {} 12 IsText() const13bool CPDF_PageObject::IsText() const { 14 return false; 15 } 16 IsPath() const17bool CPDF_PageObject::IsPath() const { 18 return false; 19 } 20 IsImage() const21bool CPDF_PageObject::IsImage() const { 22 return false; 23 } 24 IsShading() const25bool CPDF_PageObject::IsShading() const { 26 return false; 27 } 28 IsForm() const29bool CPDF_PageObject::IsForm() const { 30 return false; 31 } 32 AsText()33CPDF_TextObject* CPDF_PageObject::AsText() { 34 return nullptr; 35 } 36 AsText() const37const CPDF_TextObject* CPDF_PageObject::AsText() const { 38 return nullptr; 39 } 40 AsPath()41CPDF_PathObject* CPDF_PageObject::AsPath() { 42 return nullptr; 43 } 44 AsPath() const45const CPDF_PathObject* CPDF_PageObject::AsPath() const { 46 return nullptr; 47 } 48 AsImage()49CPDF_ImageObject* CPDF_PageObject::AsImage() { 50 return nullptr; 51 } 52 AsImage() const53const CPDF_ImageObject* CPDF_PageObject::AsImage() const { 54 return nullptr; 55 } 56 AsShading()57CPDF_ShadingObject* CPDF_PageObject::AsShading() { 58 return nullptr; 59 } 60 AsShading() const61const CPDF_ShadingObject* CPDF_PageObject::AsShading() const { 62 return nullptr; 63 } 64 AsForm()65CPDF_FormObject* CPDF_PageObject::AsForm() { 66 return nullptr; 67 } 68 AsForm() const69const CPDF_FormObject* CPDF_PageObject::AsForm() const { 70 return nullptr; 71 } 72 CopyData(const CPDF_PageObject * pSrc)73void CPDF_PageObject::CopyData(const CPDF_PageObject* pSrc) { 74 CopyStates(*pSrc); 75 m_Left = pSrc->m_Left; 76 m_Right = pSrc->m_Right; 77 m_Top = pSrc->m_Top; 78 m_Bottom = pSrc->m_Bottom; 79 m_bDirty = true; 80 } 81 TransformClipPath(CFX_Matrix & matrix)82void CPDF_PageObject::TransformClipPath(CFX_Matrix& matrix) { 83 if (!m_ClipPath.HasRef()) 84 return; 85 m_ClipPath.Transform(matrix); 86 SetDirty(true); 87 } 88 TransformGeneralState(CFX_Matrix & matrix)89void CPDF_PageObject::TransformGeneralState(CFX_Matrix& matrix) { 90 if (!m_GeneralState.HasRef()) 91 return; 92 m_GeneralState.GetMutableMatrix()->Concat(matrix); 93 SetDirty(true); 94 } 95 GetBBox(const CFX_Matrix * pMatrix) const96FX_RECT CPDF_PageObject::GetBBox(const CFX_Matrix* pMatrix) const { 97 CFX_FloatRect rect(m_Left, m_Bottom, m_Right, m_Top); 98 if (pMatrix) 99 rect = pMatrix->TransformRect(rect); 100 101 return rect.GetOuterRect(); 102 } 103