renaissance1: #i107215# Removed anonymous namespace from FramePainter header.

This commit is contained in:
Andre Fischer
2010-03-02 16:46:27 +01:00
parent efc8b0f870
commit 6be133ca03
2 changed files with 49 additions and 75 deletions

View File

@@ -105,9 +105,9 @@ void FramePainter::PaintFrame (
//===== OffsetBitmap ========================================================== //===== FramePainter::OffsetBitmap ============================================
OffsetBitmap::OffsetBitmap ( FramePainter::OffsetBitmap::OffsetBitmap (
const BitmapEx& rBitmap, const BitmapEx& rBitmap,
const sal_Int32 nHorizontalPosition, const sal_Int32 nHorizontalPosition,
const sal_Int32 nVerticalPosition) const sal_Int32 nVerticalPosition)
@@ -150,7 +150,7 @@ OffsetBitmap::OffsetBitmap (
void OffsetBitmap::PaintCorner ( void FramePainter::OffsetBitmap::PaintCorner (
OutputDevice& rDevice, OutputDevice& rDevice,
const Point& rAnchor) const const Point& rAnchor) const
{ {
@@ -161,7 +161,7 @@ void OffsetBitmap::PaintCorner (
void OffsetBitmap::PaintSide ( void FramePainter::OffsetBitmap::PaintSide (
OutputDevice& rDevice, OutputDevice& rDevice,
const Point& rAnchor1, const Point& rAnchor1,
const Point& rAnchor2, const Point& rAnchor2,

View File

@@ -41,23 +41,28 @@
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
namespace { class FramePainter
/** Bitmap with offset that is used when the bitmap is painted. The bitmap
*/
class OffsetBitmap
{ {
public: public:
/** Create one of the eight shadow bitmaps from one that combines them FramePainter (const BitmapEx& rBitmap);
all. This larger bitmap is expected to have dimension NxN with ~FramePainter (void);
N=1+2*M. Of this larger bitmap there are created four corner void PaintFrame (OutputDevice&rDevice, const Rectangle aBox) const;
bitmaps of size 2*M x 2*M and four side bitmaps of sizes 1xM (top
and bottom) and Mx1 (left and right). The corner bitmaps have each private:
one quadrant of size MxM that is painted under the interior of the /** Bitmap with offset that is used when the bitmap is painted. The bitmap
frame. */
class OffsetBitmap {
public:
/** Create one of the eight shadow bitmaps from one that combines
them all. This larger bitmap is expected to have dimension NxN
with N=1+2*M. Of this larger bitmap there are created four
corner bitmaps of size 2*M x 2*M and four side bitmaps of sizes
1xM (top and bottom) and Mx1 (left and right). The corner
bitmaps have each one quadrant of size MxM that is painted under
the interior of the frame.
@param rBitmap @param rBitmap
The larger bitmap of which the eight shadow bitmaps are cut out The larger bitmap of which the eight shadow bitmaps are cut
from. out from.
@param nHorizontalPosition @param nHorizontalPosition
Valid values are -1 (left), 0 (center), and +1 (right). Valid values are -1 (left), 0 (center), and +1 (right).
@param nVerticalPosition @param nVerticalPosition
@@ -68,32 +73,15 @@ public:
const sal_Int32 nHorizontalPosition, const sal_Int32 nHorizontalPosition,
const sal_Int32 nVerticalPosition); const sal_Int32 nVerticalPosition);
/** Create bitmap and offset from the given values. Corner bitmaps are /** Use the given device to paint the bitmap at the location that is
constructed with the given width and height. Side bitmaps are the sum of the given anchor and the internal offset.
stretched along one axis to reduce the paint calls when the sides of
a frame are painted.
@param rBitmap
The larger bitmap that contains the four corner bitmaps and the
four side bitmaps.
*/
void SetBitmap (
const BitmapEx& rBitmap,
const sal_Int32 nOriginX,
const sal_Int32 nOriginY,
const sal_Int32 nWidth,
const sal_Int32 nHeight,
const sal_Int32 nOffsetX,
const sal_Int32 nOffsetY);
/** Use the given device to paint the bitmap at the location that is the
sum of the given anchor and the internal offset.
*/ */
void PaintCorner (OutputDevice& rDevice, const Point& rAnchor) const; void PaintCorner (OutputDevice& rDevice, const Point& rAnchor) const;
/** Use the given device to paint the bitmap stretched between the two /** Use the given device to paint the bitmap stretched between the
given locations. Offsets of the adjacent corner bitmaps and the two given locations. Offsets of the adjacent corner bitmaps and
offset of the side bitmap are used to determine the area that is to the offset of the side bitmap are used to determine the area
be filled with the side bitmap. that is to be filled with the side bitmap.
*/ */
void PaintSide ( void PaintSide (
OutputDevice& rDevice, OutputDevice& rDevice,
@@ -106,20 +94,6 @@ private:
BitmapEx maBitmap; BitmapEx maBitmap;
Point maOffset; Point maOffset;
}; };
} // end of anonymous namespace
class FramePainter
{
public:
FramePainter (const BitmapEx& rBitmap);
~FramePainter (void);
void PaintFrame (OutputDevice&rDevice, const Rectangle aBox) const;
private:
OffsetBitmap maShadowTopLeft; OffsetBitmap maShadowTopLeft;
OffsetBitmap maShadowTop; OffsetBitmap maShadowTop;
OffsetBitmap maShadowTopRight; OffsetBitmap maShadowTopRight;