Kaydet (Commit) 61eb53d3 authored tarafından Noel Grandin's avatar Noel Grandin

convert FRAME_DRAW constants to scoped enum

Change-Id: I98e52aa56ec063ecc8f3d10baef65eb293c726bf
üst 0ac80267
......@@ -39,6 +39,7 @@ struct ValueSetItem;
class ValueSetAcc;
class ValueItemAcc;
enum class DrawFrameStyle;
/*************************************************************************
......@@ -219,7 +220,7 @@ private:
sal_uInt16 mnUserVisLines;
sal_uInt16 mnFirstLine;
sal_uInt16 mnSpacing;
sal_uInt16 mnFrameStyle;
DrawFrameStyle mnFrameStyle;
Color maColor;
Link<> maDoubleClickHdl;
Link<> maSelectHdl;
......
......@@ -43,18 +43,29 @@ namespace o3tl
}
// Flags for DrawFrame()
#define FRAME_DRAW_IN ((sal_uInt16)0x0001)
#define FRAME_DRAW_OUT ((sal_uInt16)0x0002)
#define FRAME_DRAW_GROUP ((sal_uInt16)0x0003)
#define FRAME_DRAW_DOUBLEIN ((sal_uInt16)0x0004)
#define FRAME_DRAW_DOUBLEOUT ((sal_uInt16)0x0005)
#define FRAME_DRAW_NWF ((sal_uInt16)0x0006)
#define FRAME_DRAW_MENU ((sal_uInt16)0x0010)
#define FRAME_DRAW_WINDOWBORDER ((sal_uInt16)0x0020)
#define FRAME_DRAW_BORDERWINDOWBORDER ((sal_uInt16)0x0040)
#define FRAME_DRAW_MONO ((sal_uInt16)0x1000)
#define FRAME_DRAW_NODRAW ((sal_uInt16)0x8000)
#define FRAME_DRAW_STYLE ((sal_uInt16)0x000F)
enum class DrawFrameStyle
{
NONE = 0x0000,
In = 0x0001,
Out = 0x0002,
Group = 0x0003,
DoubleIn = 0x0004,
DoubleOut = 0x0005,
NWF = 0x0006,
};
enum class DrawFrameFlags
{
NONE = 0x0000,
Menu = 0x0010,
WindowBorder = 0x0020,
BorderWindowBorder = 0x0040,
Mono = 0x1000,
NoDraw = 0x8000,
};
namespace o3tl
{
template<> struct typed_flags<DrawFrameFlags> : is_typed_flags<DrawFrameFlags, 0x9070> {};
}
// Flags for DrawHighlightFrame()
#define FRAME_HIGHLIGHT_IN ((sal_uInt16)0x0001)
......@@ -92,7 +103,7 @@ public:
const Color& rRightBottomColor );
void DrawHighlightFrame( const Rectangle& rRect,
sal_uInt16 nStyle = FRAME_HIGHLIGHT_OUT );
Rectangle DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle = FRAME_DRAW_OUT );
Rectangle DrawFrame( const Rectangle& rRect, DrawFrameStyle nStyle = DrawFrameStyle::Out, DrawFrameFlags nFlags = DrawFrameFlags::NONE );
Rectangle DrawButton( const Rectangle& rRect, sal_uInt16 nStyle );
void DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true );
void DrawHandle(const Rectangle& rRectangle, bool bVertical = true);
......
......@@ -806,7 +806,7 @@ void PresLayoutPreview::Paint( vcl::RenderContext& /*rRenderContext*/, const Rec
// draw decoration frame
DecorationView aDecoView( this );
maOutRect = aDecoView.DrawFrame( maOutRect, FRAME_HIGHLIGHT_IN );
maOutRect = aDecoView.DrawFrame( maOutRect, DrawFrameStyle::In );
// draw page background
SetFillColor( Color(COL_WHITE) );
......
......@@ -1791,7 +1791,7 @@ void SfxDockingWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Recta
}
DecorationView aView( this );
aView.DrawFrame( aRect, FRAME_DRAW_OUT );
aView.DrawFrame( aRect, DrawFrameStyle::Out );
}
......
......@@ -753,7 +753,7 @@ void SmCmdBoxWindow::Resize()
aRect.Bottom() -= CMD_BOX_PADDING;
DecorationView aView(this);
aRect = aView.DrawFrame( aRect, FRAME_DRAW_IN | FRAME_DRAW_NODRAW );
aRect = aView.DrawFrame( aRect, DrawFrameStyle::In, DrawFrameFlags::NoDraw );
aEdit->SetPosSizePixel(aRect.TopLeft(), aRect.GetSize());
SfxDockingWindow::Resize();
......@@ -769,7 +769,7 @@ void SmCmdBoxWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectang
aRect.Bottom() -= CMD_BOX_PADDING;
DecorationView aView(this);
aView.DrawFrame( aRect, FRAME_DRAW_IN );
aView.DrawFrame( aRect, DrawFrameStyle::In );
}
Size SmCmdBoxWindow::CalcDockingSize(SfxChildAlignment eAlign)
......
......@@ -75,7 +75,7 @@ void ValueSet::ImplInit()
mnUserCols = 0;
mnUserVisLines = 0;
mnSpacing = 0;
mnFrameStyle = 0;
mnFrameStyle = DrawFrameStyle::NONE;
mbFormat = true;
mbHighlight = false;
mbSelection = false;
......@@ -524,9 +524,9 @@ void ValueSet::Format(vcl::RenderContext& rRenderContext)
// determine Frame-Style
if (nStyle & WB_DOUBLEBORDER)
mnFrameStyle = FRAME_DRAW_DOUBLEIN;
mnFrameStyle = DrawFrameStyle::DoubleIn;
else
mnFrameStyle = FRAME_DRAW_IN;
mnFrameStyle = DrawFrameStyle::In;
// determine selected color and width
// if necessary change the colors, to make the selection
......
......@@ -1015,7 +1015,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
{
sal_uInt16 nStyle = aValue.getNumericVal();
if( nPart == PART_BORDER ) {
if(!( nStyle & FRAME_DRAW_MENU ) && !(nStyle & FRAME_DRAW_WINDOWBORDER) )
if(!( nStyle & DrawFrameFlags::Menu ) && !(nStyle & DrawFrameFlags::WindowBorder) )
{
// #i84756# strange effects start to happen when HIThemeDrawFrame
// meets the border of the window. These can be avoided by clipping
......@@ -1321,10 +1321,10 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
{
sal_uInt16 nStyle = aValue.getNumericVal();
if( ( nPart == PART_BORDER ) &&
!( nStyle & (FRAME_DRAW_MENU | FRAME_DRAW_WINDOWBORDER | FRAME_DRAW_BORDERWINDOWBORDER) ) )
!( nStyle & (DrawFrameFlags::Menu | DrawFrameFlags::WindowBorder | DrawFrameFlags::BorderWindowBorder) ) )
{
Rectangle aRect(aCtrlBoundRect);
if( nStyle & FRAME_DRAW_DOUBLEIN )
if( nStyle & DrawFrameStyle::DoubleIn )
{
aRect.Left() += 1;
aRect.Top() += 1;
......
......@@ -1910,7 +1910,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
Rectangle aImageRect = maStateRect;
Size aImageSize = maImage.GetSizePixel();
bool bEnabled = IsEnabled();
sal_uInt16 nButtonStyle = FRAME_DRAW_DOUBLEIN;
DrawFrameStyle nButtonStyle = DrawFrameStyle::DoubleIn;
aImageSize.Width() = CalcZoom(aImageSize.Width());
aImageSize.Height() = CalcZoom(aImageSize.Height());
......@@ -1925,9 +1925,9 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
rRenderContext.DrawRect(aImageRect);
// display image
nButtonStyle = 0;
sal_uInt16 nImageStyle = 0;
if (!bEnabled)
nButtonStyle |= IMAGE_DRAW_DISABLE;
nImageStyle |= IMAGE_DRAW_DISABLE;
Image* pImage = &maImage;
......@@ -1935,9 +1935,9 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
aImagePos.X() += (aImageRect.GetWidth() - aImageSize.Width()) / 2;
aImagePos.Y() += (aImageRect.GetHeight() - aImageSize.Height()) / 2;
if (IsZoom())
rRenderContext.DrawImage(aImagePos, aImageSize, *pImage, nButtonStyle);
rRenderContext.DrawImage(aImagePos, aImageSize, *pImage, nImageStyle);
else
rRenderContext.DrawImage(aImagePos, *pImage, nButtonStyle);
rRenderContext.DrawImage(aImagePos, *pImage, nImageStyle);
aImageRect.Left()++;
aImageRect.Top()++;
......
......@@ -377,7 +377,7 @@ void Control::ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect )
pDev->OutputDevice::SetSettings( aNewSettings );
DecorationView aDecoView( pDev );
rRect = aDecoView.DrawFrame( rRect, FRAME_DRAW_WINDOWBORDER );
rRect = aDecoView.DrawFrame( rRect, DrawFrameStyle::Out, DrawFrameFlags::WindowBorder );
pDev->OutputDevice::SetSettings( aOriginalSettings );
}
......
......@@ -790,7 +790,7 @@ void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize
if ( !(nFlags & WINDOW_DRAW_NOBORDER) && (GetStyle() & WB_BORDER) )
{
DecorationView aDecoView( pDev );
aRect = aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
}
pDev->IntersectClipRegion( aRect );
ImplDraw( pDev, nFlags, aRect.TopLeft(), aRect.GetSize() );
......
......@@ -1338,7 +1338,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size&
if ( bBorder )
{
DecorationView aDecoView( pDev );
aRect = aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
}
if ( bBackground )
{
......
......@@ -1133,20 +1133,21 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
if( ! mbNWFBorder )
{
sal_uInt16 nStyle = FRAME_DRAW_NODRAW;
DrawFrameStyle nStyle = DrawFrameStyle::NONE;
DrawFrameFlags nFlags = DrawFrameFlags::NoDraw;
// move border outside if border was converted or if the BorderWindow is a frame window,
if ( mpBorderWindow->mbSmallOutBorder )
nStyle |= FRAME_DRAW_DOUBLEOUT;
nStyle = DrawFrameStyle::DoubleOut;
else if ( nBorderStyle & WindowBorderStyle::NWF )
nStyle |= FRAME_DRAW_NWF;
nStyle = DrawFrameStyle::NWF;
else
nStyle |= FRAME_DRAW_DOUBLEIN;
nStyle = DrawFrameStyle::DoubleIn;
if ( nBorderStyle & WindowBorderStyle::MONO )
nStyle |= FRAME_DRAW_MONO;
nFlags |= DrawFrameFlags::Mono;
DecorationView aDecoView( mpOutDev );
Rectangle aRect( 0, 0, 10, 10 );
Rectangle aCalcRect = aDecoView.DrawFrame( aRect, nStyle );
Rectangle aCalcRect = aDecoView.DrawFrame( aRect, nStyle, nFlags );
mnLeftBorder = aCalcRect.Left();
mnTopBorder = aCalcRect.Top();
mnRightBorder = aRect.Right()-aCalcRect.Right();
......@@ -1321,26 +1322,27 @@ void ImplSmallBorderWindowView::DrawWindow(sal_uInt16 nDrawFlags, OutputDevice*,
if (nDrawFlags & BORDERWINDOW_DRAW_FRAME)
{
sal_uInt16 nStyle = 0;
DrawFrameStyle nStyle = DrawFrameStyle::NONE;
DrawFrameFlags nFlags = DrawFrameFlags::NONE;
// move border outside if border was converted or if the border window is a frame window,
if (mpBorderWindow->mbSmallOutBorder)
nStyle |= FRAME_DRAW_DOUBLEOUT;
nStyle = DrawFrameStyle::DoubleOut;
else if (nBorderStyle & WindowBorderStyle::NWF)
nStyle |= FRAME_DRAW_NWF;
nStyle = DrawFrameStyle::NWF;
else
nStyle |= FRAME_DRAW_DOUBLEIN;
nStyle = DrawFrameStyle::DoubleIn;
if (nBorderStyle & WindowBorderStyle::MONO)
nStyle |= FRAME_DRAW_MONO;
nFlags |= DrawFrameFlags::Mono;
if (nBorderStyle & WindowBorderStyle::MENU)
nStyle |= FRAME_DRAW_MENU;
nFlags |= DrawFrameFlags::Menu;
// tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
if (pWin && pWin == pWin->ImplGetFrameWindow())
nStyle |= FRAME_DRAW_WINDOWBORDER;
nFlags |= DrawFrameFlags::WindowBorder;
DecorationView aDecoView(mpOutDev);
Point aTmpPoint;
Rectangle aInRect(aTmpPoint, Size(mnWidth, mnHeight));
aDecoView.DrawFrame(aInRect, nStyle);
aDecoView.DrawFrame(aInRect, nStyle, nFlags);
}
}
......@@ -1402,7 +1404,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
DecorationView aDecoView( pDev );
Rectangle aRect( 0, 0, 10, 10 );
Rectangle aCalcRect = aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW );
Rectangle aCalcRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleOut, DrawFrameFlags::NoDraw );
pData->mpOutDev = pDev;
pData->mnWidth = nWidth;
......@@ -1605,7 +1607,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
pDev->SetClipRegion(oldClipRgn);
}
else
aInRect = aDecoView.DrawFrame(aInRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW);
aInRect = aDecoView.DrawFrame(aInRect, DrawFrameStyle::DoubleOut, DrawFrameFlags::NoDraw);
// Draw Border
pDev->SetLineColor();
......
......@@ -621,11 +621,11 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect,
}
void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
const StyleSettings& rStyleSettings, DrawFrameStyle nStyle, DrawFrameFlags nFlags )
{
vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : NULL;
const bool bMenuStyle = nStyle & FRAME_DRAW_MENU;
const bool bMenuStyle(nFlags & DrawFrameFlags::Menu);
// UseFlatBorders disables 3D style for all frames except menus
// menus may use different border colors (eg on XP)
......@@ -643,19 +643,19 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
bFlatBorders = false;
}
const bool bNoDraw = nStyle & FRAME_DRAW_NODRAW;
const bool bNoDraw(nFlags & DrawFrameFlags::NoDraw);
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) ||
bFlatBorders )
nStyle |= FRAME_DRAW_MONO;
nFlags |= DrawFrameFlags::Mono;
if( (nStyle & FRAME_DRAW_STYLE) != FRAME_DRAW_NWF &&
if( nStyle != DrawFrameStyle::NWF &&
pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) )
{
ImplControlValue aControlValue( nStyle |
(pWin->GetType()==WINDOW_BORDERWINDOW ?
FRAME_DRAW_BORDERWINDOWBORDER : 0) );
ImplControlValue aControlValue( static_cast<long>(nStyle) |
static_cast<long>(pWin->GetType()==WINDOW_BORDERWINDOW ?
DrawFrameFlags::BorderWindowBorder : DrawFrameFlags::NONE) );
Rectangle aBound, aContent;
Rectangle aNatRgn( rRect );
if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
......@@ -673,10 +673,10 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
}
}
if ( nStyle & FRAME_DRAW_MONO )
if ( nFlags & DrawFrameFlags::Mono )
{
// no round corners for window frame borders
const bool bRound = bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER);
const bool bRound = bFlatBorders && !(nFlags & DrawFrameFlags::WindowBorder);
if ( bNoDraw )
{
......@@ -704,39 +704,40 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
{
if ( bNoDraw )
{
switch ( nStyle & FRAME_DRAW_STYLE )
switch ( nStyle )
{
case FRAME_DRAW_IN:
case FRAME_DRAW_OUT:
case DrawFrameStyle::In:
case DrawFrameStyle::Out:
++rRect.Left();
++rRect.Top();
--rRect.Right();
--rRect.Bottom();
break;
case FRAME_DRAW_GROUP:
case FRAME_DRAW_DOUBLEIN:
case FRAME_DRAW_DOUBLEOUT:
case DrawFrameStyle::Group:
case DrawFrameStyle::DoubleIn:
case DrawFrameStyle::DoubleOut:
rRect.Left() += 2;
rRect.Top() += 2;
rRect.Right() -= 2;
rRect.Bottom() -= 2;
break;
case FRAME_DRAW_NWF:
case DrawFrameStyle::NWF:
// enough space for the native rendering
rRect.Left() += 4;
rRect.Top() += 4;
rRect.Right() -= 4;
rRect.Bottom() -= 4;
break;
default: break;
}
}
else
{
switch ( nStyle & FRAME_DRAW_STYLE )
switch ( nStyle )
{
case FRAME_DRAW_GROUP:
case DrawFrameStyle::Group:
pDev->SetFillColor();
pDev->SetLineColor( rStyleSettings.GetLightColor() );
pDev->DrawRect( Rectangle( rRect.Left()+1, rRect.Top()+1,
......@@ -752,19 +753,19 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
rRect.Bottom() -= 2;
break;
case FRAME_DRAW_IN:
case DrawFrameStyle::In:
ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetShadowColor(),
rStyleSettings.GetLightColor() );
break;
case FRAME_DRAW_OUT:
case DrawFrameStyle::Out:
ImplDraw2ColorFrame( pDev, rRect,
rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() );
break;
case FRAME_DRAW_DOUBLEIN:
case DrawFrameStyle::DoubleIn:
if( bFlatBorders )
{
// no 3d effect
......@@ -786,7 +787,7 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
}
break;
case FRAME_DRAW_DOUBLEOUT:
case DrawFrameStyle::DoubleOut:
if( bMenuStyle )
{
ImplDraw2ColorFrame( pDev, rRect,
......@@ -812,13 +813,14 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect,
}
break;
case FRAME_DRAW_NWF:
case DrawFrameStyle::NWF:
// no rendering, just enough space for the native rendering
rRect.Left() += 4;
rRect.Top() += 4;
rRect.Right() -= 4;
rRect.Bottom() -= 4;
break;
default: break;
}
}
}
......@@ -934,7 +936,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
DrawFrame( rRect, aLightColor, aShadowColor );
}
Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
Rectangle DecorationView::DrawFrame( const Rectangle& rRect, DrawFrameStyle nStyle, DrawFrameFlags nFlags )
{
Rectangle aRect = rRect;
bool bOldMap = mpOutDev->IsMapModeEnabled();
......@@ -946,13 +948,13 @@ Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
if ( !rRect.IsEmpty() )
{
if ( nStyle & FRAME_DRAW_NODRAW )
ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle );
if ( nFlags & DrawFrameFlags::NoDraw )
ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle, nFlags );
else
{
Color maOldLineColor = mpOutDev->GetLineColor();
Color maOldFillColor = mpOutDev->GetFillColor();
ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle );
ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle, nFlags );
mpOutDev->SetLineColor( maOldLineColor );
mpOutDev->SetFillColor( maOldFillColor );
}
......
......@@ -2064,7 +2064,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI
Point aTmpPos2( aPos );
aTmpPos2.X() = aOutSz.Width() - nFontHeight - nFontHeight/4;
aDecoView.DrawFrame(
Rectangle( aTmpPos2, Size( nFontHeight+nFontHeight/4, pData->aSz.Height() ) ), FRAME_DRAW_GROUP );
Rectangle( aTmpPos2, Size( nFontHeight+nFontHeight/4, pData->aSz.Height() ) ), DrawFrameStyle::Group );
}
aDecoView.DrawSymbol(
Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ),
......
......@@ -192,7 +192,7 @@ void PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
Rectangle aFrameRect(aOffset + Point(-1, -1), Size(maPreviewSize.Width() + 2, maPreviewSize.Height() + 2));
DecorationView aDecorationView(&rRenderContext);
aDecorationView.DrawFrame(aFrameRect, FRAME_DRAW_GROUP);
aDecorationView.DrawFrame(aFrameRect, DrawFrameStyle::Group);
}
void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt )
......@@ -377,7 +377,7 @@ void PrintDialog::ShowNupOrderWindow::Paint(vcl::RenderContext& rRenderContext,
nY * aSubSize.Height() + nDeltaY), aPageText);
}
DecorationView aDecorationView(&rRenderContext);
aDecorationView.DrawFrame(Rectangle(Point(0, 0), aOutSize), FRAME_DRAW_GROUP);
aDecorationView.DrawFrame(Rectangle(Point(0, 0), aOutSize), DrawFrameStyle::Group);
}
PrintDialog::NUpTabPage::NUpTabPage( VclBuilder *pUIBuilder )
......
......@@ -161,7 +161,7 @@ void SplitWindow::ImplDrawBorder(vcl::RenderContext& rRenderContext)
DecorationView aDecoView(&rRenderContext);
Point aTmpPoint;
Rectangle aRect(aTmpPoint, Size(nDX, nDY));
aDecoView.DrawFrame(aRect, FRAME_DRAW_DOUBLEIN);
aDecoView.DrawFrame(aRect, DrawFrameStyle::DoubleIn);
}
else
{
......
......@@ -444,12 +444,12 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen
{
if (!(pItem->mnBits & SIB_FLAT))
{
sal_uInt16 nStyle;
DrawFrameStyle nStyle;
if (pItem->mnBits & SIB_IN)
nStyle = FRAME_DRAW_IN;
nStyle = DrawFrameStyle::In;
else
nStyle = FRAME_DRAW_OUT;
nStyle = DrawFrameStyle::Out;
DecorationView aDecoView(&rRenderContext);
aDecoView.DrawFrame(aRect, nStyle);
......@@ -598,7 +598,7 @@ void StatusBar::ImplDrawProgress(vcl::RenderContext& rRenderContext, bool bPaint
if (!bNative)
{
DecorationView aDecoView(&rRenderContext);
aDecoView.DrawFrame(maPrgsFrameRect, FRAME_DRAW_IN);
aDecoView.DrawFrame(maPrgsFrameRect, DrawFrameStyle::In);
}
}
......@@ -1463,7 +1463,7 @@ Size StatusBar::CalcWindowSizePixel() const
if( mpImplData->mbDrawItemFrames &&
IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) )
{
ImplControlValue aControlValue( FRAME_DRAW_NODRAW );
ImplControlValue aControlValue( static_cast<long>(DrawFrameFlags::NoDraw) );
Rectangle aBound, aContent;
Rectangle aNatRgn( Point( 0, 0 ), Size( 150, 50 ) );
if( GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
......
......@@ -1317,13 +1317,13 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
{
int frameWidth = getFrameWidth(gWidgetData[m_nXScreen].gFrame);
rNativeBoundingRegion = rControlRegion;
sal_uInt16 nStyle = aValue.getNumericVal();
DrawFrameFlags nStyle = static_cast<DrawFrameFlags>(aValue.getNumericVal() & 0xfff0);
int x1=rControlRegion.Left();
int y1=rControlRegion.Top();
int x2=rControlRegion.Right();
int y2=rControlRegion.Bottom();
if( nStyle & FRAME_DRAW_NODRAW )
if( nStyle & DrawFrameFlags::NoDraw )
{
rNativeContentRegion = Rectangle(x1+frameWidth,
y1+frameWidth,
......@@ -1494,10 +1494,10 @@ bool GtkSalGraphics::NWPaintGTKFrame(
GdkRectangle clipRect;
int frameWidth=getFrameWidth(gWidgetData[m_nXScreen].gFrame);
GtkShadowType shadowType=GTK_SHADOW_IN;
sal_uInt16 nStyle = aValue.getNumericVal();
if( nStyle & FRAME_DRAW_IN )
DrawFrameStyle nStyle = static_cast<DrawFrameStyle>(aValue.getNumericVal() & 0x0f);
if( nStyle == DrawFrameStyle::In )
shadowType=GTK_SHADOW_OUT;
if( nStyle & FRAME_DRAW_OUT )
if( nStyle == DrawFrameStyle::Out )
shadowType=GTK_SHADOW_IN;
for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
......
......@@ -840,7 +840,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
{
int nFrameWidth = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth();
sal_uInt16 nStyle = val.getNumericVal();
if( nStyle & FRAME_DRAW_NODRAW )
if( nStyle & DrawFrameFlags::NoDraw )
{
// in this case the question is: how thick would a frame be
// see brdwin.cxx, decoview.cxx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment