diff options
author | oisin <oisin@openoffice.org> | 2001-01-23 16:33:29 +0000 |
---|---|---|
committer | oisin <oisin@openoffice.org> | 2001-01-23 16:33:29 +0000 |
commit | e3422e66da29da29c60a704770317c5d016a9086 (patch) | |
tree | 13128b46ac1a0c288d269e6b1f8a65e6abd23d50 | |
parent | 66f73e00ceeff42551e70ae6f43f8a26a4def977 (diff) |
Reverted to revision 1.2
-rw-r--r-- | vcl/unx/source/app/salinst.cxx | 24 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salbmp.cxx | 129 |
2 files changed, 19 insertions, 134 deletions
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 4325ff7f0fdf..e845aabe8211 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salinst.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oisin $ $Date: 2001-01-19 14:42:53 $ + * last change: $Author: oisin $ $Date: 2001-01-23 17:30:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,15 +92,13 @@ #ifndef _SV_DTINT_HXX #include <dtint.hxx> #endif -#if !defined(_USE_PRINT_EXTENSION_) - #ifndef _SV_SALPRN_H - #include <salprn.h> - #endif +#ifndef _SV_SALPRN_H +#include <salprn.h> +#endif +#ifndef USE_PSPRINT +#ifndef _VCL_SALCONFIG_HXX +#include <salconfig.hxx> #endif -#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) - #ifndef _VCL_SALCONFIG_HXX - #include <salconfig.hxx> - #endif #endif // -=-= C++ globals =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -188,7 +186,7 @@ final SalInstance *CreateSalInstance() // init instance (only one instance in this version !!!) pSalData->pFirstInstance_ = pInst; -#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) +#ifndef USE_PSPRINT StartPrinterListening(); #endif @@ -202,11 +200,11 @@ final void DestroySalInstance( SalInstance *pInst ) // reset instance (only one instance in this version !!!) if( pSalData->pFirstInstance_ == pInst ) { -#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) +#ifndef USE_PSPRINT StopPrinterListening(); #endif pSalData->pFirstInstance_ = NULL; -#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) +#ifndef USE_PSPRINT ::vcl_sal::XpDefaults::release(); #endif } diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index b345d5937a6c..cdfdfa0c5dba 100644 --- a/vcl/unx/source/gdi/salbmp.cxx +++ b/vcl/unx/source/gdi/salbmp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salbmp.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oisin $ $Date: 2001-01-19 14:50:43 $ + * last change: $Author: oisin $ $Date: 2001-01-23 17:33:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,9 +66,6 @@ #include <string.h> #include <stdio.h> #include <errno.h> -#ifdef FREEBSD -#include <sys/types.h> -#endif #include <sys/shm.h> #include <prex.h> #include <postx.h> @@ -462,19 +459,8 @@ XImage* SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, long nDepth, const Sa } // ----------------------------------------------------------------------------- -#ifdef _USE_PRINT_EXTENSION_ -BOOL SalBitmap::ImplCreateFromDrawable( SalDisplay* pDisplay, Drawable aDrawable, long nDrawableDepth, - long nX, long nY, long nWidth, long nHeight ) -{ - Destroy(); - - if( aDrawable && nWidth && nHeight && nDrawableDepth ) - mpDDB = new ImplSalDDB( pDisplay, aDrawable, nDrawableDepth, nX, nY, nWidth, nHeight ); - return( mpDDB != NULL ); -} -#else -BOOL SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, long nDrawableDepth, +BOOL SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) { Destroy(); @@ -484,64 +470,9 @@ BOOL SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, long nDrawableDepth return( mpDDB != NULL ); } -// ----------------------------------------------------------------------------- -#endif - -#ifdef _USE_PRINT_EXTENSION_ -void SalBitmap::ImplDraw( SalDisplay *pDisplay, Drawable aDrawable, long nDrawableDepth, - const SalTwoRect& rTwoRect, const GC& rGC ) const -{ - if( !mpDDB || !mpDDB->ImplMatches( nDrawableDepth, rTwoRect ) ) - { - if( mpDDB ) - { - // do we already have a DIB? if not, create aDIB from current DDB first - if( !mpDIB ) - { - ( (SalBitmap*) this )->mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(), - mpDDB->ImplGetDepth(), - 0, 0, - mpDDB->ImplGetWidth(), - mpDDB->ImplGetHeight() ); - } - - delete mpDDB, ( (SalBitmap*) this )->mpDDB = NULL; - } - if( mpCache ) - mpCache->ImplRemove( const_cast<SalBitmap*>(this) ); - - SalTwoRect aTwoRect( rTwoRect ); - - // create new DDB from DIB - if( aTwoRect.mnSrcWidth == aTwoRect.mnDestWidth && - aTwoRect.mnSrcHeight == aTwoRect.mnDestHeight ) - { - const Size aSize( GetSize() ); - - aTwoRect.mnSrcX = aTwoRect.mnSrcY = aTwoRect.mnDestX = aTwoRect.mnDestY = 0; - aTwoRect.mnSrcWidth = aTwoRect.mnDestWidth = aSize.Width(); - aTwoRect.mnSrcHeight = aTwoRect.mnDestHeight = aSize.Height(); - } - - XImage* pImage = ImplCreateXImage( pDisplay, - nDrawableDepth, aTwoRect ); - - if( pImage ) - { - ( (SalBitmap*) this )->mpDDB = new ImplSalDDB( pDisplay, pImage, aDrawable, aTwoRect ); - delete[] pImage->data, pImage->data = NULL; - XDestroyImage( pImage ); - - if( mpCache ) - mpCache->ImplAdd( const_cast<SalBitmap*>(this), mpDDB->ImplGetMemSize() ); - } - } +// ----------------------------------------------------------------------------- - if( mpDDB ) - mpDDB->ImplDraw( pDisplay, aDrawable, nDrawableDepth, rTwoRect, rGC ); -} -#else void SalBitmap::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const { @@ -595,7 +526,6 @@ void SalBitmap::ImplDraw( Drawable aDrawable, long nDrawableDepth, if( mpDDB ) mpDDB->ImplDraw( aDrawable, nDrawableDepth, rTwoRect, rGC ); } -#endif // ----------------------------------------------------------------------------- @@ -624,10 +554,8 @@ BOOL SalBitmap::Create( const SalBitmap& rSalBmp ) } else if( rSalBmp.mpDDB ) { -#ifndef _USE_PRINT_EXTENSION_ ImplCreateFromDrawable( rSalBmp.mpDDB->ImplGetPixmap(), rSalBmp.mpDDB->ImplGetDepth(), 0, 0, rSalBmp.mpDDB->ImplGetWidth(), rSalBmp.mpDDB->ImplGetHeight() ); -#endif } return( ( !rSalBmp.mpDIB && !rSalBmp.mpDDB ) || @@ -739,22 +667,13 @@ void SalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly ) // - ImplSalDDB - // -------------- -ImplSalDDB::ImplSalDDB( -#ifdef _USE_PRINT_EXTENSION_ - SalDisplay* pDisplay, -#endif - XImage* pImage, Drawable aDrawable, const SalTwoRect& rTwoRect ) : +ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, const SalTwoRect& rTwoRect ) : maPixmap ( 0 ), maTwoRect ( rTwoRect ), mnDepth ( pImage->depth ) { -#if !defined(_USE_PRINT_EXTENSION_) SalDisplay* pSalDisp = GetSalData()->GetCurDisp(); Display* pXDisp = pSalDisp->GetDisplay(); -#else - Display* pXDisp = pDisplay->GetDisplay(); -#endif - if( maPixmap = XCreatePixmap( pXDisp, aDrawable, ImplGetWidth(), ImplGetHeight(), ImplGetDepth() ) ) { @@ -778,19 +697,11 @@ ImplSalDDB::ImplSalDDB( // ----------------------------------------------------------------------------- -ImplSalDDB::ImplSalDDB( -#ifdef _USE_PRINT_EXTENSION_ - SalDisplay* pDisplay, -#endif - Drawable aDrawable, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) : +ImplSalDDB::ImplSalDDB( Drawable aDrawable, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) : mnDepth( nDrawableDepth ) { -#if !defined(_USE_PRINT_EXTENSION_) SalDisplay* pSalDisp = GetSalData()->GetCurDisp(); Display* pXDisp = pSalDisp->GetDisplay(); -#else - Display* pXDisp = pDisplay->GetDisplay(); -#endif if( maPixmap = XCreatePixmap( pXDisp, aDrawable, nWidth, nHeight, nDrawableDepth ) ) { @@ -807,13 +718,8 @@ ImplSalDDB::ImplSalDDB( } aGC = XCreateGC( pXDisp, maPixmap, nValues, &aValues ); -#ifdef _USE_PRINT_EXTENSION_ - ImplDraw( pDisplay, aDrawable, nDrawableDepth, maPixmap, mnDepth, - nX, nY, nWidth, nHeight, 0, 0, aGC ); -#else ImplDraw( aDrawable, nDrawableDepth, maPixmap, mnDepth, nX, nY, nWidth, nHeight, 0, 0, aGC ); -#endif XFreeGC( pXDisp, aGC ); maTwoRect.mnSrcX = maTwoRect.mnSrcY = maTwoRect.mnDestX = maTwoRect.mnDestY = 0; @@ -860,43 +766,24 @@ BOOL ImplSalDDB::ImplMatches( long nDepth, const SalTwoRect& rTwoRect ) const // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( -#ifdef _USE_PRINT_EXTENSION_ - SalDisplay* pDisplay, -#endif - Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const +void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const { -#ifdef _USE_PRINT_EXTENSION_ - ImplDraw( pDisplay, maPixmap, mnDepth, aDrawable, nDrawableDepth, - rTwoRect.mnSrcX - maTwoRect.mnSrcX, rTwoRect.mnSrcY - maTwoRect.mnSrcY, - rTwoRect.mnDestWidth, rTwoRect.mnDestHeight, - rTwoRect.mnDestX, rTwoRect.mnDestY, rGC ); -#else ImplDraw( maPixmap, mnDepth, aDrawable, nDrawableDepth, rTwoRect.mnSrcX - maTwoRect.mnSrcX, rTwoRect.mnSrcY - maTwoRect.mnSrcY, rTwoRect.mnDestWidth, rTwoRect.mnDestHeight, rTwoRect.mnDestX, rTwoRect.mnDestY, rGC ); -#endif } // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( -#ifdef _USE_PRINT_EXTENSION_ - SalDisplay* pDisplay, -#endif - Drawable aSrcDrawable, long nSrcDrawableDepth, +void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, Drawable aDstDrawable, long nDstDrawableDepth, long nSrcX, long nSrcY, long nDestWidth, long nDestHeight, long nDestX, long nDestY, const GC& rGC ) { -#if !defined(_USE_PRINT_EXTENSION_) SalDisplay* pSalDisp = GetSalData()->GetCurDisp(); Display* pXDisp = pSalDisp->GetDisplay(); -#else - Display* pXDisp = pDisplay->GetDisplay(); -#endif if( 1 == nSrcDrawableDepth ) { |