diff options
-rw-r--r-- | vcl/unx/inc/i18n_im.hxx | 7 | ||||
-rw-r--r-- | vcl/unx/inc/prex.h | 23 | ||||
-rw-r--r-- | vcl/unx/source/app/saldisp.cxx | 25 | ||||
-rw-r--r-- | vcl/unx/source/app/salinst.cxx | 24 | ||||
-rw-r--r-- | vcl/unx/source/gdi/makefile.mk | 14 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salbmp.cxx | 129 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi2.cxx | 47 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi3.cxx | 29 | ||||
-rw-r--r-- | vcl/util/makefile.mk | 33 | ||||
-rw-r--r-- | vcl/util/target.pmk | 9 |
11 files changed, 286 insertions, 67 deletions
diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx index baf62ea46673..1c84222a4035 100644 --- a/vcl/unx/inc/i18n_im.hxx +++ b/vcl/unx/inc/i18n_im.hxx @@ -2,9 +2,9 @@ * * $RCSfile: i18n_im.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:14:44 $ + * last change: $Author: oisin $ $Date: 2001-01-31 14:59:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,6 +89,9 @@ public: Bool SetLocale( const char* pLocale = "" ); Bool FilterEvent( XEvent *pEvent, XLIB_Window window ); + #ifdef _USE_PRINT_EXTENSION_ + void Invalidate() { mbUseable = False; } + #endif SalI18N_InputMethod(); ~SalI18N_InputMethod(); diff --git a/vcl/unx/inc/prex.h b/vcl/unx/inc/prex.h index 8215a5721307..8c2f3003272f 100644 --- a/vcl/unx/inc/prex.h +++ b/vcl/unx/inc/prex.h @@ -2,9 +2,9 @@ * * $RCSfile: prex.h,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:18:57 $ + * last change: $Author: oisin $ $Date: 2001-01-31 14:59:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,7 +62,7 @@ // // // (C) 1997 Star Division GmbH, Hamburg, Germany // // // -// $Revision: 1.4 $ $Author: oisin $ $Date: 2001-01-23 17:18:57 $ // +// $Revision: 1.5 $ $Author: oisin $ $Date: 2001-01-31 14:59:28 $ // // // // $Workfile: prex.h $ // // $Modtime: 08 Aug 1997 10:13:54 $ // @@ -134,10 +134,19 @@ extern "C" { #define __Ol_OlXlibExt_h__ -#if !defined(USE_PSPRINT) -#include <salpdecl.h> -#include <salpmacr.h> -#endif /* !USE_PSPRINT */ +#if !defined(_USE_PRINT_EXTENSION_) + #include <salpdecl.h> + #include <salpmacr.h> +#else + #include <X11/X.h> + #include <X11/Xlib.h> + #include <X11/Xutil.h> + #include <X11/Intrinsic.h> + + Bool XSalIsDisplay( Display *p_display ); + Bool XSalIsPrinter( Display *p_display ); + Display* GetXpDisplay(); +#endif #endif diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 6f7834fa962e..ed7b5879d18f 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: saldisp.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:21:32 $ + * last change: $Author: oisin $ $Date: 2001-01-31 15:00:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1157,6 +1157,27 @@ final void SalDisplay::Init( Colormap hXColmap, const XVisualInfo* pXVI ) #ifdef DBG_UTIL hRefWindow_ = (XLIB_Window)ILLEGAL_POINTER; #endif +#if defined(_USE_PRINT_EXTENSION_) + + pScreen_ = ScreenOfDisplay( pDisp_, nScreen_ ); + hRootWindow_ = RootWindowOfScreen( pScreen_ ); + pRootVisual_ = pVisual_; + + XSetWindowAttributes aXWAttributes; + aXWAttributes.border_pixel = 0; + aXWAttributes.background_pixel = 0; + aXWAttributes.colormap = hXColmap; + hRefWindow_ = XCreateWindow( pDisp_, + hRootWindow_, + 0, 0, 16, 16, 0, + pVisual_->GetDepth(), + InputOutput, + pVisual_->GetVisual(), + CWBorderPixel|CWBackPixel|CWColormap, + &aXWAttributes ); + +#endif + hInvert50_ = None; bLocal_ = TRUE; /* always true for xprinter */ mbLocalIsValid = TRUE; /* yes bLocal_ is initialized */ diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index e845aabe8211..5e5bd150815b 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.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:30:18 $ + * last change: $Author: oisin $ $Date: 2001-01-31 15:00:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,13 +92,15 @@ #ifndef _SV_DTINT_HXX #include <dtint.hxx> #endif -#ifndef _SV_SALPRN_H -#include <salprn.h> -#endif -#ifndef USE_PSPRINT -#ifndef _VCL_SALCONFIG_HXX -#include <salconfig.hxx> +#if !defined(_USE_PRINT_EXTENSION_) + #ifndef _SV_SALPRN_H + #include <salprn.h> + #endif #endif +#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) + #ifndef _VCL_SALCONFIG_HXX + #include <salconfig.hxx> + #endif #endif // -=-= C++ globals =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -186,7 +188,7 @@ final SalInstance *CreateSalInstance() // init instance (only one instance in this version !!!) pSalData->pFirstInstance_ = pInst; -#ifndef USE_PSPRINT +#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) StartPrinterListening(); #endif @@ -200,11 +202,11 @@ final void DestroySalInstance( SalInstance *pInst ) // reset instance (only one instance in this version !!!) if( pSalData->pFirstInstance_ == pInst ) { -#ifndef USE_PSPRINT +#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) StopPrinterListening(); #endif pSalData->pFirstInstance_ = NULL; -#ifndef USE_PSPRINT +#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) ::vcl_sal::XpDefaults::release(); #endif } diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index 369c3dbdca3f..62f112ad3028 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # -# last change: $Author: cp $ $Date: 2000-11-17 18:42:12 $ +# last change: $Author: oisin $ $Date: 2001-01-31 15:01:50 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -99,14 +99,18 @@ SLOFILES= \ $(SLO)$/xlfd_smpl.obj \ $(SLO)$/salgdi3.obj -.IF "$(PSPRINT)" == "" +.IF "$(PSPRINT)" != "" +SLOFILES+=$(SLO)$/salprnpsp.obj +.ELIF "$(USE_XPRINT)" == "TRUE" +CFLAGS+=-D_USE_PRINT_EXTENSION_=1 +SLOFILES+=$(SLO)$/xprintext.obj +.ELSE SLOFILES+=\ $(SLO)$/salprn.obj \ $(SLO)$/salpimpl.obj \ $(SLO)$/salconfig.obj -.ELSE -SLOFILES+=$(SLO)$/salprnpsp.obj .ENDIF + .IF "$(OS)"=="SOLARIS" SLOFILES+=$(SLO)$/cdeint.obj ENVCFLAGS+=-DUSE_CDE diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx index cdfdfa0c5dba..9c6b2101fcc0 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.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:33:29 $ + * last change: $Author: oisin $ $Date: 2001-01-31 15:01:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,6 +66,9 @@ #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> @@ -459,8 +462,19 @@ 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 ); -BOOL SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, long nDrawableDepth, + return( mpDDB != NULL ); +} +#else +BOOL SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) { Destroy(); @@ -470,9 +484,64 @@ 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 { @@ -526,6 +595,7 @@ void SalBitmap::ImplDraw( Drawable aDrawable, long nDrawableDepth, if( mpDDB ) mpDDB->ImplDraw( aDrawable, nDrawableDepth, rTwoRect, rGC ); } +#endif // ----------------------------------------------------------------------------- @@ -554,8 +624,10 @@ 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 ) || @@ -667,13 +739,22 @@ void SalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly ) // - ImplSalDDB - // -------------- -ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, const SalTwoRect& rTwoRect ) : +ImplSalDDB::ImplSalDDB( +#ifdef _USE_PRINT_EXTENSION_ + SalDisplay* pDisplay, +#endif + 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() ) ) { @@ -697,11 +778,19 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, const SalTwoRect& rT // ----------------------------------------------------------------------------- -ImplSalDDB::ImplSalDDB( Drawable aDrawable, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) : +ImplSalDDB::ImplSalDDB( +#ifdef _USE_PRINT_EXTENSION_ + SalDisplay* pDisplay, +#endif + 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 ) ) { @@ -718,8 +807,13 @@ ImplSalDDB::ImplSalDDB( Drawable aDrawable, long nDrawableDepth, long nX, long n } 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; @@ -766,24 +860,43 @@ BOOL ImplSalDDB::ImplMatches( long nDepth, const SalTwoRect& rTwoRect ) const // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const +void ImplSalDDB::ImplDraw( +#ifdef _USE_PRINT_EXTENSION_ + SalDisplay* pDisplay, +#endif + 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( Drawable aSrcDrawable, long nSrcDrawableDepth, +void ImplSalDDB::ImplDraw( +#ifdef _USE_PRINT_EXTENSION_ + SalDisplay* pDisplay, +#endif + 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 ) { diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index c3723910fcde..f8cd51b3e7f8 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salgdi.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:39:52 $ + * last change: $Author: oisin $ $Date: 2001-01-31 15:01:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,7 +83,7 @@ #include <tools/debug.hxx> -#if !defined(USE_PSPRINT) +#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) #ifndef PRINTER_DUMMY #define Font XLIB_Font #define Region XLIB_Region @@ -302,8 +302,13 @@ final GC SalGraphicsData::SelectBrush() { XSetFillStyle ( pDisplay, pBrushGC_, FillSolid ); XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ ); + #if defined(_USE_PRINT_EXTENSION_) + XSetBackground( pDisplay, pBrushGC_, + WhitePixel(pDisplay, DefaultScreen(pDisplay)) ); + #else if( bPrinter_ ) XSetTile( pDisplay, pBrushGC_, None ); + #endif } else { @@ -1179,7 +1184,7 @@ BOOL SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pP { #endif - #if !defined(PRINTER_DUMMY) && !defined(USE_PSPRINT) + #if !defined(PRINTER_DUMMY) && !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) if( _IsPrinter() ) { // convert \r to \n (#60367#, EPS-files with mac format) diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index 0a154cecf821..4ee205cea18b 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salgdi2.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:41:50 $ + * last change: $Author: oisin $ $Date: 2001-01-31 15:01:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,7 +82,7 @@ #include <salgdi.hxx> #endif -#if !defined(USE_PSPRINT) && !defined(PRINTER_DUMMY) +#if !defined(USE_PSPRINT) && !defined(PRINTER_DUMMY) && !defined(_USE_PRINT_EXTENSION_) #define Font XLIB_Font #define Region XLIB_Region #include <xprinter/xp.h> @@ -780,7 +780,7 @@ final void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& aNewVal.foreground = rColMap.GetWhitePixel(), aNewVal.background = rColMap.GetBlackPixel(); XChangeGC( pXDisp, aGC, nValues, &aNewVal ); - #if !defined(USE_PSPRINT) + #if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) if( _IsPrinter() ) { SalTwoRect aTwoRect = { pPosAry->mnSrcX, pPosAry->mnSrcY, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight, @@ -799,7 +799,11 @@ final void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& } else #endif + #if defined(_USE_PRINT_EXTENSION_) + rSalBitmap.ImplDraw( pSalDisp, aDrawable, nDepth, *pPosAry, aGC ); + #else rSalBitmap.ImplDraw( aDrawable, nDepth, *pPosAry, aGC ); + #endif XChangeGC( pXDisp, aGC, nValues, &aOldVal ); XFlush( pXDisp ); @@ -846,7 +850,11 @@ final void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& // draw paint bitmap in pixmap #1 aValues.function = GXcopy, aValues.foreground = nWhite, aValues.background = nBlack; aTmpGC = XCreateGC( pXDisp, aFG, nValues, &aValues ); - rSalBitmap.ImplDraw( aFG, nDepth, aTmpRect, aTmpGC ); + #ifdef _USE_PRINT_EXTENSION_ + rSalBitmap.ImplDraw( pSalDisp, aFG, nDepth, aTmpRect, aTmpGC ); + #else + rSalBitmap.ImplDraw( aFG, nDepth, aTmpRect, aTmpGC ); + #endif DBG_TESTTRANS( aFG ); // draw background in pixmap #2 @@ -859,13 +867,23 @@ final void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& // mask out paint bitmap in pixmap #1 (transparent areas 0) aValues.function = GXand, aValues.foreground = 0x00000000, aValues.background = 0xffffffff; XChangeGC( pXDisp, aTmpGC, nValues, &aValues ); - rTransBitmap.ImplDraw( aFG, 1, aTmpRect, aTmpGC ); + #ifdef _USE_PRINT_EXTENSION_ + rTransBitmap.ImplDraw( pSalDisp, aFG, 1, aTmpRect, aTmpGC ); + #else + rTransBitmap.ImplDraw( aFG, 1, aTmpRect, aTmpGC ); + #endif + DBG_TESTTRANS( aFG ); // mask out background in pixmap #2 (nontransparent areas 0) aValues.function = GXand, aValues.foreground = 0xffffffff, aValues.background = 0x00000000; XChangeGC( pXDisp, aTmpGC, nValues, &aValues ); - rTransBitmap.ImplDraw( aBG, 1, aTmpRect, aTmpGC ); + #ifdef _USE_PRINT_EXTENSION_ + rTransBitmap.ImplDraw( pSalDisp, aBG, 1, aTmpRect, aTmpGC ); + #else + rTransBitmap.ImplDraw( aBG, 1, aTmpRect, aTmpGC ); + #endif + DBG_TESTTRANS( aBG ); // merge pixmap #1 and pixmap #2 in pixmap #2 @@ -951,7 +969,12 @@ final void SalGraphics::DrawMask( const SalTwoRect* pPosAry, const SalBitmap &rS aValues.function = GXcopyInverted; aValues.foreground = 1, aValues.background = 0; aTmpGC = XCreateGC( pXDisp, aStipple, GCFunction | GCForeground | GCBackground, &aValues ); - rSalBitmap.ImplDraw( aStipple, 1, aTwoRect, aTmpGC ); + #ifdef _USE_PRINT_EXTENSION_ + rSalBitmap.ImplDraw( pSalDisp, aStipple, 1, aTwoRect, aTmpGC ); + #else + rSalBitmap.ImplDraw( aStipple, 1, aTwoRect, aTmpGC ); + #endif + XFreeGC( pXDisp, aTmpGC ); // Set stipple and draw rectangle @@ -1044,7 +1067,13 @@ final SalBitmap *SalGraphics::GetBitmap( long nX, long nY, long nDX, long nDY ) if( &_GetDisplay()->GetColormap() != &_GetColormap() ) nBitCount = 1; - pSalBitmap->ImplCreateFromDrawable( _GetDrawable(), nBitCount, nX, nY, nDX, nDY ); + + #if defined(_USE_PRINT_EXTENSION_) + pSalBitmap->ImplCreateFromDrawable( _GetDisplay(), _GetDrawable(), nBitCount, nX, nY, nDX, nDY ); + #else + pSalBitmap->ImplCreateFromDrawable( _GetDrawable(), nBitCount, nX, nY, nDX, nDY ); + #endif + return pSalBitmap; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 75bc4cd8c278..7f337825003f 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salgdi3.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: oisin $ $Date: 2001-01-23 17:49:52 $ + * last change: $Author: oisin $ $Date: 2001-01-31 15:01:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,7 +99,7 @@ #include <tools/debug.hxx> #include <tools/stream.hxx> -#if !defined(USE_PSPRINT) && !defined(PRINTER_DUMMY) +#if !defined(USE_PSPRINT) && !defined(PRINTER_DUMMY) && !defined(_USE_PRINT_EXTENSION_) #define Font XLIB_Font #define Region XLIB_Region #include <xprinter/xp.h> @@ -176,7 +176,9 @@ void SalGraphicsData::FaxPhoneComment( const sal_Unicode* pStr, USHORT nLen ) co aPhone = "PhoneNumber("; aPhone += aPhoneNumber; aPhone += ")\n"; +#if !defined(_USE_PRINT_EXTENSION_) XpPSComment( GetDisplay()->GetDisplay(), aPhone.GetBuffer() ); +#endif #else *m_pPhoneNr = String( aPhoneNumber, gsl_getSystemTextEncoding() ); #endif @@ -456,13 +458,22 @@ SalGraphicsData::SelectFont() values.fill_rule = EvenOddRule; // Pict import/ Gradient values.graphics_exposures = True; values.foreground = nTextPixel_; - +#ifdef _USE_PRINT_EXTENSION_ + values.background = xColormap_->GetWhitePixel(); +#endif +#ifdef _USE_PRINT_EXTENSION_ pFontGC_ = XCreateGC( pDisplay, hDrawable_, GCSubwindowMode | GCFillRule - | GCGraphicsExposures | GCForeground, + | GCGraphicsExposures | GCBackground | GCForeground, &values ); } - +#else + pFontGC_ = XCreateGC( pDisplay, hDrawable_, + GCSubwindowMode | GCFillRule + | GCGraphicsExposures | GCForeground, + &values ); + } +#endif if( !bFontGC_ ) { XSetForeground( pDisplay, pFontGC_, nTextPixel_ ); @@ -658,7 +669,7 @@ XPrinterDrawText16( Display* pDisplay, Drawable nDrawable, GC nGC, { // XXX FIXME this is broken, because nX and nY is not sufficiently updated XSetFont( pDisplay, nGC, pTextItem[ nItem ].font ); -#ifndef USE_PSPRINT +#if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) if ( XSalCanDrawRotString(pDisplay, nGC) ) { XSalDrawRotString( pDisplay, nDrawable, nGC, nX, nY, @@ -1303,7 +1314,7 @@ SalGraphics::GetFontMetric( ImplFontMetricData *pMetric ) { pFont->ToImplFontMetricData( pMetric ); - #ifndef USE_PSPRINT + #if !defined(USE_PSPRINT) && !defined(_USE_PRINT_EXTENSION_) if( XSalCanDrawRotString( maGraphicsData.GetXDisplay(), None ) ) pMetric->mnOrientation = maGraphicsData.nFontOrientation_; #endif @@ -1417,7 +1428,7 @@ SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs ) { if( ! _IsPrinter() ) return 0; -#ifdef USE_PSPRINT +#if defined(USE_PSPRINT) || defined(_USE_PRINT_EXTENSION_) return 0; #else // get pair kerning table ( internal data from xprinter ) diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index 95c6694c0b22..6b59197ad989 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.7 $ +# $Revision: 1.8 $ # -# last change: $Author: oisin $ $Date: 2001-01-23 17:56:11 $ +# last change: $Author: oisin $ $Date: 2001-01-31 15:02:44 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -559,20 +559,37 @@ $(MISC)$/$(SHL2TARGET).def: $(MISC)$/$(SHL1TARGET).flt \ .IF "$(GUI)"=="UNX" -.IF "$(OS)"=="SOLARIS" -.IF "$(PSPRINT)" == "" -SHL1STDLIBS += -lxp$(UPD)$(DLLPOSTFIX) -lXm -lXt -lX11 +.IF "$(USE_XPRINT)"!="TRUE" .ELSE +CFLAGS+=-D_USE_PRINT_EXTENSION_=1 +.ENDIF + +# Solaris +.IF "$(OS)"=="SOLARIS" + +.IF "$(USE_XPRINT)" == "TRUE" +SHL1STDLIBS += -lXp -lXm -lXt -lX11 +.ELIF "$(PSPRINT)"!="" SHL1STDLIBS += -lXm -lXt -lX11 +.ELSE +SHL1STDLIBS += -lxp$(UPD)$(DLLPOSTFIX) -lXm -lXt -lX11 .ENDIF + +# MacOSX .ELIF "$(OS)"=="MACOSX" SHL1STDLIBS += + +# Others .ELSE -.IF "$(PSPRINT)" == "" -SHL1STDLIBS += -lxp$(UPD)$(DLLPOSTFIX) -lXaw -lXt -lX11 -.ELSE + +.IF "$(USE_XPRINT)" == "TRUE" +SHL1STDLIBS += -lXp -lXaw -lXt -lX11 +.ELIF "$(PSPRINT)"!="" SHL1STDLIBS += -lXaw -lXt -lX11 +.ELSE +SHL1STDLIBS += -lxp$(UPD)$(DLLPOSTFIX) -lXaw -lXt -lX11 .ENDIF + .ENDIF .IF "$(OS)"=="LINUX" || "$(OS)"=="SOLARIS" diff --git a/vcl/util/target.pmk b/vcl/util/target.pmk index 56868954b47c..bc9565270431 100644 --- a/vcl/util/target.pmk +++ b/vcl/util/target.pmk @@ -2,9 +2,9 @@ # # $RCSfile: target.pmk,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # -# last change: $Author: oisin $ $Date: 2001-01-23 17:58:05 $ +# last change: $Author: oisin $ $Date: 2001-01-31 15:02:44 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -72,3 +72,8 @@ ONLYDLL .SETDIR=$(PRJ)$/util: $(SLOFILES) dmake debug=t prjpch=t linkinc=t compinc=t ..$/$(OUTPATH)$/bin$/sv$(UPD)$(DLLSUFFIX).dll @echo "READY" +.IF "$(USE_XPRINT)"!="TRUE" +.ELSE +CFLAGS+=-D_USE_PRINT_EXTENSION_=1 +.ENDIF + |