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>
30 namespace drawinglayer
34 /** WallpaperBitmapPrimitive2D class
36 This is a specialized primtive for the Wallpaper definitions included in
37 VCL and Metafiles. The extraordinary about the bitmap definition part of
38 the Wallpaper is that it uses PIXEL size of the given Bitmap and not
39 the logic and/or discrete size derived by PrefMapMode/PrefSize methods.
40 To emulate this, a ViewTransformation dependent primitive is needed which
41 takes over the correct scaling(s).
43 Since a specialized primitive is needed anyways, i opted to also add the
44 layouting which is dependent from WallpaperStyle; thus it does not need
45 to be handled anywhere else in the future.
47 class DRAWINGLAYER_DLLPUBLIC WallpaperBitmapPrimitive2D
: public ViewTransformationDependentPrimitive2D
50 basegfx::B2DRange maObjectRange
;
52 WallpaperStyle meWallpaperStyle
;
55 /// create local decomposition
56 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& rViewInformation
) const override
;
60 WallpaperBitmapPrimitive2D(
61 const basegfx::B2DRange
& rObjectRange
,
62 const BitmapEx
& rBitmapEx
,
63 WallpaperStyle eWallpaperStyle
);
66 const basegfx::B2DRange
& getLocalObjectRange() const { return maObjectRange
; }
67 const BitmapEx
& getBitmapEx() const { return maBitmapEx
; }
68 WallpaperStyle
getWallpaperStyle() const { return meWallpaperStyle
; }
71 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
74 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const override
;
77 DeclPrimitive2DIDBlock()
79 } // end of namespace primitive2d
80 } // end of namespace drawinglayer
83 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */