diff options
-rw-r--r-- | psprint/source/fontmanager/fontconfig.cxx | 16 | ||||
-rw-r--r-- | psprint/source/fontmanager/fontmanager.cxx | 25 | ||||
-rw-r--r-- | vcl/aqua/inc/salgdi.h | 8 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salatsuifontutils.cxx | 125 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdi.cxx | 36 | ||||
-rw-r--r-- | vcl/inc/vcl/salnativewidgets.hxx | 18 | ||||
-rw-r--r-- | vcl/inc/vcl/wrkwin.hxx | 11 | ||||
-rw-r--r-- | vcl/source/gdi/outdev6.cxx | 17 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/wrkwin.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkwrapper.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi.cxx | 29 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi2.cxx | 21 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi3.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/source/gdi/xrender_peer.hxx | 23 |
16 files changed, 239 insertions, 124 deletions
diff --git a/psprint/source/fontmanager/fontconfig.cxx b/psprint/source/fontmanager/fontconfig.cxx index 6270f52efcd9..c81962ef20b7 100644 --- a/psprint/source/fontmanager/fontconfig.cxx +++ b/psprint/source/fontmanager/fontconfig.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: fontconfig.cxx,v $ - * $Revision: 1.30 $ + * $Revision: 1.30.24.2 $ * * This file is part of OpenOffice.org. * @@ -91,7 +91,6 @@ using namespace rtl; class FontCfgWrapper { oslModule m_pLib; - FcConfig* m_pDefConfig; FcFontSet* m_pOutlineSet; FcBool (*m_pFcInit)(); @@ -140,7 +139,6 @@ public: bool isValid() const { return m_pLib != NULL;} - FcConfig* getDefConfig() { return m_pDefConfig; } FcFontSet* getFontSet(); FcBool FcInit() @@ -252,7 +250,6 @@ oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol ) FontCfgWrapper::FontCfgWrapper() : m_pLib( NULL ), - m_pDefConfig( NULL ), m_pOutlineSet( NULL ) { OUString aLib( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so.1" ) ); @@ -379,8 +376,7 @@ FontCfgWrapper::FontCfgWrapper() FcInit(); - m_pDefConfig = FcConfigGetCurrent(); - if( ! m_pDefConfig ) + if( ! FcConfigGetCurrent() ) { osl_unloadModule( (oslModule)m_pLib ); m_pLib = NULL; @@ -394,7 +390,7 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) add only acceptable outlined fonts to our config, for future fontconfig use */ - FcFontSet* pOrig = FcConfigGetFonts( getDefConfig(), eSetName ); + FcFontSet* pOrig = FcConfigGetFonts( FcConfigGetCurrent(), eSetName ); if( !pOrig ) return; @@ -914,13 +910,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, addtopattern(rWrapper, pPattern, eItalic, eWeight, eWidth, ePitch); // query fontconfig for a substitute - rWrapper.FcConfigSubstitute( rWrapper.getDefConfig(), pPattern, FcMatchPattern ); + rWrapper.FcConfigSubstitute( rWrapper.FcConfigGetCurrent(), pPattern, FcMatchPattern ); rWrapper.FcDefaultSubstitute( pPattern ); // process the result of the fontconfig query FcResult eResult = FcResultNoMatch; FcFontSet* pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( rWrapper.getDefConfig(), &pFontSet, 1, pPattern, &eResult ); + FcPattern* pResult = rWrapper.FcFontSetMatch( rWrapper.FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult ); rWrapper.FcPatternDestroy( pPattern ); FcFontSet* pSet = NULL; @@ -982,7 +978,7 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star if( ! rWrapper.isValid() ) return false; - FcConfig* pConfig = rWrapper.getDefConfig(); + FcConfig* pConfig = rWrapper.FcConfigGetCurrent(); FcPattern* pPattern = rWrapper.FcPatternCreate(); OString aLangAttrib; diff --git a/psprint/source/fontmanager/fontmanager.cxx b/psprint/source/fontmanager/fontmanager.cxx index a8c22f96e8d0..e794eabf42cb 100644 --- a/psprint/source/fontmanager/fontmanager.cxx +++ b/psprint/source/fontmanager/fontmanager.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: fontmanager.cxx,v $ - * $Revision: 1.81 $ + * $Revision: 1.81.22.2 $ * * This file is part of OpenOffice.org. * @@ -2089,6 +2089,20 @@ void PrintFontManager::initFontsAlias() } } +// code stolen from vcl's RegisterFontSubstitutors() +// TODO: use that method once psprint gets merged into vcl +static bool AreFCSubstitutionsEnabled() +{ + bool bDisableFC = false; +#ifdef SOLARIS + bDisableFC = true; +#endif + const char* pEnvStr = ::getenv( "SAL_DISABLE_FC_SUBST" ); + if( pEnvStr ) + bDisableFC = (*pEnvStr == '\0') || (*pEnvStr != '0'); + return bDisableFC; +} + void PrintFontManager::initialize( void* pInitDisplay ) { #ifdef CALLGRIND_COMPILE @@ -2149,13 +2163,18 @@ void PrintFontManager::initialize( void* pInitDisplay ) if( rSalPrivatePath.getLength() ) { OString aPath = rtl::OUStringToOString( rSalPrivatePath, aEncoding ); + const bool bAreFCSubstitutionsEnabled = AreFCSubstitutionsEnabled(); sal_Int32 nIndex = 0; do { OString aToken = aPath.getToken( 0, ';', nIndex ); normPath( aToken ); - if( !addFontconfigDir( aToken ) ) - continue; + // if registering an app-specific fontdir with fontconfig fails + // and fontconfig-based substitutions are enabled + // then trying to use these app-specific fonts doesn't make sense + if( m_bFontconfigSuccess && !addFontconfigDir( aToken ) ) + if( bAreFCSubstitutionsEnabled ) + continue; m_aFontDirectories.push_back( aToken ); m_aPrivateFontDirectories.push_back( getDirectoryAtom( aToken, true ) ); } while( nIndex >= 0 ); diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index 8b3911d79850..d32ef0789f93 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi.h,v $ - * $Revision: 1.45 $ + * $Revision: 1.45.14.1 $ * * This file is part of OpenOffice.org. * @@ -169,6 +169,7 @@ public: bool CheckContext(); void UpdateWindow( NSRect& rRect ); // delivered in NSView coordinates void RefreshRect( const CGRect& ); + void RefreshRect( const NSRect& rRect ); void RefreshRect(float lX, float lY, float lWidth, float lHeight); void SetState(); @@ -389,6 +390,11 @@ inline void AquaSalGraphics::RefreshRect( const CGRect& rRect ) RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height ); } +inline void AquaSalGraphics::RefreshRect( const NSRect& rRect ) +{ + RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height ); +} + inline RGBAColor::RGBAColor( SalColor nSalColor ) : mfRed( SALCOLOR_RED(nSalColor) * (1.0/255)) , mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255)) diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx index 7485df057807..6c8fe86bdaef 100644 --- a/vcl/aqua/source/gdi/salatsuifontutils.cxx +++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salatsuifontutils.cxx,v $ - * $Revision: 1.13 $ + * $Revision: 1.13.138.6 $ * * This file is part of OpenOffice.org. * @@ -44,13 +44,19 @@ // since neither head's macStyle nor OS/2's panose are easily available // during font enumeration. macStyle bits would be not sufficient anyway // and SFNT fonts on Mac usually do not contain an OS/2 table. -static void UpdateAttributesFromPSName( const String& aPSName, ImplDevFontAttributes& rDFA ) +static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttributes& rDFA ) { - if( (aPSName.SearchAscii("Regular") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Normal") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Roman") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Medium") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Plain") != STRING_NOTFOUND) ) + // TODO: use a multi-string ignore-case matcher once it becomes available + String aPSName = rPSName; + aPSName.ToLowerAscii(); + + if( (aPSName.SearchAscii("regular") != STRING_NOTFOUND) + || (aPSName.SearchAscii("normal") != STRING_NOTFOUND) + || (aPSName.SearchAscii("roman") != STRING_NOTFOUND) + || (aPSName.SearchAscii("medium") != STRING_NOTFOUND) + || (aPSName.SearchAscii("plain") != STRING_NOTFOUND) + || (aPSName.SearchAscii("standard") != STRING_NOTFOUND) + || (aPSName.SearchAscii("std") != STRING_NOTFOUND) ) { rDFA.meWidthType = WIDTH_NORMAL; rDFA.meWeight = WEIGHT_NORMAL; @@ -58,68 +64,109 @@ static void UpdateAttributesFromPSName( const String& aPSName, ImplDevFontAttrib } // heuristics for font weight - if (aPSName.SearchAscii("ExtraBlack") != STRING_NOTFOUND) + if (aPSName.SearchAscii("extrablack") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_BLACK; - else if (aPSName.SearchAscii("Black") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("black") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_BLACK; - //else if (aPSName.SearchAscii("Book") != STRING_NOTFOUND) + //else if (aPSName.SearchAscii("book") != STRING_NOTFOUND) // rDFA.meWeight = WEIGHT_SEMIBOLD; - else if (aPSName.SearchAscii("SemiBold") != STRING_NOTFOUND) + else if( (aPSName.SearchAscii("semibold") != STRING_NOTFOUND) + || (aPSName.SearchAscii("smbd") != STRING_NOTFOUND)) rDFA.meWeight = WEIGHT_SEMIBOLD; - else if (aPSName.SearchAscii("UltraBold") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("ultrabold") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_ULTRABOLD; - else if (aPSName.SearchAscii("ExtraBold") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("extrabold") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_BLACK; - else if (aPSName.SearchAscii("Bold") != STRING_NOTFOUND) + else if( (aPSName.SearchAscii("bold") != STRING_NOTFOUND) + || (aPSName.SearchAscii("-bd") != STRING_NOTFOUND)) rDFA.meWeight = WEIGHT_BOLD; - else if (aPSName.SearchAscii("UltraLight") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("extralight") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_ULTRALIGHT; - else if (aPSName.SearchAscii("Light") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("ultralight") != STRING_NOTFOUND) + rDFA.meWeight = WEIGHT_ULTRALIGHT; + else if (aPSName.SearchAscii("light") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_LIGHT; - else if (aPSName.SearchAscii("Thin") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("thin") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_THIN; - else if (aPSName.SearchAscii("-W3") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("-w3") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_LIGHT; - else if (aPSName.SearchAscii("-W4") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("-w4") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_SEMILIGHT; - else if (aPSName.SearchAscii("-W5") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("-w5") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_NORMAL; - else if (aPSName.SearchAscii("-W6") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("-w6") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_SEMIBOLD; - else if (aPSName.SearchAscii("-W8") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("-w7") != STRING_NOTFOUND) + rDFA.meWeight = WEIGHT_BOLD; + else if (aPSName.SearchAscii("-w8") != STRING_NOTFOUND) + rDFA.meWeight = WEIGHT_ULTRABOLD; + else if (aPSName.SearchAscii("-w9") != STRING_NOTFOUND) rDFA.meWeight = WEIGHT_BLACK; // heuristics for font slant - if( (aPSName.SearchAscii("Italic") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Cursive") != STRING_NOTFOUND) - || (aPSName.SearchAscii("BookIt") != STRING_NOTFOUND) ) + if( (aPSName.SearchAscii("italic") != STRING_NOTFOUND) + || (aPSName.SearchAscii(" ital") != STRING_NOTFOUND) + || (aPSName.SearchAscii("cursive") != STRING_NOTFOUND) + || (aPSName.SearchAscii("-it") != STRING_NOTFOUND) + || (aPSName.SearchAscii("lightit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("mediumit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("boldit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("cnit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("bdcn") != STRING_NOTFOUND) + || (aPSName.SearchAscii("bdit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("condit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("bookit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("blackit") != STRING_NOTFOUND) + || (aPSName.SearchAscii("libertineio") != STRING_NOTFOUND) ) rDFA.meItalic = ITALIC_NORMAL; - if( (aPSName.SearchAscii("Oblique") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Inclined") != STRING_NOTFOUND) ) + if( (aPSName.SearchAscii("oblique") != STRING_NOTFOUND) + || (aPSName.SearchAscii("inclined") != STRING_NOTFOUND) + || (aPSName.SearchAscii("slanted") != STRING_NOTFOUND) ) rDFA.meItalic = ITALIC_OBLIQUE; // heuristics for font width - if (aPSName.SearchAscii("Condensed") != STRING_NOTFOUND) + if( (aPSName.SearchAscii("condensed") != STRING_NOTFOUND) + || (aPSName.SearchAscii("-cond") != STRING_NOTFOUND) + || (aPSName.SearchAscii("boldcond") != STRING_NOTFOUND) + || (aPSName.SearchAscii("boldcn") != STRING_NOTFOUND) + || (aPSName.SearchAscii("cnit") != STRING_NOTFOUND) ) rDFA.meWidthType = WIDTH_CONDENSED; - else if (aPSName.SearchAscii("Narrow") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("narrow") != STRING_NOTFOUND) rDFA.meWidthType = WIDTH_SEMI_CONDENSED; - else if (aPSName.SearchAscii("Expanded") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("expanded") != STRING_NOTFOUND) rDFA.meWidthType = WIDTH_EXPANDED; - else if (aPSName.SearchAscii("Wide") != STRING_NOTFOUND) + else if (aPSName.SearchAscii("wide") != STRING_NOTFOUND) rDFA.meWidthType = WIDTH_EXPANDED; // heuristics for font pitch - if( (aPSName.SearchAscii("Mono") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Courier") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Monaco") != STRING_NOTFOUND) ) + if( (aPSName.SearchAscii("mono") != STRING_NOTFOUND) + || (aPSName.SearchAscii("courier") != STRING_NOTFOUND) + || (aPSName.SearchAscii("monaco") != STRING_NOTFOUND) + || (aPSName.SearchAscii("typewriter") != STRING_NOTFOUND) ) rDFA.mePitch = PITCH_FIXED; - // heuristics for font semantic - if( (aPSName.SearchAscii("Symbol") != STRING_NOTFOUND) + // heuristics for font family type + if( (aPSName.SearchAscii("script") != STRING_NOTFOUND) + || (aPSName.SearchAscii("chancery") != STRING_NOTFOUND) + || (aPSName.SearchAscii("zapfino") != STRING_NOTFOUND)) + rDFA.meFamily = FAMILY_SCRIPT; + else if( (aPSName.SearchAscii("comic") != STRING_NOTFOUND) + || (aPSName.SearchAscii("outline") != STRING_NOTFOUND) + || (aPSName.SearchAscii("pinpoint") != STRING_NOTFOUND) ) + rDFA.meFamily = FAMILY_DECORATIVE; + else if( (aPSName.SearchAscii("sans") != STRING_NOTFOUND) + || (aPSName.SearchAscii("arial") != STRING_NOTFOUND) ) + rDFA.meFamily = FAMILY_SWISS; + else if( (aPSName.SearchAscii("roman") != STRING_NOTFOUND) + || (aPSName.SearchAscii("times") != STRING_NOTFOUND) ) + rDFA.meFamily = FAMILY_ROMAN; + + // heuristics for codepoint semantic + if( (aPSName.SearchAscii("symbol") != STRING_NOTFOUND) || (aPSName.SearchAscii("dings") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Dingbats") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Ornaments") != STRING_NOTFOUND) - || (aPSName.SearchAscii("Embellishments") != STRING_NOTFOUND) ) + || (aPSName.SearchAscii("dingbats") != STRING_NOTFOUND) + || (aPSName.SearchAscii("ornaments") != STRING_NOTFOUND) + || (aPSName.SearchAscii("embellishments") != STRING_NOTFOUND) ) rDFA.mbSymbolFlag = true; } diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index e90932d739c9..3a47cdc22f13 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi.cxx,v $ - * $Revision: 1.81 $ + * $Revision: 1.81.14.1 $ * * This file is part of OpenOffice.org. * @@ -1312,9 +1312,39 @@ void AquaSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert // ----------------------------------------------------------------------- -BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) +BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, + void* pEpsData, ULONG nByteCount ) { - return FALSE; + // convert the raw data to an NSImageRef + NSData* xNSData = [NSData dataWithBytes:(void*)pEpsData length:(int)nByteCount]; + NSImageRep* xEpsImage = [NSEPSImageRep imageRepWithData: xNSData]; + if( !xEpsImage ) + return false; + + // get the target context + if( !CheckContext() ) + return false; + + // NOTE: flip drawing, else the nsimage would be drawn upside down + CGContextSaveGState( mrContext ); +// CGContextTranslateCTM( mrContext, 0, +mnHeight ); + CGContextScaleCTM( mrContext, +1, -1 ); + nY = /*mnHeight*/ - (nY + nHeight); + + // prepare the target context + NSGraphicsContext* pOrigNSCtx = [NSGraphicsContext currentContext]; + NSGraphicsContext* pDrawNSCtx = [NSGraphicsContext graphicsContextWithGraphicsPort: mrContext flipped: IsFlipped()]; + [NSGraphicsContext setCurrentContext: pDrawNSCtx]; + // draw the EPS + const NSRect aDstRect = {{nX,nY},{nWidth,nHeight}}; + const BOOL bOK = [xEpsImage drawInRect: aDstRect]; + CGContextRestoreGState( mrContext ); + // mark the destination rectangle as updated + RefreshRect( aDstRect ); + // restore the NSGraphicsContext, TODO: do we need this? + [NSGraphicsContext setCurrentContext: pOrigNSCtx]; + + return bOK; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx index e16df97f3c5f..c8fb0cb40d21 100644 --- a/vcl/inc/vcl/salnativewidgets.hxx +++ b/vcl/inc/vcl/salnativewidgets.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salnativewidgets.hxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.108.2 $ * * This file is part of OpenOffice.org. * @@ -402,11 +402,17 @@ class ImplControlValue { mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = aOptVal; }; inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric ) \ { mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = NULL; }; - inline ImplControlValue( ButtonValue nTristate ) { mTristate = nTristate; mOptionalVal = NULL; }; - inline ImplControlValue( rtl::OUString sString ) { mString = sString; mOptionalVal = NULL; }; - inline ImplControlValue( long nNumeric ) { mNumber = nNumeric; mOptionalVal = NULL; }; - inline ImplControlValue( void * aOptVal ) { mOptionalVal = aOptVal; }; - inline ImplControlValue() { mTristate = BUTTONVALUE_DONTKNOW; mNumber = 0; mOptionalVal = NULL; }; + explicit ImplControlValue( ButtonValue nTristate ) + : mTristate(nTristate), mNumber(0), mOptionalVal(NULL) {} + explicit ImplControlValue( rtl::OUString& rString ) + : mTristate(BUTTONVALUE_DONTKNOW), mString(rString), mNumber(0), mOptionalVal(NULL) {} + explicit ImplControlValue( long nNumeric ) + : mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric), mOptionalVal(NULL) {} + explicit ImplControlValue( void* aOptVal ) + : mTristate(BUTTONVALUE_DONTKNOW), mNumber(0), mOptionalVal(aOptVal) {} + inline ImplControlValue() + : mTristate(BUTTONVALUE_DONTKNOW), mNumber(0), mOptionalVal(NULL) {} + inline ~ImplControlValue() { mOptionalVal = NULL; }; inline ButtonValue getTristateVal( void ) const { return mTristate; } diff --git a/vcl/inc/vcl/wrkwin.hxx b/vcl/inc/vcl/wrkwin.hxx index 3d9c090272ab..8b2701420a2f 100644 --- a/vcl/inc/vcl/wrkwin.hxx +++ b/vcl/inc/vcl/wrkwin.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: wrkwin.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.138.1 $ * * This file is part of OpenOffice.org. * @@ -82,7 +82,14 @@ public: virtual BOOL Close(); - void ShowFullScreenMode( BOOL bFullScreenMode = TRUE, sal_Int32 nDisplay = 0 ); + /** The default value of nDisplay = -1 means "don't care" and + allows to backends to use any screen [** or display? terminology!] + they like (most probably the current one). + + NOTE: The default value cannot be 0, because 0 is a legitimate + screen number. + */ + void ShowFullScreenMode( BOOL bFullScreenMode = TRUE, sal_Int32 nDisplay = -1 ); void EndFullScreenMode() { ShowFullScreenMode( FALSE ); } BOOL IsFullScreenMode() const { return mbFullScreenMode; } diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index dbac93af425b..03f2705e9ae9 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: outdev6.cxx,v $ - * $Revision: 1.33 $ + * $Revision: 1.33.16.1 $ * * This file is part of OpenOffice.org. * @@ -1108,13 +1108,11 @@ void OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, return; Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) ); - BOOL bDrawn = FALSE; - if( !aRect.IsEmpty() ) { - aRect.Justify(); - - if( GetOutDevType() == OUTDEV_PRINTER ) + // draw the real EPS graphics + bool bDrawn = FALSE; + if( rGfxLink.GetData() && rGfxLink.GetDataSize() ) { if( !mpGraphics && !ImplGetGraphics() ) return; @@ -1122,11 +1120,12 @@ void OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, if( mbInitClipRegion ) ImplInitClipRegion(); - if( rGfxLink.GetData() && rGfxLink.GetDataSize() ) - bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), - (BYTE*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this ); + aRect.Justify(); + bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), + (BYTE*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this ); } + // else draw the substitution graphics if( !bDrawn && pSubst ) { GDIMetaFile* pOldMetaFile = mpMetaFile; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index be12fe43d8c9..987f8a3d275d 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: pdfwriter_impl.cxx,v $ - * $Revision: 1.134 $ + * $Revision: 1.133.16.2 $ * * This file is part of OpenOffice.org. * @@ -6270,10 +6270,7 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs, const ImplFontData* pDevFont = m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData; for( int i = 0; i < nGlyphs; i++ ) { - if( ! pGlyphs[i] ) - continue; const int nFontGlyphId = pGlyphs[i] & (GF_IDXMASK | GF_ISCHAR | GF_GSUB); - const ImplFontData* pCurrentFont = pFallbackFonts[i] ? pFallbackFonts[i] : pDevFont; if( isBuiltinFont( pCurrentFont ) ) diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 5aea77559cb7..b993896ad980 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: wrkwin.cxx,v $ - * $Revision: 1.21 $ + * $Revision: 1.21.138.2 $ * * This file is part of OpenOffice.org. * @@ -196,6 +196,12 @@ void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay ) if ( !mbFullScreenMode == !bFullScreenMode ) return; + if( (nDisplay < 0) + || (nDisplay >= static_cast<sal_Int32>(Application::GetScreenCount()) ) ) + { + nDisplay = GetScreenNumber(); + } + mbFullScreenMode = bFullScreenMode != 0; if ( !mbSysChild ) { diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx index b2b02d8f05af..927b8548a77a 100644 --- a/vcl/unx/gtk/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk/a11y/atkwrapper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: atkwrapper.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.52.1 $ * * This file is part of OpenOffice.org. * @@ -344,8 +344,13 @@ wrapper_get_name( AtkObject *atk_obj ) obj->mpContext->getAccessibleName(), RTL_TEXTENCODING_UTF8); - g_free(atk_obj->name); - atk_obj->name = g_strdup(aName.getStr()); + int nCmp = atk_obj->name ? rtl_str_compare( atk_obj->name, aName.getStr() ) : -1; + if( nCmp != 0 ) + { + if( atk_obj->name ) + g_free(atk_obj->name); + atk_obj->name = g_strdup(aName.getStr()); + } } catch(const uno::Exception& e) { g_warning( "Exception in getAccessibleName()" ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 00e5f6215cd7..c00d14a4a587 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: gtkframe.cxx,v $ - * $Revision: 1.84 $ + * $Revision: 1.84.36.1 $ * * This file is part of OpenOffice.org. * @@ -1624,6 +1624,7 @@ void GtkSalFrame::moveToScreen( int nScreen ) GtkSalDisplay* pDisp = getDisplay(); m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window); m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual(); + m_aSystemData.nScreen = nScreen; m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth(); m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap(); m_aSystemData.pAppContext = NULL; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 2b21397248ef..60acda82091e 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi.cxx,v $ - * $Revision: 1.53 $ + * $Revision: 1.53.16.1 $ * * This file is part of OpenOffice.org. * @@ -1361,36 +1361,25 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly } // create xrender Picture for polygon foreground - Display* pXDisplay = GetXDisplay(); - int nVisualDepth = pVisualFormat->depth; - SalDisplay::RenderEntry& rEntry = GetDisplay()->GetRenderEntries( m_nScreen )[ nVisualDepth ]; + SalDisplay::RenderEntry& rEntry = GetDisplay()->GetRenderEntries( m_nScreen )[ 32 ]; if( !rEntry.m_aPicture ) { -#ifdef DBG_UTIL - int iDummy; - unsigned uDummy; - XLIB_Window wDummy; - unsigned int nDrawDepth; - ::XGetGeometry( pXDisplay, hDrawable_, &wDummy, &iDummy, &iDummy, - &uDummy, &uDummy, &uDummy, &nDrawDepth ); - DBG_ASSERT( static_cast<unsigned>(nVisualDepth) == nDrawDepth, "depth messed up for XRender" ); -#endif // DBG_UTIL - - rEntry.m_aPixmap = ::XCreatePixmap( pXDisplay, hDrawable_, 1, 1, nVisualDepth ); + Display* pXDisplay = GetXDisplay(); + + rEntry.m_aPixmap = ::XCreatePixmap( pXDisplay, hDrawable_, 1, 1, 32 ); XRenderPictureAttributes aAttr; aAttr.repeat = true; - XRenderPictFormat* pXRPF = rRenderPeer.FindStandardFormat(PictStandardARGB32); - rEntry.m_aPicture = rRenderPeer.CreatePicture ( rEntry.m_aPixmap, pXRPF, CPRepeat, aAttr ); + XRenderPictFormat* pXRPF = rRenderPeer.FindStandardFormat( PictStandardARGB32 ); + rEntry.m_aPicture = rRenderPeer.CreatePicture( rEntry.m_aPixmap, pXRPF, CPRepeat, &aAttr ); } // set polygon foreground color and opacity - XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency); + XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency ); rRenderPeer.FillRectangle( PictOpSrc, rEntry.m_aPicture, &aRenderColor, 0, 0, 1, 1 ); // notify xrender of target drawable - XRenderPictureAttributes aAttr; - Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, aAttr ); + Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL ); // set clipping if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index f0dbc771ff76..8086ea8e8ea5 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi2.cxx,v $ - * $Revision: 1.47 $ + * $Revision: 1.47.16.1 $ * * This file is part of OpenOffice.org. * @@ -820,8 +820,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, if( !pDstVisFmt ) return false; - XRenderPictureAttributes aAttr; - Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, aAttr ); + Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, NULL ); if( !aDstPic ) return false; @@ -844,7 +843,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, return false; XRenderPictFormat* pSrcVisFmt = pDstVisFmt; - Picture aSrcPic = rPeer.CreatePicture( aSrcPM, pSrcVisFmt, 0, aAttr ); + Picture aSrcPic = rPeer.CreatePicture( aSrcPM, pSrcVisFmt, 0, NULL ); if( !aSrcPic ) return false; @@ -899,8 +898,9 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, TRUE ); + XRenderPictureAttributes aAttr; aAttr.repeat = true; - Picture aAlphaPic = rPeer.CreatePicture( aAlphaPM, pAlphaFormat, CPRepeat, aAttr ); + Picture aAlphaPic = rPeer.CreatePicture( aAlphaPM, pAlphaFormat, CPRepeat, &aAttr ); if( !aAlphaPic ) return false; @@ -948,17 +948,12 @@ bool X11SalGraphics::drawAlphaRect( long nX, long nY, long nWidth, if( !pDstVisFmt ) return false; - XRenderPictureAttributes aAttr; - Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, aAttr ); + Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, NULL ); if( !aDstPic ) return false; - XRenderColor aRenderColor = { - SALCOLOR_RED(nBrushColor_), - SALCOLOR_GREEN(nBrushColor_), - SALCOLOR_BLUE(nBrushColor_), - 255 - 255L*nTransparency/100 - }; + const double fTransparency = (100 - nTransparency) * (1.0/100); + const XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency); rPeer.FillRectangle( PictOpOver, aDstPic, diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 5caaaa81c425..f9fcf0929a88 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi3.cxx,v $ - * $Revision: 1.158 $ + * $Revision: 1.157.12.2 $ * * This file is part of OpenOffice.org. * @@ -1053,7 +1053,7 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout ) XRenderPictureAttributes aAttr; aAttr.repeat = true; - rEntry.m_aPicture = rRenderPeer.CreatePicture ( rEntry.m_aPixmap, pVisualFormat, CPRepeat, aAttr ); + rEntry.m_aPicture = rRenderPeer.CreatePicture ( rEntry.m_aPixmap, pVisualFormat, CPRepeat, &aAttr ); } // set font foreground color and opacity @@ -1061,8 +1061,7 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout ) rRenderPeer.FillRectangle( PictOpSrc, rEntry.m_aPicture, &aRenderColor, 0, 0, 1, 1 ); // notify xrender of target drawable - XRenderPictureAttributes aAttr; - Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, aAttr ); + Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL ); // set clipping if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) diff --git a/vcl/unx/source/gdi/xrender_peer.hxx b/vcl/unx/source/gdi/xrender_peer.hxx index 6b5a7688575c..24abd9d239e2 100644 --- a/vcl/unx/source/gdi/xrender_peer.hxx +++ b/vcl/unx/source/gdi/xrender_peer.hxx @@ -65,7 +65,7 @@ public: XRenderPictFormat* FindPictureFormat( unsigned long nMask, const XRenderPictFormat& ) const; Picture CreatePicture( Drawable, const XRenderPictFormat*, - unsigned long nDrawable, const XRenderPictureAttributes& ) const; + unsigned long nDrawable, const XRenderPictureAttributes* ) const; void SetPictureClipRegion( Picture, XLIB_Region ) const; void CompositePicture( int nOp, Picture aSrc, Picture aMask, Picture aDst, int nXSrc, int nYSrc, int nXMask, int nYMask, @@ -183,14 +183,14 @@ inline XRenderPictFormat* XRenderPeer::FindPictureFormat( unsigned long nFormatM inline Picture XRenderPeer::CreatePicture( Drawable aDrawable, const XRenderPictFormat* pVisFormat, unsigned long nValueMask, - const XRenderPictureAttributes& rRenderAttr ) const + const XRenderPictureAttributes* pRenderAttr ) const { #ifdef XRENDER_LINK return XRenderCreatePicture( mpDisplay, aDrawable, pVisFormat, - nValueMask, &rRenderAttr ); + nValueMask, pRenderAttr ); #else return (*mpXRenderCreatePicture)( mpDisplay, aDrawable, pVisFormat, - nValueMask, &rRenderAttr ); + nValueMask, pRenderAttr ); #endif } @@ -350,10 +350,23 @@ inline Picture& ScopedPic::Get() inline XRenderColor GetXRenderColor( const SalColor& rSalColor, double fTransparency = 0.0 ) { XRenderColor aRetVal; + // convert the SalColor aRetVal.red = SALCOLOR_RED( rSalColor ); aRetVal.red |= (aRetVal.red << 8); aRetVal.green = SALCOLOR_GREEN( rSalColor ); aRetVal.green |= (aRetVal.green << 8); aRetVal.blue = SALCOLOR_BLUE( rSalColor ); aRetVal.blue |= (aRetVal.blue << 8); - aRetVal.alpha = static_cast< unsigned short >((1.0 - fTransparency) * double(0xffff)); + + // handle transparency + aRetVal.alpha = 0xFFFF; // default to opaque + if( fTransparency != 0 ) + { + const double fAlpha = 1.0 - fTransparency; + aRetVal.alpha = static_cast<sal_uInt16>(fAlpha * 0xFFFF + 0.5); + // xrender wants pre-multiplied colors + aRetVal.red = static_cast<sal_uInt16>(fAlpha * aRetVal.red + 0.5); + aRetVal.green = static_cast<sal_uInt16>(fAlpha * aRetVal.green + 0.5); + aRetVal.blue = static_cast<sal_uInt16>(fAlpha * aRetVal.blue + 0.5); + } + return aRetVal; } |