summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-09 16:31:21 +0200
committerNoel Grandin <noel@peralex.com>2016-05-10 08:40:10 +0200
commit9c7222c11c331ecd1562e963e78ab85be75b8e49 (patch)
tree24ec24a42a54cafdc4e4eb1da7f47fb2f0d71d8c /vcl
parentfix Windows build (diff)
downloadcore-9c7222c11c331ecd1562e963e78ab85be75b8e49.tar.gz
core-9c7222c11c331ecd1562e963e78ab85be75b8e49.zip
convert WINDOWSTATE_MASK to scoped enum
Change-Id: Ic8259d81d8080c518aa07697e253a59cd6efaa4b
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/svpframe.cxx14
-rw-r--r--vcl/inc/salwtype.hxx3
-rw-r--r--vcl/osx/salframe.cxx22
-rw-r--r--vcl/source/window/dockwin.cxx4
-rw-r--r--vcl/source/window/syswin.cxx114
-rw-r--r--vcl/source/window/wrkwin.cxx2
-rw-r--r--vcl/unx/generic/window/salframe.cxx22
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx44
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx44
-rw-r--r--vcl/win/window/salframe.cxx16
10 files changed, 143 insertions, 142 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 80035726c7d3..ee6d58891ca6 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -306,8 +306,8 @@ SalFrame* SvpSalFrame::GetParent() const
}
#define FRAMESTATE_MASK_GEOMETRY \
- (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | \
- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT)
+ (WindowStateMask::X | WindowStateMask::Y | \
+ WindowStateMask::Width | WindowStateMask::Height)
void SvpSalFrame::SetWindowState( const SalFrameState *pState )
{
@@ -323,13 +323,13 @@ void SvpSalFrame::SetWindowState( const SalFrameState *pState )
long nHeight = maGeometry.nHeight;
// change requested properties
- if (pState->mnMask & WINDOWSTATE_MASK_X)
+ if (pState->mnMask & WindowStateMask::X)
nX = pState->mnX;
- if (pState->mnMask & WINDOWSTATE_MASK_Y)
+ if (pState->mnMask & WindowStateMask::Y)
nY = pState->mnY;
- if (pState->mnMask & WINDOWSTATE_MASK_WIDTH)
+ if (pState->mnMask & WindowStateMask::Width)
nWidth = pState->mnWidth;
- if (pState->mnMask & WINDOWSTATE_MASK_HEIGHT)
+ if (pState->mnMask & WindowStateMask::Height)
nHeight = pState->mnHeight;
SetPosSize( nX, nY, nWidth, nHeight,
@@ -345,7 +345,7 @@ bool SvpSalFrame::GetWindowState( SalFrameState* pState )
pState->mnY = maGeometry.nY;
pState->mnWidth = maGeometry.nWidth;
pState->mnHeight = maGeometry.nHeight;
- pState->mnMask = FRAMESTATE_MASK_GEOMETRY | WINDOWSTATE_MASK_STATE;
+ pState->mnMask = FRAMESTATE_MASK_GEOMETRY | WindowStateMask::State;
return true;
}
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 155d2f9b5234..2fffde7c1264 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -31,6 +31,7 @@ namespace vcl { class Window; }
class FontSelectPattern;
enum class InputContextFlags;
+enum class WindowStateMask;
#define SALEVENT_MOUSEMOVE ((sal_uInt16)1)
#define SALEVENT_MOUSELEAVE ((sal_uInt16)2)
@@ -224,7 +225,7 @@ typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject,
struct SalFrameState
{
- sal_uLong mnMask;
+ WindowStateMask mnMask;
long mnX;
long mnY;
long mnWidth;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 832d1328fcf9..0d535dc636c9 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -539,13 +539,13 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
NSRect aStateRect = [mpNSWindow frame];
aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask];
CocoaToVCL( aStateRect );
- if( pState->mnMask & WINDOWSTATE_MASK_X )
+ if( pState->mnMask & WindowStateMask::X )
aStateRect.origin.x = float(pState->mnX);
- if( pState->mnMask & WINDOWSTATE_MASK_Y )
+ if( pState->mnMask & WindowStateMask::Y )
aStateRect.origin.y = float(pState->mnY);
- if( pState->mnMask & WINDOWSTATE_MASK_WIDTH )
+ if( pState->mnMask & WindowStateMask::Width )
aStateRect.size.width = float(pState->mnWidth);
- if( pState->mnMask & WINDOWSTATE_MASK_HEIGHT )
+ if( pState->mnMask & WindowStateMask::Height )
aStateRect.size.height = float(pState->mnHeight);
VCLToCocoa( aStateRect );
aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask];
@@ -576,13 +576,13 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
UpdateFrameGeometry();
sal_uInt16 nEvent = 0;
- if( pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y) )
+ if( pState->mnMask & (WindowStateMask::X | WindowStateMask::Y) )
{
mbPositioned = true;
nEvent = SALEVENT_MOVE;
}
- if( pState->mnMask & (WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT) )
+ if( pState->mnMask & (WindowStateMask::Width | WindowStateMask::Height) )
{
mbSized = true;
nEvent = (nEvent == SALEVENT_MOVE) ? SALEVENT_MOVERESIZE : SALEVENT_RESIZE;
@@ -609,11 +609,11 @@ bool AquaSalFrame::GetWindowState( SalFrameState* pState )
// #i113170# may not be the main thread if called from UNO API
SalData::ensureThreadAutoreleasePool();
- pState->mnMask = WINDOWSTATE_MASK_X |
- WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH |
- WINDOWSTATE_MASK_HEIGHT |
- WINDOWSTATE_MASK_STATE;
+ pState->mnMask = WindowStateMask::X |
+ WindowStateMask::Y |
+ WindowStateMask::Width |
+ WindowStateMask::Height |
+ WindowStateMask::State;
NSRect aStateRect = [mpNSWindow frame];
aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask];
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 84322a9df9b2..aad8795d44e1 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -1020,7 +1020,7 @@ Point DockingWindow::GetFloatingPos() const
if ( pWrapper->mpFloatWin )
{
WindowStateData aData;
- aData.SetMask( WINDOWSTATE_MASK_POS );
+ aData.SetMask( WindowStateMask::Pos );
pWrapper->mpFloatWin->GetWindowStateData( aData );
Point aPos( aData.GetX(), aData.GetY() );
aPos = pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel( aPos );
@@ -1033,7 +1033,7 @@ Point DockingWindow::GetFloatingPos() const
if ( mpFloatWin )
{
WindowStateData aData;
- aData.SetMask( WINDOWSTATE_MASK_POS );
+ aData.SetMask( WindowStateMask::Pos );
mpFloatWin->GetWindowStateData( aData );
Point aPos( aData.GetX(), aData.GetY() );
aPos = mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel( aPos );
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 02b15dac35ce..5a6effbadd35 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -406,7 +406,7 @@ const Size& SystemWindow::GetMaxOutputSizePixel() const
static void ImplWindowStateFromStr(WindowStateData& rData,
const OString& rStr)
{
- sal_uInt32 nValidMask = 0;
+ WindowStateMask nValidMask = WindowStateMask::NONE;
sal_Int32 nIndex = 0;
OString aTokenStr;
@@ -415,7 +415,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetX(aTokenStr.toInt32());
if( rData.GetX() > -16384 && rData.GetX() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_X;
+ nValidMask |= WindowStateMask::X;
else
rData.SetX( 0 );
}
@@ -426,7 +426,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetY(aTokenStr.toInt32());
if( rData.GetY() > -16384 && rData.GetY() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_Y;
+ nValidMask |= WindowStateMask::Y;
else
rData.SetY( 0 );
}
@@ -437,7 +437,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetWidth(aTokenStr.toInt32());
if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_WIDTH;
+ nValidMask |= WindowStateMask::Width;
else
rData.SetWidth( 0 );
}
@@ -448,7 +448,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetHeight(aTokenStr.toInt32());
if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_HEIGHT;
+ nValidMask |= WindowStateMask::Height;
else
rData.SetHeight( 0 );
}
@@ -462,7 +462,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
sal_uInt32 nState = (sal_uInt32)aTokenStr.toInt32();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( nState );
- nValidMask |= WINDOWSTATE_MASK_STATE;
+ nValidMask |= WindowStateMask::State;
}
else
rData.SetState( 0 );
@@ -473,7 +473,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetMaximizedX(aTokenStr.toInt32());
if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X;
+ nValidMask |= WindowStateMask::MaximizedX;
else
rData.SetMaximizedX( 0 );
}
@@ -484,7 +484,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetMaximizedY(aTokenStr.toInt32());
if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y;
+ nValidMask |= WindowStateMask::MaximizedY;
else
rData.SetMaximizedY( 0 );
}
@@ -495,7 +495,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetMaximizedWidth(aTokenStr.toInt32());
if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH;
+ nValidMask |= WindowStateMask::MaximizedWidth;
else
rData.SetMaximizedWidth( 0 );
}
@@ -506,7 +506,7 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
{
rData.SetMaximizedHeight(aTokenStr.toInt32());
if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 )
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
+ nValidMask |= WindowStateMask::MaximizedHeight;
else
rData.SetMaximizedHeight( 0 );
}
@@ -519,25 +519,25 @@ static void ImplWindowStateFromStr(WindowStateData& rData,
static OString ImplWindowStateToStr(const WindowStateData& rData)
{
- const sal_uInt32 nValidMask = rData.GetMask();
- if ( !nValidMask )
+ const WindowStateMask nValidMask = rData.GetMask();
+ if ( nValidMask == WindowStateMask::NONE )
return OString();
OStringBuffer rStrBuf;
- if ( nValidMask & WINDOWSTATE_MASK_X )
+ if ( nValidMask & WindowStateMask::X )
rStrBuf.append(static_cast<sal_Int32>(rData.GetX()));
rStrBuf.append(',');
- if ( nValidMask & WINDOWSTATE_MASK_Y )
+ if ( nValidMask & WindowStateMask::Y )
rStrBuf.append(static_cast<sal_Int32>(rData.GetY()));
rStrBuf.append(',');
- if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
+ if ( nValidMask & WindowStateMask::Width )
rStrBuf.append(static_cast<sal_Int32>(rData.GetWidth()));
rStrBuf.append(',');
- if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
+ if ( nValidMask & WindowStateMask::Height )
rStrBuf.append(static_cast<sal_Int32>(rData.GetHeight()));
rStrBuf.append( ';' );
- if ( nValidMask & WINDOWSTATE_MASK_STATE )
+ if ( nValidMask & WindowStateMask::State )
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
@@ -545,16 +545,16 @@ static OString ImplWindowStateToStr(const WindowStateData& rData)
rStrBuf.append(static_cast<sal_Int32>(nState));
}
rStrBuf.append(';');
- if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X )
+ if ( nValidMask & WindowStateMask::MaximizedX )
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedX()));
rStrBuf.append(',');
- if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y )
+ if ( nValidMask & WindowStateMask::MaximizedY )
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedY()));
rStrBuf.append( ',' );
- if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH )
+ if ( nValidMask & WindowStateMask::MaximizedWidth )
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedWidth()));
rStrBuf.append(',');
- if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT )
+ if ( nValidMask & WindowStateMask::MaximizedHeight )
rStrBuf.append(static_cast<sal_Int32>(rData.GetMaximizedHeight()));
rStrBuf.append(';');
@@ -618,8 +618,8 @@ void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, lo
void SystemWindow::SetWindowStateData( const WindowStateData& rData )
{
- const sal_uInt32 nValidMask = rData.GetMask();
- if ( !nValidMask )
+ const WindowStateMask nValidMask = rData.GetMask();
+ if ( nValidMask == WindowStateMask::NONE )
return;
if ( mbSysChild )
@@ -639,7 +639,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
aState.mnWidth = rData.GetWidth();
aState.mnHeight = rData.GetHeight();
- if( rData.GetMask() & (WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
+ if( rData.GetMask() & (WindowStateMask::Width|WindowStateMask::Height) )
{
// #i43799# adjust window state sizes if a minimal output size was set
// otherwise the frame and the client might get different sizes
@@ -664,8 +664,8 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
// #96568# avoid having multiple frames at the same screen location
// do the check only if not maximized
- if( !((rData.GetMask() & WINDOWSTATE_MASK_STATE) && (nState & WINDOWSTATE_STATE_MAXIMIZED)) )
- if( rData.GetMask() & (WINDOWSTATE_MASK_POS|WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
+ if( !((rData.GetMask() & WindowStateMask::State) && (nState & WINDOWSTATE_STATE_MAXIMIZED)) )
+ if( rData.GetMask() & (WindowStateMask::Pos|WindowStateMask::Width|WindowStateMask::Height) )
{
Rectangle aDesktop = GetDesktopRectPixel();
ImplSVData *pSVData = ImplGetSVData();
@@ -711,7 +711,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
// do a synchronous resize for layout reasons
// but use rData only when the window is not to be maximized (#i38089#)
// otherwise we have no useful size information
- if( (rData.GetMask() & WINDOWSTATE_MASK_STATE) && (nState & WINDOWSTATE_STATE_MAXIMIZED) )
+ if( (rData.GetMask() & WindowStateMask::State) && (nState & WINDOWSTATE_STATE_MAXIMIZED) )
{
// query maximized size from frame
SalFrameGeometry aGeometry = mpWindowImpl->mpFrame->GetGeometry();
@@ -723,19 +723,19 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
ImplHandleResize( pWindow, aGeometry.nWidth, aGeometry.nHeight );
}
else
- if( rData.GetMask() & (WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
+ if( rData.GetMask() & (WindowStateMask::Width|WindowStateMask::Height) )
ImplHandleResize( pWindow, aState.mnWidth, aState.mnHeight ); // #i43799# use aState and not rData, see above
}
else
{
PosSizeFlags nPosSize = PosSizeFlags::NONE;
- if ( nValidMask & WINDOWSTATE_MASK_X )
+ if ( nValidMask & WindowStateMask::X )
nPosSize |= PosSizeFlags::X;
- if ( nValidMask & WINDOWSTATE_MASK_Y )
+ if ( nValidMask & WindowStateMask::Y )
nPosSize |= PosSizeFlags::Y;
- if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
+ if ( nValidMask & WindowStateMask::Width )
nPosSize |= PosSizeFlags::Width;
- if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
+ if ( nValidMask & WindowStateMask::Height )
nPosSize |= PosSizeFlags::Height;
if( IsRollUp() )
@@ -758,7 +758,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
maOrgSize = Size( nWidth, nHeight );
// 91625 - ignore Minimize
- if ( nValidMask & WINDOWSTATE_MASK_STATE )
+ if ( nValidMask & WindowStateMask::State )
{
const sal_uInt32 nState = rData.GetState();
if ( nState & WINDOWSTATE_STATE_ROLLUP )
@@ -771,8 +771,8 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
- sal_uInt32 nValidMask = rData.GetMask();
- if ( !nValidMask )
+ WindowStateMask nValidMask = rData.GetMask();
+ if ( nValidMask == WindowStateMask::NONE )
return;
if ( mbSysChild )
@@ -785,49 +785,49 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
if ( pWindow->mpWindowImpl->mbFrame )
{
SalFrameState aState;
- aState.mnMask = 0xFFFFFFFF;
+ aState.mnMask = WindowStateMask::All;
if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
{
- if ( nValidMask & WINDOWSTATE_MASK_X )
+ if ( nValidMask & WindowStateMask::X )
rData.SetX( aState.mnX );
- if ( nValidMask & WINDOWSTATE_MASK_Y )
+ if ( nValidMask & WindowStateMask::Y )
rData.SetY( aState.mnY );
- if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
+ if ( nValidMask & WindowStateMask::Width )
rData.SetWidth( aState.mnWidth );
- if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
+ if ( nValidMask & WindowStateMask::Height )
rData.SetHeight( aState.mnHeight );
- if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_X )
+ if ( aState.mnMask & WindowStateMask::MaximizedX )
{
rData.SetMaximizedX( aState.mnMaximizedX );
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X;
+ nValidMask |= WindowStateMask::MaximizedX;
}
- if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_Y )
+ if ( aState.mnMask & WindowStateMask::MaximizedY )
{
rData.SetMaximizedY( aState.mnMaximizedY );
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y;
+ nValidMask |= WindowStateMask::MaximizedY;
}
- if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH )
+ if ( aState.mnMask & WindowStateMask::MaximizedWidth )
{
rData.SetMaximizedWidth( aState.mnMaximizedWidth );
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH;
+ nValidMask |= WindowStateMask::MaximizedWidth;
}
- if ( aState.mnMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT )
+ if ( aState.mnMask & WindowStateMask::MaximizedHeight )
{
rData.SetMaximizedHeight( aState.mnMaximizedHeight );
- nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
+ nValidMask |= WindowStateMask::MaximizedHeight;
}
- if ( nValidMask & WINDOWSTATE_MASK_STATE )
+ if ( nValidMask & WindowStateMask::State )
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- if ( !(nValidMask&WINDOWSTATE_MASK_MINIMIZED) )
+ if ( !(nValidMask&WindowStateMask::Minimized) )
aState.mnState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( aState.mnState );
}
rData.SetMask( nValidMask );
}
else
- rData.SetMask( 0 );
+ rData.SetMask( WindowStateMask::NONE );
}
else
{
@@ -841,15 +841,15 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
nState = WINDOWSTATE_STATE_ROLLUP;
}
- if ( nValidMask & WINDOWSTATE_MASK_X )
+ if ( nValidMask & WindowStateMask::X )
rData.SetX( aPos.X() );
- if ( nValidMask & WINDOWSTATE_MASK_Y )
+ if ( nValidMask & WindowStateMask::Y )
rData.SetY( aPos.Y() );
- if ( nValidMask & WINDOWSTATE_MASK_WIDTH )
+ if ( nValidMask & WindowStateMask::Width )
rData.SetWidth( aSize.Width() );
- if ( nValidMask & WINDOWSTATE_MASK_HEIGHT )
+ if ( nValidMask & WindowStateMask::Height )
rData.SetHeight( aSize.Height() );
- if ( nValidMask & WINDOWSTATE_MASK_STATE )
+ if ( nValidMask & WindowStateMask::State )
rData.SetState( nState );
}
}
@@ -864,7 +864,7 @@ void SystemWindow::SetWindowState(const OString& rStr)
SetWindowStateData( aData );
}
-OString SystemWindow::GetWindowState( sal_uInt32 nMask ) const
+OString SystemWindow::GetWindowState( WindowStateMask nMask ) const
{
WindowStateData aData;
aData.SetMask( nMask );
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index caeee5642d2b..1783d918c666 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -232,7 +232,7 @@ bool WorkWindow::SetPluginParent( SystemParentData* pParent )
void WorkWindow::ImplSetFrameState( sal_uLong aFrameState )
{
SalFrameState aState;
- aState.mnMask = WINDOWSTATE_MASK_STATE;
+ aState.mnMask = WindowStateMask::State;
aState.mnState = aFrameState;
mpWindowImpl->mpFrame->SetWindowState( &aState );
}
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 7f4511df6ab0..9060664c9efd 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -1610,11 +1610,11 @@ void X11SalFrame::SetAlwaysOnTop( bool bOnTop )
}
#define FRAMESTATE_MASK_GEOMETRY \
- (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | \
- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT)
+ (WindowStateMask::X | WindowStateMask::Y | \
+ WindowStateMask::Width | WindowStateMask::Height)
#define FRAMESTATE_MASK_MAXIMIZED_GEOMETRY \
- (WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | \
- WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT)
+ (WindowStateMask::MaximizedX | WindowStateMask::MaximizedY | \
+ WindowStateMask::MaximizedWidth | WindowStateMask::MaximizedHeight)
void X11SalFrame::SetWindowState( const SalFrameState *pState )
{
@@ -1631,7 +1631,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
* in state change below maximize window
*/
if( ! IsChildWindow() &&
- (pState->mnMask & WINDOWSTATE_MASK_STATE) &&
+ (pState->mnMask & WindowStateMask::State) &&
(pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) &&
(pState->mnMask & FRAMESTATE_MASK_GEOMETRY) == FRAMESTATE_MASK_GEOMETRY &&
(pState->mnMask & FRAMESTATE_MASK_MAXIMIZED_GEOMETRY) == FRAMESTATE_MASK_MAXIMIZED_GEOMETRY
@@ -1670,21 +1670,21 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
GetPosSize (aPosSize);
// change requested properties
- if (pState->mnMask & WINDOWSTATE_MASK_X)
+ if (pState->mnMask & WindowStateMask::X)
{
aPosSize.setX (pState->mnX);
}
- if (pState->mnMask & WINDOWSTATE_MASK_Y)
+ if (pState->mnMask & WindowStateMask::Y)
{
aPosSize.setY (pState->mnY);
}
- if (pState->mnMask & WINDOWSTATE_MASK_WIDTH)
+ if (pState->mnMask & WindowStateMask::Width)
{
long nWidth = pState->mnWidth > 0 ? pState->mnWidth - 1 : 0;
aPosSize.setWidth (nWidth);
bDoAdjust = true;
}
- if (pState->mnMask & WINDOWSTATE_MASK_HEIGHT)
+ if (pState->mnMask & WindowStateMask::Height)
{
int nHeight = pState->mnHeight > 0 ? pState->mnHeight - 1 : 0;
aPosSize.setHeight (nHeight);
@@ -1730,7 +1730,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
}
// request for status change
- if (pState->mnMask & WINDOWSTATE_MASK_STATE)
+ if (pState->mnMask & WindowStateMask::State)
{
if (pState->mnState & WINDOWSTATE_STATE_MAXIMIZED)
{
@@ -1792,7 +1792,7 @@ bool X11SalFrame::GetWindowState( SalFrameState* pState )
pState->mnWidth = aPosSize.GetWidth();
pState->mnHeight = aPosSize.GetHeight();
- pState->mnMask = FRAMESTATE_MASK_GEOMETRY | WINDOWSTATE_MASK_STATE;
+ pState->mnMask = FRAMESTATE_MASK_GEOMETRY | WindowStateMask::State;
if (! maRestorePosSize.IsEmpty() )
{
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 4a952758a1d7..fae99b769bd4 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -1828,13 +1828,13 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
if( ! m_pWindow || ! pState || isChild( true, false ) )
return;
- const sal_uLong nMaxGeometryMask =
- WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT |
- WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y |
- WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
+ const WindowStateMask nMaxGeometryMask =
+ WindowStateMask::X | WindowStateMask::Y |
+ WindowStateMask::Width | WindowStateMask::Height |
+ WindowStateMask::MaximizedX | WindowStateMask::MaximizedY |
+ WindowStateMask::MaximizedWidth | WindowStateMask::MaximizedHeight;
- if( (pState->mnMask & WINDOWSTATE_MASK_STATE) &&
+ if( (pState->mnMask & WindowStateMask::State) &&
! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) &&
(pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) &&
(pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask )
@@ -1854,27 +1854,27 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
Size( pState->mnWidth, pState->mnHeight ) );
CallCallback( SALEVENT_RESIZE, nullptr );
}
- else if( pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ) )
+ else if( pState->mnMask & (WindowStateMask::X | WindowStateMask::Y |
+ WindowStateMask::Width | WindowStateMask::Height ) )
{
sal_uInt16 nPosSizeFlags = 0;
long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0);
long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0);
- if( pState->mnMask & WINDOWSTATE_MASK_X )
+ if( pState->mnMask & WindowStateMask::X )
nPosSizeFlags |= SAL_FRAME_POSSIZE_X;
else
nX = maGeometry.nX - (m_pParent ? m_pParent->maGeometry.nX : 0);
- if( pState->mnMask & WINDOWSTATE_MASK_Y )
+ if( pState->mnMask & WindowStateMask::Y )
nPosSizeFlags |= SAL_FRAME_POSSIZE_Y;
else
nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0);
- if( pState->mnMask & WINDOWSTATE_MASK_WIDTH )
+ if( pState->mnMask & WindowStateMask::Width )
nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH;
- if( pState->mnMask & WINDOWSTATE_MASK_HEIGHT )
+ if( pState->mnMask & WindowStateMask::Height )
nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT;
SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags );
}
- if( pState->mnMask & WINDOWSTATE_MASK_STATE && ! isChild() )
+ if( pState->mnMask & WindowStateMask::State && ! isChild() )
{
if( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED )
gtk_window_maximize( GTK_WINDOW(m_pWindow) );
@@ -1900,7 +1900,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
bool GtkSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = WINDOWSTATE_STATE_NORMAL;
- pState->mnMask = WINDOWSTATE_MASK_STATE;
+ pState->mnMask = WindowStateMask::State;
// rollup ? gtk 2.2 does not seem to support the shaded state
if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) )
pState->mnState |= WINDOWSTATE_STATE_MINIMIZED;
@@ -1915,10 +1915,10 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState )
pState->mnMaximizedY = maGeometry.nY;
pState->mnMaximizedWidth = maGeometry.nWidth;
pState->mnMaximizedHeight = maGeometry.nHeight;
- pState->mnMask |= WINDOWSTATE_MASK_MAXIMIZED_X |
- WINDOWSTATE_MASK_MAXIMIZED_Y |
- WINDOWSTATE_MASK_MAXIMIZED_WIDTH |
- WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
+ pState->mnMask |= WindowStateMask::MaximizedX |
+ WindowStateMask::MaximizedY |
+ WindowStateMask::MaximizedWidth |
+ WindowStateMask::MaximizedHeight;
}
else
{
@@ -1927,10 +1927,10 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState )
pState->mnWidth = maGeometry.nWidth;
pState->mnHeight = maGeometry.nHeight;
}
- pState->mnMask |= WINDOWSTATE_MASK_X |
- WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH |
- WINDOWSTATE_MASK_HEIGHT;
+ pState->mnMask |= WindowStateMask::X |
+ WindowStateMask::Y |
+ WindowStateMask::Width |
+ WindowStateMask::Height;
return true;
}
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index ec96b078fc3b..51d40c9be852 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1654,13 +1654,13 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
if( ! m_pWindow || ! pState || isChild( true, false ) )
return;
- const sal_uLong nMaxGeometryMask =
- WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT |
- WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y |
- WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
+ const WindowStateMask nMaxGeometryMask =
+ WindowStateMask::X | WindowStateMask::Y |
+ WindowStateMask::Width | WindowStateMask::Height |
+ WindowStateMask::MaximizedX | WindowStateMask::MaximizedY |
+ WindowStateMask::MaximizedWidth | WindowStateMask::MaximizedHeight;
- if( (pState->mnMask & WINDOWSTATE_MASK_STATE) &&
+ if( (pState->mnMask & WindowStateMask::State) &&
! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) &&
(pState->mnState & WINDOWSTATE_STATE_MAXIMIZED) &&
(pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask )
@@ -1675,27 +1675,27 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
m_aRestorePosSize = Rectangle( Point( pState->mnX, pState->mnY ),
Size( pState->mnWidth, pState->mnHeight ) );
}
- else if( pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ) )
+ else if( pState->mnMask & (WindowStateMask::X | WindowStateMask::Y |
+ WindowStateMask::Width | WindowStateMask::Height ) )
{
sal_uInt16 nPosSizeFlags = 0;
long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0);
long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0);
- if( pState->mnMask & WINDOWSTATE_MASK_X )
+ if( pState->mnMask & WindowStateMask::X )
nPosSizeFlags |= SAL_FRAME_POSSIZE_X;
else
nX = maGeometry.nX - (m_pParent ? m_pParent->maGeometry.nX : 0);
- if( pState->mnMask & WINDOWSTATE_MASK_Y )
+ if( pState->mnMask & WindowStateMask::Y )
nPosSizeFlags |= SAL_FRAME_POSSIZE_Y;
else
nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0);
- if( pState->mnMask & WINDOWSTATE_MASK_WIDTH )
+ if( pState->mnMask & WindowStateMask::Width )
nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH;
- if( pState->mnMask & WINDOWSTATE_MASK_HEIGHT )
+ if( pState->mnMask & WindowStateMask::Height )
nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT;
SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags );
}
- if( pState->mnMask & WINDOWSTATE_MASK_STATE && ! isChild() )
+ if( pState->mnMask & WindowStateMask::State && ! isChild() )
{
if( pState->mnState & WINDOWSTATE_STATE_MAXIMIZED )
gtk_window_maximize( GTK_WINDOW(m_pWindow) );
@@ -1743,7 +1743,7 @@ namespace
bool GtkSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = WINDOWSTATE_STATE_NORMAL;
- pState->mnMask = WINDOWSTATE_MASK_STATE;
+ pState->mnMask = WindowStateMask::State;
// rollup ? gtk 2.2 does not seem to support the shaded state
if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) )
pState->mnState |= WINDOWSTATE_STATE_MINIMIZED;
@@ -1756,20 +1756,20 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState )
pState->mnHeight = m_aRestorePosSize.GetHeight();
GetPosAndSize(GTK_WINDOW(m_pWindow), pState->mnMaximizedX, pState->mnMaximizedY,
pState->mnMaximizedWidth, pState->mnMaximizedHeight);
- pState->mnMask |= WINDOWSTATE_MASK_MAXIMIZED_X |
- WINDOWSTATE_MASK_MAXIMIZED_Y |
- WINDOWSTATE_MASK_MAXIMIZED_WIDTH |
- WINDOWSTATE_MASK_MAXIMIZED_HEIGHT;
+ pState->mnMask |= WindowStateMask::MaximizedX |
+ WindowStateMask::MaximizedY |
+ WindowStateMask::MaximizedWidth |
+ WindowStateMask::MaximizedHeight;
}
else
{
GetPosAndSize(GTK_WINDOW(m_pWindow), pState->mnX, pState->mnY,
pState->mnWidth, pState->mnHeight);
}
- pState->mnMask |= WINDOWSTATE_MASK_X |
- WINDOWSTATE_MASK_Y |
- WINDOWSTATE_MASK_WIDTH |
- WINDOWSTATE_MASK_HEIGHT;
+ pState->mnMask |= WindowStateMask::X |
+ WindowStateMask::Y |
+ WindowStateMask::Width |
+ WindowStateMask::Height;
return true;
}
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 851c2a131406..3fd2be1e5704 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1655,23 +1655,23 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
long nRightDeco = abs( aWinRect.right - aRect2.right );
// adjust window position/size to fit the screen
- if ( !(pState->mnMask & (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y)) )
+ if ( !(pState->mnMask & (WindowStateMask::X | WindowStateMask::Y)) )
nPosSize |= SWP_NOMOVE;
- if ( !(pState->mnMask & (WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT)) )
+ if ( !(pState->mnMask & (WindowStateMask::Width | WindowStateMask::Height)) )
nPosSize |= SWP_NOSIZE;
- if ( pState->mnMask & WINDOWSTATE_MASK_X )
+ if ( pState->mnMask & WindowStateMask::X )
nX = (int)pState->mnX - nLeftDeco;
else
nX = aWinRect.left;
- if ( pState->mnMask & WINDOWSTATE_MASK_Y )
+ if ( pState->mnMask & WindowStateMask::Y )
nY = (int)pState->mnY - nTopDeco;
else
nY = aWinRect.top;
- if ( pState->mnMask & WINDOWSTATE_MASK_WIDTH )
+ if ( pState->mnMask & WindowStateMask::Width )
nWidth = (int)pState->mnWidth + nLeftDeco + nRightDeco;
else
nWidth = aWinRect.right-aWinRect.left;
- if ( pState->mnMask & WINDOWSTATE_MASK_HEIGHT )
+ if ( pState->mnMask & WindowStateMask::Height )
nHeight = (int)pState->mnHeight + nTopDeco + nBottomDeco;
else
nHeight = aWinRect.bottom-aWinRect.top;
@@ -1706,7 +1706,7 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
if ( mbOverwriteState )
{
- if ( pState->mnMask & WINDOWSTATE_MASK_STATE )
+ if ( pState->mnMask & WindowStateMask::State )
{
if ( pState->mnState & WINDOWSTATE_STATE_MINIMIZED )
mnShowState = SW_SHOWMINIMIZED;
@@ -1722,7 +1722,7 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
}
else
{
- if ( pState->mnMask & WINDOWSTATE_MASK_STATE )
+ if ( pState->mnMask & WindowStateMask::State )
{
if ( pState->mnState & WINDOWSTATE_STATE_MINIMIZED )
{