1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/primitivetools2d.hxx>
26 #include <vcl/bitmapex.hxx>
27 #include <vcl/wall.hxx>
31 namespace drawinglayer
35 /** WallpaperBitmapPrimitive2D class
37 This is a specialized primtive for the Wallpaper definitions included in
38 VCL and Metafiles. The extraordinary about the bitmap definition part of
39 the Wallpaper is that it uses PIXEL size of the given Bitmap and not
40 the logic and/or discrete size derived by PrefMapMode/PrefSize methods.
41 To emulate this, a ViewTransformation dependent primitive is needed which
42 takes over the correct scaling(s).
44 Since a specialized primitive is needed anyways, i opted to also add the
45 layouting which is dependent from WallpaperStyle; thus it does not need
46 to be handled anywhere else in the future.
48 class DRAWINGLAYER_DLLPUBLIC WallpaperBitmapPrimitive2D
: public ViewTransformationDependentPrimitive2D
51 basegfx::B2DRange maObjectRange
;
53 WallpaperStyle meWallpaperStyle
;
56 /// create local decomposition
57 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
61 WallpaperBitmapPrimitive2D(
62 const basegfx::B2DRange
& rObjectRange
,
63 const BitmapEx
& rBitmapEx
,
64 WallpaperStyle eWallpaperStyle
);
67 const basegfx::B2DRange
& getLocalObjectRange() const { return maObjectRange
; }
68 const BitmapEx
& getBitmapEx() const { return maBitmapEx
; }
69 WallpaperStyle
getWallpaperStyle() const { return meWallpaperStyle
; }
72 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
75 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
78 DeclPrimitive2DIDBlock()
80 } // end of namespace primitive2d
81 } // end of namespace drawinglayer
85 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */