summaryrefslogtreecommitdiff
path: root/vcl/source/window/decoview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/decoview.cxx')
-rw-r--r--vcl/source/window/decoview.cxx154
1 files changed, 27 insertions, 127 deletions
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 0cb89a025f5d..125c927bf673 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -45,71 +45,6 @@
// =======================================================================
-void ImplDrawOS2Symbol( OutputDevice* pDev, const Rectangle& rRect,
- USHORT nStyle, BOOL bClose )
-{
- DecorationView aView( pDev );
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
- Rectangle aRect = rRect;
- Color aColor1;
- Color aColor2;
-
- pDev->SetFillColor();
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- aColor1 = rStyleSettings.GetShadowColor();
- aColor2 = rStyleSettings.GetLightColor();
- }
- else
- {
- aColor1 = rStyleSettings.GetLightColor();
- aColor2 = rStyleSettings.GetShadowColor();
- }
- aView.DrawFrame( aRect, aColor1, aColor2 );
-
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- if ( bClose )
- {
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom()-2 ) );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-2, aRect.Top() ) );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom()-1 ),
- Point( aRect.Right()-1, aRect.Top()+2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) );
- }
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- if ( bClose )
- {
- pDev->DrawLine( Point( aRect.Right(), aRect.Top()+2 ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom() ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Right()-2, aRect.Top()+1 ),
- Point( aRect.Left()+1, aRect.Bottom()-2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopRight(), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ), aRect.BottomRight() );
- }
-}
-
-// =======================================================================
-
static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
SymbolType eType )
{
@@ -509,7 +444,7 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
case SYMBOL_CHECKMARK:
{
// #106953# never mirror checkmarks
- BOOL bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
+ sal_Bool bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
Point aPos1( bRTL ? rRect.Right() : rRect.Left(),
rRect.Bottom() - rRect.GetHeight() / 3 );
Point aPos2( bRTL ? rRect.Right() - rRect.GetWidth()/3 : rRect.Left() + rRect.GetWidth()/3,
@@ -631,57 +566,22 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
pDev->DrawRect( aRect );
}
break;
-
- case SYMBOL_OS2CLOSE:
- {
- Rectangle aRect( nCenterX-n2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- ImplDrawOS2Symbol( pDev, aRect, 0, TRUE );
- }
- break;
-
- case SYMBOL_OS2FLOAT:
- {
- Rectangle aRect( nCenterX-n2+4, nCenterY-n2+4,
- nCenterX+n2-4, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- DecorationView aDecoView( pDev );
- Rectangle aRect2( nCenterX-n2, nCenterY-n2,
- nCenterX-n2+2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect2,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- Rectangle aRect3( nCenterX+n2-2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect3,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- }
- break;
-
- case SYMBOL_OS2HIDE:
- {
- Rectangle aRect( nCenterX-n2+3, nCenterY-n2+3,
- nCenterX+n2-3, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- }
- break;
}
}
// -----------------------------------------------------------------------
void DecorationView::DrawSymbol( const Rectangle& rRect, SymbolType eType,
- const Color& rColor, USHORT nStyle )
+ const Color& rColor, sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Rectangle aRect = mpOutDev->LogicToPixel( rRect );
Color aOldLineColor = mpOutDev->GetLineColor();
Color aOldFillColor = mpOutDev->GetFillColor();
- BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
mpOutDev->SetLineColor();
mpOutDev->SetFillColor( rColor );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(mpOutDev->GetOutDevType() == OUTDEV_PRINTER) )
@@ -725,8 +625,8 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
Rectangle aRect = mpOutDev->LogicToPixel( rRect );
Color aOldLineColor = mpOutDev->GetLineColor();
Color aOldFillColor = mpOutDev->GetFillColor();
- BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
- mpOutDev->EnableMapMode( FALSE );
+ sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
+ mpOutDev->EnableMapMode( sal_False );
mpOutDev->SetLineColor();
mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor );
mpOutDev->SetLineColor( aOldLineColor );
@@ -737,7 +637,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
// =======================================================================
void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Color aLightColor = rStyleSettings.GetLightColor();
@@ -787,7 +687,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
// =======================================================================
static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
- const Color* pColor, BOOL bRound = FALSE )
+ const Color* pColor, sal_Bool bRound = sal_False )
{
long nLineWidth = pDev->ImplGetDPIX()/300;
long nLineHeight = pDev->ImplGetDPIY()/300;
@@ -836,10 +736,10 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
// =======================================================================
static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, USHORT nStyle )
+ const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
{
// mask menu style
- BOOL bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? TRUE : FALSE;
+ sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False;
nStyle &= ~FRAME_DRAW_MENU;
Window *pWin = NULL;
@@ -850,7 +750,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// menus may use different border colors (eg on XP)
// normal frames will be drawn using the shadow color
// whereas window frame borders will use black
- BOOL bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
+ sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
// no flat borders for standard VCL controls (ie formcontrols that keep their classic look)
// will not affect frame windows (like dropdowns)
@@ -859,13 +759,13 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// check for formcontrol, i.e., a control without NWF enabled
Control *pControl = dynamic_cast< Control* >( pWin->GetWindow( WINDOW_CLIENT ) );
if( pControl && pControl->IsNativeWidgetEnabled() )
- bFlatBorders = TRUE;
+ bFlatBorders = sal_True;
else
- bFlatBorders = FALSE;
+ bFlatBorders = sal_False;
}
// no round corners for window frame borders
- BOOL bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
+ sal_Bool bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) ||
@@ -874,7 +774,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if ( nStyle & FRAME_DRAW_NODRAW )
{
- USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -889,7 +789,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
ImplDrawDPILineRect( pDev, rRect, NULL, bRound );
else
{
- USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
@@ -919,7 +819,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
{
if( pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) )
{
- USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -956,7 +856,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else
{
- USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
pDev->SetFillColor();
@@ -1031,7 +931,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rRect.Right()--;
rRect.Bottom()--;
- BOOL bDrawn = TRUE;
+ sal_Bool bDrawn = sal_True;
if ( nFrameStyle == FRAME_DRAW_DOUBLEIN )
{
if( bFlatBorders ) // no 3d effect
@@ -1051,7 +951,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() );
else
- bDrawn = FALSE;
+ bDrawn = sal_False;
}
if( bDrawn )
{
@@ -1068,14 +968,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
+Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
{
Rectangle aRect = rRect;
- BOOL bOldMap = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
}
if ( !rRect.IsEmpty() )
@@ -1104,7 +1004,7 @@ Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
// =======================================================================
static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, USHORT nStyle )
+ const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
{
Rectangle aFillRect = rRect;
@@ -1317,14 +1217,14 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawButton( const Rectangle& rRect, USHORT nStyle )
+Rectangle DecorationView::DrawButton( const Rectangle& rRect, sal_uInt16 nStyle )
{
Rectangle aRect = rRect;
- BOOL bOldMap = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
}
if ( !rRect.IsEmpty() )