fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / drawinglayer / source / primitive2d / epsprimitive2d.cxx
blob06ee41dd679cec2ca761d56de3cfdd9ed30bd668
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
21 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
22 #include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
24 //////////////////////////////////////////////////////////////////////////////
26 namespace drawinglayer
28 namespace primitive2d
30 Primitive2DSequence EpsPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
32 Primitive2DSequence xRetval;
33 const GDIMetaFile& rSubstituteContent = getMetaFile();
35 if( rSubstituteContent.GetActionSize() )
37 // the default decomposition will use the Metafile replacement visualisation.
38 // To really use the Eps data, a renderer has to know and interpret this primitive
39 // directly.
40 xRetval.realloc(1);
42 xRetval[0] = Primitive2DReference(
43 new MetafilePrimitive2D(
44 getEpsTransform(),
45 rSubstituteContent));
48 return xRetval;
51 EpsPrimitive2D::EpsPrimitive2D(
52 const basegfx::B2DHomMatrix& rEpsTransform,
53 const GfxLink& rGfxLink,
54 const GDIMetaFile& rMetaFile)
55 : BufferedDecompositionPrimitive2D(),
56 maEpsTransform(rEpsTransform),
57 maGfxLink(rGfxLink),
58 maMetaFile(rMetaFile)
62 bool EpsPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
64 if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
66 const EpsPrimitive2D& rCompare = (EpsPrimitive2D&)rPrimitive;
68 return (getEpsTransform() == rCompare.getEpsTransform()
69 && getGfxLink().IsEqual(rCompare.getGfxLink())
70 && getMetaFile() == rCompare.getMetaFile());
73 return false;
76 basegfx::B2DRange EpsPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
78 // use own implementation to quickly answer the getB2DRange question.
79 basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
80 aRetval.transform(getEpsTransform());
82 return aRetval;
85 // provide unique ID
86 ImplPrimitive2DIDBlock(EpsPrimitive2D, PRIMITIVE2D_ID_EPSPRIMITIVE2D)
88 } // end of namespace primitive2d
89 } // end of namespace drawinglayer
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */