#103360# mirror geometry on demand
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: salgdilayout.cxx,v $
|
||||
*
|
||||
* $Revision: 1.10 $
|
||||
* $Revision: 1.11 $
|
||||
*
|
||||
* last change: $Author: ssa $ $Date: 2002-09-09 16:30:12 $
|
||||
* last change: $Author: pl $ $Date: 2002-09-18 16:28:28 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -155,6 +155,26 @@
|
||||
|
||||
#define IS_NOTRTL_ENABLED() ( pOutDev && !pOutDev->IsRTLEnabled() )
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// The only common SalFrame method
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
SalFrameGeometry SalFrame::GetGeometry()
|
||||
{
|
||||
// mirror frame coordinates at parent
|
||||
SalFrame *pParent = GetParent();
|
||||
if( pParent && Application::GetSettings().GetLayoutRTL() )
|
||||
{
|
||||
SalFrameGeometry aGeom = maGeometry;
|
||||
int parent_x = aGeom.nX - pParent->maGeometry.nX;
|
||||
aGeom.nX = pParent->maGeometry.nX + pParent->maGeometry.nWidth - maGeometry.nWidth - parent_x;
|
||||
return aGeom;
|
||||
}
|
||||
else
|
||||
return maGeometry;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
SalGraphicsLayout::SalGraphicsLayout() : SalGraphics()
|
||||
|
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: i18n_status.cxx,v $
|
||||
*
|
||||
* $Revision: 1.16 $
|
||||
* $Revision: 1.17 $
|
||||
*
|
||||
* last change: $Author: hr $ $Date: 2002-08-27 13:14:05 $
|
||||
* last change: $Author: pl $ $Date: 2002-09-18 16:28:35 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -336,7 +336,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent ) :
|
||||
const SystemEnvData* pEnvData = GetSystemData();
|
||||
const SystemEnvData* pParentEnvData = pParent->GetSystemData();
|
||||
|
||||
const SalFrameGeometry& rGeom( pParent->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pParent->GetUnmirroredGeometry() );
|
||||
int nDistance = rGeom.nTopDecoration;
|
||||
if( nDistance < 20 )
|
||||
nDistance = 20;
|
||||
|
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: wmadaptor.cxx,v $
|
||||
*
|
||||
* $Revision: 1.36 $
|
||||
* $Revision: 1.37 $
|
||||
*
|
||||
* last change: $Author: pl $ $Date: 2002-07-30 07:35:51 $
|
||||
* last change: $Author: pl $ $Date: 2002-09-18 16:28:36 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -1088,7 +1088,7 @@ void NetWMAdaptor::setNetWMState( SalFrame* pFrame ) const
|
||||
}
|
||||
}
|
||||
Rectangle aPosSize = m_aWMWorkAreas[nCurrent];
|
||||
const SalFrameGeometry& rGeom( pFrame->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pFrame->GetUnmirroredGeometry() );
|
||||
aPosSize = Rectangle( Point( aPosSize.Left() + rGeom.nLeftDecoration,
|
||||
aPosSize.Top() + rGeom.nTopDecoration ),
|
||||
Size( aPosSize.GetWidth()
|
||||
@@ -1197,7 +1197,7 @@ void GnomeWMAdaptor::setGnomeWMState( SalFrame* pFrame ) const
|
||||
}
|
||||
}
|
||||
Rectangle aPosSize = m_aWMWorkAreas[nCurrent];
|
||||
const SalFrameGeometry& rGeom( pFrame->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pFrame->GetUnmirroredGeometry() );
|
||||
aPosSize = Rectangle( Point( aPosSize.Left() + rGeom.nLeftDecoration,
|
||||
aPosSize.Top() + rGeom.nTopDecoration ),
|
||||
Size( aPosSize.GetWidth()
|
||||
@@ -1360,7 +1360,7 @@ void WMAdaptor::maximizeFrame( SalFrame* pFrame, bool bHorizontal, bool bVertica
|
||||
pFrame->maFrameData.mbMaximizedVert = bVertical;
|
||||
pFrame->maFrameData.mbMaximizedHorz = bHorizontal;
|
||||
|
||||
const SalFrameGeometry& rGeom( pFrame->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pFrame->GetUnmirroredGeometry() );
|
||||
|
||||
// discard pending configure notifies for this frame
|
||||
XSync( m_pDisplay, False );
|
||||
@@ -1522,7 +1522,7 @@ void NetWMAdaptor::maximizeFrame( SalFrame* pFrame, bool bHorizontal, bool bVert
|
||||
pFrame->maFrameData.aRestoreFullScreen_ = Rectangle();
|
||||
else if( pFrame->maFrameData.aRestoreFullScreen_.IsEmpty() )
|
||||
{
|
||||
const SalFrameGeometry& rGeom( pFrame->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pFrame->GetUnmirroredGeometry() );
|
||||
pFrame->maFrameData.aRestoreFullScreen_ =
|
||||
Rectangle( Point( rGeom.nX, rGeom.nY ), Size( rGeom.nWidth, rGeom.nHeight ) );
|
||||
}
|
||||
@@ -1577,7 +1577,7 @@ void GnomeWMAdaptor::maximizeFrame( SalFrame* pFrame, bool bHorizontal, bool bVe
|
||||
pFrame->maFrameData.aRestoreFullScreen_ = Rectangle();
|
||||
else if( pFrame->maFrameData.aRestoreFullScreen_.IsEmpty() )
|
||||
{
|
||||
const SalFrameGeometry& rGeom( pFrame->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pFrame->GetUnmirroredGeometry() );
|
||||
pFrame->maFrameData.aRestoreFullScreen_ =
|
||||
Rectangle( Point( rGeom.nX, rGeom.nY ), Size( rGeom.nWidth, rGeom.nHeight ) );
|
||||
}
|
||||
|
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: salframe.cxx,v $
|
||||
*
|
||||
* $Revision: 1.142 $
|
||||
* $Revision: 1.143 $
|
||||
*
|
||||
* last change: $Author: hr $ $Date: 2002-08-27 17:55:03 $
|
||||
* last change: $Author: pl $ $Date: 2002-09-18 16:28:31 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -449,8 +449,8 @@ void SalFrameData::Init( ULONG nSalFrameStyle, SystemParentData* pParentData )
|
||||
( pFrame->maFrameData.mpParent
|
||||
|| pFrame->maFrameData.IsOverrideRedirect()
|
||||
|| ! ( pFrame->maFrameData.nStyle_ & SAL_FRAME_STYLE_SIZEABLE )
|
||||
|| ! pFrame->GetGeometry().nWidth
|
||||
|| ! pFrame->GetGeometry().nHeight
|
||||
|| ! pFrame->GetUnmirroredGeometry().nWidth
|
||||
|| ! pFrame->GetUnmirroredGeometry().nHeight
|
||||
)
|
||||
)
|
||||
pFrame = pFrame->maFrameData.pNextFrame_;
|
||||
@@ -458,7 +458,7 @@ void SalFrameData::Init( ULONG nSalFrameStyle, SystemParentData* pParentData )
|
||||
{
|
||||
// set a document position and size
|
||||
// the first frame gets positioned by the window manager
|
||||
const SalFrameGeometry& rGeom( pFrame->GetGeometry() );
|
||||
const SalFrameGeometry& rGeom( pFrame->GetUnmirroredGeometry() );
|
||||
x = rGeom.nX;
|
||||
y = rGeom.nY;
|
||||
w = rGeom.nWidth;
|
||||
@@ -1586,7 +1586,7 @@ void SalFrameData::SetPosSize( const Rectangle &rPosSize )
|
||||
if( mpParent )
|
||||
{
|
||||
// --- RTL --- (mirror window pos)
|
||||
if( pGraphics_ && (pGraphics_->GetLayout() & SAL_LAYOUT_BIDI_RTL) )
|
||||
if( Application::GetSettings().GetLayoutRTL() )
|
||||
values.x = mpParent->maGeometry.nWidth-values.width-1-values.x;
|
||||
|
||||
XLIB_Window aChild;
|
||||
@@ -2045,6 +2045,12 @@ void SalFrame::SetParent( SalFrame* pNewParent )
|
||||
}
|
||||
}
|
||||
|
||||
SalFrame* SalFrame::GetParent() const
|
||||
{
|
||||
return maFrameData.mpParent;
|
||||
}
|
||||
|
||||
|
||||
// Sound
|
||||
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
void SalFrame::Beep( SoundType eSoundType ) // not fully suported
|
||||
@@ -2276,7 +2282,7 @@ long SalFrameData::HandleMouseEvent( XEvent *pEvent )
|
||||
nEvent = SALEVENT_WHEELMOUSE;
|
||||
|
||||
// --- RTL --- (mirror mouse pos)
|
||||
if( pGraphics_ && (pGraphics_->GetLayout() & SAL_LAYOUT_BIDI_RTL) )
|
||||
if( Application::GetSettings().GetLayoutRTL() )
|
||||
aWheelEvt.mnX = nWidth_-1-aWheelEvt.mnX;
|
||||
return Call( nEvent, &aWheelEvt );
|
||||
}
|
||||
@@ -2289,7 +2295,7 @@ long SalFrameData::HandleMouseEvent( XEvent *pEvent )
|
||||
)
|
||||
{
|
||||
// --- RTL --- (mirror mouse pos)
|
||||
if( pGraphics_ && (pGraphics_->GetLayout() & SAL_LAYOUT_BIDI_RTL) )
|
||||
if( Application::GetSettings().GetLayoutRTL() )
|
||||
aMouseEvt.mnX = nWidth_-1-aMouseEvt.mnX;
|
||||
return Call( nEvent, &aMouseEvt );
|
||||
}
|
||||
@@ -2684,7 +2690,7 @@ long SalFrameData::HandleExposeEvent( XEvent *pEvent )
|
||||
aPEvt.mnBoundHeight = maPaintRegion.GetHeight();
|
||||
|
||||
// --- RTL --- (mirror paint rect)
|
||||
if( pGraphics_ && (pGraphics_->GetLayout() & SAL_LAYOUT_BIDI_RTL) )
|
||||
if( Application::GetSettings().GetLayoutRTL() )
|
||||
aPEvt.mnBoundX = nWidth_-aPEvt.mnBoundWidth-aPEvt.mnBoundX;
|
||||
|
||||
Call( SALEVENT_PAINT, &aPEvt );
|
||||
@@ -2880,6 +2886,9 @@ IMPL_LINK( SalFrameData, HandleResizeTimer, void*, pDummy )
|
||||
aPEvt.mnBoundWidth = maPaintRegion.GetWidth();
|
||||
aPEvt.mnBoundHeight = maPaintRegion.GetHeight();
|
||||
|
||||
if( Application::GetSettings().GetLayoutRTL() )
|
||||
aPEvt.mnBoundX = nWidth_-aPEvt.mnBoundWidth-aPEvt.mnBoundX;
|
||||
|
||||
Call( SALEVENT_PAINT, &aPEvt );
|
||||
maPaintRegion = Rectangle();
|
||||
|
||||
|
Reference in New Issue
Block a user