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 .
22 #include <vcl/bitmapex.hxx>
24 namespace sd::slidesorter::view
{
29 explicit FramePainter (const BitmapEx
& rBitmap
);
32 /** Paint a border around the given box by using a set of bitmaps for
33 the corners and sides.
35 void PaintFrame (OutputDevice
&rDevice
, const ::tools::Rectangle
& rBox
) const;
37 /** Special functionality that takes the color from the center
38 bitmap and replaces that color in all bitmaps by the given new
39 color. Alpha values are not modified.
40 The center bitmap is erased.
42 void AdaptColor (const Color aNewColor
);
45 /** Bitmap with offset that is used when the bitmap is painted. The bitmap
52 /** Create one of the eight shadow bitmaps from one that combines
53 them all. This larger bitmap is expected to have dimension NxN
54 with N=1+2*M. Of this larger bitmap there are created four
55 corner bitmaps of size 2*M x 2*M and four side bitmaps of sizes
56 1xM (top and bottom) and Mx1 (left and right). The corner
57 bitmaps have each one quadrant of size MxM that is painted under
58 the interior of the frame.
60 The larger bitmap of which the eight shadow bitmaps are cut
62 @param nHorizontalPosition
63 Valid values are -1 (left), 0 (center), and +1 (right).
64 @param nVerticalPosition
65 Valid values are -1 (top), 0 (center), and +1 (bottom).
68 const BitmapEx
& rBitmap
,
69 const sal_Int32 nHorizontalPosition
,
70 const sal_Int32 nVerticalPosition
);
72 /** Use the given device to paint the bitmap at the location that is
73 the sum of the given anchor and the internal offset.
75 void PaintCorner (OutputDevice
& rDevice
, const Point
& rAnchor
) const;
77 /** Use the given device to paint the bitmap stretched between the
78 two given locations. Offsets of the adjacent corner bitmaps and
79 the offset of the side bitmap are used to determine the area
80 that is to be filled with the side bitmap.
83 OutputDevice
& rDevice
,
84 const Point
& rAnchor1
,
85 const Point
& rAnchor2
,
86 const OffsetBitmap
& rCornerBitmap1
,
87 const OffsetBitmap
& rCornerBitmap2
) const;
89 /** Fill the given rectangle with the bitmap.
92 OutputDevice
& rDevice
,
93 const ::tools::Rectangle
& rBox
) const;
95 OffsetBitmap maTopLeft
;
97 OffsetBitmap maTopRight
;
100 OffsetBitmap maBottomLeft
;
101 OffsetBitmap maBottom
;
102 OffsetBitmap maBottomRight
;
103 OffsetBitmap maCenter
;
107 } // end of namespace sd::slidesorter::view
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */