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(int32_t content_stream)9CPDF_PageObject::CPDF_PageObject(int32_t content_stream) 10 : m_ContentStream(content_stream) {} 11 12 CPDF_PageObject::~CPDF_PageObject() = default; 13 IsText() const14bool CPDF_PageObject::IsText() const { 15 return false; 16 } 17 IsPath() const18bool CPDF_PageObject::IsPath() const { 19 return false; 20 } 21 IsImage() const22bool CPDF_PageObject::IsImage() const { 23 return false; 24 } 25 IsShading() const26bool CPDF_PageObject::IsShading() const { 27 return false; 28 } 29 IsForm() const30bool CPDF_PageObject::IsForm() const { 31 return false; 32 } 33 AsText()34CPDF_TextObject* CPDF_PageObject::AsText() { 35 return nullptr; 36 } 37 AsText() const38const CPDF_TextObject* CPDF_PageObject::AsText() const { 39 return nullptr; 40 } 41 AsPath()42CPDF_PathObject* CPDF_PageObject::AsPath() { 43 return nullptr; 44 } 45 AsPath() const46const CPDF_PathObject* CPDF_PageObject::AsPath() const { 47 return nullptr; 48 } 49 AsImage()50CPDF_ImageObject* CPDF_PageObject::AsImage() { 51 return nullptr; 52 } 53 AsImage() const54const CPDF_ImageObject* CPDF_PageObject::AsImage() const { 55 return nullptr; 56 } 57 AsShading()58CPDF_ShadingObject* CPDF_PageObject::AsShading() { 59 return nullptr; 60 } 61 AsShading() const62const CPDF_ShadingObject* CPDF_PageObject::AsShading() const { 63 return nullptr; 64 } 65 AsForm()66CPDF_FormObject* CPDF_PageObject::AsForm() { 67 return nullptr; 68 } 69 AsForm() const70const CPDF_FormObject* CPDF_PageObject::AsForm() const { 71 return nullptr; 72 } 73 CopyData(const CPDF_PageObject * pSrc)74void CPDF_PageObject::CopyData(const CPDF_PageObject* pSrc) { 75 CopyStates(*pSrc); 76 m_Rect = pSrc->m_Rect; 77 m_bDirty = true; 78 } 79 TransformClipPath(const CFX_Matrix & matrix)80void CPDF_PageObject::TransformClipPath(const CFX_Matrix& matrix) { 81 if (!m_ClipPath.HasRef()) 82 return; 83 m_ClipPath.Transform(matrix); 84 SetDirty(true); 85 } 86 TransformGeneralState(const CFX_Matrix & matrix)87void CPDF_PageObject::TransformGeneralState(const CFX_Matrix& matrix) { 88 if (!m_GeneralState.HasRef()) 89 return; 90 m_GeneralState.GetMutableMatrix()->Concat(matrix); 91 SetDirty(true); 92 } 93 GetBBox() const94FX_RECT CPDF_PageObject::GetBBox() const { 95 return GetRect().GetOuterRect(); 96 } 97 GetTransformedBBox(const CFX_Matrix & matrix) const98FX_RECT CPDF_PageObject::GetTransformedBBox(const CFX_Matrix& matrix) const { 99 return matrix.TransformRect(GetRect()).GetOuterRect(); 100 } 101