2002-07-11 06:31:51 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: salgdilayout.cxx,v $
|
|
|
|
*
|
2002-09-04 16:23:27 +00:00
|
|
|
* $Revision: 1.7 $
|
2002-07-11 06:31:51 +00:00
|
|
|
*
|
2002-09-04 16:23:27 +00:00
|
|
|
* last change: $Author: hdu $ $Date: 2002-09-04 17:23:27 $
|
2002-07-11 06:31:51 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#define _SV_OUTDEV_CXX
|
|
|
|
#include <tools/ref.hxx>
|
|
|
|
#ifndef REMOTE_APPSERVER
|
|
|
|
#ifndef _SV_SVSYS_HXX
|
|
|
|
#include <svsys.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef REMOTE_APPSERVER
|
|
|
|
#ifndef _SV_SALGDI_HXX
|
|
|
|
#include <salgdi.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SALFRAME_HXX
|
|
|
|
#include <salframe.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SALVD_HXX
|
|
|
|
#include <salvd.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SALPRN_HXX
|
|
|
|
#include <salprn.hxx>
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifndef _SV_RMOUTDEV_HXX
|
|
|
|
#include <rmoutdev.hxx>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _DEBUG_HXX
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SVDATA_HXX
|
|
|
|
#include <svdata.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SVAPP_HXX
|
|
|
|
#include <svapp.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_POLY_H
|
|
|
|
#include <poly.h>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_POLY_HXX
|
|
|
|
#include <poly.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_REGION_HXX
|
|
|
|
#include <region.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_REGION_H
|
|
|
|
#include <region.h>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_VIRDEV_HXX
|
|
|
|
#include <virdev.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_WINDOW_H
|
|
|
|
#include <window.h>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_WINDOW_HXX
|
|
|
|
#include <window.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_METAACT_HXX
|
|
|
|
#include <metaact.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_GDIMTF_HXX
|
|
|
|
#include <gdimtf.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_OUTDATA_HXX
|
|
|
|
#include <outdata.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_PRINT_HXX
|
|
|
|
#include <print.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SALOTYPE_HXX
|
|
|
|
#include <salotype.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_OPENGL_HXX
|
|
|
|
#include <opengl.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _VCL_IMPLNCVT_HXX
|
|
|
|
#include <implncvt.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_OUTDEV3D_HXX
|
|
|
|
#include <outdev3d.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_OUTDEV_H
|
|
|
|
#include <outdev.h>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_OUTDEV_HXX
|
|
|
|
#include <outdev.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _VCL_UNOWRAP_HXX
|
|
|
|
#include <unowrap.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SALLAYOUT_HXX
|
|
|
|
#include <sallayout.hxx>
|
|
|
|
#endif
|
|
|
|
|
2002-08-29 14:42:38 +00:00
|
|
|
#define IS_RTL_ENABLED() ( pOutDev && pOutDev->IsRTLEnabled() )
|
2002-07-11 06:31:51 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
SalGraphicsLayout::SalGraphicsLayout() : SalGraphics()
|
|
|
|
{
|
2002-08-22 06:54:42 +00:00
|
|
|
// read global RTL settings
|
|
|
|
if( Application::GetSettings().GetStyleSettings().GetLayoutRTL() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mnLayout = SAL_LAYOUT_BIDI_RTL;
|
|
|
|
else
|
|
|
|
mnLayout = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SalGraphicsLayout::~SalGraphicsLayout()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SalGraphicsLayout::mirror( long& x )
|
|
|
|
{
|
|
|
|
long w = GetGraphicsWidth();
|
|
|
|
if( w )
|
|
|
|
x = w-1-x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SalGraphicsLayout::mirror( long& x, long& nWidth )
|
|
|
|
{
|
|
|
|
long w = GetGraphicsWidth();
|
|
|
|
if( w )
|
|
|
|
x = w-nWidth-x;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL SalGraphicsLayout::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2 )
|
|
|
|
{
|
|
|
|
long w = GetGraphicsWidth();
|
|
|
|
if( w )
|
|
|
|
{
|
|
|
|
sal_uInt32 i, j;
|
|
|
|
for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
|
|
|
|
{
|
|
|
|
pPtAry2[j].mnX = w-1-pPtAry[i].mnX;
|
|
|
|
pPtAry2[j].mnY = pPtAry[i].mnY;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2002-08-29 14:42:38 +00:00
|
|
|
BOOL SalGraphicsLayout::UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX, nWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::UnionClipRegion( nX, nY, nWidth, nHeight, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPixel( nX, nY, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPixel( nX, nY, nSalColor, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
mirror( nX1 );
|
|
|
|
mirror( nX2 );
|
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawLine( nX1, nY1, nX2, nY2, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX, nWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawRect( nX, nY, nWidth, nHeight, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalPoint* pPtAry2 = new SalPoint[nPoints];
|
|
|
|
BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2 );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPolyLine( nPoints, bCopied ? pPtAry2 : pPtAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
delete [] pPtAry2;
|
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPolyLine( nPoints, pPtAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalPoint* pPtAry2 = new SalPoint[nPoints];
|
|
|
|
BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2 );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPolygon( nPoints, bCopied ? pPtAry2 : pPtAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
delete [] pPtAry2;
|
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPolygon( nPoints, pPtAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::DrawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-24 14:26:32 +00:00
|
|
|
{
|
|
|
|
// TODO: optimize, reduce new/delete calls
|
|
|
|
SalPoint **pPtAry2 = new SalPoint*[nPoly];
|
|
|
|
ULONG i;
|
|
|
|
for(i=0; i<nPoly; i++)
|
|
|
|
{
|
|
|
|
ULONG nPoints = pPoints[i];
|
|
|
|
pPtAry2[i] = new SalPoint[ nPoints ];
|
|
|
|
BOOL bCopied = mirror( nPoints, pPtAry[i], pPtAry2[i] );
|
|
|
|
}
|
|
|
|
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPolyPolygon( nPoly, pPoints, (PCONSTSALPOINT*)pPtAry2, NULL );
|
2002-07-24 14:26:32 +00:00
|
|
|
|
|
|
|
for(i=0; i<nPoly; i++)
|
|
|
|
delete [] pPtAry2[i];
|
|
|
|
delete [] pPtAry2;
|
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawPolyPolygon( nPoly, pPoints, pPtAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
sal_Bool SalGraphicsLayout::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( !(mnLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolyLineBezier - no mirroring implemented");
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
sal_Bool SalGraphicsLayout::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( !(mnLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolygonBezier - no mirroring implemented");
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::DrawPolygonBezier( nPoints, pPtAry, pFlgAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
sal_Bool SalGraphicsLayout::DrawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints,
|
2002-08-29 14:42:38 +00:00
|
|
|
const SalPoint* const* pPtAry, const BYTE* const* pFlgAry, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( !(mnLayout & SAL_LAYOUT_BIDI_RTL), "DrawPolyPolygonBezier - no mirroring implemented");
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::DrawPolyPolygonBezier( nPoly, pPoints, pPtAry, pFlgAry, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
void SalGraphicsLayout::CopyArea( long nDestX, long nDestY,
|
|
|
|
long nSrcX, long nSrcY,
|
|
|
|
long nSrcWidth, long nSrcHeight,
|
2002-08-29 14:42:38 +00:00
|
|
|
USHORT nFlags, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
mirror( nDestX, nSrcWidth );
|
|
|
|
mirror( nSrcX, nSrcWidth );
|
|
|
|
}
|
|
|
|
SalGraphics::CopyArea( nDestX, nDestY,
|
|
|
|
nSrcX, nSrcY,
|
|
|
|
nSrcWidth, nSrcHeight,
|
2002-08-29 14:42:38 +00:00
|
|
|
nFlags, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
void SalGraphicsLayout::CopyBits( const SalTwoRect* pPosAry,
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( ( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() ) ||
|
|
|
|
(pSrcGraphics && (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) && pSrcOutDev->IsRTLEnabled() ) )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalTwoRect pPosAry2 = *pPosAry;
|
2002-08-29 14:42:38 +00:00
|
|
|
if( pSrcGraphics && (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) && pSrcOutDev->IsRTLEnabled() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::CopyBits( &pPosAry2, pSrcGraphics, NULL, NULL );
|
2002-07-24 14:26:32 +00:00
|
|
|
// mirror back
|
2002-08-29 14:42:38 +00:00
|
|
|
if( pSrcGraphics && (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) && pSrcOutDev->IsRTLEnabled() )
|
2002-07-24 14:26:32 +00:00
|
|
|
mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-24 14:26:32 +00:00
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::CopyBits( pPosAry, pSrcGraphics, NULL, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
void SalGraphicsLayout::DrawBitmap( const SalTwoRect* pPosAry,
|
2002-08-29 14:42:38 +00:00
|
|
|
const SalBitmap& rSalBitmap, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalTwoRect pPosAry2 = *pPosAry;
|
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawBitmap( &pPosAry2, rSalBitmap, NULL );
|
2002-07-24 14:26:32 +00:00
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawBitmap( pPosAry, rSalBitmap, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
void SalGraphicsLayout::DrawBitmap( const SalTwoRect* pPosAry,
|
|
|
|
const SalBitmap& rSalBitmap,
|
2002-08-29 14:42:38 +00:00
|
|
|
SalColor nTransparentColor, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalTwoRect pPosAry2 = *pPosAry;
|
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawBitmap( &pPosAry2, rSalBitmap, nTransparentColor, NULL );
|
2002-07-24 14:26:32 +00:00
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawBitmap( pPosAry, rSalBitmap, nTransparentColor, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
void SalGraphicsLayout::DrawBitmap( const SalTwoRect* pPosAry,
|
|
|
|
const SalBitmap& rSalBitmap,
|
2002-08-29 14:42:38 +00:00
|
|
|
const SalBitmap& rTransparentBitmap, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalTwoRect pPosAry2 = *pPosAry;
|
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawBitmap( &pPosAry2, rSalBitmap, rTransparentBitmap, NULL );
|
2002-07-24 14:26:32 +00:00
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawBitmap( pPosAry, rSalBitmap, rTransparentBitmap, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
void SalGraphicsLayout::DrawMask( const SalTwoRect* pPosAry,
|
|
|
|
const SalBitmap& rSalBitmap,
|
2002-08-29 14:42:38 +00:00
|
|
|
SalColor nMaskColor, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalTwoRect pPosAry2 = *pPosAry;
|
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawMask( &pPosAry2, rSalBitmap, nMaskColor, NULL );
|
2002-07-24 14:26:32 +00:00
|
|
|
mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::DrawMask( pPosAry, rSalBitmap, nMaskColor, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
SalBitmap* SalGraphicsLayout::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX, nWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::GetBitmap( nX, nY, nWidth, nHeight, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
SalColor SalGraphicsLayout::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX );
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::GetPixel( nX, nY, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX, nWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::Invert( nX, nY, nWidth, nHeight, nFlags, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
2002-08-29 14:42:38 +00:00
|
|
|
void SalGraphicsLayout::Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
|
|
|
SalPoint* pPtAry2 = new SalPoint[nPoints];
|
|
|
|
BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2 );
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::Invert( nPoints, bCopied ? pPtAry2 : pPtAry, nFlags, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
delete [] pPtAry2;
|
|
|
|
}
|
|
|
|
else
|
2002-08-29 14:42:38 +00:00
|
|
|
SalGraphics::Invert( nPoints, pPtAry, nFlags, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
|
2002-08-29 14:42:38 +00:00
|
|
|
BOOL SalGraphicsLayout::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev )
|
2002-07-11 06:31:51 +00:00
|
|
|
{
|
2002-08-29 14:42:38 +00:00
|
|
|
if( (mnLayout & SAL_LAYOUT_BIDI_RTL) && IS_RTL_ENABLED() )
|
2002-07-11 06:31:51 +00:00
|
|
|
mirror( nX, nWidth );
|
2002-08-29 14:42:38 +00:00
|
|
|
return SalGraphics::DrawEPS( nX, nY, nWidth, nHeight, pPtr, nSize, NULL );
|
2002-07-11 06:31:51 +00:00
|
|
|
}
|
|
|
|
|