Instvar drawId renamed to sharedDrawId.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 01 Apr 2014 15:26:51 +0200
changeset 6365 cf89c4bedea4
parent 6364 47ed6ce16ea2
child 6366 b8aa19ba1519
Instvar drawId renamed to sharedDrawId.
XftFontDescription.st
--- a/XftFontDescription.st	Tue Apr 01 14:43:47 2014 +0200
+++ b/XftFontDescription.st	Tue Apr 01 15:26:51 2014 +0200
@@ -1,7 +1,7 @@
 "{ Package: 'stx:libview' }"
 
 FontDescription subclass:#XftFontDescription
-	instanceVariableNames:'device fontId drawId closestFont minCode maxCode'
+	instanceVariableNames:'device fontId sharedDrawId closestFont minCode maxCode'
 	classVariableNames:'FC_FAMILY FC_STYLE FC_SLANT FC_WEIGHT FC_SIZE FC_ASPECT
 		FC_PIXEL_SIZE FC_SPACING FC_FOUNDRY FC_ANTIALIAS FC_HINTING
 		FC_HINT_STYLE FC_VERTICAL_LAYOUT FC_AUTOHINT FC_WIDTH FC_FILE
@@ -289,20 +289,20 @@
 !XftFontDescription class methodsFor:'instance creation'!
 
 family:familyString face:faceString style:styleString size:size sizeUnit:sizeUnit encoding:encoding
-    "returns a font for given family, face, style, size and the specified encoding. 
+    "returns a font for given family, face, style, size and the specified encoding.
      The returned font is not associated to a specific device"
 
     |proto|
 
     CachedFontList notNil ifTrue:[
-        proto := CachedFontList 
-                detect:[:fn | 
+        proto := CachedFontList
+                detect:[:fn |
                     fn family = familyString
                     and:[ fn face = faceString
                     and:[ (fn style = styleString
                           or:[ (fn style = 'oblique' and:[styleString = 'italic'])
                           or:[ (fn style = 'italic' and:[styleString = 'oblique']) ]]) ]]]
-                ifNone:nil.        
+                ifNone:nil.
         proto notNil ifTrue:[
             ^ (proto shallowCopy)
                 setDevice: nil patternId: nil fontId: nil;
@@ -508,7 +508,7 @@
         ].
     ].
     displayId := device displayIdOrErrorIfBroken.
-    displayId isNil ifTrue:[    
+    displayId isNil ifTrue:[
         ^ self.
     ].
     screen := device screen.
@@ -537,16 +537,16 @@
 
     __bytesPerCharacter = __intVal(bytesPerCharacter);
 
-    if ( __INST(drawId) == nil ) {
-        __INST(drawId) = XFT_DRAW_HANDLE_NEW ( XftDrawCreate ( DISPLAY( displayId ) ,
+    if ( __INST(sharedDrawId) == nil ) {
+        __INST(sharedDrawId) = XFT_DRAW_HANDLE_NEW ( XftDrawCreate ( DISPLAY( displayId ) ,
                                                DRAWABLE( drawableId ) ,
                                                DefaultVisual( DISPLAY( displayId), SCREEN (screen) ) ,
                                                DefaultColormap( DISPLAY( displayId), SCREEN (screen) ) ) );
-        __STORE(self, __INST(drawId));
+        __STORE(self, __INST(sharedDrawId));
     }
 
-    if ( XftDrawDrawable ( XFT_DRAW ( __INST(drawId) ) ) != DRAWABLE( drawableId ) ) {
-        XftDrawChange( XFT_DRAW( __INST(drawId) ) , DRAWABLE( drawableId ) );
+    if ( XftDrawDrawable ( XFT_DRAW ( __INST(sharedDrawId) ) ) != DRAWABLE( drawableId ) ) {
+        XftDrawChange( XFT_DRAW( __INST(sharedDrawId) ) , DRAWABLE( drawableId ) );
     }
 
     string = __stringVal( aString ) + (( __intVal(index1) - 1 ) * __bytesPerCharacter);
@@ -557,9 +557,9 @@
         clipRX.y = __intVal(clipY);
         clipRX.width = __intVal(clipW);
         clipRX.height = __intVal(clipH);
-        XftDrawSetClipRectangles( XFT_DRAW( __INST( drawId ) ) , 0, 0, &clipRX, 1);
+        XftDrawSetClipRectangles( XFT_DRAW( __INST( sharedDrawId ) ) , 0, 0, &clipRX, 1);
     } else {
-        XftDrawSetClip( XFT_DRAW( __INST( drawId ) ) , 0);
+        XftDrawSetClip( XFT_DRAW( __INST( sharedDrawId ) ) , 0);
     }
 
     if (opaque == true) {
@@ -583,7 +583,7 @@
             XftTextExtents32( DISPLAY( displayId ), XFT_FONT( __INST( fontId ) ), (FcChar32*)string, len, &extents);
             break;
         }
-        XftDrawRect( XFT_DRAW ( __INST( drawId ) ), &color, __intVal(drawX) - extents.x, __intVal(drawY) - XFT_FONT( __INST( fontId ) )->ascent, extents.width, XFT_FONT(__INST (fontId ) )->height);
+        XftDrawRect( XFT_DRAW ( __INST( sharedDrawId ) ), &color, __intVal(drawX) - extents.x, __intVal(drawY) - XFT_FONT( __INST( fontId ) )->ascent, extents.width, XFT_FONT(__INST (fontId ) )->height);
     }
     if (fgPixel != nil) {
         color.pixel = (unsigned long)__intVal(fgPixel);
@@ -596,7 +596,7 @@
     // }
     switch (__bytesPerCharacter) {
     case 1:
-        XftDrawString8( XFT_DRAW ( __INST( drawId ) ), &color, XFT_FONT( __INST( fontId ) ),
+        XftDrawString8( XFT_DRAW ( __INST( sharedDrawId ) ), &color, XFT_FONT( __INST( fontId ) ),
                         __intVal(drawX),
                         __intVal(drawY),
                         (FcChar8*)string,
@@ -604,7 +604,7 @@
         RETURN ( self );
         break;
     case 2:
-        XftDrawString16( XFT_DRAW ( __INST( drawId ) ), &color, XFT_FONT( __INST( fontId ) ),
+        XftDrawString16( XFT_DRAW ( __INST( sharedDrawId ) ), &color, XFT_FONT( __INST( fontId ) ),
                         __intVal(drawX),
                         __intVal(drawY),
                         (FcChar16*)string,
@@ -612,7 +612,7 @@
         RETURN ( self );
         break;
     case 4:
-        XftDrawString32( XFT_DRAW ( __INST( drawId ) ), &color, XFT_FONT( __INST( fontId ) ),
+        XftDrawString32( XFT_DRAW ( __INST( sharedDrawId ) ), &color, XFT_FONT( __INST( fontId ) ),
                         __intVal(drawX),
                         __intVal(drawY),
                         (FcChar32*)string,
@@ -1571,9 +1571,9 @@
     drawableId isNil ifTrue: [ ^ self ].
 %{
 #ifdef XFT
-    if ( __INST(drawId) != nil ) {
-        if (XftDrawDrawable(XFT_DRAW(__INST(drawId))) == DRAWABLE(drawableId)) {
-            __INST(drawId) = nil;
+    if ( __INST(sharedDrawId) != nil ) {
+        if (XftDrawDrawable(XFT_DRAW(__INST(sharedDrawId))) == DRAWABLE(drawableId)) {
+            __INST(sharedDrawId) = nil;
             XftDrawDestroy(DRAWABLE(drawableId));
         }
     }
@@ -1591,14 +1591,14 @@
 
     device := nil.
     fontId := nil.
-    drawId := nil.
+    sharedDrawId := nil.
     closestFont := nil
 ! !
 
 !XftFontDescription methodsFor:'testing'!
 
 isUsed
-    ^ drawId notNil
+    ^ sharedDrawId notNil
 !
 
 isXftFont
@@ -1704,7 +1704,7 @@
     |page bits l min max minCode maxCode|
 
     [ l := pipeStream nextLine. l notEmpty ] whileTrue:[
-        "/ Transcript show:'->'; showCR:l. 
+        "/ Transcript show:'->'; showCR:l.
         (l startsWith:Character tab) ifFalse:[
             (l startsWith:'(') ifFalse:[self halt].
             currentDescription minCode:minCode.
@@ -1712,11 +1712,11 @@
             ^ self.
         ].
 
-        lineStream := l readStream. 
+        lineStream := l readStream.
         lineStream skipSeparators.
         page := Integer readFrom:(lineStream upTo:$:) radix:16.
         lineStream next.
-        bits := 0 to:7 collect:[:i| 
+        bits := 0 to:7 collect:[:i|
             lineStream skipSeparators.
             Integer readFrom:(lineStream upToSeparator) radix:16.
         ].
@@ -1725,12 +1725,12 @@
         minCode isNil ifTrue:[
             minCode := min.
             maxCode := max.
-        ] ifFalse:[ 
+        ] ifFalse:[
             minCode := minCode min:min.
             maxCode := maxCode max:max.
         ].
     ].
-    "/ currentDescription characterSet:(self getString).    
+    "/ currentDescription characterSet:(self getString).
     currentDescription minCode:minCode.
     currentDescription maxCode:maxCode.
 !
@@ -1853,22 +1853,22 @@
 
     xftStyle := self getString.
     (xftStyle includesString:'Bold') ifTrue:[
-        currentDescription face:'bold'.    
+        currentDescription face:'bold'.
         currentDescription style:'roman'.
         ^ self.
     ].
     (xftStyle includesString:'Italic') ifTrue:[
-        currentDescription face:'medium'.    
+        currentDescription face:'medium'.
         currentDescription style:'italic'.
         ^ self.
     ].
     (xftStyle includesString:'Oblique') ifTrue:[
-        currentDescription face:'medium'.    
+        currentDescription face:'medium'.
         currentDescription style:'italic'.
         ^ self.
     ].
 "/ self halt.
-    currentDescription face:'medium'.    
+    currentDescription face:'medium'.
     currentDescription style:'roman'.
 !
 
@@ -1920,11 +1920,11 @@
 !XftFontDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.43 2014-03-24 19:22:49 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.44 2014-04-01 13:26:51 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.43 2014-03-24 19:22:49 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XftFontDescription.st,v 1.44 2014-04-01 13:26:51 vrany Exp $'
 ! !