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 .
21 #include <vcl/outdev.hxx>
23 class SwRect
; // SwSaveClip
26 /*************************************************************************
28 *************************************************************************/
37 void _ChgClip( const SwRect
&rRect
, const SwTxtFrm
* pFrm
,
38 sal_Bool bEnlargeRect
);
40 inline SwSaveClip( OutputDevice
* pOut
);
42 inline void ChgClip( const SwRect
&rRect
, const SwTxtFrm
* pFrm
= 0,
43 sal_Bool bEnlargeRect
= sal_False
)
44 { if( pOut
) _ChgClip( rRect
, pFrm
, bEnlargeRect
); }
46 inline sal_Bool
IsOn() const { return bOn
; }
47 inline sal_Bool
IsChg() const { return bChg
; }
48 inline sal_Bool
IsOut() const { return 0 != pOut
; }
49 inline OutputDevice
*GetOut() { return pOut
; }
52 inline SwSaveClip::SwSaveClip( OutputDevice
* pOutDev
) :
53 bOn( pOutDev
&& pOutDev
->IsClipRegion() ),
58 inline SwSaveClip::~SwSaveClip()
65 /*************************************************************************
67 *************************************************************************/
74 inline SwDbgOut( OutputDevice
* pOutDev
, const sal_Bool bOn
= sal_True
);
77 /*************************************************************************
79 *************************************************************************/
81 class DbgBackColor
: public SwDbgOut
85 DbgBackColor( OutputDevice
* pOut
, const sal_Bool bOn
= sal_True
,
86 ColorData nColor
= COL_YELLOW
);
90 /*************************************************************************
92 *************************************************************************/
94 class DbgRect
: public SwDbgOut
97 DbgRect( OutputDevice
* pOut
, const Rectangle
&rRect
,
98 const sal_Bool bOn
= sal_True
,
99 ColorData eColor
= COL_LIGHTBLUE
);
102 /*************************************************************************
103 * Inline-Implementierung
104 *************************************************************************/
106 inline SwDbgOut::SwDbgOut( OutputDevice
* pOutDev
, const sal_Bool bOn
)
107 :pOut( bOn
? pOutDev
: 0 )
111 inline DbgBackColor::DbgBackColor( OutputDevice
* pOutDev
, const sal_Bool bOn
,
113 :SwDbgOut( pOutDev
, bOn
)
117 aOldFillColor
= pOut
->GetFillColor();
118 pOut
->SetFillColor( Color(eColor
) );
122 inline DbgBackColor::~DbgBackColor()
126 pOut
->SetFillColor( aOldFillColor
);
130 inline DbgRect::DbgRect( OutputDevice
* pOutDev
, const Rectangle
&rRect
,
133 : SwDbgOut( pOutDev
, bOn
)
137 const Color
aColor( eColor
);
138 Color aLineColor
= pOut
->GetLineColor();
139 pOut
->SetLineColor( aColor
);
140 Color aFillColor
= pOut
->GetFillColor();
141 pOut
->SetFillColor( Color(COL_TRANSPARENT
) );
142 pOut
->DrawRect( rRect
);
143 pOut
->SetLineColor( aLineColor
);
144 pOut
->SetFillColor( aFillColor
);
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */