Anonymous avatar Anonymous committed 19d8524

CWS-TOOLING: integrate CWS vcl94

Comments (0)

Files changed (16)

psprint/source/fontmanager/fontconfig.cxx

  * 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.
  *
 class FontCfgWrapper
 {
     oslModule		m_pLib;
-    FcConfig*		m_pDefConfig;
     FcFontSet*      m_pOutlineSet;
 
     FcBool          (*m_pFcInit)();
     bool isValid() const 
     { return m_pLib != NULL;}
 
-    FcConfig* getDefConfig() { return m_pDefConfig; }
     FcFontSet* getFontSet();
     
     FcBool FcInit()
 
 FontCfgWrapper::FontCfgWrapper()
         : m_pLib( NULL ),
-          m_pDefConfig( NULL ),
           m_pOutlineSet( NULL )
 {
      OUString aLib( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so.1" ) );
 
 
     FcInit();
-    m_pDefConfig = FcConfigGetCurrent();
-    if( ! m_pDefConfig )
+    if( ! FcConfigGetCurrent() )
     {
         osl_unloadModule( (oslModule)m_pLib );
         m_pLib = NULL;
       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;
 
     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;
     if( ! rWrapper.isValid() )
         return false;
 
-    FcConfig* pConfig = rWrapper.getDefConfig();
+    FcConfig* pConfig = rWrapper.FcConfigGetCurrent();
     FcPattern* pPattern = rWrapper.FcPatternCreate();
 
     OString aLangAttrib;

psprint/source/fontmanager/fontmanager.cxx

  * 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.
  *
     }
 }
 
+// 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
     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 );

vcl/aqua/inc/salgdi.h

  * 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.
  *
     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();
 	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))

vcl/aqua/source/gdi/salatsuifontutils.cxx

  * 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.
  *
 // 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;
     }
 
     // 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;
 }
 

vcl/aqua/source/gdi/salgdi.cxx

  * 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.
  *
 
 // -----------------------------------------------------------------------
 
-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;
 }
 
 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

vcl/inc/vcl/salnativewidgets.hxx

  * 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.
  *
 								{ 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; }

vcl/inc/vcl/wrkwin.hxx

  * 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.
  *
 
     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; }
 

vcl/source/gdi/outdev6.cxx

  * 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.
  *
 		return;
 
 	Rectangle	aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
-	BOOL		bDrawn = FALSE;
-
 	if( !aRect.IsEmpty() )
 	{
-		aRect.Justify();
+        // draw the real EPS graphics
+		bool bDrawn = FALSE;
+        if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
+        {
+            if( !mpGraphics && !ImplGetGraphics() )
+                return;
 
-		if( GetOutDevType() == OUTDEV_PRINTER )
-		{
-			if( !mpGraphics && !ImplGetGraphics() )
-				return;
+            if( mbInitClipRegion )
+                ImplInitClipRegion();
 
-			if( mbInitClipRegion )
-				ImplInitClipRegion();
+            aRect.Justify();
+            bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
+                         (BYTE*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
+        }
 
-            if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
-                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;

vcl/source/gdi/pdfwriter_impl.cxx

  * 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.
  *
     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 ) )

vcl/source/window/wrkwin.cxx

  * 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.
  *
     if ( !mbFullScreenMode == !bFullScreenMode )
         return;
 
+    if( (nDisplay < 0)
+    || (nDisplay >= static_cast<sal_Int32>(Application::GetScreenCount()) ) )
+    {
+        nDisplay = GetScreenNumber();
+    }
+
     mbFullScreenMode = bFullScreenMode != 0;
     if ( !mbSysChild )
     {

vcl/unx/gtk/a11y/atkwrapper.cxx

  * 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.
  *
                     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()" );

vcl/unx/gtk/window/gtkframe.cxx

  * 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.
  *
         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;

vcl/unx/source/gdi/salgdi.cxx

  * 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.
  *
     }
 
     // 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
+	    Display* pXDisplay = GetXDisplay();
 
-        rEntry.m_aPixmap = ::XCreatePixmap( pXDisplay, hDrawable_, 1, 1, nVisualDepth );
+        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_ ) )

vcl/unx/source/gdi/salgdi2.cxx

  * 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.
  *
     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;
 
         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;
 
 
     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;
 
     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,

vcl/unx/source/gdi/salgdi3.cxx

  * 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.
  *
 
         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
     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_ ) )

vcl/unx/source/gdi/xrender_peer.hxx

     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,
 
 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
 }
 
 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;
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.